diff --git a/boost-context-features.jam b/boost-context-features.jam new file mode 100644 index 00000000..ff3265e2 --- /dev/null +++ b/boost-context-features.jam @@ -0,0 +1,60 @@ +# Copyright René Ferdinand Rivera Morell 2023-2024 +# 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) + +import feature ; +import os ; + +feature.feature segmented-stacks : on : optional propagated composite ; +feature.compose on : BOOST_USE_SEGMENTED_STACKS ; + +feature.feature htm : tsx : optional propagated composite ; +feature.compose tsx : BOOST_USE_TSX ; + +feature.feature valgrind : on : optional propagated composite ; +feature.compose on : BOOST_USE_VALGRIND ; + +local rule default_binary_format ( ) +{ + local tmp = elf ; + if [ os.name ] = "NT" { tmp = pe ; } + else if [ os.name ] = "CYGWIN" { tmp = pe ; } + else if [ os.name ] = "AIX" { tmp = xcoff ; } + else if [ os.name ] = "MACOSX" { tmp = mach-o ; } + return $(tmp) ; +} + +feature.feature binary-format + : elf + mach-o + pe + xcoff + : propagated + ; +feature.set-default binary-format : [ default_binary_format ] ; + +local rule default_abi ( ) +{ + local tmp = sysv ; + if [ os.name ] = "NT" { tmp = ms ; } + else if [ os.name ] = "CYGWIN" { tmp = ms ; } + else if [ os.platform ] in "ARM" "ARM64" { tmp = aapcs ; } + else if [ os.platform ] = "MIPS32" { tmp = o32 ; } + else if [ os.platform ] = "MIPS64" { tmp = n64 ; } + return $(tmp) ; +} + +feature.feature abi + : aapcs + eabi + ms + n32 + n64 + o32 + o64 + sysv + x32 + : propagated + ; +feature.set-default abi : [ default_abi ] ; diff --git a/build.jam b/build.jam new file mode 100644 index 00000000..28de7941 --- /dev/null +++ b/build.jam @@ -0,0 +1,39 @@ +# Copyright René Ferdinand Rivera Morell 2023-2024 +# 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) + +require-b2 5.2 ; + +import-search /boost/predef/tools/check ; + +import predef ; +import boost-context-features ; + +constant boost_dependencies : + /boost/assert//boost_assert + /boost/config//boost_config + /boost/core//boost_core + /boost/mp11//boost_mp11 + /boost/pool//boost_pool + /boost/predef//boost_predef + /boost/smart_ptr//boost_smart_ptr ; + +project /boost/context + : common-requirements + include + : requirements + # Auto-detect toolset default address-model and architecture. + [ predef.address-model ] + [ predef.architecture ] + ; + +explicit + [ alias boost_context : build//boost_context ] + [ alias all : boost_context test ] + ; + +call-if : boost-library context + : install boost_context + ; + diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 5e7690d2..2a753bde 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -6,24 +6,18 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +import-search /boost/config/checks ; + import common ; -import feature ; import indirect ; import modules ; import os ; import toolset ; - import ../../config/checks/config : requires ; - -feature.feature segmented-stacks : on : optional propagated composite ; -feature.compose on : BOOST_USE_SEGMENTED_STACKS ; - -feature.feature htm : tsx : optional propagated composite ; -feature.compose tsx : BOOST_USE_TSX ; - -feature.feature valgrind : on : optional propagated composite ; -feature.compose on : BOOST_USE_VALGRIND ; +import config : requires ; +import feature ; -project boost/context +project + : common-requirements $(boost_dependencies) : requirements windows:_WIN32_WINNT=0x0601 linux,gcc,on:-fsplit-stack @@ -48,59 +42,13 @@ project boost/context msvc,32:/safeseh : usage-requirements shared:BOOST_CONTEXT_DYN_LINK=1 + BOOST_CONTEXT_NO_LIB=1 speed:BOOST_DISABLE_ASSERTS release:BOOST_DISABLE_ASSERTS : source-location ../src ; -local rule default_binary_format ( ) -{ - local tmp = elf ; - if [ os.name ] = "NT" { tmp = pe ; } - else if [ os.name ] = "CYGWIN" { tmp = pe ; } - else if [ os.name ] = "AIX" { tmp = xcoff ; } - else if [ os.name ] = "MACOSX" { tmp = mach-o ; } - return $(tmp) ; -} - -feature.feature binary-format - : elf - mach-o - pe - xcoff - : propagated - ; -feature.set-default binary-format : [ default_binary_format ] ; - - -local rule default_abi ( ) -{ - local tmp = sysv ; - 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) ; -} - -feature.feature abi - : aapcs - eabi - ms - n32 - n64 - o32 - o64 - sysv - x32 - : propagated - ; -feature.set-default abi : [ default_abi ] ; - - feature.feature context-impl : fcontext ucontext @@ -112,6 +60,7 @@ feature.set-default context-impl : fcontext ; feature.compose ucontext : BOOST_USE_UCONTEXT ; feature.compose winfib : BOOST_USE_WINFIB ; + # ARM # ARM/AAPCS/ELF alias asm_sources @@ -860,7 +809,7 @@ alias asm_sources pe msvc ; - + # Embarcadero on Windows, bcc64, uses the sysv-elf format for 64-bits # This is configured in the embarcadero toolset as using bcc64 with the # command line option '-x assembler-with-cpp'. @@ -997,5 +946,3 @@ lib boost_context : impl_sources stack_traits_sources ; - -boost-install boost_context ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 54019a20..dbd6a9f1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -12,12 +12,16 @@ import modules ; import os ; import testing ; import toolset ; -import ../../config/checks/config : requires ; +import-search /boost/config/checks ; +import config : requires ; using flags ; project boost/context/test : requirements + /boost/array//boost_array + /boost/lexical_cast//boost_lexical_cast /boost/context//boost_context + /boost/variant//boost_variant linux,gcc,on:-fsplit-stack linux,gcc,on:-DBOOST_USE_SEGMENTED_STACKS clang,on:-fsplit-stack