Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3 from ronnywang/master

add pkg-config support
  • Loading branch information...
commit cb2d231707d0e58b0bda5d36a3a0596bd66d05b5 2 parents f8c7b03 + b7f7386
@grumdrig authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 wscript
View
17 wscript
@@ -1,3 +1,6 @@
+from os import popen
+import Utils
+
srcdir = "."
blddir = "build"
VERSION = "0.0.1"
@@ -8,9 +11,21 @@ def set_options(opt):
def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
+ pkg_config = conf.find_program('pkg-config', var='PKG_CONFIG', mandatory=True)
+ sqlite3_libdir = popen("%s sqlite3 --libs-only-L" % pkg_config).readline().strip();
+ if sqlite3_libdir == "":
+ sqlite3_libdir = "/usr/lib"
+ sqlite3_libdir = sqlite3_libdir.replace("-L", "")
+ sqlite3_includedir = popen("%s sqlite3 --cflags-only-I" % pkg_config).readline().strip();
+ if sqlite3_includedir == "":
+ sqlite3_includedir = "/usr/include"
+ sqlite3_includedir = sqlite3_includedir.replace("-I", "")
+ conf.env.append_value("LIBPATH_SQLITE3", sqlite3_libdir)
+ conf.env.append_value('CPPPATH_SQLITE3', sqlite3_includedir)
+ conf.env.append_value("LIB_SQLITE3", "sqlite3")
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.target = "sqlite3_bindings"
obj.source = "sqlite3_bindings.cc"
- obj.lib = "sqlite3"
+ obj.uselib = "SQLITE3"
Please sign in to comment.
Something went wrong with that request. Please try again.