Reword the copyright notices to match what's suggested in GPLv3.
[autoconf.git] / lib / autoconf / autoupdate.m4
blob4a7d876129a4fd9a5016176f4ca661dc2cfe5b4c
1 # This file is part of Autoconf.                       -*- Autoconf -*-
2 # Interface with autoupdate.
4 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
5 # 2003, 2004, 2006 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 ## ---------------------------------- ##
53 ## Macros to define obsolete macros.  ##
54 ## ---------------------------------- ##
57 # AU_DEFINE(NAME, CODE)
58 # ---------------------
59 # Define the macro NAME so that it expand to CODE only when
60 # autoupdate is running.  This is achieved with traces in
61 # autoupdate itself, so this macro expands to nothing.
63 m4_define([AU_DEFINE], [])
65 # AU_DEFUN(NAME, NEW-CODE, [MESSAGE])
66 # -----------------------------------
67 # Declare that the macro NAME is now obsoleted, and should be replaced
68 # by NEW-CODE.  Tell the user she should run autoupdate, and when
69 # autoupdate is run, emit MESSAGE as a warning and include it in
70 # the updated configure.ac file.
72 # Also define NAME as a macro which code is NEW-CODE.
74 # This allows sharing the same code for both supporting obsoleted macros,
75 # and to update a configure.ac.
76 # See the end of `autoupdate.in' for a longer description.
77 m4_define([AU_DEFUN],
78 [# This is what autoupdate's m4 run will expand.  It fires
79 # the warning (with _au_warn_XXX), outputs it into the
80 # updated configure.ac (with AC_DIAGNOSE), and then outputs
81 # the replacement expansion.
82 AU_DEFINE([$1],
83 [m4_ifval([$3], [_au_warn_$1([$3])AC_DIAGNOSE([obsolete], [$3])d[]nl
84 ])dnl
85 $2])
87 # This is an auxiliary macro that is also run when
88 # autoupdate runs m4.  It simply calls m4_warning, but
89 # we need a wrapper so that each warning is emitted only
90 # once.  We break the quoting in m4_warning's argument in
91 # order to expand this macro's arguments, not AU_DEFUN's.
92 AU_DEFINE([_au_warn_$1],
93 [m4_warning($][@)dnl
94 m4_define([_au_warn_$1], [])])
96 # Finally, this is the expansion that is picked up by
97 # autoconf.  It tells the user to run autoupdate, and
98 # then outputs the replacement expansion.  We do not care
99 # about autoupdate's warning because that contains
100 # information on what to do *after* running autoupdate.
101 AC_DEFUN([$1],
102          [AC_DIAGNOSE([obsolete], [The macro `$1' is obsolete.
103 You should run autoupdate.])dnl
104 $2])])
107 # AU_ALIAS(OLD-NAME, NEW-NAME)
108 # ----------------------------
109 # The OLD-NAME is no longer used, just use NEW-NAME instead.  There is
110 # little difference with using AU_DEFUN but the fact there is little
111 # interest in running the test suite on both OLD-NAME and NEW-NAME.
112 # This macro makes it possible to distinguish such cases.
114 # Do not use `defn' since then autoupdate would replace an old macro
115 # call with the new macro body instead of the new macro call.
117 # Moreover, we have to take care that calls without parameters are
118 # expanded to calls without parameters, not with one empty parameter.
119 # This is not only an aesthetical improvement of autoupdate, it also
120 # matters with poorly written macros which test for $# = 0.
122 m4_define([AU_ALIAS],
123 [AU_DEFUN([$1], _AU_ALIAS_BODY([$], [$2]))])
125 # The body for the AU_DEFUN above should look like:
126 #       [m4_if($#, 0, [NEW-NAME], [NEW-NAME($@)])]
127 # Thus the helper macro is:
128 m4_define([_AU_ALIAS_BODY], [[m4_if($1#, 0, [$2], [$2($1@)])]])