From b5b3739a4618fd9769d19ef2fb77eb7e1cbaa04d Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 24 Mar 2006 01:59:35 +0000 Subject: [PATCH] re PR libstdc++/20448 (locale testsuite fails when GCC is configured with --disable-nls) PR libstdc++/20448 PR libstdc++/20451 * scripts/testsuite_flags.in (--cxxflags): Don't define LOCALEDIR. * testsuite/lib/libstdc++.exp (libstdc++_init): Always define LOCALEDIR to ".". (v3-build_support): Build MO files. Co-Authored-By: Joseph Myers From-SVN: r112346 --- libstdc++-v3/ChangeLog | 10 ++++++++++ libstdc++-v3/scripts/testsuite_flags.in | 2 +- libstdc++-v3/testsuite/lib/libstdc++.exp | 25 ++++++++++++++++-------- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8a090575a58..e2197bad5be 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2006-03-24 Mark Mitchell + Joseph S. Myers + + PR libstdc++/20448 + PR libstdc++/20451 + * scripts/testsuite_flags.in (--cxxflags): Don't define LOCALEDIR. + * testsuite/lib/libstdc++.exp (libstdc++_init): Always define + LOCALEDIR to ".". + (v3-build_support): Build MO files. + 2006-03-22 Paolo Carlini PR libstdc++/26777 diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in index 86b02359f92..15a4d8599e6 100755 --- a/libstdc++-v3/scripts/testsuite_flags.in +++ b/libstdc++-v3/scripts/testsuite_flags.in @@ -50,7 +50,7 @@ case ${query} in --cxxflags) CXXFLAGS_save="-g -O2 -D_GLIBCXX_ASSERT" CXXFLAGS_config='@SECTION_FLAGS@ -fmessage-length=0 - @EXTRA_CXX_FLAGS@ -DLOCALEDIR="@glibcxx_localedir@" ' + @EXTRA_CXX_FLAGS@ ' echo ${CXXFLAGS_save} ${CXXFLAGS_config} ;; --cxxpchflags) diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index f93dc6efc8f..ab364191d68 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -193,17 +193,12 @@ proc libstdc++_init { testfile } { set includes "-I${srcdir}" set cxxldflags "" set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0" - # Guess at the location of the installed locale files. - # (It would be nice if "gcc --print-file-name" could find - # message files, but it cannot.) - set absolute_cxx [which $cxx] - if { $absolute_cxx != "" } { - set localedir "[file dirname $absolute_cxx]/../share/locale" - } - set cxxflags "$cxxflags -DLOCALEDIR=\"$localedir\"" } } + # Always use MO files built by this test harness. + set cxxflags "$cxxflags -DLOCALEDIR=\".\"" + # If a PCH file is available, use it. We must delay performing # this check until $cxx and such have been initialized because we # perform a test compilation. (Ideally, gcc --print-file-name would @@ -395,6 +390,20 @@ proc v3-build_support { } { set v3-threads 1 } + # Try to build the MO files that are used by some of the locale + # tests. If we can't build them, that's OK; it just means that + # those tests will fail. + foreach lang [list "fr" "de"] { + catch { + file mkdir "$lang/LC_MESSAGES" + remote_exec "build" "msgfmt" "-o $lang/LC_MESSAGES/libstdc++.mo $srcdir/../po/$lang.po" + if [is_remote host] { + remote_exec "host" "mkdir" "-p $lang/LC_MESSAGES" + remote_download "host" "$lang/LC_MESSAGES/libstdc++.mo" "$lang/LC_MESSAGES/libstdc++.mo" + } + } + } + # Build the support objects. set source_files \ [list testsuite_abi.cc testsuite_allocator.cc testsuite_character.cc testsuite_hooks.cc ]