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

Re: [PATCH] configure.ac: rework/fix the NEEDS_RESOLV and NEEDS_LIBGEN tests

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 21, 2009, 20:33 UTC
Message-ID
<7v3a8pdbdr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<N0R1rELOlDFDG8pOY2LYJHmWygM5WFD8q_fNZgfE1A2QOX1yg6OPCZW4RbX5i03hokq4Bx2zOjM@cipher.nrlssc.navy.mil>
Brandon Casey <casey@nrlssc.navy.mil> writes:
> Maybe this is the appropriate thing to do?
Thanks.

Instead of saying that "hstrerror not in -lc means we do have -lresolv and the function will be found there" blindly, we may want to have a nested check.

	AC_CHECK_LIB([c], [hstrerror], [NEEDS_RESOLV=],
       	    AC_CHECK_LIB([resolv], [hstrerror], [NEEDS_RESOLV=YesPlease]))

But we do not have any provision for the case where -lc does not have it and -lresolv does not have it either (or -lresolv does not exist) anyway, so we might as well go with your patch.

I take it that swapping [if-found][if-not-found] parameters is what the autoconf documentation warns against? That is, both -lc and -lresolv may have it but -lresolv one may be a specialized one you would not normally want.

Show 25 quoted lines
>  configure.ac |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 74d0af5..ba44cf2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -479,13 +479,13 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
>  # 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.
> -AC_CHECK_LIB([resolv], [hstrerror],
> +AC_CHECK_LIB([c], [hstrerror],
>  [NEEDS_RESOLV=],
>  [NEEDS_RESOLV=YesPlease])
>  AC_SUBST(NEEDS_RESOLV)
>  test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"
>  
> -AC_CHECK_LIB([gen], [basename],
> +AC_CHECK_LIB([c], [basename],
>  [NEEDS_LIBGEN=],
>  [NEEDS_LIBGEN=YesPlease])
>  AC_SUBST(NEEDS_LIBGEN)
> -- 
> 1.6.3.1.24.g152f4
Previous: Brandon CaseyNext: Brandon Casey
Message 21 of 32 in “[test failure] t4114 binary file becomes symlink”
  1. Nicolas SebrechtJul 18, 2009
  2. Jeff KingJul 18, 2009
  3. [test failure] Re: t4114 binary file becomes symlinkNicolas Sebrecht, Jul 18, 2009
  4. Jeff KingJul 18, 2009
  5. Junio C HamanoJul 18, 2009
  6. [test failure] Re: t4114 binary file becomes symlinkNicolas Sebrecht, Jul 18, 2009
  7. Linus TorvaldsJul 18, 2009
  8. Johannes SixtJul 18, 2009
  9. [test failure] Re: t4114 binary file becomes symlinkNicolas Sebrecht, Jul 18, 2009
  10. [test failure] Re: t4114 binary file becomes symlinkNicolas Sebrecht, Jul 18, 2009
  11. ./configure misdetects SNPRINTF_RETURNS_BOGUS (was: [test failure] t4114 binary file becomes symlink)Jakub Narebski, Jul 19, 2009
  12. configure: use AC_SEARCH_LIBS instead of AC_CHECK_LIBNicolas Sebrecht, Jul 19, 2009
  13. Re: configure: use AC_SEARCH_LIBS instead of AC_CHECK_LIBNicolas Sebrecht, Jul 19, 2009
  14. Junio C HamanoJul 19, 2009
  15. Eric BlakeJul 19, 2009
  16. Brandon CaseyJul 21, 2009
  17. Brandon CaseyJul 21, 2009
  18. Paolo BonziniJul 21, 2009
  19. Brandon CaseyJul 21, 2009
  20. configure.ac: rework/fix the NEEDS_RESOLV and NEEDS_LIBGEN testsBrandon Casey, Jul 21, 2009
  21. Junio C HamanoJul 21, 2009
  22. Brandon CaseyJul 22, 2009
  23. config.mak.in: continue fixing NEEDS_LIBGEN autoconfigure featureBrandon Casey, Jul 22, 2009
  24. Junio C HamanoJul 22, 2009
  25. Brandon CaseyJul 23, 2009
  26. Johannes SixtJul 18, 2009
  27. Jeff KingJul 18, 2009
  28. [test failure] Re: t4114 binary file becomes symlinkNicolas Sebrecht, Jul 18, 2009
  29. Johannes SixtJul 19, 2009
  30. Jeff KingJul 20, 2009
  31. Johannes SixtJul 20, 2009
  32. Linus TorvaldsJul 20, 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.