Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51078 - in sandbox/SCons: libs/python/build tools/scons
From: loonycyborg_at_[hidden]
Date: 2009-02-07 13:08:09


Author: loonycyborg
Date: 2009-02-07 13:08:08 EST (Sat, 07 Feb 2009)
New Revision: 51078
URL: http://svn.boost.org/trac/boost/changeset/51078

Log:
Added support for building Boost.Python

Added:
   sandbox/SCons/libs/python/build/SConscript (contents, props changed)
Text files modified:
   sandbox/SCons/tools/scons/boost-configure.py | 8 ++++++++
   1 files changed, 8 insertions(+), 0 deletions(-)

Added: sandbox/SCons/libs/python/build/SConscript
==============================================================================
--- (empty file)
+++ sandbox/SCons/libs/python/build/SConscript 2009-02-07 13:08:08 EST (Sat, 07 Feb 2009)
@@ -0,0 +1,41 @@
+# vi: syntax=python:et:ts=4
+Import("env")
+
+if env.CheckPython():
+ if not env["LINK_DYNAMIC"]:
+ env.Append(CPPDEFINES = "BOOST_PYTHON_STATIC_LIB")
+ env.Append(CPPDEFINES = "BOOST_PYTHON_SOURCE")
+
+ env.BoostLibrary(
+ "python",
+ Split("""
+ numeric.cpp
+ list.cpp
+ long.cpp
+ dict.cpp
+ tuple.cpp
+ str.cpp
+ slice.cpp
+ converter/from_python.cpp
+ converter/registry.cpp
+ converter/type_id.cpp
+ object/enum.cpp
+ object/class.cpp
+ object/function.cpp
+ object/inheritance.cpp
+ object/life_support.cpp
+ object/pickle_support.cpp
+ errors.cpp
+ module.cpp
+ converter/builtin_converters.cpp
+ converter/arg_to_python_base.cpp
+ object/iterator.cpp
+ object/stl_iterator.cpp
+ object_protocol.cpp
+ object_operators.cpp
+ wrapper.cpp
+ import.cpp
+ exec.cpp
+ object/function_doc_signature.cpp
+ """)
+ )

Modified: sandbox/SCons/tools/scons/boost-configure.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-configure.py (original)
+++ sandbox/SCons/tools/scons/boost-configure.py 2009-02-07 13:08:08 EST (Sat, 07 Feb 2009)
@@ -29,9 +29,17 @@
         self.flags = dict(LIBS = ["bz2"])
         self.have_dep = self.conf.CheckLibWithHeader("bz2", "bzlib.h", "c", autoadd = False)
 
+class CheckPython(DependencyChecker):
+ def Check(self, env):
+ import distutils.sysconfig
+ self.flags = dict(CPPPATH = [distutils.sysconfig.get_python_inc()])
+ env.AppendUnique(**self.flags)
+ self.have_dep = self.conf.CheckCHeader("Python.h")
+
 def generate(env):
     env.AddMethod(CheckZLib())
     env.AddMethod(CheckBZip2())
+ env.AddMethod(CheckPython())
 
 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