From 6cd5b96f394a26f96b2fcc160267ea323682c8d5 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 23 Apr 2007 00:39:17 +0000 Subject: [PATCH] libstdc++.exp (libstdc++_init): Use the same flags for remote host testing we use for local host testing. * testsuite/lib/libstdc++.exp (libstdc++_init): Use the same flags for remote host testing we use for local host testing. Copy all testsuite headers to the remote host (v3_target_compile_as_c): Use remote_exec, not just exec. From-SVN: r124051 --- libstdc++-v3/ChangeLog | 7 +++ libstdc++-v3/testsuite/lib/libstdc++.exp | 75 +++++++++++++++--------- 2 files changed, 55 insertions(+), 27 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e6d889a28e7..497b9d73dfa 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2007-04-22 Mark Mitchell + + * testsuite/lib/libstdc++.exp (libstdc++_init): Use the same flags + for remote host testing we use for local host testing. Copy all + testsuite headers to the remote host + (v3_target_compile_as_c): Use remote_exec, not just exec. + 2007-04-22 Paolo Carlini * include/tr1/functional: Formatting fixes. diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 3c1cd5d5286..f00bb846fc9 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -171,31 +171,47 @@ proc libstdc++_init { testfile } { set compiler [transform "g++"] } - # Do a bunch of handstands and backflips for cross compiling and - # finding simulators... + # Default settings. + set cxx [transform "g++"] + set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0" + set cxxldflags "" + # Locate testsuite_hooks.h and other testsuite headers. + set includes "-I${srcdir}/util" + # Adapt the defaults for special circumstances. if [is_remote host] { - set header [remote_download host ${blddir}/testsuite/util/testsuite_hooks.h] - if { $header == "" } { - verbose -log "Unable to download ${blddir}/testsuite/util/testsuite_hooks.h to host." - return "untested" - } - set cxx [transform "g++"] - set cxxflags "-ggdb3" - set cxxldflags "" - set includes "-I./" - } else { + # A remote host does not, in general, have access to the + # $srcdir so we copy the testsuite headers into the current + # directory, and then add that to the search path. + foreach src [glob "${srcdir}/util/*.h" \ + "${srcdir}/util/*.cc" \ + "${srcdir}/util/*/*.hpp" \ + "${srcdir}/util/*/*.cc" \ + "${srcdir}/util/*/*.hpp" \ + "${srcdir}/util/*/*/*.cc" \ + "${srcdir}/util/*/*/*.hpp" \ + "${srcdir}/util/*/*/*/*.cc" \ + "${srcdir}/util/*/*/*/*.hpp" \ + "${srcdir}/util/*/*/*/*/*.cc" \ + "${srcdir}/util/*/*/*/*/*.hpp" ] { + # Remove everything up to "util/..." + set dst [string range $src [string length "${srcdir}/"] end] + # Create the directory containing the file. + set dir [file dirname $dst] + remote_exec host "mkdir" [list "-p" "$dir"] + # Download teh file. + set result [remote_download host $src $dst] + if { $result == "" } { + verbose -log "Unable to download ${srcdir}/${f} to host." + return "untested" + } + } + set includes "-Iutil" + } elseif { [file exists $flags_file] } { # If we find a testsuite_flags file, we're testing in the build dir. - if { [file exists $flags_file] } { - set cxx [exec sh $flags_file --build-cxx] - set cxxflags [exec sh $flags_file --cxxflags] - set cxxldflags [exec sh $flags_file --cxxldflags] - set includes [exec sh $flags_file --build-includes] - } else { - set cxx [transform "g++"] - set cxxldflags "" - set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0" - set includes "-I${srcdir}/util" - } + set cxx [exec sh $flags_file --build-cxx] + set cxxflags [exec sh $flags_file --cxxflags] + set cxxldflags [exec sh $flags_file --cxxldflags] + set includes [exec sh $flags_file --build-includes] } # Always use MO files built by this test harness. @@ -376,11 +392,16 @@ proc v3_target_compile_as_c { source dest type options } { # This is needed for "C" tests, as this type of test may need the # C++ includes. And if we're not testing in the build directory, - # the includes variable is not likely to include the necessary info. + # the includes variable is not likely to include the necessary + # info. if { ![file exists $flags_file] } { - set version [exec ${cc} -dumpversion] - set machine [exec ${cc} -dumpmachine] - set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec ${cc} --print-prog-name=cc1]]]]]] + set version [remote_exec host ${cc} -dumpversion] + set version [lindex $version 1] + set machine [remote_exec exec ${cc} -dumpmachine] + set machine [lindex $machine 1] + set comp_base_dir [remote_exec host ${cc} --print-prog-name=cc1] + set comp_base_dir [lindex $comp_base_dir 1] + set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname $comp_base_dir]]]]] set includesbase "${comp_base_dir}/include/c++/${version}" set includestarget "${includesbase}/${machine}" set cc_final [concat $cc_final "-I$includesbase -I$includestarget"]