You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
3.7 KiB

  1. dnl
  2. dnl $Id$
  3. dnl
  4. AC_MSG_CHECKING(for Apache 2.0 handler-module support via DSO through APXS)
  5. AC_ARG_WITH(apxs2handler,
  6. [ --with-apxs2handler[=FILE] EXPERIMENTAL: Build shared Apache 2.0 module. FILE is the optional
  7. pathname to the Apache apxs tool; defaults to "apxs".],[
  8. if test "$withval" = "yes"; then
  9. APXS=apxs
  10. $APXS -q CFLAGS >/dev/null 2>&1
  11. if test "$?" != "0" && test -x /usr/sbin/apxs; then
  12. APXS=/usr/sbin/apxs
  13. fi
  14. else
  15. PHP_EXPAND_PATH($withval, APXS)
  16. fi
  17. $APXS -q CFLAGS >/dev/null 2>&1
  18. if test "$?" != "0"; then
  19. AC_MSG_RESULT()
  20. AC_MSG_RESULT()
  21. AC_MSG_RESULT([Sorry, I cannot run apxs. Possible reasons follow:])
  22. AC_MSG_RESULT()
  23. AC_MSG_RESULT([1. Perl is not installed])
  24. AC_MSG_RESULT([2. apxs was not found. Try to pass the path using --with-apxs2handler=/path/to/apxs])
  25. AC_MSG_RESULT([3. Apache was not built using --enable-so (the apxs usage page is displayed)])
  26. AC_MSG_RESULT()
  27. AC_MSG_RESULT([The output of $APXS follows:])
  28. $APXS
  29. AC_MSG_ERROR([Aborting])
  30. fi
  31. APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
  32. APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
  33. APXS_CFLAGS=`$APXS -q CFLAGS`
  34. APXS_MPM=`$APXS -q MPM_NAME`
  35. for flag in $APXS_CFLAGS; do
  36. case $flag in
  37. -D*) CPPFLAGS="$CPPFLAGS $flag";;
  38. esac
  39. done
  40. # Test that we're trying to configure with apache 2.x
  41. PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
  42. if test "$APACHE_VERSION" -le 2000000; then
  43. 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)])
  44. elif test "$APACHE_VERSION" -lt 2000044; then
  45. AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required.])
  46. fi
  47. APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
  48. if test -z `$APXS -q SYSCONFDIR`; then
  49. optarg=
  50. else
  51. optarg=-a
  52. fi
  53. INSTALL_IT='$(mkinstalldirs) '"$APXS_LIBEXECDIR && $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' -i ${optarg} -n php4"
  54. case $host_alias in
  55. *aix*)
  56. EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
  57. PHP_SELECT_SAPI(apache2handler, shared, sapi_apache2.c apache_config.c php_functions.c)
  58. INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
  59. ;;
  60. *darwin*)
  61. dnl When using bundles on Darwin, we must resolve all symbols. However,
  62. dnl the linker does not recursively look at the bundle loader and
  63. dnl pull in its dependencies. Therefore, we must pull in the APR
  64. dnl and APR-util libraries.
  65. APXS_BINDIR=`$APXS -q BINDIR`
  66. if test -f $APXS_BINDIR/apr-config; then
  67. MH_BUNDLE_FLAGS="`$APXS_BINDIR/apr-config --ldflags --link-ld --libs`"
  68. fi
  69. if test -f $APXS_BINDIR/apu-config; then
  70. MH_BUNDLE_FLAGS="`$APXS_BINDIR/apu-config --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
  71. fi
  72. MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
  73. PHP_SUBST(MH_BUNDLE_FLAGS)
  74. PHP_SELECT_SAPI(apache2handler, bundle, sapi_apache2.c apache_config.c php_functions.c)
  75. SAPI_SHARED=libs/libphp4.so
  76. INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
  77. ;;
  78. *beos*)
  79. APXS_BINDIR=`$APXS -q BINDIR`
  80. if test -f _APP_; then `rm _APP_`; fi
  81. `ln -s $APXS_BINDIR/httpd _APP_`
  82. EXTRA_LIBS="$EXTRA_LIBS _APP_"
  83. PHP_SELECT_SAPI(apache2handler, shared, sapi_apache2.c apache_config.c php_functions.c)
  84. INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
  85. ;;
  86. *)
  87. PHP_SELECT_SAPI(apache2handler, shared, sapi_apache2.c apache_config.c php_functions.c)
  88. INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
  89. ;;
  90. esac
  91. PHP_ADD_INCLUDE($APXS_INCLUDEDIR)
  92. if test "$APXS_MPM" != "prefork"; then
  93. PHP_BUILD_THREAD_SAFE
  94. fi
  95. AC_MSG_RESULT(yes)
  96. ],[
  97. AC_MSG_RESULT(no)
  98. ])
  99. PHP_SUBST(APXS)
  100. dnl ## Local Variables:
  101. dnl ## tab-width: 4
  102. dnl ## End: