2001-11-30 19:01:32 +00:00
|
|
|
dnl
|
|
|
|
dnl $Id$
|
|
|
|
dnl
|
2000-10-26 17:55:05 +00:00
|
|
|
|
|
|
|
AC_MSG_CHECKING(for Apache 2.0 module support via DSO through APXS)
|
|
|
|
AC_ARG_WITH(apxs2,
|
2002-04-10 09:42:38 +00:00
|
|
|
[ --with-apxs2[=FILE] EXPERIMENTAL: Build shared Apache 2.0 module. FILE is the optional
|
2000-10-26 17:55:05 +00:00
|
|
|
pathname to the Apache apxs tool; defaults to "apxs".],[
|
2001-05-19 17:02:09 +00:00
|
|
|
if test "$withval" = "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)
|
|
|
|
fi
|
2000-10-26 17:55:05 +00:00
|
|
|
|
2001-05-19 17:02:09 +00:00
|
|
|
$APXS -q CFLAGS >/dev/null 2>&1
|
|
|
|
if test "$?" != "0"; then
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_RESULT([Sorry, I cannot run apxs. Possible reasons follow:])
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_RESULT([1. Perl is not installed])
|
|
|
|
AC_MSG_RESULT([2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs])
|
|
|
|
AC_MSG_RESULT([3. Apache was not built using --enable-so (the apxs usage page is displayed)])
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_RESULT([The output of $APXS follows:])
|
|
|
|
$APXS
|
|
|
|
AC_MSG_ERROR([Aborting])
|
|
|
|
fi
|
2000-10-26 17:55:05 +00:00
|
|
|
|
2001-05-19 17:02:09 +00:00
|
|
|
APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
|
2002-04-26 03:07:16 +00:00
|
|
|
APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
|
2001-05-19 17:02:09 +00:00
|
|
|
APXS_CFLAGS=`$APXS -q CFLAGS`
|
2002-04-26 03:07:16 +00:00
|
|
|
|
2001-05-19 17:02:09 +00:00
|
|
|
for flag in $APXS_CFLAGS; do
|
|
|
|
case $flag in
|
|
|
|
-D*) CPPFLAGS="$CPPFLAGS $flag";;
|
|
|
|
esac
|
|
|
|
done
|
2002-04-22 15:25:17 +00:00
|
|
|
|
2002-04-26 03:07:16 +00:00
|
|
|
# Test that we're trying to configure with apache 2.x
|
|
|
|
APACHE_VERSION=`$APXS_HTTPD -v | head -1 | cut -f3 -d' ' | cut -f2 -d'/' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
|
|
|
|
if test "$APACHE_VERSION" -le 2000000; then
|
2002-04-26 21:26:47 +00:00
|
|
|
AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropiate switch --with-apxs (without the 2)])
|
2002-04-26 03:07:16 +00:00
|
|
|
elif test "$APACHE_VERSION" -lt 2000035; then
|
2002-04-26 21:26:47 +00:00
|
|
|
AC_MSG_ERROR([Please note that Apache version >= 2.0.35 is required.])
|
2002-04-26 03:07:16 +00:00
|
|
|
fi
|
|
|
|
|
2002-04-22 15:25:17 +00:00
|
|
|
case $host_alias in
|
|
|
|
*aix*)
|
|
|
|
APXS_SBINDIR=`$APXS -q SBINDIR`
|
|
|
|
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-bI:$APXS_SBINDIR/httpd.exp"
|
2002-04-22 15:37:54 +00:00
|
|
|
PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c)
|
|
|
|
INSTALL_IT="$APXS -i -a -n php4 $SAPI_LIBTOOL"
|
2002-04-22 15:25:17 +00:00
|
|
|
;;
|
|
|
|
*darwin*)
|
2002-05-13 21:37:52 +00:00
|
|
|
dnl When using bundles on Darwin, we must resolve all symbols. However,
|
|
|
|
dnl the linker does not recursively look at the bundle loader and
|
|
|
|
dnl pull in its dependencies. Therefore, we must pull in the APR
|
|
|
|
dnl and APR-util libraries.
|
|
|
|
APXS_BINDIR=`$APXS -q BINDIR`
|
|
|
|
if test -f $APXS_BINDIR/apr-config; then
|
|
|
|
MH_BUNDLE_FLAGS="`$APXS_BINDIR/apr-config --ldflags --link-ld --libs`"
|
|
|
|
fi
|
|
|
|
if test -f $APXS_BINDIR/apu-config; then
|
|
|
|
MH_BUNDLE_FLAGS="`$APXS_BINDIR/apu-config --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
|
|
|
|
fi
|
|
|
|
MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
|
2002-04-22 15:25:17 +00:00
|
|
|
PHP_SUBST(MH_BUNDLE_FLAGS)
|
2002-04-22 15:37:54 +00:00
|
|
|
PHP_SELECT_SAPI(apache2filter, bundle, sapi_apache2.c apache_config.c php_functions.c)
|
|
|
|
SAPI_SHARED=libs/libphp4.so
|
|
|
|
INSTALL_IT="$APXS -i -a -n php4 $SAPI_SHARED"
|
2002-04-22 15:25:17 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c)
|
2002-04-22 15:37:54 +00:00
|
|
|
INSTALL_IT="$APXS -i -a -n php4 $SAPI_LIBTOOL"
|
2002-04-22 15:25:17 +00:00
|
|
|
;;
|
|
|
|
esac
|
2002-04-12 22:59:07 +00:00
|
|
|
|
2001-05-19 17:02:09 +00:00
|
|
|
PHP_ADD_INCLUDE($APXS_INCLUDEDIR)
|
|
|
|
PHP_BUILD_THREAD_SAFE
|
|
|
|
AC_MSG_RESULT(yes)
|
2000-10-26 17:55:05 +00:00
|
|
|
],[
|
2001-05-19 17:02:09 +00:00
|
|
|
AC_MSG_RESULT(no)
|
2000-10-26 17:55:05 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
PHP_SUBST(APXS)
|
|
|
|
|
|
|
|
dnl ## Local Variables:
|
|
|
|
dnl ## tab-width: 4
|
|
|
|
dnl ## End:
|