--- /dev/null
+/config.*
+/configure
+/aclocal.m4
+/autom4te.cache
+/install-sh
+/missing
+/testsuite.dir
+/testsuite.log
+/testsuite
+/package.m4
+/atconfig
+Makefile.in
+Makefile
+.deps
--- /dev/null
+# Copyright © 2015 Nick Bowler
+#
+# License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+# This is free software: you are free to do what the fuck you want to.
+# There is NO WARRANTY, to the extent permitted by law.
+
+ACLOCAL_AMFLAGS = -I m4
+
+EXTRA_DIST =
+SUFFIXES =
+
+check-local: check-autotest
+check-autotest: testsuite
+ $(SHELL) testsuite $(TESTSUITEFLAGS)
+.PHONY: check-autotest
+
+clean-local: clean-autotest
+clean-autotest:
+ test ! -f testsuite || $(SHELL) testsuite --clean
+.PHONY: clean-autotest
+
+maintainer-clean-local: maintainer-clean-autotest
+maintainer-clean-autotest:
+ rm -f testsuite package.m4
+.PHONY: maintainerclean-autotest
+
+package.m4:
+ $(AM_V_GEN) :; { \
+ printf 'm4_define([%s], [%s])\n' \
+ AT_PACKAGE_NAME '$(PACKAGE_NAME)' \
+ AT_PACKAGE_TARNAME '$(PACKAGE_TARNAME)' \
+ AT_PACKAGE_VERSION '$(PACKAGE_VERSION)' \
+ AT_PACKAGE_STRING '$(PACKAGE_STRING)' \
+ AT_PACKAGE_BUGREPORT '$(PACKAGE_BUGREPORT)' \
+ AT_PACKAGE_URL '$(PACKAGE_URL)' \
+ ; } >$@.tmp
+ $(AM_V_at) mv -f $@.tmp $@
+
+testsuite: testsuite.at package.m4
+if !HAVE_AUTOTEST
+ @:; { \
+ printf 'ERROR: Autotest was not available at configure time.\n'; \
+ printf 'You should only need it if you modified the test suite.\n'; \
+ printf 'Autotest is part of autom4te, included in the GNU\n'; \
+ printf 'Autoconf package: <https://gnu.org/s/autoconf/>\n'; \
+ } 1>&2
+ @false
+endif
+ $(AM_V_GEN) $(AUTOTEST) $(ATFLAGS) -p m4_include -o $@.tmp testsuite.at
+ $(AM_V_at) :; { \
+ $(AUTOTEST) $(ATFLAGS) -t m4_include:'$@: $$1' testsuite.at; \
+ $(AUTOTEST) $(ATFLAGS) -t m4_include:'$$1:' testsuite.at; \
+ } >$(DEPDIR)/$(@F).P
+ $(AM_V_at) mv -f $@.tmp $@
+
+EXTRA_DIST += testsuite testsuite.at package.m4
+
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/testsuite.P@am__quote@
--- /dev/null
+dnl Copyright © 2015 Nick Bowler
+dnl
+dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+dnl This is free software: you are free to do what the fuck you want to.
+dnl There is NO WARRANTY, to the extent permitted by law.
+
+AC_PREREQ([2.68])
+AC_INIT([dxcommon], [0], [nbowler@draconx.ca])
+AC_CONFIG_SRCDIR([m4/base.m4])
+
+AC_PROG_CC
+
+AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
+AM_SILENT_RULES([yes])
+
+DX_INIT([.])
+
+AC_CONFIG_TESTDIR([.])
+DX_PROG_AUTOTEST
+AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
+
+AC_CONFIG_FILES([
+ Makefile
+])
+AC_OUTPUT
--- /dev/null
+dnl Copyright © 2015 Nick Bowler
+dnl
+dnl Macro to find an working autotest installation.
+dnl
+dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+dnl This is free software: you are free to do what the fuck you want to.
+dnl There is NO WARRANTY, to the extent permitted by law.
+
+m4_define([_DX_PROG_AUTOTEST_SRC], [cat >conftest.at <<'EOF'
+m4@&t@_define(@<:@AT_PACKAGE_STRING@:>@, @<:@AC_PACKAGE_STRING@:>@)
+m4@&t@_define(@<:@AT_PACKAGE_BUGREPORT@:>@, @<:@AC_PACKAGE_BUGREPORT@:>@)
+AT_INIT
+EOF])
+
+m4_define([_DX_PROG_AUTOTEST_CHECK_OUT],
+ [AS_IF([$FGREP "$PACKAGE_STRING" conftest.out >/dev/null 2>&1],
+ [DX_DO([dx_cv_autotest_works=yes],
+ [AS_VAR_SET([dx_cv_autotest_cmd], ["$1"])])])])
+
+m4_define([_DX_PROG_AUTOTEST_CHECK_CMD],
+ [AS_IF([test x"$dx_cv_autotest_cmd" = x"false"],
+ [AS_IF([AC_RUN_LOG([$1 conftest.at >conftest.sh])],
+ [AS_IF([AC_RUN_LOG([$SHELL conftest.sh --version >conftest.out])],
+ [_DX_PROG_AUTOTEST_CHECK_OUT($@)])])])])
+
+m4_define([_DX_PROG_AUTOTEST_SET_VAR],
+ [DX_DO([AC_CACHE_CHECK([for autotest], [dx_cv_autotest_cmd],
+ [AS_VAR_SET_IF([AUTOTEST],
+ [dx_cv_autotest_cmd=$AUTOTEST],
+ [DX_DO([dx_cv_autotest_works=no dx_cv_autotest_cmd=false],
+ [AS_VAR_SET_IF([AUTOTEST],
+ [_DX_PROG_AUTOTEST_CHECK_CMD([$AUTOTEST])])],
+ [AS_VAR_SET_IF([AUTOM4TE],
+ [_DX_PROG_AUTOTEST_CHECK_CMD([$AUTOM4TE -l autotest])])],
+ [_DX_PROG_AUTOTEST_CHECK_CMD([autom4te -l autotest])])])])],
+ [AUTOTEST=$dx_cv_autotest_cmd])])
+
+AC_DEFUN([DX_PROG_AUTOTEST],
+ [m4_do([AC_REQUIRE([AC_PROG_FGREP])],
+ [AC_ARG_VAR([AUTOTEST], [command to compile autotest programs])],
+ [DX_DO([_DX_PROG_AUTOTEST_SRC],
+ [_DX_PROG_AUTOTEST_SET_VAR],
+ [AC_CACHE_CHECK([whether autotest works],
+ [dx_cv_autotest_works],
+ [DX_DO([dx_cv_autotest_works=no],
+ [_DX_PROG_AUTOTEST_CHECK_CMD([$AUTOTEST])])])])],
+ [AC_SUBST([AUTOTEST])])])
--- /dev/null
+dnl Copyright © 2015 Nick Bowler
+dnl
+dnl Assorted helper macros
+dnl
+dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+dnl This is free software: you are free to do what the fuck you want to.
+dnl There is NO WARRANTY, to the extent permitted by law.
+
+dnl DX_DO(arg, ...)
+dnl Expand each argument in sequence, inserting newlines between them.
+AC_DEFUN([DX_DO], [m4_do([$1], [m4_map([m4_newline], m4_cdr($@))])])
--- /dev/null
+dnl Copyright © 2015 Nick Bowler
+dnl
+dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+dnl This is free software: you are free to do what the fuck you want to.
+dnl There is NO WARRANTY, to the extent permitted by law.
+
+AT_BANNER([Autoconf macros])
+
+m4_define([TEST_CONFIGURE_AC], [AT_DATA([configure.ac],
+[[AC_INIT([test], [0])
+]$1[
+AC_OUTPUT
+]])
+cp "$srcdir/install-sh" \
+ "$srcdir/config.guess" \
+ "$srcdir/config.sub" \
+ .
+])
+
+m4_define([TEST_AUTORECONF],
+ [AT_CHECK([autoreconf -I "$srcdir/m4"], [0], [], [stderr])])
+
+m4_define([TEST_CONFIGURE], [AT_CHECK([./configure $1], [0], [ignore])])
+
+dnl Verify that the DX_BASEDIR macro expands correctly during argument
+dnl collection. Crucially, the output must not contain any other text.
+AT_SETUP([DX_BASEDIR during argument collection])
+
+AT_XFAIL_IF([:])
+
+AT_DATA([test.in],
+[[@TEST@
+]])
+
+TEST_CONFIGURE_AC(
+[[AC@&t@_SUBST([TEST], 'm4@&t@_dquote(DX_BASEDIR)')
+AC_CONFIG_FILES([test])
+]])
+TEST_AUTORECONF
+TEST_CONFIGURE
+
+printf '%s\n' "$srcdir" | sed -e 's:/\./:/:g' -e 's:/\.$::g' \
+ -e 's:\(.\)//*:\1/:g' >expout
+AT_CHECK([cat test], [0], [expout])
+
+AT_CLEANUP
--- /dev/null
+dnl Copyright © 2015 Nick Bowler
+dnl
+dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+dnl This is free software: you are free to do what the fuck you want to.
+dnl There is NO WARRANTY, to the extent permitted by law.
+
+AT_INIT
+AT_COLOR_TESTS
+
+m4_include([tests/macros.at])