summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.8/add-install-ptest-to-Makefile.patch
blob: 3dedde50dbc17c5b2bd84134fe3ff65c2fb13d6d (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
Add 'install-ptest' rule.

Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
Upstream-status: Pending
---
diff -uNr a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
--- a/libstdc++-v3/Makefile.in	2013-07-01 13:01:43.659958328 +0200
+++ b/libstdc++-v3/Makefile.in	2013-08-23 13:22:41.962029555 +0200
@@ -710,6 +710,26 @@
 dvi:
 install-dvi:
 
+spath=$(subst /,\/,$(SOURCE_DIR))
+bpath=$(subst /,\/,$(BUILD_DIR))
+rpath=$(subst /,\/,$(REPLACE_DIR))
+install-ptest:
+	mkdir -p $(DEST_DIR)/gcc/testsuite
+	mkdir -p $(DEST_DIR)/libstdc++-v3
+	mkdir -p $(DEST_DIR)/contrib
+	cp -r $(SOURCE_DIR)/libstdc++-v3/testsuite $(DEST_DIR)/libstdc++-v3
+	cp    $(SOURCE_DIR)/contrib/dg-extract-results.sh $(DEST_DIR)/contrib
+	cp    $(SOURCE_DIR)/gcc/BASE-VER $(DEST_DIR)/gcc
+	cp -r $(SOURCE_DIR)/gcc/testsuite/lib $(DEST_DIR)/gcc/testsuite
+	cp -r $(SOURCE_DIR)/libstdc++-v3/scripts $(DEST_DIR)/libstdc++-v3
+	cp $(BUILD_DIR)/libstdc++-v3/scripts/* $(DEST_DIR)/libstdc++-v3/scripts
+	cp $(BUILD_DIR)/libstdc++-v3/testsuite/Makefile	$(DEST_DIR)/libstdc++-v3/testsuite
+	cp $(BUILD_DIR)/libstdc++-v3/Makefile $(DEST_DIR)/libstdc++-v3
+	sed -i -e 's|^Makefile:|_Makefile:|' $(DEST_DIR)/libstdc++-v3/testsuite/Makefile
+	sed -i -e "s/$(spath)/$(rpath)/g" -e "s/$(bpath)/$(rpath)/g" $(DEST_DIR)/libstdc++-v3/testsuite/Makefile
+	sed -i -e "s/$(spath)/$(rpath)/g" -e "s/$(bpath)/$(rpath)/g" $(DEST_DIR)/libstdc++-v3/Makefile
+	sed -i -e 's/RUNTESTDEFAULTFLAGS.=/RUNTESTDEFAULTFLAGS =-a/g' ${DEST_DIR}/libstdc++-v3/testsuite/Makefile
+
 # All the machinations with string instantiations messes up the
 # automake-generated TAGS rule. Make a simple one here.
 TAGS: tags-recursive $(LISP)
diff -uNr a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
--- a/libstdc++-v3/testsuite/Makefile.in	2013-07-05 16:06:08.995480821 +0200
+++ b/libstdc++-v3/testsuite/Makefile.in	2013-08-26 08:50:04.698546942 +0200
@@ -478,6 +478,8 @@
 	maintainer-clean-generic mostlyclean mostlyclean-generic \
 	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
 
+buildtest-TESTS:
+	-@runtest $(AM_RUNTESTFLAGS) --tool libstdc++ $(RUNTESTFLAGS) buildtest.exp
 
 # This rule generates all of the testsuite_files* lists at once.
 ${lists_of_files}:
@@ -545,7 +547,7 @@
 
 # Run the testsuite in normal mode.
 check-DEJAGNU $(check_DEJAGNU_normal_targets): check-DEJAGNU%: site.exp
-	AR="$(AR)"; export AR; \
+	-@(AR="$(AR)"; export AR; \
 	RANLIB="$(RANLIB)"; export RANLIB; \
 	if [ -z "$*$(filter-out --target_board=%, $(RUNTESTFLAGS))" ] \
 	    && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \
@@ -563,6 +565,7 @@
 	  exit 0; \
 	fi; \
 	srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
+	$(SHELL) command -v g++ >/dev/null 2>&1 || echo "g++ is not installed on your system! Please note that most of the tests need g++."; \
 	EXPECT=$(EXPECT); export EXPECT; \
 	runtest=$(RUNTEST); \
 	if [ -z "$$runtest" ]; then runtest=runtest; fi; \
@@ -606,7 +609,7 @@
 		    $(RUNTESTFLAGS); \
 	  fi; \
 	else echo "WARNING: could not find \`runtest'" 1>&2; :;\
-	fi
+	fi)
 
 check-am:
 	$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
diff -uNr a/libstdc++-v3/testsuite/buildtest.exp b/libstdc++-v3/testsuite/buildtest.exp
--- a/libstdc++-v3/testsuite/buildtest.exp	1970-01-01 01:00:00.000000000 +0100
+++ b/libstdc++-v3/testsuite/buildtest.exp	2013-08-14 09:25:57.773587133 +0200
@@ -0,0 +1,33 @@
+# Copyright (C) 2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# If there is no baseline file, or we can't find the library, skip
+# this test. Or, hey, if we don't support this kind of symbol
+# versioning test: don't run it.
+
+
+set baseline_subdir "[eval exec $cxx $baseline_subdir_switch]"
+
+# Build the support objects.
+v3-build_support
+
+# Build the abi_check program.
+if { [v3_target_compile "$srcdir/util/testsuite_abi_check.cc" "abi_check" \
+      "executable" [list "additional_flags=-w"]] != "" } {
+    error "could not compile testsuite_abi_check.cc"
+}
+
+
diff -uNr a/libstdc++-v3/testsuite/libstdc++-abi/abi.exp b/libstdc++-v3/testsuite/libstdc++-abi/abi.exp
--- a/libstdc++-v3/testsuite/libstdc++-abi/abi.exp	2013-08-09 10:02:56.769743266 +0200
+++ b/libstdc++-v3/testsuite/libstdc++-abi/abi.exp	2013-08-14 09:27:15.722299887 +0200
@@ -24,11 +24,6 @@
     set lib $blddir/src/.libs/libstdc++.so
 }
 
-set baseline_subdir "[eval exec $cxx $baseline_subdir_switch]"
-
-# Build the support objects.
-v3-build_support
-
 if { (${v3-symver} == 0) || ![info exists baseline_dir] \
 	 || ![file exists $baseline_dir] \
 	 || ![file exists $lib] } {
@@ -50,12 +45,6 @@
 remote_exec "build" "$objdir/../scripts/extract_symvers" \
     [list $lib "current_symbols.txt"]
 
-# Build the abi_check program.
-if { [v3_target_compile "$srcdir/util/testsuite_abi_check.cc" "abi_check" \
-      "executable" [list "additional_flags=-w"]] != "" } {
-    error "could not compile testsuite_abi_check.cc"
-}
-
 remote_download "target" $baseline_file "baseline_symbols.txt"
 remote_download "target" "current_symbols.txt" "current_symbols.txt"
 set result [${tool}_load "./abi_check" \
diff -uNr a/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp b/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp
--- a/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp	2013-08-09 13:06:20.795174486 +0200
+++ b/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp	2013-08-23 13:25:31.290856664 +0200
@@ -21,9 +21,6 @@
 # Initialization.
 dg-init
 
-# Build the support objects.
-v3-build_support
-
 set tests [list]
 
 # If there is a "testsuite_files" file, use it.
diff -uNr a/libstdc++-v3/testsuite/libstdc++-prettyprinters/prettyprinters.exp b/libstdc++-v3/testsuite/libstdc++-prettyprinters/prettyprinters.exp
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/prettyprinters.exp	2013-08-09 13:08:17.946244225 +0200
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/prettyprinters.exp	2013-08-09 13:31:19.812003255 +0200
@@ -17,7 +17,6 @@
 load_lib gdb-test.exp
 
 dg-init
-v3-build_support
 
 global GDB
 if ![info exists ::env(GUALITY_GDB_NAME)] {