r15219: Look for gai_strerror in more places, so we don't conflict with the
authorAndrew Bartlett <abartlet@samba.org>
Mon, 24 Apr 2006 18:00:46 +0000 (18:00 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:04:19 +0000 (14:04 -0500)
system library.

This might help the build on proprietory unixes

Andrew Bartlett

source/heimdal_build/config.m4
source/heimdal_build/config.mk

index 92e38e42c25e70c7fa3b7d47b1cd19937128386e..4a3ad4d947408dfa5c0254064b73e5e44e52c8ee 100644 (file)
@@ -239,15 +239,25 @@ fi
 # only add gai_strerror if needed
 SMB_ENABLE(HEIMDAL_ROKEN_GAI_STRERROR, NO)
 AC_CHECK_FUNC(gai_strerror)
+
 if test t$ac_cv_func_gai_strerror != tyes; then
-    AC_SEARCH_LIBS_EXT(gai_strerror, [xnet], XNET_LIBS)
-    AC_CHECK_FUNC_EXT(gai_strerror, $XNET_LIBS)
-    if test t$ac_cv_func_ext_gai_strerror != tyes; then
-       SMB_ENABLE(HEIMDAL_ROKEN_GAI_STRERROR, YES)
+    AC_CHECK_LIB_EXT(nsl, GAI_LIBS, gai_strerror)
+    AC_CHECK_LIB_EXT(socket, GAI_LIBS, gai_strerror)
+    AC_CHECK_LIB_EXT(xnet, GAI_LIBS, gai_strerror)
+
+    dnl We can't just call AC_CHECK_FUNCS(gai_strerror) here, because the value
+    dnl has been cached.
+    if test x"$ac_cv_lib_ext_nsl_gai_strerror" = x"yes" ||
+       test x"$ac_cv_lib_ext_socket_gai_strerror" = x"yes" ||
+       test x"$ac_cv_lib_ext_xnet_gai_strerror" = x"yes"; then
+        AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror()])
+       SMB_EXT_LIB_ENABLE(GAI, YES)
     else
-       AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether gai_strerror() is available])
+       SMB_ENABLE(HEIMDAL_ROKEN_GAI_STRERROR, YES)
     fi
+
 else
     AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether gai_strerror() is available])
 fi
-SMB_EXT_LIB(XNET,[${XNET_LIBS}],[${XNET_CFLAGS}],[${XNET_CPPFLAGS}],[${XNET_LDFLAGS}])
+
+SMB_EXT_LIB(GAI,[${GAI_LIBS}],[${GAI_CFLAGS}],[${GAI_CPPFLAGS}],[${GAI_LDFLAGS}])
index 5a13fd488a3e3ddd67e5a0d13ee94e343212cf32..f38194ff27b8f151efdb25d81b0fafe544ec882a 100644 (file)
@@ -342,7 +342,7 @@ PUBLIC_DEPENDENCIES = \
                        HEIMDAL_ROKEN_ADDRINFO \
                        HEIMDAL_ROKEN_GAI_STRERROR \
                        HEIMDAL_ROKEN_INET_ATON \
-                       EXT_LIB_XNET
+                       EXT_LIB_GAI
 # End SUBSYSTEM HEIMDAL_ROKEN
 #######################