diff --git a/ext/cpdf/config.m4 b/ext/cpdf/config.m4 index 4f9a8e5cbc6..b1bce3bab41 100644 --- a/ext/cpdf/config.m4 +++ b/ext/cpdf/config.m4 @@ -58,7 +58,7 @@ AC_ARG_WITH(cpdflib, CPDF_JPEG_TEST CPDF_TIFF_TEST - for i in $cpdf_withval /usr /usr/local; do + for i in $cpdf_withval /usr/local /usr; do if test -f "$i/include/cpdflib.h"; then CPDFLIB_INCLUDE=$i/include AC_MSG_CHECKING(for cpdflib.h) diff --git a/ext/crack/config.m4 b/ext/crack/config.m4 index 55757ab14c9..0a9768f54d2 100644 --- a/ext/crack/config.m4 +++ b/ext/crack/config.m4 @@ -7,27 +7,26 @@ PHP_ARG_WITH(crack, for CRACKlib support, if test "$PHP_CRACK" != "no"; then - for i in $PHP_CRACK/lib $PHP_CRACK/cracklib /usr/local/lib /usr/lib; do - test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i - done + for i in $PHP_CRACK/lib $PHP_CRACK/cracklib /usr/local/lib /usr/lib; do + test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i && break + done - for i in $PHP_CRACK/include $PHP_CRACK/cracklib /usr/local/include /usr/include; do - test -f $i/packer.h && CRACK_INCLUDEDIR=$i - done + if test -z "$CRACK_LIBDIR"; then + AC_MSG_ERROR(Cannot find the cracklib library file) + fi + + for i in $PHP_CRACK/include $PHP_CRACK/cracklib /usr/local/include /usr/include; do + test -f $i/packer.h && CRACK_INCLUDEDIR=$i && break + done - if test -z "$CRACK_LIBDIR"; then - AC_MSG_ERROR(Cannot find the cracklib library file) - fi + if test -z "$CRACK_INCLUDEDIR"; then + AC_MSG_ERROR(Cannot find a cracklib header file) + fi - if test -z "$CRACK_INCLUDEDIR"; then - AC_MSG_ERROR(Cannot find a cracklib header file) - fi + PHP_ADD_INCLUDE($CRACK_INCLUDEDIR) + PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD) - PHP_ADD_INCLUDE($CRACK_INCLUDEDIR) - PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD) - - PHP_NEW_EXTENSION(crack, crack.c, $ext_shared) - PHP_SUBST(CRACK_SHARED_LIBADD) - AC_DEFINE(HAVE_CRACK, 1, [ ]) + PHP_NEW_EXTENSION(crack, crack.c, $ext_shared) + PHP_SUBST(CRACK_SHARED_LIBADD) + AC_DEFINE(HAVE_CRACK, 1, [ ]) fi - diff --git a/ext/fbsql/config.m4 b/ext/fbsql/config.m4 index 14360ce8b2b..60707d3269e 100644 --- a/ext/fbsql/config.m4 +++ b/ext/fbsql/config.m4 @@ -13,7 +13,7 @@ if test "$PHP_FBSQL" != "no"; then FBSQL_INSTALLATION_DIR="" if test "$PHP_FBSQL" = "yes"; then - for i in /Local/Library /usr /usr/local /opt /Library /usr/lib; do + for i in /Local/Library /usr/local /usr /opt /Library /usr/lib; do if test -f $i/FrontBase/include/FBCAccess/FBCAccess.h; then FBSQL_INSTALLATION_DIR=$i/FrontBase break diff --git a/ext/fdf/config.m4 b/ext/fdf/config.m4 index 2ed695e17e6..ada0f80e95f 100644 --- a/ext/fdf/config.m4 +++ b/ext/fdf/config.m4 @@ -23,7 +23,7 @@ if test "$PHP_FDFTK" != "no"; then esac if test "$PHP_FDFTK" = "yes"; then - PHP_FDFTK="/usr /usr/local ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk" + PHP_FDFTK="/usr/local /usr ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk" fi for dir in $PHP_FDFTK; do diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index fa21f81a135..aacb084e13c 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -50,8 +50,8 @@ dnl AC_DEFUN(PHP_GD_JPEG,[ if test "$PHP_JPEG_DIR" != "no"; then - for i in $PHP_JPEG_DIR /usr /usr/local; do - test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i + for i in $PHP_JPEG_DIR /usr/local /usr; do + test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i && break done if test -z "$GD_JPEG_DIR"; then @@ -75,8 +75,8 @@ AC_DEFUN(PHP_GD_JPEG,[ AC_DEFUN(PHP_GD_PNG,[ if test "$PHP_PNG_DIR" != "no"; then - for i in $PHP_PNG_DIR /usr /usr/local; do - test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i + for i in $PHP_PNG_DIR /usr/local /usr; do + test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i && break done if test -z "$GD_PNG_DIR"; then @@ -110,8 +110,8 @@ AC_DEFUN(PHP_GD_PNG,[ AC_DEFUN(PHP_GD_XPM,[ if test "$PHP_XPM_DIR" != "no"; then - for i in $PHP_XPM_DIR /usr /usr/local /usr/X11R6; do - test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i + for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do + test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i && break done if test -z "$GD_XPM_DIR"; then @@ -144,9 +144,9 @@ AC_DEFUN(PHP_GD_XPM,[ AC_DEFUN(PHP_GD_FREETYPE1,[ if test "$PHP_TTF" != "no"; then if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then - if test -n "$PHP_TTF" ; then - for i in $PHP_TTF /usr /usr/local; do - if test -f "$i/include/freetype.h" ; then + if test -n "$PHP_TTF"; then + for i in $PHP_TTF /usr/local /usr; do + if test -f "$i/include/freetype.h"; then TTF_DIR=$i unset TTF_INC_DIR fi @@ -158,6 +158,7 @@ AC_DEFUN(PHP_GD_FREETYPE1,[ TTF_DIR=$i TTF_INC_DIR=$i/include/freetype1/freetype fi + test -n "$TTF_DIR" && break done fi if test -n "$TTF_DIR" ; then @@ -178,10 +179,11 @@ AC_DEFUN(PHP_GD_FREETYPE1,[ AC_DEFUN(PHP_GD_FREETYPE2,[ if test "$PHP_FREETYPE_DIR" != "no"; then - for i in $PHP_FREETYPE_DIR /usr /usr/local; do + for i in $PHP_FREETYPE_DIR /usr/local /usr; do if test -f "$i/include/freetype2/freetype/freetype.h"; then FREETYPE2_DIR=$i FREETYPE2_INC_DIR=$i/include/freetype2 + break fi done @@ -202,8 +204,8 @@ AC_DEFUN(PHP_GD_FREETYPE2,[ AC_DEFUN(PHP_GD_T1LIB,[ if test "$PHP_T1LIB" != "no"; then - for i in $PHP_T1LIB /usr /usr/local; do - test -f "$i/include/t1lib.h" && GD_T1_DIR=$i + for i in $PHP_T1LIB /usr/local /usr; do + test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break done if test -z "$GD_T1_DIR"; then diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4 index 6cb1dd91c16..23bc9ae6f35 100644 --- a/ext/gettext/config.m4 +++ b/ext/gettext/config.m4 @@ -6,10 +6,8 @@ PHP_ARG_WITH(gettext,for GNU gettext support, [ --with-gettext[=DIR] Include GNU gettext support.]) if test "$PHP_GETTEXT" != "no"; then - for i in $PHP_GETTEXT /usr /usr/local; do - if test -r $i/include/libintl.h; then - GETTEXT_DIR=$i - fi + for i in $PHP_GETTEXT /usr/local /usr; do + test -r $i/include/libintl.h && GETTEXT_DIR=$i && break done if test -z "$GETTEXT_DIR"; then diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4 index 8548811bb7d..39e1bb24f93 100644 --- a/ext/gmp/config.m4 +++ b/ext/gmp/config.m4 @@ -8,18 +8,17 @@ PHP_ARG_WITH(gmp, for GNU MP support, if test "$PHP_GMP" != "no"; then for i in $PHP_GMP /usr/local /usr; do - if test -f $i/include/gmp.h; then - GMP_DIR=$i - fi + test -f $i/include/gmp.h && GMP_DIR=$i && break done if test -z "$GMP_DIR"; then AC_MSG_ERROR(Unable to locate gmp.h) fi + + PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/lib, GMP_SHARED_LIBADD) PHP_ADD_INCLUDE($GMP_DIR/include) PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared) - AC_DEFINE(HAVE_GMP, 1, [ ]) PHP_SUBST(GMP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/lib, GMP_SHARED_LIBADD) + AC_DEFINE(HAVE_GMP, 1, [ ]) fi diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 index 146ce8f3d72..ceefb0d04af 100644 --- a/ext/imap/config.m4 +++ b/ext/imap/config.m4 @@ -6,18 +6,17 @@ AC_DEFUN(IMAP_INC_CHK,[if test -r "$i$1/c-client.h"; then AC_DEFINE(HAVE_IMAP2000, 1, [ ]) IMAP_DIR=$i IMAP_INC_DIR=$i$1 + break elif test -r "$i$1/rfc822.h"; then IMAP_DIR=$i; IMAP_INC_DIR=$i$1 + break ]) AC_DEFUN(IMAP_LIB_CHK,[ str="$IMAP_DIR/$1/lib$lib.*" for i in `echo $str`; do - if test -r $i; then - IMAP_LIBDIR=$IMAP_DIR/$1 - break 2 - fi + test -r $i && IMAP_LIBDIR=$IMAP_DIR/$1 && break 2 done ]) diff --git a/ext/mcrypt/config.m4 b/ext/mcrypt/config.m4 index 76c097cdddc..4d9cc3eb068 100644 --- a/ext/mcrypt/config.m4 +++ b/ext/mcrypt/config.m4 @@ -25,9 +25,7 @@ PHP_ARG_WITH(mcrypt, for mcrypt support, if test "$PHP_MCRYPT" != "no"; then for i in $PHP_MCRYPT /usr/local /usr; do - if test -f $i/include/mcrypt.h; then - MCRYPT_DIR=$i - fi + test -f $i/include/mcrypt.h && MCRYPT_DIR=$i && break done if test -z "$MCRYPT_DIR"; then diff --git a/ext/mhash/config.m4 b/ext/mhash/config.m4 index da7286e49fc..6b93decbcb7 100644 --- a/ext/mhash/config.m4 +++ b/ext/mhash/config.m4 @@ -7,19 +7,17 @@ PHP_ARG_WITH(mhash, for mhash support, if test "$PHP_MHASH" != "no"; then for i in $PHP_MHASH /usr/local /usr /opt/mhash; do - if test -f $i/include/mhash.h; then - MHASH_DIR=$i - fi + test -f $i/include/mhash.h && MHASH_DIR=$i && break done if test -z "$MHASH_DIR"; then AC_MSG_ERROR(Please reinstall libmhash - I cannot find mhash.h) fi + PHP_ADD_INCLUDE($MHASH_DIR/include) PHP_ADD_LIBRARY_WITH_PATH(mhash, $MHASH_DIR/lib, MHASH_SHARED_LIBADD) - PHP_SUBST(MHASH_SHARED_LIBADD) - - AC_DEFINE(HAVE_LIBMHASH,1,[ ]) PHP_NEW_EXTENSION(mhash, mhash.c, $ext_shared) + PHP_SUBST(MHASH_SHARED_LIBADD) + AC_DEFINE(HAVE_LIBMHASH,1,[ ]) fi diff --git a/ext/ovrimos/config.m4 b/ext/ovrimos/config.m4 index 19482f39cbd..e22148ea121 100644 --- a/ext/ovrimos/config.m4 +++ b/ext/ovrimos/config.m4 @@ -8,9 +8,7 @@ PHP_ARG_WITH(ovrimos, for Ovrimos SQL Server support, if test "$PHP_OVRIMOS" != "no"; then for i in $PHP_OVRIMOS /usr/local /usr; do - if test -f $i/include/sqlcli.h; then - OVRIMOS_DIR=$i - fi + test -f $i/include/sqlcli.h && OVRIMOS_DIR=$i && break done if test -z "$OVRIMOS_DIR"; then @@ -18,11 +16,11 @@ if test "$PHP_OVRIMOS" != "no"; then fi PHP_ADD_INCLUDE($OVRIMOS_DIR/include) - PHP_SUBST(OVRIMOS_SHARED_LIBADD) LDFLAGS="$LDFLAGS $ld_runpath_switch$OVRIMOS_DIR/lib -L$OVRIMOS_DIR/lib" AC_CHECK_LIB(sqlcli, main) PHP_ADD_LIBRARY_WITH_PATH(sqlcli, $OVRIMOS_DIR/lib, OVRIMOS_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBSQLCLI,1,[ ]) PHP_NEW_EXTENSION(ovrimos, ovrimos.c, $ext_shared) + PHP_SUBST(OVRIMOS_SHARED_LIBADD) + AC_DEFINE(HAVE_LIBSQLCLI,1,[ ]) fi diff --git a/ext/pfpro/config.m4 b/ext/pfpro/config.m4 index 17424aae10c..b18abd3ab59 100644 --- a/ext/pfpro/config.m4 +++ b/ext/pfpro/config.m4 @@ -25,6 +25,8 @@ if test "$PHP_PFPRO" != "no"; then elif test -r $i/lib/$PFPRO_LIB; then PFPRO_LIB_DIR=$i/lib fi + + test -n "$PFPRO_INC_DIR" && test -n "$PFPRO_LIB_DIR" && break done if test -z "$PFPRO_INC_DIR"; then diff --git a/ext/readline/config.m4 b/ext/readline/config.m4 index e5c2a057a03..7df38b247a9 100644 --- a/ext/readline/config.m4 +++ b/ext/readline/config.m4 @@ -10,9 +10,7 @@ PHP_ARG_WITH(readline,for readline support, if test "$PHP_READLINE" != "no"; then for i in $PHP_READLINE /usr/local /usr; do - if test -f $i/include/readline/readline.h; then - READLINE_DIR=$i - fi + test -f $i/include/readline/readline.h && READLINE_DIR=$i && break done if test -z "$READLINE_DIR"; then @@ -49,17 +47,14 @@ if test "$PHP_READLINE" != "no"; then -L$READLINE_DIR/lib ]) - PHP_SUBST(READLINE_SHARED_LIBADD) - - AC_DEFINE(HAVE_LIBREADLINE, 1, [ ]) PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli) + PHP_SUBST(READLINE_SHARED_LIBADD) + AC_DEFINE(HAVE_LIBREADLINE, 1, [ ]) elif test "$PHP_LIBEDIT" != "no"; then for i in $PHP_LIBEDIT /usr/local /usr; do - if test -f $i/include/readline/readline.h; then - LIBEDIT_DIR=$i - fi + test -f $i/include/readline/readline.h && LIBEDIT_DIR=$i && break done if test -z "$LIBEDIT_DIR"; then @@ -87,8 +82,7 @@ elif test "$PHP_LIBEDIT" != "no"; then -L$READLINE_DIR/lib ]) - PHP_SUBST(READLINE_SHARED_LIBADD) - - AC_DEFINE(HAVE_LIBEDIT, 1, [ ]) PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli) + PHP_SUBST(READLINE_SHARED_LIBADD) + AC_DEFINE(HAVE_LIBEDIT, 1, [ ]) fi diff --git a/ext/recode/config.m4 b/ext/recode/config.m4 index aae118a76b0..aa94914df8b 100644 --- a/ext/recode/config.m4 +++ b/ext/recode/config.m4 @@ -6,7 +6,7 @@ PHP_ARG_WITH(recode,for recode support, [ --with-recode[=DIR] Include recode support.]) if test "$PHP_RECODE" != "no"; then - RECODE_LIST="$PHP_RECODE /usr /usr/local /opt" + RECODE_LIST="$PHP_RECODE /usr/local /usr /opt" for i in $RECODE_LIST; do if test -f $i/include/recode.h; then @@ -24,6 +24,7 @@ if test "$PHP_RECODE" != "no"; then RECODE_INC=include RECODE_LIB=lib fi + test -n "$RECODE_DIR" && break done if test -z "$RECODE_DIR"; then diff --git a/ext/session/config.m4 b/ext/session/config.m4 index 9be3040d076..3f748996766 100644 --- a/ext/session/config.m4 +++ b/ext/session/config.m4 @@ -18,9 +18,7 @@ fi if test "$PHP_MM" != "no"; then for i in $PHP_MM /usr/local /usr; do - if test -f "$i/include/mm.h"; then - MM_DIR=$i - fi + test -f "$i/include/mm.h" && MM_DIR=$i && break done if test -z "$MM_DIR" ; then diff --git a/ext/xmlrpc/config.m4 b/ext/xmlrpc/config.m4 index 09d684e9215..8551f6b958c 100644 --- a/ext/xmlrpc/config.m4 +++ b/ext/xmlrpc/config.m4 @@ -22,12 +22,13 @@ if test "$PHP_XMLRPC" != "no"; then AC_DEFINE(HAVE_XMLRPC,1,[ ]) testval=no - for i in $PHP_EXPAT_DIR $XMLRPC_DIR /usr /usr/local; do + for i in $PHP_EXPAT_DIR $XMLRPC_DIR /usr/local /usr; do if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME; then AC_DEFINE(HAVE_LIBEXPAT2,1,[ ]) PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib, XMLRPC_SHARED_LIBADD) PHP_ADD_INCLUDE($i/include) testval=yes + break fi done @@ -76,6 +77,7 @@ dnl for xmlrpc-epi because of this. if test -r $i/include/xmlrpc.h; then XMLRPC_DIR=$i/include AC_MSG_RESULT(found in $i) + break fi done fi