All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] mk: fix make defconfig on FreeBSD
@ 2018-04-10 15:08 David Hunt
  2018-04-10 15:28 ` Thomas Monjalon
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: David Hunt @ 2018-04-10 15:08 UTC (permalink / raw)
  To: dev; +Cc: thomas, David Hunt

Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 mk/rte.sdkconfig.mk | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index 0664725ee..7b1684375 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -36,6 +36,7 @@ notemplate:
 	@echo "use T=template from the following list:"
 	@$(MAKE) -rR showconfigs | sed 's,^,  ,'
 
+compiler:=$(filter clang gcc icc cc,$(shell ${CC} --version))
 
 .PHONY: defconfig
 defconfig:
@@ -47,15 +48,25 @@ defconfig:
                         print "arm-armv7a"} \
                 else if ($$0 == "ppc64") { \
                         print "ppc_64-power8"} \
+                else if ($$0 == "amd64") { \
+                        print "x86_64-native"} \
                 else { \
-                        printf "%s-native", $$0} }')-$(shell \
+                        printf "%s-native", $$0} }' \
+		)-$(shell \
                 uname | awk '{ \
                 if ($$0 == "Linux") { \
                         print "linuxapp"} \
                 else { \
-                        print "bsdapp"} }')-$(shell \
-                ${CC} -v 2>&1 | \
-                grep " version " | cut -d ' ' -f 1)
+                        print "bsdapp"} }' \
+		)-$(shell \
+		echo | awk -v compiler=${compiler} \
+		'{ \
+		if (compiler == "cc") \
+			{ print "gcc" } \
+		else \
+			{ print compiler } \
+		}' \
+		)
 
 .PHONY: config
 ifeq ($(RTE_CONFIG_TEMPLATE),)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v1] mk: fix make defconfig on FreeBSD
  2018-04-10 15:08 [PATCH v1] mk: fix make defconfig on FreeBSD David Hunt
@ 2018-04-10 15:28 ` Thomas Monjalon
  2018-04-10 15:52   ` Hunt, David
  2018-04-10 15:30 ` Burakov, Anatoly
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2018-04-10 15:28 UTC (permalink / raw)
  To: David Hunt; +Cc: dev

10/04/2018 17:08, David Hunt:
> Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>

I am sorry, I have to nack because the change is not explained.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v1] mk: fix make defconfig on FreeBSD
  2018-04-10 15:08 [PATCH v1] mk: fix make defconfig on FreeBSD David Hunt
  2018-04-10 15:28 ` Thomas Monjalon
@ 2018-04-10 15:30 ` Burakov, Anatoly
  2018-04-10 15:44 ` [PATCH v2] " David Hunt
  2018-04-23 13:09 ` [PATCH v3] " David Hunt
  3 siblings, 0 replies; 9+ messages in thread
From: Burakov, Anatoly @ 2018-04-10 15:30 UTC (permalink / raw)
  To: David Hunt, dev; +Cc: thomas

On 10-Apr-18 4:08 PM, David Hunt wrote:
> Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>
> ---

Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] mk: fix make defconfig on FreeBSD
  2018-04-10 15:08 [PATCH v1] mk: fix make defconfig on FreeBSD David Hunt
  2018-04-10 15:28 ` Thomas Monjalon
  2018-04-10 15:30 ` Burakov, Anatoly
@ 2018-04-10 15:44 ` David Hunt
  2018-04-10 15:55   ` Burakov, Anatoly
  2018-04-22 23:36   ` Thomas Monjalon
  2018-04-23 13:09 ` [PATCH v3] " David Hunt
  3 siblings, 2 replies; 9+ messages in thread
From: David Hunt @ 2018-04-10 15:44 UTC (permalink / raw)
  To: dev; +Cc: thomas, anatoly.burakov, David Hunt

On FreeBSD, make defconfig generates the config as "defconfig_x86_64-bsdapp-",
which does not resolve to any known config file.

This fix starts by introducing a 'compiler' variable which is set by executing
"${CC} --version" and pulling out the name of the compiler.

On FreeBDS, we get amd64 out of "uname -m", which was not handled by the list
of checks, but which now resolves to x86_64-native

The remaining code in the patch then takes ${compiler}, the "uname -m"
output and assembles them all together into a valid freebsd config name,
i.e. "defconfig_x86_64-native-bsdapp-clang"

Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 mk/rte.sdkconfig.mk | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index 0664725ee..7b1684375 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -36,6 +36,7 @@ notemplate:
 	@echo "use T=template from the following list:"
 	@$(MAKE) -rR showconfigs | sed 's,^,  ,'
 
+compiler:=$(filter clang gcc icc cc,$(shell ${CC} --version))
 
 .PHONY: defconfig
 defconfig:
@@ -47,15 +48,25 @@ defconfig:
                         print "arm-armv7a"} \
                 else if ($$0 == "ppc64") { \
                         print "ppc_64-power8"} \
+                else if ($$0 == "amd64") { \
+                        print "x86_64-native"} \
                 else { \
-                        printf "%s-native", $$0} }')-$(shell \
+                        printf "%s-native", $$0} }' \
+		)-$(shell \
                 uname | awk '{ \
                 if ($$0 == "Linux") { \
                         print "linuxapp"} \
                 else { \
-                        print "bsdapp"} }')-$(shell \
-                ${CC} -v 2>&1 | \
-                grep " version " | cut -d ' ' -f 1)
+                        print "bsdapp"} }' \
+		)-$(shell \
+		echo | awk -v compiler=${compiler} \
+		'{ \
+		if (compiler == "cc") \
+			{ print "gcc" } \
+		else \
+			{ print compiler } \
+		}' \
+		)
 
 .PHONY: config
 ifeq ($(RTE_CONFIG_TEMPLATE),)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v1] mk: fix make defconfig on FreeBSD
  2018-04-10 15:28 ` Thomas Monjalon
@ 2018-04-10 15:52   ` Hunt, David
  0 siblings, 0 replies; 9+ messages in thread
From: Hunt, David @ 2018-04-10 15:52 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev


On 10/4/2018 4:28 PM, Thomas Monjalon wrote:
> 10/04/2018 17:08, David Hunt:
>> Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")
>>
>> Signed-off-by: David Hunt <david.hunt@intel.com>
> I am sorry, I have to nack because the change is not explained.
>
>

Apologies, Thomas. I have now added an explanation of what's going on on 
the patch and pushed up a v2.

Regards,
Dave.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] mk: fix make defconfig on FreeBSD
  2018-04-10 15:44 ` [PATCH v2] " David Hunt
@ 2018-04-10 15:55   ` Burakov, Anatoly
  2018-04-22 23:36   ` Thomas Monjalon
  1 sibling, 0 replies; 9+ messages in thread
From: Burakov, Anatoly @ 2018-04-10 15:55 UTC (permalink / raw)
  To: David Hunt, dev; +Cc: thomas

On 10-Apr-18 4:44 PM, David Hunt wrote:
> On FreeBSD, make defconfig generates the config as "defconfig_x86_64-bsdapp-",
> which does not resolve to any known config file.
> 
> This fix starts by introducing a 'compiler' variable which is set by executing
> "${CC} --version" and pulling out the name of the compiler.
> 
> On FreeBDS, 

^^ FreeBSD :)

we get amd64 out of "uname -m", which was not handled by the list
> of checks, but which now resolves to x86_64-native

Probably should end with a period?

> 
> The remaining code in the patch then takes ${compiler}, the "uname -m"
> output and assembles them all together into a valid freebsd config name,
> i.e. "defconfig_x86_64-native-bsdapp-clang"

Same here, end with period?

> 
> Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>
> ---

Left out my Tested-by.

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] mk: fix make defconfig on FreeBSD
  2018-04-10 15:44 ` [PATCH v2] " David Hunt
  2018-04-10 15:55   ` Burakov, Anatoly
@ 2018-04-22 23:36   ` Thomas Monjalon
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2018-04-22 23:36 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, anatoly.burakov

10/04/2018 17:44, David Hunt:
> On FreeBSD, make defconfig generates the config as "defconfig_x86_64-bsdapp-",
> which does not resolve to any known config file.
> 
> This fix starts by introducing a 'compiler' variable which is set by executing
> "${CC} --version" and pulling out the name of the compiler.
[...]
> +compiler:=$(filter clang gcc icc cc,$(shell ${CC} --version))

You should not invoke a shell command outside of a rule.
Please try to move it inside the defconfig context.

Reason for this query?
1/ avoid polluting the rest of the makefile
2/ it breaks doc compilation

Why it breaks doc?
Because it breaks "make -R showversion" which is called in doc/guides/conf.py.
Tip: CC is not always defined :)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3] mk: fix make defconfig on FreeBSD
  2018-04-10 15:08 [PATCH v1] mk: fix make defconfig on FreeBSD David Hunt
                   ` (2 preceding siblings ...)
  2018-04-10 15:44 ` [PATCH v2] " David Hunt
@ 2018-04-23 13:09 ` David Hunt
  2018-04-23 20:56   ` Thomas Monjalon
  3 siblings, 1 reply; 9+ messages in thread
From: David Hunt @ 2018-04-23 13:09 UTC (permalink / raw)
  To: dev; +Cc: thomas, anatoly.burakov, David Hunt

On FreeBSD, make defconfig generates the config as
"defconfig_x86_64-bsdapp-", which does not resolve to any known
config file.

On FreeBSD, we get amd64 out of "uname -m", which was not handled by
the list of checks, but which now resolves to x86_64-native.

Then we run '$CC --version', and use grep -o with the list of known
compilers, and set to either gcc, icc or clang. Grep's '-o' option
returns the matched word rather than the whole line, making the
result easier to use.

The remaining code in the patch then takes ${compiler}, the "uname -m"
output and assembles them all together into a valid freebsd config name,
i.e. "defconfig_x86_64-native-bsdapp-clang".

v3 fixes:
   Removed the call to $CC outside of the defconfig rule.
   No longer breaks the 'make -R showversion'.
   Simplified working out the compiler name using grep -o.

Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")

Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
---
 mk/rte.sdkconfig.mk | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index 0664725ee..d90d62cc6 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -36,7 +36,6 @@ notemplate:
 	@echo "use T=template from the following list:"
 	@$(MAKE) -rR showconfigs | sed 's,^,  ,'
 
-
 .PHONY: defconfig
 defconfig:
 	@$(MAKE) config T=$(shell \
@@ -47,15 +46,25 @@ defconfig:
                         print "arm-armv7a"} \
                 else if ($$0 == "ppc64") { \
                         print "ppc_64-power8"} \
+                else if ($$0 == "amd64") { \
+                        print "x86_64-native"} \
                 else { \
-                        printf "%s-native", $$0} }')-$(shell \
+                        printf "%s-native", $$0} }' \
+		)-$(shell \
                 uname | awk '{ \
                 if ($$0 == "Linux") { \
                         print "linuxapp"} \
                 else { \
-                        print "bsdapp"} }')-$(shell \
-                ${CC} -v 2>&1 | \
-                grep " version " | cut -d ' ' -f 1)
+                        print "bsdapp"} }' \
+		)-$(shell \
+		${CC} --version | grep -o 'cc\|gcc\|icc\|clang' | awk \
+		'{ \
+		if ($$1 == "cc") { \
+			print "gcc" } \
+		else { \
+			print $$1 } \
+		}' \
+		)
 
 .PHONY: config
 ifeq ($(RTE_CONFIG_TEMPLATE),)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] mk: fix make defconfig on FreeBSD
  2018-04-23 13:09 ` [PATCH v3] " David Hunt
@ 2018-04-23 20:56   ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2018-04-23 20:56 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, anatoly.burakov

23/04/2018 15:09, David Hunt:
> On FreeBSD, make defconfig generates the config as
> "defconfig_x86_64-bsdapp-", which does not resolve to any known
> config file.
> 
> On FreeBSD, we get amd64 out of "uname -m", which was not handled by
> the list of checks, but which now resolves to x86_64-native.
> 
> Then we run '$CC --version', and use grep -o with the list of known
> compilers, and set to either gcc, icc or clang. Grep's '-o' option
> returns the matched word rather than the whole line, making the
> result easier to use.
> 
> The remaining code in the patch then takes ${compiler}, the "uname -m"
> output and assembles them all together into a valid freebsd config name,
> i.e. "defconfig_x86_64-native-bsdapp-clang".
> 
> v3 fixes:
>    Removed the call to $CC outside of the defconfig rule.
>    No longer breaks the 'make -R showversion'.
>    Simplified working out the compiler name using grep -o.
> 
> Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")
> 
> Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Signed-off-by: David Hunt <david.hunt@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-04-23 20:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 15:08 [PATCH v1] mk: fix make defconfig on FreeBSD David Hunt
2018-04-10 15:28 ` Thomas Monjalon
2018-04-10 15:52   ` Hunt, David
2018-04-10 15:30 ` Burakov, Anatoly
2018-04-10 15:44 ` [PATCH v2] " David Hunt
2018-04-10 15:55   ` Burakov, Anatoly
2018-04-22 23:36   ` Thomas Monjalon
2018-04-23 13:09 ` [PATCH v3] " David Hunt
2018-04-23 20:56   ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.