2001-08-27 15:03:48 +08:00
|
|
|
# M4 macros used in building Autoconf test suites. -*- Autotest -*-
|
2000-10-24 18:16:30 +08:00
|
|
|
|
2003-03-04 04:13:50 +08:00
|
|
|
# Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
|
2000-10-24 18:16:30 +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
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
# 02111-1307, USA.
|
|
|
|
|
2003-06-23 19:11:41 +08:00
|
|
|
# We need a very up to date version of Autotest.
|
|
|
|
m4_version_prereq([2.53])
|
|
|
|
|
|
|
|
# Used in many tests.
|
|
|
|
m4_pattern_allow([^AS_EXIT$])
|
|
|
|
m4_pattern_allow([^m4_(define|shift)$])
|
|
|
|
|
|
|
|
AT_TESTED([autom4te autoconf autoheader autoupdate autoreconf ifnames])
|
2000-10-24 18:16:30 +08:00
|
|
|
|
2002-10-18 23:20:46 +08:00
|
|
|
## ------------------ ##
|
|
|
|
## Testing autom4te. ##
|
|
|
|
## ------------------ ##
|
|
|
|
|
|
|
|
|
|
|
|
# AT_CHECK_AUTOM4TE(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
|
|
|
|
# -----------------------------------------------------------
|
2002-10-28 15:15:05 +08:00
|
|
|
# If stderr is specified, normalize the observed stderr. E.g. (GNU M4 1.5):
|
2002-10-18 23:20:46 +08:00
|
|
|
#
|
|
|
|
# /usr/local/bin/m4: script.4s: 1: Cannot open foo: No such file or directory
|
|
|
|
# autom4te: /usr/local/bin/m4 failed with exit status: 1
|
|
|
|
#
|
2002-10-28 15:15:05 +08:00
|
|
|
# or (using gm4 as GNU M4 1.4):
|
|
|
|
#
|
|
|
|
# script.4s:1: /usr/local/bin/gm4: Cannot open foo: No such file or directory
|
|
|
|
# autom4te: /usr/local/bin/m4 failed with exit status: 1
|
|
|
|
#
|
2002-10-18 23:20:46 +08:00
|
|
|
# becomes
|
|
|
|
#
|
|
|
|
# m4: script.4s: 1: Cannot open foo: No such file or directory
|
|
|
|
# autom4te: m4 failed with exit status: 1
|
2002-10-28 15:15:05 +08:00
|
|
|
#
|
|
|
|
# We use the following sed patterns:
|
|
|
|
#
|
|
|
|
# (file): (line): (m4):
|
|
|
|
# or (m4): (file): (line):
|
|
|
|
# to m4: (file): (line):
|
|
|
|
#
|
|
|
|
# and
|
|
|
|
# autom4te: [^ ]m4
|
|
|
|
# to autom4te: m4
|
2002-10-18 23:20:46 +08:00
|
|
|
m4_define([AT_CHECK_AUTOM4TE],
|
|
|
|
[AT_CHECK([autom4te $1], [$2], [$3], m4_ifval([$4], [stderr]))
|
|
|
|
m4_ifval([$4],
|
2002-10-28 15:15:05 +08:00
|
|
|
[AT_CHECK([[sed -e 's,^\([^:]*\): *\([0-9][0-9]*\): *[^:]*m4: ,m4: \1: \2: ,' \
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
-e 's,^[^:]*m4: *\([^:]*\): *\([0-9][0-9]*\): ,m4: \1: \2: ,' \
|
|
|
|
-e 's/^autom4te: [^ ]*m4 /autom4te: m4 /' \
|
|
|
|
-e 's/^autom4te: [^ ]*m4.exe /autom4te: m4 /' \
|
|
|
|
-e 's/ (E[A-Z]*)$//' \
|
|
|
|
stderr]], [0],[$4])])
|
2002-10-18 23:20:46 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
## ----------------- ##
|
|
|
|
## Testing M4sugar. ##
|
|
|
|
## ----------------- ##
|
|
|
|
|
|
|
|
|
|
|
|
# AT_DATA_M4SUGAR(FILENAME, CONTENTS)
|
2001-10-08 16:22:49 +08:00
|
|
|
# -----------------------------------
|
2001-10-08 16:21:54 +08:00
|
|
|
# Escape the invalid tokens with @&t@.
|
|
|
|
m4_define([AT_DATA_M4SUGAR],
|
|
|
|
[AT_DATA([$1],
|
2001-10-08 16:22:49 +08:00
|
|
|
[m4_bpatsubsts([$2],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
[@&t@], [@&@&t@t@],
|
|
|
|
[\(m4\)_], [\1@&t@_],
|
|
|
|
[dnl], [d@&t@nl])])])
|
2001-10-08 16:21:54 +08:00
|
|
|
|
The use of `dumpstat' revealed that `len' was used although it
should not. m4_text_wrap was using it, but in the Autoconf world
where it is legal. Hence (i) test M4sh in its own world, not
Autoconf's, and (ii), ahem, fix the bug :)
* lib/autotest/general.m4: Be sure the set good quotes, as tracing
does not like `' instead of [].
(AT_INIT): Forbid `^_?AT_'.
And don't output such tokens.
* tests/Makefile.am (CLEANFILES): Add `script', `script.s4g',
`script.as', and `autom4te.cache'.
Remove `empty' and `macro' which are no longer used.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): New.
* tests/m4sugar.at: Use it.
* lib/m4sugar/m4sugar.m4: Use `m4_len' not `len'.
2001-08-07 15:56:40 +08:00
|
|
|
|
|
|
|
# AT_CHECK_M4SUGAR(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
m4_define([AT_CHECK_M4SUGAR],
|
2002-10-18 23:20:46 +08:00
|
|
|
[AT_CHECK_AUTOM4TE([--language=m4sugar script.4s -o script $1],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
m4_default([$2], [0]), [$3], [$4])])
|
The use of `dumpstat' revealed that `len' was used although it
should not. m4_text_wrap was using it, but in the Autoconf world
where it is legal. Hence (i) test M4sh in its own world, not
Autoconf's, and (ii), ahem, fix the bug :)
* lib/autotest/general.m4: Be sure the set good quotes, as tracing
does not like `' instead of [].
(AT_INIT): Forbid `^_?AT_'.
And don't output such tokens.
* tests/Makefile.am (CLEANFILES): Add `script', `script.s4g',
`script.as', and `autom4te.cache'.
Remove `empty' and `macro' which are no longer used.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): New.
* tests/m4sugar.at: Use it.
* lib/m4sugar/m4sugar.m4: Use `m4_len' not `len'.
2001-08-07 15:56:40 +08:00
|
|
|
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
|
|
|
|
## -------------- ##
|
|
|
|
## Testing M4sh. ##
|
|
|
|
## -------------- ##
|
|
|
|
|
|
|
|
|
|
|
|
# AT_DATA_M4SH(FILENAME, CONTENTS)
|
|
|
|
# --------------------------------
|
|
|
|
# Escape the invalid tokens with @&t@.
|
|
|
|
m4_define([AT_DATA_M4SH],
|
|
|
|
[AT_DATA([$1],
|
2001-10-08 16:22:49 +08:00
|
|
|
[m4_bpatsubsts([$2],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
[@&t@], [@&@&t@t@],
|
|
|
|
[\(m4\|AS\)_], [\1@&t@_],
|
|
|
|
[dnl], [d@&t@nl])])])
|
2001-10-08 16:21:54 +08:00
|
|
|
|
|
|
|
|
The use of `dumpstat' revealed that `len' was used although it
should not. m4_text_wrap was using it, but in the Autoconf world
where it is legal. Hence (i) test M4sh in its own world, not
Autoconf's, and (ii), ahem, fix the bug :)
* lib/autotest/general.m4: Be sure the set good quotes, as tracing
does not like `' instead of [].
(AT_INIT): Forbid `^_?AT_'.
And don't output such tokens.
* tests/Makefile.am (CLEANFILES): Add `script', `script.s4g',
`script.as', and `autom4te.cache'.
Remove `empty' and `macro' which are no longer used.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): New.
* tests/m4sugar.at: Use it.
* lib/m4sugar/m4sugar.m4: Use `m4_len' not `len'.
2001-08-07 15:56:40 +08:00
|
|
|
# AT_CHECK_M4SH(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
|
|
|
|
# -------------------------------------------------------
|
|
|
|
m4_define([AT_CHECK_M4SH],
|
2001-11-13 19:41:08 +08:00
|
|
|
[AT_CHECK([autom4te --language=m4sh script.as -o script $1],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
m4_default([$2], [0]), [$3], [$4])])
|
The use of `dumpstat' revealed that `len' was used although it
should not. m4_text_wrap was using it, but in the Autoconf world
where it is legal. Hence (i) test M4sh in its own world, not
Autoconf's, and (ii), ahem, fix the bug :)
* lib/autotest/general.m4: Be sure the set good quotes, as tracing
does not like `' instead of [].
(AT_INIT): Forbid `^_?AT_'.
And don't output such tokens.
* tests/Makefile.am (CLEANFILES): Add `script', `script.s4g',
`script.as', and `autom4te.cache'.
Remove `empty' and `macro' which are no longer used.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): New.
* tests/m4sugar.at: Use it.
* lib/m4sugar/m4sugar.m4: Use `m4_len' not `len'.
2001-08-07 15:56:40 +08:00
|
|
|
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
|
|
|
|
## ------------------ ##
|
|
|
|
## Testing Autoconf. ##
|
|
|
|
## ------------------ ##
|
2000-10-24 18:16:30 +08:00
|
|
|
|
|
|
|
|
2001-11-13 22:05:25 +08:00
|
|
|
# AT_DATA_AUTOCONF(FILENAME, CONTENTS)
|
|
|
|
# ------------------------------------
|
|
|
|
# Escape the invalid tokens with @&t@.
|
|
|
|
m4_define([AT_DATA_AUTOCONF],
|
|
|
|
[AT_DATA([$1],
|
|
|
|
[m4_bpatsubsts([$2],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
[@&t@], [@&@&t@t@],
|
|
|
|
[\(m4\|AS\|AC\)_], [\1@&t@_],
|
|
|
|
[dnl], [d@&t@nl])])])
|
2001-11-13 22:05:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
# AT_CONFIGURE_AC(BODY)
|
|
|
|
# ---------------------
|
|
|
|
# Create a full configure.ac running BODY, with a config header set up,
|
2001-11-25 23:13:03 +08:00
|
|
|
# AC_OUTPUT, and environment checking hooks.
|
2001-11-13 22:05:25 +08:00
|
|
|
#
|
|
|
|
# Here are the exceptions to AC_STATE_SAVE:
|
|
|
|
#
|
|
|
|
# - ^ac_
|
|
|
|
# Autoconf's shell name space.
|
|
|
|
# - prefix and exec_prefix
|
|
|
|
# are kept undefined (NONE) until AC_OUTPUT which then sets them to
|
|
|
|
# `/usr/local' and `${prefix}' for make.
|
|
|
|
# - CONFIG_STATUS and DEFS
|
|
|
|
# Set by AC_OUTPUT.
|
|
|
|
# - F77_DUMMY_MAIN
|
|
|
|
# Set by AC_F77_DUMMY_MAIN.
|
|
|
|
# - ALLOCA|NEED_SETGID|KMEM_GROUP
|
|
|
|
# AC_FUNCs from acspecific.
|
|
|
|
# - AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC
|
|
|
|
# AC_PROGs from acspecific
|
|
|
|
# - _|@|.[*#?].|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS
|
|
|
|
# Some variables some shells use and change.
|
|
|
|
# `.[*#?].' catches `$#' etc. which are displayed like this:
|
|
|
|
# | '!'=18186
|
|
|
|
# | '#'=0
|
|
|
|
# | '$'=6908
|
|
|
|
# - POW_LIB
|
|
|
|
# From acfunctions.m4.
|
|
|
|
#
|
2001-01-22 17:03:38 +08:00
|
|
|
m4_define([AT_CONFIGURE_AC],
|
2001-11-13 22:43:50 +08:00
|
|
|
[AT_DATA_AUTOCONF([aclocal.m4],
|
2001-11-13 22:05:25 +08:00
|
|
|
[[
|
|
|
|
# AC_STATE_SAVE(FILE)
|
|
|
|
# ------------------
|
|
|
|
# Save the environment, except for those variables we are allowed to touch.
|
|
|
|
# This is to check no test touches the user name space.
|
|
|
|
# FIXME: There are surely better ways. Explore for instance if
|
|
|
|
# we can ask help from AC_SUBST. We have the right to touch what
|
|
|
|
# is AC_SUBST'ed.
|
|
|
|
#
|
2002-05-30 06:29:26 +08:00
|
|
|
# Perhaps grep -E is not supported, or perhaps it chokes on such a big regex.
|
|
|
|
# In this case just don't pay attention to the env. It would be great
|
2001-11-13 22:05:25 +08:00
|
|
|
# to keep the error message but we can't: that would break AT_CHECK.
|
|
|
|
m4_defun([AC_STATE_SAVE],
|
|
|
|
[(set) 2>&1 |
|
2002-05-30 06:29:26 +08:00
|
|
|
grep -E -v -e 'm4_join([|],
|
2001-11-13 22:05:25 +08:00
|
|
|
[^a[cs]_],
|
|
|
|
[^((exec_)?prefix|DEFS|CONFIG_STATUS)=],
|
|
|
|
[^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=],
|
|
|
|
[^(LIBS|LIB@&t@OBJS|LDFLAGS)=],
|
|
|
|
[^INSTALL(_(DATA|PROGRAM|SCRIPT))?=],
|
|
|
|
[^(CYGWIN|ISC|MINGW32|MINIX|EMXOS2|XENIX|EXEEXT|OBJEXT)=],
|
|
|
|
[^(X_(CFLAGS|(EXTRA_|PRE_)?LIBS)|x_(includes|libraries)|(have|no)_x)=],
|
|
|
|
[^(host|build|target)(_(alias|cpu|vendor|os))?=],
|
|
|
|
[^(cross_compiling)=],
|
|
|
|
[^(interpval|PATH_SEPARATOR)=],
|
|
|
|
[^(F77_DUMMY_MAIN|f77_(case|underscore))=],
|
|
|
|
[^(ALLOCA|GETLOADAVG_LIBS|KMEM_GROUP|NEED_SETGID|POW_LIB)=],
|
|
|
|
[^(AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC)=],
|
|
|
|
[^(_|@|.[*#?].|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS)=])' 2>/dev/null |
|
|
|
|
# There maybe variables spread on several lines, eg IFS, remove the dead
|
|
|
|
# lines.
|
2002-10-31 21:57:37 +08:00
|
|
|
grep '^m4_defn([m4_re_word])=' >state-env.$][1
|
|
|
|
test $? = 0 || rm -f state-env.$][1
|
|
|
|
ls -1 | sed '/^at-/d;/^state-/d;/^config\./d' | sort >state-ls.$][1
|
2001-11-13 22:05:25 +08:00
|
|
|
])# AC_STATE_SAVE
|
2001-11-13 22:43:50 +08:00
|
|
|
]])
|
2001-11-13 22:05:25 +08:00
|
|
|
|
2001-11-13 22:43:50 +08:00
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
2001-05-22 22:43:48 +08:00
|
|
|
AC_CONFIG_AUX_DIR($top_srcdir/config)
|
2001-01-22 17:03:38 +08:00
|
|
|
AC_CONFIG_HEADER(config.h:config.hin)
|
2001-02-16 07:36:48 +08:00
|
|
|
AC_STATE_SAVE(before)]
|
2001-01-22 17:03:38 +08:00
|
|
|
$1
|
2001-02-16 07:36:48 +08:00
|
|
|
[AC_OUTPUT
|
2001-01-24 21:19:10 +08:00
|
|
|
AC_STATE_SAVE(after)
|
2001-11-13 22:43:50 +08:00
|
|
|
]])
|
|
|
|
])# AT_CONFIGURE_AC
|
2001-01-22 17:03:38 +08:00
|
|
|
|
|
|
|
|
2001-08-31 21:32:35 +08:00
|
|
|
# AT_CHECK_AUTOCONF(ARGS, [EXIT-STATUS = 0], STDOUT, STDERR)
|
|
|
|
# ----------------------------------------------------------
|
2000-11-29 18:11:38 +08:00
|
|
|
m4_define([AT_CHECK_AUTOCONF],
|
2001-11-13 22:43:50 +08:00
|
|
|
[AT_CHECK([autoconf $1],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
[$2], [$3], [$4])])
|
2000-11-23 17:52:35 +08:00
|
|
|
|
|
|
|
|
2002-10-16 14:38:50 +08:00
|
|
|
# AT_CHECK_AUTOHEADER(ARGS, [EXIT-STATUS = 0], STDOUT, STDERR)
|
|
|
|
# ------------------------------------------------------------
|
2000-11-29 18:11:38 +08:00
|
|
|
m4_define([AT_CHECK_AUTOHEADER],
|
2002-10-16 14:38:50 +08:00
|
|
|
[AT_CHECK([autoheader $1], [$2], [$3], [$4])
|
|
|
|
])
|
2000-11-23 17:52:35 +08:00
|
|
|
|
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
# AT_CHECK_CONFIGURE(END-COMMAND,
|
|
|
|
# [EXIT-STATUS = 0],
|
2003-02-28 18:11:07 +08:00
|
|
|
# [STDOUT = IGNORE], STDERR)
|
2000-12-19 16:15:48 +08:00
|
|
|
# --------------------------------------------
|
* lib/autoconf/status.m4 (_AC_SRCPATHS): Rename buildpath to
abs_builddir, top_buildpath to abs_top_builddir, srcpath to
abs_srcdir, top_srcpath to abs_top_srcdir.
(_AC_OUTPUT_FILES): Adjust.
* NEWS, doc/autoconf.texi, lib/autoconf/autotest.m4,
* tests/atspecific.m4, tests/autoreconf.in, tests/tools.at,
* tests/wrappl.in, tests/wrapsh.in: Adjust.
2001-12-15 01:57:27 +08:00
|
|
|
# `abs_top_srcdir' is needed so that `./configure' finds install-sh.
|
2000-12-07 23:21:54 +08:00
|
|
|
# Using --srcdir is more expensive.
|
2000-11-29 18:11:38 +08:00
|
|
|
m4_define([AT_CHECK_CONFIGURE],
|
* lib/autoconf/status.m4 (_AC_SRCPATHS): Rename buildpath to
abs_builddir, top_buildpath to abs_top_builddir, srcpath to
abs_srcdir, top_srcpath to abs_top_srcdir.
(_AC_OUTPUT_FILES): Adjust.
* NEWS, doc/autoconf.texi, lib/autoconf/autotest.m4,
* tests/atspecific.m4, tests/autoreconf.in, tests/tools.at,
* tests/wrappl.in, tests/wrapsh.in: Adjust.
2001-12-15 01:57:27 +08:00
|
|
|
[AT_CHECK([top_srcdir=$abs_top_srcdir ./configure $1],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
[$2],
|
|
|
|
m4_default([$3], [ignore]), [$4],
|
|
|
|
[test $at_verbose = echo && echo "$srcdir/AT_LINE: config.log" && cat config.log])])
|
2000-11-23 17:52:35 +08:00
|
|
|
|
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
# AT_CHECK_ENV
|
|
|
|
# ------------
|
|
|
|
# Check that the full configure run remained in its variable name space,
|
|
|
|
# and cleaned up tmp files.
|
2002-10-31 21:57:37 +08:00
|
|
|
# Some tests might exit prematurely when they find a problem, in
|
2001-01-22 17:03:38 +08:00
|
|
|
# which case `env-after' is probably missing. Don't check it then.
|
|
|
|
m4_define([AT_CHECK_ENV],
|
2002-10-31 21:57:37 +08:00
|
|
|
[test -f state-ls.before ||
|
|
|
|
AS_ERROR([state-ls.before not present])
|
|
|
|
if test -f state-env.before && test -f state-env.after; then
|
2001-01-22 17:03:38 +08:00
|
|
|
mv -f state-env.before expout
|
|
|
|
AT_CHECK([cat state-env.after], 0, expout)
|
|
|
|
fi
|
2002-10-31 21:57:37 +08:00
|
|
|
if test -f state-ls.after; then
|
2001-01-22 17:03:38 +08:00
|
|
|
mv -f state-ls.before expout
|
|
|
|
AT_CHECK([cat state-ls.after], 0, expout)
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
# AT_CHECK_DEFINES(CONTENT)
|
|
|
|
# -------------------------
|
2002-01-07 04:48:10 +08:00
|
|
|
# Verify that config.h, once stripped, is CONTENT.
|
2001-01-22 17:03:38 +08:00
|
|
|
# Stripping consists of keeping CPP lines (i.e. containing a hash),
|
2002-01-07 04:48:10 +08:00
|
|
|
# but those of automatically checked features (STDC_HEADERS etc.)
|
|
|
|
# and symbols (PACKAGE_...).
|
2001-01-22 17:03:38 +08:00
|
|
|
# AT_CHECK_HEADER is a better name, but too close from AC_CHECK_HEADER.
|
|
|
|
m4_define([AT_CHECK_DEFINES],
|
2002-05-30 06:29:26 +08:00
|
|
|
[AT_CHECK([[sed '/#/!d
|
|
|
|
/INTTYPES/d
|
|
|
|
/MEMORY/d
|
|
|
|
/PACKAGE_/d
|
|
|
|
/STDC_HEADERS/d
|
|
|
|
/STDINT/d
|
|
|
|
/STDLIB/d
|
|
|
|
/STRING/d
|
|
|
|
/SYS_STAT/d
|
|
|
|
/SYS_TYPES/d
|
|
|
|
/UNISTD/d' config.h]],,
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 21:24:04 +08:00
|
|
|
[$1])])
|
2001-01-22 17:03:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
# AT_CHECK_AUTOUPDATE
|
|
|
|
# -------------------
|
|
|
|
m4_define([AT_CHECK_AUTOUPDATE],
|
2002-10-16 14:38:50 +08:00
|
|
|
[AT_CHECK([autoupdate $1], [$2], [$3], [$4])
|
|
|
|
])
|
2001-01-22 17:03:38 +08:00
|
|
|
|
|
|
|
|
2000-10-24 18:16:30 +08:00
|
|
|
# _AT_CHECK_AC_MACRO(AC-BODY, PRE-TESTS)
|
|
|
|
# --------------------------------------
|
2000-12-23 18:11:57 +08:00
|
|
|
# Create a minimalist configure.ac running the macro named
|
2000-10-24 18:16:30 +08:00
|
|
|
# NAME-OF-THE-MACRO, check that autoconf runs on that script,
|
|
|
|
# and that the shell runs correctly the configure.
|
2000-11-29 18:11:38 +08:00
|
|
|
m4_define([_AT_CHECK_AC_MACRO],
|
2001-01-22 17:03:38 +08:00
|
|
|
[AT_CONFIGURE_AC([$1])
|
2000-10-24 18:16:30 +08:00
|
|
|
$2
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_AUTOHEADER
|
|
|
|
AT_CHECK_CONFIGURE
|
2001-01-22 17:03:38 +08:00
|
|
|
AT_CHECK_ENV
|
2000-10-24 18:16:30 +08:00
|
|
|
])# _AT_CHECK_AC_MACRO
|
|
|
|
|
|
|
|
|
* configure.ac: Also find tested executables in bin.
* bin/autoconf.in, bin/autoheader.in, bin/autoreconf.in,
* bin/autoscan.in, autoupdate.in: Use exclusively the name of the
installed peer executables, only PATH is allowed to resolve it.
Pass `autoconf_dir' via options, not via invisible envvars.
* lib/Autom4te/General.pm (&find_peer): Remove.
* lib/autotest/general.m4 (AT_INIT): `AUTOTEST_PATH=a:b' gives
`abuild:asrc:bbuild:bsrc', not `abuild:bbuild:asrc:bsrc'.
* man/Makefile.am: Let help2man rely on PATH instead of trying to
find the executables for it.
* tests/Makefile.am: Major cleanup. Too lazy to document...
* tests/atlocal.in: Remove all the obscure envvar manipulations.
We only need PERL.
* tests/atspecific.m4, tests/tools.at: Passing --localdir is
indeed related to running the test suite, while passing
--autoconf-dir and others is related to running non installed
Autoconf executables. So don't do that, leave it to...
* tests/autoconf, tests/autoheader, tests/autom4te, tests/autoupdate,
* tests/autoscan: New.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): Don't
refer to library files: rely on --language.
2001-08-31 21:30:11 +08:00
|
|
|
# AT_CHECK_MACRO(MACRO, [MACRO-USE], [ADDITIONAL-CMDS],
|
|
|
|
# [AUTOCONF-FLAGS = -W obsolete])
|
|
|
|
# -----------------------------------------------------
|
2000-12-23 18:11:57 +08:00
|
|
|
# Create a minimalist configure.ac running the macro named
|
2000-10-24 18:16:30 +08:00
|
|
|
# NAME-OF-THE-MACRO, check that autoconf runs on that script,
|
|
|
|
# and that the shell runs correctly the configure.
|
2001-01-22 17:03:38 +08:00
|
|
|
#
|
|
|
|
# New macros are not expected to depend upon obsolete macros.
|
2000-11-29 18:11:38 +08:00
|
|
|
m4_define([AT_CHECK_MACRO],
|
2000-10-24 18:16:30 +08:00
|
|
|
[AT_SETUP([$1])
|
2001-09-10 15:18:17 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
AT_CONFIGURE_AC([m4_default([$2], [$1])])
|
2000-10-24 18:16:30 +08:00
|
|
|
|
2001-06-26 02:27:51 +08:00
|
|
|
AT_CHECK_AUTOCONF([m4_default([$4], [-W obsolete])])
|
2001-01-22 17:03:38 +08:00
|
|
|
AT_CHECK_AUTOHEADER
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK_ENV
|
2000-10-24 18:16:30 +08:00
|
|
|
$3
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CLEANUP()dnl
|
2000-10-24 18:16:30 +08:00
|
|
|
])# AT_CHECK_MACRO
|
|
|
|
|
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
# AT_CHECK_AU_MACRO(MACRO)
|
|
|
|
# ------------------------
|
2000-12-23 18:11:57 +08:00
|
|
|
# Create a minimalist configure.ac running the macro named
|
2000-10-24 18:16:30 +08:00
|
|
|
# NAME-OF-THE-MACRO, autoupdate this script, check that autoconf runs
|
|
|
|
# on that script, and that the shell runs correctly the configure.
|
2001-01-22 17:03:38 +08:00
|
|
|
#
|
|
|
|
# Updated configure.ac shall not depend upon obsolete macros, which votes
|
|
|
|
# in favor of `-W obsolete', but since many of these macros leave a message
|
2002-04-20 14:09:01 +08:00
|
|
|
# to be removed by the user once her code is adjusted, let's not check.
|
2001-01-22 17:03:38 +08:00
|
|
|
#
|
|
|
|
# Remove config.hin to avoid `autoheader: config.hin is unchanged'.
|
|
|
|
m4_define([AT_CHECK_AU_MACRO],
|
|
|
|
[AT_SETUP([$1])
|
2001-09-13 14:53:19 +08:00
|
|
|
AT_KEYWORDS([autoupdate])
|
2001-09-10 15:18:17 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
AT_CONFIGURE_AC([$1])
|
2000-10-24 18:16:30 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_AUTOHEADER
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK_ENV
|
2000-10-24 18:16:30 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
rm config.hin
|
|
|
|
AT_CHECK_AUTOUPDATE
|
2000-10-24 18:16:30 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_AUTOHEADER
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK_ENV
|
2000-10-24 18:16:30 +08:00
|
|
|
|
2001-01-22 17:03:38 +08:00
|
|
|
AT_CLEANUP()dnl
|
|
|
|
])# AT_CHECK_UPDATE
|
2003-06-23 19:11:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ----------------------- ##
|
|
|
|
## Launch the test suite. ##
|
|
|
|
## ----------------------- ##
|
|
|
|
|
|
|
|
AT_INIT
|
|
|
|
|