2008-10-21 Eric Blake <ebb9@byu.net>
+ Allow AS_CASE in shell lists.
+ * lib/m4sugar/m4sh.m4 (AS_CASE): Always execute test, in case of
+ side effects. Allow continuation of script on same line as esac.
+ * lib/autoconf/c.m4 (AC_PROG_CC_STDC): Adjust client.
+ * tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Enhance test.
+ * NEWS: Document the subtle change.
+
Allow AS_IF in shell lists.
* lib/m4sugar/m4sh.m4 (AS_IF): Always execute test, in case of
side effects. Allow continuation of script on same line as fi.
AS_VAR_PUSHDEF AS_VAR_SET AS_VAR_SET_IF AS_VAR_TEST_SET
AS_VERSION_COMPARE
+** The m4sh macros AS_IF and AS_CASE can now be used in shell lists.
+ The responsibility for supplying a trailing newline now belongs to
+ the call site, but since most users did not add dnl, this generally
+ results in fewer empty lines in configure.
+
\f
* Major changes in Autoconf 2.63 (2008-09-09) [stable]
Released by Eric Blake, based on git versions 2.62.*.
[no], [ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no],
[_AC_PROG_CC_C99([ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99],
[_AC_PROG_CC_C89([ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89],
- [ac_cv_prog_cc_stdc=no])])])dnl
+ [ac_cv_prog_cc_stdc=no])])])
AC_MSG_CHECKING([for $CC option to accept ISO Standard C])
AC_CACHE_VAL([ac_cv_prog_cc_stdc], [])
AS_CASE([$ac_cv_prog_cc_stdc],
[ *[)] $1 ;;
])
m4_defun([AS_CASE],
-[m4_ifval([$2$3],
[case $1 in
m4_map_args_pair([_$0], [_$0_DEFAULT], m4_shift($@))dnl
-esac
-])dnl
-])# AS_CASE
+esac])# AS_CASE
# AS_EXIT([EXIT-CODE = 1])
# check for nesting, lists, and side effects
empty=
-AS_IF([AS_IF([$empty], [echo eleven])]) && echo twelve
+AS_IF([AS_IF([$empty], [echo eleven])]) && AS_CASE([foo]) && echo twelve
rm -f file
AS_IF([touch file; false]) && echo thirteen
test -f file && echo fourteen
+rm -f file
+AS_CASE([`touch file; false`]) && test -f file && echo fifteen
# check that require works correctly
m4_for([n], 1, 9, [],
twelve
thirteen
fourteen
+fifteen
foo1=1 bar1=1
foo2=2 bar2=
foo3=3 bar3=