as_me=`echo "$0" | sed 's,.*[\\/],,'`
trap 'echo "'"$as_me"': failed." >&2
rm -f acdefuns audefuns requires *.tat
trap "" 0
exit 1' \
0 1 2 15
set -e
test $# != 0
src="$@"
LANGUAGE=C; export LANGUAGE
LANG=C; export LANG
LC_ALL=C export LC_ALL
sed -n 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' $src |
sort -u >requires
exclude_list='
# Not a macro name at all.
/^$/ {next}
# Not macros, just mapping from old variable name to a new one.
/^ac_cv_prog_(gcc|gxx|g77)$/ {next}
'
ac_exclude_list='
# Internal macros are used elsewhere.
/^_?_AC_/ {next}
# Used in many places.
/^AC_.*_IFELSE$/ {next}
/^AC_LANG/ {next}
/^AC_RUN_LOG$/ {next}
/^AC_TRY/ {next}
# Need an argument.
/^AC_(CANONICALIZE|PREFIX_PROGRAM|PREREQ)$/ {next}
/^AC_(SEARCH_LIBS|REPLACE_FUNCS)$/ {next}
/^AC_(CACHE_CHECK|COMPUTE)_INT$/ {next}
# Performed in the semantics tests.
/^AC_CHECK_(ALIGNOF|DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|(TARGET_)?TOOL|TYPE)S?$/ {next}
# Fail when the source does not exist.
/^AC_CONFIG/ {next}
# AU defined to nothing.
/^AC_(CYGWIN|CYGWIN32|EMXOS2|MING32|EXEEXT|OBJEXT)$/ {next}
# Produce "= val" because $1, the variable used to store the result,
# is empty.
/^AC_(F77|FC)_FUNC$/ {next}
/^AC_FC_SRCEXT$/ {next}
/^AC_PATH_((TARGET_)?TOOL|PROG)S?$/ {next}
# Requires the current language to be Fortran, not C.
/^AC_FC_FREEFORM$/ {next}
# Is a number.
/^AC_FD_CC$/ {next}
# Obsolete, but needs to be AC_DEFUNed.
/^AC_FOREACH$/ {next}
# Require a file that is not shipped with Autoconf. But it should.
/^AC_FUNC_(GETLOADAVG|FNMATCH_GNU)$/ {next}
/^AC_REPLACE_FNMATCH$/ {next}
# Obsolete, checked in semantics.
/^AC_FUNC_WAIT3$/ {next}
/^AC_SYS_RESTARTABLE_SYSCALLS$/ {next}
# Not intended to be invoked at the top level.
/^AC_INCLUDES_DEFAULT$/ {next}
# AC_INIT includes all the AC_INIT macros.
# There is an infinite m4 recursion if AC_INIT is used twice.
/^AC_INIT/ {next}
# Checked in semantics.
/^AC_(PROG_CC|C_CONST|C_VOLATILE)$/ {next}
/^AC_PATH_XTRA$/ {next}
# Requires a working C++ compiler, which is not a given.
/^AC_PROG_CXX_C_O$/ {next}
# Already tested by AT_CHECK_MACRO.
/^AC_OUTPUT$/ {next}
'
ac_exclude_script="$exclude_list $ac_exclude_list {print}"
au_exclude_list='
# Empty.
/^AC_(C_CROSS|PROG_CC_STDC)$/ {next}
# Use AC_REQUIRE.
/^AC_(CYGWIN|MINGW32|EMXOS2)$/ {next}
# Already in configure.ac.
/^AC_(INIT|OUTPUT)$/ {next}
# AC_LANG_SAVE needs user interaction to be removed.
# AC_LANG_RESTORE cannot be used alone.
/^AC_LANG_(SAVE|RESTORE)$/ {next}
# Need arguments and are tested elsewhere.
/^AC_(LINK_FILES|PREREQ)$/ {next}
'
au_exclude_script="$exclude_list $au_exclude_list {print}"
for file in $src
do
base=`echo "$file" | sed 's,.*[\\/],,;s/\..*//'`
sed -n -e 's/^AC_DEFUN(\[*\([a-zA-Z0-9_]*\).*$/\1/p' \
-e 's/^AC_DEFUN_ONCE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' $file |
awk "$ac_exclude_script" |
sort -u >acdefuns
sed -n 's/^AU_DEFUN(\[*\([a-zA-Z][a-zA-Z0-9_]*\).*$/\1/p' $file |
awk "$au_exclude_script" |
sort -u >audefuns
{
sed 's/^ *//' <<MK_EOF
# Generated by $as_me. -*- Autotest -*-
## --------------------- ##
## Do not edit by hand. ##
## --------------------- ##
# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
AT_BANNER([Testing autoconf/$base macros.])
MK_EOF
echo "# Modern macros."
comm -23 acdefuns requires | sed 's/.*/AT_CHECK_MACRO([&])/'
echo
echo "# Obsolete macros."
comm -23 audefuns requires | sed 's/.*/AT_CHECK_AU_MACRO([&])/'
} >ac$base.tat
if grep AT_CHECK ac$base.tat >/dev/null 2>&1; then
mv -f ac$base.tat ac$base.at
else
rm -f ac$base.tat ac$base.at
touch ac$base.at
fi
chmod a-w ac$base.at
done
rm -f acdefuns audefuns requires
trap '' 0
exit 0