blob: 28dd57cf5aac612665c6d1326a0991014570b6f0 [file] [log] [blame]
Alexander Afanasyev4ffcff22014-09-02 15:39:20 -07001#! /usr/bin/env python
2# encoding: utf-8
3
4from waflib import Options
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 opt.add_option('--without-sqlite-locking', action='store_false', default=True,
11 dest='with_sqlite_locking',
12 help='''Disable filesystem locking in sqlite3 database '''
13 '''(use unix-dot locking mechanism instead). '''
14 '''This option may be necessary if home directory is hosted on NFS.''')
15
16@conf
17def check_sqlite3(self, *k, **kw):
18 root = k and k[0] or kw.get('path', None) or Options.options.with_sqlite3
19 mandatory = kw.get('mandatory', True)
20 var = kw.get('uselib_store', 'SQLITE3')
21
22 if root:
23 self.check_cxx(lib='sqlite3',
24 msg='Checking for SQLite3 library',
25 define_name='HAVE_%s' % var,
26 uselib_store=var,
27 mandatory=mandatory,
28 includes="%s/include" % root,
29 libpath="%s/lib" % root)
30 else:
31 try:
32 self.check_cfg(package='sqlite3',
33 args=['--cflags', '--libs'],
34 uselib_store='SQLITE3',
35 mandatory=True)
36 except:
37 self.check_cxx(lib='sqlite3',
38 msg='Checking for SQLite3 library',
39 define_name='HAVE_%s' % var,
40 uselib_store=var,
41 mandatory=mandatory)