jani Mon Jul 21 10:31:37 2008 UTC Modified files: (Branch: PHP_5_3) /php-src acinclude.m4 Log: MFH: sync acinclude.m4 (leave the PHP_PROG_LEX for BC!) http://cvs.php.net/viewvc.cgi/php-src/acinclude.m4?r1=1.332.2.14.2.26.2.7&r2=1.332.2.14.2.26.2.8&diff_format=u Index: php-src/acinclude.m4 diff -u php-src/acinclude.m4:1.332.2.14.2.26.2.7 php-src/acinclude.m4:1.332.2.14.2.26.2.8 --- php-src/acinclude.m4:1.332.2.14.2.26.2.7 Thu Jul 3 07:46:17 2008 +++ php-src/acinclude.m4 Mon Jul 21 10:31:37 2008 @@ -1,5 +1,5 @@ dnl -dnl $Id: acinclude.m4,v 1.332.2.14.2.26.2.7 2008/07/03 07:46:17 tony2001 Exp $ +dnl $Id: acinclude.m4,v 1.332.2.14.2.26.2.8 2008/07/21 10:31:37 jani Exp $ dnl dnl This file contains local autoconf functions. dnl @@ -932,6 +932,8 @@ dnl be set to "cli" to mark extension build only with CLI or CGI sapi's. dnl "extra-cflags" are passed to the compiler, with dnl @ext_srcdir@ and @ext_builddir@ being substituted. +dnl "cxx" can be used to indicate that a C++ shared module is desired. +dnl "zend_ext" indicates a zend extension. AC_DEFUN([PHP_NEW_EXTENSION],[ ext_builddir=[]PHP_EXT_BUILDDIR($1) ext_srcdir=[]PHP_EXT_SRCDIR($1) @@ -2087,6 +2089,64 @@ ]) dnl +dnl PHP_PROG_LEX +dnl +dnl Search for (f)lex and check it's version +dnl +AC_DEFUN([PHP_PROG_LEX], [ +dnl we only support certain flex versions + flex_version_list="2.5.4" + + AC_PROG_LEX + if test "$LEX" = "flex"; then +dnl AC_DECL_YYTEXT is obsolete since autoconf 2.50 and merged into AC_PROG_LEX +dnl this is what causes that annoying "PHP_PROG_LEX is expanded from" warning with autoconf 2.50+ +dnl it should be removed once we drop support of autoconf 2.13 (if ever) + AC_DECL_YYTEXT + : + fi + 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 + + if test "$LEX" = "flex"; then + AC_CACHE_CHECK([for flex version], php_cv_flex_version, [ + flex_version=`$LEX -V -v --version 2>/dev/null | $SED -e 's/^.* //'` + php_cv_flex_version=invalid + for flex_check_version in $flex_version_list; do + if test "$flex_version" = "$flex_check_version"; then + php_cv_flex_version="$flex_check_version (ok)" + fi + done + ]) + else + flex_version=none + fi + + case $php_cv_flex_version in + ""|invalid[)] + if test -f "$abs_srcdir/Zend/zend_language_scanner.c" && test -f "$abs_srcdir/Zend/zend_ini_scanner.c"; then + AC_MSG_WARN([flex versions supported for regeneration of the Zend/PHP parsers: $flex_version_list (found: $flex_version)]) + else + flex_msg="Supported flex versions are: $flex_version_list" + if test "$flex_version" = "none"; then + flex_msg="flex not found. flex is required to generate the Zend/PHP parsers! $flex_msg" + else + flex_msg="Found invalid flex version: $flex_version. $flex_msg" + fi + AC_MSG_ERROR([$flex_msg]) + fi + LEX="exit 0;" + ;; + esac + PHP_SUBST(LEX) +]) + +dnl dnl PHP_PROG_RE2C dnl dnl Search for the re2c binary and check the version @@ -2646,12 +2706,18 @@ with-tsrm-pth | with-tsrm-st | with-tsrm-pthreads[)];; # Allow certain Zend options - with-zend-vm | enable-maintainer-zts | enable-zend-multibyte | enable-inline-optimization[)];; + with-zend-vm | enable-maintainer-zts | enable-inline-optimization[)];; # All the rest must be set using the PHP_ARG_* macros # PHP_ARG_* macros set php_enable_<arg_name> or php_with_<arg_name> *[)] # Options that exist before PHP 6 + if test "$PHP_MAJOR_VERSION" -lt "6"; then + case $arg_name in + enable-zend-multibyte[)] continue;; + esac + fi + is_arg_set=php_[]`echo [$]arg_name | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-' 'abcdefghijklmnopqrstuvwxyz_'` if eval test "x\$$is_arg_set" = "x"; then PHP_UNKNOWN_CONFIGURE_OPTIONS="$PHP_UNKNOWN_CONFIGURE_OPTIONS
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php