Missing parts of fixes for in-tree libiconv
(Commit d23d1dff missed pushing the config/iconv.m4 change, and to regenerate binutils' configure.) Original description: This is the second in a series of patches to make a build with an in-tree GNU libiconv work as designed. Currently GDB is the only toolchain component which actually uses an in-tree libiconv. This patch modifies the common AM_ICONV to use an in-tree libiconv when present and not already provided by libc. (GDB's workaround uses an in-tree libiconv even when libc provides iconv(3); I'm not sure when or why that would be desirable.) config/ChangeLog: 2015-08-24 Yaakov Selkowitz <yselkowi@redhat.com> * iconv.m4 (AM_ICONV_LINK): Use in-tree libiconv when present. binutils/ChangeLog: 2015-08-24 Yaakov Selkowitz <yselkowi@redhat.com> * configure: Regenerate.
This commit is contained in:
parent
b83035f1f6
commit
cfe101c6a8
4 changed files with 151 additions and 75 deletions
|
@ -1,3 +1,7 @@
|
|||
2015-08-24 Yaakov Selkowitz <yselkowi@redhat.com>
|
||||
|
||||
* configure: Regenerate.
|
||||
|
||||
2015-08-17 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* configure: Regenerate.
|
||||
|
|
171
binutils/configure
vendored
171
binutils/configure
vendored
|
@ -14135,7 +14135,112 @@ fi
|
|||
|
||||
|
||||
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
|
||||
$as_echo_n "checking for iconv... " >&6; }
|
||||
if test "${am_cv_func_iconv+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
am_cv_func_iconv="no, consider installing GNU libiconv"
|
||||
am_cv_lib_iconv=no
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $INCICONV"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
am_cv_func_iconv=yes
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
|
||||
if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then
|
||||
for _libs in .libs _libs; do
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
am_save_LIBS="$LIBS"
|
||||
CPPFLAGS="$CPPFLAGS -I../libiconv/include"
|
||||
LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
INCICONV="-I../libiconv/include"
|
||||
LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a
|
||||
LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la
|
||||
am_cv_lib_iconv=yes
|
||||
am_cv_func_iconv=yes
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBS="$am_save_LIBS"
|
||||
if test "$am_cv_func_iconv" = "yes"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$am_cv_func_iconv" != yes; then
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
am_save_LIBS="$LIBS"
|
||||
CPPFLAGS="$LIBS $INCICONV"
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
am_cv_lib_iconv=yes
|
||||
am_cv_func_iconv=yes
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBS="$am_save_LIBS"
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
|
||||
$as_echo "$am_cv_func_iconv" >&6; }
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
|
||||
$as_echo "#define HAVE_ICONV 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
if test "$am_cv_lib_iconv" = yes; then
|
||||
|
||||
for element in $INCICONV; do
|
||||
haveit=
|
||||
|
@ -14159,75 +14264,11 @@ fi
|
|||
fi
|
||||
done
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
|
||||
$as_echo_n "checking for iconv... " >&6; }
|
||||
if test "${am_cv_func_iconv+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
am_cv_func_iconv="no, consider installing GNU libiconv"
|
||||
am_cv_lib_iconv=no
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
am_cv_func_iconv=yes
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
if test "$am_cv_func_iconv" != yes; then
|
||||
am_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
am_cv_lib_iconv=yes
|
||||
am_cv_func_iconv=yes
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS="$am_save_LIBS"
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
|
||||
$as_echo "$am_cv_func_iconv" >&6; }
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
|
||||
$as_echo "#define HAVE_ICONV 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
if test "$am_cv_lib_iconv" = yes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
|
||||
$as_echo_n "checking how to link with libiconv... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
|
||||
$as_echo "$LIBICONV" >&6; }
|
||||
else
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBICONV=
|
||||
LTLIBICONV=
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2015-08-24 Yaakov Selkowitz <yselkowi@redhat.com>
|
||||
|
||||
* iconv.m4 (AM_ICONV_LINK): Use in-tree libiconv when present.
|
||||
|
||||
2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
Sync with GCC
|
||||
|
|
|
@ -7,6 +7,7 @@ dnl that contains a configuration script generated by Autoconf, under
|
|||
dnl the same distribution terms as the rest of that program.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
dnl with modifications to support building with in-tree libiconv
|
||||
|
||||
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
|
||||
[
|
||||
|
@ -28,24 +29,51 @@ AC_DEFUN([AM_ICONV_LINK],
|
|||
dnl accordingly.
|
||||
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
|
||||
|
||||
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
|
||||
dnl because if the user has installed libiconv and not disabled its use
|
||||
dnl via --without-libiconv-prefix, he wants to use it. The first
|
||||
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
|
||||
|
||||
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
|
||||
am_cv_func_iconv="no, consider installing GNU libiconv"
|
||||
am_cv_lib_iconv=no
|
||||
dnl Add $INCICONV to CPPFLAGS before performing the first check,
|
||||
dnl because if the user has installed libiconv and not disabled its use
|
||||
dnl via --without-libiconv-prefix, he wants to use it. This first
|
||||
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $INCICONV"
|
||||
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)
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
|
||||
if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then
|
||||
for _libs in .libs _libs; do
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
am_save_LIBS="$LIBS"
|
||||
CPPFLAGS="$CPPFLAGS -I../libiconv/include"
|
||||
LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a"
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
INCICONV="-I../libiconv/include"
|
||||
LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a
|
||||
LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la
|
||||
am_cv_lib_iconv=yes
|
||||
am_cv_func_iconv=yes)
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBS="$am_save_LIBS"
|
||||
if test "$am_cv_func_iconv" = "yes"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$am_cv_func_iconv" != yes; then
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
am_save_LIBS="$LIBS"
|
||||
CPPFLAGS="$LIBS $INCICONV"
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
|
@ -54,6 +82,7 @@ AC_DEFUN([AM_ICONV_LINK],
|
|||
iconv_close(cd);],
|
||||
am_cv_lib_iconv=yes
|
||||
am_cv_func_iconv=yes)
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBS="$am_save_LIBS"
|
||||
fi
|
||||
])
|
||||
|
@ -61,12 +90,10 @@ AC_DEFUN([AM_ICONV_LINK],
|
|||
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
|
||||
fi
|
||||
if test "$am_cv_lib_iconv" = yes; then
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
|
||||
AC_MSG_CHECKING([how to link with libiconv])
|
||||
AC_MSG_RESULT([$LIBICONV])
|
||||
else
|
||||
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
|
||||
dnl either.
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBICONV=
|
||||
LTLIBICONV=
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue