Index: acinclude.m4
===================================================================
RCS file: /cvsroot/curl/curl/acinclude.m4,v
retrieving revision 1.136
diff -u -r1.136 acinclude.m4
--- acinclude.m4	24 Oct 2007 16:40:59 -0000	1.136
+++ acinclude.m4	10 Dec 2007 20:09:25 -0000
@@ -788,6 +788,7 @@
           [type to use in place of socklen_t if not defined])
         ;;
     esac
+    AC_SUBST(CURL_SOCKLEN_T, $curl_cv_socklen_t_equiv)
   ],[
 #undef inline
 #ifdef HAVE_WINDOWS_H
@@ -810,6 +811,7 @@
 #endif
 #endif
   ])
+  AM_CONDITIONAL(USE_CURL_SOCKLEN_T, test x$ac_cv_type_socklen_t != xyes)
 ])
 
 
Index: include/curl/Makefile.am
===================================================================
RCS file: /cvsroot/curl/curl/include/curl/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- include/curl/Makefile.am	25 Mar 2004 11:34:35 -0000	1.4
+++ include/curl/Makefile.am	10 Dec 2007 20:09:25 -0000
@@ -3,3 +3,18 @@
 pkgincludedir= $(includedir)/curl
 
 CLEANFILES = *dist
+
+CURLTYPES=types.h
+
+if USE_CURL_SOCKLEN_T
+$(CURLTYPES):
+	echo '/* socklen_t replacement */'         > $(CURLTYPES)
+	echo '#ifndef HAVE_SOCKLEN_T'             >> $(CURLTYPES)
+	echo '#define socklen_t @CURL_SOCKLEN_T@' >> $(CURLTYPES)
+	echo '#define HAVE_SOCKLEN_T'             >> $(CURLTYPES)
+	echo '#endif'                             >> $(CURLTYPES)
+else
+$(CURLTYPES):
+	echo '/* socklen_t natively supported */'  > $(CURLTYPES)
+endif
+
