From 6504c241877aa7beaa19f54ccd506438acee2022 Mon Sep 17 00:00:00 2001 From: foobar Date: Sun, 3 Jun 2007 20:26:45 +0000 Subject: [PATCH] - Fixed bug #41576 (misbehaviour when using --without-apxs) --- sapi/apache/config.m4 | 86 ++++++++++++++++-------------- sapi/apache2filter/config.m4 | 15 ++++-- sapi/apache2handler/config.m4 | 15 ++++-- sapi/apache_hooks/config.m4 | 97 ++++++++++++++++++---------------- sapi/caudium/config.m4 | 30 ++++++----- sapi/embed/config.m4 | 28 +++++----- sapi/isapi/config.m4 | 33 +++++++----- sapi/milter/config.m4 | 21 ++++---- sapi/phttpd/config.m4 | 28 +++++----- sapi/pi3web/config.m4 | 16 +++--- sapi/roxen/config.m4 | 98 +++++++++++++++++++---------------- sapi/thttpd/config.m4 | 25 +++++---- sapi/tux/config.m4 | 22 ++++---- sapi/webjames/config.m4 | 24 +++++---- 14 files changed, 298 insertions(+), 240 deletions(-) diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 index a8e4782dff..796ab862fb 100644 --- a/sapi/apache/config.m4 +++ b/sapi/apache/config.m4 @@ -22,14 +22,20 @@ AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS) AC_ARG_WITH(apxs, [ --with-apxs[=FILE] Build shared Apache 1.x module. FILE is the optional pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then + PHP_APXS=$withval +],[ + PHP_APXS=no +]) + +if test "$PHP_APXS" != "no"; then + if test "$PHP_APXS" = "yes"; then APXS=apxs $APXS -q CFLAGS >/dev/null 2>&1 if test "$?" != "0" && test -x /usr/sbin/apxs; then #SUSE 6.x APXS=/usr/sbin/apxs fi else - PHP_EXPAND_PATH($withval, APXS) + PHP_EXPAND_PATH($PHP_APXS, APXS) fi $APXS -q CFLAGS >/dev/null 2>&1 @@ -113,36 +119,40 @@ AC_ARG_WITH(apxs, AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) AC_DEFINE(HAVE_APACHE,1,[ ]) AC_MSG_RESULT(yes) -],[ +else AC_MSG_RESULT(no) -]) +fi -if test "$PHP_SAPI" != "apache"; then AC_MSG_CHECKING(for Apache 1.x module support) AC_ARG_WITH(apache, [ --with-apache[=DIR] Build Apache 1.x module. DIR is the top-level Apache build directory [/usr/local/apache]],[ - - APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php.* sapi/apache/libphp6.module" - if test "$withval" = "yes"; then # Apache's default directory - withval=/usr/local/apache + PHP_APACHE=/usr/local/apache + else + PHP_APACHE=$withval fi - if test "$withval" != "no"; then +], [ + PHP_APACHE=no +]) + +if test "$PHP_SAPI" != "apache" && test "$PHP_APACHE" != "no"; then + APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php.* sapi/apache/libphp6.module" + + if test "$PHP_APACHE" != "no"; then AC_DEFINE(HAVE_APACHE,1,[ ]) APACHE_MODULE=yes - PHP_EXPAND_PATH($withval, withval) - + PHP_EXPAND_PATH($PHP_APACHE, PHP_APACHE) # For Apache 2.0.x - if test -f $withval/include/httpd.h && - test -f $withval/srclib/apr/include/apr_general.h ; then + if test -f $PHP_APACHE/include/httpd.h && + test -f $PHP_APACHE/srclib/apr/include/apr_general.h ; then AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) # For Apache 1.3.x - elif test -f $withval/src/main/httpd.h; then + elif test -f $PHP_APACHE/src/main/httpd.h; then APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$withval/src/main -I$withval/src/os/unix -I$withval/src/ap" - APACHE_TARGET=$withval/src/modules/php6 + APACHE_INCLUDE="-I$PHP_APACHE/src/main -I$PHP_APACHE/src/os/unix -I$PHP_APACHE/src/ap" + APACHE_TARGET=$PHP_APACHE/src/modules/php6 if test ! -d $APACHE_TARGET; then mkdir $APACHE_TARGET fi @@ -151,24 +161,24 @@ AC_ARG_WITH(apache, PHP_LIBS="-Lmodules/php6 -L../modules/php6 -L../../modules/php6 -lmodphp6" AC_MSG_RESULT(yes - Apache 1.3.x) STRONGHOLD= - if test -f $withval/src/include/ap_config.h; then + if test -f $PHP_APACHE/src/include/ap_config.h; then AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) fi - if test -f $withval/src/include/ap_compat.h; then + if test -f $PHP_APACHE/src/include/ap_compat.h; then AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then + if test ! -f $PHP_APACHE/src/include/ap_config_auto.h; then AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) fi else - if test -f $withval/src/include/compat.h; then + if test -f $PHP_APACHE/src/include/compat.h; then AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) fi fi # Also for Apache 1.3.x - elif test -f $withval/src/include/httpd.h; then + elif test -f $PHP_APACHE/src/include/httpd.h; then APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix" - APACHE_TARGET=$withval/src/modules/php6 + APACHE_INCLUDE="-I$PHP_APACHE/src/include -I$PHP_APACHE/src/os/unix" + APACHE_TARGET=$PHP_APACHE/src/modules/php6 if test ! -d $APACHE_TARGET; then mkdir $APACHE_TARGET fi @@ -177,52 +187,48 @@ AC_ARG_WITH(apache, APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp6.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" AC_MSG_RESULT(yes - Apache 1.3.x) STRONGHOLD= - if test -f $withval/src/include/ap_config.h; then + if test -f $PHP_APACHE/src/include/ap_config.h; then AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) fi - if test -f $withval/src/include/ap_compat.h; then + if test -f $PHP_APACHE/src/include/ap_compat.h; then AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then + if test ! -f $PHP_APACHE/src/include/ap_config_auto.h; then AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) fi else - if test -f $withval/src/include/compat.h; then + if test -f $PHP_APACHE/src/include/compat.h; then AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) fi fi # For StrongHold 2.2 - elif test -f $withval/apache/httpd.h; then - APACHE_INCLUDE="-I$withval/apache -I$withval/ssl/include" - APACHE_TARGET=$withval/apache + elif test -f $PHP_APACHE/apache/httpd.h; then + APACHE_INCLUDE="-I$PHP_APACHE/apache -I$PHP_APACHE/ssl/include" + APACHE_TARGET=$PHP_APACHE/apache PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php.c php_apache.c, $APACHE_INCLUDE) PHP_LIBS="-Lmodules/php6 -L../modules/php6 -L../../modules/php6 -lmodphp6" APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp6.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET" STRONGHOLD=-DSTRONGHOLD=1 AC_MSG_RESULT(yes - StrongHold) - if test -f $withval/apache/ap_config.h; then + if test -f $PHP_APACHE/apache/ap_config.h; then AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) fi - if test -f $withval/src/ap_compat.h; then + if test -f $PHP_APACHE/src/ap_compat.h; then AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then + if test ! -f $PHP_APACHE/src/include/ap_config_auto.h; then AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) fi else - if test -f $withval/src/compat.h; then + if test -f $PHP_APACHE/src/compat.h; then AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) fi fi else AC_MSG_RESULT(no) - AC_MSG_ERROR(Invalid Apache directory - unable to find httpd.h under $withval) + AC_MSG_ERROR(Invalid Apache directory - unable to find httpd.h under $PHP_APACHE) fi else AC_MSG_RESULT(no) fi -],[ - AC_MSG_RESULT(no) -]) - fi AC_MSG_CHECKING(for mod_charset compatibility option) diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4 index 8868370e31..f88144403a 100644 --- a/sapi/apache2filter/config.m4 +++ b/sapi/apache2filter/config.m4 @@ -7,14 +7,20 @@ AC_ARG_WITH(apxs2filter, [ --with-apxs2filter[=FILE] EXPERIMENTAL: Build shared Apache 2.0 Filter module. FILE is the optional pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then + PHP_APXS2FILTER=$withval +],[ + PHP_APXS2FILTER=no +]) + +if test "$PHP_APXS2FILTER" != "no"; then + if test "$PHP_APXS2FILTER" = "yes"; then APXS=apxs $APXS -q CFLAGS >/dev/null 2>&1 if test "$?" != "0" && test -x /usr/sbin/apxs; then APXS=/usr/sbin/apxs fi else - PHP_EXPAND_PATH($withval, APXS) + PHP_EXPAND_PATH($PHP_APXS2FILTER, APXS) fi $APXS -q CFLAGS >/dev/null 2>&1 @@ -119,11 +125,10 @@ AC_ARG_WITH(apxs2filter, PHP_BUILD_THREAD_SAFE fi AC_MSG_RESULT(yes) - PHP_SUBST(APXS) -],[ +else AC_MSG_RESULT(no) -]) +fi dnl ## Local Variables: dnl ## tab-width: 4 diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 index a2f8263fdc..b349d70d51 100644 --- a/sapi/apache2handler/config.m4 +++ b/sapi/apache2handler/config.m4 @@ -6,14 +6,20 @@ AC_MSG_CHECKING(for Apache 2.0 handler-module support via DSO through APXS) AC_ARG_WITH(apxs2, [ --with-apxs2[=FILE] Build shared Apache 2.0 Handler module. FILE is the optional pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then + PHP_APXS2=$withval +], [ + PHP_APXS2=no +]) + +if test "$PHP_APXS2" != "no"; then + if test "$PHP_APXS2" = "yes"; then APXS=apxs $APXS -q CFLAGS >/dev/null 2>&1 if test "$?" != "0" && test -x /usr/sbin/apxs; then APXS=/usr/sbin/apxs fi else - PHP_EXPAND_PATH($withval, APXS) + PHP_EXPAND_PATH($PHP_APXS2, APXS) fi $APXS -q CFLAGS >/dev/null 2>&1 @@ -118,11 +124,10 @@ AC_ARG_WITH(apxs2, PHP_BUILD_THREAD_SAFE fi AC_MSG_RESULT(yes) - PHP_SUBST(APXS) -],[ +else AC_MSG_RESULT(no) -]) +fi dnl ## Local Variables: dnl ## tab-width: 4 diff --git a/sapi/apache_hooks/config.m4 b/sapi/apache_hooks/config.m4 index 7d28a463ad..9107469760 100644 --- a/sapi/apache_hooks/config.m4 +++ b/sapi/apache_hooks/config.m4 @@ -23,14 +23,20 @@ AC_ARG_WITH(apache-hooks, [ --with-apache-hooks[=FILE] EXPERIMENTAL: Build shared Apache 1.x module. FILE is the optional pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then + PHP_APACHE_HOOKS=$withval +],[ + PHP_APACHE_HOOKS=no +]) + +if test "$PHP_APACHE_HOOKS" != "no"; then + if test "$PHP_APACHE_HOOKS" = "yes"; then APXS=apxs $APXS -q CFLAGS >/dev/null 2>&1 if test "$?" != "0" && test -x /usr/sbin/apxs; then #SUSE 6.x APXS=/usr/sbin/apxs fi else - PHP_EXPAND_PATH($withval, APXS) + PHP_EXPAND_PATH($PHP_APACHE_HOOKS, APXS) fi $APXS -q CFLAGS >/dev/null 2>&1 @@ -114,116 +120,117 @@ AC_ARG_WITH(apache-hooks, AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) AC_DEFINE(HAVE_APACHE_HOOKS,1,[ ]) AC_MSG_RESULT(yes) -],[ +else AC_MSG_RESULT(no) -]) +fi -if test "$PHP_SAPI" != "apache_hooks"; then AC_MSG_CHECKING(for Apache 1.x (hooks) module support) AC_ARG_WITH(apache-hooks-static, -[ --with-apache-hooks-static[=DIR] +[ --with-apache-hooks-static[=DIR] EXPERIMENTAL: Build Apache 1.x module. DIR is the top-level Apache build directory [/usr/local/apache]],[ - - APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache_hooks/mod_php5.* sapi/apache_hooks/libphp5.module" - if test "$withval" = "yes"; then # Apache's default directory - withval=/usr/local/apache + PHP_APACHE_HOOKS=/usr/local/apache + else + PHP_APACHE_HOOKS=$withval fi - if test "$withval" != "no"; then - AC_DEFINE(HAVE_APACHE_HOOKS,1,[ ]) +], [ + PHP_APACHE_HOOKS=no +]) + +if test "$PHP_SAPI" != "apache" && test "$PHP_SAPI" != "apache_hooks" && test "$PHP_APACHE_HOOKS" != "no"; then + APACHE_HOOKS_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php5.* sapi/apache/libphp5.module" + + if test "$PHP_APACHE_HOOKS" != "no"; then + AC_DEFINE(HAVE_APACHE,1,[ ]) APACHE_HOOKS_MODULE=yes - PHP_EXPAND_PATH($withval, withval) + PHP_EXPAND_PATH($PHP_APACHE_HOOKS, PHP_APACHE_HOOKS) # For Apache 2.0.x - if test -f $withval/include/httpd.h && - test -f $withval/srclib/apr/include/apr_general.h ; then + if test -f $PHP_APACHE_HOOKS/include/httpd.h && + test -f $PHP_APACHE_HOOKS/srclib/apr/include/apr_general.h ; then AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) # For Apache 1.3.x - elif test -f $withval/src/main/httpd.h; then + elif test -f $PHP_APACHE_HOOKS/src/main/httpd.h; then APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$withval/src/main -I$withval/src/os/unix -I$withval/src/ap" - APACHE_TARGET=$withval/src/modules/php5 + APACHE_INCLUDE="-I$PHP_APACHE_HOOKS/src/main -I$PHP_APACHE_HOOKS/src/os/unix -I$PHP_APACHE_HOOKS/src/ap" + APACHE_TARGET=$PHP_APACHE_HOOKS/src/modules/php5 if test ! -d $APACHE_TARGET; then mkdir $APACHE_TARGET fi PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" + APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" AC_MSG_RESULT(yes - Apache 1.3.x) STRONGHOLD= - if test -f $withval/src/include/ap_config.h; then + if test -f $PHP_APACHE_HOOKS/src/include/ap_config.h; then AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) fi - if test -f $withval/src/include/ap_compat.h; then + if test -f $PHP_APACHE_HOOKS/src/include/ap_compat.h; then AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then + if test ! -f $PHP_APACHE_HOOKS/src/include/ap_config_auto.h; then AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) fi else - if test -f $withval/src/include/compat.h; then + if test -f $PHP_APACHE_HOOKS/src/include/compat.h; then AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) fi fi # Also for Apache 1.3.x - elif test -f $withval/src/include/httpd.h; then + elif test -f $PHP_APACHE_HOOKS/src/include/httpd.h; then APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix" - APACHE_TARGET=$withval/src/modules/php5 + APACHE_INCLUDE="-I$PHP_APACHE_HOOKS/src/include -I$PHP_APACHE_HOOKS/src/os/unix" + APACHE_TARGET=$PHP_APACHE_HOOKS/src/modules/php5 if test ! -d $APACHE_TARGET; then mkdir $APACHE_TARGET fi PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" + APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" AC_MSG_RESULT(yes - Apache 1.3.x) STRONGHOLD= - if test -f $withval/src/include/ap_config.h; then + if test -f $PHP_APACHE_HOOKS/src/include/ap_config.h; then AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) fi - if test -f $withval/src/include/ap_compat.h; then + if test -f $PHP_APACHE_HOOKS/src/include/ap_compat.h; then AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then + if test ! -f $PHP_APACHE_HOOKS/src/include/ap_config_auto.h; then AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) fi else - if test -f $withval/src/include/compat.h; then + if test -f $PHP_APACHE_HOOKS/src/include/compat.h; then AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) fi fi # For StrongHold 2.2 - elif test -f $withval/apache/httpd.h; then - APACHE_INCLUDE="-I$withval/apache -I$withval/ssl/include" - APACHE_TARGET=$withval/apache + elif test -f $PHP_APACHE_HOOKS/apache/httpd.h; then + APACHE_INCLUDE="-I$PHP_APACHE_HOOKS/apache -I$PHP_APACHE_HOOKS/ssl/include" + APACHE_TARGET=$PHP_APACHE_HOOKS/apache PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET" + APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET" STRONGHOLD=-DSTRONGHOLD=1 AC_MSG_RESULT(yes - StrongHold) - if test -f $withval/apache/ap_config.h; then + if test -f $PHP_APACHE_HOOKS/apache/ap_config.h; then AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) fi - if test -f $withval/src/ap_compat.h; then + if test -f $PHP_APACHE_HOOKS/src/ap_compat.h; then AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - if test ! -f $withval/src/include/ap_config_auto.h; then + if test ! -f $PHP_APACHE_HOOKS/src/include/ap_config_auto.h; then AC_MSG_ERROR(Please run Apache\'s configure or src/Configure program once and try again) fi else - if test -f $withval/src/compat.h; then + if test -f $PHP_APACHE_HOOKS/src/compat.h; then AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ]) fi fi else AC_MSG_RESULT(no) - AC_MSG_ERROR(Invalid Apache directory - unable to find httpd.h under $withval) + AC_MSG_ERROR(Invalid Apache directory - unable to find httpd.h under $PHP_APACHE_HOOKS) fi else AC_MSG_RESULT(no) fi -],[ - AC_MSG_RESULT(no) -]) - fi AC_MSG_CHECKING(for mod_charset compatibility option) @@ -250,7 +257,7 @@ if test -n "$APACHE_HOOKS_INSTALL"; then fi PHP_APACHE_FD_CHECK - INSTALL_IT=$APACHE_INSTALL + INSTALL_IT=$APACHE_HOOKS_INSTALL PHP_SUBST(APXS_EXP) PHP_SUBST(APACHE_INCLUDE) diff --git a/sapi/caudium/config.m4 b/sapi/caudium/config.m4 index 88cdcd32c6..ba9dc3fa60 100644 --- a/sapi/caudium/config.m4 +++ b/sapi/caudium/config.m4 @@ -6,22 +6,27 @@ RESULT=no AC_MSG_CHECKING(for Caudium support) AC_ARG_WITH(caudium, [ --with-caudium[=DIR] Build PHP as a Pike module for use with Caudium. - DIR is the Caudium server dir [/usr/local/caudium/server]], -[ + DIR is the Caudium server dir [/usr/local/caudium/server]],[ + PHP_CAUDIUM=$withval +], [ + PHP_CAUDIUM=no +]) + +if test "$PHP_CAUDIUM" != "no"; then if test "$prefix" = "NONE"; then CPREF=/usr/local/; fi - if test ! -d $withval ; then + if test ! -d $PHP_CAUDIUM ; then if test "$prefix" = "NONE"; then - withval=/usr/local/caudium/server/ + PHP_CAUDIUM=/usr/local/caudium/server/ else - withval=$prefix/caudium/server/ + PHP_CAUDIUM=$prefix/caudium/server/ fi fi - if test -f $withval/bin/caudium; then - PIKE=$withval/bin/caudium - elif test -f $withval/bin/pike; then - PIKE=$withval/bin/pike + if test -f $PHP_CAUDIUM/bin/caudium; then + PIKE=$PHP_CAUDIUM/bin/caudium + elif test -f $PHP_CAUDIUM/bin/pike; then + PIKE=$PHP_CAUDIUM/bin/pike else - AC_MSG_ERROR(Couldn't find a pike in $withval/bin/) + AC_MSG_ERROR(Couldn't find a pike in $PHP_CAUDIUM/bin/) fi if $PIKE -e 'float v; int rel;sscanf(version(), "Pike v%f release %d", v, rel);v += rel/10000.0; if(v < 7.0268) exit(1); exit(0);'; then PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'` @@ -82,14 +87,13 @@ AC_ARG_WITH(caudium, PIKE_VERSION=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'` AC_DEFINE(HAVE_CAUDIUM,1,[Whether to compile with Caudium support]) PHP_SELECT_SAPI(caudium, shared, caudium.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/lib/$PIKE_VERSION/PHP5.so" + INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_CAUDIUM/lib/$PIKE_VERSION/PHP5.so" RESULT=" *** Pike binary used: $PIKE *** Pike include dir(s) used: $PIKE_INCLUDE_DIR *** Pike version: $PIKE_VERSION" dnl Always use threads since thread-free support really blows. PHP_BUILD_THREAD_SAFE - -]) +fi AC_MSG_RESULT($RESULT) dnl ## Local Variables: diff --git a/sapi/embed/config.m4 b/sapi/embed/config.m4 index 4461bc3383..fccae0198f 100644 --- a/sapi/embed/config.m4 +++ b/sapi/embed/config.m4 @@ -6,9 +6,14 @@ AC_MSG_CHECKING(for embedded SAPI library support) AC_ARG_ENABLE(embed, [ --enable-embed[=TYPE] EXPERIMENTAL: Enable building of embedded SAPI library - TYPE is either 'shared' or 'static'. [TYPE=shared]], -[ - case $enableval in + TYPE is either 'shared' or 'static'. [TYPE=shared]], [ + PHP_EMBED=$enableval +], [ + PHP_EMBED=no +]) + +if test "$PHP_EMBED" != "no"; then + case "$PHP_EMBED" in yes|shared) PHP_EMBED_TYPE=shared INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib" @@ -21,13 +26,12 @@ AC_ARG_ENABLE(embed, PHP_EMBED_TYPE=no ;; esac -],[ - PHP_EMBED_TYPE=no -]) - -AC_MSG_RESULT($PHP_EMBED_TYPE) - -if test "$PHP_EMBED_TYPE" != "no"; then - PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c) - PHP_INSTALL_HEADERS([sapi/embed/php_embed.h]) + if test "$PHP_EMBED_TYPE" != "no"; then + PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c) + PHP_INSTALL_HEADERS([sapi/embed/php_embed.h]) + fi + AC_MSG_RESULT($PHP_EMBED_TYPE) +else + AC_MSG_RESULT(no) fi + diff --git a/sapi/isapi/config.m4 b/sapi/isapi/config.m4 index b5410ace00..60870ef947 100644 --- a/sapi/isapi/config.m4 +++ b/sapi/isapi/config.m4 @@ -5,20 +5,25 @@ dnl RESULT=no AC_MSG_CHECKING(for Zeus ISAPI support) AC_ARG_WITH(isapi, -[ --with-isapi[=DIR] Build PHP as an ISAPI module for use with Zeus], -[ - if test "$withval" = "yes"; then - ZEUSPATH=/usr/local/zeus # the default - else - ZEUSPATH=$withval - fi - test -f "$ZEUSPATH/web/include/httpext.h" || AC_MSG_ERROR(Unable to find httpext.h in $ZEUSPATH/web/include) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(WITH_ZEUS,1,[ ]) - PHP_ADD_INCLUDE($ZEUSPATH/web/include) - PHP_SELECT_SAPI(isapi, shared, php5isapi.c) - INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$ZEUSPATH/web/bin/" - RESULT=yes +[ --with-isapi[=DIR] Build PHP as an ISAPI module for use with Zeus], [ + PHP_ISAPI=$withval +], [ + PHP_ISAPI=no +]) + +if test "$PHP_ISAPI" != "no"; then + if test "$PHP_ISAPI" = "yes"; then + ZEUSPATH=/usr/local/zeus # the default + else + ZEUSPATH=$PHP_ISAPI + fi + test -f "$ZEUSPATH/web/include/httpext.h" || AC_MSG_ERROR(Unable to find httpext.h in $ZEUSPATH/web/include) + PHP_BUILD_THREAD_SAFE + AC_DEFINE(WITH_ZEUS,1,[ ]) + PHP_ADD_INCLUDE($ZEUSPATH/web/include) + PHP_SELECT_SAPI(isapi, shared, php5isapi.c) + INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$ZEUSPATH/web/bin/" + RESULT=yes ]) AC_MSG_RESULT($RESULT) diff --git a/sapi/milter/config.m4 b/sapi/milter/config.m4 index 37269d0b58..36c212b4c5 100644 --- a/sapi/milter/config.m4 +++ b/sapi/milter/config.m4 @@ -5,7 +5,14 @@ dnl AC_MSG_CHECKING(for Milter support) AC_ARG_WITH(milter, [ --with-milter[=DIR] Build PHP as Milter application],[ - if test "$withval" = "yes"; then + PHP_MILTER=$withval +], [ + PHP_MILTER=no +]) + +RESULT=no +if test "$PHP_MILTER" != "no"; then + if test "$PHP_MILTER" = "yes"; then if test -f /usr/lib/libmilter.a ; then MILTERPATH=/usr/lib else @@ -16,24 +23,18 @@ AC_ARG_WITH(milter, fi fi else - MILTERPATH=$withval + MILTERPATH=$PHP_MILTER fi SAPI_MILTER_PATH=sapi/milter/php-milter - PHP_SUBST(SAPI_MILTER_PATH) PHP_BUILD_THREAD_SAFE PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/milter/Makefile.frag) - PHP_SELECT_SAPI(milter, program, php_milter.c getopt.c,,'$(SAPI_MILTER_PATH)') PHP_ADD_LIBRARY_WITH_PATH(milter, $MILTERPATH,) - BUILD_MILTER="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_MILTER_PATH)" - INSTALL_IT="\$(INSTALL) -m 0755 \$(SAPI_MILTER_PATH) \$(bindir)/php-milter" RESULT=yes - + PHP_SUBST(SAPI_MILTER_PATH) PHP_SUBST(BUILD_MILTER) -],[ - RESULT=no -]) +fi AC_MSG_RESULT($RESULT) diff --git a/sapi/phttpd/config.m4 b/sapi/phttpd/config.m4 index 75c6d66891..92da441f56 100644 --- a/sapi/phttpd/config.m4 +++ b/sapi/phttpd/config.m4 @@ -5,18 +5,22 @@ dnl RESULT=no AC_MSG_CHECKING(for PHTTPD support) AC_ARG_WITH(phttpd, -[ --with-phttpd=DIR Build PHP as phttpd module], -[ - if test ! -d $withval ; then - AC_MSG_ERROR(You did not specify a directory) - fi - PHP_BUILD_THREAD_SAFE - PHTTPD_DIR=$withval - PHP_ADD_INCLUDE($PHTTPD_DIR/include) - AC_DEFINE(HAVE_PHTTPD,1,[Whether you have phttpd]) - PHP_SELECT_SAPI(phttpd, shared, phttpd.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHTTPD_DIR/modules/" - RESULT=yes +[ --with-phttpd=DIR Build PHP as phttpd module],[ + PHP_PHTTPD=$withval +], [ + PHP_PHTTPD=no +]) + +if test "$PHP_PHTTPD" != "no"; then + if test ! -d $PHP_PHTTPD ; then + AC_MSG_ERROR(You did not specify a directory) + fi + PHP_BUILD_THREAD_SAFE + PHP_ADD_INCLUDE($PHP_PHTTPD/include) + AC_DEFINE(HAVE_PHTTPD,1,[Whether you have phttpd]) + PHP_SELECT_SAPI(phttpd, shared, phttpd.c) + INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_PHTTPD/modules/" + RESULT=yes ]) AC_MSG_RESULT($RESULT) diff --git a/sapi/pi3web/config.m4 b/sapi/pi3web/config.m4 index ba6a166c16..83c212af46 100644 --- a/sapi/pi3web/config.m4 +++ b/sapi/pi3web/config.m4 @@ -4,15 +4,18 @@ dnl RESULT=no AC_MSG_CHECKING(for Pi3Web support) - AC_ARG_WITH(pi3web, -[ --with-pi3web[=DIR] Build PHP as Pi3Web module], -[ -if test "$withval" != "no"; then - if test "$withval" = "yes"; then +[ --with-pi3web[=DIR] Build PHP as Pi3Web module],[ + PHP_PI3WEB=$withval +], [ + PHP_PI3WEB=no +]) + +if test "$PHP_PI3WEB" != "no"; then + if test "$PHP_PI3WEB" = "yes"; then PI3PATH=../.. # the default else - PI3PATH=$withval + PI3PATH=$PHP_PI3WEB fi test -f "$PI3PATH/PiAPI/PiAPI.h" || AC_MSG_ERROR(Unable to find PiAPI.h in $PI3PATH/PiAPI) PHP_BUILD_THREAD_SAFE @@ -27,7 +30,6 @@ if test "$withval" != "no"; then else RESULT=no fi -]) AC_MSG_RESULT($RESULT) dnl ## Local Variables: diff --git a/sapi/roxen/config.m4 b/sapi/roxen/config.m4 index 7f74707af2..e050682d70 100644 --- a/sapi/roxen/config.m4 +++ b/sapi/roxen/config.m4 @@ -2,59 +2,65 @@ dnl dnl $Id$ dnl -RESULT=no -AC_MSG_CHECKING(for Roxen/Pike support) AC_ARG_WITH(roxen, [ --with-roxen=DIR Build PHP as a Pike module. DIR is the base Roxen - directory, normally /usr/local/roxen/server], -[ - if test ! -d $withval ; then - AC_MSG_ERROR(You did not specify a directory) - fi - if test -f $withval/bin/roxen; then - PIKE=$withval/bin/roxen - elif test -f $withval/bin/pike; then - PIKE=$withval/bin/pike - else - AC_MSG_ERROR(Couldn't find a pike in $withval/bin/) - fi - if $PIKE -e 'float v; catch(v = __VERSION__ + (__BUILD__/10000.0)); if(v < 0.7079) exit(1); exit(0);'; then - PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'` - PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,'` - if test -z "$PIKE_INCLUDE_DIR" || test -z "$PIKE_MODULE_DIR"; then - AC_MSG_ERROR(Failed to figure out Pike module and include directories) - fi - else - AC_MSG_ERROR(Roxen/PHP requires Pike 0.7.79 or newer) - fi - - PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR) - AC_DEFINE(HAVE_ROXEN,1,[Whether you use Roxen]) - PHP_SELECT_SAPI(roxen, shared, roxen.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP5.so" - RESULT="yes - Pike binary used: $PIKE - Pike include dir: $PIKE_INCLUDE_DIR - Pike module directory: $PIKE_MODULE_DIR" - PIKE_INCLUDE_DIR=" -I$PIKE_INCLUDE_DIR " + directory, normally /usr/local/roxen/server], [ + PHP_ROXEN=$withval +], [ + PHP_ROXEN=no ]) -AC_MSG_RESULT($RESULT) -if test "$RESULT" != "no" ; then - RESULT=no - AC_MSG_CHECKING(if Roxen should use ZTS) - AC_ARG_ENABLE(roxen-zts, - [ --enable-roxen-zts Build the Roxen module using Zend Thread Safety], - [ - PHP_BUILD_THREAD_SAFE - AC_DEFINE(ROXEN_USE_ZTS,1,[Whether to use Roxen in ZTS mode]) - RESULT=yes +AC_ARG_ENABLE(roxen-zts, +[ --enable-roxen-zts Build the Roxen module using Zend Thread Safety], [ + PHP_ROXEN_ZTS=$enableval +], [ + PHP_ROXEN_ZTS=no +]) - ]) - AC_MSG_RESULT($RESULT) +AC_MSG_CHECKING(for Roxen/Pike support) +if test "$PHP_ROXEN" != "no"; then + if test ! -d $PHP_ROXEN ; then + AC_MSG_ERROR(You did not specify a directory) + fi + if test -f $PHP_ROXEN/bin/roxen; then + PIKE=$PHP_ROXEN/bin/roxen + elif test -f $PHP_ROXEN/bin/pike; then + PIKE=$PHP_ROXEN/bin/pike + else + AC_MSG_ERROR(Couldn't find a pike in $PHP_ROXEN/bin/) + fi + + if $PIKE -e 'float v; catch(v = __VERSION__ + (__BUILD__/10000.0)); if(v < 0.7079) exit(1); exit(0);'; then + PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'` + PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,'` + if test -z "$PIKE_INCLUDE_DIR" || test -z "$PIKE_MODULE_DIR"; then + AC_MSG_ERROR(Failed to figure out Pike module and include directories) + fi + else + AC_MSG_ERROR(Roxen/PHP requires Pike 0.7.79 or newer) + fi + + PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR) + AC_DEFINE(HAVE_ROXEN,1,[Whether you use Roxen]) + PHP_SELECT_SAPI(roxen, shared, roxen.c) + INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP5.so" + RESULT="yes + Pike binary used: $PIKE + Pike include dir: $PIKE_INCLUDE_DIR + Pike module directory: $PIKE_MODULE_DIR" + PIKE_INCLUDE_DIR=" -I$PIKE_INCLUDE_DIR " + + AC_MSG_CHECKING(if Roxen should use ZTS) + if test "$PHP_ROXEN_ZTS" != "no"; then + PHP_BUILD_THREAD_SAFE + AC_DEFINE(ROXEN_USE_ZTS,1,[Whether to use Roxen in ZTS mode]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi fi +AC_MSG_RESULT($RESULT) dnl ## Local Variables: dnl ## tab-width: 4 dnl ## End: - diff --git a/sapi/thttpd/config.m4 b/sapi/thttpd/config.m4 index ac5a2bfca2..f872aa4d2a 100644 --- a/sapi/thttpd/config.m4 +++ b/sapi/thttpd/config.m4 @@ -3,18 +3,25 @@ dnl $Id$ dnl AC_ARG_WITH(thttpd, -[ --with-thttpd=SRCDIR Build PHP as thttpd module],[ - if test ! -d $withval; then - AC_MSG_RESULT(thttpd directory does not exist ($withval)) +[ --with-thttpd=SRCDIR Build PHP as thttpd module], [ + PHP_THTTPD=$withval +],[ + PHP_THTTPD=no +]) + +AC_MSG_CHECKING(for thttpd) +if test "$PHP_THTTPD" != "no"; then + if test ! -d $PHP_THTTPD; then + AC_MSG_RESULT(thttpd directory does not exist ($PHP_THTTPD)) fi - PHP_EXPAND_PATH($withval, THTTPD) + PHP_EXPAND_PATH($PHP_THTTPD, THTTPD) - if grep thttpd.2.21b $withval/version.h >/dev/null; then + if grep thttpd.2.21b $PHP_THTTPD/version.h >/dev/null; then patch="test -f $THTTPD/php_patched || \ (cd $THTTPD && patch -p1 < $abs_srcdir/sapi/thttpd/thttpd_patch && touch php_patched)" - elif grep Premium $withval/version.h >/dev/null; then + elif grep Premium $PHP_THTTPD/version.h >/dev/null; then patch= else AC_MSG_ERROR([This version only supports thttpd-2.21b and Premium thttpd]) @@ -31,9 +38,5 @@ AC_ARG_WITH(thttpd, PHP_THTTPD="yes, using $THTTPD" PHP_ADD_INCLUDE($THTTPD) PHP_SELECT_SAPI(thttpd, static) -],[ - PHP_THTTPD=no -]) - -AC_MSG_CHECKING(for thttpd) +fi AC_MSG_RESULT($PHP_THTTPD) diff --git a/sapi/tux/config.m4 b/sapi/tux/config.m4 index cc79bea1b9..d0a8196b68 100644 --- a/sapi/tux/config.m4 +++ b/sapi/tux/config.m4 @@ -2,17 +2,19 @@ dnl dnl $Id$ dnl -PHP_TUX=no - AC_ARG_WITH(tux, -[ --with-tux=MODULEDIR Build PHP as a TUX module (Linux only)],[ - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/php5.tux.so" - AC_CHECK_HEADERS(tuxmodule.h,[:],[AC_MSG_ERROR([Cannot find tuxmodule.h])]) - PHP_SELECT_SAPI(tux, shared, php_tux.c) - PHP_TUX=yes +[ --with-tux=MODULEDIR Build PHP as a TUX module (Linux only)], [ + PHP_TUX=$withval +], [ + PHP_TUX=no ]) AC_MSG_CHECKING(for TUX) -AC_MSG_RESULT($PHP_TUX) - -unset PHP_TUX +if test "$PHP_TUX" != "no"; then + INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_TUX/php5.tux.so" + AC_CHECK_HEADERS(tuxmodule.h,[:],[AC_MSG_ERROR([Cannot find tuxmodule.h])]) + PHP_SELECT_SAPI(tux, shared, php_tux.c) + AC_MSG_RESULT($PHP_TUX) +else + AC_MSG_RESULT(no) +fi diff --git a/sapi/webjames/config.m4 b/sapi/webjames/config.m4 index 10e0001680..9e406fc057 100644 --- a/sapi/webjames/config.m4 +++ b/sapi/webjames/config.m4 @@ -4,17 +4,21 @@ dnl AC_ARG_WITH(webjames, [ --with-webjames=SRCDIR Build PHP as a WebJames module (RISC OS only)],[ - PHP_EXPAND_PATH($withval, WEBJAMES) - INSTALL_IT="\ - echo 'PHP_LIBS = -l$abs_srcdir/$SAPI_STATIC \$(PHP_LIBS) \$(EXTRA_LIBS)' > $WEBJAMES/build/php; \ - echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $WEBJAMES/build/php; \ - echo 'PHP_CFLAGS = -DPHP \$(COMMON_FLAGS) \$(EXTRA_CFLAGS) -I$abs_srcdir/sapi/webjames' >> $WEBJAMES/build/php;" - PHP_WEBJAMES="yes, using $WEBJAMES" - PHP_ADD_INCLUDE($WEBJAMES) - PHP_SELECT_SAPI(webjames, static, webjames.c) + PHP_WEBJAMES=$withval ],[ - PHP_WEBJAMES="no" + PHP_WEBJAMES=no ]) AC_MSG_CHECKING(for webjames) -AC_MSG_RESULT($PHP_WEBJAMES) +if test "$PHP_WEBJAMES" != "no"; then + PHP_EXPAND_PATH($PHP_WEBJAMES, PHP_WEBJAMES) + INSTALL_IT="\ + echo 'PHP_LIBS = -l$abs_srcdir/$SAPI_STATIC \$(PHP_LIBS) \$(EXTRA_LIBS)' > $PHP_WEBJAMES/build/php; \ + echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $PHP_WEBJAMES/build/php; \ + echo 'PHP_CFLAGS = -DPHP \$(COMMON_FLAGS) \$(EXTRA_CFLAGS) -I$abs_srcdir/sapi/webjames' >> $PHP_WEBJAMES/build/php;" + PHP_ADD_INCLUDE($PHP_WEBJAMES) + PHP_SELECT_SAPI(webjames, static, webjames.c) + AC_MSG_RESULT([yes, using $PHP_WEBJAMES]) +else + AC_MSG_RESULT(no) +fi -- 2.40.0