DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] scripts: fix symbol overriding in configuration files
Date: Fri, 28 Nov 2014 15:06:11 +0100	[thread overview]
Message-ID: <CALwxeUvRWYPmwSR4tuH9x8QYwR1AA6qnUarMu=wM-NrK+Aq-6w@mail.gmail.com> (raw)
In-Reply-To: <20141128135604.GB5828@bricha3-MOBL3>

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 <david.marchand@6wind.com>
> >
> > Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> >
> > 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

  reply	other threads:[~2014-11-28 14:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27 11:29 David Marchand
2014-11-27 18:17 ` Thomas Monjalon
2014-11-28 13:56   ` Bruce Richardson
2014-11-28 14:06     ` David Marchand [this message]
2014-11-28 14:37       ` Bruce Richardson
2014-11-28 14:43       ` Bruce Richardson
2014-11-28 14:49         ` David Marchand
2014-11-28 14:59           ` Bruce Richardson
2014-11-28 15:41             ` David Marchand
2014-11-28 15:42               ` [dpdk-dev] [PATCH] scripts: fix newline character in sed expression David Marchand
2014-11-28 15:49                 ` Bruce Richardson
2014-11-28 16:05                   ` Thomas Monjalon
2014-11-28 14:35     ` [dpdk-dev] [PATCH] scripts: fix merged lines on FreeBSD in config.h Bruce Richardson
2014-11-28 11:35 ` [dpdk-dev] [PATCH] scripts: fix symbol overriding in configuration files Bruce Richardson

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='CALwxeUvRWYPmwSR4tuH9x8QYwR1AA6qnUarMu=wM-NrK+Aq-6w@mail.gmail.com' \
    --to=david.marchand@6wind.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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).