[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [FYI] [ng] dejagnu: include verbatim
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [FYI] [ng] dejagnu: include verbatim |
Date: |
Fri, 10 Aug 2012 13:10:14 +0200 |
* 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 <address@hidden>
---
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 d2f014f..7d2b255 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 4e28402..74560a4 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 c3a9659..f34178b 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 <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
@@ -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 5b75bb6..51f23fb 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
-
:
--
1.7.12.rc0
- [Automake-NG] [FYI] [ng] dejagnu: include verbatim,
Stefano Lattarini <=