+## ----------------- ##
+## AWK portability. ##
+## ----------------- ##
-## ------------ ##
-## autoheader. ##
-## ------------ ##
-
-# autoheader is intensively used in its modern form throught this
-# test suite. But we also have to check that acconfig.h still works.
-
-AT_SETUP([autoheader])
-
-AT_DATA(acconfig.h,
-[[/* Define this to whatever you want. */
-#undef this
-]])
-
-
-# 1. Check that `acconfig.h' is still honored.
-AT_DATA(configure.in,
-[[AC_INIT
-AC_CONFIG_HEADERS(config.h)
-AC_DEFINE(this, "whatever you want.")
-]])
-
-AT_CHECK([autoheader --autoconf-dir .. -<configure.in], 0,
-[[/* config.h.in. Generated automatically from - by autoheader. */
-/* Define this to whatever you want. */
-#undef this
-]], ignore)
-
-
-# 2. Check that missing templates are a fatal error.
-AT_DATA(configure.in,
-[[AC_INIT
-AC_CONFIG_HEADERS(config.h)
-AC_DEFINE(that, "whatever you want.")
-]])
-
-AT_CHECK([autoheader --autoconf-dir .. -<configure.in], 1, [],
-[autoheader: No template for symbol `that'
-])
-
-
-# 3. Check TOP and BOTTOM.
-AT_DATA(acconfig.h,
-[[/* Top from acconfig.h. */
-@TOP@
-/* Middle from acconfig.h. */
-@BOTTOM@
-/* Bottom from acconfig.h. */
-]])
-
-AT_DATA(configure.in,
-[[AC_INIT
-AC_CONFIG_HEADERS(config.h)
-AH_TOP([Top1 from configure.in.])
-AH_TOP([Top2 from configure.in.])
-AH_VERBATIM([Middle], [Middle from configure.in.])
-AH_BOTTOM([Bottom1 from configure.in.])
-AH_BOTTOM([Bottom2 from configure.in.])
-]])
-
-
-# Yes, that's right: the `middle' part of `acconfig.h' is still before
-# the AH_TOP part. But so what, you're not supposed to use the two
-# together.
-AT_CHECK([autoheader --autoconf-dir .. -<configure.in], 0,
-[[/* config.h.in. Generated automatically from - by autoheader. */
-/* Top from acconfig.h. */
-
-/* Middle from acconfig.h. */
-
-Top1 from configure.in.
-
-Top2 from configure.in.
-
-Middle from configure.in.
-
-Bottom1 from configure.in.
-
-Bottom2 from configure.in.
-/* Bottom from acconfig.h. */
-]], [])
-
-
-AT_CLEANUP
-
-
-
-
-## ------------ ##
-## autoupdate. ##
-## ------------ ##
-
-# Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
-AT_SETUP([autoupdate])
-
-AT_DATA(configure.in,
-[[AC_INIT(Test, 1.0)
-AC_CANONICAL_SYSTEM
-dnl The doc says 27 is a valid fubar.
-fubar=27
-AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
-]])
-
-AT_DATA([expout],
-[[AC_INIT([Test],[1.0])
-AC_CANONICAL_TARGET([])
-dnl The doc says 27 is a valid fubar.
-fubar=27
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_COMMANDS([default],[[echo $fubar]],[[fubar=$fubar]])
-AC_OUTPUT
-]])
-
-# Checking `autoupdate'.
-AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
- [autoupdate: `configure.in' is updated
-])
-AT_CHECK([cat configure.in], 0, [expout])
-# Checking that `autoupdate' is idempotent
-AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
- [autoupdate: `configure.in' is unchanged
-])
-AT_CHECK([cat configure.in], 0, [expout])
-
-AT_CLEANUP
-
-
-# autoupdating AC_LINK_FILES
-# --------------------------
-AT_SETUP([autoupdating AC_LINK_FILES])
+AT_SETUP([AWK portability])
-AT_DATA(configure.in,
+AT_DATA([configure.in],
[[AC_INIT
-AC_LINK_FILES(dst1 dst2, src1 src2)
-AC_OUTPUT
]])
-AT_DATA(dst1, dst1
-)
-AT_DATA(dst2, dst2
-)
-
-# Checking `autoupdate'.
-AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
- [autoupdate: `configure.in' is updated
-])
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
-AT_CHECK_CONFIGURE
-AT_CHECK([cat src1], 0, [dst1
-])
-AT_CHECK([cat src2], 0, [dst2
-])
-
-AT_CLEANUP(src1 src2)
-
-
-# autoupdating AC_PREREQ
-# ----------------------
-AT_SETUP([autoupdating AC_PREREQ])
-
-cat >expout <<EOF
-AC_PREREQ($at_version)
-EOF
-
-AT_CHECK([echo "AC_PREREQ(1.0)" |
- autoupdate --autoconf-dir $top_srcdir -],
- 0, [expout], [])
+if (gawk --version) >/dev/null 2>&1; then
+ # Generation of the script.
+ AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir], 0,
+ [], [])
+ # Tracing.
+ AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir -t AC_INIT], 0,
+ ignore, [])
+ # Syntax correctness of ifnames.
+ AT_CHECK([AWK='gawk --posix' ifnames empty], 0,
+ [], [])
+fi
-AT_CHECK([echo "AC_PREREQ($at_version)" |
- autoupdate --autoconf-dir $top_srcdir -],
- 0, [expout], [])
+AT_CLEANUP(configure)
-AT_CHECK([echo "AC_PREREQ(999.99)" |
- autoupdate --autoconf-dir $top_srcdir -],
- 1, [], [ignore])
-AT_CLEANUP
## ------------------ ##
-# Tracing user defined macros
-# ---------------------------
-AT_SETUP([autoconf --trace])
+# autoconf --trace: user macros
+# -----------------------------
+AT_SETUP([autoconf --trace: user macros])
AT_DATA(configure.in,
[[define([active], [ACTIVE])
AT_CLEANUP
-# Tracing builtins
-# ----------------
-AT_SETUP([Tracing M4 builtins])
+# autoconf --trace: builtins
+# --------------------------
+AT_SETUP([autoconf --trace: builtins])
AT_DATA(configure.in,
[[define([active], [ACTIVE])
-## ---------------------------- ##
-## autoconf's AWK portability. ##
-## ---------------------------- ##
-
-AT_SETUP([AWK portability])
-
-AT_DATA([configure.in],
-[[AC_INIT
-]])
-
-if (gawk --version) >/dev/null 2>&1; then
- # Generation of the script.
- AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir], 0,
- [], [])
- # Tracing.
- AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir -t AC_INIT], 0,
- ignore, [])
- # Syntax correctness of ifnames.
- AT_CHECK([AWK='gawk --posix' ifnames empty], 0,
- [], [])
-fi
-
-AT_CLEANUP(configure)
-
-
-
-
-
## --------- ##
## ifnames. ##
## --------- ##
], [])
AT_CLEANUP(configure)
+
+
+
+## ------------ ##
+## autoheader. ##
+## ------------ ##
+
+# autoheader is intensively used in its modern form throught this
+# test suite. But we also have to check that acconfig.h still works.
+# autoheader uses autoconf --trace, so traces first.
+
+AT_SETUP([autoheader])
+
+AT_DATA(acconfig.h,
+[[/* Define this to whatever you want. */
+#undef this
+]])
+
+
+# 1. Check that `acconfig.h' is still honored.
+AT_DATA(configure.in,
+[[AC_INIT
+AC_CONFIG_HEADERS(config.h)
+AC_DEFINE(this, "whatever you want.")
+]])
+
+AT_CHECK([autoheader --autoconf-dir .. -<configure.in], 0,
+[[/* config.h.in. Generated automatically from - by autoheader. */
+/* Define this to whatever you want. */
+#undef this
+]], ignore)
+
+
+# 2. Check that missing templates are a fatal error.
+AT_DATA(configure.in,
+[[AC_INIT
+AC_CONFIG_HEADERS(config.h)
+AC_DEFINE(that, "whatever you want.")
+]])
+
+AT_CHECK([autoheader --autoconf-dir .. -<configure.in], 1, [],
+[autoheader: No template for symbol `that'
+])
+
+
+# 3. Check TOP and BOTTOM.
+AT_DATA(acconfig.h,
+[[/* Top from acconfig.h. */
+@TOP@
+/* Middle from acconfig.h. */
+@BOTTOM@
+/* Bottom from acconfig.h. */
+]])
+
+AT_DATA(configure.in,
+[[AC_INIT
+AC_CONFIG_HEADERS(config.h)
+AH_TOP([Top1 from configure.in.])
+AH_TOP([Top2 from configure.in.])
+AH_VERBATIM([Middle], [Middle from configure.in.])
+AH_BOTTOM([Bottom1 from configure.in.])
+AH_BOTTOM([Bottom2 from configure.in.])
+]])
+
+
+# Yes, that's right: the `middle' part of `acconfig.h' is still before
+# the AH_TOP part. But so what, you're not supposed to use the two
+# together.
+AT_CHECK([autoheader --autoconf-dir .. -<configure.in], 0,
+[[/* config.h.in. Generated automatically from - by autoheader. */
+/* Top from acconfig.h. */
+
+/* Middle from acconfig.h. */
+
+Top1 from configure.in.
+
+Top2 from configure.in.
+
+Middle from configure.in.
+
+Bottom1 from configure.in.
+
+Bottom2 from configure.in.
+/* Bottom from acconfig.h. */
+]], [])
+
+
+AT_CLEANUP
+
+
+
+
+## ------------ ##
+## autoupdate. ##
+## ------------ ##
+
+# Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
+AT_SETUP([autoupdate])
+
+AT_DATA(configure.in,
+[[AC_INIT(Test, 1.0)
+AC_CANONICAL_SYSTEM
+dnl The doc says 27 is a valid fubar.
+fubar=27
+AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
+]])
+
+AT_DATA([expout],
+[[AC_INIT([Test],[1.0])
+AC_CANONICAL_TARGET([])
+dnl The doc says 27 is a valid fubar.
+fubar=27
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_COMMANDS([default],[[echo $fubar]],[[fubar=$fubar]])
+AC_OUTPUT
+]])
+
+# Checking `autoupdate'.
+AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
+ [autoupdate: `configure.in' is updated
+])
+AT_CHECK([cat configure.in], 0, [expout])
+# Checking that `autoupdate' is idempotent
+AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
+ [autoupdate: `configure.in' is unchanged
+])
+AT_CHECK([cat configure.in], 0, [expout])
+
+AT_CLEANUP
+
+
+# autoupdating AC_LINK_FILES
+# --------------------------
+AT_SETUP([autoupdating AC_LINK_FILES])
+
+AT_DATA(configure.in,
+[[AC_INIT
+AC_LINK_FILES(dst1 dst2, src1 src2)
+AC_OUTPUT
+]])
+
+AT_DATA(dst1, dst1
+)
+AT_DATA(dst2, dst2
+)
+
+# Checking `autoupdate'.
+AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
+ [autoupdate: `configure.in' is updated
+])
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
+AT_CHECK_CONFIGURE
+AT_CHECK([cat src1], 0, [dst1
+])
+AT_CHECK([cat src2], 0, [dst2
+])
+
+AT_CLEANUP(src1 src2)
+
+
+# autoupdating AC_PREREQ
+# ----------------------
+AT_SETUP([autoupdating AC_PREREQ])
+
+cat >expout <<EOF
+AC_PREREQ($at_version)
+EOF
+
+AT_CHECK([echo "AC_PREREQ(1.0)" |
+ autoupdate --autoconf-dir $top_srcdir -],
+ 0, [expout], [])
+
+AT_CHECK([echo "AC_PREREQ($at_version)" |
+ autoupdate --autoconf-dir $top_srcdir -],
+ 0, [expout], [])
+
+AT_CHECK([echo "AC_PREREQ(999.99)" |
+ autoupdate --autoconf-dir $top_srcdir -],
+ 1, [], [ignore])
+
+AT_CLEANUP