diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-11 22:17:09 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-11 22:17:09 +0000 |
commit | 265edb83211d4fb523de01a7d9e97afdb6c7cf2c (patch) | |
tree | 3f80b2c7f4676d9f738aafa42271968bb6f5748d /libstdc++-v3/acinclude.m4 | |
parent | 873983a1f2ba7303096c00439011669b9caf2985 (diff) | |
download | gcc-265edb83211d4fb523de01a7d9e97afdb6c7cf2c.tar.gz |
2006-12-11 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/28125
* acinclude.m4 (GLIBCXX_CHECK_ICONV_SUPPORT): Remove link test, ie
AC_CHECK_LIB for libiconv. Instead, use bits of AM_ICONV.
* configure: Regenerate.
* scripts/testsuite_flags.in (cxxldflags): Add LIBICONV bits.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119749 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 38345fa2e32..660447b7d71 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -324,20 +324,30 @@ AC_DEFUN([GLIBCXX_CHECK_ICONV_SUPPORT], [ # Only continue checking if the ISO C99 headers exist and support is on. if test x"$enable_wchar_t" = xyes; then + # From Bruno Haible's AM_ICONV, but without link tests. + # Check for existence of libiconv.a providing XPG2 wchar_t support. + # Some systems have iconv in libc, some have it in libiconv (OSF/1 and + # those with the standalone portable GNU libiconv installed). + AC_ARG_WITH([libiconv-prefix], +[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LIBICONV="$LIBICONV -L$dir/lib"; fi + done + LIBICONV="$LIBICONV -liconv" + ]) + if test x"$LIBICONV" != x; then + AC_MSG_NOTICE([--with-libiconv-prefix is $LIBICONV]) + fi + # Use iconv for wchar_t to char conversions. As such, check for # X/Open Portability Guide, version 2 features (XPG2). AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no) AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no) - # Check for existence of libiconv.a providing XPG2 wchar_t support. - AC_CHECK_LIB(iconv, iconv, LIBICONV="-liconv") ac_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_SUBST(LIBICONV) - AC_CHECK_FUNCS([iconv_open iconv_close iconv nl_langinfo], [ac_XPG2funcs=yes], [ac_XPG2funcs=no]) - LIBS="$ac_save_LIBS" if test x"$ac_has_iconv_h" = xyes && @@ -347,6 +357,7 @@ AC_DEFUN([GLIBCXX_CHECK_ICONV_SUPPORT], [ AC_DEFINE([_GLIBCXX_USE_ICONV],1, [Define if iconv and related functions exist and are usable.]) enable_iconv=yes + AC_SUBST(LIBICONV) fi fi AC_MSG_CHECKING([for enabled iconv specializations]) |