Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51027 - in sandbox/SCons: . libs tools/scons
From: loonycyborg_at_[hidden]
Date: 2009-02-05 06:37:01


Author: loonycyborg
Date: 2009-02-05 06:37:00 EST (Thu, 05 Feb 2009)
New Revision: 51027
URL: http://svn.boost.org/trac/boost/changeset/51027

Log:
Added support for threading aspect of build variants.

Text files modified:
   sandbox/SCons/SConstruct | 3 ++-
   sandbox/SCons/libs/SConscript | 25 ++++++++++++++-----------
   sandbox/SCons/tools/scons/boost-build-variants.py | 2 +-
   3 files changed, 17 insertions(+), 13 deletions(-)

Modified: sandbox/SCons/SConstruct
==============================================================================
--- sandbox/SCons/SConstruct (original)
+++ sandbox/SCons/SConstruct 2009-02-05 06:37:00 EST (Thu, 05 Feb 2009)
@@ -4,7 +4,8 @@
 vars = Variables("build-config.py")
 vars.AddVariables(
     ListVariable("variant", "Build configuration", "release", ["release", "debug"]),
- ListVariable("link", "Library linking", "all", ["static", "dynamic"])
+ ListVariable("link", "Library linking", "all", ["static", "dynamic"]),
+ ListVariable("threading", "Multi-threading support", "multi", ["single", "multi"])
 )
 env = Environment(toolpath = ["tools/scons"], tools = ["default", "boost-libs", "boost-build-variants"], variables = vars)
 vars.Save("build-config.py", env)

Modified: sandbox/SCons/libs/SConscript
==============================================================================
--- sandbox/SCons/libs/SConscript (original)
+++ sandbox/SCons/libs/SConscript 2009-02-05 06:37:00 EST (Thu, 05 Feb 2009)
@@ -3,23 +3,26 @@
 env.Append(
     CPPPATH = "#/",
     CPPDEFINES = ["BOOST_ALL_NO_LIB=1"],
- CCFLAGS = Split("$DEBUG_RELEASE_CCFLAGS $THREADING_CCFLAGS"),
- LIBFLAGS = Split("$DEBUG_RELEASE_LIBFLAGS $THREADING_LIBFLAGS")
+ CCFLAGS = Split("$VARIANT_CCFLAGS $THREADING_CCFLAGS"),
+ LINKFLAGS = Split("$VARIANT_LINKFLAGS $THREADING_LINKFLAGS"),
     )
 
 sconscripts = Glob("*/build/SConscript")
 env.AppendUnique(CPPDEFINES = ["${LINK_DYNAMIC and 'BOOST_' + BOOST_LIB + '_DYN_LINK=1' or []}"])
-for debug_release in env["variant"]:
- env["DEBUG_RELEASE_CCFLAGS"] = env.get(debug_release.upper() + "_CCFLAGS")
- env["DEBUG_RELEASE_LIBFLAGS"] = env.get(debug_release.upper() + "_LIBFLAGS")
+for variant in env["variant"]:
+ env["VARIANT_CCFLAGS"] = env.get(variant.upper() + "_CCFLAGS")
+ env["VARIANT_LINKFLAGS"] = env.get(variant.upper() + "_LINKFLAGS")
     for linking in env["link"]:
         if linking == "dynamic":
             env["LINK_DYNAMIC"] = True
         else:
             env["LINK_DYNAMIC"] = False
- for sconscript in sconscripts:
- lib = str(sconscript.get_dir().up())
- target_dir = "#/bin.SCons/" + lib + "/" + debug_release + "/" + linking
- VariantDir(src_dir = lib + "/src", variant_dir = target_dir, duplicate = False)
- VariantDir(src_dir = lib + "/build", variant_dir = lib + "/src", duplicate = False)
- SConscript(target_dir + "/SConscript", exports = { "env" : env.Clone(BOOST_LIB = lib.upper()) })
+ for threading in env["threading"]:
+ env["THREADING_CCFLAGS"] = env.get("THREADING_" + threading.upper() + "_CCFLAGS")
+ env["THREADING_LINKFLAGS"] = env.get("THREADING_" + threading.upper() + "_LINKFLAGS")
+ for sconscript in sconscripts:
+ lib = str(sconscript.get_dir().up())
+ target_dir = "#/bin.SCons/" + lib + "/" + variant + "/" + linking + "/threading-" + threading
+ VariantDir(src_dir = lib + "/src", variant_dir = target_dir, duplicate = False)
+ VariantDir(src_dir = lib + "/build", variant_dir = lib + "/src", duplicate = False)
+ SConscript(target_dir + "/SConscript", exports = { "env" : env.Clone(BOOST_LIB = lib.upper()) })

Modified: sandbox/SCons/tools/scons/boost-build-variants.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-build-variants.py (original)
+++ sandbox/SCons/tools/scons/boost-build-variants.py 2009-02-05 06:37:00 EST (Thu, 05 Feb 2009)
@@ -7,6 +7,6 @@
 def generate(env):
     env["CXXFLAGS"] = Split("-ftemplate-depth-128 -Wall")
     env["THREADING_MULTI_CCFLAGS"] = "-pthread"
- env["THREADING_MULTI_LIBFLAGS"] = "-pthread"
+ env["THREADING_MULTI_LINKFLAGS"] = "-pthread"
     env["DEBUG_CCFLAGS"] = Split("-O0 -g -fno-inline")
     env["RELEASE_CCFLAGS"] = Split("-O3 -DNDEBUG -finline-functions -Wno-inline")


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk