From 01b3db1d0799be463efef22f2a8e3bc2f835510d Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 10 Aug 2012 13:02:29 +0200 Subject: [PATCH] [ng] dejagnu: include verbatim * lib/am/dejagnu.am: Rename ... * lib/am/dejagnu.mk: ... like this, and rewrite partially to make it readable verbatim. * Makefile.am (dist_am_DATA): Adjust. * automake.in (handle_tests): When DejaGNU support is needed, include 'dejagnu.mk' verbatim in the output Makefile. * t/dejagnu2.sh: Adjust. Signed-off-by: Stefano Lattarini --- Makefile.am | 2 +- automake.in | 2 +- lib/am/dejagnu.mk | 56 ++++++++++++++++++++++++----------------------- t/dejagnu2.sh | 8 +------ 4 files changed, 32 insertions(+), 36 deletions(-) diff --git a/Makefile.am b/Makefile.am index d2f014f94..7d2b2559e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -194,10 +194,10 @@ dist_am_DATA = \ lib/am/clean.mk \ lib/am/header-vars.mk \ lib/am/tags.mk \ + lib/am/dejagnu.mk \ lib/am/compile.am \ lib/am/configure.am \ lib/am/data.am \ - lib/am/dejagnu.am \ lib/am/depend2.am \ lib/am/distdir.am \ lib/am/footer.am \ diff --git a/automake.in b/automake.in index 4e28402bd..74560a47e 100644 --- a/automake.in +++ b/automake.in @@ -3977,7 +3977,7 @@ sub handle_tests { if (option 'dejagnu') { - $output_rules .= file_contents ('dejagnu', new Automake::Location); + verbatim ('dejagnu'); } else { diff --git a/lib/am/dejagnu.mk b/lib/am/dejagnu.mk index c3a96591b..f34178bf4 100644 --- a/lib/am/dejagnu.mk +++ b/lib/am/dejagnu.mk @@ -14,15 +14,20 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . -## Name of tool to use. Default is the same as the package. +# Name of tool to use. Default is the same as the package. +ifeq ($(call am.vars.is-undef,DEJATOOL),yes) DEJATOOL = $(PACKAGE) +endif -## Default flags to pass to dejagnu. The user can override this. +# Default flags to pass to dejagnu. The user can override this. +ifeq ($(call am.vars.is-undef,$(RUNTESTDEFAULTFLAGS)),yes) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +endif -EXPECT = expect -RUNTEST = runtest - +# FIXME: is a good idea to let this being overridden from the +# environment? +EXPECT ?= expect +RUNTEST ?= runtest .PHONY: check-DEJAGNU check-DEJAGNU: site.exp @@ -40,13 +45,9 @@ check-DEJAGNU: site.exp exit $$exit_status -## ------------------- ## -## Building site.exp. ## -## ------------------- ## - -## Note that in the rule we don't directly generate site.exp to avoid -## the possibility of a corrupted site.exp if make is interrupted. -## Jim Meyering has some useful text on this topic. +# Note that in the rule we don't directly generate site.exp to avoid +# the possibility of a corrupted site.exp if make is interrupted. +# Jim Meyering has some useful text on this topic. site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo 'Making a new site.exp file ...' @echo '## these variables are automatically generated by make ##' >site.tmp @@ -54,14 +55,20 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo '# edit the last section' >>site.tmp @echo 'set srcdir "$(srcdir)"' >>site.tmp @echo "set objdir `pwd`" >>site.tmp -## Quote the *_alias variables because they might be empty. - $(if $(am.conf.build-triplet),@echo 'set build_triplet $(build)' >>site.tmp) - $(if $(am.conf.build-triplet),@echo 'set build_alias "$(build_alias)"' >>site.tmp) - $(if $(am.conf.host-triplet),@echo 'set host_triplet $(host)' >>site.tmp) - $(if $(am.conf.host-triplet),@echo 'set host_alias "$(host_alias)"' >>site.tmp) - $(if $(am.conf.target-triplet),@echo 'set target_alias "$(target_alias)"' >>site.tmp) - $(if $(am.conf.target-triplet),@echo 'set target_triplet $(target)' >>site.tmp) -## Allow the package author to extend site.exp. + @# Quote the *_alias variables because they might be empty. +ifdef am.conf.build-triplet + @echo 'set build_triplet $(build)' >>site.tmp + @echo 'set build_alias "$(build_alias)"' >>site.tmp +endif +ifdef am.conf.host-triplet + @echo 'set host_triplet $(host)' >>site.tmp + @echo 'set host_alias "$(host_alias)"' >>site.tmp +endif +ifdef am.conf.target-triplet + @echo 'set target_triplet $(target)' >>site.tmp + @echo 'set target_alias "$(target_alias)"' >>site.tmp +endif + @# Allow the package author to extend site.exp. @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ echo "## Begin content included from file $$f. Do not modify. ##" \ && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ @@ -76,13 +83,8 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp -## ---------- ## -## Cleaning. ## -## ---------- ## - -## Any other cleaning must be done by the user or by the test suite -## itself. We can't predict what dejagnu or the test suite might -## generate. +# Any other cleaning must be done by the user or by the test suite itself. +# We can't predict what dejagnu or the test suite might generate. ## FIXME: we clean these on "make distclean" only for better compatibility ## FIXME: with mainline Automake, but wouldn't be more correct to clean ## FIXME: them on "make clean" instead? diff --git a/t/dejagnu2.sh b/t/dejagnu2.sh index 5b75bb698..51f23fb74 100755 --- a/t/dejagnu2.sh +++ b/t/dejagnu2.sh @@ -31,16 +31,10 @@ END $ACLOCAL $AUTOCONF -$AUTOMAKE -Wno-override - -grep 'site\.exp' Makefile.in -test $(grep -c '^site\.exp:' Makefile.in) -eq 1 +$AUTOMAKE ./configure $MAKE site.exp grep ':GREP:ME:' site.exp -AUTOMAKE_fails -grep '^Makefile\.am:3:.*site\.exp' stderr - : -- 2.47.2