summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-06-02 19:36:28 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-06-02 19:36:28 (GMT)
commit8a2f97f752c146a0e35b3640d57e517319fd924e (patch)
tree607603cb41390fff721049e545c82233f5e2512e /BuildTools/SCons/SConstruct
parente715084693dd74637084b9c9f020c2652c7e9c62 (diff)
downloadswift-8a2f97f752c146a0e35b3640d57e517319fd924e.zip
swift-8a2f97f752c146a0e35b3640d57e517319fd924e.tar.bz2
Detect & use system Boost version if present.
Diffstat (limited to 'BuildTools/SCons/SConstruct')
-rw-r--r--BuildTools/SCons/SConstruct27
1 files changed, 14 insertions, 13 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 6e98e87..9e79c4c 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -269,19 +269,20 @@ else :
env["LIBIDN_BUNDLED"] = 1
# Boost
-# NOTE: We can't use the system boost, because of 'signals' (which we
-# redefine as signals2 for avoiding Qt clashes)
-#boostLibs = ["boost_signals", "boost_thread", "boost_program_options", "boost_filesystem"]
-#if conf.CheckCHeader("boost/foreach.hpp") and conf.CheckCHeader("boost/signals.hpp") and conf.CheckCHeader("boost/thread.hpp") and conf.CheckCHeader("boost/program_options.hpp") and Conf.CheckCHeader("boost/filesystem.hpp") :
-# allLibsPresent = True
-# for lib in boostLibs :
-# if not env.CheckLib(lib) :
-# allLibsPresent = False
-# break
-# if allLibsPresent :
-# env["BOOST_FLAGS"] = { "LIBS": [boostLibs] }
-# else :
-# env["BOOST_BUNDLED"] = True
+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
+for (lib, header) in boostLibs :
+ if header :
+ header = "boost/" + header
+ else :
+ header = "boost/" + lib + ".hpp"
+ if not conf.CheckCXXHeader(header) or not conf.CheckLib("boost_" + lib) :
+ allLibsPresent = False
+ break
+if allLibsPresent :
+ env["BOOST_FLAGS"] = { "LIBS": ["boost_" + lib for lib, header in boostLibs] }
+else :
+ env["BOOST_BUNDLED"] = True
# Avahi
if env["PLATFORM"] != "darwin" :