Skip to content

Commit 8c18ae7

Browse files
authored
Autotools: Sync CS in bz2 extension (#15163)
- AS_* macros used - Checking message refactored
1 parent 49a08d5 commit 8c18ae7

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

ext/bz2/config.m4

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@ PHP_ARG_WITH([bz2],
44
[Include BZip2 support])])
55

66
if test "$PHP_BZ2" != "no"; then
7-
if test -r $PHP_BZ2/include/bzlib.h; then
8-
BZIP_DIR=$PHP_BZ2
9-
else
10-
AC_MSG_CHECKING([for BZip2 in default path])
7+
AS_IF([test -r $PHP_BZ2/include/bzlib.h], [BZIP_DIR=$PHP_BZ2], [
118
for i in /usr/local /usr; do
12-
if test -r $i/include/bzlib.h; then
13-
BZIP_DIR=$i
14-
AC_MSG_RESULT([found in $i])
15-
break
16-
fi
9+
AS_IF([test -r $i/include/bzlib.h], [BZIP_DIR=$i; break;])
1710
done
18-
fi
11+
])
1912

20-
if test -z "$BZIP_DIR"; then
21-
AC_MSG_RESULT([not found])
22-
AC_MSG_ERROR([Please reinstall the BZip2 distribution])
23-
fi
13+
AC_MSG_CHECKING([for BZip2])
14+
AS_VAR_IF([BZIP_DIR],, [
15+
AC_MSG_RESULT([bzlib.h not found])
16+
AC_MSG_ERROR([Please reinstall the BZip2 library package])
17+
], [AC_MSG_RESULT([found in $BZIP_DIR])])
2418

2519
PHP_CHECK_LIBRARY([bz2], [BZ2_bzerror], [
2620
PHP_ADD_INCLUDE([$BZIP_DIR/include])

0 commit comments

Comments
 (0)