3 # Build some of the Autoconf test files.
4 # Copyright 2000 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 # If we fail, clean up, but touch the output files. We probably failed
22 # because we used some non portable tool, but we just don't care: this
23 # shell script is a maintainer tool, and we do expect good tools.
25 as_me
=`echo "$0" | sed 's,.*[\\/],,'`
27 trap 'echo "'"$as_me"': failed. To proceed run make check." >&2
28 rm -f acdefuns audefuns requires *.tat
31 touch `echo "$file" | sed "s,.*[\\/],,;s/\..*/.at/"`
37 # If ever something goes wrong, fail, so that the trap be launched.
43 # We need these arguments.
46 # Set locale to C so that `sort' behaves in a uniform way.
47 export LANGUAGE
; LANGUAGE
=C
49 export LC_ALL
; LC_ALL
=C
54 # Get the list of macros that are required: there is little interest
55 # in testing them since they will be run but the guy who requires
58 sed -n 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' |
65 # Macros which must not be checked at all (not by ac-macros.at, nor
67 # The trailing new line is meant.
69 # - ac_cv_prog_gcc, gxx, g77
70 # Not macros, just mapping from old variable name to a new one.
71 exclude_list
='^ac_cv_prog_(gcc|gxx|g77)$
77 # The test `ac-macros.at' tries to run all the macros of Autoconf to check
78 # for syntax problems, etc. Not all the macros can be run without argument,
79 # and some are already tested elsewhere. EGREP_EXCLUDE must filter out
80 # the macros we don't want to test in ac-macros.at.
82 # - AC_CANONICALIZE, AC_PREFIX_PROGRAM, AC_PREREQ
84 # - AC_CHECK decl, file, func, header, lib, member, prog, sizeof, type
85 # Performed in the semantics tests.
87 # They fail when the source does not exist.
89 # AC_INIT includes all the AC_INIT macros. Note that there is an
90 # infinite m4 recursion if AC_INIT it used twice.
92 # Heavily used by other macros.
93 # - AC_PATH_PROGS?, AC_F77_FUNC
94 # They produce `= val' because $1, the variable used to store the result,
96 # - AC_TRY, AC_.*_IFELSE, AC_RUN_LOG.
97 # Used in many places.
99 # Internal macros are used elsewhere.
101 # Already tested by `AT_CHECK_MACRO'.
104 # - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE), AC_PATH_XTRA
105 # Checked in semantics.
106 # - AC_CYGWIN, AC_CYGWIN32, AC_EMXOS2, AC_MING32, AC_EXEEXT, AC_OBJEXT
107 # AU defined to nothing.
109 # Checked in semantics.
110 # - AC_SYS_RESTARTABLE_SYSCALLS, AC_FUNC_WAIT3
111 # Obsolete, checked in semantics.
113 ac_exclude_list
='^AC_ARG_VAR$
114 ^AC_CANONICALIZE|AC_PREFIX_PROGRAM|AC_PREREQ$
115 ^AC_CHECK_(DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|TOOL|TYPE)S?$
124 ^AC_PATH_(TOOL|PROG)S?$
127 ^(AC_TRY.*|AC_RUN_LOG)$
130 ^(AC_(PROG_CC|C_CONST|C_INLINE|C_VOLATILE))$
131 ^AC_(CYGWIN|CYGWIN32|EMXOS2|MING32|EXEEXT|OBJEXT)$
133 ^AC_SYS_RESTARTABLE_SYSCALLS$
140 # Build a single egrep pattern out of filter_macros_list.
141 # Sed is used to get rid of the trailing `|' coming from the trailing
143 ac_exclude_egrep
=`echo "$exclude_list$ac_exclude_list" | tr '
144 ' '|' | sed 's/.$//'`
150 # cannot be used alone.
151 # AC_LINK_FILES, AC_PREREQ
152 # need arguments and are tested elsewhere.
153 # AC_INIT and AC_OUTPUT
154 # are already in `configure.ac'.
155 # AC_CYGWIN, AC_MINGW32, AC_EMXOS2
156 # are using AC_REQUIRE.
157 au_exclude_list
='^AC_LANG_RESTORE$
158 ^AC_LINK_FILES|AC_PREREQ$
160 ^AC_(CYGWIN|MINGW32|EMXOS2)$'
165 # Build a single egrep pattern out of filter_macros_list.
166 # Sed is used to get rid of the trailing `|' coming from the trailing
168 au_exclude_egrep
=`echo "$exclude_list$au_exclude_list" | tr '
169 ' '|' | sed 's/.$//'`
173 ## ------------------------- ##
174 ## Creating the test files. ##
175 ## ------------------------- ##
179 base
=`echo "$file" | sed 's,.*[\\/],,;s/\..*//'`
180 # Get the list of macros which are defined in Autoconf level.
181 # Get rid of the macros we are not interested in.
183 sed -n -e 's/^AC_DEFUN(\[*\([a-zA-Z0-9_]*\).*$/\1/p' \
184 -e 's/^AC_DEFUN_ONCE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' |
187 # Watch out we are `set -e': don't fail.
188 ( egrep -v "$ac_exclude_egrep" || true
) >acdefuns
190 # 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' |
195 ( egrep -v "$au_exclude_egrep" || true
) > audefuns
197 # Filter out required macros.
199 sed 's/^ *//' <<MK_EOF
200 # Generated by $as_me, do not edit by hand. -*- autoconf -*-
202 AT_BANNER([Testing $base macros.])
206 echo "# Modern macros."
207 for macro
in `cat acdefuns`; do
208 if fgrep
"$macro" requires
>/dev
/null
2>&1; then :; else
209 echo "AT_CHECK_MACRO([$macro])"
213 echo "# Obsolete macros."
214 for macro
in `cat audefuns`; do
215 if fgrep
"$macro" requires
>/dev
/null
2>&1; then :; else
216 echo "AT_CHECK_AU_MACRO([$macro])"
221 # In one atomic step so that if something above fails, the trap
222 # preserves the old version of the file.
223 mv $base.tat
$base.
at
226 rm -f acdefuns audefuns requires