Re: [PATCH 2/8] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments
- From
Brandon Casey <drafnel@gmail.com>
- Date
- Jun 7, 2009, 01:02 UTC
- Message-ID
- <ee63ef30906061802m4153b9e6i1b289897f2f7f52a@mail.gmail.com>
- In-Reply-To
- <m3y6s54y8g.fsf@localhost.localdomain>
On Sat, Jun 6, 2009 at 2:29 AM, Jakub Narebski<jnareb@gmail.com> wrote:
Show 31 quoted lines
> Brandon Casey <casey@nrlssc.navy.mil> writes: > >> From: Brandon Casey <drafnel@gmail.com> >> >> This library is required on Solaris when compiling with NO_IPV6 since >> hstrerror resides in libresolv. Additionally, Solaris 7 will need it, >> since inet_ntop and inet_pton reside there too. >> >> Signed-off-by: Brandon Casey <drafnel@gmail.com> >> --- >> Makefile | 11 ++++++++++- >> 1 files changed, 10 insertions(+), 1 deletions(-) >> >> diff --git a/Makefile b/Makefile >> index baa05f5..40642f7 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -95,6 +95,10 @@ all:: >> # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, >> # Patrick Mauritz). >> # >> +# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough. >> +# Notably on Solaris hstrerror resides in libresolv and on Solaris 7 >> +# inet_ntop and inet_pton additionally reside there. >> +# >> # Define NO_MMAP if you want to avoid mmap. >> # >> # Define NO_PTHREADS if you do not have or do not want to use Pthreads. > > Could you please add this build configuration variable to configure.ac > and config.mak.in, to be able to autodetect this situation?
I'll take a look at it, but autoconf is not a strong suit of mine. Plus, I doubt I will actually be able to test anything on the platforms I have access to that need to set NEEDS_RESOLV, since any autoconf installation is likely to be very old.
> CC-ed Ralf Wildenhues and David Syzdek (who hopefully can produce > autoconf patch to squash with this one).
Yes please. :)
FYI: Solaris 7 needs -lresov since inet_ntop and inet_pton reside there. Additionally, since NO_IPV6 is set, hstrerror is called in connect.c and hstrerror also resides in libresolv.
On more modern Solaris, inet_ntop and inet_pton reside somewhere else, and since NO_IPV6 does not need to be set, -lresolv is not needed.
-brandon