Alexander Afanasyev | 1160baa | 2014-04-10 18:50:29 -0700 | [diff] [blame] | 1 | from waflib.Configure import conf |
| 2 | |
| 3 | def options(opt): |
Davide Pesavento | 77f1c76 | 2019-02-19 03:20:49 -0500 | [diff] [blame] | 4 | opt.add_option('--with-sqlite3', type='string', default=None, dest='sqlite3_dir', |
| 5 | help='directory where SQLite3 is installed, e.g., /usr/local') |
Alexander Afanasyev | 1160baa | 2014-04-10 18:50:29 -0700 | [diff] [blame] | 6 | |
| 7 | @conf |
| 8 | def check_sqlite3(self, *k, **kw): |
Davide Pesavento | 77f1c76 | 2019-02-19 03:20:49 -0500 | [diff] [blame] | 9 | root = k and k[0] or kw.get('path', self.options.sqlite3_dir) |
Alexander Afanasyev | 1160baa | 2014-04-10 18:50:29 -0700 | [diff] [blame] | 10 | 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 Pesavento | 77f1c76 | 2019-02-19 03:20:49 -0500 | [diff] [blame] | 19 | includes='%s/include' % root, |
| 20 | libpath='%s/lib' % root) |
Alexander Afanasyev | 1160baa | 2014-04-10 18:50:29 -0700 | [diff] [blame] | 21 | else: |
| 22 | try: |
| 23 | self.check_cfg(package='sqlite3', |
| 24 | args=['--cflags', '--libs'], |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 25 | global_define=True, |
| 26 | define_name='HAVE_%s' % var, |
Alexander Afanasyev | 1160baa | 2014-04-10 18:50:29 -0700 | [diff] [blame] | 27 | 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) |