blob: 66fb945d6a89858951f465723a00fb32017a0567 [file] [log] [blame]
Alexander Afanasyev1160baa2014-04-10 18:50:29 -07001from waflib.Configure import conf
2
3def options(opt):
Davide Pesavento77f1c762019-02-19 03:20:49 -05004 opt.add_option('--with-sqlite3', type='string', default=None, dest='sqlite3_dir',
5 help='directory where SQLite3 is installed, e.g., /usr/local')
Alexander Afanasyev1160baa2014-04-10 18:50:29 -07006
7@conf
8def check_sqlite3(self, *k, **kw):
Davide Pesavento77f1c762019-02-19 03:20:49 -05009 root = k and k[0] or kw.get('path', self.options.sqlite3_dir)
Alexander Afanasyev1160baa2014-04-10 18:50:29 -070010 mandatory = kw.get('mandatory', True)
11 var = kw.get('uselib_store', 'SQLITE3')
12
13 if root:
14 self.check_cxx(lib='sqlite3',
15 msg='Checking for SQLite3 library',
16 define_name='HAVE_%s' % var,
17 uselib_store=var,
18 mandatory=mandatory,
Davide Pesavento77f1c762019-02-19 03:20:49 -050019 includes='%s/include' % root,
20 libpath='%s/lib' % root)
Alexander Afanasyev1160baa2014-04-10 18:50:29 -070021 else:
22 try:
23 self.check_cfg(package='sqlite3',
24 args=['--cflags', '--libs'],
Alexander Afanasyev01515792014-12-16 14:20:01 -080025 global_define=True,
26 define_name='HAVE_%s' % var,
Alexander Afanasyev1160baa2014-04-10 18:50:29 -070027 uselib_store='SQLITE3',
28 mandatory=True)
29 except:
30 self.check_cxx(lib='sqlite3',
31 msg='Checking for SQLite3 library',
32 define_name='HAVE_%s' % var,
33 uselib_store=var,
34 mandatory=mandatory)