diff options
author | Joel Brobecker <brobecker@gnat.com> | 2009-05-06 23:05:28 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2009-05-06 23:05:28 +0000 |
commit | 4edb1e84b10c08cf1606165ec3918aa1724b219f (patch) | |
tree | c37192f3d43c71a2ad9e8ad903fb3039fc3bb6b8 /gdb/acinclude.m4 | |
parent | 8626589c42c3cdb9784be37fff88f631a5f25b6e (diff) | |
download | gdb-4edb1e84b10c08cf1606165ec3918aa1724b219f.zip gdb-4edb1e84b10c08cf1606165ec3918aa1724b219f.tar.gz gdb-4edb1e84b10c08cf1606165ec3918aa1724b219f.tar.bz2 |
* acinclude.m4 (AM_ICONV): Prefer in-tree libiconv if present over
system iconv.
* configure: Regenerate.
Diffstat (limited to 'gdb/acinclude.m4')
-rw-r--r-- | gdb/acinclude.m4 | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index d1f71c1..c32e1ea 100644 --- a/gdb/acinclude.m4 +++ b/gdb/acinclude.m4 @@ -189,47 +189,51 @@ AC_DEFUN([AM_ICONV], am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no am_cv_use_build_libiconv=no - # First, try to find iconv in libc. - AC_TRY_LINK([#include <stdlib.h> -#include <iconv.h>], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_func_iconv=yes) - # If iconv was not in libc, try -liconv. In this case, arrange to - # look in the libiconv prefix, if it was specified by the user. - if test "$am_cv_func_iconv" != yes; then - am_save_CPPFLAGS="$CPPFLAGS" + # If libiconv is part of the build tree, then try using it over + # any system iconv. + if test -d ../libiconv; then am_save_LIBS="$LIBS" - if test -n "$LIBICONV_INCLUDE"; then - CPPFLAGS="$CPPFLAGS $LIBICONV_INCLUDE" - LIBS="$LIBS $LIBICONV_LIBDIR" - fi - LIBS="$LIBS -liconv" + am_save_CPPFLAGS="$CPPFLAGS" + LIBS="$LIBS $BUILD_LIBICONV_LIBDIR -liconv" + CPPFLAGS="$CPPFLAGS $BUILD_LIBICONV_INCLUDE" AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], + am_cv_use_build_libiconv=yes am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" CPPFLAGS="$am_save_CPPFLAGS" fi - # If that didn't work, try to find libiconv in the build tree. - if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then - am_save_LIBS="$LIBS" + # Next, try to find iconv in libc. + if test "$am_cv_func_iconv" != yes; then + AC_TRY_LINK([#include <stdlib.h> +#include <iconv.h>], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + fi + + # If iconv was not in libc, try -liconv. In this case, arrange to + # look in the libiconv prefix, if it was specified by the user. + if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" - LIBS="$LIBS $BUILD_LIBICONV_LIBDIR -liconv" - CPPFLAGS="$CPPFLAGS $BUILD_LIBICONV_INCLUDE" + am_save_LIBS="$LIBS" + if test -n "$LIBICONV_INCLUDE"; then + CPPFLAGS="$CPPFLAGS $LIBICONV_INCLUDE" + LIBS="$LIBS $LIBICONV_LIBDIR" + fi + LIBS="$LIBS -liconv" AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - am_cv_use_build_libiconv=yes am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" |