2000-10-05 17:39:06 +08:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# Build some of the Autoconf test files.
|
2005-01-29 05:21:32 +08:00
|
|
|
|
2009-08-14 21:31:43 +08:00
|
|
|
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
|
2010-01-06 11:59:55 +08:00
|
|
|
# 2009, 2010 Free Software Foundation, Inc.
|
2000-10-05 17:39:06 +08:00
|
|
|
|
2007-07-21 07:11:49 +08:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
Update License to GPLv3+ including new Autoconf Exception.
* NEWS, README: Update licensing information.
* COPYING.EXCEPTION: New file.
* Makefile.am (EXTRA_DIST): Distribute it.
* cfg.mk (autom4te-update): Remove copyright change warning.
* lib/autoconf/autoconf.m4, lib/autoconf/autoheader.m4,
lib/autoconf/autoscan.m4, lib/autoconf/autotest.m4,
lib/autoconf/autoupdate.m4, lib/autoconf/c.m4,
lib/autoconf/erlang.m4, lib/autoconf/fortran.m4,
lib/autoconf/functions.m4, lib/autoconf/general.m4,
lib/autoconf/headers.m4, lib/autoconf/lang.m4,
lib/autoconf/libs.m4, lib/autoconf/oldnames.m4,
lib/autoconf/programs.m4, lib/autoconf/specific.m4,
lib/autoconf/status.m4, lib/autoconf/types.m4,
lib/autotest/autotest.m4, lib/autotest/general.m4,
lib/autotest/specific.m4, lib/m4sugar/foreach.m4,
lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4: Update exception
statement, bump to GPLv3.
* bin/autoconf.as, bin/autoheader.in, bin/autom4te.in,
bin/autoreconf.in, bin/autoscan.in, bin/autoupdate.in,
bin/ifnames.in: Bump to GPLv3+, adjust --version output
to reflect the GPLv3+ and the Autoconf Exception.
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm,
lib/Autom4te/General.pm, lib/Autom4te/Request.pm,
lib/autom4te.in, lib/autoscan/autoscan.pre,
lib/emacs/autoconf-mode.el, lib/emacs/autotest-mode.el,
lib/freeze.mk, tests/atlocal.in, tests/autoscan.at,
tests/autotest.at, tests/base.at, tests/c.at,
tests/compile.at, tests/erlang.at, tests/foreign.at,
tests/fortran.at, tests/local.at, tests/m4sh.at,
tests/m4sugar.at, tests/mktests.sh, tests/semantics.at,
tests/statesave.m4, tests/suite.at, tests/tools.at,
tests/torture.at, tests/wrapper.as: Bump to GPLv3+.
2009-09-10 01:53:31 +08:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2000-10-05 17:39:06 +08:00
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
Update License to GPLv3+ including new Autoconf Exception.
* NEWS, README: Update licensing information.
* COPYING.EXCEPTION: New file.
* Makefile.am (EXTRA_DIST): Distribute it.
* cfg.mk (autom4te-update): Remove copyright change warning.
* lib/autoconf/autoconf.m4, lib/autoconf/autoheader.m4,
lib/autoconf/autoscan.m4, lib/autoconf/autotest.m4,
lib/autoconf/autoupdate.m4, lib/autoconf/c.m4,
lib/autoconf/erlang.m4, lib/autoconf/fortran.m4,
lib/autoconf/functions.m4, lib/autoconf/general.m4,
lib/autoconf/headers.m4, lib/autoconf/lang.m4,
lib/autoconf/libs.m4, lib/autoconf/oldnames.m4,
lib/autoconf/programs.m4, lib/autoconf/specific.m4,
lib/autoconf/status.m4, lib/autoconf/types.m4,
lib/autotest/autotest.m4, lib/autotest/general.m4,
lib/autotest/specific.m4, lib/m4sugar/foreach.m4,
lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4: Update exception
statement, bump to GPLv3.
* bin/autoconf.as, bin/autoheader.in, bin/autom4te.in,
bin/autoreconf.in, bin/autoscan.in, bin/autoupdate.in,
bin/ifnames.in: Bump to GPLv3+, adjust --version output
to reflect the GPLv3+ and the Autoconf Exception.
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm,
lib/Autom4te/General.pm, lib/Autom4te/Request.pm,
lib/autom4te.in, lib/autoscan/autoscan.pre,
lib/emacs/autoconf-mode.el, lib/emacs/autotest-mode.el,
lib/freeze.mk, tests/atlocal.in, tests/autoscan.at,
tests/autotest.at, tests/base.at, tests/c.at,
tests/compile.at, tests/erlang.at, tests/foreign.at,
tests/fortran.at, tests/local.at, tests/m4sh.at,
tests/m4sugar.at, tests/mktests.sh, tests/semantics.at,
tests/statesave.m4, tests/suite.at, tests/tools.at,
tests/torture.at, tests/wrapper.as: Bump to GPLv3+.
2009-09-10 01:53:31 +08:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2000-10-05 17:39:06 +08:00
|
|
|
|
2000-10-14 00:37:21 +08:00
|
|
|
# If we fail, clean up, but touch the output files. We probably failed
|
2006-04-07 01:56:43 +08:00
|
|
|
# because we used some non-portable tool.
|
2001-01-22 17:03:38 +08:00
|
|
|
|
2007-09-22 20:04:51 +08:00
|
|
|
as_me=`echo "$0" | sed 's|.*[\\/]||'`
|
2001-01-22 17:03:38 +08:00
|
|
|
|
2006-04-11 05:00:40 +08:00
|
|
|
trap 'echo "'"$as_me"': failed." >&2
|
2001-01-26 19:59:49 +08:00
|
|
|
rm -f acdefuns audefuns requires *.tat
|
2006-04-11 05:00:40 +08:00
|
|
|
trap "" 0
|
2000-10-14 00:37:21 +08:00
|
|
|
exit 1' \
|
|
|
|
0 1 2 15
|
|
|
|
|
2006-04-05 07:36:20 +08:00
|
|
|
# If ever something goes wrong, fail, so that the trap is launched.
|
2000-10-14 00:37:21 +08:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# We need arguments.
|
|
|
|
test $# != 0
|
|
|
|
|
|
|
|
# We need these arguments.
|
2000-10-05 17:39:06 +08:00
|
|
|
src="$@"
|
|
|
|
|
2000-10-25 03:30:00 +08:00
|
|
|
# Set locale to C so that `sort' behaves in a uniform way.
|
2006-03-07 05:13:21 +08:00
|
|
|
LANGUAGE=C; export LANGUAGE
|
|
|
|
LANG=C; export LANG
|
|
|
|
LC_ALL=C export LC_ALL
|
2000-10-25 03:30:00 +08:00
|
|
|
|
2000-10-05 21:52:41 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
# requires
|
|
|
|
# --------
|
|
|
|
# Get the list of macros that are required: there is little interest
|
2006-04-07 01:56:43 +08:00
|
|
|
# in testing them since they will be run by the guy who requires them.
|
2006-04-05 07:36:20 +08:00
|
|
|
sed -n 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' $src |
|
|
|
|
sort -u >requires
|
2001-01-22 17:03:38 +08:00
|
|
|
|
|
|
|
|
2000-11-07 22:16:54 +08:00
|
|
|
# exclude_list
|
|
|
|
# ------------
|
2006-04-07 01:56:43 +08:00
|
|
|
# Macros which must not be checked at all (not with AT_CHECK_MACRO nor
|
|
|
|
# AT_CHECK_AU_MACRO).
|
2006-04-05 06:36:02 +08:00
|
|
|
exclude_list='
|
2006-04-05 07:36:20 +08:00
|
|
|
# Not a macro name at all.
|
|
|
|
/^$/ {next}
|
|
|
|
|
|
|
|
# Not macros, just mapping from old variable name to a new one.
|
2006-04-05 06:36:02 +08:00
|
|
|
/^ac_cv_prog_(gcc|gxx|g77)$/ {next}
|
2000-11-07 22:16:54 +08:00
|
|
|
'
|
|
|
|
|
2001-01-26 19:59:49 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
# ac_exclude_list
|
|
|
|
# ---------------
|
2006-04-07 01:56:43 +08:00
|
|
|
# We try to test all the Autoconf macros with AT_CHECK_MACRO to check
|
|
|
|
# for syntax problems, etc. Not every macros can be run without
|
|
|
|
# arguments, and some are already tested elsewhere. AC_EXCLUDE_LIST
|
|
|
|
# filters out the macros we don't want to test.
|
2006-04-05 06:36:02 +08:00
|
|
|
ac_exclude_list='
|
|
|
|
# Internal macros are used elsewhere.
|
2006-04-07 01:55:21 +08:00
|
|
|
/^_?_AC_/ {next}
|
2006-04-05 06:36:02 +08:00
|
|
|
|
|
|
|
# Used in many places.
|
|
|
|
/^AC_.*_IFELSE$/ {next}
|
|
|
|
/^AC_LANG/ {next}
|
|
|
|
/^AC_RUN_LOG$/ {next}
|
|
|
|
/^AC_TRY/ {next}
|
|
|
|
|
|
|
|
# Need an argument.
|
2006-04-09 05:44:13 +08:00
|
|
|
/^AC_(CANONICALIZE|PREFIX_PROGRAM|PREREQ)$/ {next}
|
|
|
|
/^AC_(SEARCH_LIBS|REPLACE_FUNCS)$/ {next}
|
2006-09-02 13:37:07 +08:00
|
|
|
/^AC_(CACHE_CHECK|COMPUTE)_INT$/ {next}
|
2007-06-12 19:36:56 +08:00
|
|
|
/^AC_ARG_VAR$/ {next}
|
2008-10-22 19:16:58 +08:00
|
|
|
/^AC_REQUIRE_SHELL_FN$/ {next}
|
2006-04-05 06:36:02 +08:00
|
|
|
|
|
|
|
# Performed in the semantics tests.
|
|
|
|
/^AC_CHECK_(ALIGNOF|DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|(TARGET_)?TOOL|TYPE)S?$/ {next}
|
2007-09-08 22:48:49 +08:00
|
|
|
/^AC_PATH_PROGS_FEATURE_CHECK$/ {next}
|
2006-04-05 06:36:02 +08:00
|
|
|
|
|
|
|
# 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}
|
2006-12-02 03:36:56 +08:00
|
|
|
/^AC_FUNC_SETVBUF_REVERSED$/ {next}
|
2006-04-05 06:36:02 +08:00
|
|
|
/^AC_SYS_RESTARTABLE_SYSCALLS$/ {next}
|
|
|
|
|
2006-04-05 07:36:20 +08:00
|
|
|
# Not intended to be invoked at the top level.
|
|
|
|
/^AC_INCLUDES_DEFAULT$/ {next}
|
|
|
|
|
2006-04-05 06:36:02 +08:00
|
|
|
# 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}
|
|
|
|
|
2006-11-10 05:03:54 +08:00
|
|
|
# Requires a working C++ compiler, which is not a given.
|
|
|
|
/^AC_PROG_CXX_C_O$/ {next}
|
|
|
|
|
2006-04-05 06:36:02 +08:00
|
|
|
# Already tested by AT_CHECK_MACRO.
|
|
|
|
/^AC_OUTPUT$/ {next}
|
2009-11-25 08:20:33 +08:00
|
|
|
|
|
|
|
# Tested alongside m4_divert_text.
|
|
|
|
/^AC_PRESERVE_HELP_ORDER$/ {next}
|
2006-04-05 06:36:02 +08:00
|
|
|
'
|
|
|
|
|
|
|
|
|
|
|
|
# ac_exclude_script
|
|
|
|
# -----------------
|
|
|
|
# Build a single awk script out of the above.
|
|
|
|
ac_exclude_script="$exclude_list $ac_exclude_list {print}"
|
2000-10-05 21:52:41 +08:00
|
|
|
|
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
# au_exclude_list
|
|
|
|
# ---------------
|
2006-04-07 01:56:43 +08:00
|
|
|
# Check all AU_DEFUN'ed macros with AT_CHECK_AU_MACRO, except these.
|
2006-04-05 06:36:02 +08:00
|
|
|
au_exclude_list='
|
|
|
|
# Empty.
|
2006-04-09 05:44:13 +08:00
|
|
|
/^AC_(C_CROSS|PROG_CC_STDC)$/ {next}
|
2006-04-05 06:36:02 +08:00
|
|
|
|
|
|
|
# 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.
|
2006-04-09 05:44:13 +08:00
|
|
|
/^AC_(LINK_FILES|PREREQ)$/ {next}
|
2006-04-05 06:36:02 +08:00
|
|
|
'
|
|
|
|
|
|
|
|
# au_exclude_script
|
|
|
|
# -----------------
|
|
|
|
# Build a single awk script out of the above.
|
|
|
|
au_exclude_script="$exclude_list $au_exclude_list {print}"
|
2002-05-30 06:29:54 +08:00
|
|
|
|
2000-10-05 21:52:41 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
## ------------------------- ##
|
|
|
|
## Creating the test files. ##
|
|
|
|
## ------------------------- ##
|
2000-10-05 21:52:41 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
for file in $src
|
|
|
|
do
|
2007-09-22 20:04:51 +08:00
|
|
|
base=`echo "$file" | sed 's|.*[\\/]||;s|\..*||'`
|
2001-01-22 17:03:38 +08:00
|
|
|
# Get the list of macros which are defined in Autoconf level.
|
|
|
|
# Get rid of the macros we are not interested in.
|
2006-04-05 07:36:20 +08:00
|
|
|
sed -n -e 's/^AC_DEFUN(\[*\([a-zA-Z0-9_]*\).*$/\1/p' \
|
* TODO, config/Makefile.am, lib/freeze.mk, lib/autoconf/c.m4,
lib/autoconf/specific.m4, lib/autoconf/status.m4,
lib/autoconf/types.m4, lib/autotest/general.m4,
tests/mktests.sh, tests/torture.at: White space cleanup:
remove some SPACE before TAB, or add quoting ('' or @&t@).
2006-04-06 04:55:14 +08:00
|
|
|
-e 's/^AC_DEFUN_ONCE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' $file |
|
2006-04-05 07:36:20 +08:00
|
|
|
awk "$ac_exclude_script" |
|
|
|
|
sort -u >acdefuns
|
2000-10-05 21:52:41 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
# Get the list of macros which are defined in Autoupdate level.
|
2006-04-05 07:36:20 +08:00
|
|
|
sed -n 's/^AU_DEFUN(\[*\([a-zA-Z][a-zA-Z0-9_]*\).*$/\1/p' $file |
|
|
|
|
awk "$au_exclude_script" |
|
|
|
|
sort -u >audefuns
|
2001-01-22 17:03:38 +08:00
|
|
|
|
|
|
|
# Filter out required macros.
|
|
|
|
{
|
|
|
|
sed 's/^ *//' <<MK_EOF
|
2003-09-11 00:54:12 +08:00
|
|
|
# Generated by $as_me. -*- Autotest -*-
|
|
|
|
|
|
|
|
## --------------------- ##
|
|
|
|
## Do not edit by hand. ##
|
|
|
|
## --------------------- ##
|
|
|
|
|
2007-09-08 22:48:49 +08:00
|
|
|
# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007 Free Software
|
|
|
|
# Foundation, Inc.
|
2000-10-05 21:52:41 +08:00
|
|
|
|
2001-08-01 21:46:22 +08:00
|
|
|
AT_BANNER([Testing autoconf/$base macros.])
|
2001-01-22 17:03:38 +08:00
|
|
|
|
|
|
|
MK_EOF
|
|
|
|
|
|
|
|
echo "# Modern macros."
|
2006-04-05 07:36:20 +08:00
|
|
|
comm -23 acdefuns requires | sed 's/.*/AT_CHECK_MACRO([&])/'
|
2001-01-22 17:03:38 +08:00
|
|
|
echo
|
|
|
|
echo "# Obsolete macros."
|
2006-04-05 07:36:20 +08:00
|
|
|
comm -23 audefuns requires | sed 's/.*/AT_CHECK_AU_MACRO([&])/'
|
2001-08-01 21:46:22 +08:00
|
|
|
} >ac$base.tat
|
2001-01-22 17:03:38 +08:00
|
|
|
|
|
|
|
# In one atomic step so that if something above fails, the trap
|
2001-09-13 14:56:44 +08:00
|
|
|
# preserves the old version of the file. If there is nothing to
|
|
|
|
# check, output /rien du tout/[1].
|
2002-06-27 15:51:16 +08:00
|
|
|
if grep AT_CHECK ac$base.tat >/dev/null 2>&1; then
|
2003-09-25 17:30:34 +08:00
|
|
|
mv -f ac$base.tat ac$base.at
|
2001-09-13 14:56:44 +08:00
|
|
|
else
|
|
|
|
rm -f ac$base.tat ac$base.at
|
|
|
|
touch ac$base.at
|
|
|
|
fi
|
2006-04-11 05:00:40 +08:00
|
|
|
# Help people not to update these files by hand.
|
|
|
|
chmod a-w ac$base.at
|
2001-01-22 17:03:38 +08:00
|
|
|
done
|
2000-10-05 17:39:06 +08:00
|
|
|
|
2000-10-12 20:45:16 +08:00
|
|
|
rm -f acdefuns audefuns requires
|
2000-10-14 00:37:21 +08:00
|
|
|
|
2006-04-11 05:00:40 +08:00
|
|
|
trap '' 0
|
2000-10-05 17:39:06 +08:00
|
|
|
exit 0
|
2001-09-13 14:56:44 +08:00
|
|
|
|
|
|
|
# [1] En franc,ais dans le texte.
|