From 80c3de2313dbea3e974167732ec85547ab848a0b Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 17 May 2004 20:19:34 +0000 Subject: [PATCH] * m4/cond.m4 (AM_CONDITIONAL): Double-quote diagnostic. * tests/condd.test: Define a macro with the same name as a conditional. * tests/pr220.test: Modernize, and make sure the diagnostics contains the macro name. Report from Volker Boerchers. --- ChangeLog | 9 +++++++++ THANKS | 1 + m4/cond.m4 | 6 +++--- tests/condd.test | 8 ++++++-- tests/pr220.test | 23 +++++++++++------------ 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index bab7bafc..de8f2cc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-05-17 Alexandre Duret-Lutz + + * m4/cond.m4 (AM_CONDITIONAL): Double-quote diagnostic. + * tests/condd.test: Define a macro with the same name as a + conditional. + * tests/pr220.test: Modernize, and make sure the diagnostics + contains the macro name. + Report from Volker Boerchers. + 2004-05-16 Alexandre Duret-Lutz * lib/texinfo.tex: New upstream version. diff --git a/THANKS b/THANKS index f9053575..dd255897 100644 --- a/THANKS +++ b/THANKS @@ -252,6 +252,7 @@ Tom Epperly tepperly@llnl.gov Ulrich Drepper drepper@gnu.ai.mit.edu Václav Haisman V.Haisman@sh.cvut.cz Vadim Zeitlin Vadim.zeitlin@dptmaths.ens-cachan.fr +Volker Boerchers vboerchers@tecon.de Werner John john@oswf.de Werner Koch wk@isil.d.shuttle.de William S Fulton wsf@fultondesigns.co.uk diff --git a/m4/cond.m4 b/m4/cond.m4 index 5887388f..1394121e 100644 --- a/m4/cond.m4 +++ b/m4/cond.m4 @@ -1,6 +1,6 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. +# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,6 +37,6 @@ else fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]) + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) fi])]) diff --git a/tests/condd.test b/tests/condd.test index a05839ef..67318df3 100755 --- a/tests/condd.test +++ b/tests/condd.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -26,7 +26,10 @@ set -e cat >> configure.in << 'END' AC_PROG_CC -AM_CONDITIONAL(COND1, false) +dnl Define a macro with the same name as the conditional to exhibit +dnl any underquotted bug. +AC_DEFUN([COND1], ["some'meaningless;characters`]) +AM_CONDITIONAL([COND1], false) AC_CONFIG_FILES([foo/Makefile]) AC_CONFIG_FILES([bar/Makefile]) AC_OUTPUT @@ -65,6 +68,7 @@ mkdir foo bar $ACLOCAL $AUTOCONF +grep "meaningless;characters" configure && exit 1 $AUTOMAKE ./configure $MAKE test diff --git a/tests/pr220.test b/tests/pr220.test index 3384dd2b..2933a058 100755 --- a/tests/pr220.test +++ b/tests/pr220.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -23,6 +23,8 @@ required=gcc . ./defs || exit 1 +set -e + cat >main.c < configure.in << 'EOF' -AC_INIT(main.c) -AM_INIT_AUTOMAKE(test_am, 1.0) +cat >> configure.in << 'EOF' AC_PROG_CC AC_ARG_ENABLE(foo, [ --enable-foo Enable foo], @@ -48,18 +48,17 @@ AC_ARG_ENABLE(foo, AM_CONDITIONAL(NEVER_TRUE, false) fi ]) -AC_OUTPUT(Makefile) +AC_OUTPUT EOF -touch README NEWS AUTHORS ChangeLog - mkdir build -$ACLOCAL \ - && $AUTOCONF \ - && $AUTOMAKE -a || exit 1 +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a cd build # configure should fail since we've done something invalid. -../configure && exit 1 -exit 0 +../configure 2>stderr && exit 1 +cat stderr +grep NEVER_TRUE stderr -- 2.43.5