1 dnl Copyright © 2021-2022 Nick Bowler
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.
7 AT_BANNER([Automake snippet tests])
9 m4_define([TEST_DEPFILES_INIT],
11 [[AM_INIT_AUTOMAKE([foreign])
14 AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
17 AM_OUTPUT_DEPENDENCY_COMMANDS
21 AC_CONFIG_FILES([Makefile])
24 cp "$srcdir/snippet/autotest.mk" .
25 AT_DATA([Makefile.am],
28 include $(top_srcdir)/autotest.mk
33 AT_SETUP([autotest.mk depfiles (MAKE=gmake)])
38 AT_CHECK([{ echo 'rule:; @: $(info works)' |
39 gmake --no-print-directory -f - >out 2>/dev/null &&
40 read s <out && test x"$s" = x"works"; } || exit 77])
43 AT_CHECK([cd build && ../configure MAKE=gmake && test -f .deps/testsuite.P],
45 AT_CHECK([gmake --no-print-directory -sC build distclean &&
50 AT_SETUP([autotest.mk depfiles (MAKE=dmake)])
55 AT_CHECK([{ echo 'rule:; @echo works' | dmake -f - >out 2>/dev/null &&
56 read s <out && test x"$s" = x"works"; } || exit 77])
58 AT_CHECK([./configure MAKE=dmake && test -f .deps/testsuite.P], [0], [ignore])
62 AT_SETUP([autotest.mk no depfiles])
65 [[AM_INIT_AUTOMAKE([foreign])
68 AM_OUTPUT_DEPENDENCY_COMMANDS
73 AM_CONDITIONAL([HAVE_AUTOTEST], [:])
75 AC_CONFIG_FILES([Makefile])
78 cp "$srcdir/snippet/autotest.mk" .
79 AT_DATA([Makefile.am],
82 include $(top_srcdir)/autotest.mk
86 TEST_CONFIGURE([--disable-dependency-tracking])
88 AT_DATA([testsuite.at])
89 AT_CHECK([make -s AUTOTEST="$srcdir/t/autotest.sh" testsuite])
93 AT_SETUP([glconfig.mk no depfiles])
96 [[AM_INIT_AUTOMAKE([foreign])
99 AM_OUTPUT_DEPENDENCY_COMMANDS
104 AC_SUBST([GLSRC], [lib])
106 AC_CONFIG_FILES([Makefile])
109 cp "$srcdir/snippet/glconfig.mk" .
110 AT_DATA([Makefile.am],
114 include $(top_srcdir)/glconfig.mk
118 TEST_CONFIGURE([--disable-dependency-tracking])
119 AT_CHECK([make -s lib/glconfig.h])
120 AT_CHECK([test ! -d lib/.deps && test ! -d lib/_deps && cat lib/glconfig.h])