libgo: fix DejaGNU testsuite compiler when using build sysroot
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 11 Nov 2019 23:28:54 +0000 (23:28 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 11 Nov 2019 23:28:54 +0000 (23:28 +0000)
    Patch by Maciej W. Rozycki.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/206577

From-SVN: r278070

libgo/configure
libgo/configure.ac
libgo/testsuite/Makefile.am
libgo/testsuite/Makefile.in
libgo/testsuite/lib/libgo.exp
libgo/testsuite/libgo-test-support.exp.in [new file with mode: 0644]

index 09c89dfe070e704fcc54d9be9779376f0e5618f0..ba80569e26db0832b8d0364a6254ea4637272cc8 100755 (executable)
@@ -15850,7 +15850,7 @@ else
   multilib_arg=
 fi
 
-ac_config_files="$ac_config_files Makefile testsuite/Makefile"
+ac_config_files="$ac_config_files Makefile testsuite/Makefile testsuite/libgo-test-support.exp"
 
 
 ac_config_commands="$ac_config_commands default"
@@ -17031,6 +17031,7 @@ do
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+    "testsuite/libgo-test-support.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgo-test-support.exp" ;;
     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
index de364afd0fe37311955b4e33210e82e2f0e417b4..00b4054a0ee6826820bcaf58618262384543ca91 100644 (file)
@@ -877,7 +877,7 @@ else
   multilib_arg=
 fi
 
-AC_CONFIG_FILES(Makefile testsuite/Makefile)
+AC_CONFIG_FILES(Makefile testsuite/Makefile testsuite/libgo-test-support.exp)
 
 AC_CONFIG_COMMANDS([default],
 [if test -n "$CONFIG_FILES"; then
index 8c6249d9d1299a462758ac3f0b0fd7bfb2382387..892cda770dc99cb358aa9abb0a4192cb243ff2ff 100644 (file)
@@ -11,6 +11,8 @@ RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
               echo $(top_srcdir)/../dejagnu/runtest ; \
            else echo runtest; fi`
 
+EXTRA_DEJAGNU_SITE_CONFIG = libgo-test-support.exp
+
 # When running the tests we set GCC_EXEC_PREFIX to the install tree so that
 # files that have already been installed there will be found.  The -B option
 # overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files
index 41d81b5684fd7274411030337a2d3ea9a4c9b4e8..7b4b27f0c309ddd1bd2bfe121b1a20e3914af8e3 100644 (file)
@@ -106,7 +106,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 DIST_COMMON = $(srcdir)/Makefile.am
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = libgo-test-support.exp
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -299,6 +299,7 @@ RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
               echo $(top_srcdir)/../dejagnu/runtest ; \
            else echo runtest; fi`
 
+EXTRA_DEJAGNU_SITE_CONFIG = libgo-test-support.exp
 
 # When running the tests we set GCC_EXEC_PREFIX to the install tree so that
 # files that have already been installed there will be found.  The -B option
@@ -338,6 +339,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+libgo-test-support.exp: $(top_builddir)/config.status $(srcdir)/libgo-test-support.exp.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
 mostlyclean-libtool:
        -rm -f *.lo
index 1b0f26a68845169d27ba962a09235bd601f8029c..b5833bbafe270dc5de1a3ce60d7f674c4cb0c00c 100644 (file)
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
-if {$gccdir != ""} {
-    set gccdir [file dirname $gccdir]
-}
-set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/"
 set TESTING_IN_BUILD_TREE 1
 
+if ![info exists GOC_UNDER_TEST] then {
+    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+    if {$gccdir != ""} {
+       set gccdir [file dirname $gccdir]
+    }
+    set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/"
+}
+
 if [info exists GOTEST_TMPDIR] {
     set tmpdir $GOTEST_TMPDIR
 }
diff --git a/libgo/testsuite/libgo-test-support.exp.in b/libgo/testsuite/libgo-test-support.exp.in
new file mode 100644 (file)
index 0000000..aaa6c5e
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (C) 2019 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 GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+set GOC_UNDER_TEST {@GOC@}