Skip to content

Commit

Permalink
configure: test whether -lresolv is needed
Browse files Browse the repository at this point in the history
Check if -lresolv is needed for hstrerror; set NEEDS_RESOLV
accordingly, and substitute in config.mak.in.

Signed-off-by: Ralf Wildenhues <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Ralf Wildenhues authored and gitster committed Jun 10, 2009
1 parent 61dbb3c commit 8fccb00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.mak.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ NO_CURL=@NO_CURL@
NO_EXPAT=@NO_EXPAT@
NEEDS_LIBICONV=@NEEDS_LIBICONV@
NEEDS_SOCKET=@NEEDS_SOCKET@
NEEDS_RESOLV=@NEEDS_RESOLV@
NO_SYS_SELECT_H=@NO_SYS_SELECT_H@
NO_D_INO_IN_DIRENT=@NO_D_INO_IN_DIRENT@
NO_D_TYPE_IN_DIRENT=@NO_D_TYPE_IN_DIRENT@
Expand Down
9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,15 @@ AC_CHECK_LIB([c], [socket],
AC_SUBST(NEEDS_SOCKET)
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],
[NEEDS_RESOLV=],
[NEEDS_RESOLV=YesPlease])
AC_SUBST(NEEDS_RESOLV)
test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"

## Checks for header files.
AC_MSG_NOTICE([CHECKS for header files])
Expand Down

0 comments on commit 8fccb00

Please sign in to comment.