Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51061 - in sandbox/SCons: . libs/iostreams/build tools/scons
From: loonycyborg_at_[hidden]
Date: 2009-02-06 12:50:17


Author: loonycyborg
Date: 2009-02-06 12:50:16 EST (Fri, 06 Feb 2009)
New Revision: 51061
URL: http://svn.boost.org/trac/boost/changeset/51061

Log:
Added config checks for zlib and bzip2.

Added:
   sandbox/SCons/tools/scons/boost-configure.py (contents, props changed)
Text files modified:
   sandbox/SCons/SConstruct | 5 +++--
   sandbox/SCons/libs/iostreams/build/SConscript | 15 +++++++++++----
   2 files changed, 14 insertions(+), 6 deletions(-)

Modified: sandbox/SCons/SConstruct
==============================================================================
--- sandbox/SCons/SConstruct (original)
+++ sandbox/SCons/SConstruct 2009-02-06 12:50:16 EST (Fri, 06 Feb 2009)
@@ -1,5 +1,6 @@
 # vi: syntax=python:et:ts=4
-EnsureSConsVersion(0, 98, 5)
+EnsureSConsVersion(0, 98, 3)
+SConsignFile("bin.SCons/sconsign.dblite")
 
 vars = Variables("build-config.py")
 vars.AddVariables(
@@ -7,7 +8,7 @@
     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)
+env = Environment(toolpath = ["tools/scons"], tools = ["default", "boost-libs", "boost-build-variants", "boost-configure"], variables = vars)
 vars.Save("build-config.py", env)
 Export("env")
 

Modified: sandbox/SCons/libs/iostreams/build/SConscript
==============================================================================
--- sandbox/SCons/libs/iostreams/build/SConscript (original)
+++ sandbox/SCons/libs/iostreams/build/SConscript 2009-02-06 12:50:16 EST (Fri, 06 Feb 2009)
@@ -1,10 +1,17 @@
 # vi: syntax=python:et:ts=4
 Import("env")
 
+sources = Split("""
+ file_descriptor.cpp
+ mapped_file.cpp
+ """)
+
+if env.CheckZLib():
+ sources.append("zlib.cpp")
+if env.CheckBZip2():
+ sources.append("bzip2.cpp")
+
 env.BoostLibrary(
    "iostreams",
- Split("""
- file_descriptor.cpp
- mapped_file.cpp
- """)
+ sources
    )

Added: sandbox/SCons/tools/scons/boost-configure.py
==============================================================================
--- (empty file)
+++ sandbox/SCons/tools/scons/boost-configure.py 2009-02-06 12:50:16 EST (Fri, 06 Feb 2009)
@@ -0,0 +1,40 @@
+# vi: syntax=python:et:ts=4
+
+def ConfigureBoost(env):
+ global conf
+ return conf
+
+have_zlib = None
+zlib_flags = None
+def CheckZLib(env):
+ global have_zlib, zlib_flags
+ if zlib_flags == None:
+ zlib_flags = dict(LIBS = ["z"])
+ conf = env.ConfigureBoost()
+ have_zlib = conf.CheckLibWithHeader("z", "zlib.h", "c", autoadd = False)
+ if have_zlib:
+ env.AppendUnique(**zlib_flags)
+ return have_zlib
+
+have_bzip2 = None
+bzip2_flags = None
+def CheckBZip2(env):
+ global have_bzip2, bzip2_flags
+ if bzip2_flags == None:
+ bzip2_flags = dict(LIBS = ["bz2"])
+ conf = env.ConfigureBoost()
+ have_bzip2 = conf.CheckLibWithHeader("bz2", "bzlib.h", "c", autoadd = False)
+ if have_bzip2:
+ env.AppendUnique(**bzip2_flags)
+ return have_bzip2
+
+def generate(env):
+ env.AddMethod(ConfigureBoost)
+ env.AddMethod(CheckZLib)
+ env.AddMethod(CheckBZip2)
+ global conf
+ build_dir = "#/bin.SCons/"
+ conf = env.Configure(conf_dir = build_dir + "sconf_temp", log_file = build_dir + "config.log")
+
+def exists():
+ return True


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