bug-autoconf
[Top][All Lists]
Advanced

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

Re: Bug: "possibly undefined macro: AC_MSG_ERROR"


From: Ralf Wildenhues
Subject: Re: Bug: "possibly undefined macro: AC_MSG_ERROR"
Date: Tue, 4 Mar 2008 08:16:32 +0100
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* Hans Aberg wrote on Tue, Mar 04, 2008 at 12:51:07AM CET:
> On 3 Mar 2008, at 23:29, Axel Simon wrote:
>>
>> You could join the 'Could not find...' line with the previous line and 
>> see if the error goes away. The indentation and quoting is identical to 
>> other macros that are distributed with autoconf/automake.
>
> If I do that, I get a whole host of new errors, and the first is  
> AM_INIT_AUTOMAKE. SO I installet latest automake to be sure, from 1.10 to 
> 1.10.1. Still, same error.
>
> But two autoconf in a row (on a new darcs download) works.

No, it doesn't.  You need to run aclocal before running autoconf.
If you don't do that, autoconf will not see the macro definitions for
AM_INIT_AUTOMAKE, AM_CONDITIONAL, GTKHS_PROG_CHECK_VERSION, ...

The fact that autoconf doesn't warn the second time is due to caching
(it doesn't even run the autom4te program the second time, which is the
one that is warning).

The real problem here is that the warning messages are confusing/wrong:
For example, this warning:

> configure.ac:101: error: possibly undefined macro: AC_MSG_ERROR

is triggered because of this code:

GTKHS_PROG_CHECK_VERSION($GHC_VERSION, -lt, 6.4, [
  AC_MSG_ERROR([Gtk2Hs requires GHC 6.4 or later])])

which is in line 113, and which is not expanded correctly unless a macro
definition of GTKHS_PROG_CHECK_VERSION exists.  The problem is that
autom4te does not track output file lines matching input file lines, and
thus only warns about the first instance found in the input file.

Not sure if line tracking can be implemented easily and efficiently.

As a workaround, you should consider adding
  m4_pattern_forbid([^GTKHS_])

early in the configure.ac script, which will at least add the right
warnings as well.

Cheers,
Ralf




reply via email to

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