apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r757593 - in /apr/apr/trunk/build: aprconf.py aprenv.py
Date Mon, 23 Mar 2009 23:31:23 GMT
Author: pquerna
Date: Mon Mar 23 23:31:23 2009
New Revision: 757593

URL: http://svn.apache.org/viewvc?rev=757593&view=rev
Log:
Improve SCTP test.

Modified:
    apr/apr/trunk/build/aprconf.py
    apr/apr/trunk/build/aprenv.py

Modified: apr/apr/trunk/build/aprconf.py
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/aprconf.py?rev=757593&r1=757592&r2=757593&view=diff
==============================================================================
--- apr/apr/trunk/build/aprconf.py (original)
+++ apr/apr/trunk/build/aprconf.py Mon Mar 23 23:31:23 2009
@@ -396,6 +396,28 @@
         context.Result(result)
         return result
 
+    def Check_apr_sctp(self, context):
+        context.Message('Checking for sctp support... ')
+        source = """
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_uio.h>
+#include <stdlib.h>
+int main(void) {
+    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);
+}
+"""
+        result = context.TryRun(source, '.c') 
+        context.Result(result[0] == 1)
+        return result[0] == 1
+
     def CheckFile(self, filename):
         return os.path.exists(filename)
 

Modified: apr/apr/trunk/build/aprenv.py
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/aprenv.py?rev=757593&r1=757592&r2=757593&view=diff
==============================================================================
--- apr/apr/trunk/build/aprenv.py (original)
+++ apr/apr/trunk/build/aprenv.py Mon Mar 23 23:31:23 2009
@@ -542,7 +542,8 @@
     else:
         subst['@have_ipv6@'] = 0
 
-    if conf.CheckDeclaration('IPPROTO_SCTP', '#include <netinet/in.h>'):
+    if conf.CheckDeclaration('IPPROTO_SCTP', '#include <netinet/in.h>') and \
+        self.Check_apr_sctp():
         subst['@have_sctp@'] = 1
     else:
         subst['@have_sctp@'] = 0



Mime
View raw message