Browse Source

- Made one test/setup macro for iconv and fixed it to check

for libc first.
experimental/new_ui_api
foobar 24 years ago
parent
commit
19e82a49f9
  1. 50
      acinclude.m4
  2. 33
      ext/iconv/config.m4
  3. 24
      ext/rpc/xmlrpc/config.m4
  4. 24
      ext/xmlrpc/config.m4
  5. 25
      ext/xslt/config.m4

50
acinclude.m4

@ -1339,4 +1339,54 @@ AC_DEFUN(PHP_CHECK_LIBRARY, [
])
dnl
dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])
dnl
dnl Common setup macro for iconv
dnl
AC_DEFUN(PHP_SETUP_ICONV, [
found_iconv=no
AC_CHECK_LIB(c, iconv_open, [
AC_DEFINE(HAVE_ICONV, 1, [ ])
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
ICONV_DIR=$i
if test -r $i/include/giconv.h; then
iconv_lib_name=giconv
fi
break
fi
done
if test -z "$ICONV_DIR"; then
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
then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv_open, [
found_iconv=yes
PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, $1)
AC_DEFINE(HAVE_ICONV, 1, [ ])
AC_DEFINE(HAVE_LIBICONV, 1, [ ])
], [
found_iconv=no
], [
-L$ICONV_DIR/lib
])
fi
])
if test "$found_iconv" = "no"; then
$3
else
$2
PHP_ADD_INCLUDE($ICONV_DIR/include)
fi
])

33
ext/iconv/config.m4

@ -7,34 +7,11 @@ PHP_ARG_WITH(iconv, for iconv support,
if test "$PHP_ICONV" != "no"; then
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
ICONV_DIR=$i
if test -r $i/include/giconv.h; then
iconv_lib_name=giconv
fi
break
fi
done
if test -z "$ICONV_DIR"; then
PHP_SETUP_ICONV(ICONV_SHARED_LIBADD, [
PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared)
PHP_SUBST(ICONV_SHARED_LIBADD)
], [
AC_MSG_ERROR(Please reinstall the iconv library.)
fi
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_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, ICONV_SHARED_LIBADD)
AC_CHECK_LIB($iconv_lib_name, libiconv_open, [
AC_DEFINE(HAVE_ICONV, 1, [ ])
AC_DEFINE(HAVE_LIBICONV, 1, [ ])
])
else
AC_CHECK_LIB(c, iconv_open, AC_DEFINE(HAVE_ICONV, 1, [ ]))
fi
])
PHP_ADD_INCLUDE($ICONV_DIR/include)
PHP_EXTENSION(iconv, $ext_shared)
PHP_SUBST(ICONV_SHARED_LIBADD)
fi

24
ext/rpc/xmlrpc/config.m4

@ -32,29 +32,9 @@ if test "$PHP_XMLRPC" != "no"; then
AC_MSG_ERROR(XML-RPC support requires libexpat. Use --with-expat-dir=<DIR>)
fi
found_iconv=no
if test -z "$ICONV_DIR"; then
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
then
PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, XMLRPC_SHARED_LIBADD)
AC_CHECK_LIB($iconv_lib_name, libiconv_open, [
found_iconv=yes
])
else
AC_CHECK_LIB(c, iconv_open, [
found_iconv=yes
])
fi
if test "$found_iconv" = "no"; then
PHP_SETUP_ICONV(XMLRPC_SHARED_LIBADD, [], [
AC_MSG_ERROR([iconv not found, in order to build xmlrpc you need the iconv library])
fi
])
fi

24
ext/xmlrpc/config.m4

@ -32,29 +32,9 @@ if test "$PHP_XMLRPC" != "no"; then
AC_MSG_ERROR(XML-RPC support requires libexpat. Use --with-expat-dir=<DIR>)
fi
found_iconv=no
if test -z "$ICONV_DIR"; then
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
then
PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, XMLRPC_SHARED_LIBADD)
AC_CHECK_LIB($iconv_lib_name, libiconv_open, [
found_iconv=yes
])
else
AC_CHECK_LIB(c, iconv_open, [
found_iconv=yes
])
fi
if test "$found_iconv" = "no"; then
PHP_SETUP_ICONV(XMLRPC_SHARED_LIBADD, [], [
AC_MSG_ERROR([iconv not found, in order to build xmlrpc you need the iconv library])
fi
])
fi

25
ext/xslt/config.m4

@ -69,29 +69,10 @@ if test "$PHP_XSLT" != "no"; then
PHP_ADD_LIBRARY(xmltok)
fi
found_iconv=no
if test -z "$ICONV_DIR"; then
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
then
PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, XSLT_SHARED_LIBADD)
AC_CHECK_LIB($iconv_lib_name, libiconv_open, [
found_iconv=yes
])
else
AC_CHECK_LIB(c, iconv_open, [
found_iconv=yes
])
fi
if test "$found_iconv" = "no"; then
PHP_SETUP_ICONV(XSLT_SHARED_LIBADD, [], [
AC_MSG_ERROR([iconv not found, in order to build sablotron you need the iconv library])
fi
])
if test "$PHP_SABLOT_JS" != "no"; then
found_js=no
AC_CHECK_LIB(js, JS_GetRuntime, found_js=yes)

Loading…
Cancel
Save