]> granicus.if.org Git - php/commitdiff
lex optimizations
authorSascha Schumann <sas@php.net>
Sun, 27 Jun 1999 21:18:43 +0000 (21:18 +0000)
committerSascha Schumann <sas@php.net>
Sun, 27 Jun 1999 21:18:43 +0000 (21:18 +0000)
Makefile.in
configure.in.in

index 26c8d8cf50a6a0661f27897fd2d75d7455212a24..66e7768af6a774936c21968eef2c0593eef13b51 100644 (file)
@@ -61,6 +61,7 @@ MAINT = @MAINT@
 APXS = @APXS@
 APXS_LDFLAGS = $(EXTRA_LIBS) $(LIBS)
 WARNING_LEVEL = @WARNING_LEVEL@
+LEX_CFLAGS = -w$(WARNING_LEVEL) @LEX_CFLAGS@
 
 SOURCE = main.c internal_functions.c snprintf.c php3_sprintf.c \
        configuration-parser.c configuration-scanner.c request_info.c \
@@ -115,7 +116,7 @@ configuration-parser.h configuration-parser.c:      $(srcdir)/configuration-parser.y
        bison -p cfg -v -d $(srcdir)/configuration-parser.y -o configuration-parser.c
 
 configuration-scanner.o:       configuration-scanner.c
-       $(CC) $(CFLAGS) -w$(WARNING_LEVEL) -c configuration-scanner.c
+       $(CC) $(CFLAGS) $(LEX_CFLAGS) -c configuration-scanner.c
 
 configuration-scanner.c:       $(srcdir)/configuration-scanner.l
        flex -Pcfg -oconfiguration-scanner.c -i $(srcdir)/configuration-scanner.l
index e7c11631e9f6b0fa70f19fc5871113f51c258dc8..c410c1d29c416bc28abf7ebcddfc76e02d182e0b 100644 (file)
@@ -86,6 +86,16 @@ AC_PROG_CC_C_O
 AC_PROG_LN_S
 AC_PATH_PROG(PERL_PATH, perl)
 
+
+dnl Make flex scanners use const if they can, even if __STDC__ is not
+dnl true, for compilers like Sun's that only set __STDC__ true in
+dnl "limit-to-ANSI-standard" mode, not in "ANSI-compatible" mode
+AC_C_CONST
+if test "$ac_cv_c_const" = "yes" ; then
+  LEX_CFLAGS="-DYY_USE_CONST"
+fi
+AC_SUBST(LEX_CFLAGS)
+
 dnl Ugly hack to get around a problem with gcc on AIX.
 if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
    "`uname -sv`" = "AIX 4"; then