aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-03-09 15:38:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-03-09 15:38:59 +0000
commit11693c0faa69701f8966ca6c7f328eb7a51cb7d5 (patch)
tree3c6149e28243502f21e715a8358ef0cdf6cac3b0
parent26cd8eda4a2180a61fbd914228a2950f2659ba7f (diff)
the socklen_t check is more involved now, but works on linux at least
-rw-r--r--configure.in23
1 files changed, 21 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 805a0bcd5..6451473a6 100644
--- a/configure.in
+++ b/configure.in
@@ -693,8 +693,27 @@ AC_CHECK_SIZEOF(long long, 4)
# check for ssize_t
AC_CHECK_TYPE(ssize_t, int)
-# check for socklen_t (getsockname() wants that)
-AC_CHECK_TYPE(socklen_t, int)
+dnl
+dnl We can't just AC_CHECK_TYPE() for socklen_t since it doesn't appear
+dnl in the standard headers. We egrep for it in the socket headers and
+dnl if it is used there we assume we have the type defined, otherwise
+dnl we search for it with AC_CHECK_TYPE() the "normal" way
+dnl
+
+if test "$ac_cv_header_sys_socket_h" = "yes"; then
+ AC_MSG_CHECKING(for socklen_t in sys/socket.h)
+ AC_EGREP_HEADER(socklen_t,
+ sys/socket.h,
+ socklen_t=yes
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+fi
+
+if test "$socklen_t" != "yes"; then
+ # check for socklen_t the standard way if it wasn't found before
+ AC_CHECK_TYPE(socklen_t, int)
+fi
+
dnl Get system canonical name
AC_CANONICAL_HOST