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.

129 lines
4.5 KiB

23 years ago
21 years ago
23 years ago
23 years ago
23 years ago
23 years ago
  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(apxs2,
  6. [ --with-apxs2[=FILE] Build shared Apache 2.0 Handler module. FILE is the optional
  7. pathname to the Apache apxs tool [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-apxs2=/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 -q CFLAGS
  29. AC_MSG_ERROR([Aborting])
  30. fi
  31. APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
  32. APXS_BINDIR=`$APXS -q BINDIR`
  33. APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
  34. APXS_CFLAGS=`$APXS -q CFLAGS`
  35. APXS_MPM=`$APXS -q MPM_NAME`
  36. APU_BINDIR=`$APXS -q APU_BINDIR`
  37. APR_BINDIR=`$APXS -q APR_BINDIR`
  38. # Pick up ap[ru]-N-config if using httpd >=2.1
  39. APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null ||
  40. echo $APR_BINDIR/apr-config`
  41. APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null ||
  42. echo $APU_BINDIR/apu-config`
  43. APR_CFLAGS="`$APR_CONFIG --cppflags --includes`"
  44. APU_CFLAGS="`$APU_CONFIG --includes`"
  45. for flag in $APXS_CFLAGS; do
  46. case $flag in
  47. -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
  48. esac
  49. done
  50. APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS"
  51. # Test that we're trying to configure with apache 2.x
  52. PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
  53. if test "$APACHE_VERSION" -le 2000000; then
  54. 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)])
  55. elif test "$APACHE_VERSION" -lt 2000044; then
  56. AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required])
  57. fi
  58. APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
  59. if test -z `$APXS -q SYSCONFDIR`; then
  60. INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
  61. $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
  62. -i -n php5"
  63. else
  64. APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
  65. INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
  66. \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
  67. $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
  68. -S SYSCONFDIR='$APXS_SYSCONFDIR' \
  69. -i -a -n php5"
  70. fi
  71. case $host_alias in
  72. *aix*)
  73. EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
  74. PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
  75. INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
  76. ;;
  77. *darwin*)
  78. dnl When using bundles on Darwin, we must resolve all symbols. However,
  79. dnl the linker does not recursively look at the bundle loader and
  80. dnl pull in its dependencies. Therefore, we must pull in the APR
  81. dnl and APR-util libraries.
  82. if test -x "$APR_CONFIG"; then
  83. MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"
  84. fi
  85. if test -x "$APU_CONFIG"; then
  86. MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
  87. fi
  88. MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
  89. PHP_SUBST(MH_BUNDLE_FLAGS)
  90. PHP_SELECT_SAPI(apache2handler, bundle, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
  91. SAPI_SHARED=libs/libphp5.so
  92. INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
  93. ;;
  94. *beos*)
  95. if test -f _APP_; then `rm _APP_`; fi
  96. `ln -s $APXS_BINDIR/httpd _APP_`
  97. EXTRA_LIBS="$EXTRA_LIBS _APP_"
  98. PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
  99. INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
  100. ;;
  101. *)
  102. PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
  103. INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
  104. ;;
  105. esac
  106. if test "$APXS_MPM" != "prefork"; then
  107. PHP_BUILD_THREAD_SAFE
  108. fi
  109. AC_MSG_RESULT(yes)
  110. PHP_SUBST(APXS)
  111. ],[
  112. AC_MSG_RESULT(no)
  113. ])
  114. dnl ## Local Variables:
  115. dnl ## tab-width: 4
  116. dnl ## End: