]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/zstd.jam
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / tools / build / src / tools / zstd.jam
1 # Copyright (c) 2010 Vladimir Prus.
2 # Copyright (c) 2013 Steven Watanabe
3 #
4 # Use, modification and distribution is subject to the Boost Software
5 # License Version 1.0. (See accompanying file LICENSE_1_0.txt or
6 # http://www.boost.org/LICENSE_1_0.txt)
7
8 # Supports the zstd library
9 #
10 # After 'using zstd', the following targets are available:
11 #
12 # /zstd//zstd -- The zstd library
13
14 import project ;
15 import ac ;
16 import errors ;
17 import feature ;
18 import "class" : new ;
19 import targets ;
20 import path ;
21 import modules ;
22 import indirect ;
23 import property ;
24 import property-set ;
25
26 header = zstd.h ;
27 names = zstd ;
28
29 library-id = 0 ;
30
31 if --debug-configuration in [ modules.peek : ARGV ]
32 {
33 .debug = true ;
34 }
35
36 rule init (
37 version ?
38 # (currently ignored)
39
40 : options *
41 # A list of the options to use
42
43 : requirements *
44 # The requirements for the target
45 )
46 {
47 local caller = [ project.current ] ;
48
49 if ! $(.initialized)
50 {
51 .initialized = true ;
52
53 project.initialize $(__name__) ;
54 .project = [ project.current ] ;
55 project zstd ;
56 }
57
58 local library-path = [ feature.get-values <search> : $(options) ] ;
59 local include-path = [ feature.get-values <include> : $(options) ] ;
60 local library-name = [ feature.get-values <name> : $(options) ] ;
61
62 condition = [ property-set.create $(requirements) ] ;
63 condition = [ property-set.create [ $(condition).base ] ] ;
64
65 if $(.configured.$(condition))
66 {
67 if ! $(options)
68 {
69 if $(.debug)
70 {
71 ECHO "notice: [zstd] zstd is already configured" ;
72 }
73 }
74 else
75 {
76 errors.user-error "zstd is already configured" ;
77 }
78 return ;
79 }
80 else
81 {
82 if $(.debug)
83 {
84 ECHO "notice: [zstd] Using pre-installed library" ;
85 if $(condition)
86 {
87 ECHO "notice: [zstd] Condition" [ $(condition).raw ] ;
88 }
89 }
90
91 local mt = [ new ac-library zstd : $(.project) : $(condition) :
92 $(include-path) : $(library-path) : $(library-name) ] ;
93 $(mt).set-header $(header) ;
94 $(mt).set-default-names $(names) ;
95 targets.main-target-alternative $(mt) ;
96 }
97 .configured.$(condition) = true ;
98 }