summaryrefslogtreecommitdiff
path: root/debian/patches/libstdc++-test-installed.diff
blob: b9e6bfd309bc69d8f05c582b36d8bcc900f317ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# DP: Add support to run the libstdc++-v3 testsuite using the
# DP: installed shared libraries.

Index: b/src/libstdc++-v3/testsuite/lib/libstdc++.exp
===================================================================
--- a/src/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/src/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -37,6 +37,12 @@
 # the last thing before testing begins.  This can be defined in, e.g.,
 # ~/.dejagnurc or $DEJAGNU.
 
+set test_installed 0
+if [info exists env(TEST_INSTALLED)] {
+    verbose -log "test installed libstdc++-v3"
+    set test_installed 1
+}
+
 proc load_gcc_lib { filename } {
     global srcdir loaded_libs
 
@@ -101,6 +107,7 @@ proc libstdc++_init { testfile } {
     global tool_timeout
     global DEFAULT_CXXFLAGS
     global STATIC_LIBCXXFLAGS
+    global test_installed
 
     # We set LC_ALL and LANG to C so that we get the same error
     # messages as expected.
@@ -120,6 +127,9 @@ proc libstdc++_init { testfile } {
 
     set blddir [lookfor_file [get_multilibs] libstdc++-v3]
     set flags_file "${blddir}/scripts/testsuite_flags"
+    if {$test_installed} {
+      set flags_file "${blddir}/scripts/testsuite_flags.installed"
+    }
     set shlib_ext [get_shlib_extension]
     v3track flags_file 2
 
@@ -151,7 +161,11 @@ proc libstdc++_init { testfile } {
 
     # Locate libgcc.a so we don't need to account for different values of
     # SHLIB_EXT on different platforms
-    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+    if {$test_installed} {
+	set gccdir ""
+    } else {
+	set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+    }
     if {$gccdir != ""} {
         set gccdir [file dirname $gccdir]
 	append ld_library_path_tmp ":${gccdir}"
@@ -160,7 +174,11 @@ proc libstdc++_init { testfile } {
 
     # Locate libgomp. This is only required for parallel mode.
     set v3-libgomp 0
-    set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.$shlib_ext]
+    if {$test_installed} {
+	set libgompdir ""
+    } else {
+	set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.$shlib_ext]
+    }
     if {$libgompdir != ""} {
 	set v3-libgomp 1
         set libgompdir [file dirname $libgompdir]
@@ -182,7 +200,12 @@ proc libstdc++_init { testfile } {
 
     # Locate libstdc++ shared library. (ie libstdc++.so.)
     set v3-sharedlib 0
-    set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.$shlib_ext]
+    if {$test_installed} {
+	set sharedlibdir ""
+	set v3-sharedlib 1
+    } else {
+	set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.$shlib_ext]
+    }
     if {$sharedlibdir != ""} {
 	if { ([string match "*-*-linux*" $target_triplet]
 	      || [string match "*-*-gnu*" $target_triplet])