Skip to content

Commit 7575905

Browse files
authored
Autotools: Refactor PEAR check (#14765)
- Synced CS: AS_VAR_IF style checks and M4 macro arguments quoted - Error message normalized without checking other errors appended (once more dependencies were required and additional error messages were appended)
1 parent a071d1c commit 7575905

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

configure.ac

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,7 @@ PHP_HELP_SEPARATOR([PEAR:])
11691169
PHP_CONFIGURE_PART(Configuring PEAR)
11701170

11711171
dnl If CLI is disabled disable PEAR.
1172-
if test "$PHP_CLI" = "no"; then
1173-
with_pear=no
1174-
fi
1172+
AS_VAR_IF([PHP_CLI], [no], [with_pear=no])
11751173

11761174
PHP_ARG_WITH([pear],
11771175
[whether to install PEAR],
@@ -1180,34 +1178,29 @@ PHP_ARG_WITH([pear],
11801178
[no],
11811179
[yes])
11821180

1183-
if test "$PHP_PEAR" != "no"; then
1181+
AS_VAR_IF([PHP_PEAR], [no],, [
1182+
AC_MSG_WARN([The --with-pear option is deprecated])
11841183
11851184
dnl PEAR dependencies.
1186-
if test "$PHP_XML" = "no"; then
1187-
pear_error_msg="$pear_error_msg
1188-
PEAR requires XML to be enabled. Add --enable-xml to the configure line. (or --without-pear)"
1189-
fi
1185+
AS_VAR_IF([PHP_XML], [no], [AC_MSG_ERROR([m4_normalize([
1186+
PEAR requires XML to be enabled. Add '--enable-xml' to the configure line,
1187+
or disable PEAR (--without-pear).
1188+
])])])
11901189
1191-
if test "$pear_error_msg"; then
1192-
AC_MSG_ERROR([$pear_error_msg])
1193-
fi
1194-
1195-
AC_MSG_WARN([The --with-pear option is deprecated])
1190+
install_pear=install-pear
11961191
1197-
install_pear="install-pear"
1198-
PEAR_INSTALLDIR=$PHP_PEAR
1199-
1200-
if test "$PHP_PEAR" = "yes"; then
1201-
case $PHP_LAYOUT in
1202-
GNU) PEAR_INSTALLDIR=$datadir/pear;;
1203-
*) PEAR_INSTALLDIR=$libdir/php;;
1204-
esac
1205-
fi
1192+
AS_VAR_IF([PHP_PEAR], [yes],
1193+
[AS_CASE([$PHP_LAYOUT],
1194+
[GNU], [PEAR_INSTALLDIR=$datadir/pear],
1195+
[PEAR_INSTALLDIR=$libdir/php])],
1196+
[PEAR_INSTALLDIR=$PHP_PEAR])
12061197
12071198
PHP_SUBST([PEAR_INSTALLDIR])
12081199
PHP_ADD_BUILD_DIR([pear])
1209-
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/pear/Makefile.frag,$abs_srcdir/pear,pear)
1210-
fi
1200+
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/pear/Makefile.frag],
1201+
[$abs_srcdir/pear],
1202+
[pear])
1203+
])
12111204

12121205
dnl Configuring Zend and TSRM.
12131206
dnl ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)