bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib-tool.py: Fix crash when no ACLOCAL_AMFLAGS is found.


From: Collin Funk
Subject: Re: gnulib-tool.py: Fix crash when no ACLOCAL_AMFLAGS is found.
Date: Sun, 02 Jun 2024 05:51:44 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

Bruno Haible <bruno@clisp.org> writes:

>> > Thanks for this recipe. I think this is worth a unit test, since it
>> > is a special case that is otherwise not tested.
>> 
>> Agreed. I can add one later today.
>
> I added it already.

Thanks, I've applied the attached patch fixing that regular expression.

Also, Paul while investigating this I noticed some strange behavior. The
Autoconf documentation mentions the limit to a single line for
ACLOCAL_AMFLAGS. Perhaps it is worth changing this regexp [1] or
mentioning this in the documentation [2].

Here is a test case:

   $ gnulib-tool --create-testdir --dir testdir1 README-release
   $ cd testdir1
   $ sed -i -e 's/ACLOCAL_AMFLAGS = -I glm4/ACLOCAL_AMFLAGS = -I glm4 # 
--help/g' Makefile.am
   $ cat Makefile.am
     [...]
     ACLOCAL_AMFLAGS = -I glm4 # --help
   $ autoreconf
     Usage: aclocal [OPTION]...

     Generate 'aclocal.m4' by scanning 'configure.ac' or 'configure.in'
     [...]

If you remove aclocal.m4 and try to autoreconf the build will fail
because m4 macros cannot be found of course.

I don't know enough about Autotools to tell if anything silly can be
done using this trick. Not that you would run auto* in a project that
you don't trust anyways...

Collin

[1] 
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fCONFIG_005fMACRO_005fDIR-1
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/bin/autoreconf.in#n532

Attachment: 0001-gnulib-tool.py-Fix-regular-expression-regr.-today.patch
Description: Text Data


reply via email to

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