+AT_SETUP([fix-gnulib.pl header directory creation])
+
+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
+]])
+
+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)
+]])
+
+AT_CLEANUP
+