autoconf
[Top][All Lists]
Advanced

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

Re: Automatic rebuilds, LIBS, and autoheader


From: Micah J. Cowan
Subject: Re: Automatic rebuilds, LIBS, and autoheader
Date: Fri, 9 Jun 2006 03:47:22 -0700
User-agent: Mutt/1.2.5.1i

I accidentally sent the following to Stepan only.

On Thu, Jun 08, 2006 at 09:01:38PM +0200, Stepan Kasal wrote:
> Hello,
> 
> On Tue, Jun 06, 2006 at 08:23:26PM -0700, Micah J. Cowan wrote:
> >   AC_CHECK_LIB(readline, readline,
> >         [AC_DEFINE(HAVE_LIBREADLINE, 1,
> >           [Define to 1 if you have the `readline' library (libreadline).])],
> >         [AC_MSG_WARN([Won't build pitchcalc])])
> 
> well, I wouldn't hesitate to use the above.
> 
> But if you don't like it, you can separate the declaration from
> AC_DEFINE, using AH_TEMPLATE:
> 
> AH_TEMPLATE([HAVE_LIBREADLINE], [Define to 1 if you have the
>       `readline' library (libreadline).]
> ...
> 
> Or you can use undocumented macro AH_CHECK_LIB:
> 
> AH_CHECK_LIB([readline])
> AH_CHECK_LIB([check])
> AH_CHECK_LIB([m])
> 
> Or, if you want to make in in one go for all three:
> 
> m4_foreach([A_LIB], [readline, check, m], [AH_CHECK_LIB(A_LIB)])

Thank you, this is /exactly/ what I needed.

I had looked at the source for AC_CHECK_LIB, but apparently I had glossed
over the first line of its code:

  m4_ifval([$3], , [AH_CHECK_LIB([$1])])dnl

...although, if I'm reading correctly, I'll need to still AC_DEFINE() in
/addition/ to AH_CHECK_LIB().

This probably warrants my own wrapper around both of those.

Thanks so much for your help!

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/




reply via email to

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