-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
-