Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55456 - sandbox-branches/bhy/py3k/libs/python/build
From: divinekid_at_[hidden]
Date: 2009-08-08 03:58:45


Author: bhy
Date: 2009-08-08 03:58:44 EDT (Sat, 08 Aug 2009)
New Revision: 55456
URL: http://svn.boost.org/trac/boost/changeset/55456

Log:
build two BPL targets: libboost_python and libboost_python3
Text files modified:
   sandbox-branches/bhy/py3k/libs/python/build/Jamfile.v2 | 152 +++++++++++++++++++++++----------------
   1 files changed, 91 insertions(+), 61 deletions(-)

Modified: sandbox-branches/bhy/py3k/libs/python/build/Jamfile.v2
==============================================================================
--- sandbox-branches/bhy/py3k/libs/python/build/Jamfile.v2 (original)
+++ sandbox-branches/bhy/py3k/libs/python/build/Jamfile.v2 2009-08-08 03:58:44 EDT (Sat, 08 Aug 2009)
@@ -4,6 +4,7 @@
 
 import os ;
 import modules ;
+import feature ;
 
 import python ;
 
@@ -22,6 +23,22 @@
     }
 }
 
+rule find-py3-version
+{
+ local versions = [ feature.values python ] ;
+ local py3ver ;
+ for local v in $(versions)
+ {
+ if $(v) >= 3.0
+ {
+ py3ver = $(v) ;
+ }
+ }
+ return $(py3ver) ;
+}
+
+py3-version = [ find-py3-version ] ;
+
 project boost/python
   : source-location ../src
   ;
@@ -29,66 +46,79 @@
 rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } }
 rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } }
 
-lib boost_python
- : # sources
- 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
- : # requirements
- <link>static:<define>BOOST_PYTHON_STATIC_LIB
- <define>BOOST_PYTHON_SOURCE
-
- # On Windows, all code using Python has to link to the Python
- # import library.
- #
- # On *nix we never link libboost_python to libpython. When
- # extending Python, all Python symbols are provided by the
- # Python interpreter executable. When embedding Python, the
- # client executable is expected to explicitly link to
- # /python//python (the target representing libpython) itself.
- #
- # python_for_extensions is a target defined by Boost.Build to
- # provide the Python include paths, and on Windows, the Python
- # import library, as usage requirements.
- [ cond [ python.configured ] : <library>/python//python_for_extensions ]
-
- # we prevent building when there is no python available
- # as it's not possible anyway, and to cause dependents to
- # fail to build
- [ unless [ python.configured ] : <build>no ]
-
- <python-debugging>on:<define>BOOST_DEBUG_PYTHON
- : # default build
- <link>shared
- : # usage requirements
- <link>static:<define>BOOST_PYTHON_STATIC_LIB
- <python-debugging>on:<define>BOOST_DEBUG_PYTHON
- ;
+rule lib_boost_python ( is-py3 ? )
+{
 
+ lib [ cond $(is-py3) : boost_python3 : boost_python ]
+ : # sources
+ 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
+ : # requirements
+ <link>static:<define>BOOST_PYTHON_STATIC_LIB
+ <define>BOOST_PYTHON_SOURCE
+
+ # On Windows, all code using Python has to link to the Python
+ # import library.
+ #
+ # On *nix we never link libboost_python to libpython. When
+ # extending Python, all Python symbols are provided by the
+ # Python interpreter executable. When embedding Python, the
+ # client executable is expected to explicitly link to
+ # /python//python (the target representing libpython) itself.
+ #
+ # python_for_extensions is a target defined by Boost.Build to
+ # provide the Python include paths, and on Windows, the Python
+ # import library, as usage requirements.
+ [ cond [ python.configured ] : <library>/python//python_for_extensions ]
+
+ # we prevent building when there is no python available
+ # as it's not possible anyway, and to cause dependents to
+ # fail to build
+ [ unless [ python.configured ] : <build>no ]
+
+ <python-debugging>on:<define>BOOST_DEBUG_PYTHON
+ [ cond $(is-py3) : <python>$(py3-version) ]
+ : # default build
+ <link>shared
+ : # usage requirements
+ <link>static:<define>BOOST_PYTHON_STATIC_LIB
+ <python-debugging>on:<define>BOOST_DEBUG_PYTHON
+ ;
+
+}
+
+lib_boost_python ;
 boost-install boost_python ;
+
+if $(py3-version)
+{
+ lib_boost_python yes ;
+ boost-install boost_python3 ;
+}


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