[asterisk-commits] qwell: branch 1.4 r262421 - /branches/1.4/pbx/Makefile

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 11 14:55:48 CDT 2010


Author: qwell
Date: Tue May 11 14:55:42 2010
New Revision: 262421

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=262421
Log:
Use a less silly method for modifying a flex-generated file.

The sed syntax that was used wasn't actually valid, causing some versions to
choke.  This is the method that is used in 1.6.x+ for similar changes.

(closes issue #16696)
Reported by: bklang
Patches: 
      16696-sedfix.diff uploaded by qwell (license 4)
Tested by: qwell

Modified:
    branches/1.4/pbx/Makefile

Modified: branches/1.4/pbx/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/pbx/Makefile?view=diff&rev=262421&r1=262420&r2=262421
==============================================================================
--- branches/1.4/pbx/Makefile (original)
+++ branches/1.4/pbx/Makefile Tue May 11 14:55:42 2010
@@ -50,8 +50,12 @@
 ael/ael_lex.c:
 endif
 	$(ECHO_PREFIX) echo "   [FLEX] $< -> $@"
-	$(CMD_PREFIX) (cd ael; $(FLEX) ael.flex; sed -i -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c)
-	$(CMD_PREFIX) (cd ael; sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ael_lex.c > zz; mv zz ael_lex.c)
+	$(CMD_PREFIX) (cd ael; $(FLEX) ael.flex)
+	$(CMD_PREFIX) sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' $@ > $@.fix
+	$(CMD_PREFIX) echo "#include \"asterisk.h\"" > $@
+	$(CMD_PREFIX) echo >> $@
+	$(CMD_PREFIX) cat $@.fix >> $@
+	$(CMD_PREFIX) rm $@.fix
 
 ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
 ael/ael.tab.c ael/ael.tab.h: ael/ael.y




More information about the asterisk-commits mailing list