]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/lzma.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / lzma.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 lzma library
9 #
10 # After 'using lzma', the following targets are available:
11 #
12 # /lzma//lzam -- The lzma library
13
14 import project ;
15 import ac ;
16 import errors ;
17 import "class" : new ;
18 import targets ;
19 import path ;
20 import modules ;
21 import errors ;
22 import indirect ;
23 import property ;
24 import property-set ;
25
26 header = lzma.h ;
27 names = lzma ;
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 : is-default ?
47 # Default configurations are only used when
48 # not yet configured. This option is
49 # deprecated. A configuration will be treated
50 # as a default when none of <include>, <search>,
51 # <name>, and <source> are present.
52 )
53 {
54 local caller = [ project.current ] ;
55
56 if ! $(.initialized)
57 {
58 .initialized = true ;
59
60 project.initialize $(__name__) ;
61 .project = [ project.current ] ;
62 project lzma ;
63 }
64
65 local library-path = [ property.select <search> : $(options) ] ;
66 library-path = $(library-path:G=) ;
67 local include-path = [ property.select <include> : $(options) ] ;
68 include-path = $(include-path:G=) ;
69 local library-name = [ property.select <name> : $(options) ] ;
70 library-name = $(library-name:G=) ;
71
72 if ! $(options)
73 {
74 is-default = true ;
75 }
76
77 condition = [ property-set.create $(requirements) ] ;
78 condition = [ property-set.create [ $(condition).base ] ] ;
79
80 if $(.configured.$(condition))
81 {
82 if $(is-default)
83 {
84 if $(.debug)
85 {
86 ECHO "notice: [lzma] lzma is already configured" ;
87 }
88 }
89 else
90 {
91 errors.user-error "lzma is already configured" ;
92 }
93 return ;
94 }
95 else
96 {
97 if $(.debug)
98 {
99 ECHO "notice: [lzma] Using pre-installed library" ;
100 if $(condition)
101 {
102 ECHO "notice: [lzma] Condition" [ $(condition).raw ] ;
103 }
104 }
105
106 local mt = [ new ac-library lzma : $(.project) : $(condition) :
107 $(include-path) : $(library-path) : $(library-name) ] ;
108 $(mt).set-header $(header) ;
109 $(mt).set-default-names $(names) ;
110 targets.main-target-alternative $(mt) ;
111 }
112 .configured.$(condition) = true ;
113 }