Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sqlite3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
node-sqlite3
Commits
8aec7adc
Commit
8aec7adc
authored
Nov 06, 2011
by
Dane Springmeyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ability to configure against boost threads if requested
parent
a5fe5d0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
wscript
wscript
+38
-3
No files found.
wscript
View file @
8aec7adc
...
@@ -21,7 +21,7 @@ BUNDLED_SQLITE3_TAR = 'sqlite-autoconf-%s.tar.gz' % BUNDLED_SQLITE3_VERSION
...
@@ -21,7 +21,7 @@ BUNDLED_SQLITE3_TAR = 'sqlite-autoconf-%s.tar.gz' % BUNDLED_SQLITE3_VERSION
SQLITE3_TARGET = 'deps/%s' % BUNDLED_SQLITE3
SQLITE3_TARGET = 'deps/%s' % BUNDLED_SQLITE3
sqlite3_test_program = '''
sqlite3_test_program = '''
#include
"stdio.h
"
#include
<stdio>
"
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#endif
...
@@ -36,6 +36,16 @@ main() {
...
@@ -36,6 +36,16 @@ main() {
}
}
'''
'''
boost_thread_test_program = '''
#include <boost/thread/mutex.hpp>
int
main() {
boost::mutex mutex_;
return 0;
}
'''
def set_options(opt):
def set_options(opt):
opt.tool_options("compiler_cxx")
opt.tool_options("compiler_cxx")
...
@@ -46,6 +56,13 @@ def set_options(opt):
...
@@ -46,6 +56,13 @@ def set_options(opt):
, dest='sqlite3_dir'
, dest='sqlite3_dir'
)
)
opt.add_option( '--with-boost'
, action='store'
, default=None
, help='Directory prefix containing boost "lib" and "include" files (default is to use pthreads not boost for threading support)'
, dest='boost_dir'
)
def _conf_exit(conf,msg):
def _conf_exit(conf,msg):
conf.fatal('\n\n' + msg + '\n...check the build/config.log for details')
conf.fatal('\n\n' + msg + '\n...check the build/config.log for details')
...
@@ -75,10 +92,28 @@ def configure(conf):
...
@@ -75,10 +92,28 @@ def configure(conf):
msg='Checking for libsqlite3 at %s' % lib,
msg='Checking for libsqlite3 at %s' % lib,
includes=include):
includes=include):
Utils.pprint('GREEN', 'Sweet, found viable sqlite3 dependency at: %s ' % o.sqlite3_dir)
Utils.pprint('GREEN', 'Sweet, found viable sqlite3 dependency at: %s ' % o.sqlite3_dir)
else:
else:
_conf_exit(conf,'sqlite3 libs/headers not found at %s' % o.sqlite3_dir)
_conf_exit(conf,'sqlite3 libs/headers not found at %s' % o.sqlite3_dir)
linkflags = []
linkflags = []
if o.boost_dir:
lib, include = _build_paths(conf,o.boost_dir)
if conf.check_cxx(lib='boost_thread',
fragment=boost_thread_test_program,
uselib_store='SQLITE3',
libpath=lib,
msg='Checking for libboost_thread at %s' % lib,
includes=include):
Utils.pprint('GREEN', 'Sweet, found viable boost dependency at: %s ' % o.boost_dir)
conf.env.append_value("CXXFLAGS_SQLITE3", ['-DNODE_SQLITE3_BOOST_THREADING'])
else:
_conf_exit(conf,'boost libs/headers not found at %s' % o.boost_dir)
else:
conf.env.append_value("CXXFLAGS_SQLITE3", ["-pthread"])
if os.environ.has_key('LINKFLAGS'):
if os.environ.has_key('LINKFLAGS'):
linkflags.extend(os.environ['LINKFLAGS'].split(' '))
linkflags.extend(os.environ['LINKFLAGS'].split(' '))
...
@@ -128,7 +163,7 @@ def build(bld):
...
@@ -128,7 +163,7 @@ def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
build_internal_sqlite3(bld)
build_internal_sqlite3(bld)
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE",
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE",
"-DSQLITE_ENABLE_RTREE=1", "-
pthread", "-
Wall"]
"-DSQLITE_ENABLE_RTREE=1", "-Wall"]
# uncomment the next line to remove '-undefined dynamic_lookup'
# uncomment the next line to remove '-undefined dynamic_lookup'
# in order to review linker errors (v8, libev/eio references can be ignored)
# in order to review linker errors (v8, libev/eio references can be ignored)
#obj.env['LINKFLAGS_MACBUNDLE'] = ['-bundle']
#obj.env['LINKFLAGS_MACBUNDLE'] = ['-bundle']
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment