From 1c7781fbb3c307f57116fb05f81b4debf9acb2fe Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 27 Jun 2000 18:01:02 +0000 Subject: [PATCH] g++.exp (g++_include_flags): Override libgloss.exp version with one that knows about the new gcc tree structure. 2000-06-27 H.J. Lu Loren J. Rittle * lib/g++.exp (g++_include_flags): Override libgloss.exp version with one that knows about the new gcc tree structure. (g++_link_flags): Same. Co-Authored-By: Loren J. Rittle From-SVN: r34735 --- gcc/testsuite/ChangeLog | 7 +++ gcc/testsuite/lib/g++.exp | 94 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 76c2d7d963c..aedd567c035 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2000-06-27 H.J. Lu + Loren J. Rittle + + * lib/g++.exp (g++_include_flags): Override libgloss.exp + version with one that knows about the new gcc tree structure. + (g++_link_flags): Same. + 2000-06-26 Zack Weinberg * gcc.dg/20000419-1.c, gcc.dg/cpp-mi.c, gcc.dg/cpp-tradwarn1.c, diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 917a063f472..47ce3738613 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -62,6 +62,100 @@ proc g++_version { } { } } +# +# provide new versions of g++_include_flags and g++_link_flags (both +# originally from libgloss.exp) which know about the new gcc tree structure +# +proc g++_include_flags { args } { + global srcdir + + if [is_remote host] { + return "" + } + + set gccpath [get_multilibs] + set libio_dir "" + set flags "" + + set dir [lookfor_file ${srcdir} libg++] + if { ${dir} != "" } { + append flags "-I${dir} -I${dir}/src " + } + set odir_v2 [lookfor_file ${gccpath} libstdc++] + set sdir_v2 [lookfor_file ${srcdir} libstdc++] + if { ${odir_v2} != "" } { + append flags "-I${sdir_v2} -I${sdir_v2}/stl " + } + set odir_v3 [lookfor_file ${gccpath} libstdc++-v3] + set sdir_v3 [lookfor_file ${srcdir} libstdc++-v3] + if { ${odir_v3} != "" } { + append flags [exec ${odir_v3}/mkcheck 2 ${odir_v3} ${sdir_v3}] + } + + if { ${odir_v2} != "" && ${odir_v3} != ""} { + send_error "ERROR: can't handle both libstdc++ and libstdc++-v3 appearing in build tree.\n" + exit 1 + } + + return "$flags" +} + +proc g++_link_flags { args } { + global srcdir + global ld_library_path + + set gccpath [get_multilibs]; + set libio_dir "" + set flags "" + set ld_library_path "." + + if { $gccpath != "" } { + if [file exists "${gccpath}/lib/libstdc++.a"] { + append ld_library_path ":${gccpath}/lib" + } + if [file exists "${gccpath}/libg++/libg++.a"] { + append flags "-L${gccpath}/libg++ " + append ld_library_path ":${gccpath}/libg++" + } + if [file exists "${gccpath}/libstdc++/libstdc++.a"] { + append flags "-L${gccpath}/libstdc++ " + append ld_library_path ":${gccpath}/libstdc++" + } + if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] { + append flags " -L${gccpath}/libstdc++-v3/src/.libs " + append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs" + } + if [file exists "${gccpath}/libiberty/libiberty.a"] { + append flags "-L${gccpath}/libiberty " + } + if [file exists "${gccpath}/librx/librx.a"] { + append flags "-L${gccpath}/librx " + } + } else { + global tool_root_dir; + + set libgpp [lookfor_file ${tool_root_dir} libg++]; + if { $libgpp != "" } { + append flags "-L${libgpp} "; + append ld_library_path ":${libgpp}" + } + set libstdcpp [lookfor_file ${tool_root_dir} libstdc++]; + if { $libstdcpp != "" } { + append flags "-L${libstdcpp} "; + append ld_library_path ":${libstdcpp}" + } + set libiberty [lookfor_file ${tool_root_dir} libiberty]; + if { $libiberty != "" } { + append flags "-L${libiberty} "; + } + set librx [lookfor_file ${tool_root_dir} librx]; + if { $librx != "" } { + append flags "-L${librx} "; + } + } + return "$flags" +} + # # g++_init -- called at the start of each subdir of tests # -- 2.30.2