aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl@gnu.org>2000-06-27 18:01:02 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2000-06-27 18:01:02 +0000
commit1c7781fbb3c307f57116fb05f81b4debf9acb2fe (patch)
treeca607c025ad0799f7f3f893442cb1d4881b663c5
parente57b9d65666b9440d13ebb601254a9d53f772714 (diff)
downloadgcc-1c7781fbb3c307f57116fb05f81b4debf9acb2fe.zip
gcc-1c7781fbb3c307f57116fb05f81b4debf9acb2fe.tar.gz
gcc-1c7781fbb3c307f57116fb05f81b4debf9acb2fe.tar.bz2
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 <hjl@gnu.org> Loren J. Rittle <ljrittle@acm.org> * 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 <ljrittle@acm.org> From-SVN: r34735
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/lib/g++.exp94
2 files changed, 101 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 76c2d7d..aedd567 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2000-06-27 H.J. Lu <hjl@gnu.org>
+ Loren J. Rittle <ljrittle@acm.org>
+
+ * 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 <zack@wolery.cumb.org>
* 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 917a063..47ce373 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -63,6 +63,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
#