summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-06 18:16:54 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-06 18:16:54 (GMT)
commitdad0795cd24ab5e0350fc96a4c8c51f97d1ab1dd (patch)
treefd06bac8e923e03a19f29fa2c07681a4068bc548 /BuildTools/SCons
parent68e1293885abca6076e35d104d14894022e1ad6b (diff)
downloadswift-dad0795cd24ab5e0350fc96a4c8c51f97d1ab1dd.zip
swift-dad0795cd24ab5e0350fc96a4c8c51f97d1ab1dd.tar.bz2
Added boost libdir and includedir flags.
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r--BuildTools/SCons/SConstruct43
1 files changed, 29 insertions, 14 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 85a8205..8690eca 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -34,6 +34,8 @@ if os.name == "nt" :
if os.name == "nt" :
vars.Add(PackageVariable("bonjour", "Bonjour SDK location", "yes"))
vars.Add(PackageVariable("openssl", "OpenSSL location", "yes"))
+vars.Add(PathVariable("boost_includedir", "Boost headers location", None, PathVariable.PathAccept))
+vars.Add(PathVariable("boost_libdir", "Boost library location", None, PathVariable.PathAccept))
vars.Add(PathVariable("expat_includedir", "Expat headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("expat_libdir", "Expat library location", None, PathVariable.PathAccept))
vars.Add("expat_libname", "Expat library name", "libexpat" if os.name == "nt" else "expat")
@@ -316,7 +318,23 @@ if conf.CheckCHeader("idna.h") and conf.CheckLib("idn") :
else :
env["LIBIDN_BUNDLED"] = 1
+# Avahi
+if env["PLATFORM"] != "darwin" :
+ if conf.CheckCHeader("avahi-client/client.h") and conf.CheckLib("avahi-client") and conf.CheckLib("avahi-common") :
+ env["HAVE_AVAHI"] = True
+ env["AVAHI_FLAGS"] = { "LIBS": ["avahi-client", "avahi-common"] }
+
+conf.Finish()
+
# Boost
+boost_conf_env = conf_env.Clone()
+boost_flags = {}
+if env.get("boost_libdir", None) :
+ boost_flags["LIBPATH"] = [env["boost_libdir"]]
+if env.get("boost_includedir", None) :
+ boost_flags["CPPPATH"] = [env["boost_includedir"]]
+boost_conf_env.MergeFlags(boost_flags)
+conf = Configure(boost_conf_env)
boostLibs = [("signals", None), ("thread", None), ("regex", None), ("program_options", None), ("filesystem", None), ("system", "system/system_error.hpp"), ("date_time", "date_time/date.hpp")]
allLibsPresent = True
libNames = []
@@ -328,29 +346,26 @@ for (lib, header) in boostLibs :
if not conf.CheckCXXHeader(header) :
allLibsPresent = False
break
- libName = "boost_" + lib
- if not conf.CheckLib(libName) :
- libName += "-mt"
+ if env["PLATFORM"] != "win32" :
+ libName = "boost_" + lib
if not conf.CheckLib(libName) :
- allLibsPresent = False
- break
- libNames.append(libName)
+ libName += "-mt"
+ if not conf.CheckLib(libName) :
+ allLibsPresent = False
+ break
+ libNames.append(libName)
if allLibsPresent :
- env["BOOST_FLAGS"] = { "LIBS": libNames }
+ env["BOOST_FLAGS"] = boost_flags
+ if env["PLATFORM"] != "win32" :
+ env["BOOST_FLAGS"].update({"LIBS": libNames})
if not conf.CheckCXXHeader("boost/uuid/uuid.hpp") :
# FIXME: Remove this workaround when UUID is available in most distros
env["BOOST_BUNDLED_UUID_ONLY"] = True
else :
env["BOOST_BUNDLED"] = True
-
-# Avahi
-if env["PLATFORM"] != "darwin" :
- if conf.CheckCHeader("avahi-client/client.h") and conf.CheckLib("avahi-client") and conf.CheckLib("avahi-common") :
- env["HAVE_AVAHI"] = True
- env["AVAHI_FLAGS"] = { "LIBS": ["avahi-client", "avahi-common"] }
-
conf.Finish()
+
# Xss
env["HAVE_XSS"] = 0
if env["PLATFORM"] != "win32" and env["PLATFORM"] != "darwin" :