diff --git a/build.jam b/build.jam new file mode 100644 index 000000000..aac1c89ec --- /dev/null +++ b/build.jam @@ -0,0 +1,19 @@ +# 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 ; + +project /boost/log ; + +explicit + [ alias boost_log : build//boost_log ] + [ alias boost_log_setup : build//boost_log_setup ] + [ alias boost_log_with_support : build//boost_log_with_support ] + [ alias all : boost_log boost_log_setup boost_log_with_support example test ] + ; + +call-if : boost-library log + : install boost_log boost_log_setup + ; diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index dfb6a65a4..5711b8c35 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -12,53 +12,120 @@ import path ; import project ; import feature ; import configure ; +import-search /boost/config/checks ; import config : requires ; import log-arch-config ; import log-platform-config ; import log-build-config ; +import-search /boost/predef/tools/check ; +import predef ; using mc ; -local here = [ modules.binding $(__name__) ] ; - -project.push-current [ project.current ] ; -project.load [ path.join [ path.make $(here:D) ] ../config/x86-ext ] ; -project.pop-current ; - # Windows libs -lib psapi ; -lib advapi32 ; -lib secur32 ; -lib ws2_32 ; -lib mswsock ; +searched-lib psapi ; +searched-lib advapi32 ; +searched-lib secur32 ; +searched-lib ws2_32 ; +searched-lib mswsock ; explicit psapi advapi32 secur32 ws2_32 mswsock ; # UNIX libs -lib rt ; -lib socket ; -lib nsl ; -lib ipv6 ; +searched-lib rt ; +searched-lib socket ; +searched-lib nsl ; +searched-lib ipv6 ; explicit rt socket nsl ipv6 ; -local log_cxx_public_requirements = [ requires +constant boost_log_public_deps : + /boost/assert//boost_assert + /boost/config//boost_config + /boost/core//boost_core + /boost/date_time//boost_date_time + /boost/filesystem//boost_filesystem + /boost/function_types//boost_function_types + /boost/fusion//boost_fusion + /boost/intrusive//boost_intrusive + /boost/move//boost_move + /boost/mpl//boost_mpl + /boost/parameter//boost_parameter + /boost/phoenix//boost_phoenix + /boost/predef//boost_predef + /boost/preprocessor//boost_preprocessor + /boost/proto//boost_proto + /boost/range//boost_range + /boost/smart_ptr//boost_smart_ptr + /boost/system//boost_system + /boost/throw_exception//boost_throw_exception + /boost/type_index//boost_type_index + /boost/type_traits//boost_type_traits + /boost/utility//boost_utility + :/boost/winapi//boost_winapi + [ requires cxx11_static_assert - ] ; + ] + ; -local log_cxx_private_requirements = [ requires +constant boost_log_private_deps : + /boost/align//boost_align + /boost/asio//boost_asio + /boost/bind//boost_bind + /boost/exception//boost_exception + /boost/interprocess//boost_interprocess + /boost/optional//boost_optional + /boost/random//boost_random + /boost/spirit//boost_spirit + [ requires cxx11_lambdas - ] ; + ] + ; -local log_setup_cxx_public_requirements = [ requires +constant boost_log_setup_public_deps : + /boost/assert//boost_assert + /boost/config//boost_config + /boost/core//boost_core + /boost/iterator//boost_iterator + /boost/move//boost_move + /boost/optional//boost_optional + /boost/parameter//boost_parameter + /boost/phoenix//boost_phoenix + /boost/preprocessor//boost_preprocessor + /boost/property_tree//boost_property_tree + /boost/smart_ptr//boost_smart_ptr + /boost/type_traits//boost_type_traits + [ requires cxx11_static_assert cxx11_unified_initialization_syntax - ] ; + ] + ; -local log_setup_cxx_public_requirements = [ requires +constant boost_log_setup_private_deps : + /boost/asio//boost_asio + /boost/bind//boost_bind + /boost/date_time//boost_date_time + /boost/exception//boost_exception + /boost/filesystem//boost_filesystem + /boost/io//boost_io + /boost/log//boost_log + /boost/spirit//boost_spirit + /boost/throw_exception//boost_throw_exception + /boost/utility//boost_utility + [ requires cxx11_lambdas - ] ; + ] + ; -project boost/log +constant boost_log_support_public_deps : + /boost/log//boost_log + /boost/exception//boost_exception + /boost/spirit//boost_spirit + /boost/xpressive//boost_xpressive + ; + +project : source-location ../src + : common-requirements + ../include : requirements @log-arch-config.check-instruction-set @log-build-config.check-atomic-int32 @@ -129,6 +196,10 @@ project boost/log freebsd:rt qnxnto:socket pgi:rt + + # Set these to computed values according to the build. + [ predef.address-model ] + [ predef.architecture ] : usage-requirements clang:-Wno-bind-to-temporary-copy clang:-Wno-unused-function @@ -218,16 +289,16 @@ rule select-arch-specific-sources ( properties * ) { local result ; - if x86 in [ log-arch-config.deduce-architecture $(properties) ] + if x86 in $(properties) { - local has_ssse3 = [ configure.builds /boost/log/x86-extensions//ssse3 : $(properties) : "compiler supports SSSE3" ] ; + local has_ssse3 = [ configure.builds /boost/log/config/x86-ext//ssse3 : $(properties) : "compiler supports SSSE3" ] ; if $(has_ssse3) { result += BOOST_LOG_USE_SSSE3 ; result += $(BOOST_LOG_COMMON_SSSE3_SRC) ; } - local has_avx2 = [ configure.builds /boost/log/x86-extensions//avx2 : $(properties) : "compiler supports AVX2" ] ; + local has_avx2 = [ configure.builds /boost/log/config/x86-ext//avx2 : $(properties) : "compiler supports AVX2" ] ; if $(has_avx2) { result += BOOST_LOG_USE_AVX2 ; @@ -302,13 +373,14 @@ lib boost_log @select-platform-specific-sources shared:BOOST_LOG_DLL BOOST_LOG_BUILDING_THE_LIB=1 - $(log_cxx_public_requirements) - $(log_cxx_private_requirements) + $(boost_log_private_deps) + $(boost_log_public_deps) : ## default-build ## : ## usage-requirements ## shared:BOOST_LOG_DYN_LINK=1 single:BOOST_LOG_NO_THREADS - $(log_cxx_public_requirements) + BOOST_LOG_NO_LIB=1 + $(boost_log_public_deps) ; @@ -344,14 +416,19 @@ lib boost_log_setup shared:BOOST_LOG_DYN_LINK=1 shared:BOOST_LOG_SETUP_DLL BOOST_LOG_SETUP_BUILDING_THE_LIB=1 - $(log_setup_cxx_public_requirements) - $(log_setup_cxx_private_requirements) - boost_log + $(boost_log_setup_private_deps) + $(boost_log_setup_public_deps) : ## default-build ## : ## usage-requirements ## shared:BOOST_LOG_SETUP_DYN_LINK=1 single:BOOST_LOG_NO_THREADS - $(log_setup_cxx_public_requirements) + BOOST_LOG_SETUP_NO_LIB=1 + $(boost_log_setup_public_deps) ; -boost-install boost_log boost_log_setup ; +alias boost_log_with_support + : requirements + $(boost_log_support_public_deps) + : usage-requirements + $(boost_log_support_public_deps) + ; diff --git a/build/log-arch-config.jam b/build/log-arch-config.jam index ee410ce1e..b5438ff00 100644 --- a/build/log-arch-config.jam +++ b/build/log-arch-config.jam @@ -13,68 +13,22 @@ import path ; import property ; import feature ; -local here = [ modules.binding $(__name__) ] ; - -project.push-current [ project.current ] ; -project.load [ path.join [ path.make $(here:D) ] ../../config/checks/architecture ] ; -project.pop-current ; - rule deduce-address-model ( properties * ) { - local address_model = [ feature.get-values "address-model" : $(properties) ] ; - if $(address_model) - { - return $(address_model) ; - } - else - { - if [ configure.builds /boost/architecture//32 : $(properties) : 32-bit ] - { - return 32 ; - } - else if [ configure.builds /boost/architecture//64 : $(properties) : 64-bit ] - { - return 64 ; - } - } + # The address-model is always set to a deduced value using the predef.address-model checks. + return [ feature.get-values : $(properties) ] ; } rule deduce-architecture ( properties * ) { - local architecture = [ feature.get-values "architecture" : $(properties) ] ; - if $(architecture) - { - return $(architecture) ; - } - else - { - if [ configure.builds /boost/architecture//x86 : $(properties) : x86 ] - { - return x86 ; - } - else if [ configure.builds /boost/architecture//arm : $(properties) : arm ] - { - return arm ; - } - else if [ configure.builds /boost/architecture//mips : $(properties) : mips ] - { - return mips ; - } - else if [ configure.builds /boost/architecture//power : $(properties) : power ] - { - return power ; - } - else if [ configure.builds /boost/architecture//sparc : $(properties) : sparc ] - { - return sparc ; - } - } + # The architecture is always set to a deduced value using the predef.architecture checks. + return [ feature.get-values : $(properties) ] ; } rule deduce-instruction-set ( properties * ) { local result ; - local instruction_set = [ feature.get-values "instruction-set" : $(properties) ] ; + local instruction_set = [ feature.get-values : $(properties) ] ; if $(instruction_set) { @@ -95,7 +49,6 @@ rule deduce-instruction-set ( properties * ) rule ssse3-flags ( properties * ) { local result ; - if intel in $(properties) { if win in $(properties) @@ -111,7 +64,7 @@ rule ssse3-flags ( properties * ) { # MSVC doesn't really care about these switches, all SSE intrinsics are always available, but still... # Also 64 bit MSVC doesn't have the /arch:SSE2 switch as it is the default. - if 32 in [ deduce-address-model $(properties) ] + if 32 in $(properties) { result = "/arch:SSE2" ; } diff --git a/build/log-build-config.jam b/build/log-build-config.jam index 51cc31279..e32e720d6 100644 --- a/build/log-build-config.jam +++ b/build/log-build-config.jam @@ -12,16 +12,6 @@ import path ; import property ; import feature ; -local here = [ modules.binding $(__name__) ] ; - -project.push-current [ project.current ] ; -project.load [ path.join [ path.make $(here:D) ] ../config/message-compiler ] ; -project.load [ path.join [ path.make $(here:D) ] ../config/pthread-mutex-robust ] ; -project.load [ path.join [ path.make $(here:D) ] ../config/native-syslog ] ; -project.load [ path.join [ path.make $(here:D) ] ../config/atomic-int32 ] ; -project.load [ path.join [ path.make $(here:D) ] ../config/regex-header-only ] ; -project.pop-current ; - rule has-config-flag ( flag : properties * ) { if ( "$(flag)" in $(properties) || "$(flag)=1" in $(properties) ) @@ -38,7 +28,7 @@ rule check-regex-header-only ( properties * ) { local result ; - local has_regex_header_only = [ configure.builds /boost/log/regex-header-only//regex_header_only : $(properties) : "Boost.Regex is header-only" ] ; + local has_regex_header_only = [ configure.builds /boost/log/config/regex-header-only//regex_header_only : $(properties) : "Boost.Regex is header-only" ] ; if ! $(has_regex_header_only) { result = /boost/regex//boost_regex ; @@ -51,7 +41,7 @@ rule check-atomic-int32 ( properties * ) { local result ; - local has_atomic_int32 = [ configure.builds /boost/log/atomic-int32//atomic_int32 : $(properties) : "native atomic int32 supported" ] ; + local has_atomic_int32 = [ configure.builds /boost/log/config/atomic-int32//atomic_int32 : $(properties) : "native atomic int32 supported" ] ; if ! $(has_atomic_int32) { result = BOOST_LOG_WITHOUT_IPC ; @@ -64,7 +54,7 @@ rule check-pthread-mutex-robust ( properties * ) { local result ; - local has_pthread_mutex_robust = [ configure.builds /boost/log/pthread-mutex-robust//pthread_mutex_robust : $(properties) : "pthread supports robust mutexes" ] ; + local has_pthread_mutex_robust = [ configure.builds /boost/log/config/pthread-mutex-robust//pthread_mutex_robust : $(properties) : "pthread supports robust mutexes" ] ; if $(has_pthread_mutex_robust) { result = BOOST_LOG_HAS_PTHREAD_MUTEX_ROBUST ; @@ -79,7 +69,7 @@ rule check-native-syslog ( properties * ) if ! [ has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ] { - local has_native_syslog = [ configure.builds /boost/log/native-syslog//native_syslog : $(properties) : "native syslog supported" ] ; + local has_native_syslog = [ configure.builds /boost/log/config/native-syslog//native_syslog : $(properties) : "native syslog supported" ] ; if $(has_native_syslog) { result = BOOST_LOG_USE_NATIVE_SYSLOG ; @@ -97,7 +87,7 @@ rule check-message-compiler ( properties * ) { if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ] { - local has_mc = [ configure.builds /boost/log/message-compiler//test-availability : $(properties) : "has message compiler" ] ; + local has_mc = [ configure.builds /boost/log/config/message-compiler//test-availability : $(properties) : "has message compiler" ] ; if ! $(has_mc) { result = BOOST_LOG_WITHOUT_EVENT_LOG ; diff --git a/build/log-platform-config.jam b/build/log-platform-config.jam index 93b31431b..d83d41f12 100644 --- a/build/log-platform-config.jam +++ b/build/log-platform-config.jam @@ -12,12 +12,6 @@ import path ; import property ; import feature ; -local here = [ modules.binding $(__name__) ] ; - -project.push-current [ project.current ] ; -project.load [ path.join [ path.make $(here:D) ] ../config/xopen-source-600 ] ; -project.pop-current ; - rule set-platform-defines ( properties * ) { local result ; @@ -49,7 +43,7 @@ rule set-platform-defines ( properties * ) { # Solaris headers are broken and cannot be included in C++03 when _XOPEN_SOURCE=600. At the same time, they cannot be included with _XOPEN_SOURCE=500 in C++11 and later. # This is because the system headers check the C language version and error out if the version does not match. We have to test if we can request _XOPEN_SOURCE=600. - if [ configure.builds /boost/log/xopen-source-600//xopen_source_600 : $(properties) : xopen-source-600-supported ] + if [ configure.builds /boost/log/config/xopen-source-600//xopen_source_600 : $(properties) : xopen-source-600-supported ] { result += _XOPEN_SOURCE=600 ; } diff --git a/config/atomic-int32/Jamfile.jam b/config/atomic-int32/Jamfile.jam index 2f8d4baf2..308ce9417 100644 --- a/config/atomic-int32/Jamfile.jam +++ b/config/atomic-int32/Jamfile.jam @@ -6,9 +6,9 @@ # import project ; -import log-platform-config ; +import ../../build/log-platform-config ; -project /boost/log/atomic-int32 +project : source-location . : requirements @log-platform-config.set-platform-defines diff --git a/config/build.jam b/config/build.jam new file mode 100644 index 000000000..551de845f --- /dev/null +++ b/config/build.jam @@ -0,0 +1,14 @@ +# Copyright René Ferdinand Rivera Morell +# 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-search /boost/predef/tools/check ; +import predef ; + +project + : requirements + # Set these to computed values according to the build. + [ predef.address-model ] + [ predef.architecture ] + ; diff --git a/config/message-compiler/Jamfile.jam b/config/message-compiler/Jamfile.jam index 6716021bb..a42b801ec 100644 --- a/config/message-compiler/Jamfile.jam +++ b/config/message-compiler/Jamfile.jam @@ -9,7 +9,7 @@ import project ; import log-platform-config ; using mc ; -project /boost/log/message-compiler +project : source-location ../../src : requirements @log-platform-config.set-platform-defines diff --git a/config/native-syslog/Jamfile.jam b/config/native-syslog/Jamfile.jam index dd9143f50..3c8915404 100644 --- a/config/native-syslog/Jamfile.jam +++ b/config/native-syslog/Jamfile.jam @@ -8,7 +8,7 @@ import project ; import log-platform-config ; -project /boost/log/native-syslog +project : source-location . : requirements @log-platform-config.set-platform-defines diff --git a/config/pthread-mutex-robust/Jamfile.jam b/config/pthread-mutex-robust/Jamfile.jam index ac3de06bd..49cd19935 100644 --- a/config/pthread-mutex-robust/Jamfile.jam +++ b/config/pthread-mutex-robust/Jamfile.jam @@ -8,7 +8,7 @@ import project ; import log-platform-config ; -project /boost/log/pthread-mutex-robust +project : source-location . : requirements @log-platform-config.set-platform-defines diff --git a/config/regex-header-only/Jamfile.jam b/config/regex-header-only/Jamfile.jam index 90d28e94f..4f5873eee 100644 --- a/config/regex-header-only/Jamfile.jam +++ b/config/regex-header-only/Jamfile.jam @@ -8,7 +8,7 @@ import project ; import log-platform-config ; -project /boost/log/regex-header-only +project : source-location . : requirements @log-platform-config.set-platform-defines diff --git a/config/x86-ext/Jamfile.jam b/config/x86-ext/Jamfile.jam index 5379dbd16..a010067e7 100644 --- a/config/x86-ext/Jamfile.jam +++ b/config/x86-ext/Jamfile.jam @@ -6,9 +6,9 @@ # import project ; -import log-arch-config ; +import ../../build/log-arch-config ; -project /boost/log/x86-extensions +project : source-location . : requirements off diff --git a/config/xopen-source-600/Jamfile.jam b/config/xopen-source-600/Jamfile.jam index d2a28ad56..b35fa4652 100644 --- a/config/xopen-source-600/Jamfile.jam +++ b/config/xopen-source-600/Jamfile.jam @@ -7,7 +7,7 @@ import project ; -project /boost/log/xopen-source-600 +project : source-location . : requirements off diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index adc588260..46bd2bdb8 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -86,57 +86,57 @@ local doxygen_params = local top_level_includes = [ glob - ../../../boost/log/*.hpp + ../include/boost/log/*.hpp ] ; local core_includes = [ glob - ../../../boost/log/core/*.hpp + ../include/boost/log/core/*.hpp ] ; local attributes_includes = [ glob - ../../../boost/log/attributes/*.hpp + ../include/boost/log/attributes/*.hpp ] ; local expressions_includes = [ glob - ../../../boost/log/expressions/*.hpp - ../../../boost/log/expressions/predicates/*.hpp - ../../../boost/log/expressions/formatters/*.hpp + ../include/boost/log/expressions/*.hpp + ../include/boost/log/expressions/predicates/*.hpp + ../include/boost/log/expressions/formatters/*.hpp ] ; local sources_includes = [ glob - ../../../boost/log/sources/*.hpp + ../include/boost/log/sources/*.hpp ] ; local sinks_includes = [ set.difference # Document all these files... [ glob - ../../../boost/log/sinks/*.hpp + ../include/boost/log/sinks/*.hpp ] : # ...except these [ glob - ../../../boost/log/sinks/nt6_event_log*.hpp + ../include/boost/log/sinks/nt6_event_log*.hpp ] ] ; local utility_includes = [ glob - ../../../boost/log/utility/*.hpp - ../../../boost/log/utility/ipc/*.hpp - ../../../boost/log/utility/setup/*.hpp - ../../../boost/log/utility/type_dispatch/*.hpp - ../../../boost/log/utility/functional/*.hpp - ../../../boost/log/utility/manipulators/*.hpp + ../include/boost/log/utility/*.hpp + ../include/boost/log/utility/ipc/*.hpp + ../include/boost/log/utility/setup/*.hpp + ../include/boost/log/utility/type_dispatch/*.hpp + ../include/boost/log/utility/functional/*.hpp + ../include/boost/log/utility/manipulators/*.hpp ] ; local support_includes = [ glob - ../../../boost/log/support/*.hpp + ../include/boost/log/support/*.hpp ] ; diff --git a/example/doc/Jamfile.v2 b/example/doc/Jamfile.v2 index 1a1fe4059..c84959ef1 100644 --- a/example/doc/Jamfile.v2 +++ b/example/doc/Jamfile.v2 @@ -29,7 +29,7 @@ rule check-message-compiler ( properties * ) { if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ] { - local has_mc = [ configure.builds /boost/log/message-compiler//test-availability : $(properties) : message-compiler ] ; + local has_mc = [ configure.builds /boost/log/config/message-compiler//test-availability : $(properties) : message-compiler ] ; if ! $(has_mc) { result = BOOST_LOG_WITHOUT_EVENT_LOG ; @@ -89,6 +89,9 @@ project /boost/date_time//boost_date_time /boost/filesystem//boost_filesystem /boost/thread//boost_thread + /boost/lambda//boost_lambda + /boost/scope_exit//boost_scope_exit + /boost/format//boost_format multi ; diff --git a/example/event_log/Jamfile.v2 b/example/event_log/Jamfile.v2 index ab80036d4..89e652d05 100644 --- a/example/event_log/Jamfile.v2 +++ b/example/event_log/Jamfile.v2 @@ -29,7 +29,7 @@ rule check-message-compiler ( properties * ) { if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ] { - local has_mc = [ configure.builds /boost/log/message-compiler//test-availability : $(properties) : message-compiler ] ; + local has_mc = [ configure.builds /boost/log/config/message-compiler//test-availability : $(properties) : message-compiler ] ; if ! $(has_mc) { result += no ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index a3bb840f1..fe60de1ed 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -71,8 +71,8 @@ rule test_all if ! [ os.environ BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ] { - local headers_path = [ path.make $(BOOST_ROOT)/libs/log/include/boost/log ] ; - for file in [ path.glob-tree $(headers_path) : *.hpp : detail ] + local headers_path = ../include/boost/log ; + for file in [ glob-tree-ex $(headers_path) : *.hpp : detail ] { local rel_file = [ path.relative-to $(headers_path) $(file) ] ; # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.