sqlite3: Enabling option to disable filesystem locking (POSIX advisory locks)

When sqlite database is expected to be stored on a NFS disk (e.g., a
home directory and ~/.ndnx/ndnsec-public-info.db is on NFS mount),
default POSIX advisory filesystem locks may not work properly, since
some NFS implementation do not support them.  This commit allows
specification of ``--without-sqlite-locking`` to use alternative
"dotfile" sqlite locking mechanism.

Change-Id: Iddee82c6ca7839f993147547f61c440184689043
diff --git a/wscript b/wscript
index 682df49..079ceeb 100644
--- a/wscript
+++ b/wscript
@@ -24,6 +24,9 @@
     opt.add_option('--without-tools', action='store_false', default=True, dest='with_tools',
                    help='''Do not build tools''')
 
+    opt.add_option('--without-sqlite-locking', action='store_false', default=True, dest='with_sqlite_locking',
+                   help='''Disable filesystem locking in sqlite3 database (use unix-dot locking mechanism instead). '''
+                   '''This option may be necessary if home directory is hosted on NFS.''')
 
 def configure(conf):
     conf.load("compiler_c compiler_cxx boost gnu_dirs c_osx openssl cryptopp")
@@ -105,6 +108,9 @@
     conf.check_cxx(lib='pthread', uselib_store='PTHREAD', define_name='HAVE_PTHREAD', mandatory=False)
     conf.check_cxx(lib='rt', uselib_store='RT', define_name='HAVE_RT', mandatory=False)
 
+    if not conf.options.with_sqlite_locking:
+        conf.define('DISABLE_SQLITE3_FS_LOCKING', 1)
+    
     conf.write_config_header('src/ndn-cpp-config.h', define_prefix='NDN_CPP_')
 
 def build (bld):