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
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
])