diff options
Diffstat (limited to 'lib/am/dejagnu.am')
-rw-r--r-- | lib/am/dejagnu.am | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am index 37f34ca44..010504f39 100644 --- a/lib/am/dejagnu.am +++ b/lib/am/dejagnu.am @@ -44,7 +44,7 @@ endif ! %?CYGNUS% .PHONY: check-DEJAGNU check-DEJAGNU: site.exp ## Life is easiest with an absolute srcdir, so do that. - srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + srcdir='$(srcdir)'; export srcdir; \ EXPECT=$(EXPECT); export EXPECT; \ ## Allow this to work when expect and DejaGnu are in tree. ## Only required when --cygnus in force. @@ -72,12 +72,12 @@ check-DEJAGNU: 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. -site.exp: Makefile +site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @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 srcdir "$(srcdir)"' >>site.tmp @echo "set objdir `pwd`" >>site.tmp ## Quote the *_alias variables because they might be empty. ?BUILD? @echo 'set build_alias "$(build_alias)"' >>site.tmp @@ -86,9 +86,17 @@ site.exp: Makefile ?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp ?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp ?TARGET? @echo 'set target_triplet $(target_triplet)' >>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 +## 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 \ + && echo "## End content included from file $$f. ##" \ + || exit 1; \ + done >> site.tmp + @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp + @if test -f site.exp; then \ + sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \ + fi @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp |