2010-07-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Avoid syntax error if IF-TRUE part of AM_COND_IF expands empty.
+ * m4/cond-if.m4 (AM_COND_IF): Ensure IF-TRUE part is never empty
+ to avoid shell syntax error if the m4 expansion is empty.
+ * tests/cond40.test: Enhance test.
+
Coverage: bogus option to AM_INIT_AUTOMAKE.
* tests/init2.test: New test.
* tests/Makefile.am: Update.
# AM_COND_IF -*- Autoconf -*-
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
+# serial 2
# _AM_COND_IF
# _AM_COND_ELSE
[m4_ifndef([_AM_COND_VALUE_$1],
[m4_fatal([$0: no such condition "$1"])])dnl
_AM_COND_IF([$1])dnl
-if _AM_COND_VALUE_$1; then
- m4_default([$2], [:])
+if _AM_COND_VALUE_$1; then :
+ m4_n([$2])[]dnl
m4_ifval([$3],
[_AM_COND_ELSE([$1])dnl
else
-#!/bin/sh
-# Copyright (C) 2008 Free Software Foundation, Inc.
+#! /bin/sh
+# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
[AC_CONFIG_FILES([$1])])
AM_CONDITIONAL([COND], [test "$cond" = yes])
+# Next lines should not cause a shell syntax error.
+AM_COND_IF([COND])
+AM_COND_IF([COND],
+ [AC_SUBST([BAR])])
AM_COND_IF([COND],
[AC_CONFIG_FILES([file1])])