aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>2009-06-07 07:40:29 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-10 00:08:07 -0700
commit8fccb009fa539080a6c4fb18204dfea0be434433 (patch)
tree3105db3376bda164d7f7a30847cccf08af80a06a
parent61dbb3c4415169194d9351cc4b68dd88788a93c5 (diff)
downloadgit-8fccb009fa539080a6c4fb18204dfea0be434433.tar.gz
git-8fccb009fa539080a6c4fb18204dfea0be434433.tar.xz
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 <Ralf.Wildenhues@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--config.mak.in1
-rw-r--r--configure.ac9
2 files changed, 10 insertions, 0 deletions
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])