From: David Hunt <david.hunt@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, anatoly.burakov@intel.com,
David Hunt <david.hunt@intel.com>
Subject: [dpdk-dev] [PATCH v3] mk: fix make defconfig on FreeBSD
Date: Mon, 23 Apr 2018 14:09:02 +0100 [thread overview]
Message-ID: <20180423130902.183473-1-david.hunt@intel.com> (raw)
In-Reply-To: <20180410150804.8774-1-david.hunt@intel.com>
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
next prev parent reply other threads:[~2018-04-23 13:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-10 15:08 [dpdk-dev] [PATCH v1] " 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 ` [dpdk-dev] [PATCH v2] " David Hunt
2018-04-10 15:55 ` Burakov, Anatoly
2018-04-22 23:36 ` Thomas Monjalon
2018-04-23 13:09 ` David Hunt [this message]
2018-04-23 20:56 ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180423130902.183473-1-david.hunt@intel.com \
--to=david.hunt@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).