]> git.draconx.ca Git - dxcommon.git/commitdiff
Add helper to work around Solaris /bin/sh bug in Autotest.
authorNick Bowler <nbowler@draconx.ca>
Sat, 1 Jul 2023 20:38:06 +0000 (16:38 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sat, 1 Jul 2023 20:45:00 +0000 (16:45 -0400)
This hackjob edits the definition of AT_INIT to fix the problem
described in this patch[1], even for versions of Autoconf which
do not include this fix (which, as of this writing, is all of
them).

Specifically, older Solaris /bin/sh does not correctly handle
redirections on : within a shell function, but Autotest test
suites expect this to work when preparing the environment
for AT_CHECK.

[1] https://lists.gnu.org/archive/html/autoconf-patches/2021-03/msg00000.html

snippet/at-compat.at [new file with mode: 0644]

diff --git a/snippet/at-compat.at b/snippet/at-compat.at
new file mode 100644 (file)
index 0000000..5e111b4
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright © 2023 Nick Bowler
+#
+# Compatibility helper for Autotest test suites.  This should be included
+# before expanding AT_INIT
+#
+# 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.
+
+# Redefine AT_INIT to work around nonportable constructs in current
+# (as of 2023) Autoconf releases:
+#
+#   - In a shell function, redirections on : are not correctly handled
+#     by Solaris /bin/sh.  See the following Autoconf patch for details:
+#
+#       https://lists.gnu.org/archive/html/autoconf-patches/2021-03/msg00000.html
+
+m4_define([AT_INIT],
+  m4_bpatsubst(m4_dquote(m4_defn([AT_INIT])),
+    [^\( *\)\(: >"\$at_stdout".*$\)], [\1eval '\2']))