From: Ralf Wildenhues Date: Sun, 7 Jun 2009 05:40:29 +0000 (+0200) Subject: configure: test whether -lresolv is needed X-Git-Tag: v1.6.4-rc0~66^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8fccb009fa539080a6c4fb18204dfea0be434433;p=git.git configure: test whether -lresolv is needed Check if -lresolv is needed for hstrerror; set NEEDS_RESOLV accordingly, and substitute in config.mak.in. Signed-off-by: Ralf Wildenhues Signed-off-by: Junio C Hamano --- diff --git a/config.mak.in b/config.mak.in index 7cce0c12d..d0cd15581 100644 --- a/config.mak.in +++ b/config.mak.in @@ -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@ diff --git a/configure.ac b/configure.ac index 4e728bca3..0a37af74a 100644 --- a/configure.ac +++ b/configure.ac @@ -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])