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