configure.ac: Look in the right place for `socklen_t'.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 11 Jul 2016 08:47:12 +0000 (09:47 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 11 Jul 2016 08:47:12 +0000 (09:47 +0100)
The old-fashioned version of `AC_CHECK_TYPE' doesn't look in
<sys/socket.h>, which is the proper place.  Android doesn't appear to
define the type in the usual places where Autoconf looks.

So use the modern version of the check and look in <sys/socket.h>
explicitly.  This seems to fix the build on Android.

configure.ac

index 1f0ada8..9ff83ba 100644 (file)
@@ -62,7 +62,12 @@ dnl Functions.
 AC_CHECK_FUNCS([snprintf])
 
 dnl Types.
-AC_CHECK_TYPE([socklen_t], [int])
+AC_CHECK_TYPE([socklen_t], [],
+  [AC_DEFINE([socklen_t], [int],
+     [Define to `int' if <sys/socket.h> does not define])],
+  [AC_INCLUDES_DEFAULT
+#include <sys/socket.h>
+])
 
 dnl Which version of struct msghdr do we have?
 AC_CHECK_MEMBERS([struct msgdr.msg_control],,, [