bug-automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"make check-TEST" lossage on FreeBSD make (+ untested patch)


From: Paul Eggert
Subject: "make check-TEST" lossage on FreeBSD make (+ untested patch)
Date: Tue, 04 May 2004 23:14:23 -0700

At the end of
<http://mail.gnu.org/archive/html/bug-gnulib/2004-05/msg00020.html>,
Mark D. Baushke reports that an Automake-generated rule fails on
FreeBSD "make", which uses "sh -e" on its subcommands.  I see several
other places where similar problems might occur.  Here's a proposed
(but completely untested, alas) patch for the problems I found.

2004-05-04  Paul Eggert  <address@hidden>

        * Makefile.am (fetch): Work even with FreeBSD "make", which
        uses sh -e and thus errors-out if a simple-command fails.
        * lib/am/check.am (check-TESTS): Likewise.
        * lib/am/ltlib.am (clean-%DIR%LTLIBRARIES): Likewise.
        * lib/am/tags.am (TAGS): Likewise.

Index: Makefile.am
===================================================================
RCS file: /cvs/automake/automake/Makefile.am,v
retrieving revision 1.232
diff -p -u -r1.232 Makefile.am
--- Makefile.am 10 Apr 2004 17:18:01 -0000      1.232
+++ Makefile.am 5 May 2004 06:08:14 -0000
@@ -344,6 +344,6 @@ fetch:
            cp Fetchdir/$$file $(srcdir)/lib/$$file; \
          fi; \
        done; \
-       test $$stat = 1 && \
+       test $$stat = 0 || \
          echo "See Fetchdir/update.patch for a log of the changes."; \
        exit $$stat
Index: lib/am/check.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/check.am,v
retrieving revision 1.4
diff -p -u -r1.4 check.am
--- lib/am/check.am     2 Jun 2003 07:08:40 -0000       1.4
+++ lib/am/check.am     5 May 2004 06:08:14 -0000
@@ -80,20 +80,20 @@ check-TESTS: $(TESTS)
          skipped=""; \
          if test "$$skip" -ne 0; then \
            skipped="($$skip tests were not run)"; \
-           test `echo "$$skipped" | wc -c` -gt `echo "$$banner" | wc -c` && \
+           test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
              dashes="$$skipped"; \
          fi; \
          report=""; \
          if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
            report="Please report to $(PACKAGE_BUGREPORT)"; \
-           test `echo "$$report" | wc -c` -gt `echo "$$banner" | wc -c` && \
+           test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
              dashes="$$report"; \
          fi; \
          dashes=`echo "$$dashes" | sed s/./=/g`; \
          echo "$$dashes"; \
          echo "$$banner"; \
-         test -n "$$skipped" && echo "$$skipped"; \
-         test -n "$$report" && echo "$$report"; \
+         test -z "$$skipped" || echo "$$skipped"; \
+         test -z "$$report" || echo "$$report"; \
          echo "$$dashes"; \
          test "$$failed" -eq 0; \
        else :; fi
Index: lib/am/ltlib.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/ltlib.am,v
retrieving revision 1.30
diff -p -u -r1.30 ltlib.am
--- lib/am/ltlib.am     28 Jan 2004 20:50:43 -0000      1.30
+++ lib/am/ltlib.am     5 May 2004 06:08:15 -0000
@@ -86,7 +86,7 @@ clean-%DIR%LTLIBRARIES:
 ## directory where the shared object is created.
        @list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \
          dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" = "$$p" && dir=.; \
+         test "$$dir" != "$$p" || dir=.; \
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
Index: lib/am/tags.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/tags.am,v
retrieving revision 1.41
diff -p -u -r1.41 tags.am
--- lib/am/tags.am      24 Apr 2004 10:45:42 -0000      1.41
+++ lib/am/tags.am      5 May 2004 06:08:15 -0000
@@ -62,7 +62,7 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %
 ?SUBDIRS?      list='$(SUBDIRS)'; for subdir in $$list; do \
 ## Do nothing if we're trying to look in `.'.
 ?SUBDIRS?        if test "$$subdir" = .; then :; else \
-?SUBDIRS?          test -f $$subdir/TAGS && \
+?SUBDIRS?          test ! -f $$subdir/TAGS || \
 ## Note that the = is mandatory for --etags-include.
 ?SUBDIRS?            tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
 ?SUBDIRS?        fi; \
@@ -77,7 +77,7 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %
               END { for (i in files) print i; }'`; \
 ## Make sure we have something to run etags on.
        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-         test -z "$$unique" && unique=$$empty_fix; \
+         test -n "$$unique" || unique=$$empty_fix; \
          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
            $$tags $$unique; \
        fi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]