1 # Copyright David Abrahams 2001-2006. Distributed under the Boost
2 # Software License, Version 1.0. (See accompanying
3 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12 if ! [ python.configured ] && ! ( --without-python in [ modules.peek : ARGV ] )
14 # Attempt default configuration of python
15 import toolset : using ;
19 if [ python.configured ] || ( --without-python in [ modules.peek : ARGV ] )
21 alias config-warning ;
25 message config-warning
26 : "warning: No python installation configured and autoconfiguration"
27 : "note: failed. See http://www.boost.org/libs/python/doc/building.html"
28 : "note: for configuration instructions or pass --without-python to"
29 : "note: suppress this message and silently skip all Boost.Python targets"
34 : source-location ../src
37 rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } }
38 rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } }
39 local rule eq ( a : b ) { if $(a) = $(b) { return 1 ; } }
50 converter/from_python.cpp
51 converter/registry.cpp
56 object/inheritance.cpp
57 object/life_support.cpp
58 object/pickle_support.cpp
61 converter/builtin_converters.cpp
62 converter/arg_to_python_base.cpp
64 object/stl_iterator.cpp
70 object/function_doc_signature.cpp
72 <link>static:<define>BOOST_PYTHON_STATIC_LIB
73 <define>BOOST_PYTHON_SOURCE
75 # On Windows, all code using Python has to link to the Python
78 # On *nix we never link libboost_python to libpython. When
79 # extending Python, all Python symbols are provided by the
80 # Python interpreter executable. When embedding Python, the
81 # client executable is expected to explicitly link to
82 # /python//python (the target representing libpython) itself.
84 # python_for_extensions is a target defined by Boost.Build to
85 # provide the Python include paths, and on Windows, the Python
86 # import library, as usage requirements.
87 [ cond [ python.configured ] : <library>/python//python_for_extensions ]
89 # we prevent building when there is no python available
90 # as it's not possible anyway, and to cause dependents to
92 [ unless [ python.configured ] : <build>no ]
93 <dependency>config-warning
94 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
95 -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
97 <conditional>@python.require-py
101 : # usage requirements
102 <link>static:<define>BOOST_PYTHON_STATIC_LIB
103 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
106 numpy-include = [ python.numpy-include ] ;
116 <link>static:<define>BOOST_NUMPY_STATIC_LIB
117 <define>BOOST_NUMPY_SOURCE
118 [ cond [ python.numpy ] : <library>/python//python_for_extensions ]
119 [ unless [ python.numpy ] : <build>no ]
120 <include>$(numpy-include)
121 <library>boost_python
122 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
123 -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
125 <conditional>@python.require-py
129 : # usage requirements
130 <link>static:<define>BOOST_NUMPY_STATIC_LIB
131 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
134 # boost-install creates `stage` and `install` targets
136 # `stage` stages (builds and copies into `stage/lib`) the given libraries
137 # `boost_python` and `boost_numpy` and their dependencies and is similar
138 # to issuing `b2 --with-python stage` from top level
140 # `install` installs the two libraries and their dependencies and is similar
141 # to issuing `b2 --with-python install` from top level
143 if [ python.configured ]
147 boost-install boost_python boost_numpy ;
151 boost-install boost_python ;
157 # When Python isn't configured, the above `boost-install` is not executed,
158 # so we create empty `stage` and `install` targets that do nothing but issue
159 # a warning message unless `--without-python` is given
161 alias stage : config-warning ;
164 alias install : config-warning ;