bug#16841: Bug#738716: automake: Generates syntax error in configure script

2014-12-19 Thread Stefano Lattarini

tags 16841 + patch
close 16841
thanks

On 02/22/2014 08:40 AM, Eric Dorland wrote:

* Hilko Bengen (ben...@debian.org) wrote:

Source: automake-1.14
Version: 1:1.14.1-2
Severity: critical
Tags: patch

While trying to build a new version of nbdkit, I fonud that a freshly
generated configure script contains a syntax error:

,
| $ curl -O http://libguestfs.org/download/nbdkit/nbdkit-1.1.4.tar.gz
| [...]
| $ tar xzf nbdkit-1.1.4.tar.gz
| $ cd nbdkit-1.1.4/
| $ autoreconf
| $ ./configure
| [...]
| checking for style of include used by make... GNU
| checking whether make supports nested variables... yes
| checking dependency style of gcc... gcc3
| ./configure: line 4820: syntax error near unexpected token `case'
| ./configure: line 4820: `fi case `pwd` in'
`

To me, this looks like a missing newline at the end of AM_INIT_AUTOMAKE
in /usr/share/aclocal-1.14/init.m4. At least the attached patch fixes
the problem for me.


It looks like the problem is the dnl on your AM_INIT_AUTOMAKE line:

AM_INIT_AUTOMAKE(foreign) dnl NB: Do not [quote] this parameter.

That's suppressing the natural new line that would be there. But I
think the patch is legitimate so forwarding it along.


--- /usr/share/aclocal-1.14/init.m4.orig2014-02-12 09:45:22.883382346 
+0100
+++ /usr/share/aclocal-1.14/init.m4 2014-02-12 09:45:40.758921507 +0100
@@ -164,7 +164,8 @@
  END
  AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
-fi])
+fi
+])

  dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
  dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further




Agreed, we shouldn't have broken backward-compatibility for no good reason
(and IIRC the removal of the trailing newline wasn't deliberated).  Fixed
with the attached patch.

Thanks,
  Stefano
From 69d9e8de6154916072900974d62f3b27ba9c664c Mon Sep 17 00:00:00 2001
Message-Id: 69d9e8de6154916072900974d62f3b27ba9c664c.1418988210.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Fri, 19 Dec 2014 11:44:12 +0100
Subject: [PATCH] AM_INIT_AUTOMAKE: make sure has a trailing newline after
 expansion

This used to be the case until Automke 1.13, but we broke it in
Automake 1.14 (see commit v1.13.1-71-gf78b0f0).  This caused
issues like http://debbugs.gnu.org/16841

* m4/init.m4 (AM_INIT_AUTOMAKE): Adjust.
* t/aminit-trailing-dnl-comment-pr16841.sh: New test.
* t/list-of-tests.mk: Add it.
* NEWS, THANKS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS |  9 +++
 THANKS   |  1 +
 m4/init.m4   |  6 -
 t/aminit-trailing-dnl-comment-pr16841.sh | 44 
 t/list-of-tests.mk   |  1 +
 5 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 t/aminit-trailing-dnl-comment-pr16841.sh

diff --git a/NEWS b/NEWS
index 614eba6..626d295 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,15 @@
 
 
 
+New in 1.14.2:
+
+* Bugs fixed:
+
+  - The expansion of AM_INIT_AUTOMAKE ends once again with a trailing
+newline (bug#16841). Regression introduced in Automake 1.14.
+
+
+
 New in 1.14.1:
 
 * Bugs fixed:
diff --git a/THANKS b/THANKS
index 7f84850..9ace719 100644
--- a/THANKS
+++ b/THANKS
@@ -152,6 +152,7 @@ Harlan Stennharlan.st...@pfcs.com
 He Li   tippa...@yahoo.com
 Henrik Frystyk Nielsen  frys...@w3.org
 Hib Erish...@hiberis.nl
+Hilko Bengenben...@debian.org
 Ian Lance Taylori...@cygnus.com
 Ignacy Gawedzki i...@lri.fr
 Илья Н. Голубев g...@mo.msk.ru
diff --git a/m4/init.m4 b/m4/init.m4
index 432ff20..d8350fe 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -164,7 +164,11 @@ to yes, and re-run configure.
 END
 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
diff --git a/t/aminit-trailing-dnl-comment-pr16841.sh b/t/aminit-trailing-dnl-comment-pr16841.sh
new file mode 100644
index 000..0f47f16
--- /dev/null
+++ b/t/aminit-trailing-dnl-comment-pr16841.sh
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2014 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
+# the Free Software Foundation; either version 2, or (at your 

bug#16841: Bug#738716: automake: Generates syntax error in configure script

2014-02-21 Thread Eric Dorland
* Hilko Bengen (ben...@debian.org) wrote:
 Source: automake-1.14
 Version: 1:1.14.1-2
 Severity: critical
 Tags: patch
 
 While trying to build a new version of nbdkit, I fonud that a freshly
 generated configure script contains a syntax error:
 
 ,
 | $ curl -O http://libguestfs.org/download/nbdkit/nbdkit-1.1.4.tar.gz
 | [...]
 | $ tar xzf nbdkit-1.1.4.tar.gz 
 | $ cd nbdkit-1.1.4/
 | $ autoreconf
 | $ ./configure
 | [...]
 | checking for style of include used by make... GNU
 | checking whether make supports nested variables... yes
 | checking dependency style of gcc... gcc3
 | ./configure: line 4820: syntax error near unexpected token `case'
 | ./configure: line 4820: `fi case `pwd` in'
 `
 
 To me, this looks like a missing newline at the end of AM_INIT_AUTOMAKE
 in /usr/share/aclocal-1.14/init.m4. At least the attached patch fixes
 the problem for me.

It looks like the problem is the dnl on your AM_INIT_AUTOMAKE line: 

AM_INIT_AUTOMAKE(foreign) dnl NB: Do not [quote] this parameter.

That's suppressing the natural new line that would be there. But I
think the patch is legitimate so forwarding it along.

 --- /usr/share/aclocal-1.14/init.m4.orig2014-02-12 09:45:22.883382346 
 +0100
 +++ /usr/share/aclocal-1.14/init.m4 2014-02-12 09:45:40.758921507 +0100
 @@ -164,7 +164,8 @@
  END
  AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
 -fi])
 +fi
 +])
  
  dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
  dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further


-- 
Eric Dorland e...@kuroneko.ca
ICQ: #61138586, Jabber: ho...@jabber.com



signature.asc
Description: Digital signature