Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 79827 invoked by uid 500); 22 Oct 2002 12:23:26 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 79812 invoked from network); 22 Oct 2002 12:23:25 -0000 Message-ID: <3DB5433D.6070401@stewart.chicago.il.us> Date: Tue, 22 Oct 2002 07:23:25 -0500 From: Randall Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0rc3) Gecko/20020922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Trawick CC: dev@apr.apache.org Subject: Re: detecting SCTP protocol support References: <3DAEB5AE.10603@stewart.chicago.il.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Jeff: Great solution.. it worked wonderfully on both my BSD's .. the have SCTP and the HAVE-NOT SCTP ;-) Much better than what I sent in.. thanks Jeff R Jeff Trawick wrote: > 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 > +#endif > +#ifdef HAVE_SYS_SOCKET_H > +#include > +#endif > +#ifdef HAVE_NETINET_IN_H > +#include > +#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 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 > -- Randall R. Stewart randall@stewart.chicago.il.us 815-342-5222 (cell phone)