From 74443830ea0a683e5373a8c8beee1a657170c89c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 18 Oct 2008 12:55:04 +0200 Subject: [PATCH] * maint.mk (coreutils-path-check): New definition, now run only if src/true.c exists. Factored out of... (my-distcheck): ...here. --- maint.mk | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/maint.mk b/maint.mk index 2752486..a7d0b86 100644 --- a/maint.mk +++ b/maint.mk @@ -785,6 +785,34 @@ define my-instcheck } endef +define coreutils-path-check + { \ + if test -f $(srcdir)/src/true.c; then \ + fail=1; \ + mkdir $(bin) \ + && ($(write_loser)) > $(bin)/loser \ + && chmod a+x $(bin)/loser \ + && for i in $(built_programs); do \ + case $$i in \ + rm|expr|basename|echo|sort|ls|tr);; \ + cat|dirname|mv|wc);; \ + *) ln $(bin)/loser $(bin)/$$i;; \ + esac; \ + done \ + && ln -sf ../src/true $(bin)/false \ + && PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \ + && { test -d gnulib-tests \ + && $(MAKE) -C gnulib-tests check \ + || :; } \ + && rm -rf $(bin) \ + && fail=0; \ + else \ + fail=0; \ + fi; \ + test $$fail = 1 && exit 1 || :; \ + } +endef + # Use -Wformat -Werror to detect format-string/arg-list mismatches. # Also, check for shadowing problems with -Wshadow, and for pointer # arithmetic problems with -Wpointer-arith. @@ -810,22 +838,7 @@ my-distcheck: $(DIST_ARCHIVES) $(local-check) && $(MAKE) dvi \ && $(install-transform-check) \ && $(my-instcheck) \ - && mkdir $(bin) \ - && ($(write_loser)) > $(bin)/loser \ - && chmod a+x $(bin)/loser \ - && for i in $(built_programs); do \ - case $$i in \ - rm|expr|basename|echo|sort|ls|tr);; \ - cat|dirname|mv|wc);; \ - *) ln $(bin)/loser $(bin)/$$i;; \ - esac; \ - done \ - && ln -sf ../src/true $(bin)/false \ - && PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \ - && { test -d gnulib-tests \ - && $(MAKE) -C gnulib-tests check \ - || :; } \ - && rm -rf $(bin) \ + && $(coreutils-path-check) \ && $(MAKE) distclean (cd $(t) && mv $(distdir) $(distdir).old \ && $(AMTAR) -zxf - ) < $(distdir).tar.gz -- 2.7.4