PageRenderTime 63ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/php5/sapi/apache2handler/config.m4

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