diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/apr_network.m4 | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 58ae115d4..bc6ae0e17 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -633,8 +633,8 @@ 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( [ + AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [ + AC_TRY_RUN([ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif @@ -644,21 +644,17 @@ AC_DEFUN(APR_CHECK_SCTP,[ #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif +#include <stdlib.h> int main(void) { - int s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); - if (s < 0) { - exit(1); - } + int s, opt = 1; + if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)) < 0) + exit(1); + if (setsockopt(s, IPPROTO_SCTP, SCTP_NODELAY, &opt, sizeof(int)) < 0) + exit(2); exit(0); -} -],[ - ac_cv_sctp="yes" -],[ - ac_cv_sctp="no" -],[ - ac_cv_sctp="yes" -])]) -if test "$ac_cv_sctp" = "yes"; then +}], [apr_cv_sctp=yes], [apr_cv_sctp=no], [apr_cv_sctp=no])]) + +if test "$apr_cv_sctp" = "yes"; then have_sctp=1 else have_sctp=0 |