apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject detecting SCTP protocol support
Date Tue, 22 Oct 2002 03:03:37 GMT
Does this work everywhere?  It ensures that we can actually get a
socket with protocol IPPROTO_SCTP when determining the value of
APR_HAVE_SCTP.

Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.491
diff -u -r1.491 configure.in
--- configure.in	18 Oct 2002 15:00:35 -0000	1.491
+++ configure.in	22 Oct 2002 02:40:13 -0000
@@ -930,6 +930,8 @@
     kernel/OS.h		\
     net/errno.h		\
     netinet/in.h	\
+    netinet/sctp.h      \
+    netinet/sctp_uio.h  \
     sys/file.h		\
     sys/mman.h		\
     sys/poll.h		\
@@ -977,6 +979,8 @@
 AC_SUBST(netdbh)
 AC_SUBST(sys_syslimitsh)
 AC_SUBST(netinet_inh)
+AC_SUBST(netinet_sctph)
+AC_SUBST(netinet_sctp_uioh)
 AC_SUBST(netinet_tcph)
 AC_SUBST(stdargh)
 AC_SUBST(stdioh)
@@ -1723,9 +1727,12 @@
     acceptfilter="0"
 fi
 
+APR_CHECK_SCTP
+
 AC_SUBST(apr_tcp_nopush_flag)
 AC_SUBST(have_corkable_tcp)
 AC_SUBST(acceptfilter)
+AC_SUBST(have_sctp)
 
 AC_CHECK_FUNCS(set_h_errno)
 APR_CHECK_RESOLV_RETRANS
Index: build/apr_network.m4
===================================================================
RCS file: /home/cvs/apr/build/apr_network.m4,v
retrieving revision 1.18
diff -u -r1.18 apr_network.m4
--- build/apr_network.m4	30 Apr 2002 10:57:40 -0000	1.18
+++ build/apr_network.m4	22 Oct 2002 02:40:14 -0000
@@ -659,6 +659,44 @@
 
 
 dnl
+dnl APR_CHECK_SCTP
+dnl
+dnl check for presence of SCTP protocol support
+dnl
+AC_DEFUN(APR_CHECK_SCTP,[
+  AC_CACHE_CHECK(if SCTP protocol is supported, ac_cv_sctp,[
+  AC_TRY_RUN( [
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+int main(void) {
+    int s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
+    if (s < 0) {
+        exit(1);
+    }
+    exit(0);
+}
+],[
+    ac_cv_sctp="yes"
+],[
+    ac_cv_sctp="no"
+],[
+    ac_cv_sctp="yes"
+])])
+if test "$ac_cv_sctp" = "yes"; then
+    have_sctp=1
+else
+    have_sctp=0
+fi
+])
+
+dnl
 dnl APR_CHECK_H_ERRNO_FLAG
 dnl
 dnl checks which flags are necessary for <netdb.h> to define h_errno
Index: include/apr.h.in
===================================================================
RCS file: /home/cvs/apr/include/apr.h.in,v
retrieving revision 1.115
diff -u -r1.115 apr.h.in
--- include/apr.h.in	3 Aug 2002 20:29:54 -0000	1.115
+++ include/apr.h.in	22 Oct 2002 02:40:14 -0000
@@ -43,6 +43,8 @@
 #define APR_HAVE_LIMITS_H        @limitsh@
 #define APR_HAVE_NETDB_H         @netdbh@
 #define APR_HAVE_NETINET_IN_H    @netinet_inh@
+#define APR_HAVE_NETINET_SCTP_H  @netinet_sctph@
+#define APR_HAVE_NETINET_SCTP_UIO_H @netinet_sctp_uioh@
 #define APR_HAVE_NETINET_TCP_H   @netinet_tcph@
 #define APR_HAVE_PTHREAD_H       @pthreadh@
 #define APR_HAVE_SEMAPHORE_H     @semaphoreh@
@@ -117,6 +119,7 @@
 #define APR_HAVE_MEMCHR         @have_memchr@
 #define APR_HAVE_STRUCT_RLIMIT  @struct_rlimit@
 #define APR_HAVE_UNION_SEMUN    @have_union_semun@
+#define APR_HAVE_SCTP           @have_sctp@
 
 #if APR_HAVE_SYS_TYPES_H
 #include <sys/types.h>

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Mime
View raw message