blob: 3d4e46ed0c26f160a3a66e8edc588b3d180e73cc [file] [log] [blame]
Alexander Afanasyeve83c0562016-12-24 10:20:41 -08001#! /usr/bin/env python
2# encoding: utf-8
3
4from waflib import Options, Logs
5from waflib.Configure import conf
6
7def options(opt):
8 opt.add_option('--with-sqlite3', type='string', default=None,
9 dest='with_sqlite3', help='''Path to SQLite3, e.g., /usr/local''')
10
11@conf
12def check_sqlite3(self, *k, **kw):
13 root = k and k[0] or kw.get('path', None) or Options.options.with_sqlite3
14 mandatory = kw.get('mandatory', True)
15 var = kw.get('uselib_store', 'SQLITE3')
16
17 if root:
18 self.check_cxx(lib='sqlite3',
19 msg='Checking for SQLite3 library',
20 define_name='HAVE_%s' % var,
21 uselib_store=var,
22 mandatory=mandatory,
23 includes="%s/include" % root,
24 libpath="%s/lib" % root)
25 else:
26 try:
27 self.check_cfg(package='sqlite3',
28 args=['--cflags', '--libs'],
29 global_define=True,
30 define_name='HAVE_%s' % var,
31 uselib_store='SQLITE3',
32 mandatory=True)
33 except:
34 self.check_cxx(lib='sqlite3',
35 msg='Checking for SQLite3 library',
36 define_name='HAVE_%s' % var,
37 uselib_store=var,
38 mandatory=mandatory)