From 2b882015914c1e802a44d2fe59e154c0470b0b73 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 13 Nov 2001 14:05:25 +0000 Subject: [PATCH] * tests/atspecific.m4 (AT_DATA_AUTOCONF): New. * tests/aclocal.m4: Remove, as it is no longer used. --- ChangeLog | 7 ++++ tests/.cvsignore | 19 ++--------- tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/aclocal.m4 | 76 ------------------------------------------ tests/atspecific.m4 | 81 ++++++++++++++++++++++++++++++++++++++++++--- tests/suite.at | 2 +- 7 files changed, 89 insertions(+), 100 deletions(-) delete mode 100644 tests/aclocal.m4 diff --git a/ChangeLog b/ChangeLog index b8b01472..cfa89f81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-11-13 Akim Demaille + + * tests/atspecific.m4 (AT_DATA_AUTOCONF): New. + (AT_CONFIGURE_AC): Output the definition of AC_STATE_SAVE in + configure.ac. + * tests/aclocal.m4: Remove, as it is no longer used. + 2001-11-13 Akim Demaille * lib/autotest/general.m4: Change `tests?' into `groups?' in diff --git a/tests/.cvsignore b/tests/.cvsignore index 6859f146..016046b2 100644 --- a/tests/.cvsignore +++ b/tests/.cvsignore @@ -1,26 +1,11 @@ Makefile -AT-* at-* atlocal atconfig experr expout stderr stdout -config.h config.hin -config.log -config.status -configure configure.ac configure.in configure.scan -confdefs.h -conftest* -dst1 dst2 src1 src2 -empty -endless.sh macros.m4 -mycc mycpp -state* -syntax.sh expr +expr *.log -testsuite testsuite.tmp testsuite.[0-9][0-9][0-9] +testsuite testsuite.tmp testsuite.dir autom4te.cache -command.in header.in link.in -script.s4g package.m4 ifnames -install-sh autoupdate autoscan autoreconf diff --git a/tests/Makefile.am b/tests/Makefile.am index bafedaa2..9012daad 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,7 +20,7 @@ # We don't actually distribute the testsuite, since one only # needs m4 to build it, m4 being required anyway to install Autoconf. -EXTRA_DIST = $(TESTSUITE_AT) atspecific.m4 aclocal.m4 mktests.sh \ +EXTRA_DIST = $(TESTSUITE_AT) atspecific.m4 mktests.sh \ atlocal.in # Running the uninstalled scripts. diff --git a/tests/Makefile.in b/tests/Makefile.in index cf7c5ad7..30dde8fb 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -72,7 +72,7 @@ PACKAGE_NAME = @PACKAGE_NAME@ PERL = @PERL@ VERSION = @VERSION@ -EXTRA_DIST = $(TESTSUITE_AT) atspecific.m4 aclocal.m4 mktests.sh \ +EXTRA_DIST = $(TESTSUITE_AT) atspecific.m4 mktests.sh \ atlocal.in diff --git a/tests/aclocal.m4 b/tests/aclocal.m4 deleted file mode 100644 index 22da49c6..00000000 --- a/tests/aclocal.m4 +++ /dev/null @@ -1,76 +0,0 @@ -# actest.m4 -*- autoconf -*- -# Additional Autoconf macros to ease testing. - -# Copyright 2000, 2001 Free Software Foundation, Inc. -# -# 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. - -# 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. -# - ^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. -# -# Some `egrep' choke on such a big regex (e.g., SunOS 4.1.3). In this -# case just don't pay attention to the env. It would be great -# to keep the error message but we can't: that would break AT_CHECK. -m4_defun([AC_STATE_SAVE], -[(set) 2>&1 | - egrep -v -e 'm4_join([|], - [^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. - grep '^m4_defn([m4_re_word])=' >state-env.$1 -test $? = 0 || rm -f state-env.$1 - -ls -1 | egrep -v '^(at-|state-|config\.)' | sort >state-ls.$1 -])# AC_STATE_SAVE diff --git a/tests/atspecific.m4 b/tests/atspecific.m4 index 8d1ade5d..3858ad00 100644 --- a/tests/atspecific.m4 +++ b/tests/atspecific.m4 @@ -37,7 +37,7 @@ m4_define([AT_DATA_M4SUGAR], # ---------------------------------------------------------- m4_define([AT_CHECK_M4SUGAR], [AT_CHECK([autom4te --language=m4sugar script.4s -o script $1], - m4_default([$2], [0]), [$3], [$4])]) + m4_default([$2], [0]), [$3], [$4])]) @@ -60,7 +60,7 @@ m4_define([AT_DATA_M4SH], # ------------------------------------------------------- m4_define([AT_CHECK_M4SH], [AT_CHECK([autom4te --language=m4sh script.as -o script $1], - m4_default([$2], [0]), [$3], [$4])]) + m4_default([$2], [0]), [$3], [$4])]) @@ -69,13 +69,86 @@ m4_define([AT_CHECK_M4SH], ## ------------------ ## +# AT_DATA_AUTOCONF(FILENAME, CONTENTS) +# ------------------------------------ +# Escape the invalid tokens with @&t@. +m4_define([AT_DATA_AUTOCONF], +[AT_DATA([$1], +[m4_bpatsubsts([$2], + [\(m4\|AS\|AC\)_], [\1@&t@_], + [dnl], [d@&t@nl])])]) + + + # AT_CONFIGURE_AC(BODY) # --------------------- # Create a full configure.ac running BODY, with a config header set up, # AC_OUTPUT, and environement checking hooks. +# +# 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. +# m4_define([AT_CONFIGURE_AC], -[AT_DATA([configure.ac], -[[AC_INIT +[AT_DATA_AUTOCONF([configure.ac], +[[ +# 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. +# +# Some `egrep' choke on such a big regex (e.g., SunOS 4.1.3). In this +# case just don't pay attention to the env. It would be great +# to keep the error message but we can't: that would break AT_CHECK. +m4_defun([AC_STATE_SAVE], +[(set) 2>&1 | + egrep -v -e 'm4_join([|], + [^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. + grep '^m4_defn([m4_re_word])=' >state-env.$1 +test $? = 0 || rm -f state-env.$1 + +ls -1 | egrep -v '^(at-|state-|config\.)' | sort >state-ls.$1 +])# AC_STATE_SAVE + +AC_INIT AC_CONFIG_AUX_DIR($top_srcdir/config) AC_CONFIG_HEADER(config.h:config.hin) AC_STATE_SAVE(before)] diff --git a/tests/suite.at b/tests/suite.at index 3e9563b1..d23eb6de 100644 --- a/tests/suite.at +++ b/tests/suite.at @@ -18,7 +18,7 @@ # 02111-1307, USA. # We need a very up to date version of Autotest. -m4_version_prereq([2.52e]) +m4_version_prereq([2.52g]) # Macros specialized for Autoconf testing. m4_include([atspecific.m4])