From 33c6ff0f4f4f35d7dae7bcdac8d429ab312e2b5e Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Sat, 2 Jul 2005 00:35:00 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'apple-gcc-5208'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/apple-gcc-5208@101526 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/testsuite/lib/libstdc++.exp | 90 ++++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 21 deletions(-) (limited to 'libstdc++-v3/testsuite/lib/libstdc++.exp') diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 0ac4196b7c3..7d7fa6c86bf 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -134,27 +134,34 @@ proc libstdc++_init { testfile } { v3track gccdir 3 # Compute what needs to be added to the existing LD_LIBRARY_PATH. - set ld_library_path "" - append ld_library_path ":${gccdir}" - set compiler ${gccdir}/g++ - if { [is_remote host] == 0 && [which $compiler] != 0 } { - foreach i "[exec $compiler --print-multi-lib]" { - set mldir "" - regexp -- "\[a-z0-9=/\.-\]*;" $i mldir - set mldir [string trimright $mldir "\;@"] - if { "$mldir" == "." } { - continue - } - if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } { - append ld_library_path ":${gccdir}/${mldir}" - } - } - } - append ld_library_path ":${blddir}/src/.libs" + # APPLE LOCAL begin mainline + if {$gccdir != ""} { + set ld_library_path "" + append ld_library_path ":${gccdir}" + set compiler ${gccdir}/g++ + append ld_library_path ":${blddir}/src/.libs" + + if { [is_remote host] == 0 && [which $compiler] != 0 } { + foreach i "[exec $compiler --print-multi-lib]" { + set mldir "" + regexp -- "\[a-z0-9=/\.-\]*;" $i mldir + set mldir [string trimright $mldir "\;@"] + if { "$mldir" == "." } { + continue + } + if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } { + append ld_library_path ":${gccdir}/${mldir}" + } + } + } - set_ld_library_path_env_vars - if [info exists env(LD_LIBRARY_PATH)] { - verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)" + set_ld_library_path_env_vars + if [info exists env(LD_LIBRARY_PATH)] { + verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)" + } + } else { + set compiler [transform "g++"] + # APPLE LOCAL end mainline } # Do a bunch of handstands and backflips for cross compiling and @@ -176,7 +183,15 @@ proc libstdc++_init { testfile } { set includes [exec sh $flags_file --build-includes] } else { set cxx [transform "g++"] - set cxxflags "-ggdb3" + # APPLE LOCAL begin libstdc++ testing + # For standalone libstdc++ testing, we need to provide all + # the necessary compiler flags, since we do not have a + # testsuite_flags file to fall back on. + set cxxflags [concat "-g -O2 -D_GLIBCXX_ASSERT" \ + " -ffunction-sections" \ + " -fdata-sections -fmessage-length=0 -DAPPLE_KEYMGR" \ + " -DLOCALEDIR=\"/usr/share/locale\""] + # APPLE LOCAL end libstdc++ testing set includes "-I${srcdir}" } } @@ -278,6 +293,39 @@ proc v3_target_compile { source dest type options } { proc v3-list-tests { filename } { global srcdir global blddir + # APPLE LOCAL begin libstdc++ testing + global objdir + global libiconv + + # If we are not running in a build directory, we will need to generate + # our own testsuite_files, and build our own libv3test.a as well. + if { $blddir == "" } { + set blddir ${objdir} + set libiconv "-liconv" + set tmp [exec mkdir ${blddir}/testsuite] + set tmp [exec touch ${blddir}/testsuite/testsuite_thread] + set tmp [exec touch ${blddir}/testsuite/testsuite_wchar_t] + set tmp [exec sh ${srcdir}/../scripts/create_testsuite_files \ + ${srcdir} ${blddir}/testsuite] + # Build the support objects. + foreach f [list testsuite_abi.cc testsuite_allocator.cc \ + testsuite_hooks.cc] { + set object_file ${blddir}/testsuite/[file rootname $f].o + # Compile with "-w" so that warnings issued by the compiler + # do not prevent compilation. + if { [v3_target_compile $srcdir/$f $object_file "object" \ + [list "incdir=$srcdir" "additional_flags=-w"]] + != "" } { + error "could not compile $f" + } + } + set tmp [exec ar cru ${blddir}/testsuite/libv3test.a \ + ${blddir}/testsuite/testsuite_abi.o \ + ${blddir}/testsuite/testsuite_allocator.o \ + ${blddir}/testsuite/testsuite_hooks.o] + set tmp [exec ranlib -c ${blddir}/testsuite/libv3test.a] + } + # APPLE LOCAL end libstdc++ testing set tests_file "${blddir}/testsuite/${filename}" set sfiles "" -- cgit v1.2.3