Commit a009b5e2 authored by Sam Rushing's avatar Sam Rushing

openssl support

parent fceed6bc
...@@ -47,6 +47,45 @@ def check_lio(): ...@@ -47,6 +47,45 @@ def check_lio():
status = os.system('test/build/test_lio') status = os.system('test/build/test_lio')
return exit_ok(status) return exit_ok(status)
#--------------------------------------------------------------------------------
# OpenSSL support
#--------------------------------------------------------------------------------
import os
import sys
# If you need NPN support (for SPDY), you most likely will have to link against
# newer openssl than the one that came with your OS. (this is circa 2012).
# 1) change the value of ossl_base below.
# 2) change the value of either 'libraries' or 'extra_link_args' depending on
# your platform.
# For OS X: use 'manual static link'
# statically link is a bit tricky
# Note: be sure to remove coro/openssl.c if you change this, see NPN probe below.
ossl_base = '/Users/rushing/src/openssl-1.0.1c'
#ossl_base = '/usr/'
def O (path):
return os.path.join (ossl_base, path)
# cheap probe for npn support
USE_NPN = (open (O('include/openssl/ssl.h')).read().find ('next_protos') != -1)
OpenSSL_Extension = Extension (
'coro.ssl.openssl',
['coro/ssl/openssl.pyx'],
depends=['coro/ssl/openssl.pxi'],
# manual static link
extra_link_args = [ O('libcrypto.a'), O('libssl.a') ],
# link to an absolute location
#extra_link_args = [ '-L %s -lcrypto -lssl' % (ossl_base,) ]
# 'normal' link
#libraries = ['crypto', 'ssl'],
include_dirs = [ O('include') ],
cython_compile_time_env = {'NPN' : USE_NPN},
)
#--------------------------------------------------------------------------------
setup ( setup (
name='coro', name='coro',
version='1.0.2-000', version='1.0.2-000',
...@@ -115,10 +154,12 @@ setup ( ...@@ -115,10 +154,12 @@ setup (
os.path.join(include_dir, 'include'), os.path.join(include_dir, 'include'),
], ],
), ),
# the pre-computed openssl extension from above
OpenSSL_Extension,
], ],
packages=['coro', 'coro.clocks', 'coro.http', 'coro.dns', 'coro.emulation'], packages=['coro', 'coro.clocks', 'coro.http', 'coro.dns', 'coro.emulation', 'coro.asn1', 'coro.ssl'],
package_dir = { package_dir = {
# '': 'coroutine', #'': 'coroutine',
'coro': 'coro', 'coro': 'coro',
'coro.clocks': 'coro/clocks', 'coro.clocks': 'coro/clocks',
'coro.dns': 'coro/dns', 'coro.dns': 'coro/dns',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment