bug-autoconf
[Top][All Lists]
Advanced

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

Re: Autoconfig bug report


From: JohnT
Subject: Re: Autoconfig bug report
Date: Fri, 12 Oct 2007 14:51:21 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4

Eric Blake wrote:
> According to JohnT on 10/10/2007 6:21 PM:
>
> Please keep replies on the list, so that others may chime in.  Also, on
> lists, it is customary to reply following some context, rather than
> top-posting, so that others joining in late can follow what the thread is
> about; I've reformatted your message a bit accordingly.
Sorry, didn't realize it was a list. Also, I haven't done newsgroup-protocol
discussion for quite a while. Most of the people I correspond with usually
top-post in informal discussion.

>
> Also, I'm adding bug-gnupg, since it is a bug in their package.
>
> >> Sounds like there is some missing m4 quoting; more likely in your
> original
> >> configure.ac, but possibly in autoconf's replacement macro.  Can
> you give
> >> us a link to the configure.ac as it was before you tried to run
> autoupdate
> >> (or post it here)?  Can you figure out which macro was auto-updated
> into
> >> the expansion error?
>
>
> > The package I have worked with the most on this is
> libgpg-error-1.5.tar.bz2,
> > which is needed (v. 1.4+) to build gpg2. I think it's from Sourceforge.
> > The version of
> > M4 that I'm using is 1.4.3.
>
> That's a problem.  All versions of m4 earlier than 1.4.5 contain known
> bugs which are documented to interfere with autoconf (note, not
> "autoconfig") in combination with gettext operation.  Try upgrading m4
> first; the latest version is 1.4.10.  However, that is a side issue, and
> should not affect your original report.
Upgraded.

>
> > Gettext is version 14.5. I ran autoconfig
> > after autoupdate
> > to incur the problem I reported, but don't know anything about aclocal
> > or options
> > for autoconfig except what the --help output shows.
>
> Basically, I was asking if you have a line ACLOCAL_AMFLAGS in your
> Makefile.am?
Yes.
ACLOCAL_AMFLAGS = -I m4

>
> > Below are the diffs and the text of the original configure.ac file. I
> > found that versions
> > of autoupdate earlier than 2.59 either failed because of the version
> > requirement in the
> > original configure.ac or reported errors, after trying 2.55, 2.57 and
> > 2.58 as I recall.
>
> > John T
>
> > Here's the output of a diff command, which I've never used before.
> > address@hidden libgpg-error-1.5]$ diff --suppress-common-lines
> > configure.ac configure.ac.original
>
> It's MUCH nicer to use context diffs (diff -u or diff -c) for human use.
> The default diff output is designed primarily for machine use.  Also, when
> using diff, it is customary to list the original file first on the command
> line.
OK. I thought the removal of common lines would be the easiest way to
highlight the changes.
>
> > 22c22
> > < AC_PREREQ(2.61)
> > ---
> >> AC_PREREQ(2.59)
> > 33c33,34
> > <
> >
> AC_INIT([libgpg-error],[my_versionm4_if(my_issvn,yes,-svn[]svn_revision)],address@hidden)
> > ---
> >> AC_INIT([libgpg-error],
> > my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]),
> >>         address@hidden)
>
> Yep - underquoted.  The bug is in the libgpg-error configure.ac, and not
> in autoconf.
One might inquire how long this configure.ac file has had the flaw with
nobody bothering to run autoupdate on it. I started running autoupdate
regularly because a configure.ac or configure.in file for another
application
was reported to be in need of updating.


>
>
> > Original configure.ac file
> ...
> > # Remember to change the version number immediately *after* a release.
> > # Set my_issvn to "yes" for non-released code.  Remember to run an
> > # "svn up" and "autogen.sh" right before creating a distribution.
> > m4_define([my_version], [1.5])
> > m4_define([my_issvn], [no])
>
> > m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
> >             || echo 'Revision: 0')|sed -n '/^Revision:/
> > {s/[^0-9]//gp;q;}')]))
> > AC_INIT([libgpg-error],
> > my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]),
> >         address@hidden)
>
> What happens here is that AC_INIT is called with the expansion of the
> 'my_version' macro, concatenated with the expansion of the 'm4_if' macro,
> as its second argument.  This works for autoconf, even though it is
> underquoted; the [] in the middle separates the two macro names.  However,
> autoupdate is a lot stricter on quoting, because it works by using m4 to
> parse the literal arguments to AC_INIT without expansion, then replays
> exactly what it parsed.  Since the argument is underquoted, m4 sees the
> giant string 'my_versionm4_if' rather than 'my_version[]m4_if'.
>
> The fix should be as simple as properly quoting, per these rules[1]:
>
> AC_INIT([libgpg-error],
>         [my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
>         address@hidden)
>
> [1]
> http://www.gnu.org/software/autoconf/manual/html_node/Quotation-Rule-Of-Thumb.html#Quotation-Rule-Of-Thumb
>
I figured it was a simple syntax error someplace, but had no idea where.
I am
only a hobbyist and know almost nothing about Unix scripts, etc




reply via email to

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