From: Sascha Schumann Date: Wed, 20 Mar 2002 12:08:30 +0000 (+0000) Subject: Avoid duplicate tests and make third parameter truly optional. X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~1189 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1962e1e62091457148ba0784dc40dbe68be37266;p=php Avoid duplicate tests and make third parameter truly optional. --- diff --git a/acinclude.m4 b/acinclude.m4 index 18c24182b3..949f1f9d89 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1362,23 +1362,24 @@ AC_DEFUN(PHP_SETUP_ICONV, [ found_iconv=yes ], [ - iconv_lib_name=iconv for i in $PHP_ICONV /usr/local /usr; do - if test -r $i/include/giconv.h || test -r $i/include/iconv.h; then + if test -r $i/include/giconv.h; then ICONV_DIR=$i - if test -r $i/include/giconv.h; then - iconv_lib_name=giconv - fi + iconv_lib_name=giconv break - fi + elif test -r $i/include/iconv.h; then + ICONV_DIR=$i + iconv_lib_name=iconv + break + fi done if test -z "$ICONV_DIR"; then - AC_MSG_ERROR(Please specify the location of iconv with --with-iconv) + AC_MSG_ERROR([Please specify the location of iconv with --with-iconv]) fi - if test -f $ICONV_DIR/lib/lib${iconv_lib_name}.a || - test -f $ICONV_DIR/lib/lib${iconv_lib_name}.$SHLIB_SUFFIX_NAME + if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a || + test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME then PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [ found_iconv=yes @@ -1394,13 +1395,12 @@ AC_DEFUN(PHP_SETUP_ICONV, [ fi ]) - if test "$found_iconv" = "no"; then - $3 - else + if test "$found_iconv" = "yes"; then if test -n "$ICONV_DIR"; then PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, $1) PHP_ADD_INCLUDE($ICONV_DIR/include) fi $2 +ifelse([$3],[],,[else $3]) fi ])