Skip to content

Commit 1739653

Browse files
authored
Autotools: Use AS_* macros in apache2handler SAPI (#15423)
1 parent 2438717 commit 1739653

File tree

1 file changed

+37
-41
lines changed

1 file changed

+37
-41
lines changed

sapi/apache2handler/config.m4

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ PHP_ARG_WITH([apxs2],
77
[no])
88

99
if test "$PHP_APXS2" != "no"; then
10-
if test "$PHP_APXS2" = "yes"; then
10+
AS_VAR_IF([PHP_APXS2], [yes], [
1111
APXS=apxs
1212
$APXS -q CFLAGS >/dev/null 2>&1
1313
if test "$?" != "0" && test -x /usr/sbin/apxs; then
1414
APXS=/usr/sbin/apxs
1515
fi
16-
else
17-
PHP_EXPAND_PATH([$PHP_APXS2], [APXS])
18-
fi
16+
],
17+
[PHP_EXPAND_PATH([$PHP_APXS2], [APXS])])
1918

2019
$APXS -q CFLAGS >/dev/null 2>&1
2120
if test "$?" != "0"; then
@@ -53,9 +52,7 @@ if test "$PHP_APXS2" != "no"; then
5352
APU_CFLAGS="`$APU_CONFIG --includes`"
5453

5554
for flag in $APXS_CFLAGS; do
56-
case $flag in
57-
-D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
58-
esac
55+
AS_CASE([$flag], [-D*], [APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag"])
5956
done
6057

6158
APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
@@ -82,42 +79,41 @@ if test "$PHP_APXS2" != "no"; then
8279
LIBPHP_CFLAGS="-shared"
8380
PHP_SUBST([LIBPHP_CFLAGS])
8481

85-
case $host_alias in
86-
*aix*)
87-
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
88-
PHP_SELECT_SAPI([apache2handler],
89-
[shared],
90-
[mod_php.c sapi_apache2.c apache_config.c php_functions.c],
91-
[$APACHE_CFLAGS])
92-
INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
93-
;;
94-
*darwin*)
95-
dnl When using bundles on Darwin, we must resolve all symbols. However, the
96-
dnl linker does not recursively look at the bundle loader and pull in its
97-
dnl dependencies. Therefore, we must pull in the APR and APR-util libraries.
98-
if test -x "$APR_CONFIG"; then
82+
AS_CASE([$host_alias],
83+
[*aix*], [
84+
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
85+
PHP_SELECT_SAPI([apache2handler],
86+
[shared],
87+
[mod_php.c sapi_apache2.c apache_config.c php_functions.c],
88+
[$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 pull in
94+
dnl its dependencies. Therefore, we must pull in the APR and APR-util
95+
dnl libraries.
96+
if test -x "$APR_CONFIG"; then
9997
MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"
100-
fi
101-
if test -x "$APU_CONFIG"; then
98+
fi
99+
if test -x "$APU_CONFIG"; then
102100
MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
103-
fi
104-
MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
105-
PHP_SUBST([MH_BUNDLE_FLAGS])
106-
PHP_SELECT_SAPI([apache2handler],
107-
[bundle],
108-
[mod_php.c sapi_apache2.c apache_config.c php_functions.c],
109-
[$APACHE_CFLAGS])
110-
SAPI_SHARED=libs/libphp.so
111-
INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
112-
;;
113-
*)
114-
PHP_SELECT_SAPI([apache2handler],
115-
[shared],
116-
[mod_php.c sapi_apache2.c apache_config.c php_functions.c],
117-
[$APACHE_CFLAGS])
118-
INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
119-
;;
120-
esac
101+
fi
102+
MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
103+
PHP_SUBST([MH_BUNDLE_FLAGS])
104+
PHP_SELECT_SAPI([apache2handler],
105+
[bundle],
106+
[mod_php.c sapi_apache2.c apache_config.c php_functions.c],
107+
[$APACHE_CFLAGS])
108+
SAPI_SHARED=libs/libphp.so
109+
INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
110+
], [
111+
PHP_SELECT_SAPI([apache2handler],
112+
[shared],
113+
[mod_php.c sapi_apache2.c apache_config.c php_functions.c],
114+
[$APACHE_CFLAGS])
115+
INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
116+
])
121117

122118
AS_IF([$APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes' >/dev/null 2>&1], [
123119
APACHE_THREADED_MPM=yes

0 commit comments

Comments
 (0)