From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by dpdk.org (Postfix) with ESMTP id 4A7E7231C for ; Fri, 28 Nov 2014 15:06:12 +0100 (CET) Received: by mail-oi0-f43.google.com with SMTP id a3so4716361oib.2 for ; Fri, 28 Nov 2014 06:06:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=WBBJkwBIB3P197jgrEWkPkbEEPwQoGemH5qT0VfmIvA=; b=FTo3ShrqpkgIslIhhxLJgMp/F+IPr1KISG/r1OvSrgpqz6i67g+DHrMZ0u2VqUH8DC OZU8DL3odLFXggrr12X7ybtRs+zNOQN3nGz9hJaYNqRz6MQv9G8cTaFyu1NMHKjOaQIU 9iE+YgzsY9OIdKybIn77Is3o/2nZfWR0cL6L4CsgZ9vYtNi7msl4LSCLE9KiZdPjSDv4 OR2DlieHbiNmTv121uUvrGMTGP9OXhh/Kliqr6k/0gESoWHXfx29NLASFMG1Qwop8v1X 8nePF7l38X/gViXmmd2NfIsAJCFMf5aIk28s0FQ31m1rPm353Li+MlspfIPV9qp2GYam TJGQ== X-Gm-Message-State: ALoCoQnU/U/oZ8axRwCWEemfL3M4xTrgxDxVWtZYTQD0dWB45NzYKOhe/fRogOUI1AHO+qEbivWF MIME-Version: 1.0 X-Received: by 10.60.94.73 with SMTP id da9mr27794225oeb.10.1417183571534; Fri, 28 Nov 2014 06:06:11 -0800 (PST) Received: by 10.76.172.165 with HTTP; Fri, 28 Nov 2014 06:06:11 -0800 (PST) In-Reply-To: <20141128135604.GB5828@bricha3-MOBL3> References: <1417087745-9004-1-git-send-email-david.marchand@6wind.com> <4256507.tIOyuODinC@xps13> <20141128135604.GB5828@bricha3-MOBL3> Date: Fri, 28 Nov 2014 15:06:11 +0100 Message-ID: From: David Marchand To: Bruce Richardson Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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:06:12 -0000 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 */" -- David Marchand