mirror of
https://github.com/php/php-src.git
synced 2025-01-20 18:53:37 +08:00
Fix for Bug 14423. Enables FreeBSD to use iconv functionality.
This commit is contained in:
parent
ce4bf31268
commit
a3010a9b8f
@ -7,15 +7,27 @@ PHP_ARG_WITH(iconv, for iconv support,
|
||||
|
||||
if test "$PHP_ICONV" != "no"; then
|
||||
|
||||
dnl This is a fix for why FreeBSD does not work with ICONV
|
||||
dnl It seems libtool checks for libiconv_open which only exists in
|
||||
dnl the giconv series of files under FreeBSD
|
||||
|
||||
ac_os_uname=`uname -s 2>/dev/null`
|
||||
|
||||
if test "$ac_os_uname" = "FreeBSD"; then
|
||||
lib_name=giconv
|
||||
else
|
||||
lib_name=iconv
|
||||
fi
|
||||
|
||||
for i in /usr /usr/local $PHP_ICONV; do
|
||||
test -r $i/include/iconv.h && ICONV_DIR=$i
|
||||
test -r $i/include/${lib_name}.h && ICONV_DIR=$i
|
||||
done
|
||||
|
||||
if test -z "$ICONV_DIR"; then
|
||||
AC_MSG_ERROR(Please reinstall the iconv library.)
|
||||
fi
|
||||
|
||||
if test -f $ICONV_DIR/lib/libconv.a -o -f $ICONV_DIR/lib/libiconv.$SHLIB_SUFFIX_NAME ; then
|
||||
if test -f $ICONV_DIR/lib/libconv.a -o -f $ICONV_DIR/lib/lib${lib_name}.$SHLIB_SUFFIX_NAME ; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(iconv, $ICONV_DIR/lib, ICONV_SHARED_LIBADD)
|
||||
AC_CHECK_LIB(iconv, libiconv_open, [
|
||||
AC_DEFINE(HAVE_ICONV, 1, [ ])
|
||||
|
@ -26,8 +26,9 @@
|
||||
#define PHP_ICONV_API
|
||||
#endif
|
||||
|
||||
#if HAVE_ICONV
|
||||
extern zend_module_entry iconv_module_entry;
|
||||
#define phpext_iconv_ptr &iconv_module_entry
|
||||
#define iconv_module_ptr &iconv_module_entry
|
||||
|
||||
PHP_MINIT_FUNCTION(miconv);
|
||||
PHP_MSHUTDOWN_FUNCTION(miconv);
|
||||
@ -54,6 +55,14 @@ ZEND_END_MODULE_GLOBALS(iconv)
|
||||
#define ICONV_OUTPUT_ENCODING "ISO-8859-1"
|
||||
#define ICONV_INTERNAL_ENCODING "ISO-8859-1"
|
||||
|
||||
#else
|
||||
|
||||
#define iconv_module_ptr NULL
|
||||
|
||||
#endif /* HAVE_ICONV */
|
||||
|
||||
#define phpext_iconv_ptr iconv_module_ptr
|
||||
|
||||
#endif /* PHP_ICONV_H */
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user