2000-05-24 22:39:24 +08:00
|
|
|
# actest.m4 -*- autoconf -*-
|
|
|
|
# Additional Autoconf macros to ease testing.
|
Test that the macros respect the user variable name space.
* acgeneral.m4 (AC_CANONICAL_THING): define, not AC_DEFUN.
Don't AC_PROVIDE, there is no need.
When calling `config.sub`, also || exit 1, to catch failures from
config.sub.
* acspecific.m4 (AC_SYS_LONG_FILE_NAMES): Use ac_val, not val.
(AC_EXEEXT): Use ac_file, not file.
* tests/actest.m4: New file, holding extra Autoconf macros used
during the testing.
(AC_ENV_SAVE): New macro, save the sh variables in a file.
* tests/suite.m4 (AT_TEST_MACRO, Generation of configure.in):
include actest.m4, and call twice AC_ENV_SAVE to compare the
variables before and after the macro.
* tests/Makefile.am (macro.m4): Don't test macros that are
required: they will be tested somewhere else.
2000-02-07 21:25:35 +08:00
|
|
|
|
2000-03-10 23:22:13 +08:00
|
|
|
# join(SEP, ARG1, ARG2...)
|
|
|
|
# ------------------------
|
|
|
|
# Produce ARG1SEPARG2...SEPARGn.
|
2000-05-24 22:39:24 +08:00
|
|
|
define([join],
|
2000-03-10 23:22:13 +08:00
|
|
|
[ifelse([$#], [1], [],
|
|
|
|
[$#], [2], [[$2]],
|
|
|
|
[[$2][$1]join([$1], m4_shift(m4_shift($@)))])])
|
|
|
|
|
Test that the macros respect the user variable name space.
* acgeneral.m4 (AC_CANONICAL_THING): define, not AC_DEFUN.
Don't AC_PROVIDE, there is no need.
When calling `config.sub`, also || exit 1, to catch failures from
config.sub.
* acspecific.m4 (AC_SYS_LONG_FILE_NAMES): Use ac_val, not val.
(AC_EXEEXT): Use ac_file, not file.
* tests/actest.m4: New file, holding extra Autoconf macros used
during the testing.
(AC_ENV_SAVE): New macro, save the sh variables in a file.
* tests/suite.m4 (AT_TEST_MACRO, Generation of configure.in):
include actest.m4, and call twice AC_ENV_SAVE to compare the
variables before and after the macro.
* tests/Makefile.am (macro.m4): Don't test macros that are
required: they will be tested somewhere else.
2000-02-07 21:25:35 +08:00
|
|
|
|
|
|
|
# AC_ENV_SAVE(FILE)
|
|
|
|
# ------------------
|
|
|
|
# Save the environment, but the 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.
|
2000-03-01 19:28:02 +08:00
|
|
|
# - ^ac_
|
|
|
|
# Autoconf's shell name space.
|
|
|
|
# - 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
|
2000-03-14 16:59:11 +08:00
|
|
|
# - _|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS
|
2000-03-01 19:28:02 +08:00
|
|
|
# Some variables some shells use and change
|
2000-09-19 23:36:39 +08:00
|
|
|
# - POW_LIB
|
|
|
|
# From acfunctions.m4.
|
2000-05-24 22:39:24 +08:00
|
|
|
AC_DEFUN([AC_ENV_SAVE],
|
Test that the macros respect the user variable name space.
* acgeneral.m4 (AC_CANONICAL_THING): define, not AC_DEFUN.
Don't AC_PROVIDE, there is no need.
When calling `config.sub`, also || exit 1, to catch failures from
config.sub.
* acspecific.m4 (AC_SYS_LONG_FILE_NAMES): Use ac_val, not val.
(AC_EXEEXT): Use ac_file, not file.
* tests/actest.m4: New file, holding extra Autoconf macros used
during the testing.
(AC_ENV_SAVE): New macro, save the sh variables in a file.
* tests/suite.m4 (AT_TEST_MACRO, Generation of configure.in):
include actest.m4, and call twice AC_ENV_SAVE to compare the
variables before and after the macro.
* tests/Makefile.am (macro.m4): Don't test macros that are
required: they will be tested somewhere else.
2000-02-07 21:25:35 +08:00
|
|
|
[(set) 2>&1 |
|
2000-03-10 23:22:13 +08:00
|
|
|
egrep -v -e \
|
|
|
|
'join([|],
|
|
|
|
[^ac_],
|
|
|
|
[^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=],
|
|
|
|
[^(LIBS|LIBOBJS|LDFLAGS)=],
|
|
|
|
[^INSTALL(_(DATA|PROGRAM|SCRIPT))?=],
|
2000-05-24 22:39:24 +08:00
|
|
|
[^(CYGWIN|ISC|MINGW32|MINIX|EMXOS2|XENIX|EXEEXT|OBJEXT)=],
|
2000-06-07 01:00:46 +08:00
|
|
|
[^(X_(CFLAGS|(EXTRA_|PRE_)?LIBS)|x_(includes|libraries)|(have|no)_x)=],
|
2000-03-10 23:22:13 +08:00
|
|
|
[^(host|build|target)(_(alias|cpu|vendor|os))?=],
|
|
|
|
[^(cross_compiling)=],
|
|
|
|
[^(interpval)=],
|
|
|
|
[^(f77_(case|underscore))=],
|
2000-09-19 23:36:39 +08:00
|
|
|
[^(ALLOCA|GETLOADAVG_LIBS|KMEM_GROUP|NEED_SETGID|POW_LIB)=],
|
2000-03-10 23:22:13 +08:00
|
|
|
[^(AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC)=],
|
2000-03-14 16:59:11 +08:00
|
|
|
[^(_|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS)=])' |
|
Test that the macros respect the user variable name space.
* acgeneral.m4 (AC_CANONICAL_THING): define, not AC_DEFUN.
Don't AC_PROVIDE, there is no need.
When calling `config.sub`, also || exit 1, to catch failures from
config.sub.
* acspecific.m4 (AC_SYS_LONG_FILE_NAMES): Use ac_val, not val.
(AC_EXEEXT): Use ac_file, not file.
* tests/actest.m4: New file, holding extra Autoconf macros used
during the testing.
(AC_ENV_SAVE): New macro, save the sh variables in a file.
* tests/suite.m4 (AT_TEST_MACRO, Generation of configure.in):
include actest.m4, and call twice AC_ENV_SAVE to compare the
variables before and after the macro.
* tests/Makefile.am (macro.m4): Don't test macros that are
required: they will be tested somewhere else.
2000-02-07 21:25:35 +08:00
|
|
|
# There maybe variables spread on several lines, eg IFS, remove the dead
|
|
|
|
# lines
|
|
|
|
fgrep = >$1
|
|
|
|
])
|
2000-02-08 01:15:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# AC_DEFUBST(NAME)
|
|
|
|
# ----------------
|
|
|
|
# Related VALUE to NAME both with AC_SUBST and AC_DEFINE. This is
|
|
|
|
# used in the torture tests.
|
2000-05-24 22:39:24 +08:00
|
|
|
AC_DEFUN([AC_DEFUBST],
|
2000-02-08 01:15:51 +08:00
|
|
|
[AC_DUMMY_VAR($1)="AC_DEFUBST_VALUE"
|
|
|
|
AC_DEFINE_UNQUOTED(AC_DUMMY_VAR($1),
|
|
|
|
"$AC_DUMMY_VAR($1)",
|
|
|
|
[Define to a long string if your `Autoconf' works
|
|
|
|
properly.])
|
|
|
|
AC_SUBST(AC_DUMMY_VAR($1))])
|