automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AM_CONDITIONAL error


From: Alexandre Duret-Lutz
Subject: Re: AM_CONDITIONAL error
Date: Mon, 17 May 2004 22:19:02 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

>>> "Volker" == Volker Boerchers <address@hidden> writes:

 Volker> Hi,
 Volker> i experienced an error in witch AM_CONDITIONAL is involved. My
 Volker> configure.in contains the following lines
[...]
 Volker> AM_CONDITIONAL([SWIG_PYTHON], [test x$enable_swig_python = xyes])

 Volker> After updating my swig installation (www.swig.org) the
 Volker> following error occured (I'm using automake 1.5 and
 Volker> 1.7.6, autoconf 2.52 and 2.57):
[...]
 Volker> ./configure: line 2901: syntax error near unexpected token `"(c'
 Volker> ./configure: line 2901: `  echo $ECHO_N "(cached) $ECHO_C" >&6'
[...]
 Volker> It took a long time until I realized what went wrong: swig installs a
 Volker> m4 file that defines a macro 'SWIG_PYTHON' too. So actually the
 Volker> problem is not really an automake problem...

Thanks for the detailed report.  I'm installing the following
fix on HEAD and branch-1-8.

2004-05-17  Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.252
diff -u -r1.252 THANKS
--- THANKS      15 May 2004 21:01:03 -0000      1.252
+++ THANKS      17 May 2004 20:16:12 -0000
@@ -252,6 +252,7 @@
 Ulrich Drepper         address@hidden
 Václav Haisman         address@hidden
 Vadim Zeitlin          address@hidden
+Volker Boerchers       address@hidden
 Werner John            address@hidden
 Werner Koch            address@hidden
 William S Fulton       address@hidden
Index: m4/cond.m4
===================================================================
RCS file: /cvs/automake/automake/m4/cond.m4,v
retrieving revision 1.11
diff -u -r1.11 cond.m4
--- m4/cond.m4  24 Aug 2003 19:56:07 -0000      1.11
+++ m4/cond.m4  17 May 2004 20:16:19 -0000
@@ -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 @@
 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])])
Index: tests/condd.test
===================================================================
RCS file: /cvs/automake/automake/tests/condd.test,v
retrieving revision 1.5
diff -u -r1.5 condd.test
--- tests/condd.test    14 Nov 2003 21:25:58 -0000      1.5
+++ tests/condd.test    17 May 2004 20:16:19 -0000
@@ -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 @@
 
 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 @@
 
 $ACLOCAL
 $AUTOCONF
+grep "meaningless;characters" configure && exit 1
 $AUTOMAKE
 ./configure
 $MAKE test
Index: tests/pr220.test
===================================================================
RCS file: /cvs/automake/automake/tests/pr220.test,v
retrieving revision 1.6
diff -u -r1.6 pr220.test
--- tests/pr220.test    14 Nov 2003 21:25:59 -0000      1.6
+++ tests/pr220.test    17 May 2004 20:16:19 -0000
@@ -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 <<EOF
 int main() { return 0; }
 EOF
@@ -36,9 +38,7 @@
 main_SOURCES = main.c $(NEVER_DEFINED)
 EOF
 
-cat > 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 @@
     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

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]