@@ -7,7 +7,6 @@ import indirect ;
77import modules ;
88import feature ;
99import property ;
10-
1110import python ;
1211
1312if ! [ python.configured ] && ! ( --without-python in [ modules.peek : ARGV ] )
3130 ;
3231}
3332
34- py2-version = [ py-version 2 ] ;
35- py3-version = [ py-version 3 ] ;
36-
3733project boost/python
3834 : source-location ../src
3935 ;
@@ -42,146 +38,95 @@ rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { retu
4238rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } }
4339local rule eq ( a : b ) { if $(a) = $(b) { return 1 ; } }
4440
45- lib_boost_python(2) = boost_python ;
46- lib_boost_python(3) = boost_python3 ;
47-
48- lib_boost_python($(py2-version)) = $(lib_boost_python(2)) ;
49- lib_boost_python($(py3-version)) = $(lib_boost_python(3)) ;
50-
51- rule lib_boost_python ( version )
52- {
53- lib $(lib_boost_python($(version)))
54- : # sources
55- list.cpp
56- long.cpp
57- dict.cpp
58- tuple.cpp
59- str.cpp
60- slice.cpp
61-
62- converter/from_python.cpp
63- converter/registry.cpp
64- converter/type_id.cpp
65- object/enum.cpp
66- object/class.cpp
67- object/function.cpp
68- object/inheritance.cpp
69- object/life_support.cpp
70- object/pickle_support.cpp
71- errors.cpp
72- module.cpp
73- converter/builtin_converters.cpp
74- converter/arg_to_python_base.cpp
75- object/iterator.cpp
76- object/stl_iterator.cpp
77- object_protocol.cpp
78- object_operators.cpp
79- wrapper.cpp
80- import.cpp
81- exec.cpp
82- object/function_doc_signature.cpp
83- : # requirements
84- <link>static:<define>BOOST_PYTHON_STATIC_LIB
85- <define>BOOST_PYTHON_SOURCE
86-
87- # On Windows, all code using Python has to link to the Python
88- # import library.
89- #
90- # On *nix we never link libboost_python to libpython. When
91- # extending Python, all Python symbols are provided by the
92- # Python interpreter executable. When embedding Python, the
93- # client executable is expected to explicitly link to
94- # /python//python (the target representing libpython) itself.
95- #
96- # python_for_extensions is a target defined by Boost.Build to
97- # provide the Python include paths, and on Windows, the Python
98- # import library, as usage requirements.
99- [ cond [ python.configured ] : <library>/python//python_for_extensions ]
100-
101- # we prevent building when there is no python available
102- # as it's not possible anyway, and to cause dependents to
103- # fail to build
104- [ unless [ python.configured ] : <build>no ]
105- <dependency>config-warning
106-
107- <python-debugging>on:<define>BOOST_DEBUG_PYTHON
108- <python>$(version)
109-
110- -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
111- <tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag
112-
113- <conditional>@python.require-py
114-
115- : # default build
116- <link>shared
117- : # usage requirements
118- <link>static:<define>BOOST_PYTHON_STATIC_LIB
119- <python-debugging>on:<define>BOOST_DEBUG_PYTHON
120- ;
121- }
122-
123- lib_boost_numpy(2) = boost_numpy ;
124- lib_boost_numpy(3) = boost_numpy3 ;
125-
126- lib_boost_numpy($(py2-version)) = $(lib_boost_numpy(2)) ;
127- lib_boost_numpy($(py3-version)) = $(lib_boost_numpy(3)) ;
128-
129- rule lib_boost_numpy ( version )
130- {
131- numpy-include = [ python.numpy-include ] ;
132- lib $(lib_boost_numpy($(version)))
133- : # sources
134- numpy/dtype.cpp
135- numpy/matrix.cpp
136- numpy/ndarray.cpp
137- numpy/numpy.cpp
138- numpy/scalars.cpp
139- numpy/ufunc.cpp
140- : # requirements
141- <link>static:<define>BOOST_NUMPY_STATIC_LIB
142- <define>BOOST_NUMPY_SOURCE
143- [ cond [ python.numpy ] : <library>/python//python_for_extensions ]
144- [ unless [ python.numpy ] : <build>no ]
145- <include>$(numpy-include)
146- <library>$(lib_boost_python($(version)))
147- <python-debugging>on:<define>BOOST_DEBUG_PYTHON
148- <python>$(version)
149-
150- -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
151- <tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag
152-
153- <conditional>@python.require-py
154-
155- : # default build
156- <link>shared
157- : # usage requirements
158- <link>static:<define>BOOST_NUMPY_STATIC_LIB
159- <python-debugging>on:<define>BOOST_DEBUG_PYTHON
160- ;
161- }
162-
163- libraries = ;
164-
165- for local N in 2 3
166- {
167- if $(py$(N)-version)
168- {
169- lib_boost_python $(py$(N)-version) ;
170- libraries += $(lib_boost_python($(py$(N)-version))) ;
171- }
172- else
173- {
174- alias $(lib_boost_python($(N))) ;
175- }
176- if $(py$(N)-version) && [ python.numpy ]
177- {
178- lib_boost_numpy $(py$(N)-version) ;
179- libraries += $(lib_boost_numpy($(py$(N)-version))) ;
180- }
181- else
182- {
183- alias $(lib_boost_numpy($(N))) ;
184- }
185- }
186-
187- boost-install $(libraries) ;
41+ lib boost_python
42+ : # sources
43+ list.cpp
44+ long.cpp
45+ dict.cpp
46+ tuple.cpp
47+ str.cpp
48+ slice.cpp
49+
50+ converter/from_python.cpp
51+ converter/registry.cpp
52+ converter/type_id.cpp
53+ object/enum.cpp
54+ object/class.cpp
55+ object/function.cpp
56+ object/inheritance.cpp
57+ object/life_support.cpp
58+ object/pickle_support.cpp
59+ errors.cpp
60+ module.cpp
61+ converter/builtin_converters.cpp
62+ converter/arg_to_python_base.cpp
63+ object/iterator.cpp
64+ object/stl_iterator.cpp
65+ object_protocol.cpp
66+ object_operators.cpp
67+ wrapper.cpp
68+ import.cpp
69+ exec.cpp
70+ object/function_doc_signature.cpp
71+ : # requirements
72+ <link>static:<define>BOOST_PYTHON_STATIC_LIB
73+ <define>BOOST_PYTHON_SOURCE
74+
75+ # On Windows, all code using Python has to link to the Python
76+ # import library.
77+ #
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.
83+ #
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 ]
88+
89+ # we prevent building when there is no python available
90+ # as it's not possible anyway, and to cause dependents to
91+ # fail to build
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
96+ <tag>@$(__name__).python-tag
97+ <conditional>@python.require-py
98+
99+ : # default build
100+ <link>shared
101+ : # usage requirements
102+ <link>static:<define>BOOST_PYTHON_STATIC_LIB
103+ <python-debugging>on:<define>BOOST_DEBUG_PYTHON
104+ ;
105+
106+ numpy-include = [ python.numpy-include ] ;
107+ lib boost_numpy
108+ : # sources
109+ numpy/dtype.cpp
110+ numpy/matrix.cpp
111+ numpy/ndarray.cpp
112+ numpy/numpy.cpp
113+ numpy/scalars.cpp
114+ numpy/ufunc.cpp
115+ : # requirements
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
124+ <tag>@$(__name__).python-tag
125+ <conditional>@python.require-py
126+
127+ : # default build
128+ <link>shared
129+ : # usage requirements
130+ <link>static:<define>BOOST_NUMPY_STATIC_LIB
131+ <python-debugging>on:<define>BOOST_DEBUG_PYTHON
132+ ;
0 commit comments