1 # actest.m4 -*- autoconf -*-
2 # Additional Autoconf macros to ease testing.
6 # Save the environment, except for those variables we are allowed to touch.
7 # This is to check no test touches the user name space.
8 # FIXME: There are surely better ways. Explore for instance if
9 # we can ask help from AC_SUBST. We have the right to touch what
12 # Autoconf's shell name space.
13 # - prefix and exec_prefix
14 # are kept undefined (NONE) until AC_OUTPUT which then sets them to
15 # `/usr/local' and `${prefix}' for make.
16 # - CONFIG_STATUS and DEFS
19 # Set by AC_F77_DUMMY_MAIN.
20 # - ALLOCA|NEED_SETGID|KMEM_GROUP
21 # AC_FUNCs from acspecific.
22 # - AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC
23 # AC_PROGs from acspecific
24 # - _|@|.[*#?].|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS
25 # Some variables some shells use and change.
26 # `.[*#?].' catches `$#' etc. which are displayed like this:
31 # From acfunctions.m4.
33 # Some `egrep' choke on such a big regex (e.g., SunOS 4.1.3). In this
34 # case just don't pay attention to the env. It would be great
35 # to keep the error message but we can't: that would break AT_CHECK.
36 m4_defun([AC_STATE_SAVE],
38 egrep -v -e 'm4_join([|],
40 [^((exec_)?prefix|DEFS|CONFIG_STATUS)=],
41 [^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=],
42 [^(LIBS|LIBOBJS|LDFLAGS)=],
43 [^INSTALL(_(DATA|PROGRAM|SCRIPT))?=],
44 [^(CYGWIN|ISC|MINGW32|MINIX|EMXOS2|XENIX|EXEEXT|OBJEXT)=],
45 [^(X_(CFLAGS|(EXTRA_|PRE_)?LIBS)|x_(includes|libraries)|(have|no)_x)=],
46 [^(host|build|target)(_(alias|cpu|vendor|os))?=],
47 [^(cross_compiling)=],
48 [^(interpval|PATH_SEPARATOR)=],
49 [^(F77_DUMMY_MAIN|f77_(case|underscore))=],
50 [^(ALLOCA|GETLOADAVG_LIBS|KMEM_GROUP|NEED_SETGID|POW_LIB)=],
51 [^(AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC)=],
52 [^(_|@|.[*#?].|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS)=])' 2>/dev/null |
53 # There maybe variables spread on several lines, eg IFS, remove the dead
55 grep '^m4_defn([m4_re_word])=' >state-env.$1
56 test $? = 0 || rm -f state-env.$1
58 ls -1 | egrep -v '^(at-|state-|config\.)' | sort >state-ls.$1