## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
-## 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
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
@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 \
@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?