diff --git a/build.jam b/build.jam new file mode 100644 index 000000000..d0caf573d --- /dev/null +++ b/build.jam @@ -0,0 +1,46 @@ +# 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 ; + +constant boost_dependencies : + /boost/assert//boost_assert + /boost/atomic//boost_atomic + /boost/bind//boost_bind + /boost/chrono//boost_chrono + /boost/concept_check//boost_concept_check + /boost/config//boost_config + /boost/container//boost_container + /boost/container_hash//boost_container_hash + /boost/core//boost_core + /boost/date_time//boost_date_time + /boost/exception//boost_exception + /boost/function//boost_function + /boost/io//boost_io + /boost/move//boost_move + /boost/optional//boost_optional + /boost/predef//boost_predef + /boost/preprocessor//boost_preprocessor + /boost/smart_ptr//boost_smart_ptr + /boost/static_assert//boost_static_assert + /boost/system//boost_system + /boost/throw_exception//boost_throw_exception + /boost/tuple//boost_tuple + /boost/type_traits//boost_type_traits + /boost/utility//boost_utility + /boost/winapi//boost_winapi ; + +project /boost/thread + ; + +explicit + [ alias boost_thread : build//boost_thread ] + [ alias all : boost_thread example test ] + ; + +call-if : boost-library thread + : install boost_thread + ; + diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 1a88d0102..5be59046a 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -35,18 +35,22 @@ import os ; import indirect ; import path ; -import configure ; +import configure ; import threadapi-feature ; exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ; -project boost/thread +project : source-location ../src + : common-requirements + $(boost_dependencies) + ../include : requirements multi #static:BOOST_THREAD_STATIC_LINK=1 #shared:BOOST_THREAD_DYN_LINK=1 static:BOOST_THREAD_BUILD_LIB=1 shared:BOOST_THREAD_BUILD_DLL=1 + -@%boostcpp.tag -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag @$(__name__).tag gcc:-Wno-long-long @@ -139,6 +143,7 @@ project boost/thread #BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED #BOOST_SYSTEM_NO_DEPRECATED #BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS + BOOST_THREAD_NO_LIB=1 ; rule tag ( name : type ? : property-set ) @@ -156,8 +161,15 @@ rule tag ( name : type ? : property-set ) } # forward to the boost tagging rule - return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag - $(result) : $(type) : $(property-set) ] ; + if $(BOOST_JAMROOT_MODULE) + { + return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag + $(result) : $(type) : $(property-set) ] ; + } + else + { + return $(result) ; + } } rule win32_pthread_paths ( properties * ) @@ -269,10 +281,10 @@ rule requirements ( properties * ) } } result += BOOST_THREAD_DONT_USE_CHRONO ; - if ! [ configure.builds has_atomic_flag_lockfree - : $(properties) : "lockfree boost::atomic_flag" ] { - result += /boost/atomic//boost_atomic ; - } + if ! [ configure.builds has_atomic_flag_lockfree + : $(properties) : "lockfree boost::atomic_flag" ] { + result += /boost/atomic//boost_atomic ; + } } else { if win32 in $(properties) { @@ -315,5 +327,3 @@ lib boost_thread static:BOOST_THREAD_USE_LIB=1 @usage-requirements ; - -boost-install boost_thread ; \ No newline at end of file diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index bfc8a59b3..fbdf760c5 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -4,7 +4,7 @@ # 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) -project boost/thread/example +project : requirements ../build//boost_thread multi ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 3f81bc07e..340f6c0aa 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -268,16 +268,15 @@ rule generate_self_contained_header_tests if ! [ os.environ BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ] { - local headers_path = [ path.make $(BOOST_ROOT)/libs/thread/include/boost/thread ] ; - for file in [ path.glob-tree $(headers_path) : *.hpp : detail pthread win32 ] + for file in [ glob-tree-ex ../include/boost/thread : *.hpp : detail pthread win32 ] { - local rel_file = [ path.relative-to $(headers_path) $(file) ] ; + local rel_file = [ path.relative-to ../include/boost/thread $(file) ] ; # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end. # All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes. local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ; #ECHO $(rel_file) ; - all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" $(file) : $(test_name) ] ; - all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" "BOOST_THREAD_TEST_POST_WINDOWS_H" $(file) @windows-cygwin-specific : $(test_name)-post_winh ] ; + all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" $(file) ../build//boost_thread : $(test_name) ] ; + all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" "BOOST_THREAD_TEST_POST_WINDOWS_H" $(file) @windows-cygwin-specific ../build//boost_thread : $(test_name)-post_winh ] ; } } @@ -1012,7 +1011,7 @@ rule generate_self_contained_header_tests #[ thread-run test_10128.cpp ] #[ thread-run test_10340.cpp ] ; - + explicit ts_more_cpp11 ; test-suite ts_more_cpp11 : @@ -1033,13 +1032,13 @@ rule generate_self_contained_header_tests : [ thread-run2-noit ./experimental/parallel/v1/exception_list_pass.cpp : exception_list_p ] ; - + #explicit ts_task_region ; test-suite ts_task_region : [ thread-run2-noit ./experimental/parallel/v2/task_region_pass.cpp : task_region_p ] ; - + explicit ts_other ; test-suite ts_other : @@ -1050,7 +1049,7 @@ rule generate_self_contained_header_tests explicit ts_ ; test-suite ts_ : - #[ thread-run test_11256.cpp ] + #[ thread-run test_11256.cpp ] #[ thread-run test_11256.cpp ] #[ thread-run test_11499.cpp ] #[ thread-run test_11611.cpp ] @@ -1060,7 +1059,7 @@ rule generate_self_contained_header_tests #[ thread-run test_12949.cpp ] #[ thread-run test_13480b.cpp ] [ thread-run test_13561.cpp ] - + ; explicit test_time_jumps_1_obj ;