mirror of
https://github.com/boostorg/thread.git
synced 2026-01-27 19:32:11 +00:00
66 lines
1.9 KiB
Plaintext
66 lines
1.9 KiB
Plaintext
# Copyright 2006 Roland Schwarz.
|
|
# Distributed under the Boost Software License, Version 1.0. (See
|
|
# accompanying file LICENSE_1_0.txt or copy at
|
|
# http://www.boost.org/LICENSE_1_0.txt)
|
|
#
|
|
# This work is a reimplementation along the design and ideas
|
|
# of William E. Kempf.
|
|
|
|
# find out if pthread is available on current build platform
|
|
rule threads::is-pthread-available
|
|
{
|
|
if $(OS) = "NT" {
|
|
if $(PTW32_INCLUDE) && $(PTW32_LIB) {
|
|
return true ;
|
|
}
|
|
else {
|
|
ECHO "******************************************************" ;
|
|
ECHO "Building Boost.Thread without pthread support" ;
|
|
ECHO "If you need pthread you should specify the paths." ;
|
|
ECHO "For example:" ;
|
|
ECHO "PTW32_INCLUDE=C:\\Program Files\\ptw32\\Pre-built2\\include" ;
|
|
ECHO "PTW32_LIB=C:\\Program Files\\ptw32\\Pre-built2\\lib\\pthreadVC2.lib" ;
|
|
ECHO "******************************************************" ;
|
|
}
|
|
}
|
|
else if $(OS) = "LINUX" {
|
|
return true ;
|
|
}
|
|
else { ## assume pthread is available on unknown os for now
|
|
return true ;
|
|
}
|
|
}
|
|
|
|
# find the native library variant for current build os
|
|
rule threads::is-native-on-build-os ( libvariant )
|
|
{
|
|
if $(OS) = "NT" {
|
|
if $(libvariant) = win32 { return true ; }
|
|
}
|
|
else if $(OS) = "LINUX" {
|
|
if $(libvariant) = pthread { return true ; }
|
|
}
|
|
else { ## assume pthread is native on others for now
|
|
if $(libvariant) = pthread { return true ; }
|
|
}
|
|
}
|
|
|
|
# utility to prepend the source path to the cpp sources
|
|
rule threads::cpp_source ( path : sources * )
|
|
{
|
|
return $(path)/$(sources).cpp ;
|
|
}
|
|
|
|
# impose the pthread library and include path on the requirements
|
|
rule threads::lib-pthread ( toolset variant : subvariant-path properties * )
|
|
{
|
|
if $(OS) = "NT" && $(PTW32_INCLUDE) && $(PTW32_LIB) {
|
|
properties = [ impose-requirements $(properties) :
|
|
<define>BOOST_HAS_PTHREADS
|
|
<include>$(PTW32_INCLUDE)
|
|
<library-file>$(PTW32_LIB) ] ;
|
|
}
|
|
|
|
return $(subvariant-path) $(properties) ;
|
|
}
|