1 # This file is part of Autoconf. -*- Autoconf -*-
2 # Interface with autoheader.
4 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
5 # 2002 Free Software Foundation, Inc.
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # As a special exception, the Free Software Foundation gives unlimited
21 # permission to copy, distribute and modify the configure scripts that
22 # are the output of Autoconf. You need not follow the terms of the GNU
23 # General Public License when using or distributing such scripts, even
24 # though portions of the text of Autoconf appear in them. The GNU
25 # General Public License (GPL) does govern all other use of the material
26 # that constitutes the Autoconf program.
28 # Certain portions of the Autoconf source text are designed to be copied
29 # (in certain cases, depending on the input) into the output of
30 # Autoconf. We call these the "data" portions. The rest of the Autoconf
31 # source text consists of comments plus executable code that decides which
32 # of the data portions to output in any given case. We call these
33 # comments and executable code the "non-data" portions. Autoconf never
34 # copies any of the non-data portions into its output.
36 # This special exception to the GPL applies to versions of Autoconf
37 # released by the Free Software Foundation. When you make and
38 # distribute a modified version of Autoconf, you may extend this special
39 # exception to the GPL to apply to your modified version as well, *unless*
40 # your modified version has the potential to copy into its output some
41 # of the text that was the non-data portion of the version that you started
42 # with. (In other words, unless your change moves or copies text from
43 # the non-data portions to the data portions.) If your modification has
44 # such potential, you must delete any notice of this special exception
45 # to the GPL from your modified version.
47 # Written by David MacKenzie, with help from
48 # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
49 # Roland McGrath, Noah Friedman, david d zuhn, and many others.
52 # AH_OUTPUT(KEY, TEXT)
53 # --------------------
54 # Pass TEXT to autoheader.
55 # This macro is `read' only via `autoconf --trace', it outputs nothing.
56 m4_define([AH_OUTPUT], [])
59 # AH_VERBATIM(KEY, TEMPLATE)
60 # --------------------------
61 # If KEY is direct (i.e., no indirection such as in KEY=$my_func which
62 # may occur if there is AC_CHECK_FUNCS($my_func)), issue an autoheader
63 # TEMPLATE associated to the KEY. Otherwise, do nothing. TEMPLATE is
64 # output as is, with no formatting.
66 # Quote for Perl '' strings, which are those used by Autoheader.
67 m4_define([AH_VERBATIM],
69 [AH_OUTPUT([$1], AS_ESCAPE([[$2]], [\\'']))])
73 # AH_TEMPLATE(KEY, DESCRIPTION)
74 # -----------------------------
75 # Issue an autoheader template for KEY, i.e., a comment composed of
76 # DESCRIPTION (properly wrapped), and then #undef KEY.
77 m4_define([AH_TEMPLATE],
79 m4_text_wrap([$2 */], [ ], [/* ])[
85 # Output TEXT at the top of `config.h.in'.
87 [m4_define([_AH_COUNTER], m4_incr(_AH_COUNTER))dnl
88 AH_VERBATIM([0000]_AH_COUNTER, [$1])])
93 # Output TEXT at the bottom of `config.h.in'.
94 m4_define([AH_BOTTOM],
95 [m4_define([_AH_COUNTER], m4_incr(_AH_COUNTER))dnl
96 AH_VERBATIM([zzzz]_AH_COUNTER, [$1])])
99 m4_define([_AH_COUNTER], [0])