summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-09-22 09:42:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:08 -0500
commitb15e7316a47b7c3e4ff6f477e270023f1a851a86 (patch)
treed63db4f1da4927240fa3652fd92accf72a223146
parent70b33dc533202cf52433c4e99fe2abb1c63a4f8f (diff)
downloadsamba-b15e7316a47b7c3e4ff6f477e270023f1a851a86.tar.gz
samba-b15e7316a47b7c3e4ff6f477e270023f1a851a86.tar.bz2
samba-b15e7316a47b7c3e4ff6f477e270023f1a851a86.zip
r25297: - fix sed arguments to make the replacement work
- always add #include "config.h" in the first line metze (This used to be commit 7939f847bfdda6977e7d04dc5a55e1333ade7b14)
-rwxr-xr-xsource4/script/lex_compile.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/script/lex_compile.sh b/source4/script/lex_compile.sh
index f655f81f2d..9bba7257b1 100755
--- a/source4/script/lex_compile.sh
+++ b/source4/script/lex_compile.sh
@@ -35,8 +35,14 @@ if cd $dir && $LEX $ARGS $file; then
if [ -r $base.yy.c ];then
# we must guarantee that config.h comes first
echo "#include \"config.h\"" > $base.c
- sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c >> $base.c
+ sed -e "s|$base\.yy\.c|$DEST|" $base.yy.c >> $base.c
rm -f $base.yy.c
+ elif [ -r $base.c ];then
+ # we must guarantee that config.h comes first
+ mv $base.c $base.c.tmp
+ echo "#include \"config.h\"" > $base.c
+ sed -e "s|$base\.yy\.c|$DEST|" $base.c.tmp >> $base.c
+ rm -f $base.c.tmp
elif [ ! -r base.c ]; then
echo "$base.c nor $base.yy.c generated."
exit 1