]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/log/build/Jamfile.v2
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / log / build / Jamfile.v2
1 #
2 # Copyright Andrey Semashev 2007 - 2020.
3 # Distributed under the Boost Software License, Version 1.0.
4 # (See accompanying file LICENSE_1_0.txt or copy at
5 # http://www.boost.org/LICENSE_1_0.txt)
6 #
7
8 import common ;
9 import modules ;
10 import os ;
11 import path ;
12 import project ;
13 import feature ;
14 import configure ;
15 import log-arch-config ;
16 import log-platform-config ;
17 using mc ;
18
19 local here = [ modules.binding $(__name__) ] ;
20
21 project.push-current [ project.current ] ;
22 project.load [ path.join [ path.make $(here:D) ] ../config/message-compiler ] ;
23 project.load [ path.join [ path.make $(here:D) ] ../config/x86-ext ] ;
24 project.load [ path.join [ path.make $(here:D) ] ../config/pthread-mutex-robust ] ;
25 project.load [ path.join [ path.make $(here:D) ] ../config/native-syslog ] ;
26 project.load [ path.join [ path.make $(here:D) ] ../config/atomic-int32 ] ;
27 project.pop-current ;
28
29 # Windows libs
30 lib psapi ;
31 lib advapi32 ;
32 lib secur32 ;
33 lib ws2_32 ;
34 lib mswsock ;
35 explicit psapi advapi32 secur32 ws2_32 mswsock ;
36
37 # UNIX libs
38 lib rt ;
39 lib socket ;
40 lib nsl ;
41 lib ipv6 ;
42 explicit rt socket nsl ipv6 ;
43
44 rule has-config-flag ( flag : properties * )
45 {
46 if ( "<define>$(flag)" in $(properties) || "<define>$(flag)=1" in $(properties) )
47 {
48 return 1 ;
49 }
50 else
51 {
52 return ;
53 }
54 }
55
56 rule check-instruction-set ( properties * )
57 {
58 local result ;
59 local instruction_set = [ log-arch-config.deduce-instruction-set $(properties) ] ;
60
61 if $(instruction_set) = i386 || $(instruction_set) = i486
62 {
63 if ! $(.annouced-failure)
64 {
65 ECHO Boost.Log is not supported on the specified target CPU and will not be built. At least i586 class CPU is required. ;
66 .annouced-failure = 1 ;
67 }
68 result = <build>no ;
69 }
70
71 return $(result) ;
72 }
73
74 rule select-regex-backend ( properties * )
75 {
76 local result ;
77
78 # Use Boost.Regex backend by default. It produces smaller executables and also has the best performance for small string matching.
79 if ! (
80 [ has-config-flag BOOST_LOG_WITHOUT_SETTINGS_PARSERS : $(properties) ] ||
81 [ has-config-flag BOOST_LOG_WITHOUT_DEFAULT_FACTORIES : $(properties) ] ||
82 [ has-config-flag BOOST_LOG_USE_STD_REGEX : $(properties) ] ||
83 [ has-config-flag BOOST_LOG_USE_BOOST_XPRESSIVE : $(properties) ] )
84 {
85 result = <library>/boost/regex//boost_regex ;
86 }
87
88 return $(result) ;
89 }
90
91 rule check-pthread-mutex-robust ( properties * )
92 {
93 local result ;
94
95 local has_pthread_mutex_robust = [ configure.builds /boost/log/pthread-mutex-robust//pthread_mutex_robust : $(properties) : "pthread supports robust mutexes" ] ;
96 if $(has_pthread_mutex_robust)
97 {
98 result = <define>BOOST_LOG_HAS_PTHREAD_MUTEX_ROBUST ;
99 }
100
101 return $(result) ;
102 }
103
104 rule check-atomic-int32 ( properties * )
105 {
106 local result ;
107
108 local has_atomic_int32 = [ configure.builds /boost/log/atomic-int32//atomic_int32 : $(properties) : "native atomic int32 supported" ] ;
109 if ! $(has_atomic_int32)
110 {
111 result = <define>BOOST_LOG_WITHOUT_IPC ;
112 }
113
114 return $(result) ;
115 }
116
117 rule check-native-syslog ( properties * )
118 {
119 local result ;
120
121 if ! [ has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ]
122 {
123 local has_native_syslog = [ configure.builds /boost/log/native-syslog//native_syslog : $(properties) : "native syslog supported" ] ;
124 if $(has_native_syslog)
125 {
126 result = <define>BOOST_LOG_USE_NATIVE_SYSLOG ;
127 }
128 }
129
130 return $(result) ;
131 }
132
133 rule check-message-compiler ( properties * )
134 {
135 local result ;
136
137 if <target-os>windows in $(properties)
138 {
139 if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
140 {
141 local has_mc = [ configure.builds /boost/log/message-compiler//test-availability : $(properties) : "has message compiler" ] ;
142 if ! $(has_mc)
143 {
144 result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
145 }
146 }
147 else
148 {
149 # This branch is needed to fix building with MinGW
150 result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
151 }
152 }
153 else
154 {
155 result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
156 }
157
158 return $(result) ;
159 }
160
161 project boost/log
162 : source-location ../src
163 : requirements
164 <conditional>@check-instruction-set
165 <conditional>@check-atomic-int32
166 <conditional>@select-regex-backend
167 <conditional>@check-pthread-mutex-robust
168 <conditional>@check-native-syslog
169 <conditional>@check-message-compiler
170 <conditional>@log-platform-config.set-platform-defines
171
172 <include>../src
173
174 <define>__STDC_CONSTANT_MACROS # Use system-defined macros for integer constants, if possible
175 <define>BOOST_SPIRIT_USE_PHOENIX_V3=1
176 <define>BOOST_THREAD_DONT_USE_CHRONO=1 # Don't introduce false dependency on Boost.Chrono
177
178 <c++-template-depth>1024
179
180 <toolset>msvc:<cxxflags>/bigobj
181 <toolset>msvc:<cxxflags>/wd4503 # decorated name length exceeded, name was truncated
182 <toolset>msvc:<cxxflags>/wd4456 # declaration of 'A' hides previous local declaration
183 <toolset>msvc:<cxxflags>/wd4459 # declaration of 'A' hides global declaration
184 <toolset>msvc:<cxxflags>/wd4003 # not enough actual parameters for macro 'X' - caused by BOOST_PP_IS_EMPTY and BOOST_PP_IS_BEGIN_PARENS which are used by Fusion
185
186 # Disable Intel warnings:
187 # warning #177: function "X" was declared but never referenced
188 # warning #780: using-declaration ignored -- it refers to the current namespace
189 # warning #2196: routine is both "inline" and "noinline"
190 # remark #1782: #pragma once is obsolete. Use #ifndef guard instead.
191 # remark #193: zero used for undefined preprocessing identifier "X"
192 # remark #304: access control not specified ("public" by default)
193 # remark #981: operands are evaluated in unspecified order
194 # remark #1418: external function definition with no prior declaration
195 # Mostly comes from Boost.Phoenix: warning #411: class "X" defines no constructor to initialize the following: reference member "Y"...
196 # warning #734: "X" (declared at line N of "file.hpp"), required for copy that was eliminated, is inaccessible
197 # warning #279: controlling expression is constant
198 <toolset>intel-win:<cxxflags>"/Qwd177,780,2196,1782,193,304,981,1418,411,734,279"
199 <toolset>intel-linux:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
200 <toolset>intel-darwin:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
201
202 <toolset>gcc:<cxxflags>-fno-strict-aliasing # avoids strict aliasing violations in other Boost components
203 <toolset>gcc,<target-os>windows:<linkflags>-Wl,--enable-auto-import
204 <toolset>gcc,<target-os>cygwin:<linkflags>-Wl,--enable-auto-import
205
206 <library>/boost/filesystem//boost_filesystem
207 <threading>single:<define>BOOST_LOG_NO_THREADS
208 <threading>multi:<library>/boost/atomic//boost_atomic
209 <threading>multi:<library>/boost/thread//boost_thread
210
211 <target-os>windows:<library>ws2_32
212 <target-os>windows:<library>mswsock
213 <target-os>windows:<library>advapi32
214
215 <target-os>cygwin:<library>ws2_32
216 <target-os>cygwin:<library>mswsock
217 <target-os>cygwin:<library>advapi32
218 # Boost.Interprocess does not compile on Cygwin: https://github.com/boostorg/interprocess/issues/76
219 <target-os>cygwin:<define>BOOST_LOG_WITHOUT_IPC
220
221 <target-os>linux:<library>rt
222
223 <target-os>solaris:<library>socket
224 <target-os>solaris:<library>nsl
225
226 <target-os>hpux:<library>ipv6
227
228 <target-os>freebsd:<library>rt
229 <target-os>qnxnto:<library>socket
230 <toolset>pgi:<library>rt
231 : usage-requirements
232 <toolset>clang:<cxxflags>-Wno-bind-to-temporary-copy
233 <toolset>clang:<cxxflags>-Wno-unused-function
234 ;
235
236 local BOOST_LOG_COMMON_SRC =
237 attribute_name.cpp
238 attribute_set.cpp
239 attribute_value_set.cpp
240 code_conversion.cpp
241 core.cpp
242 record_ostream.cpp
243 severity_level.cpp
244 global_logger_storage.cpp
245 named_scope.cpp
246 process_name.cpp
247 process_id.cpp
248 thread_id.cpp
249 timer.cpp
250 exceptions.cpp
251 default_attribute_names.cpp
252 default_sink.cpp
253 text_ostream_backend.cpp
254 text_file_backend.cpp
255 text_multifile_backend.cpp
256 thread_specific.cpp
257 once_block.cpp
258 timestamp.cpp
259 threadsafe_queue.cpp
260 event.cpp
261 trivial.cpp
262 spirit_encoding.cpp
263 format_parser.cpp
264 date_time_format_parser.cpp
265 named_scope_format_parser.cpp
266 permissions.cpp
267 dump.cpp
268 ;
269
270 BOOST_LOG_COMMON_SSSE3_SRC =
271 dump_ssse3
272 ;
273
274 BOOST_LOG_COMMON_AVX2_SRC =
275 dump_avx2
276 ;
277
278 for local src in $(BOOST_LOG_COMMON_SSSE3_SRC)
279 {
280 obj $(src)
281 : ## sources ##
282 $(src).cpp
283 : ## requirements ##
284 <conditional>@log-arch-config.ssse3-flags
285 <link>shared:<define>BOOST_LOG_DLL
286 <define>BOOST_LOG_BUILDING_THE_LIB=1
287 : ## default-build ##
288 : ## usage-requirements ##
289 <define>BOOST_LOG_USE_SSSE3
290 ;
291
292 explicit $(src) ;
293 }
294
295 for local src in $(BOOST_LOG_COMMON_AVX2_SRC)
296 {
297 obj $(src)
298 : ## sources ##
299 $(src).cpp
300 : ## requirements ##
301 <conditional>@log-arch-config.avx2-flags
302 <link>shared:<define>BOOST_LOG_DLL
303 <define>BOOST_LOG_BUILDING_THE_LIB=1
304 : ## default-build ##
305 : ## usage-requirements ##
306 <define>BOOST_LOG_USE_AVX2
307 ;
308
309 explicit $(src) ;
310 }
311
312 rule select-arch-specific-sources ( properties * )
313 {
314 local result ;
315
316 if x86 in [ log-arch-config.deduce-architecture $(properties) ]
317 {
318 local has_ssse3 = [ configure.builds /boost/log/x86-extensions//ssse3 : $(properties) : "compiler supports SSSE3" ] ;
319 if $(has_ssse3)
320 {
321 result += <define>BOOST_LOG_USE_SSSE3 ;
322 result += <source>$(BOOST_LOG_COMMON_SSSE3_SRC) ;
323 }
324
325 local has_avx2 = [ configure.builds /boost/log/x86-extensions//avx2 : $(properties) : "compiler supports AVX2" ] ;
326 if $(has_avx2)
327 {
328 result += <define>BOOST_LOG_USE_AVX2 ;
329 result += <source>$(BOOST_LOG_COMMON_AVX2_SRC) ;
330 }
331 }
332
333 # ECHO Arch sources: $(result) ;
334
335 return $(result) ;
336 }
337
338 rule select-platform-specific-sources ( properties * )
339 {
340 local result ;
341
342 if <target-os>windows in $(properties)
343 {
344 result += <source>windows/light_rw_mutex.cpp ;
345
346 if ! [ has-config-flag BOOST_LOG_WITHOUT_IPC : $(properties) ]
347 {
348 result += <source>windows/object_name.cpp ;
349 result += <source>windows/mapped_shared_memory.cpp ;
350 result += <source>windows/ipc_sync_wrappers.cpp ;
351 result += <source>windows/ipc_reliable_message_queue.cpp ;
352 result += <library>secur32 ;
353 }
354
355 if ! [ has-config-flag BOOST_LOG_WITHOUT_DEBUG_OUTPUT : $(properties) ]
356 {
357 result += <source>windows/debug_output_backend.cpp ;
358 }
359
360 if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
361 {
362 result += <source>windows/simple_event_log.mc ;
363 result += <source>windows/event_log_backend.cpp ;
364 result += <library>psapi ;
365
366 DEPENDS windows/event_log_backend.cpp : windows/simple_event_log.mc ;
367 }
368 }
369 else
370 {
371 result += <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
372 result += <define>BOOST_LOG_WITHOUT_DEBUG_OUTPUT ;
373
374 if ! [ has-config-flag BOOST_LOG_WITHOUT_IPC : $(properties) ]
375 {
376 result += <source>posix/object_name.cpp ;
377 result += <source>posix/ipc_reliable_message_queue.cpp ;
378 }
379 }
380
381 if ! [ has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ]
382 {
383 result += <source>syslog_backend.cpp ;
384 }
385
386 # ECHO Platform sources: $(result) ;
387
388 return $(result) ;
389 }
390
391 lib boost_log
392 : ## sources ##
393 $(BOOST_LOG_COMMON_SRC)
394 : ## requirements ##
395 <conditional>@select-arch-specific-sources
396 <conditional>@select-platform-specific-sources
397 <link>shared:<define>BOOST_LOG_DLL
398 <define>BOOST_LOG_BUILDING_THE_LIB=1
399 : ## default-build ##
400 : ## usage-requirements ##
401 <link>shared:<define>BOOST_LOG_DYN_LINK=1
402 <threading>single:<define>BOOST_LOG_NO_THREADS
403 ;
404
405
406 local BOOST_LOG_SETUP_COMMON_SRC =
407 parser_utils.cpp
408 init_from_stream.cpp
409 init_from_settings.cpp
410 settings_parser.cpp
411 filter_parser.cpp
412 formatter_parser.cpp
413 default_filter_factory.cpp
414 matches_relation_factory.cpp
415 default_formatter_factory.cpp
416 ;
417
418 lib boost_log_setup
419 : ## sources ##
420 setup/$(BOOST_LOG_SETUP_COMMON_SRC)
421 : ## requirements ##
422 <link>shared:<define>BOOST_LOG_DYN_LINK=1
423 <link>shared:<define>BOOST_LOG_SETUP_DLL
424 <define>BOOST_LOG_SETUP_BUILDING_THE_LIB=1
425 <library>boost_log
426 : ## default-build ##
427 : ## usage-requirements ##
428 <link>shared:<define>BOOST_LOG_SETUP_DYN_LINK=1
429 <threading>single:<define>BOOST_LOG_NO_THREADS
430 ;
431
432 boost-install boost_log boost_log_setup ;