diff --git a/boost-context-features.jam b/boost-context-features.jam index d0167fa5..988e6170 100644 --- a/boost-context-features.jam +++ b/boost-context-features.jam @@ -5,6 +5,7 @@ import feature ; import os ; +import property ; feature.feature segmented-stacks : on : optional propagated composite ; feature.compose on : BOOST_USE_SEGMENTED_STACKS ; @@ -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 : $(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 windows in $(properties) { tmp = ms ; } + else if 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 arm in $(properties) { tmp = aapcs ; } + else if mips in $(properties) + { + if 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 $(tmp) ; } feature.feature abi @@ -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 diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 1ba8a52b..24a81117 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -14,10 +14,12 @@ import modules ; import os ; import toolset ; import config : requires ; +import boost-context-features ; project : common-requirements $(boost_dependencies) : requirements + @boost-context-features.default_abi windows,arm,64:winfib windows:_WIN32_WINNT=0x0601 linux,gcc,on:-fsplit-stack