Hi! On Thu, 18 Dec 2014 11:21:20 +0100, Jakub Jelinek <ja...@redhat.com> wrote: > On Wed, Dec 17, 2014 at 11:48:01PM +0100, Thomas Schwinge wrote: > > I have another suggestion: on gomp-4_0-branch, we had already started > > using a libgomp-test-support.exp file for a similar purpose. I now > > changed your code on gomp-4_0-branch in r218845 as follows (though, not > > very much tested). The advantage here is that people who are not using > > GCC build-tree testing, but are directly invoking runtest, then don't > > have to set various environment variables, but instead just have to copy > > this one libgomp-test-support.exp file from the build tree to the testing > > tree. Does this make sense? > > > > commit de01639bf47e29a20959771e587fb6f30c372a45 > > Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> > > Date: Wed Dec 17 22:45:05 2014 +0000 > > > > libgomp: Route offloading data through the libgomp-test-support.exp > > file. > > > > libgomp/ > > * testsuite/Makefile.am: Don't export OFFLOAD_TARGETS, > > OFFLOAD_ADDITIONAL_OPTIONS, and OFFLOAD_ADDITIONAL_LIB_PATHS... > > * testsuite/libgomp-test-support.exp.in: ..., and instead set > > offload_targets, offload_additional_options, and > > offload_additional_lib_paths here. Update all users. > > LGTM.
As discussed in <http://news.gmane.org/find-root.php?message_id=%3C87388dropf.fsf%40schwinge.name%3E>, that doesn't really work: there may be additional (recursive) expansions required (similar to: libexecdir being defined in terms of exec_prefix, that in terms of prefix, and so on), so we really need to handle that in the Makefile, where all these variables are available. Committed to gomp-4_0-branch in r219016: commit 6bb8cfa151e40ab1e991112d2bbe2719f0a2c46a Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Mon Dec 22 16:17:15 2014 +0000 libgomp: Handle Makefile variable usage in testsuite/libgomp-test-support.exp. libgomp/ * testsuite/libgomp-test-support.exp.in (offload_additional_options, offload_additional_lib_paths): Don't set. * configure.ac: Instantiate testsuite/libgomp-test-support.pt.exp instead of testsuite/libgomp-test-support.exp. * testsuite/Makefile.am (libgomp-test-support.exp): New rule. (all-local): Depend on it. * configure: Regenerate. * testsuite/Makefile.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@219016 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog.gomp | 12 ++++++++ libgomp/configure | 4 +-- libgomp/configure.ac | 2 +- libgomp/testsuite/Makefile.am | 14 +++++++++ libgomp/testsuite/Makefile.in | 41 ++++++++++++++++++--------- libgomp/testsuite/libgomp-test-support.exp.in | 2 -- 6 files changed, 56 insertions(+), 19 deletions(-) diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp index b7a0e7d..6653e58 100644 --- libgomp/ChangeLog.gomp +++ libgomp/ChangeLog.gomp @@ -1,3 +1,15 @@ +2014-12-22 Thomas Schwinge <tho...@codesourcery.com> + + * testsuite/libgomp-test-support.exp.in + (offload_additional_options, offload_additional_lib_paths): Don't + set. + * configure.ac: Instantiate testsuite/libgomp-test-support.pt.exp + instead of testsuite/libgomp-test-support.exp. + * testsuite/Makefile.am (libgomp-test-support.exp): New rule. + (all-local): Depend on it. + * configure: Regenerate. + * testsuite/Makefile.in: Likewise. + 2014-12-17 Thomas Schwinge <tho...@codesourcery.com> Tom de Vries <t...@codesourcery.com> diff --git libgomp/configure libgomp/configure index f72378e..839b2c6 100755 --- libgomp/configure +++ libgomp/configure @@ -16553,7 +16553,7 @@ ac_config_files="$ac_config_files omp.h omp_lib.h omp_lib.f90 libgomp_f.h" ac_config_files="$ac_config_files Makefile testsuite/Makefile libgomp.spec" -ac_config_files="$ac_config_files testsuite/libgomp-test-support.exp" +ac_config_files="$ac_config_files testsuite/libgomp-test-support.pt.exp:testsuite/libgomp-test-support.exp.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17699,7 +17699,7 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; "libgomp.spec") CONFIG_FILES="$CONFIG_FILES libgomp.spec" ;; - "testsuite/libgomp-test-support.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgomp-test-support.exp" ;; + "testsuite/libgomp-test-support.pt.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgomp-test-support.pt.exp:testsuite/libgomp-test-support.exp.in" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git libgomp/configure.ac libgomp/configure.ac index 178c34d..4687b01 100644 --- libgomp/configure.ac +++ libgomp/configure.ac @@ -352,5 +352,5 @@ CFLAGS="$save_CFLAGS" AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h) AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec) -AC_CONFIG_FILES([testsuite/libgomp-test-support.exp]) +AC_CONFIG_FILES([testsuite/libgomp-test-support.pt.exp:testsuite/libgomp-test-support.exp.in]) AC_OUTPUT diff --git libgomp/testsuite/Makefile.am libgomp/testsuite/Makefile.am index 561b7e2..66a9d94 100644 --- libgomp/testsuite/Makefile.am +++ libgomp/testsuite/Makefile.am @@ -11,3 +11,17 @@ EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \ echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi) RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)" + + +# Instead of directly in ../testsuite/libgomp-test-support.exp.in, the +# following variables have to be "routed through" this Makefile, for expansion +# of the several (Makefile) variables used therein. +libgomp-test-support.exp: libgomp-test-support.pt.exp Makefile + cp $< $@.tmp + echo >> $@.tmp \ + 'set offload_additional_options "$(offload_additional_options)"' + echo >> $@.tmp \ + 'set offload_additional_lib_paths "$(offload_additional_lib_paths)"' + mv $@.tmp $@ + +all-local: libgomp-test-support.exp diff --git libgomp/testsuite/Makefile.in libgomp/testsuite/Makefile.in index 016d0d4..352fc3f 100644 --- libgomp/testsuite/Makefile.in +++ libgomp/testsuite/Makefile.in @@ -56,7 +56,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = libgomp-test-support.exp +CONFIG_CLEAN_FILES = libgomp-test-support.pt.exp CONFIG_CLEAN_VPATH_FILES = SOURCES = DEJATOOL = $(PACKAGE) @@ -258,7 +258,7 @@ $(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): -libgomp-test-support.exp: $(top_builddir)/config.status $(srcdir)/libgomp-test-support.exp.in +libgomp-test-support.pt.exp: $(top_builddir)/config.status $(srcdir)/libgomp-test-support.exp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: @@ -313,7 +313,7 @@ distclean-DEJAGNU: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check: check-am -all-am: Makefile +all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am @@ -408,19 +408,32 @@ uninstall-am: .MAKE: check-am install-am install-strip -.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \ - clean-libtool distclean distclean-DEJAGNU distclean-generic \ - distclean-libtool dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am +.PHONY: all all-am all-local check check-DEJAGNU check-am clean \ + clean-generic clean-libtool distclean distclean-DEJAGNU \ + distclean-generic distclean-libtool dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am +# Instead of directly in ../testsuite/libgomp-test-support.exp.in, the +# following variables have to be "routed through" this Makefile, for expansion +# of the several (Makefile) variables used therein. +libgomp-test-support.exp: libgomp-test-support.pt.exp Makefile + cp $< $@.tmp + echo >> $@.tmp \ + 'set offload_additional_options "$(offload_additional_options)"' + echo >> $@.tmp \ + 'set offload_additional_lib_paths "$(offload_additional_lib_paths)"' + mv $@.tmp $@ + +all-local: libgomp-test-support.exp + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git libgomp/testsuite/libgomp-test-support.exp.in libgomp/testsuite/libgomp-test-support.exp.in index 4586fbe..764bec0 100644 --- libgomp/testsuite/libgomp-test-support.exp.in +++ libgomp/testsuite/libgomp-test-support.exp.in @@ -2,5 +2,3 @@ set cuda_driver_include "@CUDA_DRIVER_INCLUDE@" set cuda_driver_lib "@CUDA_DRIVER_LIB@" set offload_targets "@offload_targets@" -set offload_additional_options "@offload_additional_options@" -set offload_additional_lib_paths "@offload_additional_lib_paths@" Grüße, Thomas
pgpyH1cmpnQTJ.pgp
Description: PGP signature