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: Hans Aberg
Subject: Re: Bug: "possibly undefined macro: AC_MSG_ERROR"
Date: Tue, 4 Mar 2008 10:09:43 +0100

On 4 Mar 2008, at 08:16, Ralf Wildenhues wrote:

But two autoconf in a row (on a new darcs download) works.

No, it doesn't.

Yes it does.

You need to run aclocal before running autoconf.

It id not work for me.

If you don't do that, autoconf will not see the macro definitions for
AM_INIT_AUTOMAKE, AM_CONDITIONAL, GTKHS_PROG_CHECK_VERSION, ...

I think autoconf runs aclocal, but running aclocal first did not work for me.

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).

Yes, sure.

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.

Yes, but in the altered version, configure.ac starts:
----
dnl with parts stolen from Manuel Chakravaty, Sven Panne and Micheal Weber
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public
dnl License as published by the Free Software Foundation; either
dnl version 2 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl Library General Public License for more details.
dnl
dnl You should have received a copy of the GNU Library General Public
dnl License along with this library (COPYING.LIB); if not, write to the Free dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

dnl ######################################################################
dnl Process this file with autoconf to produce a configure script.
dnl ######################################################################

AC_INIT([gtk2hs],[0.9.12.2])
AM_INIT_AUTOMAKE
....
----

with an error on AM_INIT_AUTOMAKE. How is that to be fixed.

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.

That would only be a bug workaround. WHat is the bug, and how is it fixed?

  Hans Aberg






reply via email to

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