Boost logo

Boost-Commit :

From: RaoulGough_at_[hidden]
Date: 2008-05-18 10:20:35


Author: raoulgough
Date: 2008-05-18 10:20:34 EDT (Sun, 18 May 2008)
New Revision: 45485
URL: http://svn.boost.org/trac/boost/changeset/45485

Log:
Merged head r19968:40714 to sandbox python_indexing_2 branch

Text files modified:
   sandbox/python_indexing_v2/libs/python/build/Jamfile.v2 | 114 +++++++++++++++++++++------------------
   1 files changed, 60 insertions(+), 54 deletions(-)

Modified: sandbox/python_indexing_v2/libs/python/build/Jamfile.v2
==============================================================================
--- sandbox/python_indexing_v2/libs/python/build/Jamfile.v2 (original)
+++ sandbox/python_indexing_v2/libs/python/build/Jamfile.v2 2008-05-18 10:20:34 EDT (Sun, 18 May 2008)
@@ -1,70 +1,44 @@
+# Copyright David Abrahams 2001-2006. Distributed under the Boost
+# Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
 import os ;
 import modules ;
 
-# Use a very crude way to sense there python is locatted
-
-
-local PYTHON_PATH = [ modules.peek : PYTHON_PATH ] ;
-ECHO "XXX" $(PYTHON_PATH) ;
-
-if [ GLOB /usr/local/include/python2.2 : * ]
-{
- PYTHON_PATH = /usr/local ;
-}
-else if [ GLOB /usr/include/python2.2 : * ]
-{
- PYTHON_PATH = /usr ;
-}
+import python ;
 
-if [ os.name ] in CYGWIN NT
+if ! [ python.configured ] && ! ( --without-python in [ modules.peek : ARGV ] )
 {
- lib_condition = <link>shared: ;
- defines = USE_DL_IMPORT ;
-
- # Declare a target for the python interpreter library
- lib python : : <name>python22 <search>$(PYTHON_PATH)/libs ;
- PYTHON_LIB = python ;
-}
-else
-{
- lib python : : <name>python2.2 ;
- PYTHON_LIB = python ;
-}
-
-
-
-if $(PYTHON_PATH) {
+ # Attempt default configuration of python
+ import toolset : using ;
+ using python ;
     
+ if ! [ python.configured ]
+ {
+ ECHO "WARNING: No python installation configured and autoconfiguration" ;
+ ECHO " failed. See http://www.boost.org/libs/python/doc/building.html" ;
+ ECHO " for configuration instructions or pass --without-python to" ;
+ ECHO " suppress this message and silently skip all Boost.Python targets" ;
+ }
+}
 
 project boost/python
- : source-location ../src
- : requirements <include>$(PYTHON_PATH)/include
- $(lib_condition)<library-path>$(PYTHON_PATH)/libs
- <link>shared:<library>$(PYTHON_LIB)
- <define>$(defines)
- : usage-requirements # requirement that will be propageted to *users* of this library
- <include>$(PYTHON_PATH)/include
-
-# We have a bug which causes us to conclude that conditionalized
-# properties in this section are not free.
-# $(lib_condition)<library-path>$(PYTHON_PATH)/lib/python2.2/config
-# <shared>true:<find-library>$(PYTHON_LIB)
-
- <library-path>$(PYTHON_PATH)/lib/python2.2/config
- <library>$(PYTHON_LIB)
- ;
+ : source-location ../src
+ ;
+
+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
 
- aix_init_module.cpp
     converter/from_python.cpp
     converter/registry.cpp
     converter/type_id.cpp
@@ -79,10 +53,42 @@
     converter/builtin_converters.cpp
     converter/arg_to_python_base.cpp
     object/iterator.cpp
+ object/stl_iterator.cpp
     object_protocol.cpp
     object_operators.cpp
- : <link>static:<define>BOOST_PYTHON_STATIC_LIB
+ wrapper.cpp
+ import.cpp
+ exec.cpp
+ object/function_doc_signature.cpp
+ : # requirements
+ <link>static:<define>BOOST_PYTHON_STATIC_LIB
         <define>BOOST_PYTHON_SOURCE
- : <link>shared
- ;
-}
+
+ # 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
+ ;
+
+boost-install boost_python ;


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