GNU bug report logs - #18075
AM_INIT_AUTOMAKE followed by comment

Previous Next

Package: automake;

Reported by: Scott Pakin <pakin <at> lanl.gov>

Date: Mon, 21 Jul 2014 23:11:01 UTC

Severity: normal

Tags: patch

Merged with 16841

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Scott Pakin <pakin <at> lanl.gov>
To: 18075 <at> debbugs.gnu.org
Subject: bug#18075: AM_INIT_AUTOMAKE followed by comment
Date: Mon, 21 Jul 2014 15:39:13 -0600
[Message part 1 (text/plain, inline)]
The definition of AM_INIT_AUTOMAKE does not end in a newline
character, which can cause tricky-to-track errors if the call is
followed by an M4 comment.  I believe this is new behavior because an
old set of Autotools configuration files that used to work failed when
I recently re-ran automake.

I'm running Ubuntu Trusty Tahr (14.04 LTS) with the following Automake
and Autoconf versions:

    $ automake --version | head -1
    automake (GNU automake) 1.14.1
    $ autoconf --version | head -1
    autoconf (GNU Autoconf) 2.69

I've attached a minimal reproducer, a configure.ac file with only the
following contents:

    AC_INIT([badness], [1.0], [pakin <at> lanl.gov], [badness])
    AM_INIT_AUTOMAKE([1.14])dnl This comment causes configure to break.
    AC_CONFIG_FILES([Makefile])
    AC_OUTPUT

Here's how to produce the error:

    $ touch Makefile.am
    $ aclocal
    $ automake --add-missing --foreign
    configure.ac:2: installing './install-sh'
    configure.ac:2: installing './missing'
    $ autoconf
    $ ./configure
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    ./configure: line 3493: syntax error: unexpected end of file

The error is caused by line 2313, which contains

    fiac_config_files="$ac_config_files Makefile"

instead of

    fi
    ac_config_files="$ac_config_files Makefile"

That is, bash is in fact complaining about a missing "fi".

Removing the comment from configure.ac or moving it onto a line of its
own works around the problem, but I think it would be nicer if init.m4
replaced the final "fi])" (right after the "Your 'rm' program is bad"
message) with

    fi
    ])

Hopefully, that'll save someone else the effort of associating an "end
of file" error with a comment appearing in the wrong place.

Thanks for your time,
-- Scott

[configure.ac (text/plain, attachment)]

This bug report was last modified 10 years and 153 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.