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"
35 local versions = [ feature.values python ] ;
37 for local v in $(versions)
47 py3-version = [ find-py3-version ] ;
50 : source-location ../src
53 rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } }
54 rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } }
56 rule lib_boost_python ( is-py3 ? )
59 lib [ cond $(is-py3) : boost_python3 : boost_python ]
69 converter/from_python.cpp
70 converter/registry.cpp
75 object/inheritance.cpp
76 object/life_support.cpp
77 object/pickle_support.cpp
80 converter/builtin_converters.cpp
81 converter/arg_to_python_base.cpp
83 object/stl_iterator.cpp
89 object/function_doc_signature.cpp
91 <link>static:<define>BOOST_PYTHON_STATIC_LIB
92 <define>BOOST_PYTHON_SOURCE
94 # On Windows, all code using Python has to link to the Python
97 # On *nix we never link libboost_python to libpython. When
98 # extending Python, all Python symbols are provided by the
99 # Python interpreter executable. When embedding Python, the
100 # client executable is expected to explicitly link to
101 # /python//python (the target representing libpython) itself.
103 # python_for_extensions is a target defined by Boost.Build to
104 # provide the Python include paths, and on Windows, the Python
105 # import library, as usage requirements.
106 [ cond [ python.configured ] : <library>/python//python_for_extensions ]
108 # we prevent building when there is no python available
109 # as it's not possible anyway, and to cause dependents to
111 [ unless [ python.configured ] : <build>no ]
112 <dependency>config-warning
114 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
115 [ cond $(is-py3) : <python>$(py3-version) ]
117 -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
118 <tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag
122 : # usage requirements
123 <link>static:<define>BOOST_PYTHON_STATIC_LIB
124 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
128 rule lib_boost_numpy ( is-py3 ? )
130 numpy-include = [ python.numpy-include ] ;
131 lib [ cond $(is-py3) : boost_numpy3 : boost_numpy ]
140 [ cond [ python.numpy ] : <library>/python//python_for_extensions ]
141 [ unless [ python.numpy ] : <build>no ]
142 <include>$(numpy-include)
143 <library>boost_python
144 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
145 [ cond $(is-py3) : <python>$(py3-version) ]
147 -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
148 <tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag
152 : # usage requirements
153 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
157 libraries = boost_python ;
158 libraries3 = boost_python3 ;
161 libraries += boost_numpy ;
162 libraries3 += boost_numpy3 ;
170 lib_boost_python yes ;
171 lib_boost_numpy yes ;
172 libraries += $(libraries3) ;
175 boost-install $(libraries) ;