path: root/
diff options
authorGary V. Vaughan <>2010-05-14 09:31:40 (GMT)
committerJunio C Hamano <>2010-06-01 00:36:27 (GMT)
commit0a9b167ede027c09eca7aa2ea7522f058e153a13 (patch)
tree92669f4d61a2497dde256bbb12e1b062fbd1d84f /
parentfcf3a21acce45aa73001ee1d3ae119f653294def (diff)
Makefile: some platforms do not have hstrerror anywhere
This patch improves the logic of the test for hstrerror, not to blindly assume that if there is no hstrerror in libc that it must exist in libresolv. Signed-off-by: Gary V. Vaughan <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to '')
1 files changed, 14 insertions, 3 deletions
diff --git a/ b/
index d8aab9a..fbe5035 100644
--- a/
+++ b/
@@ -546,11 +546,22 @@ 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([c], [hstrerror],
+# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.
+AC_CHECK_LIB([c], [inet_ntop],
+# Define NO_HSTRERROR if linking with -lresolv is not enough.
+# Solaris 2.6 in particular has no hstrerror, even in -lresolv.
+ [],
+ [AC_CHECK_LIB([resolv], [hstrerror],
+ [NEEDS_RESOLV=YesPlease],
+ [NO_HSTRERROR=YesPlease])
test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"