This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Fix cross-Linux libstdc++ configuration issues
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Fri, 6 Jun 2008 15:25:25 +0000 (UTC)
- Subject: Fix cross-Linux libstdc++ configuration issues
This patch updates the configuration when cross-compiling libstdc++
for GNU/Linux, uClinux and other systems using the same configuration
code to be closer to the native configuration.
* Native tests for gconv.h, cross for gconf.h (for these targets).
The results of neither configure test are used, so I removed the
tests for both headers.
* I believe assuming the presence of /dev/random, /dev/urandom and
working mmap is appropriate when cross-compiling to these systems.
* The LC_MESSAGES and iconv tests are link tests, and we require to be
able to use link tests when configuring for these targets (if you
couldn't link, you wouldn't be able to build a shared libstdc++
either). So those tests can be run for these targets just as they
are when native.
Tested with cross to powerpc-none-linux-gnuspe. OK to commit?
2008-06-06 Joseph Myers <joseph@codesourcery.com>
* configure.ac: Do not check for gconv.h.
* crossconfig.m4 (GLIBCXX_CROSSCONFIG): Do not test for gconv.h or
gconf.h. For glibc and uClibc systems, define
_GLIBCXX_USE_RANDOM_TR1 and HAVE_MMAP and use AC_LC_MESSAGES and
AM_ICONV.
* configure, config.h.in: Regenerate.
Index: configure.ac
===================================================================
--- configure.ac (revision 136416)
+++ configure.ac (working copy)
@@ -131,7 +131,7 @@
# Check for available headers.
AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
- machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
+ machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
sys/types.h sys/ipc.h sys/sem.h])
GLIBCXX_CHECK_LINKER_FEATURES
Index: crossconfig.m4
===================================================================
--- crossconfig.m4 (revision 136416)
+++ crossconfig.m4 (working copy)
@@ -46,7 +46,7 @@
# so we just check for all the features here.
# Check for available headers.
AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
- machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
+ machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
sys/types.h])
# Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
@@ -197,7 +197,7 @@
AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
machine/endian.h machine/param.h sys/machine.h sys/types.h \
fp.h float.h endian.h inttypes.h locale.h float.h stdint.h \
- sys/ipc.h sys/sem.h gconf.h])
+ sys/ipc.h sys/sem.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_COMPILER_FEATURES
@@ -223,6 +223,10 @@
# For C99 support to TR1.
GLIBCXX_CHECK_C99_TR1
+ AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
+
+ AC_LC_MESSAGES
+
# Check for sigsetjmp
AC_TRY_COMPILE(
[#include <setjmp.h>],
@@ -231,6 +235,11 @@
siglongjmp (env, 1);
],
[AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
+
+ AC_DEFINE(HAVE_MMAP)
+
+ # For iconv support.
+ AM_ICONV
;;
*-mingw32*)
AC_CHECK_HEADERS([sys/types.h locale.h float.h])
--
Joseph S. Myers
joseph@codesourcery.com