[PATCH] dejagnu: add support for silent builds with site.exp

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <[email protected]>
* lib/am/dejagnu.am (site.exp): Use $(AM_V_GEN) and merge all
independent shell calls into one.
---
 lib/am/dejagnu.am | 51 ++++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am
index 8b5c1af4905b..f65247db6f0a 100644
--- a/lib/am/dejagnu.am
+++ b/lib/am/dejagnu.am
@@ -49,33 +49,34 @@ check-DEJAGNU: site.exp
 ## 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 '# 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
+	$(AM_V_GEN)set -e; ( \
+	echo '## these variables are automatically generated by make ##'; \
+	echo '# Do not edit here.  If you wish to override these values'; \
+	echo '# edit the last section'; \
+	echo 'set srcdir "$(srcdir)"'; \
+	echo "set objdir \"`pwd`\""; \
 ## Quote the *_alias variables because they might be empty.
-?BUILD?	@echo 'set build_alias "$(build_alias)"' >>site.tmp
-?BUILD?	@echo 'set build_triplet $(build_triplet)' >>site.tmp
-?HOST?	@echo 'set host_alias "$(host_alias)"' >>site.tmp
-?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
+?BUILD?	echo 'set build_alias "$(build_alias)"'; \
+?BUILD?	echo 'set build_triplet $(build_triplet)'; \
+?HOST?	echo 'set host_alias "$(host_alias)"'; \
+?HOST?	echo 'set host_triplet $(host_triplet)'; \
+?TARGET?	echo 'set target_alias "$(target_alias)"'; \
+?TARGET?	echo 'set target_triplet $(target_triplet)'; \
 ## 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
+	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. ##"; \
+	done; \
+	echo "## End of auto-generated content; you can edit from here. ##"; \
+	if test -f site.exp; then \
+	  sed -e '1,/^## End of auto-generated content.*##/d' site.exp; \
+	fi; \
+	) >site.tmp; \
+	rm -f site.bak; \
+	test ! -f site.exp || mv site.exp site.bak; \
+	mv site.tmp site.exp
 
 ## ---------- ##
 ## Cleaning.  ##
-- 
2.33.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.