2001-12-01 03:01:32 +08:00
|
|
|
dnl
|
|
|
|
dnl $Id$
|
|
|
|
dnl
|
2005-03-04 23:14:47 +08:00
|
|
|
AC_DEFUN([PHP_APACHE_FD_CHECK], [
|
|
|
|
AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[
|
|
|
|
save=$CPPFLAGS
|
|
|
|
if test -n "$APXS_INCLUDEDIR"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$APXS_INCLUDEDIR"
|
|
|
|
else
|
|
|
|
CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE"
|
|
|
|
fi
|
|
|
|
AC_TRY_COMPILE([#include <httpd.h>],[conn_rec *c; int fd = c->client->fd;],[
|
|
|
|
ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no])
|
|
|
|
CPPFLAGS=$save
|
|
|
|
])
|
|
|
|
if test "$ac_cv_php_fd_in_buff" = "yes"; then
|
|
|
|
AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD,1,[ ])
|
|
|
|
fi
|
|
|
|
])
|
1999-12-24 23:56:40 +08:00
|
|
|
|
2002-02-26 02:27:13 +08:00
|
|
|
AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS)
|
1999-09-28 00:34:28 +08:00
|
|
|
AC_ARG_WITH(apxs,
|
2002-02-26 02:27:13 +08:00
|
|
|
[ --with-apxs[=FILE] Build shared Apache 1.x module. FILE is the optional
|
2005-05-30 07:17:16 +08:00
|
|
|
pathname to the Apache apxs tool [apxs]],[
|
2001-05-20 01:13:09 +08:00
|
|
|
if test "$withval" = "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)
|
|
|
|
fi
|
2000-05-16 00:37:32 +08:00
|
|
|
|
2001-05-20 01:13:09 +08:00
|
|
|
$APXS -q CFLAGS >/dev/null 2>&1
|
|
|
|
if test "$?" != "0"; then
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_RESULT([Sorry, I was not able to successfully run APXS. Possible reasons:])
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_RESULT([1. Perl is not installed;])
|
|
|
|
AC_MSG_RESULT([2. Apache was not compiled with DSO support (--enable-module=so);])
|
|
|
|
AC_MSG_RESULT([3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs])
|
|
|
|
AC_MSG_RESULT([The output of $APXS follows])
|
2003-05-28 22:11:21 +08:00
|
|
|
$APXS -q CFLAGS
|
2001-05-20 01:13:09 +08:00
|
|
|
AC_MSG_ERROR([Aborting])
|
|
|
|
fi
|
2000-05-16 00:37:32 +08:00
|
|
|
|
2001-05-20 01:13:09 +08:00
|
|
|
APXS_LDFLAGS="@SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@"
|
|
|
|
APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
|
|
|
|
APXS_CFLAGS=`$APXS -q CFLAGS`
|
2002-04-26 11:07:16 +08:00
|
|
|
APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
|
2003-02-13 01:09:31 +08:00
|
|
|
APACHE_INCLUDE=-I$APXS_INCLUDEDIR
|
2002-04-26 11:07:16 +08:00
|
|
|
|
|
|
|
# Test that we're trying to configure with apache 1.x
|
2002-07-11 16:44:42 +08:00
|
|
|
PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
|
2002-04-26 11:07:16 +08:00
|
|
|
if test "$APACHE_VERSION" -ge 2000000; then
|
2002-04-27 05:26:47 +08:00
|
|
|
AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropiate switch --with-apxs2])
|
2002-04-26 11:07:16 +08:00
|
|
|
fi
|
|
|
|
|
2001-05-20 01:13:09 +08:00
|
|
|
for flag in $APXS_CFLAGS; do
|
|
|
|
case $flag in
|
2003-02-25 00:16:11 +08:00
|
|
|
-D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
|
2001-05-20 01:13:09 +08:00
|
|
|
esac
|
|
|
|
done
|
2003-02-25 00:16:11 +08:00
|
|
|
|
2002-03-30 11:17:25 +08:00
|
|
|
case $host_alias in
|
|
|
|
*aix*)
|
|
|
|
APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
|
2003-02-25 00:16:11 +08:00
|
|
|
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
|
|
|
|
PHP_AIX_LDFLAGS="-Wl,-brtl"
|
|
|
|
build_type=shared
|
2002-03-30 11:17:25 +08:00
|
|
|
;;
|
|
|
|
*darwin*)
|
|
|
|
MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD"
|
|
|
|
PHP_SUBST(MH_BUNDLE_FLAGS)
|
2003-03-29 12:52:46 +08:00
|
|
|
SAPI_SHARED=libs/libphp5.so
|
2003-02-25 00:16:11 +08:00
|
|
|
build_type=bundle
|
2002-03-30 11:17:25 +08:00
|
|
|
;;
|
|
|
|
*)
|
2003-02-25 00:16:11 +08:00
|
|
|
build_type=shared
|
2002-03-30 11:17:25 +08:00
|
|
|
;;
|
|
|
|
esac
|
2002-04-13 06:59:07 +08:00
|
|
|
|
2003-03-29 12:52:46 +08:00
|
|
|
PHP_SELECT_SAPI(apache, $build_type, sapi_apache.c mod_php5.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR)
|
2003-02-25 00:16:11 +08:00
|
|
|
|
2001-11-19 08:51:06 +08:00
|
|
|
# Test whether apxs support -S option
|
2002-03-05 01:46:19 +08:00
|
|
|
$APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1
|
2001-11-19 08:51:06 +08:00
|
|
|
|
|
|
|
if test "$?" != "0"; then
|
2003-03-29 12:52:46 +08:00
|
|
|
APACHE_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option
|
2001-11-19 08:51:06 +08:00
|
|
|
else
|
2003-02-23 15:32:03 +08:00
|
|
|
APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
|
|
|
|
if test -z `$APXS -q SYSCONFDIR`; then
|
|
|
|
APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
|
|
|
|
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
|
2003-03-29 12:52:46 +08:00
|
|
|
-i -n php5 $SAPI_SHARED"
|
2003-02-23 15:32:03 +08:00
|
|
|
else
|
|
|
|
APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
|
|
|
|
APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
|
|
|
|
\$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
|
|
|
|
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
|
|
|
|
-S SYSCONFDIR='$APXS_SYSCONFDIR' \
|
2003-03-29 12:52:46 +08:00
|
|
|
-i -a -n php5 $SAPI_SHARED"
|
2003-02-23 15:32:03 +08:00
|
|
|
fi
|
2001-11-19 08:51:06 +08:00
|
|
|
fi
|
|
|
|
|
2001-05-20 01:13:09 +08:00
|
|
|
if test -z "`$APXS -q LD_SHLIB`" || test "`$APXS -q LIBEXECDIR`" = "modules"; then
|
|
|
|
PHP_APXS_BROKEN=yes
|
|
|
|
fi
|
|
|
|
STRONGHOLD=
|
|
|
|
AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ])
|
|
|
|
AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ])
|
2003-02-13 15:47:21 +08:00
|
|
|
AC_DEFINE(HAVE_APACHE,1,[ ])
|
2001-05-20 01:13:09 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
1999-09-28 00:34:28 +08:00
|
|
|
],[
|
2001-05-20 01:13:09 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1999-09-28 00:34:28 +08:00
|
|
|
])
|
|
|
|
|
1999-10-08 05:04:26 +08:00
|
|
|
if test "$PHP_SAPI" != "apache"; then
|
2002-02-26 02:27:13 +08:00
|
|
|
AC_MSG_CHECKING(for Apache 1.x module support)
|
1999-09-28 00:34:28 +08:00
|
|
|
AC_ARG_WITH(apache,
|
2002-02-26 02:27:13 +08:00
|
|
|
[ --with-apache[=DIR] Build Apache 1.x module. DIR is the top-level Apache
|
2005-05-30 07:17:16 +08:00
|
|
|
build directory [/usr/local/apache]],[
|
2003-02-13 15:47:21 +08:00
|
|
|
|
2003-03-29 12:52:46 +08:00
|
|
|
APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php5.* sapi/apache/libphp5.module"
|
2003-02-13 15:47:21 +08:00
|
|
|
|
2001-05-20 01:13:09 +08:00
|
|
|
if test "$withval" = "yes"; then
|
|
|
|
# Apache's default directory
|
|
|
|
withval=/usr/local/apache
|
|
|
|
fi
|
|
|
|
if test "$withval" != "no"; then
|
2003-02-13 15:47:21 +08:00
|
|
|
AC_DEFINE(HAVE_APACHE,1,[ ])
|
2001-05-20 01:13:09 +08:00
|
|
|
APACHE_MODULE=yes
|
|
|
|
PHP_EXPAND_PATH($withval, withval)
|
|
|
|
# For Apache 1.2.x
|
|
|
|
if test -f $withval/src/httpd.h; then
|
|
|
|
APACHE_INCLUDE=-I$withval/src
|
|
|
|
APACHE_TARGET=$withval/src
|
2003-03-29 12:52:46 +08:00
|
|
|
PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE)
|
2001-05-20 01:13:09 +08:00
|
|
|
APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET"
|
|
|
|
PHP_LIBS="-L. -lphp3"
|
|
|
|
AC_MSG_RESULT(yes - Apache 1.2.x)
|
|
|
|
STRONGHOLD=
|
|
|
|
if test -f $withval/src/ap_config.h; then
|
|
|
|
AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ])
|
|
|
|
fi
|
|
|
|
# For Apache 2.0.x
|
2002-04-13 13:58:29 +08:00
|
|
|
elif test -f $withval/include/httpd.h &&
|
|
|
|
test -f $withval/srclib/apr/include/apr_general.h ; then
|
2005-01-27 02:03:04 +08:00
|
|
|
AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!])
|
2001-05-20 01:13:09 +08:00
|
|
|
# For Apache 1.3.x
|
|
|
|
elif test -f $withval/src/main/httpd.h; then
|
|
|
|
APACHE_HAS_REGEX=1
|
|
|
|
APACHE_INCLUDE="-I$withval/src/main -I$withval/src/os/unix -I$withval/src/ap"
|
2003-03-29 12:52:46 +08:00
|
|
|
APACHE_TARGET=$withval/src/modules/php5
|
2001-05-20 01:13:09 +08:00
|
|
|
if test ! -d $APACHE_TARGET; then
|
|
|
|
mkdir $APACHE_TARGET
|
|
|
|
fi
|
2003-03-29 12:52:46 +08:00
|
|
|
PHP_SELECT_SAPI(apache, 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/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"
|
2001-05-20 01:13:09 +08:00
|
|
|
AC_MSG_RESULT(yes - Apache 1.3.x)
|
|
|
|
STRONGHOLD=
|
|
|
|
if test -f $withval/src/include/ap_config.h; then
|
|
|
|
AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ])
|
|
|
|
fi
|
|
|
|
if test -f $withval/src/include/ap_compat.h; then
|
|
|
|
AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ])
|
|
|
|
if test ! -f $withval/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
|
|
|
|
AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# Also for Apache 1.3.x
|
|
|
|
elif test -f $withval/src/include/httpd.h; then
|
|
|
|
APACHE_HAS_REGEX=1
|
|
|
|
APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix"
|
2003-03-29 12:52:46 +08:00
|
|
|
APACHE_TARGET=$withval/src/modules/php5
|
2001-05-20 01:13:09 +08:00
|
|
|
if test ! -d $APACHE_TARGET; then
|
|
|
|
mkdir $APACHE_TARGET
|
|
|
|
fi
|
2003-03-29 12:52:46 +08:00
|
|
|
PHP_SELECT_SAPI(apache, 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/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
|
2001-05-20 01:13:09 +08:00
|
|
|
AC_MSG_RESULT(yes - Apache 1.3.x)
|
|
|
|
STRONGHOLD=
|
|
|
|
if test -f $withval/src/include/ap_config.h; then
|
|
|
|
AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ])
|
|
|
|
fi
|
|
|
|
if test -f $withval/src/include/ap_compat.h; then
|
|
|
|
AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ])
|
|
|
|
if test ! -f $withval/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
|
|
|
|
AC_DEFINE(HAVE_OLD_COMPAT_H,1,[ ])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# For StrongHold 2.2
|
|
|
|
elif test -f $withval/apache/httpd.h; then
|
2004-08-18 15:22:54 +08:00
|
|
|
APACHE_INCLUDE="-I$withval/apache -I$withval/ssl/include"
|
2001-05-20 01:13:09 +08:00
|
|
|
APACHE_TARGET=$withval/apache
|
2003-03-29 12:52:46 +08:00
|
|
|
PHP_SELECT_SAPI(apache, 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"
|
2001-05-20 01:13:09 +08:00
|
|
|
STRONGHOLD=-DSTRONGHOLD=1
|
|
|
|
AC_MSG_RESULT(yes - StrongHold)
|
|
|
|
if test -f $withval/apache/ap_config.h; then
|
|
|
|
AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ])
|
|
|
|
fi
|
|
|
|
if test -f $withval/src/ap_compat.h; then
|
|
|
|
AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ])
|
|
|
|
if test ! -f $withval/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
|
|
|
|
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)
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
1999-09-28 00:34:28 +08:00
|
|
|
],[
|
2001-05-20 01:13:09 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1999-09-28 00:34:28 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for mod_charset compatibility option)
|
|
|
|
AC_ARG_WITH(mod_charset,
|
2005-05-30 07:17:16 +08:00
|
|
|
[ --with-mod_charset Enable transfer tables for mod_charset (Rus Apache)],
|
1999-09-28 00:34:28 +08:00
|
|
|
[
|
2001-05-20 01:13:09 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(USE_TRANSFER_TABLES,1,[ ])
|
1999-09-28 00:34:28 +08:00
|
|
|
],[
|
2001-05-20 01:13:09 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1999-09-28 00:34:28 +08:00
|
|
|
])
|
|
|
|
|
2005-03-04 23:14:47 +08:00
|
|
|
dnl Build as static module
|
1999-09-30 06:18:43 +08:00
|
|
|
if test -n "$APACHE_MODULE"; then
|
2001-06-15 20:53:20 +08:00
|
|
|
PHP_TARGET_RDYNAMIC
|
2000-06-14 02:02:28 +08:00
|
|
|
$php_shtool mkdir -p sapi/apache
|
2003-03-29 12:52:46 +08:00
|
|
|
PHP_OUTPUT(sapi/apache/libphp5.module)
|
1999-09-30 06:18:43 +08:00
|
|
|
fi
|
|
|
|
|
2005-03-04 23:14:47 +08:00
|
|
|
dnl General
|
1999-10-04 23:18:26 +08:00
|
|
|
if test -n "$APACHE_INSTALL"; then
|
2005-03-04 23:14:47 +08:00
|
|
|
if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then
|
|
|
|
APXS_EXP=-bE:sapi/apache/mod_php5.exp
|
|
|
|
fi
|
|
|
|
|
|
|
|
PHP_APACHE_FD_CHECK
|
1999-10-04 23:18:26 +08:00
|
|
|
INSTALL_IT=$APACHE_INSTALL
|
2005-03-04 23:14:47 +08:00
|
|
|
|
|
|
|
PHP_SUBST(APXS_EXP)
|
|
|
|
PHP_SUBST(APACHE_INCLUDE)
|
|
|
|
PHP_SUBST(APACHE_TARGET)
|
|
|
|
PHP_SUBST(APXS)
|
|
|
|
PHP_SUBST(APXS_LDFLAGS)
|
|
|
|
PHP_SUBST(APACHE_INSTALL)
|
|
|
|
PHP_SUBST(STRONGHOLD)
|
1999-10-04 23:18:26 +08:00
|
|
|
fi
|
1999-09-30 06:18:43 +08:00
|
|
|
|
1999-09-28 00:34:28 +08:00
|
|
|
dnl ## Local Variables:
|
|
|
|
dnl ## tab-width: 4
|
|
|
|
dnl ## End:
|