autoconf
[Top][All Lists]
Advanced

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

Re: trouble adding new macros to my configure.ac


From: Alberto Luaces
Subject: Re: trouble adding new macros to my configure.ac
Date: Wed, 22 Apr 2009 11:58:28 +0200
User-agent: KMail/1.9.9

El Miércoles 22 Abril 2009ES 10:52:05 Nina Nordstrom escribió:
> Hello,
> I have an autoconf problem I am trying to solve: Basically I need to add
> new macros and use them in configure.ac... specifically, I would like to
> add a macro called AX_GCC_ARCHFLAG found in the autoconf macro archive
> somewhere in my package and then it in my configure.ac
>
> Problem is, how do I do that? I tried to add this macro (and the
> prerequisites) inside aclocal.m4, but it seems aclocal.m4 gets
> autogenerated by aclocal whenever autoconf makes the configure script.
>
> Is there a way to keep the macro in a separate file (eg ax_gcc_archflag) in
> the same directory as configure.ac and tell that to configure.ac?
>
> Sorry if this is a "newbie" question, I could not find this info in all my
> reading and googling..

Hi Nina,

I'm also a newbie too, but I found it very well explained on the Autotools 
tutorial written by Alexandre Duret-Lutz 
(http://www.lrde.epita.fr/~adl/autotools.html):

* Create a m4/ subdirectory.
* Put your macros there.
(The extension must be *.m4 )
* Add ACLOCAL AMFLAGS = -I m4 to the top-level Makefile.am.
* Add AC CONFIG MACRO DIR([m4]) to configure.ac. (This is not
strictly needed yet, but let’s be future-proof.)
* Use your macros in configure.ac.
* The ACLOCAL AMFLAGS are used by ‘autoreconf’ and by the Makefile
rebuild rule when they need to run ‘aclocal’.
* Local macros that are used are automatically distributed. (Those that are
not used are simply ignored.)

Alberto




reply via email to

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