diff --git a/ext/bz2/config.m4 b/ext/bz2/config.m4 index 8cb198b820097..3a41e9835a75b 100644 --- a/ext/bz2/config.m4 +++ b/ext/bz2/config.m4 @@ -4,23 +4,17 @@ PHP_ARG_WITH([bz2], [Include BZip2 support])]) if test "$PHP_BZ2" != "no"; then - if test -r $PHP_BZ2/include/bzlib.h; then - BZIP_DIR=$PHP_BZ2 - else - AC_MSG_CHECKING([for BZip2 in default path]) + AS_IF([test -r $PHP_BZ2/include/bzlib.h], [BZIP_DIR=$PHP_BZ2], [ for i in /usr/local /usr; do - if test -r $i/include/bzlib.h; then - BZIP_DIR=$i - AC_MSG_RESULT([found in $i]) - break - fi + AS_IF([test -r $i/include/bzlib.h], [BZIP_DIR=$i; break;]) done - fi + ]) - if test -z "$BZIP_DIR"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please reinstall the BZip2 distribution]) - fi + AC_MSG_CHECKING([for BZip2]) + AS_VAR_IF([BZIP_DIR],, [ + AC_MSG_RESULT([bzlib.h not found]) + AC_MSG_ERROR([Please reinstall the BZip2 library package]) + ], [AC_MSG_RESULT([found in $BZIP_DIR])]) PHP_CHECK_LIBRARY([bz2], [BZ2_bzerror], [ PHP_ADD_INCLUDE([$BZIP_DIR/include])