Skip to content

Commit 17ef4b7

Browse files
authored
Autotools: Sync CS in phpize and configure.ac (php#14838)
- This syncs Autoconf syntax with AS_VAR_* macros in phpize and configure.ac - The cross-compiling check synced with configure.ac (the check message printed after program check message) - Some redundant quoting removed
1 parent e4904a2 commit 17ef4b7

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

configure.ac

+5-5
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ T_ME=`$php_shtool echo -n -e %b`
112112
PHP_INIT_BUILD_SYSTEM
113113

114114
dnl We want this one before the checks, so the checks can modify CFLAGS.
115-
test -z "$CFLAGS" && auto_cflags=1
115+
AS_VAR_SET_IF([CFLAGS],, [auto_cflags=1])
116116

117117
abs_srcdir=`(cd $srcdir; pwd)`
118118
abs_builddir=`pwd`
@@ -1349,10 +1349,10 @@ unset LIBS LDFLAGS
13491349

13501350
AC_ARG_PROGRAM
13511351

1352-
test "$prefix" = "NONE" && prefix=/usr/local
1353-
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
1354-
test "$program_prefix" = "NONE" && program_prefix=
1355-
test "$program_suffix" = "NONE" && program_suffix=
1352+
AS_VAR_IF([prefix], [NONE], [prefix=/usr/local])
1353+
AS_VAR_IF([exec_prefix], [NONE], [exec_prefix='${prefix}'])
1354+
AS_VAR_IF([program_prefix], [NONE], [program_prefix=])
1355+
AS_VAR_IF([program_suffix], [NONE], [program_suffix=])
13561356

13571357
orig_libdir=$libdir
13581358
case $libdir in

scripts/phpize.m4

+10-13
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-
test -z "$CFLAGS" && auto_cflags=1
29+
AS_VAR_SET_IF([CFLAGS],, [auto_cflags=1])
3030

3131
abs_srcdir=`(cd $srcdir && pwd)`
3232
abs_builddir=`pwd`
@@ -62,9 +62,8 @@ 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-
if test -z "$prefix"; then
66-
AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])
67-
fi
65+
AS_VAR_SET_IF([prefix],,
66+
[AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])])
6867

6968
php_shtool=$srcdir/build/shtool
7069
PHP_INIT_BUILD_SYSTEM
@@ -167,16 +166,14 @@ CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
167166
CFLAGS_CLEAN='$(CFLAGS) -D_GNU_SOURCE'
168167
CXXFLAGS_CLEAN='$(CXXFLAGS)'
169168

170-
test "$prefix" = "NONE" && prefix="/usr/local"
171-
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
169+
AS_VAR_IF([prefix], [NONE], [prefix=/usr/local])
170+
AS_VAR_IF([exec_prefix], [NONE], [exec_prefix='$(prefix)'])
172171

173-
if test "$cross_compiling" = yes ; then
174-
AC_MSG_CHECKING(for native build C compiler)
175-
AC_CHECK_PROGS(BUILD_CC, [gcc clang c99 c89 cc cl],none)
176-
AC_MSG_RESULT($BUILD_CC)
177-
else
178-
BUILD_CC=$CC
179-
fi
172+
AS_VAR_IF([cross_compiling], [yes],
173+
[AC_CHECK_PROGS([BUILD_CC], [gcc clang c99 c89 cc cl], [none])
174+
AC_MSG_CHECKING([for native build C compiler])
175+
AC_MSG_RESULT([$BUILD_CC])],
176+
[BUILD_CC=$CC])
180177

181178
PHP_SUBST([PHP_MODULES])
182179
PHP_SUBST([PHP_ZEND_EX])

0 commit comments

Comments
 (0)