tests: fix build-aux/check.mk for non-GNU make
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 2 Aug 2008 11:22:32 +0000 (13:22 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 2 Aug 2008 11:57:17 +0000 (13:57 +0200)
* build-aux/check.mk ($(TEST_LOGS)) [!GNU_MAKE]: Check for
a $(TESTS) test in the build dir, before one in srcdir.  For details,
see <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14198>.

build-aux/check.mk

index f26696d..92935d9 100644 (file)
@@ -159,8 +159,9 @@ CHECK-FORCE:
 DEPENDENCY = CHECK-FORCE
 $(TEST_LOGS): $(DEPENDENCY)
        @if test '$(DEPENDENCY)' = CHECK-FORCE; then                    \
-         dst=$@;                                                       \
-         exec $(MAKE) $(AM_MAKEFLAGS) DEPENDENCY='$(srcdir)'/$${dst%.log} $@;\
+         dst=$@; src=$${dst%.log};                                     \
+         test -x "$$src" || src='$(srcdir)'/$$src;                     \
+         exec $(MAKE) $(AM_MAKEFLAGS) DEPENDENCY="$$src" $@;           \
        else                                                            \
          src='$(DEPENDENCY)';                                          \
          $(am__check_pre) "$$dir$$src" $(am__check_post);              \