Annotation of embedaddon/php/sapi/apache2handler/config.m4, revision 1.1
1.1 ! misho 1: dnl
! 2: dnl $Id: config.m4 254930 2008-03-11 22:47:39Z lstrojny $
! 3: dnl
! 4:
! 5: PHP_ARG_WITH(apxs2,,
! 6: [ --with-apxs2[=FILE] Build shared Apache 2.0 Handler module. FILE is the optional
! 7: pathname to the Apache apxs tool [apxs]], no, no)
! 8:
! 9: AC_MSG_CHECKING([for Apache 2.0 handler-module support via DSO through APXS])
! 10:
! 11: if test "$PHP_APXS2" != "no"; then
! 12: if test "$PHP_APXS2" = "yes"; then
! 13: APXS=apxs
! 14: $APXS -q CFLAGS >/dev/null 2>&1
! 15: if test "$?" != "0" && test -x /usr/sbin/apxs; then
! 16: APXS=/usr/sbin/apxs
! 17: fi
! 18: else
! 19: PHP_EXPAND_PATH($PHP_APXS2, APXS)
! 20: fi
! 21:
! 22: $APXS -q CFLAGS >/dev/null 2>&1
! 23: if test "$?" != "0"; then
! 24: AC_MSG_RESULT()
! 25: AC_MSG_RESULT()
! 26: AC_MSG_RESULT([Sorry, I cannot run apxs. Possible reasons follow:])
! 27: AC_MSG_RESULT()
! 28: AC_MSG_RESULT([1. Perl is not installed])
! 29: AC_MSG_RESULT([2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs])
! 30: AC_MSG_RESULT([3. Apache was not built using --enable-so (the apxs usage page is displayed)])
! 31: AC_MSG_RESULT()
! 32: AC_MSG_RESULT([The output of $APXS follows:])
! 33: $APXS -q CFLAGS
! 34: AC_MSG_ERROR([Aborting])
! 35: fi
! 36:
! 37: APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
! 38: APXS_BINDIR=`$APXS -q BINDIR`
! 39: APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
! 40: APXS_CFLAGS=`$APXS -q CFLAGS`
! 41: APXS_MPM=`$APXS -q MPM_NAME`
! 42: APU_BINDIR=`$APXS -q APU_BINDIR`
! 43: APR_BINDIR=`$APXS -q APR_BINDIR`
! 44:
! 45: # Pick up ap[ru]-N-config if using httpd >=2.1
! 46: APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null ||
! 47: echo $APR_BINDIR/apr-config`
! 48: APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null ||
! 49: echo $APU_BINDIR/apu-config`
! 50:
! 51: APR_CFLAGS="`$APR_CONFIG --cppflags --includes`"
! 52: APU_CFLAGS="`$APU_CONFIG --includes`"
! 53:
! 54: for flag in $APXS_CFLAGS; do
! 55: case $flag in
! 56: -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
! 57: esac
! 58: done
! 59:
! 60: APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS"
! 61:
! 62: # Test that we're trying to configure with apache 2.x
! 63: PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
! 64: if test "$APACHE_VERSION" -le 2000000; then
! 65: 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)])
! 66: elif test "$APACHE_VERSION" -lt 2000044; then
! 67: AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required])
! 68: fi
! 69:
! 70: APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
! 71: if test -z `$APXS -q SYSCONFDIR`; then
! 72: INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
! 73: $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
! 74: -i -n php5"
! 75: else
! 76: APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
! 77: INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
! 78: \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
! 79: $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
! 80: -S SYSCONFDIR='$APXS_SYSCONFDIR' \
! 81: -i -a -n php5"
! 82: fi
! 83:
! 84: case $host_alias in
! 85: *aix*)
! 86: EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
! 87: PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
! 88: INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
! 89: ;;
! 90: *darwin*)
! 91: dnl When using bundles on Darwin, we must resolve all symbols. However,
! 92: dnl the linker does not recursively look at the bundle loader and
! 93: dnl pull in its dependencies. Therefore, we must pull in the APR
! 94: dnl and APR-util libraries.
! 95: if test -x "$APR_CONFIG"; then
! 96: MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"
! 97: fi
! 98: if test -x "$APU_CONFIG"; then
! 99: MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
! 100: fi
! 101: MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
! 102: PHP_SUBST(MH_BUNDLE_FLAGS)
! 103: PHP_SELECT_SAPI(apache2handler, bundle, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
! 104: SAPI_SHARED=libs/libphp5.so
! 105: INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
! 106: ;;
! 107: *beos*)
! 108: if test -f _APP_; then `rm _APP_`; fi
! 109: `ln -s $APXS_BINDIR/httpd _APP_`
! 110: EXTRA_LIBS="$EXTRA_LIBS _APP_"
! 111: PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
! 112: INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
! 113: ;;
! 114: *)
! 115: PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
! 116: INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
! 117: ;;
! 118: esac
! 119:
! 120: if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser" && test "$APXS_MPM" != "itk"; then
! 121: PHP_BUILD_THREAD_SAFE
! 122: fi
! 123: AC_MSG_RESULT(yes)
! 124: PHP_SUBST(APXS)
! 125: else
! 126: AC_MSG_RESULT(no)
! 127: fi
! 128:
! 129: dnl ## Local Variables:
! 130: dnl ## tab-width: 4
! 131: dnl ## End:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>