On Thu, Oct 30, 2014 at 02:40:01PM +0300, Ilya Verbin wrote: > 2014-10-30 Andrey Turetskiy <andrey.turets...@intel.com> > Ilya Verbin <ilya.ver...@intel.com> > > libgomp/ > * Makefile.in: Regenerate. > * configure: Regenerate. > * configure.ac: Set up offload_additional_options, > offload_additional_lib_paths and offload_targets. > * testsuite/Makefile.am: Overrule site.exp. > * testsuite/Makefile.in: Regenerate. > * testsuite/lib/libgomp.exp (libgomp_init): Append > offload_additional_lib_paths to LD_LIBRARY_PATH. Append > offload_additional_options to ALWAYS_CFLAGS. Append liboffloadmic > build directory to LD_LIBRARY_PATH for intelmic offload targets.
Looks mostly good, but: > --- a/libgomp/testsuite/Makefile.am > +++ b/libgomp/testsuite/Makefile.am > @@ -11,3 +11,30 @@ 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)" > + > +# We need more things in site.exp, but automake completely controls the > +# creation of that file; there's no way to append to it without messing up > +# the dependancy chains. So we overrule automake. This rule is exactly > +# what it would have generated, plus our own additions. > +site.exp: Makefile > + @echo 'Making a new site.exp file...' > + @echo '## these variables are automatically generated by make ##' > >site.tmp > + @echo '# Do not edit here. If you wish to override these values' > >>site.tmp > + @echo '# edit the last section' >>site.tmp > + @echo 'set srcdir $(srcdir)' >>site.tmp > + @echo "set objdir `pwd`" >>site.tmp > + @echo 'set build_alias "$(build_alias)"' >>site.tmp > + @echo 'set build_triplet $(build_triplet)' >>site.tmp > + @echo 'set host_alias "$(host_alias)"' >>site.tmp > + @echo 'set host_triplet $(host_triplet)' >>site.tmp > + @echo 'set target_alias "$(target_alias)"' >>site.tmp > + @echo 'set target_triplet $(target_triplet)' >>site.tmp > + @echo 'set offload_targets "$(offload_targets)"' >>site.tmp > + @echo 'set offload_additional_options "$(offload_additional_options)"' > >>site.tmp > + @echo 'set offload_additional_lib_paths > "$(offload_additional_lib_paths)"' >>site.tmp > + @echo '## All variables above are generated by configure. Do Not Edit > ##' >>site.tmp > + @test ! -f site.exp || \ > + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp > + @-rm -f site.bak > + @test ! -f site.exp || mv site.exp site.bak > + @mv site.tmp site.exp I don't like this, that is too fragile. If automake is changed, we'll forget to update this. If all you are about are the 3 additional variables, can't you instead put them into env vars and query them in the tcl code using getenv? Or append them into AM_RUNTESTFLAGS ? AM_RUNTESTFLAGS += @something@ > @@ -169,6 +186,10 @@ proc libgomp_init { args } { > > # Disable color diagnostics > lappend ALWAYS_CFLAGS "additional_flags=-fdiagnostics-color=never" > + > + # Required to support non-fallback testing of '#pragma omp target'. > + # Help GCC to find target mkoffload. > + lappend ALWAYS_CFLAGS "additional_flags=${offload_additional_options}" > } Perhaps add this only if offload_additional_options is non-empty? Jakub