dnl This file contains Zend specific autoconf functions.
dnl
-AC_DEFUN([LIBZEND_BISON_CHECK],[
- if test "$YACC" = "bison -y"; then
- AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
- set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /' | tr -d 'a-z'`
- if test "${1}" = "1" -a "${2}" -lt "28"; then
- php_cv_bison_version=invalid
- else
- php_cv_bison_version="${1}.${2} (ok)"
- fi
- ])
- fi
- case $php_cv_bison_version in
- ""|invalid[)]
- AC_MSG_WARN([You will need bison 1.28, 1.35, 1.75 or 1.875 if you want to regenerate the Zend parsers (found ${1}.${2}).])
- YACC="exit 0;"
- ;;
- esac
-])
-
AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
AC_MSG_CHECKING(for $1)
AC_TRY_COMPILE([
dnl
dnl This file contains local autoconf functions.
+AC_DEFUN([LIBZEND_BISON_CHECK],[
+ # we only support certain bison versions
+ bison_version_list="1.28 1.35 1.75 2.0"
+
+ if test "$YACC" = "bison -y"; then
+ AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
+ set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /'|tr -d a-z`
+ bison_version="${1}.${2}"
+ php_cv_bison_version=invalid
+ for bison_check_version in $bison_version_list; do
+ if test "$bison_version" = "$bison_check_version"; then
+ php_cv_bison_version="$bison_check_version (ok)"
+ fi
+ done
+ ])
+ fi
+ case $php_cv_bison_version in
+ ""|invalid[)]
+ bison_msg="bison versions supported for regeneration of the Zend/PHP parsers: $bison_version_list (found $bison_version)."
+ AC_MSG_WARN([$bison_msg])
+ YACC="exit 0;"
+ ;;
+ esac
+])
+
AC_DEFUN([ZEND_FP_EXCEPT],[
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
AC_TRY_COMPILE([
dnl
AC_DEFUN([PHP_PROG_BISON], [
AC_PROG_YACC
- if test "$YACC" = "bison -y"; then
- AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
- set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /'|tr -d a-z`
- if test "(" "${1}" = "1" -a "(" "${2}" = "28" -o "${2}" = "35" -o "${2}" = "75" -o "${2}" = "875" ")" ")" -o "(" "${1}" = "2" -a "(" "${2}" = "0" ")" ")"; then
- php_cv_bison_version="${1}.${2} (ok)"
- else
- php_cv_bison_version=invalid
- fi
- ])
- fi
- case $php_cv_bison_version in
- ""|invalid[)]
- AC_MSG_WARN([You will need bison 1.28, 1.35, 1.75, 1.875 or 2.0 if you want to regenerate the Zend/PHP parsers (found ${1}.${2}).])
- YACC="exit 0;"
- ;;
- esac
+ LIBZEND_BISON_CHECK
PHP_SUBST(YACC)
])
dnl ## All of these are normally in the extension directories.
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
+dnl include Zend specific macro definitions first
+dnl -------------------------------------------------------------------------
+sinclude(Zend/acinclude.m4)
dnl Basic autoconf + automake initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
dnl Include Zend and TSRM configurations.
dnl -------------------------------------------------------------------------
-sinclude(Zend/acinclude.m4)
sinclude(Zend/Zend.m4)
sinclude(TSRM/tsrm.m4)