This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix for testing installed compiler
- To: gcc-patches at gcc dot gnu dot org
- Subject: Fix for testing installed compiler
- From: Geoffrey Keating <geoffk at thief dot cygnus dot com>
- Date: Thu, 3 May 2001 19:56:15 -0700
- Reply-to: geoffk at redhat dot com
This patch fixes the testsuite machinery so that you can run it
without having a build tree around (on an installed compiler).
Tested on x86-linux.
--
Geoff Keating <geoffk@redhat.com>
===File ~/patches/gcc-installtest.patch=====================
Index: gcc/gcc/ChangeLog
2001-05-03 Geoffrey Keating <geoffk@redhat.com>
* Makefile.in (site.exp): Set TESTING_IN_BUILD_TREE.
Index: gcc/gcc/testsuite/ChangeLog
2001-05-03 Geoffrey Keating <geoffk@redhat.com>
* lib/g++.exp (g++_include_flags): Don't use any special flags
if TESTING_IN_BUILD_TREE is not defined.
(g++_init): Use a plain 'c++' as the compiler if
TESTING_IN_BUILD_TREEE is not defined.
Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.654
diff -p -u -p -r1.654 Makefile.in
--- Makefile.in 2001/05/01 17:45:02 1.654
+++ Makefile.in 2001/05/04 02:54:34
@@ -2800,6 +2800,7 @@ site.exp: ./config.status Makefile
# CFLAGS is set even though it's empty to show we reserve the right to set it.
@echo "set CFLAGS \"\"" >> ./tmp0
@echo "set CXXFLAGS \"-I$(objdir)/../$(target_subdir)libio -I\$$srcdir/../libg++/src -I\$$srcdir/../libio -I\$$srcdir/../libstdc++ -I\$$srcdir/../libstdc++/stl -L$(objdir)/../$(target_subdir)libg++ -L$(objdir)/../$(target_subdir)libstdc++\"" >> ./tmp0
+ @echo "set TESTING_IN_BUILD_TREE 1" >> ./tmp0
@echo "set HAVE_LIBSTDCXX_V3 1" >> ./tmp0
# If newlib has been configured, we need to pass -B to gcc so it can find
# newlib's crt0.o if it exists. This will cause a "path prefix not used"
Index: gcc/testsuite/lib/g++.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/g++.exp,v
retrieving revision 1.17
diff -p -u -p -r1.17 g++.exp
--- g++.exp 2001/02/08 02:29:38 1.17
+++ g++.exp 2001/05/04 02:54:36
@@ -66,10 +66,11 @@ proc g++_version { } {
proc g++_include_flags { args } {
global srcdir
global HAVE_LIBSTDCXX_V3
+ global TESTING_IN_BUILD_TREE
set flags ""
- if [is_remote host] {
+ if { [is_remote host] || ! [info exists TESTING_IN_BUILD_TREE] } {
return "${flags}"
}
@@ -166,12 +167,13 @@ proc g++_init { args } {
global ALWAYS_CXXFLAGS
global TOOL_EXECUTABLE TOOL_OPTIONS
global GXX_UNDER_TEST
+ global TESTING_IN_BUILD_TREE
if ![info exists GXX_UNDER_TEST] then {
if [info exists TOOL_EXECUTABLE] {
set GXX_UNDER_TEST $TOOL_EXECUTABLE;
} else {
- if [is_remote host] {
+ if { [is_remote host] || ! [info exists TESTING_IN_BUILD_TREE] } {
set GXX_UNDER_TEST [transform c++]
} else {
set GXX_UNDER_TEST [findfile $base_dir/../g++ "$base_dir/../g++ -B$base_dir/../" [findfile $base_dir/g++ "$base_dir/g++ -B$base_dir/" [transform c++]]]
============================================================