PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/php5/sapi/apache2filter/config.m4

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