cvs: php4 / acinclude.m4 /ext/iconv iconv.c

From: Date: Thu, 21 Mar 2002 20:22:05 +0000
Subject: cvs: php4 / acinclude.m4 /ext/iconv iconv.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10546@lists.php.net to get a copy of this message
sniper Thu Mar 21 15:22:05 2002 EDT Modified files: /php4 acinclude.m4 /php4/ext/iconv iconv.c Log: - Fixed bug #16165 again. We check libc for iconv functions only if no path is given for --with-iconv. # I hope this is the last time. Index: php4/acinclude.m4 diff -u php4/acinclude.m4:1.173 php4/acinclude.m4:1.174 --- php4/acinclude.m4:1.173 Wed Mar 20 13:16:51 2002 +++ php4/acinclude.m4 Thu Mar 21 15:22:05 2002 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.173 2002/03/20 18:16:51 sniper Exp $ +dnl $Id: acinclude.m4,v 1.174 2002/03/21 20:22:05 sniper Exp $ dnl dnl This file contains local autoconf functions. @@ -1374,14 +1374,25 @@ found_iconv=no unset ICONV_DIR - AC_CHECK_FUNC(iconv, [ - PHP_DEFINE(HAVE_ICONV) - found_iconv=yes - ],[ - AC_CHECK_FUNC(libiconv,[ - PHP_DEFINE(HAVE_LIBICONV) + dnl + dnl Check libc first if no path is provided in --with-iconv + dnl + if test "$PHP_ICONV" = "yes"; then + AC_CHECK_FUNC(iconv, [ + PHP_DEFINE(HAVE_ICONV) found_iconv=yes - ],[ + ],[ + AC_CHECK_FUNC(libiconv,[ + PHP_DEFINE(HAVE_LIBICONV) + found_iconv=yes + ]) + ]) + fi + + dnl + dnl Check external libs for iconv funcs + dnl + if test "$found_iconv" = "no"; then for i in $PHP_ICONV /usr/local /usr; do if test -r $i/include/giconv.h; then @@ -1396,7 +1407,7 @@ 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 install prefix of iconv with --with-iconv=<DIR>]) fi if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a || @@ -1416,11 +1427,11 @@ -L$ICONV_DIR/lib ]) fi - ]) - ]) + fi if test "$found_iconv" = "yes"; then if test -n "$ICONV_DIR"; then + AC_DEFINE(HAVE_ICONV, 1, [ ]) PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, $1) PHP_ADD_INCLUDE($ICONV_DIR/include) fi Index: php4/ext/iconv/iconv.c diff -u php4/ext/iconv/iconv.c:1.34 php4/ext/iconv/iconv.c:1.35 --- php4/ext/iconv/iconv.c:1.34 Wed Mar 20 08:24:59 2002 +++ php4/ext/iconv/iconv.c Thu Mar 21 15:22:05 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: iconv.c,v 1.34 2002/03/20 13:24:59 sas Exp $ */ +/* $Id: iconv.c,v 1.35 2002/03/21 20:22:05 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -32,7 +32,12 @@ #if HAVE_ICONV +#ifdef HAVE_GICONV_H +#include <giconv.h> +#else #include <iconv.h> +#endif + #include <errno.h> #include "php_globals.h"

« previous php.cvs (#10546) next »