|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51364 - in sandbox/SCons: libs/mpi/build tools/scons
From: loonycyborg_at_[hidden]
Date: 2009-02-21 08:57:21
Author: loonycyborg
Date: 2009-02-21 08:57:20 EST (Sat, 21 Feb 2009)
New Revision: 51364
URL: http://svn.boost.org/trac/boost/changeset/51364
Log:
Added support for library suffixes.
Text files modified:
sandbox/SCons/libs/mpi/build/SConscript | 9 ++++-----
sandbox/SCons/tools/scons/boost-build-variants.py | 13 ++++++++++++-
sandbox/SCons/tools/scons/boost-libs.py | 11 +++++++++--
3 files changed, 25 insertions(+), 8 deletions(-)
Modified: sandbox/SCons/libs/mpi/build/SConscript
==============================================================================
--- sandbox/SCons/libs/mpi/build/SConscript (original)
+++ sandbox/SCons/libs/mpi/build/SConscript 2009-02-21 08:57:20 EST (Sat, 21 Feb 2009)
@@ -6,9 +6,8 @@
env.Append(
CPPDEFINES = "BOOST_MPI_SOURCE=1",
- LIBPATH = Dir("#/" + Dir(".").path.replace("/mpi/", "/serialization/")),
- LIBS = "boost_serialization"
)
+env.BoostUseLib("serialization")
env.BoostLibrary(
"mpi",
Split("""
@@ -40,9 +39,9 @@
env = env.Clone()
env.Append(
CPPDEFINES = "BOOST_MPI_PYTHON_SOURCE=1",
- LIBPATH = [Dir("."), Dir("#/" + Dir(".").path.replace("/mpi/", "/python/"))],
- LIBS = ["boost_mpi", "boost_python"]
)
+env.BoostUseLib("python")
+env.BoostUseLib("mpi")
if env["LINK_DYNAMIC"]:
env.Append(CPPDEFINES = ["BOOST_MPI_PYTHON_DYN_LINK=1", "BOOST_PYTHON_DYN_LINK=1"])
env.BoostLibrary(
@@ -66,5 +65,5 @@
python/status.cpp
python/py_timer.cpp
"""),
- LIBS = env["LIBS"] + ["boost_mpi_python"]
+ LIBS = env["LIBS"] + ["boost_mpi_python" + env["BOOST_SUFFIX"]]
)
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-21 08:57:20 EST (Sat, 21 Feb 2009)
@@ -46,6 +46,15 @@
getattr(features, prop, lambda x, y : None)(env, value)
env[prop.upper()] = value
+def boost_suffix(env):
+ suffix = str()
+ if env["THREADING"] == "multi":
+ suffix += "-mt"
+ if env["DEBUG"]:
+ suffix += "-d"
+
+ return suffix
+
def exists():
return True
@@ -53,8 +62,10 @@
env.AddMethod(SetProperty)
env.AddMethod(_AppendFeatureFlag)
+ env["boost_suffix"] = boost_suffix
env.Replace(
CXXFLAGS = Split("-ftemplate-depth-128 -Wall"),
- BOOST_BUILD_DIR = "#/bin.SCons"
+ BOOST_BUILD_DIR = "#/bin.SCons",
+ BOOST_SUFFIX = "${boost_suffix(__env__)}"
)
Modified: sandbox/SCons/tools/scons/boost-libs.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-libs.py (original)
+++ sandbox/SCons/tools/scons/boost-libs.py 2009-02-21 08:57:20 EST (Sat, 21 Feb 2009)
@@ -3,13 +3,19 @@
def BoostLibrary(env, lib, sources):
if env["LINK_DYNAMIC"]:
- lib_node = env.SharedLibrary("boost_" + lib, sources)
+ lib_node = env.SharedLibrary("boost_" + lib + env["BOOST_SUFFIX"], sources)
else:
- lib_node = env.StaticLibrary("boost_" + lib, sources)
+ lib_node = env.StaticLibrary("boost_" + lib + env["BOOST_SUFFIX"], sources)
env.Alias(lib, lib_node)
return lib_node
+def BoostUseLib(env, lib):
+ env.AppendUnique(
+ LIBPATH = env.Dir("#/" + env.Dir(".").path.replace("/" + env["BOOST_LIB"].lower() + "/", "/" + lib + "/")),
+ LIBS = ["boost_" + lib + env["BOOST_SUFFIX"]]
+ )
+
def PythonExtension(env, lib, sources, **kw):
if env["LINK_DYNAMIC"]:
env.Alias(lib,
@@ -21,4 +27,5 @@
def generate(env):
env.AddMethod(BoostLibrary)
+ env.AddMethod(BoostUseLib)
env.AddMethod(PythonExtension)
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