scripts: fix filtering of config comments on bsd
authorBruce Richardson <bruce.richardson@intel.com>
Wed, 18 Jun 2014 20:33:06 +0000 (21:33 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 18 Jun 2014 22:57:50 +0000 (00:57 +0200)
On BSD 10, the cpp binary behaves a little differently and often leaves
lines starting with a space before the inital '#' character. This change
ensures those lines are filtered out properly.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
scripts/gen-config-h.sh

index 86b41ab..efd7667 100755 (executable)
@@ -34,7 +34,7 @@
 echo "#ifndef __RTE_CONFIG_H"
 echo "#define __RTE_CONFIG_H"
 grep CONFIG_ $1                                                         \
 echo "#ifndef __RTE_CONFIG_H"
 echo "#define __RTE_CONFIG_H"
 grep CONFIG_ $1                                                         \
-| grep -v '^#'                                                  \
+| grep -v '^[ \t]*#'                                                    \
 | sed 's,CONFIG_\(.*\)=y.*$,#define \1 1,'                      \
 | sed 's,CONFIG_\(.*\)=n.*$,#undef \1,'                                 \
 | sed 's,CONFIG_\(.*\)=\(.*\)$,#define \1 \2,'                  \
 | sed 's,CONFIG_\(.*\)=y.*$,#define \1 1,'                      \
 | sed 's,CONFIG_\(.*\)=n.*$,#undef \1,'                                 \
 | sed 's,CONFIG_\(.*\)=\(.*\)$,#define \1 \2,'                  \