autoconf
[Top][All Lists]
Advanced

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

Re: static library as fallback


From: Eric Blake
Subject: Re: static library as fallback
Date: Mon, 13 Jun 2011 17:43:34 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 06/13/2011 04:05 PM, Sergio Belkin wrote:
> I have the following sentence in a configure.ac:
> 
> AC_SEARCH_LIBS(ns_initparse,resolv)
> 
> The problem is ns_initparse is missing on old releases of libresolv.so
> eg: on Centos 5.
> 
> So I'd want to make static resolv as a fallback, Can I do it with
> AC_SEARCH_LIBS?

Of course, by using the action-if-not-found argument to declare a
witness preprocessor macro.  Something like this (untested, and adding
recommended m4 quoting):

AC_SEARCH_LIBS([ns_initparse], [resolv], [],
  [AC_DEFINE([MISSING_NS_INITPARSE], [1], [Define to 1 if ns_initparse
     is not available in any library])])

Then in your C code:

#if MISSING_NS_INITPARSE
// implement your static ns_initparse instead
#endif

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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