From 6012218763eac328f0b776413bf0fda0032c6a3e Mon Sep 17 00:00:00 2001 From: kan Date: Tue, 14 Aug 2007 02:49:11 +0000 Subject: GCC 4.2.1 release C++ standard library and runtime support code. --- contrib/libstdc++/acinclude.m4 | 142 +++++++++++++++++++++++++---------------- 1 file changed, 86 insertions(+), 56 deletions(-) (limited to 'contrib/libstdc++/acinclude.m4') diff --git a/contrib/libstdc++/acinclude.m4 b/contrib/libstdc++/acinclude.m4 index 214ce30..6b8aeb5 100644 --- a/contrib/libstdc++/acinclude.m4 +++ b/contrib/libstdc++/acinclude.m4 @@ -251,11 +251,9 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [ # NB: This flag only works reliably after 2.16.1. Configure tests # for this are difficult, so hard wire a value that should work. - # All these tests are for C++, but run with the "C" compiler driver. - # Need to do this so that g++ won't try to link in libstdc++/libsupc++. ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" - CFLAGS='-x c++ -Wl,--gc-sections' + CFLAGS='-Wl,--gc-sections' # Check for -Wl,--gc-sections AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections]) @@ -1334,64 +1332,31 @@ dnl dnl Default is generic. dnl AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ - AC_MSG_CHECKING([for C locale to use]) GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], [use MODEL for target locale package], [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) + + # Deal with gettext issues. Default to not using it (=no) until we detect + # support for it later. Let the user turn it off via --e/d, but let that + # default to on for easier handling. + USE_NLS=no + AC_ARG_ENABLE(nls, + AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]), + [], + [enable_nls=yes]) - # If they didn't use this option switch, or if they specified --enable - # with no specific model, we'll have to look for one. If they - # specified --disable (???), do likewise. + # Either a known packaage, or "auto" if test $enable_clocale = no || test $enable_clocale = yes; then enable_clocale=auto fi - - # Either a known package, or "auto" enable_clocale_flag=$enable_clocale - # Probe for locale support if no specific model is specified. + # Probe for locale model to use if none specified. # Default to "generic". if test $enable_clocale_flag = auto; then case ${target_os} in linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) - AC_EGREP_CPP([_GLIBCXX_ok], [ - #include - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) - _GLIBCXX_ok - #endif - ], enable_clocale_flag=gnu, enable_clocale_flag=generic) - - # Test for bugs early in glibc-2.2.x series - if test $enable_clocale_flag = gnu; then - AC_TRY_RUN([ - #define _GNU_SOURCE 1 - #include - #include - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) - extern __typeof(newlocale) __newlocale; - extern __typeof(duplocale) __duplocale; - extern __typeof(strcoll_l) __strcoll_l; - #endif - int main() - { - const char __one[] = "Äuglein Augmen"; - const char __two[] = "Äuglein"; - int i; - int j; - __locale_t loc; - __locale_t loc_dup; - loc = __newlocale(1 << LC_ALL, "de_DE", 0); - loc_dup = __duplocale(loc); - i = __strcoll_l(__one, __two, loc); - j = __strcoll_l(__one, __two, loc_dup); - return 0; - } - ], - [enable_clocale_flag=gnu],[enable_clocale_flag=generic], - [enable_clocale_flag=generic]) - fi - - # ... at some point put __strxfrm_l tests in as well. + enable_clocale_flag=gnu ;; darwin* | freebsd*) enable_clocale_flag=darwin @@ -1402,16 +1367,81 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ esac fi - # Deal with gettext issues. Default to not using it (=no) until we detect - # support for it later. Let the user turn it off via --e/d, but let that - # default to on for easier handling. - USE_NLS=no - AC_ARG_ENABLE(nls, - AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]), - [], - [enable_nls=yes]) + # Sanity check model, and test for special functionality. + if test $enable_clocale_flag = gnu; then + AC_EGREP_CPP([_GLIBCXX_ok], [ + #include + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) + _GLIBCXX_ok + #endif + ], enable_clocale_flag=gnu, enable_clocale_flag=generic) + + if test $enable_clocale = auto; then + # Test for bugs early in glibc-2.2.x series + AC_TRY_RUN([ + #define _GNU_SOURCE 1 + #include + #include + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) + extern __typeof(newlocale) __newlocale; + extern __typeof(duplocale) __duplocale; + extern __typeof(strcoll_l) __strcoll_l; + #endif + int main() + { + const char __one[] = "Äuglein Augmen"; + const char __two[] = "Äuglein"; + int i; + int j; + __locale_t loc; + __locale_t loc_dup; + loc = __newlocale(1 << LC_ALL, "de_DE", 0); + loc_dup = __duplocale(loc); + i = __strcoll_l(__one, __two, loc); + j = __strcoll_l(__one, __two, loc_dup); + return 0; + } + ], + [enable_clocale_flag=gnu],[enable_clocale_flag=generic], + [enable_clocale_flag=generic]) + fi + + # Set it to scream when it hurts. + ac_save_CFLAGS="$CFLAGS" + CFLAGS="-Wimplicit-function-declaration -Werror" + + # Use strxfrm_l if available. + AC_TRY_COMPILE([#define _GNU_SOURCE 1 + #include + #include ], + [char s[128]; __locale_t loc; strxfrm_l(s, "C", 5, loc);], + AC_DEFINE(HAVE_STRXFRM_L, 1, + [Define if strxfrm_l is available in .]),) + + # Use strerror_l if available. + AC_TRY_COMPILE([#define _GNU_SOURCE 1 + #include + #include ], + [__locale_t loc; strerror_l(5, loc);], + AC_DEFINE(HAVE_STRERROR_L, 1, + [Define if strerror_l is available in .]),) + + CFLAGS="$ac_save_CFLAGS" + fi + + # Perhaps use strerror_r if available, and strerror_l isn't. + ac_save_CFLAGS="$CFLAGS" + CFLAGS="-Wimplicit-function-declaration -Werror" + AC_TRY_COMPILE([#define _GNU_SOURCE 1 + #include + #include ], + [char s[128]; strerror_r(5, s, 128);], + AC_DEFINE(HAVE_STRERROR_R, 1, + [Define if strerror_r is available in .]),) + CFLAGS="$ac_save_CFLAGS" # Set configure bits for specified locale package + AC_MSG_CHECKING([for C locale to use]) case ${enable_clocale_flag} in generic) AC_MSG_RESULT(generic) -- cgit v1.1