Skip to content

Commit 083493b

Browse files
authored
Fix AS_VAR_* checks (#14868)
AS_VAR_SET_IF doesn't behave the same as "test -n" and/or "test -z", which becomes an issue for Apache's ZTS automatic enabling and CFLAGS edge case where it would be explicitly set to empty value. It is safer to use AS_VAR_IF instead of AS_VAR_SET_IF in these cases.
1 parent 0b3c506 commit 083493b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ T_ME=`$php_shtool echo -n -e %b`
111111
PHP_INIT_BUILD_SYSTEM
112112

113113
dnl We want this one before the checks, so the checks can modify CFLAGS.
114-
AS_VAR_SET_IF([CFLAGS],, [auto_cflags=1])
114+
AS_VAR_IF([CFLAGS],, [auto_cflags=1])
115115

116116
abs_srcdir=`(cd $srcdir; pwd)`
117117
abs_builddir=`pwd`

sapi/apache2handler/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,5 @@ if test "$PHP_APXS2" != "no"; then
106106
esac
107107

108108
APACHE_THREADED_MPM=$($APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes')
109-
AS_VAR_SET_IF([APACHE_THREADED_MPM], [PHP_BUILD_THREAD_SAFE])
109+
AS_VAR_IF([APACHE_THREADED_MPM],,, [PHP_BUILD_THREAD_SAFE])
110110
fi

scripts/phpize.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ AC_DEFUN([PHP_ALWAYS_SHARED],[
2626
test "[$]$1" = "no" && $1=yes
2727
])dnl
2828

29-
AS_VAR_SET_IF([CFLAGS],, [auto_cflags=1])
29+
AS_VAR_IF([CFLAGS],, [auto_cflags=1])
3030

3131
abs_srcdir=`(cd $srcdir && pwd)`
3232
abs_builddir=`pwd`
@@ -62,7 +62,7 @@ INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
6262
EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
6363
PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
6464

65-
AS_VAR_SET_IF([prefix],,
65+
AS_VAR_IF([prefix],,
6666
[AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])])
6767

6868
php_shtool=$srcdir/build/shtool

0 commit comments

Comments
 (0)