From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 02F6C1DBF for ; Mon, 23 Apr 2018 15:48:21 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2018 06:48:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,318,1520924400"; d="scan'208";a="34600608" Received: from silpixa00397898.ir.intel.com (HELO silpixa00397898.ger.corp.intel.com) ([10.237.222.61]) by fmsmga008.fm.intel.com with ESMTP; 23 Apr 2018 06:48:19 -0700 From: David Hunt To: dev@dpdk.org Cc: thomas@monjalon.net, anatoly.burakov@intel.com, David Hunt Date: Mon, 23 Apr 2018 14:09:02 +0100 Message-Id: <20180423130902.183473-1-david.hunt@intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180410150804.8774-1-david.hunt@intel.com> References: <20180410150804.8774-1-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v3] mk: fix make defconfig on FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 13:48:22 -0000 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 Signed-off-by: David Hunt --- 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