]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/log/build/Jamfile.v2
update ceph source to reef 18.1.2
[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:<define>BOOST_USE_WINDOWS_H
212 <target-os>windows:<library>ws2_32
213 <target-os>windows:<library>mswsock
214 <target-os>windows:<library>advapi32
215
216 <target-os>cygwin:<define>BOOST_USE_WINDOWS_H
217 # Boost.Interprocess does not compile on Cygwin: https://github.com/boostorg/interprocess/issues/76
218 <target-os>cygwin:<define>BOOST_LOG_WITHOUT_IPC
219 <target-os>cygwin:<library>ws2_32
220 <target-os>cygwin:<library>mswsock
221 <target-os>cygwin:<library>advapi32
222
223 <target-os>linux:<library>rt
224
225 <target-os>solaris:<library>socket
226 <target-os>solaris:<library>nsl
227
228 <target-os>hpux:<library>ipv6
229
230 <target-os>freebsd:<library>rt
231 <target-os>qnxnto:<library>socket
232 <toolset>pgi:<library>rt
233 : usage-requirements
234 <toolset>clang:<cxxflags>-Wno-bind-to-temporary-copy
235 <toolset>clang:<cxxflags>-Wno-unused-function
236 ;
237
238 local BOOST_LOG_COMMON_SRC =
239 attribute_name.cpp
240 attribute_set.cpp
241 attribute_value_set.cpp
242 code_conversion.cpp
243 core.cpp
244 record_ostream.cpp
245 severity_level.cpp
246 global_logger_storage.cpp
247 named_scope.cpp
248 process_name.cpp
249 process_id.cpp
250 thread_id.cpp
251 timer.cpp
252 exceptions.cpp
253 default_attribute_names.cpp
254 default_sink.cpp
255 text_ostream_backend.cpp
256 text_file_backend.cpp
257 text_multifile_backend.cpp
258 thread_specific.cpp
259 once_block.cpp
260 timestamp.cpp
261 threadsafe_queue.cpp
262 event.cpp
263 trivial.cpp
264 spirit_encoding.cpp
265 format_parser.cpp
266 date_time_format_parser.cpp
267 named_scope_format_parser.cpp
268 permissions.cpp
269 dump.cpp
270 ;
271
272 BOOST_LOG_COMMON_SSSE3_SRC =
273 dump_ssse3
274 ;
275
276 BOOST_LOG_COMMON_AVX2_SRC =
277 dump_avx2
278 ;
279
280 for local src in $(BOOST_LOG_COMMON_SSSE3_SRC)
281 {
282 obj $(src)
283 : ## sources ##
284 $(src).cpp
285 : ## requirements ##
286 <conditional>@log-arch-config.ssse3-flags
287 <link>shared:<define>BOOST_LOG_DLL
288 <define>BOOST_LOG_BUILDING_THE_LIB=1
289 : ## default-build ##
290 : ## usage-requirements ##
291 <define>BOOST_LOG_USE_SSSE3
292 ;
293
294 explicit $(src) ;
295 }
296
297 for local src in $(BOOST_LOG_COMMON_AVX2_SRC)
298 {
299 obj $(src)
300 : ## sources ##
301 $(src).cpp
302 : ## requirements ##
303 <conditional>@log-arch-config.avx2-flags
304 <link>shared:<define>BOOST_LOG_DLL
305 <define>BOOST_LOG_BUILDING_THE_LIB=1
306 : ## default-build ##
307 : ## usage-requirements ##
308 <define>BOOST_LOG_USE_AVX2
309 ;
310
311 explicit $(src) ;
312 }
313
314 rule select-arch-specific-sources ( properties * )
315 {
316 local result ;
317
318 if x86 in [ log-arch-config.deduce-architecture $(properties) ]
319 {
320 local has_ssse3 = [ configure.builds /boost/log/x86-extensions//ssse3 : $(properties) : "compiler supports SSSE3" ] ;
321 if $(has_ssse3)
322 {
323 result += <define>BOOST_LOG_USE_SSSE3 ;
324 result += <source>$(BOOST_LOG_COMMON_SSSE3_SRC) ;
325 }
326
327 local has_avx2 = [ configure.builds /boost/log/x86-extensions//avx2 : $(properties) : "compiler supports AVX2" ] ;
328 if $(has_avx2)
329 {
330 result += <define>BOOST_LOG_USE_AVX2 ;
331 result += <source>$(BOOST_LOG_COMMON_AVX2_SRC) ;
332 }
333 }
334
335 # ECHO Arch sources: $(result) ;
336
337 return $(result) ;
338 }
339
340 rule select-platform-specific-sources ( properties * )
341 {
342 local result ;
343
344 if <target-os>windows in $(properties)
345 {
346 result += <source>windows/light_rw_mutex.cpp ;
347 result += <source>windows/is_debugger_present.cpp ;
348
349 if ! [ has-config-flag BOOST_LOG_WITHOUT_IPC : $(properties) ]
350 {
351 result += <source>windows/object_name.cpp ;
352 result += <source>windows/mapped_shared_memory.cpp ;
353 result += <source>windows/ipc_sync_wrappers.cpp ;
354 result += <source>windows/ipc_reliable_message_queue.cpp ;
355 result += <library>secur32 ;
356 }
357
358 if ! [ has-config-flag BOOST_LOG_WITHOUT_DEBUG_OUTPUT : $(properties) ]
359 {
360 result += <source>windows/debug_output_backend.cpp ;
361 }
362
363 if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
364 {
365 result += <source>windows/simple_event_log.mc ;
366 result += <source>windows/event_log_backend.cpp ;
367 result += <library>psapi ;
368
369 DEPENDS windows/event_log_backend.cpp : windows/simple_event_log.mc ;
370 }
371 }
372 else
373 {
374 result += <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
375 result += <define>BOOST_LOG_WITHOUT_DEBUG_OUTPUT ;
376
377 if ! [ has-config-flag BOOST_LOG_WITHOUT_IPC : $(properties) ]
378 {
379 result += <source>posix/object_name.cpp ;
380 result += <source>posix/ipc_reliable_message_queue.cpp ;
381 }
382 }
383
384 if ! [ has-config-flag BOOST_LOG_WITHOUT_SYSLOG : $(properties) ]
385 {
386 result += <source>syslog_backend.cpp ;
387 }
388
389 # ECHO Platform sources: $(result) ;
390
391 return $(result) ;
392 }
393
394 lib boost_log
395 : ## sources ##
396 $(BOOST_LOG_COMMON_SRC)
397 : ## requirements ##
398 <conditional>@select-arch-specific-sources
399 <conditional>@select-platform-specific-sources
400 <link>shared:<define>BOOST_LOG_DLL
401 <define>BOOST_LOG_BUILDING_THE_LIB=1
402 : ## default-build ##
403 : ## usage-requirements ##
404 <link>shared:<define>BOOST_LOG_DYN_LINK=1
405 <threading>single:<define>BOOST_LOG_NO_THREADS
406 ;
407
408
409 local BOOST_LOG_SETUP_COMMON_SRC =
410 parser_utils.cpp
411 init_from_stream.cpp
412 init_from_settings.cpp
413 settings_parser.cpp
414 filter_parser.cpp
415 formatter_parser.cpp
416 default_filter_factory.cpp
417 matches_relation_factory.cpp
418 default_formatter_factory.cpp
419 ;
420
421 lib boost_log_setup
422 : ## sources ##
423 setup/$(BOOST_LOG_SETUP_COMMON_SRC)
424 : ## requirements ##
425 <link>shared:<define>BOOST_LOG_DYN_LINK=1
426 <link>shared:<define>BOOST_LOG_SETUP_DLL
427 <define>BOOST_LOG_SETUP_BUILDING_THE_LIB=1
428 <library>boost_log
429 : ## default-build ##
430 : ## usage-requirements ##
431 <link>shared:<define>BOOST_LOG_SETUP_DYN_LINK=1
432 <threading>single:<define>BOOST_LOG_NO_THREADS
433 ;
434
435 boost-install boost_log boost_log_setup ;