From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1BE431518 for ; Fri, 28 Nov 2014 15:43:12 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 28 Nov 2014 06:40:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,477,1413270000"; d="scan'208";a="645065255" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.19]) by orsmga002.jf.intel.com with SMTP; 28 Nov 2014 06:43:09 -0800 Received: by (sSMTP sendmail emulation); Fri, 28 Nov 2014 14:43:09 +0025 Date: Fri, 28 Nov 2014 14:43:09 +0000 From: Bruce Richardson To: David Marchand Message-ID: <20141128144309.GB3412@bricha3-MOBL3> References: <1417087745-9004-1-git-send-email-david.marchand@6wind.com> <4256507.tIOyuODinC@xps13> <20141128135604.GB5828@bricha3-MOBL3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] scripts: fix symbol overriding in configuration files X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2014 14:43:13 -0000 On Fri, Nov 28, 2014 at 03:06:11PM +0100, David Marchand wrote: > Hello Bruce, > > On Fri, Nov 28, 2014 at 2:56 PM, Bruce Richardson < > bruce.richardson@intel.com> wrote: > > > On Thu, Nov 27, 2014 at 10:17:22AM -0800, Thomas Monjalon wrote: > > > > When redefining the same symbol in configuration (basically after an > > inclusion), > > > > we need to undefine the previous symbol to avoid "redefined" errors. > > > > > > > > Signed-off-by: David Marchand > > > > > > Acked-by: Thomas Monjalon > > > > > > Applied > > > > > This patch doesn't seem to work on FreeBSD. I'm still investigating how to > > fix > > it but right now compilation with gcc/clang on FreeBSD is broken due to the > > config.h file having lines like the below in it :-( > > > > /usr/home/bruce/ > > dpdk.org/x86_64-native-bsdapp-clang/include/rte_config.h:3:21: fatal > > error: extra tokens at end of #undef directive [-Wextra-tokens] > > #undef RTE_EXEC_ENVn#define RTE_EXEC_ENV "bsdapp" > > > > This is probably because of the \n in the sed. > > Can you try something like this (I did not like this version of my patch at > first because it is not that readable) ? > > > diff --git a/scripts/gen-config-h.sh b/scripts/gen-config-h.sh > index 2fac08c..d36efd6 100755 > --- a/scripts/gen-config-h.sh > +++ b/scripts/gen-config-h.sh > @@ -35,9 +35,11 @@ echo "#ifndef __RTE_CONFIG_H" > echo "#define __RTE_CONFIG_H" > grep CONFIG_ $1 | > grep -v '^[ \t]*#' | > -sed 's,CONFIG_\(.*\)=y.*$,#undef \1\n#define \1 1,' | > +sed 's,CONFIG_\(.*\)=y.*$,#undef \1\ > +#define \1 1,' | > sed 's,CONFIG_\(.*\)=n.*$,#undef \1,' | > -sed 's,CONFIG_\(.*\)=\(.*\)$,#undef \1\n#define \1 \2,' | > +sed 's,CONFIG_\(.*\)=\(.*\)$,#undef \1\ > +#define \1 \2,' | > sed 's,\# CONFIG_\(.*\) is not set$,#undef \1,' > echo "#endif /* __RTE_CONFIG_H */" > > This proposed fix also works. I don't mind whether my patch proposal or this fix gets applied - gen-config-h.sh is not a commonly modified script anyway. /Bruce