]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/log/build/Jamfile.v2
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / log / build / Jamfile.v2
1 #
2 # Copyright Andrey Semashev 2007 - 2016.
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-architecture ;
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/visibility ] ;
25 project.load [ path.join [ path.make $(here:D) ] ../config/pthread-mutex-robust ] ;
26 project.load [ path.join [ path.make $(here:D) ] ../config/native-syslog ] ;
27 project.load [ path.join [ path.make $(here:D) ] ../config/atomic-int32 ] ;
28 project.pop-current ;
29
30 # Windows libs
31 lib psapi ;
32 lib advapi32 ;
33 lib secur32 ;
34 lib ws2_32 ;
35 lib mswsock ;
36
37 # UNIX libs
38 lib rt ;
39 lib socket ;
40 lib nsl ;
41 lib ipv6 ;
42
43 rule has-config-flag ( flag : properties * )
44 {
45 if ( <define>$(flag) in $(properties) || <define>$(flag)=1 in $(properties) )
46 {
47 return 1 ;
48 }
49 else
50 {
51 return ;
52 }
53 }
54
55 rule check-instruction-set ( properties * )
56 {
57 local result ;
58 local instruction_set = [ feature.get-values "log-instruction-set" : [ log-architecture.deduce-instruction-set $(properties) ] ] ;
59
60 if $(instruction_set) = i386 || $(instruction_set) = i486
61 {
62 if ! $(.annouced-failure)
63 {
64 ECHO Boost.Log is not supported on the specified target CPU and will not be built. At least i586 class CPU is required. ;
65 .annouced-failure = 1 ;
66 }
67 result = <build>no ;
68 }
69
70 return $(result) ;
71 }
72
73 rule select-regex-backend ( properties * )
74 {
75 local result = ;
76
77 # Use Boost.Regex backend by default. It produces smaller executables and also has the best performance for small string matching.
78 if ! (
79 [ has-config-flag BOOST_LOG_WITHOUT_SETTINGS_PARSERS : $(properties) ] ||
80 [ has-config-flag BOOST_LOG_WITHOUT_DEFAULT_FACTORIES : $(properties) ] ||
81 [ has-config-flag BOOST_LOG_USE_STD_REGEX : $(properties) ] ||
82 [ has-config-flag BOOST_LOG_USE_BOOST_XPRESSIVE : $(properties) ] )
83 {
84 result = <library>/boost/regex//boost_regex ;
85 }
86
87 return $(result) ;
88 }
89
90 rule check-visibility ( properties * )
91 {
92 local result = ;
93
94 local has_visibility = [ configure.builds /boost/log/visibility//visibility : $(properties) : compiler-supports-visibility ] ;
95 if $(has_visibility)
96 {
97 result = <cxxflags>"-fvisibility=hidden" ;
98 }
99
100 return $(result) ;
101 }
102
103 rule check-pthread-mutex-robust ( properties * )
104 {
105 local result = ;
106
107 local has_pthread_mutex_robust = [ configure.builds /boost/log/pthread-mutex-robust//pthread_mutex_robust : $(properties) : pthread-supports-robust-mutexes ] ;
108 if $(has_pthread_mutex_robust)
109 {
110 result = <define>BOOST_LOG_HAS_PTHREAD_MUTEX_ROBUST ;
111 }
112
113 return $(result) ;
114 }
115
116 rule check-atomic-int32 ( properties * )
117 {
118 local result = ;
119
120 local has_atomic_int32 = [ configure.builds /boost/log/atomic-int32//atomic_int32 : $(properties) : native-atomic-int32-supported ] ;
121 if ! $(has_atomic_int32)
122 {
123 result = <define>BOOST_LOG_WITHOUT_IPC ;
124 }
125
126 return $(result) ;
127 }
128
129 rule check-native-syslog ( properties * )
130 {
131 local result = ;
132
133 if ! [ has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ]
134 {
135 local has_native_syslog = [ configure.builds /boost/log/native-syslog//native_syslog : $(properties) : native-syslog-supported ] ;
136 if $(has_native_syslog)
137 {
138 result = <define>BOOST_LOG_USE_NATIVE_SYSLOG ;
139 }
140 }
141
142 return $(result) ;
143 }
144
145 rule check-message-compiler ( properties * )
146 {
147 local result ;
148
149 if <target-os>windows in $(properties)
150 {
151 if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
152 {
153 local has_mc = [ configure.builds /boost/log/message-compiler//test-availability : $(properties) : message-compiler ] ;
154 if ! $(has_mc)
155 {
156 result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
157 }
158 }
159 else
160 {
161 # This branch is needed to fix building with MinGW
162 result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
163 }
164 }
165 else
166 {
167 result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
168 }
169
170 return $(result) ;
171 }
172
173 project boost/log
174 : source-location ../src
175 : requirements
176 <conditional>@check-instruction-set
177 <conditional>@check-atomic-int32
178 <conditional>@select-regex-backend
179 <conditional>@check-visibility
180 <conditional>@check-pthread-mutex-robust
181 <conditional>@check-native-syslog
182 <conditional>@check-message-compiler
183 <conditional>@log-platform-config.set-platform-defines
184
185 <include>../src
186
187 <define>__STDC_CONSTANT_MACROS # Use system-defined macros for integer constants, if possible
188 <define>BOOST_SPIRIT_USE_PHOENIX_V3=1
189 <define>BOOST_THREAD_DONT_USE_CHRONO=1 # Don't introduce false dependency on Boost.Chrono
190
191 # Disable warnings about using 'insecure' standard C functions
192 <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
193 <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
194 <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
195 <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
196 <toolset>intel-win:<define>_SCL_SECURE_NO_WARNINGS
197 <toolset>intel-win:<define>_SCL_SECURE_NO_DEPRECATE
198 <toolset>intel-win:<define>_CRT_SECURE_NO_WARNINGS
199 <toolset>intel-win:<define>_CRT_SECURE_NO_DEPRECATE
200
201 <toolset>msvc:<cxxflags>/bigobj
202 <toolset>msvc:<cxxflags>/wd4503 # decorated name length exceeded, name was truncated
203 <toolset>msvc:<cxxflags>/wd4456 # declaration of 'A' hides previous local declaration
204 <toolset>msvc:<cxxflags>/wd4459 # declaration of 'A' hides global declaration
205 <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
206
207 # Disable Intel warnings:
208 # warning #177: function "X" was declared but never referenced
209 # warning #780: using-declaration ignored -- it refers to the current namespace
210 # warning #2196: routine is both "inline" and "noinline"
211 # remark #1782: #pragma once is obsolete. Use #ifndef guard instead.
212 # remark #193: zero used for undefined preprocessing identifier "X"
213 # remark #304: access control not specified ("public" by default)
214 # remark #981: operands are evaluated in unspecified order
215 # remark #1418: external function definition with no prior declaration
216 # Mostly comes from Boost.Phoenix: warning #411: class "X" defines no constructor to initialize the following: reference member "Y"...
217 # warning #734: "X" (declared at line N of "file.hpp"), required for copy that was eliminated, is inaccessible
218 # warning #279: controlling expression is constant
219 <toolset>intel-win:<cxxflags>"/Qwd177,780,2196,1782,193,304,981,1418,411,734,279"
220 <toolset>intel-linux:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
221 <toolset>intel-darwin:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
222
223 <toolset>darwin:<cxxflags>-ftemplate-depth-1024
224 <toolset>clang:<cxxflags>-ftemplate-depth-1024
225 <toolset>gcc:<cxxflags>-ftemplate-depth-1024
226
227 <toolset>gcc:<cxxflags>-fno-strict-aliasing # avoids strict aliasing violations in other Boost components
228 <toolset>gcc,<target-os>windows:<linkflags>-Wl,--enable-auto-import
229 <toolset>gcc,<target-os>cygwin:<linkflags>-Wl,--enable-auto-import
230
231 <library>/boost/date_time//boost_date_time
232 <library>/boost/filesystem//boost_filesystem
233 <library>/boost/system//boost_system
234 <threading>single:<define>BOOST_LOG_NO_THREADS
235 <threading>multi:<library>/boost/atomic//boost_atomic
236 <threading>multi:<library>/boost/thread//boost_thread
237
238 <target-os>windows:<library>ws2_32
239 <target-os>windows:<library>mswsock
240 <target-os>windows:<library>advapi32
241
242 <target-os>cygwin:<library>ws2_32
243 <target-os>cygwin:<library>mswsock
244 <target-os>cygwin:<library>advapi32
245
246 <target-os>linux:<library>rt
247
248 <target-os>solaris:<library>socket
249 <target-os>solaris:<library>nsl
250
251 <target-os>hpux:<library>ipv6
252
253 <target-os>freebsd:<library>rt
254 <target-os>qnxnto:<library>socket
255 <toolset>pgi:<library>rt
256 : usage-requirements
257 <toolset>clang:<cxxflags>-Wno-bind-to-temporary-copy
258 <toolset>clang:<cxxflags>-Wno-unused-function
259 ;
260
261 local BOOST_LOG_COMMON_SRC =
262 attribute_name.cpp
263 attribute_set.cpp
264 attribute_value_set.cpp
265 code_conversion.cpp
266 core.cpp
267 record_ostream.cpp
268 severity_level.cpp
269 global_logger_storage.cpp
270 named_scope.cpp
271 process_name.cpp
272 process_id.cpp
273 thread_id.cpp
274 timer.cpp
275 exceptions.cpp
276 default_attribute_names.cpp
277 default_sink.cpp
278 text_ostream_backend.cpp
279 text_file_backend.cpp
280 text_multifile_backend.cpp
281 thread_specific.cpp
282 once_block.cpp
283 timestamp.cpp
284 threadsafe_queue.cpp
285 event.cpp
286 trivial.cpp
287 spirit_encoding.cpp
288 format_parser.cpp
289 date_time_format_parser.cpp
290 named_scope_format_parser.cpp
291 unhandled_exception_count.cpp
292 permissions.cpp
293 dump.cpp
294 ;
295
296 BOOST_LOG_COMMON_SSSE3_SRC =
297 dump_ssse3
298 ;
299
300 BOOST_LOG_COMMON_AVX2_SRC =
301 dump_avx2
302 ;
303
304 rule ssse3-targets-cond ( properties * )
305 {
306 local result = <build>no ;
307
308 if <log-architecture>x86 in [ log-architecture.deduce-architecture $(properties) ]
309 {
310 local has_ssse3 = [ configure.builds /boost/log/x86-extensions//ssse3 : $(properties) : compiler-supports-ssse3 ] ;
311 if $(has_ssse3)
312 {
313 result = ;
314 if <toolset>gcc in $(properties) || <toolset>clang in $(properties)
315 {
316 result = <cxxflags>"-msse -msse2 -msse3 -mssse3" ;
317 }
318 else if <toolset>intel in $(properties)
319 {
320 if <toolset-intel:platform>win in $(properties)
321 {
322 result = <cxxflags>"/QxSSSE3" ;
323 }
324 else
325 {
326 result = <cxxflags>"-xSSSE3" ;
327 }
328 }
329 else if <toolset>msvc in $(properties)
330 {
331 # MSVC doesn't really care about these switches, all SSE intrinsics are always available, but still...
332 # Also 64 bit MSVC doesn't have the /arch:SSE2 switch as it is the default.
333 if <log-address-model>32 in [ log-architecture.deduce-address-model $(properties) ]
334 {
335 result = <cxxflags>"/arch:SSE2" ;
336 }
337 }
338 }
339 }
340
341 # if ! <build>no in $(result)
342 # {
343 # ECHO Boost.Log: Using SSSE3 optimized implementation ;
344 # }
345 # ECHO $(result) ;
346
347 return $(result) ;
348 }
349
350 for local src in $(BOOST_LOG_COMMON_SSSE3_SRC)
351 {
352 obj $(src)
353 : ## sources ##
354 $(src).cpp
355 : ## requirements ##
356 <conditional>@ssse3-targets-cond
357 <link>shared:<define>BOOST_LOG_DLL
358 <define>BOOST_LOG_BUILDING_THE_LIB=1
359 : ## default-build ##
360 : ## usage-requirements ##
361 <define>BOOST_LOG_USE_SSSE3
362 ;
363
364 explicit $(src) ;
365 }
366
367 rule avx2-targets-cond ( properties * )
368 {
369 local result = <build>no ;
370
371 if <log-architecture>x86 in [ log-architecture.deduce-architecture $(properties) ]
372 {
373 local has_avx2 = [ configure.builds /boost/log/x86-extensions//avx2 : $(properties) : compiler-supports-avx2 ] ;
374 if $(has_avx2)
375 {
376 result = ;
377 if <toolset>gcc in $(properties)
378 {
379 result = <cxxflags>"-mavx -mavx2 -fabi-version=0" ;
380 }
381 else if <toolset>clang in $(properties)
382 {
383 result = <cxxflags>"-mavx -mavx2" ;
384 }
385 else if <toolset>intel in $(properties)
386 {
387 if <toolset-intel:platform>win in $(properties)
388 {
389 result = <cxxflags>"/arch:CORE-AVX2" ;
390 }
391 else
392 {
393 result = <cxxflags>"-xCORE-AVX2 -fabi-version=0" ;
394 }
395 }
396 else if <toolset>msvc in $(properties)
397 {
398 result = <cxxflags>"/arch:AVX" ;
399 }
400 }
401 }
402
403 # if ! <build>no in $(result)
404 # {
405 # ECHO Boost.Log: Using AVX2 optimized implementation ;
406 # }
407 # ECHO $(result) ;
408
409 return $(result) ;
410 }
411
412 for local src in $(BOOST_LOG_COMMON_AVX2_SRC)
413 {
414 obj $(src)
415 : ## sources ##
416 $(src).cpp
417 : ## requirements ##
418 <conditional>@avx2-targets-cond
419 <link>shared:<define>BOOST_LOG_DLL
420 <define>BOOST_LOG_BUILDING_THE_LIB=1
421 : ## default-build ##
422 : ## usage-requirements ##
423 <define>BOOST_LOG_USE_AVX2
424 ;
425
426 explicit $(src) ;
427 }
428
429 rule select-arch-specific-sources ( properties * )
430 {
431 local result ;
432
433 if <log-architecture>x86 in [ log-architecture.deduce-architecture $(properties) ]
434 {
435 local has_ssse3 = [ configure.builds /boost/log/x86-extensions//ssse3 : $(properties) : compiler-supports-ssse3 ] ;
436 if $(has_ssse3)
437 {
438 result += <define>BOOST_LOG_USE_SSSE3 ;
439 result += <source>$(BOOST_LOG_COMMON_SSSE3_SRC) ;
440 }
441
442 local has_avx2 = [ configure.builds /boost/log/x86-extensions//avx2 : $(properties) : compiler-supports-avx2 ] ;
443 if $(has_avx2)
444 {
445 result += <define>BOOST_LOG_USE_AVX2 ;
446 result += <source>$(BOOST_LOG_COMMON_AVX2_SRC) ;
447 }
448 }
449
450 # ECHO Arch sources: $(result) ;
451
452 return $(result) ;
453 }
454
455 rule select-platform-specific-sources ( properties * )
456 {
457 local result ;
458
459 if <target-os>windows in $(properties)
460 {
461 result += <source>windows/light_rw_mutex.cpp ;
462
463 if ! [ has-config-flag BOOST_LOG_WITHOUT_IPC : $(properties) ]
464 {
465 result += <source>windows/object_name.cpp ;
466 result += <source>windows/mapped_shared_memory.cpp ;
467 result += <source>windows/ipc_sync_wrappers.cpp ;
468 result += <source>windows/ipc_reliable_message_queue.cpp ;
469 result += <library>secur32 ;
470 }
471
472 if ! [ has-config-flag BOOST_LOG_WITHOUT_DEBUG_OUTPUT : $(properties) ]
473 {
474 result += <source>windows/debug_output_backend.cpp ;
475 }
476
477 if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
478 {
479 result += <source>windows/simple_event_log.mc ;
480 result += <source>windows/event_log_backend.cpp ;
481 result += <library>psapi ;
482
483 DEPENDS windows/event_log_backend.cpp : windows/simple_event_log.mc ;
484 }
485 }
486 else
487 {
488 result += <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
489 result += <define>BOOST_LOG_WITHOUT_DEBUG_OUTPUT ;
490
491 if ! [ has-config-flag BOOST_LOG_WITHOUT_IPC : $(properties) ]
492 {
493 result += <source>posix/object_name.cpp ;
494 result += <source>posix/ipc_reliable_message_queue.cpp ;
495 }
496 }
497
498 if ! [ has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ]
499 {
500 result += <source>syslog_backend.cpp ;
501 }
502
503 # ECHO Platform sources: $(result) ;
504
505 return $(result) ;
506 }
507
508 lib boost_log
509 : ## sources ##
510 $(BOOST_LOG_COMMON_SRC)
511 : ## requirements ##
512 <conditional>@select-arch-specific-sources
513 <conditional>@select-platform-specific-sources
514 <link>shared:<define>BOOST_LOG_DLL
515 <define>BOOST_LOG_BUILDING_THE_LIB=1
516 : ## default-build ##
517 : ## usage-requirements ##
518 <link>shared:<define>BOOST_LOG_DYN_LINK=1
519 <threading>single:<define>BOOST_LOG_NO_THREADS
520 ;
521
522
523 local BOOST_LOG_SETUP_COMMON_SRC =
524 parser_utils.cpp
525 init_from_stream.cpp
526 init_from_settings.cpp
527 settings_parser.cpp
528 filter_parser.cpp
529 formatter_parser.cpp
530 default_filter_factory.cpp
531 matches_relation_factory.cpp
532 default_formatter_factory.cpp
533 ;
534
535 lib boost_log_setup
536 : ## sources ##
537 setup/$(BOOST_LOG_SETUP_COMMON_SRC)
538 : ## requirements ##
539 <link>shared:<define>BOOST_LOG_DYN_LINK=1
540 <link>shared:<define>BOOST_LOG_SETUP_DLL
541 <define>BOOST_LOG_SETUP_BUILDING_THE_LIB=1
542 <library>boost_log
543 : ## default-build ##
544 : ## usage-requirements ##
545 <link>shared:<define>BOOST_LOG_SETUP_DYN_LINK=1
546 <threading>single:<define>BOOST_LOG_NO_THREADS
547 ;