Alexander Afanasyev | 52c1c05 | 2014-09-04 16:13:14 -0700 | [diff] [blame] | 1 | Index: chronochat_0.5.0~rc0/wscript |
| 2 | =================================================================== |
| 3 | --- chronochat_0.5.0~rc0.orig/wscript 2014-09-04 15:48:47.727801874 -0700 |
| 4 | +++ chronochat_0.5.0~rc0/wscript 2014-09-04 15:48:51.000000000 -0700 |
| 5 | @@ -9,7 +9,7 @@ |
| 6 | |
| 7 | opt.load(['compiler_c', 'compiler_cxx', 'qt4', 'gnu_dirs']) |
| 8 | |
| 9 | - opt.load(['default-compiler-flags', 'boost', 'protoc', |
| 10 | + opt.load(['default-compiler-flags', 'boost', 'protoc', 'openssl', |
| 11 | 'doxygen', 'sphinx_build'], |
| 12 | tooldir=['waf-tools']) |
| 13 | |
| 14 | @@ -23,7 +23,7 @@ |
| 15 | |
| 16 | def configure(conf): |
| 17 | conf.load(['compiler_c', 'compiler_cxx', 'qt4', |
| 18 | - 'default-compiler-flags', 'boost', 'protoc', 'gnu_dirs', |
| 19 | + 'default-compiler-flags', 'boost', 'protoc', 'gnu_dirs', 'openssl', |
| 20 | 'doxygen', 'sphinx_build']) |
| 21 | |
| 22 | conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'], |
| 23 | @@ -37,6 +37,8 @@ |
| 24 | conf.check_cfg (package='ChronoSync', args=['ChronoSync >= 0.1', '--cflags', '--libs'], |
| 25 | uselib_store='SYNC', mandatory=True) |
| 26 | |
| 27 | + conf.check_openssl() |
| 28 | + |
| 29 | boost_libs = 'system random thread filesystem' |
| 30 | if conf.options.with_tests: |
| 31 | conf.env['WITH_TESTS'] = 1 |
| 32 | @@ -65,7 +67,7 @@ |
| 33 | defines = "WAF=1", |
| 34 | source = bld.path.ant_glob(['src/*.cpp', 'src/*.ui', '*.qrc', 'logging.cc', 'src/*.proto']), |
| 35 | includes = "src .", |
| 36 | - use = "QTCORE QTGUI QTWIDGETS QTSQL NDN_CXX BOOST LOG4CXX SYNC", |
| 37 | + use = "QTCORE QTGUI QTWIDGETS QTSQL NDN_CXX BOOST LOG4CXX SYNC OPENSSL", |
| 38 | ) |
| 39 | |
| 40 | # Unit tests |
| 41 | Index: chronochat_0.5.0~rc0/waf-tools/openssl.py |
| 42 | =================================================================== |
| 43 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
| 44 | +++ chronochat_0.5.0~rc0/waf-tools/openssl.py 2014-09-04 15:50:42.876551986 -0700 |
| 45 | @@ -0,0 +1,46 @@ |
| 46 | +#! /usr/bin/env python |
| 47 | +# encoding: utf-8 |
| 48 | + |
| 49 | +''' |
| 50 | + |
| 51 | +When using this tool, the wscript will look like: |
| 52 | + |
| 53 | + def options(opt): |
| 54 | + opt.tool_options('openssl') |
| 55 | + |
| 56 | + def configure(conf): |
| 57 | + conf.load('compiler_cxx openssl') |
| 58 | + conf.check_openssl() |
| 59 | + |
| 60 | + def build(bld): |
| 61 | + bld(source='main.cpp', target='app', use='OPENSSL') |
| 62 | + |
| 63 | +''' |
| 64 | + |
| 65 | +from waflib import Options |
| 66 | +from waflib.Configure import conf |
| 67 | + |
| 68 | +@conf |
| 69 | +def check_openssl(self,*k,**kw): |
| 70 | + root = k and k[0] or kw.get('path', None) or Options.options.with_openssl |
| 71 | + mandatory = kw.get('mandatory', True) |
| 72 | + var = kw.get('uselib_store', 'OPENSSL') |
| 73 | + |
| 74 | + if root: |
| 75 | + libcrypto = self.check_cxx(lib=['ssl', 'crypto'], |
| 76 | + msg='Checking for OpenSSL library', |
| 77 | + define_name='HAVE_%s' % var, |
| 78 | + uselib_store=var, |
| 79 | + mandatory=mandatory, |
| 80 | + includes="%s/include" % root, |
| 81 | + libpath="%s/lib" % root) |
| 82 | + else: |
| 83 | + libcrypto = self.check_cxx(lib=['ssl', 'crypto'], |
| 84 | + msg='Checking for OpenSSL library', |
| 85 | + define_name='HAVE_%s' % var, |
| 86 | + uselib_store=var, |
| 87 | + mandatory=mandatory) |
| 88 | + |
| 89 | +def options(opt): |
| 90 | + opt.add_option('--with-openssl', type='string', default=None, |
| 91 | + dest='with_openssl', help='''Path to OpenSSL''') |