summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-05-10 07:40:20 +0000
committerAndrew Tridgell <tridge@samba.org>1998-05-10 07:40:20 +0000
commit7d29d4ba13620ef50c0db6d08508dc41156a3ed7 (patch)
treecf56156e7d5a1eaa551e00c0188856dd721661f9
parent7a6421fa764dd0f609e2a5024ec8b3bc577575a1 (diff)
downloadrsync-7d29d4ba13620ef50c0db6d08508dc41156a3ed7.tar.gz
look for -lsocket by checking for connect()
-rw-r--r--acconfig.h1
-rw-r--r--configure.in31
2 files changed, 32 insertions, 0 deletions
diff --git a/acconfig.h b/acconfig.h
index 9fbb13d8..c923a624 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -6,3 +6,4 @@
#undef HAVE_UNSIGNED_CHAR
#undef HAVE_UTIMBUF
#undef ino_t
+#undef HAVE_CONNECT
diff --git a/configure.in b/configure.in
index 7755272a..478ff1aa 100644
--- a/configure.in
+++ b/configure.in
@@ -85,4 +85,35 @@ AC_TRY_COMPILE([#include <sys/types.h>
echo yes;AC_DEFINE(HAVE_UTIMBUF),
echo no)
+# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
+# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
+# libsocket.so which has a bad implementation of gethostbyname (it
+# only looks in /etc/hosts), so we only look for -lsocket if we need
+# it.
+AC_CHECK_FUNC(connect, :,
+[case "$LIBS" in
+*-lnsl*) ;;
+*) AC_CHECK_LIB(nsl_s, printf) ;;
+esac
+case "$LIBS" in
+*-lnsl*) ;;
+*) AC_CHECK_LIB(nsl, printf) ;;
+esac
+case "$LIBS" in
+*-lsocket*) ;;
+*) AC_CHECK_LIB(socket, connect) ;;
+esac
+case "$LIBS" in
+*-linet*) ;;
+*) AC_CHECK_LIB(inet, connect) ;;
+esac
+dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
+dnl has been cached.
+if test "$ac_cv_lib_socket_connect" = "yes" || test "$ac_cv_lib_inet_connect" =
+"yes"; then
+ ac_cv_func_connect=yes
+ AC_DEFINE(HAVE_CONNECT)
+fi])
+
+
AC_OUTPUT(Makefile lib/dummy)