]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acgeneral.m4 (AH_TOP, AH_BOTTOM): New macros.
authorAkim Demaille <akim@epita.fr>
Thu, 4 May 2000 10:26:02 +0000 (10:26 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 4 May 2000 10:26:02 +0000 (10:26 +0000)
(_AH_COUNTER): New variable.
* tests/tools.m4 (autoheader): Check their proper functioning.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4
tests/tools.m4

index 062163e480e2855714e066b66b811cd4c24a5eab..e4db3860cc5338df96b53ea9cc059a1f3aa58b0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-05-04  Akim Demaille  <akim@epita.fr>
+
+       * acgeneral.m4 (AH_TOP, AH_BOTTOM): New macros.
+       (_AH_COUNTER): New variable.
+       * tests/tools.m4 (autoheader): Check their proper functioning.
+
 2000-05-04  Akim Demaille  <akim@epita.fr>
 
        * doc/autoconf.texi (Obsolete Macros): Rename as...
index 56affd35b685d8dde7321faa5849fe5f2df6a86e..d40da6ee0adb4c71a294c09bc680204e1a659ea4 100644 (file)
@@ -379,8 +379,8 @@ AU_DEFINE([$1], [$2], [$3])dnl
 ## ------------------------- ##
 
 
-# AH_OUTPUT(TEXT)
-# ---------------
+# AH_OUTPUT(KEY, TEXT)
+# --------------------
 # Pass TEXT to autoheader.
 # This macro is `read' only via `autoconf --trace', it outputs nothing.
 define([AH_OUTPUT], [])
@@ -408,6 +408,24 @@ define([AH_TEMPLATE],
 #undef $1])])
 
 
+# AH_TOP(TEXT)
+# ------------
+# Output TEXT at the top of `config.h.in'.
+define([AH_TOP],
+[m4_define([_AH_COUNTER], incr(_AH_COUNTER))dnl
+AH_VERBATIM([0000]_AH_COUNTER, [$1])])
+
+
+# AH_BOTTOM(TEXT)
+# ---------------
+# Output TEXT at the bottom of `config.h.in'.
+define([AH_BOTTOM],
+[m4_define([_AH_COUNTER], incr(_AH_COUNTER))dnl
+AH_VERBATIM([zzzz]_AH_COUNTER, [$1])])
+
+# Initialize.
+define([_AH_COUNTER], [0])
+
 
 ## --------------------- ##
 ## Some /bin/sh idioms.  ##
index 56affd35b685d8dde7321faa5849fe5f2df6a86e..d40da6ee0adb4c71a294c09bc680204e1a659ea4 100644 (file)
@@ -379,8 +379,8 @@ AU_DEFINE([$1], [$2], [$3])dnl
 ## ------------------------- ##
 
 
-# AH_OUTPUT(TEXT)
-# ---------------
+# AH_OUTPUT(KEY, TEXT)
+# --------------------
 # Pass TEXT to autoheader.
 # This macro is `read' only via `autoconf --trace', it outputs nothing.
 define([AH_OUTPUT], [])
@@ -408,6 +408,24 @@ define([AH_TEMPLATE],
 #undef $1])])
 
 
+# AH_TOP(TEXT)
+# ------------
+# Output TEXT at the top of `config.h.in'.
+define([AH_TOP],
+[m4_define([_AH_COUNTER], incr(_AH_COUNTER))dnl
+AH_VERBATIM([0000]_AH_COUNTER, [$1])])
+
+
+# AH_BOTTOM(TEXT)
+# ---------------
+# Output TEXT at the bottom of `config.h.in'.
+define([AH_BOTTOM],
+[m4_define([_AH_COUNTER], incr(_AH_COUNTER))dnl
+AH_VERBATIM([zzzz]_AH_COUNTER, [$1])])
+
+# Initialize.
+define([_AH_COUNTER], [0])
+
 
 ## --------------------- ##
 ## Some /bin/sh idioms.  ##
index 2224dbd08ed14aaf691220827970b8d2dfe93c9f..320e4042c3983fdd76698885ab69f3c62d587b02 100644 (file)
@@ -82,6 +82,7 @@ AT_DATA(acconfig.h,
 #undef this
 ]])
 
+
 # 1. Check that `acconfig.h' is still honored.
 AT_DATA(configure.in,
 [[AC_INIT
@@ -89,13 +90,13 @@ AC_CONFIG_HEADERS(config.h)
 AC_DEFINE(this, "whatever you want.")
 ]])
 
-
 AT_CHECK([../autoheader -m .. -<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
@@ -105,6 +106,49 @@ AC_DEFINE(that, "whatever you want.")
 
 AT_CHECK([../autoheader -m .. -<configure.in], 1, ignore, ignore)
 
+
+# 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 -m .. -<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. */
+]], ignore)
+
+
 AT_CLEANUP