]> asedeno.scripts.mit.edu Git - git.git/blobdiff - configure.ac
Makefile: some platforms do not have hstrerror anywhere
[git.git] / configure.ac
index d8aab9a27706cfb9802af60bd3cd32f7142f0107..fbe5035c463e25b7c221ad115a8f8e8de409d1d5 100644 (file)
@@ -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],
 [NEEDS_RESOLV=],
 [NEEDS_RESOLV=YesPlease])
+#
+# Define NO_HSTRERROR if linking with -lresolv is not enough.
+# Solaris 2.6 in particular has no hstrerror, even in -lresolv.
+NO_HSTRERROR=
+AC_CHECK_FUNC([hstrerror],
+       [],
+    [AC_CHECK_LIB([resolv], [hstrerror],
+           [NEEDS_RESOLV=YesPlease],
+       [NO_HSTRERROR=YesPlease])
+])
+AC_SUBST(NO_HSTRERROR)
+
 AC_SUBST(NEEDS_RESOLV)
 test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"