git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Jakub NarebskiNext: Ralf Wildenhues
Message 25 of 30 in “enhancing builds on Solaris”
  1. 0/8 enhancing builds on SolarisBrandon Casey, Jun 5, 2009
  2. 1/8 Makefile: use /usr/ucb/install on SunOS platforms rather than ginstallBrandon Casey, Jun 5, 2009
  3. 2/8 Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile argumentsBrandon Casey, Jun 5, 2009
  4. 3/8 diff-delta.c: "diff.h" is not a required includeBrandon Casey, Jun 5, 2009
  5. 4/8 On Solaris choose the OLD_ICONV iconv() declaration based on the UNIX specBrandon Casey, Jun 5, 2009
  6. 5/8 git-compat-util.h: tweak the way _XOPEN_SOURCE is set on SolarisBrandon Casey, Jun 5, 2009
  7. 6/8 Makefile: define __sun__ on SunOSBrandon Casey, Jun 5, 2009
  8. 7/8 Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATHBrandon Casey, Jun 5, 2009
  9. 8/8 Makefile: add section for SunOS 5.7Brandon Casey, Jun 5, 2009
  10. Jeff KingJun 8, 2009
  11. Brandon CaseyJun 8, 2009
  12. Jeff KingJun 8, 2009
  13. Brandon CaseyJun 8, 2009
  14. Junio C HamanoJun 8, 2009
  15. Jeff KingJun 8, 2009
  16. Brandon CaseyJun 8, 2009
  17. Brandon CaseyJun 9, 2009
  18. 3/8 diff-delta.c: "delta.h" is not a required includeBrandon Casey, Jun 6, 2009
  19. Nicolas PitreJun 6, 2009
  20. Brandon CaseyJun 6, 2009
  21. Nicolas PitreJun 6, 2009
  22. Brandon CaseyJun 6, 2009
  23. git-compat-util.h: avoid using c99 flex array feature with Sun compiler 5.8Brandon Casey, Jun 8, 2009
  24. Jakub NarebskiJun 6, 2009
  25. Brandon CaseyJun 7, 2009
  26. configure: test whether -lresolv is neededRalf Wildenhues, Jun 7, 2009
  27. Brandon CaseyJun 5, 2009
  28. Junio C HamanoJun 6, 2009
  29. Brandon CaseyJun 6, 2009
  30. Jeff KingJun 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.