of the test suite.
* tests/aclocal.m4 (AC_STATE_SAVE): If egrep fails, remove the
output file.
* tests/atspecific.m4 (_AT_CHECK_AC_MACRO): Don't check `state-*'
if the files are not present.
* m4sugar.m4 (m4_join): Rename as...
(m4_smash): this.
* tests/aclocal.m4 (join): Move as...
* m4sugar.m4 (m4_flatten): this.
* autoconf.sh (trace.m4): Rename m4_smash as m4_flatten.
+2000-12-06 Akim Demaille <akim@epita.fr>
+
+ The SunOS' egrep fails to process properly the `egrep' invocations
+ of the test suite.
+
+ * tests/aclocal.m4 (AC_STATE_SAVE): If egrep fails, remove the
+ output file.
+ * tests/atspecific.m4 (_AT_CHECK_AC_MACRO): Don't check `state-*'
+ if the files are not present.
+
+ * m4sugar.m4 (m4_join): Rename as...
+ (m4_smash): this.
+ * tests/aclocal.m4 (join): Move as...
+ * m4sugar.m4 (m4_flatten): this.
+ * autoconf.sh (trace.m4): Rename m4_smash as m4_flatten.
+
2000-12-06 Akim Demaille <akim@epita.fr>
* autoconf.sh (task trace): s/m4/$M4/.
# ive ], [-Var-])end
# => -active--b--active-end
m4_define([AC_FOREACH],
-[m4_foreach([$1], m4_split(m4_strip(m4_join([$2]))), [$3])])
+[m4_foreach([$1], m4_split(m4_strip(m4_flatten([$2]))), [$3])])
# MODE can be:
# `at' -- the elements are enclosed in brackets.
# `star' -- the elements are listed as are.
- # `percent' -- the elements are `smashed': spaces are singled out,
+ # `percent' -- the elements are `flattened': spaces are singled out,
# and no new line remains.
define([_at_at],
[at_ifelse([$#], [1], [],
[[[$2]][$1]$0([$1], at_shift(at_shift($@)))])])
define([_at_percent],
[at_ifelse([$#], [1], [],
- [$#], [2], [at_smash([$2])],
- [at_smash([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
+ [$#], [2], [at_flatten([$2])],
+ [at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
define([_at_star],
[at_ifelse([$#], [1], [],
[$#], [2], [[$2]],
[[$2][$1]$0([$1], at_shift(at_shift($@)))])])
- # Smash quotes its result.
- define([at_smash],
+ # FLATTEN quotes its result.
+ define([at_flatten],
[at_patsubst(at_patsubst(at_patsubst([[[$1]]],
[\\
]),
# $*, list of unquoted effective arguments.
if (arg == "*")
return "]at_star([" (separator ? separator : ",") "], $@)["
- # $%, list of smashed unquoted effective arguments.
+ # $%, list of flattened unquoted effective arguments.
if (arg == "%")
return "]at_percent([" (separator ? separator : ":") "], $@)["
}
# MODE can be:
# `at' -- the elements are enclosed in brackets.
# `star' -- the elements are listed as are.
- # `percent' -- the elements are `smashed': spaces are singled out,
+ # `percent' -- the elements are `flattened': spaces are singled out,
# and no new line remains.
define([_at_at],
[at_ifelse([$#], [1], [],
[[[$2]][$1]$0([$1], at_shift(at_shift($@)))])])
define([_at_percent],
[at_ifelse([$#], [1], [],
- [$#], [2], [at_smash([$2])],
- [at_smash([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
+ [$#], [2], [at_flatten([$2])],
+ [at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
define([_at_star],
[at_ifelse([$#], [1], [],
[$#], [2], [[$2]],
[[$2][$1]$0([$1], at_shift(at_shift($@)))])])
- # Smash quotes its result.
- define([at_smash],
+ # FLATTEN quotes its result.
+ define([at_flatten],
[at_patsubst(at_patsubst(at_patsubst([[[$1]]],
[\\
]),
# $*, list of unquoted effective arguments.
if (arg == "*")
return "]at_star([" (separator ? separator : ",") "], $@)["
- # $%, list of smashed unquoted effective arguments.
+ # $%, list of flattened unquoted effective arguments.
if (arg == "%")
return "]at_percent([" (separator ? separator : ":") "], $@)["
}
# MODE can be:
# `at' -- the elements are enclosed in brackets.
# `star' -- the elements are listed as are.
- # `percent' -- the elements are `smashed': spaces are singled out,
+ # `percent' -- the elements are `flattened': spaces are singled out,
# and no new line remains.
define([_at_at],
[at_ifelse([$#], [1], [],
[[[$2]][$1]$0([$1], at_shift(at_shift($@)))])])
define([_at_percent],
[at_ifelse([$#], [1], [],
- [$#], [2], [at_smash([$2])],
- [at_smash([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
+ [$#], [2], [at_flatten([$2])],
+ [at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
define([_at_star],
[at_ifelse([$#], [1], [],
[$#], [2], [[$2]],
[[$2][$1]$0([$1], at_shift(at_shift($@)))])])
- # Smash quotes its result.
- define([at_smash],
+ # FLATTEN quotes its result.
+ define([at_flatten],
[at_patsubst(at_patsubst(at_patsubst([[[$1]]],
[\\
]),
# $*, list of unquoted effective arguments.
if (arg == "*")
return "]at_star([" (separator ? separator : ",") "], $@)["
- # $%, list of smashed unquoted effective arguments.
+ # $%, list of flattened unquoted effective arguments.
if (arg == "%")
return "]at_percent([" (separator ? separator : ":") "], $@)["
}
# ive ], [-Var-])end
# => -active--b--active-end
m4_define([AC_FOREACH],
-[m4_foreach([$1], m4_split(m4_strip(m4_join([$2]))), [$3])])
+[m4_foreach([$1], m4_split(m4_strip(m4_flatten([$2]))), [$3])])
-# m4_join(STRING)
-# ---------------
+# m4_flatten(STRING)
+# ------------------
# If STRING contains end of lines, replace them with spaces. If there
# are backslashed end of lines, remove them. This macro is safe with
# active symbols.
# m4_define(active, ACTIVE)
-# m4_join([active
+# m4_flatten([active
# act\
# ive])end
# => active activeend
-m4_define([m4_join],
+m4_define([m4_flatten],
[m4_translit(m4_patsubst([[[$1]]], [\\
]), [
], [ ])])
+# m4_join(SEP, ARG1, ARG2...)
+# ---------------------------
+# Produce ARG1SEPARG2...SEPARGn.
+m4_defun([m4_join],
+[m4_case([$#],
+ [1], [],
+ [2], [[$2]],
+ [[$2][$1]m4_join([$1], m4_shift(m4_shift($@)))])])
+
+
+
# m4_append(MACRO-NAME, STRING)
# -----------------------------
# Redefine MACRO-NAME to hold its former content plus STRING at the
m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
m4_Prefix])[]dnl
-m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_join([$1])))),
+m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_flatten([$1])))),
[m4_define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl
dnl New line if too long, else insert a space unless it is the first
dnl of the words.
-# m4_join(STRING)
-# ---------------
+# m4_flatten(STRING)
+# ------------------
# If STRING contains end of lines, replace them with spaces. If there
# are backslashed end of lines, remove them. This macro is safe with
# active symbols.
# m4_define(active, ACTIVE)
-# m4_join([active
+# m4_flatten([active
# act\
# ive])end
# => active activeend
-m4_define([m4_join],
+m4_define([m4_flatten],
[m4_translit(m4_patsubst([[[$1]]], [\\
]), [
], [ ])])
+# m4_join(SEP, ARG1, ARG2...)
+# ---------------------------
+# Produce ARG1SEPARG2...SEPARGn.
+m4_defun([m4_join],
+[m4_case([$#],
+ [1], [],
+ [2], [[$2]],
+ [[$2][$1]m4_join([$1], m4_shift(m4_shift($@)))])])
+
+
+
# m4_append(MACRO-NAME, STRING)
# -----------------------------
# Redefine MACRO-NAME to hold its former content plus STRING at the
m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
m4_Prefix])[]dnl
-m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_join([$1])))),
+m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_flatten([$1])))),
[m4_define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl
dnl New line if too long, else insert a space unless it is the first
dnl of the words.
# actest.m4 -*- autoconf -*-
# Additional Autoconf macros to ease testing.
-# join(SEP, ARG1, ARG2...)
-# ------------------------
-# Produce ARG1SEPARG2...SEPARGn.
-define([join],
-[m4_case([$#],
- [1], [],
- [2], [[$2]],
- [[$2][$1]join([$1], m4_shift(m4_shift($@)))])])
-
-
# AC_STATE_SAVE(FILE)
# ------------------
# Save the environment, but the variables we are allowed to touch.
# Some variables some shells use and change
# - POW_LIB
# From acfunctions.m4.
-AC_DEFUN([AC_STATE_SAVE],
+m4_defun([AC_STATE_SAVE],
[(set) 2>&1 |
- egrep -v -e \
-'join([|],
+ egrep -v -e 'm4_join([|],
[^ac_],
[^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=],
[^(LIBS|LIBOBJS|LDFLAGS)=],
[^(AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC)=],
[^(_|@|.[*#?].|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS)=])' |
# There maybe variables spread on several lines, eg IFS, remove the dead
- # lines
+ # lines.
fgrep = >state-env.$1
- rm -f state-ls.$1
- ls -1 | grep -v '^state' | sort > state-ls.$1
-])
+# 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.
+test $? = 0 || rm -f state-env.$1
+
+ls -1 | grep -v '^state' | sort >state-ls.$1
+])# AC_STATE_SAVE
# ----------------
# Related VALUE to NAME both with AC_SUBST and AC_DEFINE. This is
# used in the torture tests.
-AC_DEFUN([AC_DEFUBST],
+m4_defun([AC_DEFUBST],
[AC_DUMMY_VAR($1)="AC_DEFUBST_VALUE"
AC_DEFINE_UNQUOTED(AC_DUMMY_VAR($1),
"$AC_DUMMY_VAR($1)",
dnl Some tests might exit prematurely when they find a problem, in
dnl which case `env-after' is probably missing. Don't check it then.
-if test -f state-env.after; then
+if test -f state-env.before -a -f state-env.after; then
mv -f state-env.before expout
AT_CHECK([cat state-env.after], 0, expout)
+fi
+if test -f state-ls.before -a -f state-ls.after; then
mv -f state-ls.before expout
AT_CHECK([cat state-ls.after], 0, expout)
fi