Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions boost-context-features.jam
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import feature ;
import os ;
import property ;

feature.feature segmented-stacks : on : optional propagated composite ;
feature.compose <segmented-stacks>on : <define>BOOST_USE_SEGMENTED_STACKS ;
Expand Down Expand Up @@ -34,20 +35,35 @@ feature.feature binary-format
;
feature.set-default binary-format : [ default_binary_format ] ;

local rule default_abi ( )
rule default_abi ( properties * )
{
local tmp = sysv ;
local arch = [ property.select <architecture> : $(properties) ] ;

# Avoid using "in" operator here: it returns true if its left
# part is empty, which happens e.g. with os.platform on
# some uncommon architectures.
if [ os.name ] = "NT" { tmp = ms ; }
if <target-os>windows in $(properties) { tmp = ms ; }
else if <target-os>cygwin in $(properties) { tmp = ms ; }
else if [ os.name ] = "NT" { tmp = ms ; }
else if [ os.name ] = "CYGWIN" { tmp = ms ; }
else if [ os.platform ] = "ARM" { tmp = aapcs ; }
else if [ os.platform ] = "ARM64" { tmp = aapcs ; }
else if [ os.platform ] = "MIPS32" { tmp = o32 ; }
else if [ os.platform ] = "MIPS64" { tmp = n64 ; }
return $(tmp) ;
else if $(arch)
{
if <architecture>arm in $(properties) { tmp = aapcs ; }
else if <architecture>mips in $(properties)
{
if <address-model>64 in $(properties) { tmp = n64 ; }
else { tmp = o32 ; }
}
}
else
{
# Avoid using "in" operator here: it returns true if its left
# part is empty, which happens e.g. with os.platform on
# some uncommon architectures.
if [ os.platform ] = "ARM" { tmp = aapcs ; }
else if [ os.platform ] = "ARM64" { tmp = aapcs ; }
else if [ os.platform ] = "MIPS32" { tmp = o32 ; }
else if [ os.platform ] = "MIPS64" { tmp = n64 ; }
}
return <abi>$(tmp) ;
}

feature.feature abi
Expand All @@ -62,7 +78,7 @@ feature.feature abi
x32
: propagated
;
feature.set-default abi : [ default_abi ] ;
feature.set-default abi : sysv ;

feature.feature context-impl
: fcontext
Expand Down
2 changes: 2 additions & 0 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import modules ;
import os ;
import toolset ;
import config : requires ;
import boost-context-features ;

project
: common-requirements <library>$(boost_dependencies)
: requirements
<conditional>@boost-context-features.default_abi
<target-os>windows,<architecture>arm,<address-model>64:<context-impl>winfib
<target-os>windows:<define>_WIN32_WINNT=0x0601
<target-os>linux,<toolset>gcc,<segmented-stacks>on:<cxxflags>-fsplit-stack
Expand Down