autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: s/m4/$M4/


From: Akim Demaille
Subject: FYI: s/m4/$M4/
Date: 06 Dec 2000 12:02:57 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * autoconf.sh (task trace): s/m4/$M4/.
        * autoheader.sh: When loading trace.sh, catch errors and exit with
        a decent error message.
        * tests/tools.at: Be sure to test autoconf --trace before
        autoheader.

Index: autoconf.sh
===================================================================
RCS file: /cvs/autoconf/autoconf.sh,v
retrieving revision 1.108
diff -u -u -r1.108 autoconf.sh
--- autoconf.sh 2000/12/06 08:58:14 1.108
+++ autoconf.sh 2000/12/06 10:53:46
@@ -668,7 +668,7 @@
     # sometimes and `m4_BUILTIN' at others.  We should render a unique name,
     # the one specified by the user.
     base_name=`echo "$macro_name" | sed 's/^m4_//'`
-    if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | m4; then
+    if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | $M4; then
       # BASE_NAME is a builtin.
       trace_opt="$trace_opt -t $base_name -t m4_$base_name"
       echo "$base_name$trace_format" |
Index: autoheader.sh
===================================================================
RCS file: /cvs/autoconf/autoheader.sh,v
retrieving revision 1.88
diff -u -u -r1.88 autoheader.sh
--- autoheader.sh 2000/11/16 10:12:51 1.88
+++ autoheader.sh 2000/12/06 10:53:46
@@ -256,7 +256,13 @@
   $infile >$tmp/traces.sh || { (exit 1); exit; }
 
 $verbose $me: sourcing $tmp/traces.sh >&2
-. $tmp/traces.sh
+if (set -e && . $tmp/traces.sh) >/dev/null 2>&1; then
+  . $tmp/traces.sh
+else
+  echo "$me: error: shell error while sourcing $tmp/trace.sh" >&2
+  (exit 1); exit
+fi
+
 
 # Make SYMS newline-separated rather than blank-separated, and remove dups.
 # Start each symbol with a blank (to match the blank after "#undef")
Index: tests/tools.at
===================================================================
RCS file: /cvs/autoconf/tests/tools.at,v
retrieving revision 1.14
diff -u -u -r1.14 tools.at
--- tests/tools.at 2000/12/06 08:58:15 1.14
+++ tests/tools.at 2000/12/06 10:53:48
@@ -68,184 +68,31 @@
 
 
 
+## ----------------- ##
+## 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. */
address@hidden@
-/* Middle from acconfig.h. */
address@hidden@
-/* 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
 
 
 
@@ -255,9 +102,9 @@
 ## ------------------ ##
 
 
-# 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])
@@ -310,9 +157,9 @@
 AT_CLEANUP
 
 
-# Tracing builtins
-# ----------------
-AT_SETUP([Tracing M4 builtins])
+# autoconf --trace: builtins
+# --------------------------
+AT_SETUP([autoconf --trace: builtins])
 
 AT_DATA(configure.in,
 [[define([active], [ACTIVE])
@@ -381,34 +228,6 @@
 
 
 
-## ---------------------------- ##
-## 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.  ##
 ## --------- ##
@@ -450,3 +269,184 @@
 ], [])
 
 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. */
address@hidden@
+/* Middle from acconfig.h. */
address@hidden@
+/* 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]