source: src/router/php7/sapi/apache2handler/config.m4 @ 31879

Last change on this file since 31879 was 31879, checked in by brainslayer, 3 months ago

update php

File size: 4.4 KB
Line 
1dnl
2dnl $Id$
3dnl
4
5PHP_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
9AC_MSG_CHECKING([for Apache 2.0 handler-module support via DSO through APXS])
10
11if 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  APU_BINDIR=`$APXS -q APU_BINDIR`
42  APR_BINDIR=`$APXS -q APR_BINDIR`
43
44  # Pick up ap[ru]-N-config if using httpd >=2.1
45  APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null ||
46    echo $APR_BINDIR/apr-config`
47  APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null ||
48    echo $APU_BINDIR/apu-config`
49
50  APR_CFLAGS="`$APR_CONFIG --cppflags --includes`"
51  APU_CFLAGS="`$APU_CONFIG --includes`"
52
53  for flag in $APXS_CFLAGS; do
54    case $flag in
55    -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
56    esac
57  done
58
59  APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
60
61  # Test that we're trying to configure with apache 2.x
62  PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
63  if test "$APACHE_VERSION" -le 2000000; then
64    AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3.  Please use the appropriate switch --with-apxs (without the 2)])
65  elif test "$APACHE_VERSION" -lt 2000044; then
66    AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required])
67  fi
68
69  APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
70  INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
71               $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
72                     -i -n php7"
73
74  case $host_alias in
75  *aix*)
76    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
77    PHP_SELECT_SAPI(apache2handler, shared, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
78    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
79    ;;
80  *darwin*)
81    dnl When using bundles on Darwin, we must resolve all symbols.  However,
82    dnl the linker does not recursively look at the bundle loader and
83    dnl pull in its dependencies.  Therefore, we must pull in the APR
84    dnl and APR-util libraries.
85    if test -x "$APR_CONFIG"; then
86        MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"
87    fi
88    if test -x "$APU_CONFIG"; then
89        MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
90    fi
91    MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
92    PHP_SUBST(MH_BUNDLE_FLAGS)
93    PHP_SELECT_SAPI(apache2handler, bundle, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
94    SAPI_SHARED=libs/libphp7.so
95    INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
96    ;;
97  *beos*)
98    if test -f _APP_; then `rm _APP_`; fi
99    `ln -s $APXS_BINDIR/httpd _APP_`
100    EXTRA_LIBS="$EXTRA_LIBS _APP_"
101    PHP_SELECT_SAPI(apache2handler, shared, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
102    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
103    ;;
104  *)
105    PHP_SELECT_SAPI(apache2handler, shared, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
106    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
107    ;;
108  esac
109
110  if test "$APACHE_VERSION" -lt 2004001; then
111    APXS_MPM=`$APXS -q MPM_NAME`
112    if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser" && test "$APXS_MPM" != "itk"; then
113      PHP_BUILD_THREAD_SAFE
114    fi
115  else
116    APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`
117    if test -n "$APACHE_THREADED_MPM"; then
118      PHP_BUILD_THREAD_SAFE
119    fi
120  fi
121  AC_MSG_RESULT(yes)
122  PHP_SUBST(APXS)
123else
124  AC_MSG_RESULT(no)
125fi
126
127dnl ## Local Variables:
128dnl ## tab-width: 4
129dnl ## End:
Note: See TracBrowser for help on using the repository browser.