3 # Build some of the Autoconf test files.
5 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
6 # 2009 Free Software Foundation, Inc.
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # If we fail, clean up, but touch the output files. We probably failed
22 # because we used some non-portable tool.
24 as_me
=`echo "$0" | sed 's|.*[\\/]||'`
26 trap 'echo "'"$as_me"': failed." >&2
27 rm -f acdefuns audefuns requires *.tat
32 # If ever something goes wrong, fail, so that the trap is launched.
38 # We need these arguments.
41 # Set locale to C so that `sort' behaves in a uniform way.
42 LANGUAGE
=C
; export LANGUAGE
44 LC_ALL
=C
export LC_ALL
49 # Get the list of macros that are required: there is little interest
50 # in testing them since they will be run by the guy who requires them.
51 sed -n 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' $src |
57 # Macros which must not be checked at all (not with AT_CHECK_MACRO nor
60 # Not a macro name at all.
63 # Not macros, just mapping from old variable name to a new one.
64 /^ac_cv_prog_(gcc|gxx|g77)$/ {next}
70 # We try to test all the Autoconf macros with AT_CHECK_MACRO to check
71 # for syntax problems, etc. Not every macros can be run without
72 # arguments, and some are already tested elsewhere. AC_EXCLUDE_LIST
73 # filters out the macros we don't want to test.
75 # Internal macros are used elsewhere.
78 # Used in many places.
79 /^AC_.*_IFELSE$/ {next}
85 /^AC_(CANONICALIZE|PREFIX_PROGRAM|PREREQ)$/ {next}
86 /^AC_(SEARCH_LIBS|REPLACE_FUNCS)$/ {next}
87 /^AC_(CACHE_CHECK|COMPUTE)_INT$/ {next}
89 /^AC_REQUIRE_SHELL_FN$/ {next}
91 # Performed in the semantics tests.
92 /^AC_CHECK_(ALIGNOF|DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|(TARGET_)?TOOL|TYPE)S?$/ {next}
93 /^AC_PATH_PROGS_FEATURE_CHECK$/ {next}
95 # Fail when the source does not exist.
98 # AU defined to nothing.
99 /^AC_(CYGWIN|CYGWIN32|EMXOS2|MING32|EXEEXT|OBJEXT)$/ {next}
101 # Produce "= val" because $1, the variable used to store the result,
103 /^AC_(F77|FC)_FUNC$/ {next}
104 /^AC_FC_SRCEXT$/ {next}
105 /^AC_PATH_((TARGET_)?TOOL|PROG)S?$/ {next}
107 # Requires the current language to be Fortran, not C.
108 /^AC_FC_FREEFORM$/ {next}
113 # Obsolete, but needs to be AC_DEFUNed.
114 /^AC_FOREACH$/ {next}
116 # Require a file that is not shipped with Autoconf. But it should.
117 /^AC_FUNC_(GETLOADAVG|FNMATCH_GNU)$/ {next}
118 /^AC_REPLACE_FNMATCH$/ {next}
120 # Obsolete, checked in semantics.
121 /^AC_FUNC_WAIT3$/ {next}
122 /^AC_FUNC_SETVBUF_REVERSED$/ {next}
123 /^AC_SYS_RESTARTABLE_SYSCALLS$/ {next}
125 # Not intended to be invoked at the top level.
126 /^AC_INCLUDES_DEFAULT$/ {next}
128 # AC_INIT includes all the AC_INIT macros.
129 # There is an infinite m4 recursion if AC_INIT is used twice.
132 # Checked in semantics.
133 /^AC_(PROG_CC|C_CONST|C_VOLATILE)$/ {next}
134 /^AC_PATH_XTRA$/ {next}
136 # Requires a working C++ compiler, which is not a given.
137 /^AC_PROG_CXX_C_O$/ {next}
139 # Already tested by AT_CHECK_MACRO.
146 # Build a single awk script out of the above.
147 ac_exclude_script
="$exclude_list $ac_exclude_list {print}"
152 # Check all AU_DEFUN'ed macros with AT_CHECK_AU_MACRO, except these.
155 /^AC_(C_CROSS|PROG_CC_STDC)$/ {next}
158 /^AC_(CYGWIN|MINGW32|EMXOS2)$/ {next}
160 # Already in configure.ac.
161 /^AC_(INIT|OUTPUT)$/ {next}
163 # AC_LANG_SAVE needs user interaction to be removed.
164 # AC_LANG_RESTORE cannot be used alone.
165 /^AC_LANG_(SAVE|RESTORE)$/ {next}
167 # Need arguments and are tested elsewhere.
168 /^AC_(LINK_FILES|PREREQ)$/ {next}
173 # Build a single awk script out of the above.
174 au_exclude_script
="$exclude_list $au_exclude_list {print}"
177 ## ------------------------- ##
178 ## Creating the test files. ##
179 ## ------------------------- ##
183 base
=`echo "$file" | sed 's|.*[\\/]||;s|\..*||'`
184 # Get the list of macros which are defined in Autoconf level.
185 # Get rid of the macros we are not interested in.
186 sed -n -e 's/^AC_DEFUN(\[*\([a-zA-Z0-9_]*\).*$/\1/p' \
187 -e 's/^AC_DEFUN_ONCE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' $file |
188 awk "$ac_exclude_script" |
191 # Get the list of macros which are defined in Autoupdate level.
192 sed -n 's/^AU_DEFUN(\[*\([a-zA-Z][a-zA-Z0-9_]*\).*$/\1/p' $file |
193 awk "$au_exclude_script" |
196 # Filter out required macros.
198 sed 's/^ *//' <<MK_EOF
199 # Generated by $as_me. -*- Autotest -*-
201 ## --------------------- ##
202 ## Do not edit by hand. ##
203 ## --------------------- ##
205 # Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007 Free Software
208 AT_BANNER([Testing autoconf/$base macros.])
212 echo "# Modern macros."
213 comm -23 acdefuns requires |
sed 's/.*/AT_CHECK_MACRO([&])/'
215 echo "# Obsolete macros."
216 comm -23 audefuns requires |
sed 's/.*/AT_CHECK_AU_MACRO([&])/'
219 # In one atomic step so that if something above fails, the trap
220 # preserves the old version of the file. If there is nothing to
221 # check, output /rien du tout/[1].
222 if grep AT_CHECK ac
$base.tat
>/dev
/null
2>&1; then
223 mv -f ac
$base.tat ac
$base.
at
225 rm -f ac
$base.tat ac
$base.
at
228 # Help people not to update these files by hand.
232 rm -f acdefuns audefuns requires
237 # [1] En franc,ais dans le texte.