help-shishi
[Top][All Lists]
Advanced

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

Re: Detection of <resolv.h> in BSD.


From: Mats Erik Andersson
Subject: Re: Detection of <resolv.h> in BSD.
Date: Wed, 22 Aug 2012 23:04:21 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

onsdag den 15 augusti 2012 klockan 12:44 skrev Mats Erik Andersson detta:
> onsdag den 15 augusti 2012 klockan 11:58 skrev Mats Erik Andersson detta:
> > fredag den 10 augusti 2012 klockan 09:47 skrev Simon Josefsson detta:
> > > Mats, could you please re-try whether -lresolv detection works on BSDs?
> > > I have changed it to use AC_LIB_HAVE_LINKFLAGS instead which should be
> > > more reliable and flexible.  What I'm uncertain about is: doesn't BSDs
> > > provide libresolv at all?
> > 
> > Answer, first installment for convenience:
> > 
> >   DragonflyBSD, FreeBSD, and OpenBSD
> > 
> >     * do not provide libresolv at all;
> 
> Second installment:
> 
> Suffice it to test FreeBSD:
> 
>   * res_query() is not detected.

The following patch is able to detect and link correctly on

  GNU/Linux, OpenSolaris, FreeBSD, and NetBSD

in order that res_query() be available to shishi_resolv().

There has been an error in thinking at the code of "lib/resolv.c":

   * The C source should have no business whatsoever to care
     for WITH_LIBRESOLV.

What it should do is instead

   * Build a rich, non-trivial shishi_resolv() if res_query()
     is defined, however it be so. I.e., build an interesting
     shishi_resolv() whenever WITH_RES_QUERY happens to be defined.

The patch achieves this goal by first investigation whether
res_query() happens to be available in libc. That failing it
proceeds to invoke AS_LIB_HAVE_LINKFLAGS as a means of detecting
libresolv. This last step has for a long time been implemented
as a contrived mechanism to claim the presence of res_query(),
so that outcome is backported as AC_DEFINE([WITH_RES_QUERY]).

Some details are needed, but the above is the essential message.

Best regards,

  Mats Erik Andersson

Attachment: 0001-Locate-res_query-and-libresolv.patch
Description: Text Data


reply via email to

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