]> git.draconx.ca Git - dxcommon.git/blobdiff - tests/scripts.at
fix-gnulib.pl: Convert rules to dirstamp prerequisites.
[dxcommon.git] / tests / scripts.at
index 7a873a9086fcdaa4b4007f935ad34dcbd938ebb6..92db0a1675ab474b5e6fb15469ebd575c52f23f8 100644 (file)
@@ -910,38 +910,6 @@ grep SED_HEADER test.mk], [0], [expout])
 
 AT_CLEANUP
 
-AT_SETUP([fix-gnulib.pl %reldir% substitution])
-AT_KEYWORDS([fix-gnulib perl script scripts])
-
-test_gnulib_mk sys_types >test.mk.in
-AT_CHECK([grep '%reldir%' test.mk.in >/dev/null || exit 99])
-
-sed -n <test.mk.in >expout '
-$G
-$p
-$b
-/^## begin gnulib/,/^## end   gnulib/!b
-/^#/{
-p
-b
-}
-s|(srcdir)|(top_srcdir)|
-s|%reldir%|lib|
-s|BUILT_SOURCES|gnulib_core_headers|
-s|sys[[/_]]|lib/&|g
-/^MOSTLYCLEANFILES/{
-h
-b
-}
-p'
-
-AT_CHECK([test_fix_gnulib -i test.mk.in -o test.mk || exit
-sed -n -e '/^## begin gnulib/,/^## end   gnulib/p' \
-       -e '/CLEANFILES/p' test.mk],
-[0], [expout])
-
-AT_CLEANUP
-
 AT_SETUP([fix-gnulib.pl warning removal])
 AT_KEYWORDS([fix-gnulib perl script scripts])
 
@@ -965,34 +933,31 @@ AT_CLEANUP
 AT_SETUP([fix-gnulib.pl header directory creation])
 AT_KEYWORDS([fix-gnulib perl script scripts])
 
-AT_DATA([extract.sed],
-[[/AM_V_GEN/b ok
-/gl_V_at/b ok
-s/:.*/:/
-h
-b
-:ok
-s/'//g
-x
-G
-p
-n
-s/[)].*/)/
-p
+AT_DATA([extract.awk],
+[[$0 !~ /^\t/ && $1 ~ /:$/ {
+  target=$1;
+
+  for (i = 2; i <= NF; i++) {
+    if ($i ~ /am__dirstamp/)
+      target = target " " $i;
+  }
+
+  next;
+}
+
+target != "" && sub(/[$][({](AM_V_GEN|gl_V_at)[})].*$/, "[OK]") {
+  print target, $1;
+}
+
+{ target=""; }
 ]])
 
 test_gnulib_mk alloca-opt sys_types stddef >test.mk.in
 AT_CHECK([test_fix_gnulib -i test.mk.in -o test.mk || exit
-sed -n -f extract.sed test.mk], [0],
-[[lib/alloca.h:
-       $(AM_V_GEN)$(MKDIR_P) lib
-       $(AM_V_at)
-lib/sys/types.h:
-       $(AM_V_GEN)$(MKDIR_P) lib/sys
-       $(AM_V_at)
-lib/stddef.h:
-       $(AM_V_GEN)$(MKDIR_P) lib
-       $(AM_V_at)
+$AWK -f extract.awk test.mk], [0],
+[[lib/alloca.h: lib/$(am__dirstamp) [OK]
+lib/sys/types.h: lib/sys/$(am__dirstamp) [OK]
+lib/stddef.h: lib/$(am__dirstamp) [OK]
 ]])
 
 AT_CLEANUP