Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wscript add pkg_config support

  • Loading branch information...
commit b7f738629a841b727e2f76b78c5e1559ecf4e4b1 1 parent c92d4ac
@ronnywang ronnywang 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.