blob: 8300acc21750c09199a38999f8f9fb854516d9ae [file] [log] [blame]
Alexander Afanasyev71b43e72012-12-27 01:03:43 -08001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3VERSION='0.1'
4APPNAME='chronoshare'
5
6from waflib import Build, Logs
7
8def options(opt):
9 opt.load('compiler_cxx boost ccnx')
10 opt.add_option('--debug',action='store_true',default=False,dest='debug',help='''debugging mode''')
11 opt.add_option('--yes',action='store_true',default=False) # for autoconf/automake/make compatibility
12
13def configure(conf):
14 conf.load("compiler_cxx boost ccnx")
15
16 conf.check_cfg(package='sqlite3', args=['--cflags', '--libs'], uselib_store='SQLITE3', mandatory=True)
17
18 if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False):
19 Logs.error ("bla")
20 conf.check_cc(lib='crypto',
21 header_name='openssl/crypto.h',
22 define_name='HAVE_SSL',
23 uselib_store='SSL')
24 else:
25 conf.define ("HAVE_SSL", 1)
26
27 if not conf.get_define ("HAVE_SSL"):
28 conf.fatal ("Cannot find SSL libraries")
29
30 conf.check_boost(lib='system iostreams regex')
31
32 boost_version = conf.env.BOOST_VERSION.split('_')
33 if int(boost_version[0]) < 1 or int(boost_version[1]) < 46:
34 Logs.error ("Minumum required boost version is 1.46")
35 return
36
37 conf.check_ccnx (path=conf.options.ccnx_dir)
38
39 if conf.options.debug:
40 conf.define ('_DEBUG', 1)
41 conf.env.append_value('CXXFLAGS', ['-O0', '-g3'])
42 else:
43 conf.env.append_value('CXXFLAGS', ['-O3', '-g'])
44
45 conf.write_config_header('src/config.h')
46
47def build (bld):
48 chronoshare = bld (
49 target=APPNAME,
50 features=['cxx', 'cxxprogram'],
51 # source = bld.path.ant_glob(['src/**/*.cc']),
52 source = ['src/main.cc', 'src/sqlite-helper.cc'],
53 use = 'BOOST BOOST_IOSTREAMS BOOST_REGEX CCNX SSL SQLITE3',
54 includes = ['include', 'src'],
55 )