autoconf
[Top][All Lists]
Advanced

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

Re: AM_COND_IF with m4_foreach+m4_include


From: Dave Goodell
Subject: Re: AM_COND_IF with m4_foreach+m4_include
Date: Thu, 10 Feb 2011 15:53:24 -0600

On Feb 10, 2011, at 3:27 PM CST, Ralf Wildenhues wrote:

> * Dave Goodell wrote on Thu, Feb 10, 2011 at 10:02:12PM CET:
> 
>> autoreconf: running: /Users/goodell/prefix/bin/autoconf --force
>> configure.in:8: error: possibly undefined macro: AM_COND_IF
>>      If this token and others are legitimate, please use m4_pattern_allow.
>>      See the Autoconf documentation.
>> autoreconf: /Users/goodell/prefix/bin/autoconf failed with exit status: 1
> 
> Yep.  This is a limitation in aclocal.  You know, aclocal is a bit dumb
> sometimes.  It doesn't understand that subconfigure.m4 is included by
> your configure.ac, thus doesn't see that AM_COND_IF might be needed,
> thus doesn't copy the definition of that macro into aclocal.m4.  Then
> later, autoconf will protest about the unknown macro as you saw.
> 
> aclocal currently uses a regex to match m4_include lines against
> configure.ac lines.  That of course fails when the argument to
> m4_include contains a macro itself (subsys_i in your case).

This makes perfect sense, and explains why AC_PROG_GREP works but AM_COND_IF 
doesn't.  Thanks for the explanation (thanks to Eric too, who basically said 
the same thing).

> The Right Fix[tm] would probably be to let aclocal use m4 tracing (or
> ditch aclocal).  Not sure if that could be done safely, when macro
> definitions are missing however.

Yeah, that sound like an unnecessary pain at this point.

> A workaround is to add a dummy use of AM_COND_IF somewhere in your
> configure.ac, so that it is pulled in by aclocal.

That would work, although I'll need to do something similar for any other 
macros that are managed by aclocal and used in the subconfigure.m4 fragments, 
which sounds fragile enough that I'll just avoid it.  Rather than attempting to 
construct the inclusions via m4 looping, I'll either:

A) generate a sequence of m4_includes at autogen.sh-time and shove them in a 
single file that will get included, or

B) just write out all of the included m4 filenames explicitly so that aclocal 
doesn't get confused.

-Dave


reply via email to

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