Re: static library as fallback

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

 



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   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux