diff options
author | foobar <sniper@php.net> | 2005-02-24 18:11:36 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2005-02-24 18:11:36 +0000 |
commit | 2a6da0f24cbd04361c044c1cdf6b6b30d08a245e (patch) | |
tree | 09677e3ea8561d2f4854f79fc86ed3c894493757 | |
parent | 129a8a760765fe2996c63ca3bddcca228f3a48d4 (diff) | |
download | php-git-2a6da0f24cbd04361c044c1cdf6b6b30d08a245e.tar.gz |
- Restructured and added a few comments here and there.
- Made macros of couple of tests previously littering configure.in
(e.g. PHP_PROG_AWK, PHP_PROG_LEX, PHP_PROG_BISON..)
- Moved all PHP_SUBST() calls into their respective macros.
(no point adding empty entries in Makefile if macro is not used)
-rw-r--r-- | acinclude.m4 | 2153 | ||||
-rw-r--r-- | configure.in | 125 | ||||
-rw-r--r-- | scripts/phpize.m4 | 7 |
3 files changed, 1254 insertions, 1031 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index dd83f1684c..0001967d7d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,27 +1,80 @@ +dnl dnl $Id$ dnl dnl This file contains local autoconf functions. +dnl + +dnl ------------------------------------------------------------------------- +dnl Output stylize macros for configure (help/runtime) +dnl ------------------------------------------------------------------------- -dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile[, ext_srcdir[, ext_builddir]]]) dnl -dnl Processes a file called Makefile.frag in the source directory -dnl of the most recently added extension. $(srcdir) and $(builddir) -dnl are substituted with the proper paths. Can be used to supply -dnl custom rules and/or additional targets. +dnl PHP_HELP_SEPARATOR(title) dnl -AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[ - ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1) - ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2) - ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3) - sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments +dnl Adds separator title into the configure --help display. +dnl +AC_DEFUN([PHP_HELP_SEPARATOR],[ +AC_ARG_ENABLE([],[ +$1 +],[]) ]) -AC_DEFUN([PHP_PROG_RE2C],[ - AC_CHECK_PROG(RE2C, re2c, re2c, [exit 0;]) +dnl +dnl PHP_CONFIGURE_PART(title) +dnl +dnl Adds separator title configure output (idea borrowed from mm) +dnl +AC_DEFUN([PHP_CONFIGURE_PART],[ + AC_MSG_RESULT() + AC_MSG_RESULT([${T_MD}$1${T_ME}]) ]) +dnl ------------------------------------------------------------------------- +dnl Build system helper macros +dnl ------------------------------------------------------------------------- + +dnl +dnl PHP_DEF_HAVE(what) +dnl +dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [ ])' +dnl +AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_-,A-Z__), 1, [ ])]) + +dnl +dnl PHP_RUN_ONCE(namespace, variable, code) +dnl +dnl execute code, if variable is not set in namespace +dnl +AC_DEFUN([PHP_RUN_ONCE],[ + changequote({,}) + unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'` + changequote([,]) + cmd="echo $ac_n \"\$$1$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then + eval "$1$unique=set" + $3 + fi +]) + +dnl +dnl PHP_EXPAND_PATH(path, variable) +dnl +dnl expands path to an absolute path and assigns it to variable +dnl +AC_DEFUN([PHP_EXPAND_PATH],[ + if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then + $2=$1 + else + changequote({,}) + ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`" + changequote([,]) + ep_realdir="`(cd \"$ep_dir\" && pwd)`" + $2="$ep_realdir/`basename \"$1\"`" + fi +]) -dnl PHP_DEFINE(WHAT[, value[, directory]]) +dnl +dnl PHP_DEFINE(WHAT [, value[, directory]]) dnl dnl Creates builddir/include/what.h and in there #define WHAT value dnl @@ -29,6 +82,43 @@ AC_DEFUN([PHP_DEFINE],[ [echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h] ]) +dnl +dnl PHP_SUBST(varname) +dnl +dnl Adds variable with it's value into Makefile, e.g.: +dnl CC = gcc +dnl +AC_DEFUN([PHP_SUBST],[ + PHP_VAR_SUBST="$PHP_VAR_SUBST $1" +]) + +dnl +dnl PHP_SUBST_OLD(varname) +dnl +dnl Same as PHP_SUBST() but also substitutes all @VARNAME@ +dnl instances in every file passed to AC_OUTPUT() +dnl +AC_DEFUN([PHP_SUBST_OLD],[ + PHP_SUBST($1) + AC_SUBST($1) +]) + +dnl +dnl PHP_OUTPUT(file) +dnl +dnl Adds "file" to the list of files generated by AC_OUTPUT +dnl This macro can be used several times. +dnl +AC_DEFUN([PHP_OUTPUT],[ + PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" +]) + + +dnl ------------------------------------------------------------------------- +dnl Build system base macros +dnl ------------------------------------------------------------------------- + +dnl dnl PHP_CANONICAL_HOST_TARGET dnl AC_DEFUN([PHP_CANONICAL_HOST_TARGET],[ @@ -43,6 +133,7 @@ AC_DEFUN([PHP_CANONICAL_HOST_TARGET],[ fi ]) +dnl dnl PHP_INIT_BUILD_SYSTEM dnl AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[ @@ -55,6 +146,7 @@ pattern=define egrep $pattern'.*include/php' $srcdir/configure|sed 's/.*>//'|xargs touch 2>/dev/null ]) +dnl dnl PHP_GEN_GLOBAL_MAKEFILE dnl dnl Generates the global makefile. @@ -73,7 +165,23 @@ EOF cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile ]) -dnl PHP_ADD_SOURCES(source-path, sources[, special-flags[, type]]) +dnl +dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile [, ext_srcdir [, ext_builddir]]]) +dnl +dnl Processes a file called Makefile.frag in the source directory +dnl of the most recently added extension. $(srcdir) and $(builddir) +dnl are substituted with the proper paths. Can be used to supply +dnl custom rules and/or additional targets. +dnl +AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[ + ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1) + ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2) + ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3) + sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments +]) + +dnl +dnl PHP_ADD_SOURCES(source-path, sources [, special-flags [, type]]) dnl dnl Adds sources which are located relative to source-path to the dnl array of type type. Sources are processed with optional @@ -88,6 +196,7 @@ dnl which array to append to? AC_DEFUN([PHP_ADD_SOURCES],[ PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS))) ]) + dnl dnl _PHP_ASSIGN_BUILD_VARS(type) dnl internal, don't use @@ -110,12 +219,14 @@ ifelse($1,shared,[ b_lo=[$]$1_lo ]) +dnl dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]]) dnl dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the dnl name of the array target-var directly, as well as whether -dnl shared objects will be built from the sources. Should not be -dnl used directly. +dnl shared objects will be built from the sources. +dnl +dnl Should not be used directly. dnl AC_DEFUN([PHP_ADD_SOURCES_X],[ dnl relative to source- or build-directory? @@ -158,14 +269,9 @@ EOF done ]) -dnl -dnl Separator into the configure --help display. -dnl -AC_DEFUN([PHP_HELP_SEPARATOR],[ -AC_ARG_ENABLE([],[ -$1 -],[]) -]) +dnl ------------------------------------------------------------------------- +dnl Compiler characteristics checks +dnl ------------------------------------------------------------------------- dnl dnl PHP_TARGET_RDYNAMIC @@ -180,477 +286,19 @@ dnl AC_DEFUN([PHP_TARGET_RDYNAMIC],[ if test -n "$GCC"; then dnl we should use a PHP-specific macro here - TSRM_CHECK_GCC_ARG(-rdynamic, gcc_rdynamic=yes) + PHP_CHECK_GCC_ARG(-rdynamic, gcc_rdynamic=yes) if test "$gcc_rdynamic" = "yes"; then PHP_LDFLAGS="$PHP_LDFLAGS -rdynamic" fi fi ]) -AC_DEFUN([PHP_REMOVE_USR_LIB],[ - unset ac_new_flags - for i in [$]$1; do - case [$]i in - -L/usr/$PHP_LIBDIR|-L/usr/$PHP_LIBDIR/[)] ;; - *[)] ac_new_flags="[$]ac_new_flags [$]i" ;; - esac - done - $1=[$]ac_new_flags -]) - -dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD) dnl -dnl Use this macro, if you need to add libraries and or library search -dnl paths to the PHP build system which are only given in compiler -dnl notation. +dnl PHP_RUNPATH_SWITCH dnl -AC_DEFUN([PHP_EVAL_LIBLINE],[ - for ac_i in $1; do - case $ac_i in - -l*[)] - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_LIBRARY($ac_ii,1,$2) - ;; - -L*[)] - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_LIBPATH($ac_ii,$2) - ;; - esac - done -]) - -dnl PHP_EVAL_INCLINE(LINE) -dnl -dnl Use this macro, if you need to add header search paths to the PHP -dnl build system which are only given in compiler notation. +dnl Checks for -R, etc. switch dnl -AC_DEFUN([PHP_EVAL_INCLINE],[ - for ac_i in $1; do - case $ac_i in - -I*[)] - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_INCLUDE($ac_ii) - ;; - esac - done -]) - -AC_DEFUN([PHP_READDIR_R_TYPE],[ - dnl HAVE_READDIR_R is also defined by libmysql - AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no) - if test "$ac_cv_func_readdir_r" = "yes"; then - AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[ - AC_TRY_RUN([ -#define _REENTRANT -#include <sys/types.h> -#include <dirent.h> - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - -main() { - DIR *dir; - char entry[sizeof(struct dirent)+PATH_MAX]; - struct dirent *pentry = (struct dirent *) &entry; - - dir = opendir("/"); - if (!dir) - exit(1); - if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) - exit(0); - exit(1); -} - ],[ - ac_cv_what_readdir_r=POSIX - ],[ - AC_TRY_CPP([ -#define _REENTRANT -#include <sys/types.h> -#include <dirent.h> -int readdir_r(DIR *, struct dirent *); - ],[ - ac_cv_what_readdir_r=old-style - ],[ - ac_cv_what_readdir_r=none - ]) - ],[ - ac_cv_what_readdir_r=none - ]) - ]) - case $ac_cv_what_readdir_r in - POSIX) - AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);; - old-style) - AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);; - esac - fi -]) - -AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[ - AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl - PHP_SUBST(SHLIB_SUFFIX_NAME) - SHLIB_SUFFIX_NAME=so - case $host_alias in - *hpux*[)] - SHLIB_SUFFIX_NAME=sl - ;; - *darwin*[)] - SHLIB_SUFFIX_NAME=dylib - ;; - esac -]) - -AC_DEFUN([PHP_DEBUG_MACRO],[ - DEBUG_LOG=$1 - cat >$1 <<X -CONFIGURE: $CONFIGURE_COMMAND -CC: $CC -CFLAGS: $CFLAGS -CPPFLAGS: $CPPFLAGS -CXX: $CXX -CXXFLAGS: $CXXFLAGS -INCLUDES: $INCLUDES -LDFLAGS: $LDFLAGS -LIBS: $LIBS -DLIBS: $DLIBS -SAPI: $PHP_SAPI -PHP_RPATHS: $PHP_RPATHS -uname -a: `uname -a` - -X - cat >conftest.$ac_ext <<X -main() -{ - exit(0); -} -X - (eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>$1 2>&1 - rm -fr conftest* -]) - -AC_DEFUN([PHP_DOES_PWRITE_WORK],[ - AC_TRY_RUN([ -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> -#include <errno.h> -$1 - main() { - int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); - - if (fd < 0) exit(1); - if (pwrite(fd, "text", 4, 0) != 4) exit(1); - /* Linux glibc breakage until 2.2.5 */ - if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); - exit(0); - } - - ],[ - ac_cv_pwrite=yes - ],[ - ac_cv_pwrite=no - ],[ - ac_cv_pwrite=no - ]) -]) - -AC_DEFUN([PHP_DOES_PREAD_WORK],[ - echo test > conftest_in - AC_TRY_RUN([ -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> -#include <errno.h> -$1 - main() { - char buf[3]; - int fd = open("conftest_in", O_RDONLY); - if (fd < 0) exit(1); - if (pread(fd, buf, 2, 0) != 2) exit(1); - /* Linux glibc breakage until 2.2.5 */ - if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); - exit(0); - } - ],[ - ac_cv_pread=yes - ],[ - ac_cv_pread=no - ],[ - ac_cv_pread=no - ]) - rm -f conftest_in -]) - -AC_DEFUN([PHP_PWRITE_TEST],[ - AC_CACHE_CHECK(whether pwrite works,ac_cv_pwrite,[ - PHP_DOES_PWRITE_WORK - if test "$ac_cv_pwrite" = "no"; then - PHP_DOES_PWRITE_WORK([ssize_t pwrite(int, void *, size_t, off64_t);]) - if test "$ac_cv_pwrite" = "yes"; then - ac_cv_pwrite=64 - fi - fi - ]) - - if test "$ac_cv_pwrite" != "no"; then - AC_DEFINE(HAVE_PWRITE, 1, [ ]) - if test "$ac_cv_pwrite" = "64"; then - AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]) - fi - fi -]) - -AC_DEFUN([PHP_PREAD_TEST],[ - AC_CACHE_CHECK(whether pread works,ac_cv_pread,[ - PHP_DOES_PREAD_WORK - if test "$ac_cv_pread" = "no"; then - PHP_DOES_PREAD_WORK([ssize_t pread(int, void *, size_t, off64_t);]) - if test "$ac_cv_pread" = "yes"; then - ac_cv_pread=64 - fi - fi - ]) - - if test "$ac_cv_pread" != "no"; then - AC_DEFINE(HAVE_PREAD, 1, [ ]) - if test "$ac_cv_pread" = "64"; then - AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]) - fi - fi -]) - -AC_DEFUN([PHP_MISSING_TIME_R_DECL],[ - AC_MSG_CHECKING([for missing declarations of reentrant functions]) - AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[ - : - ],[ - AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) - ]) - AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[ - : - ],[ - AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) - ]) - AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[ - : - ],[ - AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) - ]) - AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[ - : - ],[ - AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) - ]) - AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[ - : - ],[ - AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) - ]) - AC_MSG_RESULT([done]) -]) - -dnl -dnl PHP_LIBGCC_LIBPATH(gcc) -dnl Stores the location of libgcc in libgcc_libpath -dnl -AC_DEFUN([PHP_LIBGCC_LIBPATH],[ - changequote({,}) - libgcc_libpath=`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'` - changequote([,]) -]) - -AC_DEFUN([PHP_ARG_ANALYZE_EX],[ -ext_output="yes, shared" -ext_shared=yes -case [$]$1 in -shared,*[)] - $1=`echo "[$]$1"|sed 's/^shared,//'` - ;; -shared[)] - $1=yes - ;; -no[)] - ext_output=no - ext_shared=no - ;; -*[)] - ext_output=yes - ext_shared=no - ;; -esac - -PHP_ALWAYS_SHARED([$1]) -]) - -AC_DEFUN([PHP_ARG_ANALYZE],[ -ifelse([$3],yes,[PHP_ARG_ANALYZE_EX([$1])],[ext_output=ifelse([$]$1,,no,[$]$1)]) -ifelse([$2],,,[AC_MSG_RESULT([$ext_output])]) -]) - -dnl -dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val[, extension-or-not]]) -dnl Sets PHP_ARG_NAME either to the user value or to the default value. -dnl default-val defaults to no. This will also set the variable ext_shared, -dnl and will overwrite any previous variable of that name. -dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run -dnl the PHP_ARG_ANALYZE_EX. -dnl -AC_DEFUN([PHP_ARG_WITH],[ -PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_),[ifelse($5,,yes,$5)]) -]) - -AC_DEFUN([PHP_REAL_ARG_WITH],[ -ifelse([$2],,,[AC_MSG_CHECKING([$2])]) -AC_ARG_WITH($1,[$3],$5=[$]withval, -[ - $5=ifelse($4,,no,$4) - - if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then - $5=$PHP_ENABLE_ALL - fi -]) -PHP_ARG_ANALYZE($5,[$2],$6) -]) - -dnl -dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val[, extension-or-not]]) -dnl Sets PHP_ARG_NAME either to the user value or to the default value. -dnl default-val defaults to no. This will also set the variable ext_shared, -dnl and will overwrite any previous variable of that name. -dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run -dnl the PHP_ARG_ANALYZE_EX. -dnl -AC_DEFUN([PHP_ARG_ENABLE],[ -PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_),[ifelse($5,,yes,$5)]) -]) - -AC_DEFUN([PHP_REAL_ARG_ENABLE],[ -ifelse([$2],,,[AC_MSG_CHECKING([$2])]) -AC_ARG_ENABLE($1,[$3],$5=[$]enableval, -[ - $5=ifelse($4,,no,$4) - - if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then - $5=$PHP_ENABLE_ALL - fi -]) -PHP_ARG_ANALYZE($5,[$2],$6) -]) - -AC_DEFUN([PHP_MODULE_PTR],[ - EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1," -]) - -AC_DEFUN([PHP_CONFIG_NICE],[ - test -f $1 && mv $1 $1.old - rm -f $1.old - cat >$1<<EOF -#! /bin/sh -# -# Created by configure - -EOF - - for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS CC CXX; do - eval val=\$$var - if test -n "$val"; then - echo "$var='$val' \\" >> $1 - fi - done - - for arg in [$]0 "[$]@"; do - echo "'[$]arg' \\" >> $1 - done - echo '"[$]@"' >> $1 - chmod +x $1 -]) - -AC_DEFUN([PHP_TIME_R_TYPE],[ -AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[ -AC_TRY_RUN([ -#include <time.h> - -main() { -char buf[27]; -struct tm t; -time_t old = 0; -int r, s; - -s = gmtime_r(&old, &t); -r = (int) asctime_r(&t, buf, 26); -if (r == s && s == 0) return (0); -return (1); -} -],[ - ac_cv_time_r_type=hpux -],[ - AC_TRY_RUN([ -#include <time.h> -main() { - struct tm t, *s; - time_t old = 0; - char buf[27], *p; - - s = gmtime_r(&old, &t); - p = asctime_r(&t, buf, 26); - if (p == buf && s == &t) return (0); - return (1); -} - ],[ - ac_cv_time_r_type=irix - ],[ - ac_cv_time_r_type=POSIX - ]) -],[ - ac_cv_time_r_type=POSIX -]) -]) - case $ac_cv_time_r_type in - hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; - irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; - esac -]) - -AC_DEFUN([PHP_SUBST],[ - PHP_VAR_SUBST="$PHP_VAR_SUBST $1" -]) - -AC_DEFUN([PHP_SUBST_OLD],[ - PHP_SUBST($1) - AC_SUBST($1) -]) - -AC_DEFUN([PHP_TM_GMTOFF],[ -AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, -[AC_TRY_COMPILE([#include <sys/types.h> -#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], - ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) - -if test "$ac_cv_struct_tm_gmtoff" = yes; then - AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm]) -fi -]) - -dnl PHP_CONFIGURE_PART(MESSAGE) -dnl Idea borrowed from mm -AC_DEFUN([PHP_CONFIGURE_PART],[ - AC_MSG_RESULT() - AC_MSG_RESULT([${T_MD}$1${T_ME}]) -]) - -AC_DEFUN([PHP_PROG_SENDMAIL],[ -PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib -AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:$PHP_ALT_PATH) -if test -n "$PROG_SENDMAIL"; then - AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail]) -fi -]) - AC_DEFUN([PHP_RUNPATH_SWITCH],[ -dnl check for -R, etc. switch AC_MSG_CHECKING([if compiler supports -R]) AC_CACHE_VAL(php_cv_cc_dashr,[ SAVE_LIBS=$LIBS @@ -677,166 +325,100 @@ else fi ]) -AC_DEFUN([PHP_STRUCT_FLOCK],[ -AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, - AC_TRY_COMPILE([ -#include <unistd.h> -#include <fcntl.h> - ], - [struct flock x;], - [ - ac_cv_struct_flock=yes - ],[ - ac_cv_struct_flock=no - ]) -) -if test "$ac_cv_struct_flock" = "yes" ; then - AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock]) -fi -]) - -AC_DEFUN([PHP_SOCKLEN_T],[ -AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, - AC_TRY_COMPILE([ -#include <sys/types.h> -#include <sys/socket.h> -],[ -socklen_t x; -],[ - ac_cv_socklen_t=yes -],[ - ac_cv_socklen_t=no -])) -if test "$ac_cv_socklen_t" = "yes"; then - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) -fi -]) - -dnl -dnl PHP_SET_SYM_FILE(path) -dnl -dnl set the path of the file which contains the symbol export list -dnl -AC_DEFUN([PHP_SET_SYM_FILE], -[ - PHP_SYM_FILE=$1 -]) - dnl -dnl PHP_BUILD_THREAD_SAFE +dnl PHP_CHECK_GCC_ARG(arg, action-if-found, action-if-not-found) dnl -AC_DEFUN([PHP_BUILD_THREAD_SAFE],[ - enable_maintainer_zts=yes - if test "$pthreads_working" != "yes"; then - AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.]) +AC_DEFUN([PHP_CHECK_GCC_ARG],[ + gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_) + AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [ + echo 'void somefunc() { };' > conftest.c + cmd='$CC $1 -c conftest.c' + if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then + ac_result=no + else + ac_result=yes fi -]) - -AC_DEFUN([PHP_REQUIRE_CXX],[ - if test -z "$php_cxx_done"; then - AC_PROG_CXX - AC_PROG_CXXCPP - php_cxx_done=yes + eval $gcc_arg_name=$ac_result + rm -f conftest.* + ]) + if eval test "\$$gcc_arg_name" = "yes"; then + $2 + else + : + $3 fi ]) dnl -dnl PHP_BUILD_SHARED -dnl -AC_DEFUN([PHP_BUILD_SHARED],[ - PHP_BUILD_PROGRAM - OVERALL_TARGET=libphp5.la - php_build_target=shared - - php_c_pre=$shared_c_pre - php_c_meta=$shared_c_meta - php_c_post=$shared_c_post - php_cxx_pre=$shared_cxx_pre - php_cxx_meta=$shared_cxx_meta - php_cxx_post=$shared_cxx_post - php_lo=$shared_lo -]) - +dnl PHP_LIBGCC_LIBPATH(gcc) dnl -dnl PHP_BUILD_STATIC +dnl Stores the location of libgcc in libgcc_libpath dnl -AC_DEFUN([PHP_BUILD_STATIC],[ - PHP_BUILD_PROGRAM - OVERALL_TARGET=libphp5.la - php_build_target=static +AC_DEFUN([PHP_LIBGCC_LIBPATH],[ + changequote({,}) + libgcc_libpath=`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'` + changequote([,]) ]) -dnl -dnl PHP_BUILD_BUNDLE -dnl -AC_DEFUN([PHP_BUILD_BUNDLE],[ - PHP_BUILD_PROGRAM - OVERALL_TARGET=libs/libphp5.bundle - php_build_target=static -]) +dnl ------------------------------------------------------------------------- +dnl Macros to modify LIBS, INCLUDES, etc. variables +dnl ------------------------------------------------------------------------- dnl -dnl PHP_BUILD_PROGRAM +dnl PHP_REMOVE_USR_LIB(NAME) dnl -AC_DEFUN([PHP_BUILD_PROGRAM],[ - OVERALL_TARGET=[]ifelse($1,,php,$1) - php_c_pre='$(CC)' - php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)' - php_c_post=' && echo > $[@]' - php_cxx_pre='$(CXX)' - php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)' - php_cxx_post=' && echo > $[@]' - php_lo=o - - case $with_pic in - yes) pic_setting='-prefer-pic';; - no) pic_setting='-prefer-non-pic';; - esac - - shared_c_pre='$(LIBTOOL) --mode=compile $(CC)' - shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting - shared_c_post= - shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)' - shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting - shared_cxx_post= - shared_lo=lo - - php_build_target=program +dnl Removes all -L/usr/$PHP_LIBDIR entries from variable NAME +dnl +AC_DEFUN([PHP_REMOVE_USR_LIB],[ + unset ac_new_flags + for i in [$]$1; do + case [$]i in + -L/usr/$PHP_LIBDIR|-L/usr/$PHP_LIBDIR/[)] ;; + *[)] ac_new_flags="[$]ac_new_flags [$]i" ;; + esac + done + $1=[$]ac_new_flags ]) dnl -dnl PHP_RUN_ONCE(namespace, variable, code) +dnl PHP_EVAL_LIBLINE(libline, SHARED-LIBADD) dnl -dnl execute code, if variable is not set in namespace +dnl Use this macro, if you need to add libraries and or library search +dnl paths to the PHP build system which are only given in compiler +dnl notation. dnl -AC_DEFUN([PHP_RUN_ONCE],[ - changequote({,}) - unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'` - changequote([,]) - cmd="echo $ac_n \"\$$1$unique$ac_c\"" - if test -n "$unique" && test "`eval $cmd`" = "" ; then - eval "$1$unique=set" - $3 - fi +AC_DEFUN([PHP_EVAL_LIBLINE],[ + for ac_i in $1; do + case $ac_i in + -l*[)] + ac_ii=`echo $ac_i|cut -c 3-` + PHP_ADD_LIBRARY($ac_ii,1,$2) + ;; + -L*[)] + ac_ii=`echo $ac_i|cut -c 3-` + PHP_ADD_LIBPATH($ac_ii,$2) + ;; + esac + done ]) dnl -dnl PHP_EXPAND_PATH(path, variable) +dnl PHP_EVAL_INCLINE(headerline) dnl -dnl expands path to an absolute path and assigns it to variable +dnl Use this macro, if you need to add header search paths to the PHP +dnl build system which are only given in compiler notation. dnl -AC_DEFUN([PHP_EXPAND_PATH],[ - if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then - $2=$1 - else - changequote({,}) - ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`" - changequote([,]) - ep_realdir="`(cd \"$ep_dir\" && pwd)`" - $2="$ep_realdir/`basename \"$1\"`" - fi +AC_DEFUN([PHP_EVAL_INCLINE],[ + for ac_i in $1; do + case $ac_i in + -I*[)] + ac_ii=`echo $ac_i|cut -c 3-` + PHP_ADD_INCLUDE($ac_ii) + ;; + esac + done ]) -dnl + dnl internal, don't use AC_DEFUN([_PHP_ADD_LIBPATH_GLOBAL],[ PHP_RUN_ONCE(LIBPATH, $1, [ @@ -847,10 +429,9 @@ AC_DEFUN([_PHP_ADD_LIBPATH_GLOBAL],[ ])dnl dnl dnl +dnl PHP_ADD_LIBPATH(path [, SHARED-LIBADD]) dnl -dnl PHP_ADD_LIBPATH(path[, shared-libadd]) -dnl -dnl add a library to linkpath/runpath +dnl Adds a path to linkpath/runpath (LDFLAGS) dnl AC_DEFUN([PHP_ADD_LIBPATH],[ if test "$1" != "/usr/$PHP_LIBDIR"; then @@ -909,7 +490,7 @@ AC_DEFUN([PHP_ADD_INCLUDE],[ ]) fi ]) -dnl + dnl internal, don't use AC_DEFUN([_PHP_X_ADD_LIBRARY],[dnl ifelse([$2],,$3="-l$1 [$]$3", $3="[$]$3 -l$1") dnl @@ -932,7 +513,6 @@ AC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[ ])dnl dnl dnl -dnl dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]]) dnl dnl add a library to the link line @@ -944,7 +524,7 @@ AC_DEFUN([PHP_ADD_LIBRARY],[ dnl dnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]]) dnl -dnl add a library to the link line (deferred) +dnl add a library to the link line (deferred, not used during configure) dnl AC_DEFUN([PHP_ADD_LIBRARY_DEFER],[ _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY_DEFER],[DLIBS]) @@ -1007,7 +587,7 @@ dnl dnl add a (Darwin / Mac OS X) framework to the link dnl line. if before is 1, the framework is added dnl to the beginning of the line. - +dnl AC_DEFUN([PHP_ADD_FRAMEWORK], [ PHP_RUN_ONCE(FRAMEWORKS, $1, [ if test "$2"; then @@ -1028,7 +608,7 @@ dnl /System/Library/Frameworks, so these don't need dnl to be specifically added. if before is 1, the dnl framework path is added to the beginning of the dnl relevant lines. - +dnl AC_DEFUN([PHP_ADD_FRAMEWORKPATH], [ PHP_EXPAND_PATH($1, ai_p) PHP_RUN_ONCE(FRAMEWORKPATH, $ai_p, [ @@ -1043,14 +623,17 @@ AC_DEFUN([PHP_ADD_FRAMEWORKPATH], [ dnl dnl PHP_ADD_FRAMEWORK_WITH_PATH(framework, path) dnl -dnl add a (Darwin / Mac OS X) framework path and the +dnl Adds a (Darwin / Mac OS X) framework path and the dnl framework itself to the link and include lines. +dnl AC_DEFUN([PHP_ADD_FRAMEWORK_WITH_PATH], [ PHP_ADD_FRAMEWORKPATH($2) PHP_ADD_FRAMEWORK($1) ]) dnl +dnl PHP_SET_LIBTOOL_VARIABLE(var) +dnl dnl Set libtool variable dnl AC_DEFUN([PHP_SET_LIBTOOL_VARIABLE],[ @@ -1061,115 +644,196 @@ AC_DEFUN([PHP_SET_LIBTOOL_VARIABLE],[ fi ]) +dnl ------------------------------------------------------------------------- +dnl Wrapper macros for AC_ARG_WITH / AC_ARG_ENABLE +dnl ------------------------------------------------------------------------- + +dnl PHP_ARG_ANALYZE_EX +dnl internal +AC_DEFUN([PHP_ARG_ANALYZE_EX],[ +ext_output="yes, shared" +ext_shared=yes +case [$]$1 in +shared,*[)] + $1=`echo "[$]$1"|sed 's/^shared,//'` + ;; +shared[)] + $1=yes + ;; +no[)] + ext_output=no + ext_shared=no + ;; +*[)] + ext_output=yes + ext_shared=no + ;; +esac + +PHP_ALWAYS_SHARED([$1]) +]) + +dnl PHP_ARG_ANALYZE +dnl internal +AC_DEFUN([PHP_ARG_ANALYZE],[ +ifelse([$3],yes,[PHP_ARG_ANALYZE_EX([$1])],[ext_output=ifelse([$]$1,,no,[$]$1)]) +ifelse([$2],,,[AC_MSG_RESULT([$ext_output])]) +]) + dnl -dnl Check for cc option +dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val[, extension-or-not]]) +dnl Sets PHP_ARG_NAME either to the user value or to the default value. +dnl default-val defaults to no. This will also set the variable ext_shared, +dnl and will overwrite any previous variable of that name. +dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run +dnl the PHP_ARG_ANALYZE_EX. dnl -AC_DEFUN([PHP_CHECK_CC_OPTION],[ - echo "main(){return 0;}" > conftest.$ac_ext - opt=$1 - changequote({,}) - var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'` - changequote([,]) - AC_MSG_CHECKING([if compiler supports -$1 really]) - ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1" - if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then - eval php_cc_$var=no - AC_MSG_RESULT([no]) - else - if eval ./conftest 2>/dev/null ; then - eval php_cc_$var=yes - AC_MSG_RESULT([yes]) - else - eval php_cc_$var=no - AC_MSG_RESULT([no]) - fi +AC_DEFUN([PHP_ARG_WITH],[ +PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_),[ifelse($5,,yes,$5)]) +]) + +dnl PHP_REAL_ARG_WITH +dnl internal +AC_DEFUN([PHP_REAL_ARG_WITH],[ +ifelse([$2],,,[AC_MSG_CHECKING([$2])]) +AC_ARG_WITH($1,[$3],$5=[$]withval, +[ + $5=ifelse($4,,no,$4) + + if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then + $5=$PHP_ENABLE_ALL fi - rm -rf conftest* +]) +PHP_ARG_ANALYZE($5,[$2],$6) ]) -AC_DEFUN([PHP_REGEX],[ +dnl +dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val[, extension-or-not]]) +dnl Sets PHP_ARG_NAME either to the user value or to the default value. +dnl default-val defaults to no. This will also set the variable ext_shared, +dnl and will overwrite any previous variable of that name. +dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run +dnl the PHP_ARG_ANALYZE_EX. +dnl +AC_DEFUN([PHP_ARG_ENABLE],[ +PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_),[ifelse($5,,yes,$5)]) +]) -if test "$REGEX_TYPE" = "php"; then - AC_DEFINE(HSREGEX,1,[ ]) - AC_DEFINE(REGEX,1,[ ]) - PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c) -elif test "$REGEX_TYPE" = "system"; then - AC_DEFINE(REGEX,0,[ ]) -fi +dnl PHP_REAL_ARG_ENABLE +dnl internal +AC_DEFUN([PHP_REAL_ARG_ENABLE],[ +ifelse([$2],,,[AC_MSG_CHECKING([$2])]) +AC_ARG_ENABLE($1,[$3],$5=[$]enableval, +[ + $5=ifelse($4,,no,$4) -AC_MSG_CHECKING([which regex library to use]) -AC_MSG_RESULT([$REGEX_TYPE]) + if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then + $5=$PHP_ENABLE_ALL + fi ]) +PHP_ARG_ANALYZE($5,[$2],$6) +]) + +dnl ------------------------------------------------------------------------- +dnl Build macros +dnl ------------------------------------------------------------------------- dnl -dnl See if we have broken header files like SunOS has. +dnl PHP_SET_SYM_FILE(path) dnl -AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[ - AC_MSG_CHECKING([for fclose declaration]) - AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[ - AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) - AC_MSG_RESULT([ok]) - ],[ - AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) - AC_MSG_RESULT([missing]) - ]) +dnl set the path of the file which contains the symbol export list +dnl +AC_DEFUN([PHP_SET_SYM_FILE], +[ + PHP_SYM_FILE=$1 ]) dnl -dnl Check for broken sprintf(), C99 conformance +dnl PHP_BUILD_THREAD_SAFE dnl -AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ - AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes - ],[ - ac_cv_broken_sprintf=no - ]) - ]) - if test "$ac_cv_broken_sprintf" = "yes"; then - AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [Whether sprintf is C99 conform]) - else - AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [Whether sprintf is C99 conform]) +AC_DEFUN([PHP_BUILD_THREAD_SAFE],[ + enable_maintainer_zts=yes + if test "$pthreads_working" != "yes"; then + AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.]) fi ]) dnl -dnl Check for broken snprintf(), C99 conformance +dnl PHP_REQUIRE_CXX dnl -AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[ - AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ - AC_TRY_RUN([ -#define NULL (0L) -main() { - char buf[20]; - int res = 0; - res = res || (snprintf(buf, 2, "marcus") != 6); - res = res || (buf[1] != '\0'); - /* Implementations may consider this as an encoding error */ - snprintf(buf, 0, "boerger"); - /* However, they MUST ignore the pointer */ - res = res || (buf[0] != 'm'); - res = res || (snprintf(NULL, 0, "boerger") != 7); - res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8); - exit(res); -} - ],[ - ac_cv_broken_snprintf=no - ],[ - ac_cv_broken_snprintf=yes - ],[ - ac_cv_broken_snprintf=no - ]) - ]) - if test "$ac_cv_broken_snprintf" = "yes"; then - AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform]) - else - AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform]) +AC_DEFUN([PHP_REQUIRE_CXX],[ + if test -z "$php_cxx_done"; then + AC_PROG_CXX + AC_PROG_CXXCPP + php_cxx_done=yes fi ]) +dnl +dnl PHP_BUILD_SHARED +dnl +AC_DEFUN([PHP_BUILD_SHARED],[ + PHP_BUILD_PROGRAM + OVERALL_TARGET=libphp5.la + php_build_target=shared + + php_c_pre=$shared_c_pre + php_c_meta=$shared_c_meta + php_c_post=$shared_c_post + php_cxx_pre=$shared_cxx_pre + php_cxx_meta=$shared_cxx_meta + php_cxx_post=$shared_cxx_post + php_lo=$shared_lo +]) + +dnl +dnl PHP_BUILD_STATIC +dnl +AC_DEFUN([PHP_BUILD_STATIC],[ + PHP_BUILD_PROGRAM + OVERALL_TARGET=libphp5.la + php_build_target=static +]) + +dnl +dnl PHP_BUILD_BUNDLE +dnl +AC_DEFUN([PHP_BUILD_BUNDLE],[ + PHP_BUILD_PROGRAM + OVERALL_TARGET=libs/libphp5.bundle + php_build_target=static +]) + +dnl +dnl PHP_BUILD_PROGRAM +dnl +AC_DEFUN([PHP_BUILD_PROGRAM],[ + OVERALL_TARGET=[]ifelse($1,,php,$1) + php_c_pre='$(CC)' + php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)' + php_c_post=' && echo > $[@]' + php_cxx_pre='$(CXX)' + php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)' + php_cxx_post=' && echo > $[@]' + php_lo=o + + case $with_pic in + yes) pic_setting='-prefer-pic';; + no) pic_setting='-prefer-non-pic';; + esac + + shared_c_pre='$(LIBTOOL) --mode=compile $(CC)' + shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting + shared_c_post= + shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)' + shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting + shared_cxx_post= + shared_lo=lo + + php_build_target=program +]) + +dnl dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx) dnl dnl Basically sets up the link-stage for building module-name @@ -1290,6 +954,436 @@ dnl ---------------------------------------------- CLI static module ]) dnl +dnl PHP_WITH_SHARED +dnl +dnl Checks whether $withval is "shared" or starts with "shared,XXX" +dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff +dnl from $withval. +dnl +AC_DEFUN([PHP_WITH_SHARED],[ + PHP_ARG_ANALYZE_EX(withval) + shared=$ext_shared + unset ext_shared ext_output +]) + +dnl +dnl PHP_ADD_EXTENSION_DEP(extname, depends [, depconf]) +dnl +dnl This macro is currently a placeholder in the config.m4 file +dnl it is scanned by genif.sh when it builds the internal functions +dnl list, so that modules can be init'd in the correct order +dnl $1 = name of extension, $2 = extension upon which it depends +dnl $3 = optional: if true, it's ok for $2 to have not been configured +dnl default is false and should halt the build. +dnl See ADD_EXTENSION_DEP in win32 build +dnl +AC_DEFUN([PHP_ADD_EXTENSION_DEP], []) + +dnl ------------------------------------------------------------------------- +dnl Checks for structures, typedefs, broken functions, etc. +dnl ------------------------------------------------------------------------- + +dnl +dnl PHP_CHECK_IN_ADDR_T +dnl +AC_DEFUN([PHP_CHECK_IN_ADDR_T], [ +dnl AIX keeps in_addr_t in /usr/include/netinet/in.h +AC_MSG_CHECKING([for in_addr_t]) +AC_CACHE_VAL(ac_cv_type_in_addr_t, +[AC_EGREP_CPP(dnl +changequote(<<,>>)dnl +<<in_addr_t[^a-zA-Z_0-9]>>dnl +changequote([,]), [#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl +AC_MSG_RESULT([$ac_cv_type_in_addr_t]) +if test $ac_cv_type_in_addr_t = no; then + AC_DEFINE(in_addr_t, u_int, [ ]) +fi +]) + +dnl +dnl PHP_TIME_R_TYPE +dnl +dnl Check type of reentrant time-related functions +dnl Type can be: irix, hpux or POSIX +dnl +AC_DEFUN([PHP_TIME_R_TYPE],[ +AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[ +AC_TRY_RUN([ +#include <time.h> + +main() { +char buf[27]; +struct tm t; +time_t old = 0; +int r, s; + +s = gmtime_r(&old, &t); +r = (int) asctime_r(&t, buf, 26); +if (r == s && s == 0) return (0); +return (1); +} +],[ + ac_cv_time_r_type=hpux +],[ + AC_TRY_RUN([ +#include <time.h> +main() { + struct tm t, *s; + time_t old = 0; + char buf[27], *p; + + s = gmtime_r(&old, &t); + p = asctime_r(&t, buf, 26); + if (p == buf && s == &t) return (0); + return (1); +} + ],[ + ac_cv_time_r_type=irix + ],[ + ac_cv_time_r_type=POSIX + ]) +],[ + ac_cv_time_r_type=POSIX +]) +]) + case $ac_cv_time_r_type in + hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; + irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; + esac +]) + +dnl +dnl PHP_DOES_PWRITE_WORK +dnl internal +AC_DEFUN([PHP_DOES_PWRITE_WORK],[ + AC_TRY_RUN([ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> +#include <errno.h> +$1 + main() { + int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); + + if (fd < 0) exit(1); + if (pwrite(fd, "text", 4, 0) != 4) exit(1); + /* Linux glibc breakage until 2.2.5 */ + if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); + exit(0); + } + + ],[ + ac_cv_pwrite=yes + ],[ + ac_cv_pwrite=no + ],[ + ac_cv_pwrite=no + ]) +]) + +dnl PHP_DOES_PREAD_WORK +dnl internal +AC_DEFUN([PHP_DOES_PREAD_WORK],[ + echo test > conftest_in + AC_TRY_RUN([ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> +#include <errno.h> +$1 + main() { + char buf[3]; + int fd = open("conftest_in", O_RDONLY); + if (fd < 0) exit(1); + if (pread(fd, buf, 2, 0) != 2) exit(1); + /* Linux glibc breakage until 2.2.5 */ + if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); + exit(0); + } + ],[ + ac_cv_pread=yes + ],[ + ac_cv_pread=no + ],[ + ac_cv_pread=no + ]) + rm -f conftest_in +]) + +dnl +dnl PHP_PWRITE_TEST +dnl +AC_DEFUN([PHP_PWRITE_TEST],[ + AC_CACHE_CHECK(whether pwrite works,ac_cv_pwrite,[ + PHP_DOES_PWRITE_WORK + if test "$ac_cv_pwrite" = "no"; then + PHP_DOES_PWRITE_WORK([ssize_t pwrite(int, void *, size_t, off64_t);]) + if test "$ac_cv_pwrite" = "yes"; then + ac_cv_pwrite=64 + fi + fi + ]) + + if test "$ac_cv_pwrite" != "no"; then + AC_DEFINE(HAVE_PWRITE, 1, [ ]) + if test "$ac_cv_pwrite" = "64"; then + AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]) + fi + fi +]) + +dnl +dnl PHP_PREAD_TEST +dnl +AC_DEFUN([PHP_PREAD_TEST],[ + AC_CACHE_CHECK(whether pread works,ac_cv_pread,[ + PHP_DOES_PREAD_WORK + if test "$ac_cv_pread" = "no"; then + PHP_DOES_PREAD_WORK([ssize_t pread(int, void *, size_t, off64_t);]) + if test "$ac_cv_pread" = "yes"; then + ac_cv_pread=64 + fi + fi + ]) + + if test "$ac_cv_pread" != "no"; then + AC_DEFINE(HAVE_PREAD, 1, [ ]) + if test "$ac_cv_pread" = "64"; then + AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]) + fi + fi +]) + +dnl +dnl PHP_MISSING_TIME_R_DECL +dnl +AC_DEFUN([PHP_MISSING_TIME_R_DECL],[ + AC_MSG_CHECKING([for missing declarations of reentrant functions]) + AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[ + : + ],[ + AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) + ]) + AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[ + : + ],[ + AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) + ]) + AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[ + : + ],[ + AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) + ]) + AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[ + : + ],[ + AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) + ]) + AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[ + : + ],[ + AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) + ]) + AC_MSG_RESULT([done]) +]) + +dnl +dnl PHP_READDIR_R_TYPE +dnl +AC_DEFUN([PHP_READDIR_R_TYPE],[ + dnl HAVE_READDIR_R is also defined by libmysql + AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no) + if test "$ac_cv_func_readdir_r" = "yes"; then + AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[ + AC_TRY_RUN([ +#define _REENTRANT +#include <sys/types.h> +#include <dirent.h> + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +main() { + DIR *dir; + char entry[sizeof(struct dirent)+PATH_MAX]; + struct dirent *pentry = (struct dirent *) &entry; + + dir = opendir("/"); + if (!dir) + exit(1); + if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) + exit(0); + exit(1); +} + ],[ + ac_cv_what_readdir_r=POSIX + ],[ + AC_TRY_CPP([ +#define _REENTRANT +#include <sys/types.h> +#include <dirent.h> +int readdir_r(DIR *, struct dirent *); + ],[ + ac_cv_what_readdir_r=old-style + ],[ + ac_cv_what_readdir_r=none + ]) + ],[ + ac_cv_what_readdir_r=none + ]) + ]) + case $ac_cv_what_readdir_r in + POSIX) + AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);; + old-style) + AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);; + esac + fi +]) + +dnl +dnl PHP_TM_GMTOFF +dnl +AC_DEFUN([PHP_TM_GMTOFF],[ +AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, +[AC_TRY_COMPILE([#include <sys/types.h> +#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], + ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) + +if test "$ac_cv_struct_tm_gmtoff" = yes; then + AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm]) +fi +]) + +dnl +dnl PHP_STRUCT_FLOCK +dnl +AC_DEFUN([PHP_STRUCT_FLOCK],[ +AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, + AC_TRY_COMPILE([ +#include <unistd.h> +#include <fcntl.h> + ], + [struct flock x;], + [ + ac_cv_struct_flock=yes + ],[ + ac_cv_struct_flock=no + ]) +) +if test "$ac_cv_struct_flock" = "yes" ; then + AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock]) +fi +]) + +dnl +dnl PHP_SOCKLEN_T +dnl +AC_DEFUN([PHP_SOCKLEN_T],[ +AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, + AC_TRY_COMPILE([ +#include <sys/types.h> +#include <sys/socket.h> +],[ +socklen_t x; +],[ + ac_cv_socklen_t=yes +],[ + ac_cv_socklen_t=no +])) +if test "$ac_cv_socklen_t" = "yes"; then + AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) +fi +]) + +dnl +dnl PHP_MISSING_FCLOSE_DECL +dnl +dnl See if we have broken header files like SunOS has. +dnl +AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[ + AC_MSG_CHECKING([for fclose declaration]) + AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[ + AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) + AC_MSG_RESULT([ok]) + ],[ + AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) + AC_MSG_RESULT([missing]) + ]) +]) + +dnl +dnl PHP_AC_BROKEN_SPRINTF +dnl +dnl Check for broken sprintf(), C99 conformance +dnl +AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ + AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ + AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ + ac_cv_broken_sprintf=no + ],[ + ac_cv_broken_sprintf=yes + ],[ + ac_cv_broken_sprintf=no + ]) + ]) + if test "$ac_cv_broken_sprintf" = "yes"; then + AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [Whether sprintf is C99 conform]) + else + AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [Whether sprintf is C99 conform]) + fi +]) + +dnl +dnl PHP_AC_BROKEN_SNPRINTF +dnl +dnl Check for broken snprintf(), C99 conformance +dnl +AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[ + AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ + AC_TRY_RUN([ +#define NULL (0L) +main() { + char buf[20]; + int res = 0; + res = res || (snprintf(buf, 2, "marcus") != 6); + res = res || (buf[1] != '\0'); + /* Implementations may consider this as an encoding error */ + snprintf(buf, 0, "boerger"); + /* However, they MUST ignore the pointer */ + res = res || (buf[0] != 'm'); + res = res || (snprintf(NULL, 0, "boerger") != 7); + res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8); + exit(res); +} + ],[ + ac_cv_broken_snprintf=no + ],[ + ac_cv_broken_snprintf=yes + ],[ + ac_cv_broken_snprintf=no + ]) + ]) + if test "$ac_cv_broken_snprintf" = "yes"; then + AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform]) + else + AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform]) + fi +]) + +dnl +dnl PHP_SOLARIS_PIC_WEIRDNESS +dnl dnl Solaris requires main code to be position independent in order dnl to let shared objects find symbols. Weird. Ugly. dnl @@ -1316,24 +1410,16 @@ AC_DEFUN([PHP_SOLARIS_PIC_WEIRDNESS],[ ]) dnl -dnl Checks whether $withval is "shared" or starts with "shared,XXX" -dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff -dnl from $withval. +dnl PHP_SYS_LFS dnl -AC_DEFUN([PHP_WITH_SHARED],[ - PHP_ARG_ANALYZE_EX(withval) - shared=$ext_shared - unset ext_shared ext_output -]) - dnl The problem is that the default compilation flags in Solaris 2.6 won't dnl let programs access large files; you need to tell the compiler that dnl you actually want your programs to work on large files. For more dnl details about this brain damage please see: dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - +dnl dnl Written by Paul Eggert <eggert@twinsun.com>. - +dnl AC_DEFUN([PHP_SYS_LFS], [dnl # If available, prefer support for large files unless the user specified @@ -1369,6 +1455,9 @@ AC_DEFUN([PHP_SYS_LFS], esac ]) +dnl +dnl PHP_SOCKADDR_SA_LEN +dnl AC_DEFUN([PHP_SOCKADDR_SA_LEN],[ AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ AC_TRY_COMPILE([#include <sys/types.h> @@ -1380,14 +1469,9 @@ AC_DEFUN([PHP_SOCKADDR_SA_LEN],[ ]) ]) - -dnl ## PHP_OUTPUT(file) -dnl ## adds "file" to the list of files generated by AC_OUTPUT -dnl ## This macro can be used several times. -AC_DEFUN([PHP_OUTPUT],[ - PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" -]) - +dnl +dnl PHP_DECLARED_TIMEZONE +dnl AC_DEFUN([PHP_DECLARED_TIMEZONE],[ AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[ AC_TRY_COMPILE([ @@ -1408,7 +1492,10 @@ AC_DEFUN([PHP_DECLARED_TIMEZONE],[ fi ]) -AC_DEFUN([PHP_EBCDIC],[ +dnl +dnl PHP_EBCDIC +dnl +AC_DEFUN([PHP_EBCDIC], [ AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ AC_TRY_RUN( [ int main(void) { @@ -1426,8 +1513,12 @@ int main(void) { fi ]) +dnl +dnl PHP_BROKEN_GETCWD +dnl dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if a dnl component of the path has execute but not read permissions +dnl AC_DEFUN([PHP_BROKEN_GETCWD],[ AC_MSG_CHECKING([for broken getcwd]) os=`uname -sr 2>/dev/null` @@ -1440,7 +1531,10 @@ AC_DEFUN([PHP_BROKEN_GETCWD],[ esac ]) -AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND],[ +dnl +dnl PHP_BROKEN_GLIBC_FOPEN_APPEND +dnl +AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND], [ AC_MSG_CHECKING([for broken libc stdio]) AC_CACHE_VAL(have_broken_glibc_fopen_append,[ AC_TRY_RUN([ @@ -1489,28 +1583,27 @@ choke me fi ]) +dnl +dnl PHP_FOPENCOOKIE +dnl +AC_DEFUN([PHP_FOPENCOOKIE], [ + AC_CHECK_FUNC(fopencookie, [have_glibc_fopencookie=yes]) -AC_DEFUN([PHP_FOPENCOOKIE],[ - AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ]) - - if test "$have_glibc_fopencookie" = "yes" ; then - dnl this comes in two flavors: - dnl newer glibcs (since 2.1.2 ? ) - dnl have a type called cookie_io_functions_t - AC_TRY_COMPILE([ #define _GNU_SOURCE - #include <stdio.h> - ], - [ cookie_io_functions_t cookie; ], - [ have_cookie_io_functions_t=yes ], - [] ) - - if test "$have_cookie_io_functions_t" = "yes" ; then - cookie_io_functions_t=cookie_io_functions_t - have_fopen_cookie=yes + if test "$have_glibc_fopencookie" = "yes"; then +dnl this comes in two flavors: +dnl newer glibcs (since 2.1.2 ? ) +dnl have a type called cookie_io_functions_t +AC_TRY_COMPILE([ +#define _GNU_SOURCE +#include <stdio.h> +], [cookie_io_functions_t cookie;], [have_cookie_io_functions_t=yes], []) - dnl even newer glibcs have a different seeker definition... + if test "$have_cookie_io_functions_t" = "yes"; then + cookie_io_functions_t=cookie_io_functions_t + have_fopen_cookie=yes - AC_TRY_RUN([ +dnl even newer glibcs have a different seeker definition... +AC_TRY_RUN([ #define _GNU_SOURCE #include <stdio.h> @@ -1538,36 +1631,35 @@ main() { exit(1); } - ], - [ cookie_io_functions_use_off64_t=yes ], - [ ] ) - - else - dnl older glibc versions (up to 2.1.2 ?) - dnl call it _IO_cookie_io_functions_t - AC_TRY_COMPILE([ #define _GNU_SOURCE - #include <stdio.h> - ], - [ _IO_cookie_io_functions_t cookie; ], - [ have_IO_cookie_io_functions_t=yes ], - [] ) - if test "$have_cookie_io_functions_t" = "yes" ; then - cookie_io_functions_t=_IO_cookie_io_functions_t - have_fopen_cookie=yes - fi - fi +], [cookie_io_functions_use_off64_t=yes], []) + + else - if test "$have_fopen_cookie" = "yes" ; then - AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) - AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) - if test "$cookie_io_functions_use_off64_t" = "yes" ; then - AC_DEFINE(COOKIE_SEEKER_USES_OFF64_T, 1, [ ]) - fi - fi +dnl older glibc versions (up to 2.1.2 ?) +dnl call it _IO_cookie_io_functions_t +AC_TRY_COMPILE([ +#define _GNU_SOURCE +#include <stdio.h> +], [ _IO_cookie_io_functions_t cookie; ], [have_IO_cookie_io_functions_t=yes], []) + if test "$have_cookie_io_functions_t" = "yes" ; then + cookie_io_functions_t=_IO_cookie_io_functions_t + have_fopen_cookie=yes + fi + fi - fi + if test "$have_fopen_cookie" = "yes" ; then + AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) + AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) + if test "$cookie_io_functions_use_off64_t" = "yes" ; then + AC_DEFINE(COOKIE_SEEKER_USES_OFF64_T, 1, [ ]) + fi + fi + fi ]) +dnl ------------------------------------------------------------------------- +dnl Library/function existance and build sanity checks +dnl ------------------------------------------------------------------------- dnl dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]]) @@ -1614,6 +1706,302 @@ AC_DEFUN([PHP_CHECK_FRAMEWORK], [ ]) dnl +dnl PHP_CHECK_FUNC_LIB(func, libs) +dnl +dnl This macro checks whether 'func' or '__func' exists +dnl in the specified library. +dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. +dnl This should be called in the ACTION-IF-NOT-FOUND part of PHP_CHECK_FUNC +dnl +dnl +dnl autoconf undefines the builtin "shift" :-( +dnl If possible, we use the builtin shift anyway, otherwise we use +dnl the ubercool definition I have tested so far with FreeBSD/GNU m4 +ifdef([builtin],[builtin(define, phpshift, [builtin(shift, $@)])],[ +define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])))])]) +]) +dnl +AC_DEFUN([PHP_CHECK_FUNC_LIB],[ + ifelse($2,,:,[ + unset ac_cv_lib_$2[]_$1 + unset ac_cv_lib_$2[]___$1 + unset found + AC_CHECK_LIB($2, $1, [found=yes], [ + AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) + ]) + + if test "$found" = "yes"; then + ac_libs=$LIBS + LIBS="$LIBS -l$2" + AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no]) + LIBS=$ac_libs + fi + + if test "$found" = "yes"; then + PHP_ADD_LIBRARY($2) + PHP_DEF_HAVE($1) + PHP_DEF_HAVE(lib$2) + ac_cv_func_$1=yes + else + PHP_CHECK_FUNC_LIB($1,phpshift(phpshift($@))) + fi + ]) +]) + +dnl +dnl PHP_CHECK_FUNC(func, ...) +dnl +dnl This macro checks whether 'func' or '__func' exists +dnl in the default libraries and as a fall back in the specified library. +dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. +dnl +AC_DEFUN([PHP_CHECK_FUNC],[ + unset ac_cv_func_$1 + unset ac_cv_func___$1 + unset found + + AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) + + case $found in + yes[)] + PHP_DEF_HAVE($1) + ac_cv_func_$1=yes + ;; + ifelse($#,1,,[ + *[)] PHP_CHECK_FUNC_LIB($@) ;; + ]) + esac +]) + +dnl +dnl PHP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs [, extra-source]]) +dnl +dnl This macro checks whether build works and given function exists. +dnl +AC_DEFUN([PHP_TEST_BUILD], [ + old_LIBS=$LIBS + LIBS="$4 $LIBS" + AC_TRY_RUN([ + $5 + char $1(); + int main() { + $1(); + return 0; + } + ], [ + LIBS=$old_LIBS + $2 + ],[ + LIBS=$old_LIBS + $3 + ],[ + LIBS=$old_LIBS + ]) +]) + +dnl ------------------------------------------------------------------------- +dnl Platform characteristics checks +dnl ------------------------------------------------------------------------- + +dnl +dnl PHP_SHLIB_SUFFIX_NAME +dnl +dnl Determines shared library suffix +dnl suffix can be: .so, .sl or .dylib +dnl +AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[ + AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl + PHP_SUBST(SHLIB_SUFFIX_NAME) + SHLIB_SUFFIX_NAME=so + case $host_alias in + *hpux*[)] + SHLIB_SUFFIX_NAME=sl + ;; + *darwin*[)] + SHLIB_SUFFIX_NAME=dylib + ;; + esac +]) + +dnl +dnl PHP_CHECK_64BIT([do if 32], [do if 64]) +dnl +dnl This macro is used to detect if we're at 64-bit platform or not. +dnl It could be useful for those external libs, that have different precompiled +dnl versions in different directories. +dnl +AC_DEFUN([PHP_CHECK_64BIT],[ + AC_CHECK_SIZEOF(long int) + AC_MSG_CHECKING([checking if we're at 64-bit platform]) + if test "$ac_cv_sizeof_long_int" = "4" ; then + AC_MSG_RESULT([no]) + $1 + else + AC_MSG_RESULT([yes]) + $2 + fi +]) + +dnl +dnl PHP_C_BIGENDIAN +dnl +dnl Replacement macro for AC_C_BIGENDIAN +dnl +AC_DEFUN([PHP_C_BIGENDIAN], +[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php, + [ + ac_cv_c_bigendian_php=unknown + AC_TRY_RUN( + [ +int main(void) +{ + short one = 1; + char *cp = (char *)&one; + + if (*cp == 0) { + return(0); + } else { + return(1); + } +} + ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown]) + ]) + if test $ac_cv_c_bigendian_php = yes; then + AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word]) + fi +]) + +dnl ------------------------------------------------------------------------- +dnl Checks for programs: PHP_PROG_<program> +dnl ------------------------------------------------------------------------- + +dnl +dnl PHP_PROG_SENDMAIL +dnl +dnl Search for the sendmail binary +dnl +AC_DEFUN([PHP_PROG_SENDMAIL], [ + PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib + AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:$PHP_ALT_PATH) + if test -n "$PROG_SENDMAIL"; then + AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail]) + fi + PHP_SUBST(PROG_SENDMAIL) +]) + +dnl +dnl PHP_PROG_AWK +dnl +dnl Some vendors force mawk before gawk; mawk is broken so we don't like that +dnl +AC_DEFUN([PHP_PROG_AWK], [ + AC_CHECK_PROGS(AWK, gawk nawk awk mawk, bork, /usr/xpg4/bin/:$PATH) + case "$AWK" in + *mawk) + AC_MSG_WARN([mawk is known to have problems on some systems. You should install GNU awk]) + ;; + *gawk) + ;; + bork) + AC_MSG_ERROR([Could not find awk; Install GNU awk]) + ;; + *) + AC_MSG_CHECKING([if $AWK is broken]) + if ! $AWK 'function foo() {}' >/dev/null 2>&1 ; then + AC_MSG_RESULT([yes]) + AC_MSG_ERROR([You should install GNU awk]) + else + AC_MSG_RESULT([no]) + fi + ;; + esac + PHP_SUBST(AWK) +]) + +dnl +dnl PHP_PROG_BISON +dnl +dnl Search for bison and check it's version +dnl +AC_DEFUN([PHP_PROG_BISON], [ + AC_PROG_YACC + if test "$YACC" != "bison -y"; then + AC_MSG_WARN([You will need bison 1.28, 1.35, 1.75 or 1.875 if you want to regenerate the Zend/PHP parsers.]) + else + AC_MSG_CHECKING([bison version]) + set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'|tr -d a-z` + if test "${1}" -ne "1" -o "(" "${2}" != "28" -a "${2}" != "35" -a "${2}" != "75" -a "${2}" != "875" ")"; then + AC_MSG_WARN([You will need bison 1.28, 1.35, 1.75 or 1.875 if you want to regenerate the Zend/PHP parsers (found ${1}.${2}).]) + fi + AC_MSG_RESULT(${1}.${2} (ok)) + fi + PHP_SUBST(YACC) +]) + +dnl +dnl PHP_PROG_LEX +dnl +dnl Search for (f)lex and check it's version +dnl +AC_DEFUN([PHP_PROG_LEX], [ + AC_PROG_LEX + if test -n "$LEX"; then + 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 + + AC_MSG_CHECKING([flex version]) + if test "$LEX" ;then + flexvers=`echo "" | $LEX -V -v --version 2>/dev/null | sed -e 's/^.* //' -e 's/\./ /g'` + if test ! -z "$flexvers"; then + set $flexvers + if test "${1}" != "2" -o "${2}" != "5" -o "${3}" != "4"; then + AC_MSG_WARN([You will need flex 2.5.4 if you want to regenerate Zend/PHP lexical parsers.]) + fi + fi + AC_MSG_RESULT(${1}.${2}.${3} (ok)) + else + AC_MSG_WARN([You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers.]) + fi + PHP_SUBST(LEX) +]) + +dnl +dnl PHP_PROG_RE2C +dnl +dnl Search for the re2c binary and check the version +dnl +AC_DEFUN([PHP_PROG_RE2C],[ + AC_CHECK_PROG(RE2C, re2c, re2c) + if test -n "$RE2C"; then + AC_MSG_CHECKING([re2c version]) + AC_CACHE_VAL(php_cv_re2c_version, [ + if test `echo "" | re2c --vernum 2>/dev/null` -lt "904"; then + AC_MSG_WARN([You will need re2c 0.94 or later if you want to regenerate PHP parsers.]) + php_cv_re2c_version=invalid + else + php_cv_re2c_version="`echo "" | re2c --version | cut -d ' ' -f 2 2>/dev/null` (ok)" + fi + ]) + AC_MSG_RESULT([$php_cv_re2c_version]) + else + AC_MSG_WARN([You will need re2c 0.94 or later if you want to regenerate PHP parsers.]) + fi + PHP_SUBST(RE2C) +]) + +dnl ------------------------------------------------------------------------- +dnl Common setup macros: PHP_SETUP_<what> +dnl ------------------------------------------------------------------------- + +dnl dnl PHP_SETUP_KERBEROS(shared-add [, action-found [, action-not-found]]) dnl dnl Common setup macro for kerberos @@ -1923,76 +2311,13 @@ ifelse([$3],[],,[else $3]) fi ]) -AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_-,A-Z__), 1, [ ])]) - -dnl -dnl PHP_CHECK_FUNC_LIB(func, libs) -dnl This macro checks whether 'func' or '__func' exists -dnl in the specified library. -dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. -dnl This should be called in the ACTION-IF-NOT-FOUND part of PHP_CHECK_FUNC -dnl - -dnl autoconf undefines the builtin "shift" :-( -dnl If possible, we use the builtin shift anyway, otherwise we use -dnl the ubercool definition I have tested so far with FreeBSD/GNU m4 -ifdef([builtin],[builtin(define, phpshift, [builtin(shift, $@)])],[ -define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])))])]) -]) - -AC_DEFUN([PHP_CHECK_FUNC_LIB],[ - ifelse($2,,:,[ - unset ac_cv_lib_$2[]_$1 - unset ac_cv_lib_$2[]___$1 - unset found - AC_CHECK_LIB($2, $1, [found=yes], [ - AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) - ]) - - if test "$found" = "yes"; then - ac_libs=$LIBS - LIBS="$LIBS -l$2" - AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no]) - LIBS=$ac_libs - fi - - if test "$found" = "yes"; then - PHP_ADD_LIBRARY($2) - PHP_DEF_HAVE($1) - PHP_DEF_HAVE(lib$2) - ac_cv_func_$1=yes - else - PHP_CHECK_FUNC_LIB($1,phpshift(phpshift($@))) - fi - ]) -]) - -dnl -dnl PHP_CHECK_FUNC(func, ...) -dnl This macro checks whether 'func' or '__func' exists -dnl in the default libraries and as a fall back in the specified library. -dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. -dnl -AC_DEFUN([PHP_CHECK_FUNC],[ - unset ac_cv_func_$1 - unset ac_cv_func___$1 - unset found - - AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) - - case $found in - yes[)] - PHP_DEF_HAVE($1) - ac_cv_func_$1=yes - ;; - ifelse($#,1,,[ - *[)] PHP_CHECK_FUNC_LIB($@) ;; - ]) - esac -]) +dnl ------------------------------------------------------------------------- +dnl Misc. macros +dnl ------------------------------------------------------------------------- dnl dnl PHP_AP_EXTRACT_VERSION(/path/httpd) +dnl dnl This macro is used to get a comparable dnl version for apache1/2. dnl @@ -2008,81 +2333,77 @@ IFS="- /. ]) dnl -dnl PHP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs [, extra-source]]) -dnl This macro checks whether build works and given function exists. -dnl -AC_DEFUN([PHP_TEST_BUILD], [ - old_LIBS=$LIBS - LIBS="$4 $LIBS" - AC_TRY_RUN([ - $5 - char $1(); - int main() { - $1(); - return 0; - } - ], [ - LIBS=$old_LIBS - $2 - ],[ - LIBS=$old_LIBS - $3 - ],[ - LIBS=$old_LIBS - ]) +dnl PHP_DEBUG_MACRO(filename) +dnl +AC_DEFUN([PHP_DEBUG_MACRO],[ + DEBUG_LOG=$1 + cat >$1 <<X +CONFIGURE: $CONFIGURE_COMMAND +CC: $CC +CFLAGS: $CFLAGS +CPPFLAGS: $CPPFLAGS +CXX: $CXX +CXXFLAGS: $CXXFLAGS +INCLUDES: $INCLUDES +LDFLAGS: $LDFLAGS +LIBS: $LIBS +DLIBS: $DLIBS +SAPI: $PHP_SAPI +PHP_RPATHS: $PHP_RPATHS +uname -a: `uname -a` + +X + cat >conftest.$ac_ext <<X +main() +{ + exit(0); +} +X + (eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>$1 2>&1 + rm -fr conftest* ]) -dnl This macro is currently a placeholder in the config.m4 file -dnl it is scanned by genif.sh when it builds the internal functions -dnl list, so that modules can be init'd in the correct order -dnl $1 = name of extension, $2 = extension upon which it depends -dnl $3 = optional: if true, it's ok for $2 to have not been configured -dnl default is false and should halt the build. -dnl See ADD_EXTENSION_DEP in win32 build -AC_DEFUN([PHP_ADD_EXTENSION_DEP], []) +dnl +dnl PHP_CONFIG_NICE(filename) +dnl +dnl Generates the config.nice file +dnl +AC_DEFUN([PHP_CONFIG_NICE],[ + test -f $1 && mv $1 $1.old + rm -f $1.old + cat >$1<<EOF +#! /bin/sh +# +# Created by configure +EOF -dnl PHP_CHECK_64BIT([do if 32], [do if 64]) -dnl This macro is used to detect if we're at 64-bit platform or not. -dnl It could be useful for those external libs, that have different precompiled -dnl versions in different directories. -AC_DEFUN([PHP_CHECK_64BIT],[ - AC_CHECK_SIZEOF(long int) - AC_MSG_CHECKING([checking if we're at 64-bit platform]) - if test "$ac_cv_sizeof_long_int" = "4" ; then - AC_MSG_RESULT([no]) - $1 - else - AC_MSG_RESULT([yes]) - $2 - fi + for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS CC CXX; do + eval val=\$$var + if test -n "$val"; then + echo "$var='$val' \\" >> $1 + fi + done + + for arg in [$]0 "[$]@"; do + echo "'[$]arg' \\" >> $1 + done + echo '"[$]@"' >> $1 + chmod +x $1 ]) dnl -dnl PHP_C_BIGENDIAN -dnl Replacement macro for AC_C_BIGENDIAN +dnl PHP_REGEX dnl -AC_DEFUN([PHP_C_BIGENDIAN], -[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php, - [ - ac_cv_c_bigendian_php=unknown - AC_TRY_RUN( - [ -int main(void) -{ - short one = 1; - char *cp = (char *)&one; +AC_DEFUN([PHP_REGEX],[ + if test "$REGEX_TYPE" = "php"; then + AC_DEFINE(HSREGEX,1,[ ]) + AC_DEFINE(REGEX,1,[ ]) + PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c) + elif test "$REGEX_TYPE" = "system"; then + AC_DEFINE(REGEX,0,[ ]) + fi - if (*cp == 0) { - return(0); - } else { - return(1); - } -} - ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown]) - ]) - if test $ac_cv_c_bigendian_php = yes; then - AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word]) - fi + AC_MSG_CHECKING([which regex library to use]) + AC_MSG_RESULT([$REGEX_TYPE]) ]) - diff --git a/configure.in b/configure.in index 96d8076829..04a03db48e 100644 --- a/configure.in +++ b/configure.in @@ -119,11 +119,8 @@ AC_PROG_CC_C_O dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf dnl AC_PROG_CC_STDC AC_PROG_CPP - AC_AIX - -dnl AC_PROG_CXX -dnl AC_PROG_CXXCPP +AC_PROG_LN_S dnl Support systems with system libraries in e.g. /usr/lib64 AC_ARG_WITH(libdir, @@ -133,75 +130,11 @@ AC_ARG_WITH(libdir, dnl check for -R, etc. switch PHP_RUNPATH_SWITCH +dnl Checks for some support/generator progs PHP_PROG_RE2C -AC_PROG_LN_S - -dnl Some vendors force mawk before gawk; mawk is broken so we don't like that, -dnl and check manually -dnl AC_PROG_AWK -AC_CHECK_PROGS(AWK, gawk nawk awk mawk, bork, /usr/xpg4/bin/:$PATH) -case "$AWK" in - *mawk) - AC_MSG_WARN([mawk is known to have problems on some systems. You should install GNU awk]) - ;; - *gawk) - ;; - bork) - AC_MSG_ERROR([Could not find awk; Install GNU awk]) - ;; - *) - AC_MSG_CHECKING([if $AWK is broken]) - if ! $AWK 'function foo() {}' >/dev/null 2>&1 ; then - AC_MSG_RESULT([yes]) - AC_MSG_ERROR([You should install GNU awk]) - else - AC_MSG_RESULT([no - good!]) - fi - ;; -esac - -AC_PROG_YACC -if test "$YACC" != "bison -y"; then - AC_MSG_WARN([You will need bison if you want to regenerate the PHP parsers.]) -else - AC_MSG_CHECKING([bison version]) - set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'|tr -d a-z` - if test "${1}" -ne "1" -o "(" "${2}" != "28" -a "${2}" != "35" -a "${2}" != "75" -a "${2}" != "875" ")"; then - AC_MSG_WARN([You will need bison 1.28, 1.35, 1.75 or 1.875 if you want to regenerate the Zend parser (found ${1}.${2}).]) - fi - AC_MSG_RESULT(${1}.${2} (ok)) -fi -AC_PROG_LEX -if test -n "$LEX"; then - 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 - -AC_MSG_CHECKING([flex version]) -if test "$LEX" ;then - flexvers=`echo "" | $LEX -V -v --version 2>/dev/null | - sed -e 's/^.* //' -e 's/\./ /g'` - if test ! -z "$flexvers"; then - set $flexvers - if test "${1}" != "2" -o "${2}" != "5" -o "${3}" != "4"; then - AC_MSG_WARN(You will need flex 2.5.4 if you want to regenerate Zend/PHP lexical parsers.) - fi - fi -AC_MSG_RESULT(${1}.${2}.${3} (ok)) -else - AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers.) -fi - -dnl Check whether byte ordering is bigendian -PHP_C_BIGENDIAN - +PHP_PROG_AWK +PHP_PROG_BISON +PHP_PROG_LEX dnl Platform-specific compile settings. dnl ------------------------------------------------------------------------- @@ -255,7 +188,6 @@ sinclude(Zend/Zend.m4) sinclude(TSRM/tsrm.m4) - divert(2) dnl ## Diversion 2 is where we set PHP-specific options and come up @@ -274,7 +206,6 @@ PHP_SAPI=default PHP_BUILD_PROGRAM - dnl SAPI configuration. dnl ------------------------------------------------------------------------- @@ -310,16 +241,20 @@ dnl ## includes what regex library is used and whether debugging or short dnl ## tags are enabled, and the default behaviour of php.ini options. - dnl Starting system checks. dnl ------------------------------------------------------------------------- PHP_CONFIGURE_PART(Running system checks) -PHP_MISSING_TIME_R_DECL +dnl Find sendmail binary PHP_PROG_SENDMAIL + dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset PHP_EBCDIC + +dnl Check whether the system byte ordering is bigendian +PHP_C_BIGENDIAN + dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary dnl and source packages. This should be harmless on other OSs. if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then @@ -369,7 +304,6 @@ dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT -PHP_MISSING_FCLOSE_DECL dnl QNX requires unix.h to allow functions in libunix to work properly AC_CHECK_HEADERS([ \ inttypes.h \ @@ -452,6 +386,9 @@ dnl ------------------------------------------------------------------------- AC_STRUCT_TM AC_STRUCT_TIMEZONE +PHP_MISSING_TIME_R_DECL +PHP_MISSING_FCLOSE_DECL + PHP_TM_GMTOFF PHP_STRUCT_FLOCK PHP_SOCKLEN_T @@ -506,8 +443,6 @@ AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support, #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;], [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])]) - - dnl Checks for library functions. dnl ------------------------------------------------------------------------- @@ -644,28 +579,7 @@ dnl PHP_AC_BROKEN_SNPRINTF PHP_DECLARED_TIMEZONE PHP_TIME_R_TYPE PHP_READDIR_R_TYPE - -dnl AIX keeps in_addr_t in /usr/include/netinet/in.h -dnl AC_MSG_CHECKING([for in_addr_t]) -AC_CACHE_VAL(ac_cv_type_$1, -[AC_EGREP_CPP(dnl -changequote(<<,>>)dnl -<<in_addr_t[^a-zA-Z_0-9]>>dnl -changequote([,]), [#include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl - -dnl AC_MSG_RESULT([$ac_cv_type_in_addr_t]) -if test $ac_cv_type_in_addr_t = no; then - AC_DEFINE(in_addr_t, u_int, [ ]) -fi - - +PHP_CHECK_IN_ADDR_T divert(4) @@ -1018,6 +932,7 @@ TSRM_BASIC_CHECKS if test "$PHP_THREAD_SAFETY" = "yes"; then TSRM_THREADS_CHECKS fi + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS" EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS" EXTRA_LIBS="$EXTRA_LIBS $LIBS" @@ -1164,7 +1079,6 @@ PHP_SUBST(localstatedir) PHP_SUBST(datadir) PHP_SUBST(sysconfdir) -PHP_SUBST(AWK) PHP_SUBST(CC) PHP_SUBST(CFLAGS) PHP_SUBST(CFLAGS_CLEAN) @@ -1174,7 +1088,6 @@ PHP_SUBST(CPPFLAGS) PHP_SUBST(CXX) PHP_SUBST(CXXFLAGS) PHP_SUBST(CXXFLAGS_CLEAN) -PHP_SUBST(CXX_PHP_COMPILE) PHP_SUBST_OLD(DEBUG_CFLAGS) PHP_SUBST(DEFS) PHP_SUBST_OLD(EXTENSION_DIR) @@ -1186,23 +1099,18 @@ PHP_SUBST_OLD(INCLUDES) PHP_SUBST_OLD(EXTRA_INCLUDES) PHP_SUBST_OLD(INCLUDE_PATH) PHP_SUBST_OLD(INSTALL_IT) -PHP_SUBST(LEX) -PHP_SUBST(LEX_OUTPUT_ROOT) PHP_SUBST(LFLAGS) PHP_SUBST(LIBTOOL) PHP_SUBST(LN_S) PHP_SUBST_OLD(NATIVE_RPATHS) PHP_SUBST_OLD(PEAR_INSTALLDIR) PHP_SUBST(PHP_BUILD_DATE) -PHP_SUBST(PHP_COMPILE) PHP_SUBST_OLD(PHP_LDFLAGS) PHP_SUBST_OLD(PHP_LIBS) PHP_SUBST(OVERALL_TARGET) PHP_SUBST(PHP_RPATHS) PHP_SUBST(PHP_SAPI) PHP_SUBST_OLD(PHP_VERSION) -PHP_SUBST(PROG_SENDMAIL) -PHP_SUBST(RE2C) PHP_SUBST(SHELL) PHP_SUBST(SHARED_LIBTOOL) PHP_SUBST(TSRM_DIR) @@ -1210,7 +1118,6 @@ PHP_SUBST(TSRM_LIB) PHP_SUBST(WARNING_LEVEL) PHP_SUBST(PHP_FRAMEWORKS) PHP_SUBST(PHP_FRAMEWORKPATH) -PHP_SUBST_OLD(YACC) PHP_SUBST_OLD(SHLIB_SUFFIX_NAME) old_CC=$CC diff --git a/scripts/phpize.m4 b/scripts/phpize.m4 index 303ea5cfe2..c6a57302a4 100644 --- a/scripts/phpize.m4 +++ b/scripts/phpize.m4 @@ -58,7 +58,7 @@ PHP_BUILD_SHARED AC_PREFIX_DEFAULT() PHP_PROG_RE2C -AC_PROG_AWK +PHP_PROG_AWK sinclude(config.m4) @@ -86,7 +86,6 @@ PHP_SUBST(libdir) PHP_SUBST(prefix) PHP_SUBST(phplibdir) -PHP_SUBST(PHP_COMPILE) PHP_SUBST(CC) PHP_SUBST(CFLAGS) PHP_SUBST(CFLAGS_CLEAN) @@ -98,15 +97,11 @@ PHP_SUBST(EXTENSION_DIR) PHP_SUBST(EXTRA_LDFLAGS) PHP_SUBST(EXTRA_LIBS) PHP_SUBST(INCLUDES) -PHP_SUBST(LEX) -PHP_SUBST(LEX_OUTPUT_ROOT) PHP_SUBST(LFLAGS) PHP_SUBST(LDFLAGS) PHP_SUBST(SHARED_LIBTOOL) PHP_SUBST(LIBTOOL) PHP_SUBST(SHELL) -PHP_SUBST(AWK) -PHP_SUBST(RE2C) PHP_GEN_BUILD_DIRS PHP_GEN_GLOBAL_MAKEFILE |