|
30 | 30 | ; |
31 | 31 | } |
32 | 32 |
|
33 | | -project boost/python |
| 33 | +project |
34 | 34 | : source-location ../src |
35 | 35 | ; |
36 | 36 |
|
37 | 37 | rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } } |
38 | 38 | rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } } |
39 | 39 | local rule eq ( a : b ) { if $(a) = $(b) { return 1 ; } } |
40 | 40 |
|
| 41 | +rule tag ( name : type ? : property-set ) |
| 42 | +{ |
| 43 | + if python-tag in [ RULENAMES $(__name__) ] |
| 44 | + { |
| 45 | + return [ $(__name__).python-tag $(name) : $(type) : $(property-set) ] ; |
| 46 | + } |
| 47 | +} |
| 48 | + |
| 49 | +if [ python.configured ] |
| 50 | +{ |
| 51 | + |
41 | 52 | lib boost_python |
42 | 53 | : # sources |
43 | 54 | list.cpp |
@@ -92,8 +103,8 @@ lib boost_python |
92 | 103 | [ unless [ python.configured ] : <build>no ] |
93 | 104 | <dependency>config-warning |
94 | 105 | <python-debugging>on:<define>BOOST_DEBUG_PYTHON |
95 | | - -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag |
96 | | - <tag>@python-tag |
| 106 | + -<tag>@%boostcpp.tag |
| 107 | + <tag>@tag |
97 | 108 | <conditional>@python.require-py |
98 | 109 |
|
99 | 110 | : # default build |
@@ -103,6 +114,17 @@ lib boost_python |
103 | 114 | <python-debugging>on:<define>BOOST_DEBUG_PYTHON |
104 | 115 | ; |
105 | 116 |
|
| 117 | +} |
| 118 | +else |
| 119 | +{ |
| 120 | + |
| 121 | +alias boost_python : config-warning ; |
| 122 | + |
| 123 | +} |
| 124 | + |
| 125 | +if [ python.configured ] && [ python.numpy ] |
| 126 | +{ |
| 127 | + |
106 | 128 | numpy-include = [ python.numpy-include ] ; |
107 | 129 | lib boost_numpy |
108 | 130 | : # sources |
@@ -120,8 +142,8 @@ lib boost_numpy |
120 | 142 | <library>/python//numpy |
121 | 143 | <library>boost_python |
122 | 144 | <python-debugging>on:<define>BOOST_DEBUG_PYTHON |
123 | | - -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag |
124 | | - <tag>@python-tag |
| 145 | + -<tag>@%boostcpp.tag |
| 146 | + <tag>@tag |
125 | 147 | <conditional>@python.require-py |
126 | 148 |
|
127 | 149 | : # default build |
@@ -131,37 +153,10 @@ lib boost_numpy |
131 | 153 | <python-debugging>on:<define>BOOST_DEBUG_PYTHON |
132 | 154 | ; |
133 | 155 |
|
134 | | -# boost-install creates `stage` and `install` targets |
135 | | -# |
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 |
139 | | -# |
140 | | -# `install` installs the two libraries and their dependencies and is similar |
141 | | -# to issuing `b2 --with-python install` from top level |
142 | | - |
143 | | -if [ python.configured ] |
144 | | -{ |
145 | | - if [ python.numpy ] |
146 | | - { |
147 | | - boost-install boost_python boost_numpy ; |
148 | | - } |
149 | | - else |
150 | | - { |
151 | | - boost-install boost_python ; |
152 | | - } |
153 | 156 | } |
154 | 157 | else |
155 | 158 | { |
156 | 159 |
|
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 |
160 | | - |
161 | | -alias stage : config-warning ; |
162 | | -explicit stage ; |
163 | | - |
164 | | -alias install : config-warning ; |
165 | | -explicit install ; |
| 160 | +alias boost_numpy : config-warning ; |
166 | 161 |
|
167 | 162 | } |