16
16
# You need to provide the include path and lib path in the variables
17
17
# PTW32_INCLUDE and PTW32_LIB respectively. You can specify these
18
18
# paths in site-config.jam, user-config.jam or in the environment.
19
+ # Additionally, you can provide PTW32_LIB_NAME to overwrite the name hardcoded
20
+ # by Boost.Thread.
19
21
# A new feature is provided to request a specific API:
20
22
# <threadapi>win32 and <threadapi>pthread.
21
23
#
@@ -165,12 +167,16 @@ rule win32_pthread_paths ( properties * )
165
167
local result ;
166
168
local PTW32_INCLUDE ;
167
169
local PTW32_LIB ;
168
- PTW32_INCLUDE = [ modules.peek : PTW32_INCLUDE ] ;
169
- PTW32_LIB = [ modules.peek : PTW32_LIB ] ;
170
- PTW32_INCLUDE ?= [ modules.peek user-config : PTW32_INCLUDE ] ;
171
- PTW32_LIB ?= [ modules.peek user-config : PTW32_LIB ] ;
172
- PTW32_INCLUDE ?= [ modules.peek site-config : PTW32_INCLUDE ] ;
173
- PTW32_LIB ?= [ modules.peek site-config : PTW32_LIB ] ;
170
+ local PTW32_LIB_NAME ;
171
+ PTW32_INCLUDE = [ modules.peek : PTW32_INCLUDE ] ;
172
+ PTW32_LIB = [ modules.peek : PTW32_LIB ] ;
173
+ PTW32_LIB_NAME = [ modules.peek : PTW32_LIB_NAME ] ;
174
+ PTW32_INCLUDE ?= [ modules.peek user-config : PTW32_INCLUDE ] ;
175
+ PTW32_LIB ?= [ modules.peek user-config : PTW32_LIB ] ;
176
+ PTW32_LIB_NAME ?= [ modules.peek user-config : PTW32_LIB_NAME ] ;
177
+ PTW32_INCLUDE ?= [ modules.peek site-config : PTW32_INCLUDE ] ;
178
+ PTW32_LIB ?= [ modules.peek site-config : PTW32_LIB ] ;
179
+ PTW32_LIB_NAME ?= [ modules.peek site-config : PTW32_LIB_NAME ] ;
174
180
175
181
if ! ( $(PTW32_INCLUDE) && $(PTW32_LIB) )
176
182
{
@@ -192,16 +198,23 @@ rule win32_pthread_paths ( properties * )
192
198
{
193
199
local include_path = [ path.make $(PTW32_INCLUDE) ] ;
194
200
local lib_path = [ path.make $(PTW32_LIB) ] ;
195
- local libname = pthread ;
201
+ local libname = $(PTW32_LIB_NAME) ;
196
202
if <toolset>msvc in $(properties)
197
203
{
198
- libname = $(libname)VC2.lib ;
204
+ if ! $(libname)
205
+ {
206
+ libname = libpthreadVC2.lib ;
207
+ }
208
+ lib_path = [ path.glob $(lib_path) : $(libname) ] ;
199
209
}
200
210
if <toolset>gcc in $(properties)
201
211
{
202
- libname = lib$(libname)GC2.a ;
212
+ if ! $(libname)
213
+ {
214
+ libname = libpthreadGC2.a ;
215
+ }
216
+ lib_path = [ path.glob $(lib_path) : $(libname) ] ;
203
217
}
204
- lib_path = [ path.glob $(lib_path) : $(libname) ] ;
205
218
if ! $(lib_path)
206
219
{
207
220
if ! $(.notified)
@@ -210,6 +223,7 @@ rule win32_pthread_paths ( properties * )
210
223
echo "Trying to build Boost.Thread with pthread support." ;
211
224
echo "But the library" $(libname) "could not be found in path" ;
212
225
echo $(PTW32_LIB) ;
226
+ echo "You can force the library name by setting PTW32_LIB_NAME " ;
213
227
echo "************************************************************" ;
214
228
.notified = true ;
215
229
}
@@ -316,4 +330,4 @@ lib boost_thread
316
330
<conditional>@usage-requirements
317
331
;
318
332
319
- boost-install boost_thread ;
333
+ boost-install boost_thread ;
0 commit comments