summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-25 06:02:52 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-25 07:15:16 (GMT)
commit20f9d6330351b373d40b40222433e11a2a0f2713 (patch)
tree08ee119179925d2d4d0c70d1882c3f445d45cebb /BuildTools
parenta32db865c13126df9dc676425f0f7b7a3fe5dea9 (diff)
downloadswift-20f9d6330351b373d40b40222433e11a2a0f2713.zip
swift-20f9d6330351b373d40b40222433e11a2a0f2713.tar.bz2
Added SQLite build flags.
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/SCons/SConstruct20
1 files changed, 20 insertions, 0 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index e808ddd..5ecb8cb 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -42,6 +42,9 @@ vars.Add("expat_libname", "Expat library name", "libexpat" if os.name == "nt" el
vars.Add(PathVariable("libidn_includedir", "LibIDN headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("libidn_libdir", "LibIDN library location", None, PathVariable.PathAccept))
vars.Add("libidn_libname", "LibIDN library name", "libidn" if os.name == "nt" else "idn")
+vars.Add(PathVariable("sqlite_includedir", "SQLite headers location", None, PathVariable.PathAccept))
+vars.Add(PathVariable("sqlite_libdir", "SQLite library location", None, PathVariable.PathAccept))
+vars.Add("sqlite_libname", "SQLite library name", "libsqlite3" if os.name == "nt" else "sqlite3")
vars.Add(PathVariable("avahi_includedir", "Avahi headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("avahi_libdir", "Avahi library location", None, PathVariable.PathAccept))
vars.Add(PathVariable("qt", "Qt location", "", PathVariable.PathAccept))
@@ -546,6 +549,23 @@ else :
env["LIBIDN_BUNDLED"] = 1
conf.Finish()
+# SQLite
+sqlite_conf_env = conf_env.Clone()
+sqlite_flags = {}
+if env.get("sqlite_libdir", None) :
+ sqlite_flags["LIBPATH"] = [env["sqlite_libdir"]]
+if env.get("sqlite_includedir", None) :
+ sqlite_flags["CPPPATH"] = [env["sqlite_includedir"]]
+sqlite_conf_env.MergeFlags(sqlite_flags)
+conf = Configure(sqlite_conf_env)
+if conf.CheckCHeader("sqlite3.h") and conf.CheckLib(env["sqlite_libname"]) :
+ env["HAVE_SQLITE"] = 1
+ env["SQLITE_FLAGS"] = { "LIBS": [env["sqlite_libname"]] }
+ env["SQLITE_FLAGS"].update(sqlite_flags)
+else :
+ env["SQLITE_BUNDLED"] = 1
+conf.Finish()
+
# Lua
env["LUA_BUNDLED"] = 1