autoconf
[Top][All Lists]
Advanced

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

Re: m4 macro that would call AAC_INIT


From: Eric Blake
Subject: Re: m4 macro that would call AAC_INIT
Date: Wed, 15 Sep 2010 10:32:33 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.3

On 09/15/2010 10:07 AM, Eric Blake wrote:
On 09/15/2010 10:01 AM, Vincent Torri wrote:

AC_DEFUN([EFL_INIT],
[

Well, i already tried to do that, with always the same message:

configure.ac:3: error: m4_defn: undefined macro: _m4_divert_diversion
configure.ac:3: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: autom4te failed with exit status: 1

A-ha. Thanks for that additional information. The problem is that any
macro defined via AC_DEFUN includes a prologue that _requires_ that
AC_INIT has already been called.

If you s/AC_DEFUN/m4_define/ in your my_init.m4 file, that should make
the difference. The whole point of AC_DEFUN is that it allows macro
dependency tracing, via things like AC_REQUIRE, but since you don't need
to do any dependencies on EFL_INIT (that is, no one should be doing
AC_REQUIRE([EFL_INIT]), it's overkill to use that. So, by using a
plain-and-simple m4_define'd macro instead of an overboard AC_DEFUN'd
macro, I think you can get further.

But note that automake's aclocal magic only works on AC_DEFUN'd macros, not m4_define'd ones. To make automake still recognize my_init.m4, you'll need at least one other AC_DEFUN'd macro in that file that gets invoked along some path in configure.ac. For example, see how http://git.savannah.gnu.org/cgit/gnulib.git/tree/m4/00gnulib.m4 has a dummy define gl_00GNULIB, which gnulib-tool then AC_REQUIRE's during gl_INIT.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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