summaryrefslogtreecommitdiff
path: root/tests/autohdr4.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/autohdr4.test')
-rwxr-xr-xtests/autohdr4.test31
1 files changed, 23 insertions, 8 deletions
diff --git a/tests/autohdr4.test b/tests/autohdr4.test
index bd753dab2..430d75c54 100755
--- a/tests/autohdr4.test
+++ b/tests/autohdr4.test
@@ -17,7 +17,7 @@
# Check rebuild rules for AC_CONFIG_HEADERS.
# (This should also work without GNU Make.)
-required=gcc
+required=cc
. ./defs || Exit 1
cat >>configure.in <<'EOF'
@@ -33,16 +33,25 @@ mkdir sub1 sub2 sub3
: > sub1/config.top
echo '#define NAME "grepme1"' >sub2/config.bot
-echo SUBDIRS = sub3 >Makefile.am
-echo noinst_PROGRAMS = run >sub3/Makefile.am
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub3
+.PHONY: test-prog-updated
+test-prog-updated:
+ stat older sub3/run$(EXEEXT) || : For debugging.
+ test `ls -t older sub3/run$(EXEEXT) | sed 1q` = sub3/run$(EXEEXT)
+END
+
+cat > sub3/Makefile.am <<'END'
+noinst_PROGRAMS = run
+END
cat >sub3/run.c <<'EOF'
#include <defs.h>
#include <config.h>
#include <stdio.h>
-int
-main ()
+int main (void)
{
puts (NAME); /* from config.h */
puts (PACKAGE); /* from defs.h */
@@ -55,13 +64,19 @@ $AUTOCONF
$AUTOHEADER
$AUTOMAKE
-./configure
+# Do not reject slow dependency extractors: we need dependency tracking.
+./configure --enable-dependency-tracking
$MAKE
-sub3/run | grep grepme1
+# Sanity check.
+cross_compiling || { sub3/run | grep grepme1; }
+: > older
$sleep
echo '#define NAME "grepme2"' > sub2/config.bot
$MAKE
-sub3/run | grep grepme2
+cross_compiling || { sub3/run | grep grepme2; }
+$MAKE test-prog-updated
$MAKE distcheck
+
+: