aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/configure')
-rwxr-xr-xgdb/configure27
1 files changed, 23 insertions, 4 deletions
diff --git a/gdb/configure b/gdb/configure
index fceba2a..51f35f5 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -10012,8 +10012,8 @@ if test "${with_libiconv_prefix+set}" = set; then
withval="$with_libiconv_prefix"
for dir in `echo "$withval" | tr : ' '`; do
- if test -d $dir/include; then LIBICONV_INCLUDE="-I$dir/include"; CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
- if test -d $dir/lib; then LIBICONV_LIBDIR="-L$dir/lib"; LDFLAGS="$LDFLAGS -L$dir/lib"; fi
+ if test -d $dir/include; then LIBICONV_INCLUDE="-I$dir/include"; fi
+ if test -d $dir/lib; then LIBICONV_LIBDIR="-L$dir/lib"; fi
done
fi;
@@ -10030,6 +10030,7 @@ else
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.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10078,8 +10079,16 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+
+ # 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"
am_save_LIBS="$LIBS"
+ if test -n "$LIBICONV_INCLUDE"; then
+ CPPFLAGS="$CPPFLAGS $LIBICONV_INCLUDE"
+ LIBS="$LIBS $LIBICONV_LIBDIR"
+ fi
LIBS="$LIBS -liconv"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -10131,8 +10140,10 @@ fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS="$am_save_LIBS"
+ CPPFLAGS="$am_save_CPPFLAGS"
fi
- # Look for libiconv in the build tree.
+
+ # 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"
am_save_CPPFLAGS="$CPPFLAGS"
@@ -10178,7 +10189,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- am_cv_lib_iconv=yes
+ am_cv_use_build_libiconv=yes
+ am_cv_lib_iconv=yes
am_cv_func_iconv=yes
else
echo "$as_me: failed program was:" >&5
@@ -10194,9 +10206,15 @@ rm -f conftest.err conftest.$ac_objext \
fi
echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5
echo "${ECHO_T}$am_cv_func_iconv" >&6
+
+ # Set the various flags based on the cache variables. We can't rely
+ # on the flags to remain set from the above code, due to caching.
LIBICONV=
if test "$am_cv_lib_iconv" = yes; then
LIBICONV="-liconv"
+ else
+ LIBICONV_LIBDIR=
+ LIBICONV_INCLUDE=
fi
if test "$am_cv_use_build_libiconv" = yes; then
LIBICONV_LIBDIR="$BUILD_LIBICONV_LIBDIR"
@@ -10204,6 +10222,7 @@ echo "${ECHO_T}$am_cv_func_iconv" >&6
fi
CPPFLAGS="$CPPFLAGS $LIBICONV_INCLUDE"
LIBS="$LIBS $LIBICONV_LIBDIR $LIBICONV"
+
if test "$am_cv_func_iconv" = yes; then
cat >>confdefs.h <<\_ACEOF