source: nscp/Jamroot @ 64d42de

0.4.00.4.10.4.2
Last change on this file since 64d42de was f0eb62d, checked in by Michael Medin <michael@…>, 4 years ago

Refactored service into its own project

  • Property mode set to 100644
File size: 8.0 KB
Line 
1import feature : feature ;
2import modules ;
3import os ;
4import errors ;
5import stage ;
6import common ;
7import option ;
8
9feature character-set : unicode ansi multibyte : composite ;
10feature.compose <character-set>unicode : <define>_UNICODE <define>UNICODE ;
11feature.compose <character-set>multibyte : <define>_MBCS ;
12
13
14local toolset = [ MATCH "^--toolset=(.*)" : [ modules.peek : ARGV ] ] ;
15toolset ?= msvc ;
16if $(toolset) = "msvc" {
17        import bjam/lua ;
18        import bjam/openssl ;
19        import bjam/boost ;
20        import bjam/cryptopp ;
21        import bjam/psdk ;
22}
23import toolset : flags ;
24import notfile ;
25import bjam/zip ;
26
27local target-config = nsc.ini ;
28local target-readme = readme.txt ;
29local target-guide = "Nagios Usage Guide.pdf" ;
30local target-refman = "NSClient++ Reference Manual.pdf" ;
31local target-changelog = changelog.txt ;
32local target-license = license.txt ;
33local target-counters = counters.defs ;
34
35ECHO "OS =" [ os.name ] ;
36ECHO "name =" $(__name__) ;
37
38# what kind of layout are we doing?
39layout = [ MATCH "^--layout=(.*)" : [ modules.peek : ARGV ] ] ;
40layout ?= versioned ;
41layout-$(layout) = true ;
42
43path-constant TOP : . ;
44
45# possible stage only location
46local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ;
47stage-locate ?= stage ;
48path-constant BOOST_STAGE_LOCATE : $(stage-locate) ;
49
50if $(toolset) = "msvc" {
51        using bjam/openssl : : $(TOP)/lib-source/openssl-0.9.8g/include $(TOP)/lib ;
52        using bjam/boost : : $(TOP)/lib-source/boost_1_35_0 $(TOP)/lib ;
53        using bjam/lua : : $(TOP)/lib-source/lua-5.1.2 ;
54        using bjam/cryptopp : : $(TOP)/lib-source/"Crypto++"/src ;
55        using bjam/psdk : : /foo ;
56
57        if [ bjam/lua.isEnabled ] = true {
58                echo "LUA support enabled (disable with --without-lua)" ;
59                bjam/lua.printEnv ;
60        } else {
61                echo "LUA support DISABLED (enable with --with-lua)" ;
62        }
63
64        if [ bjam/openssl.isEnabled ] = true {
65                echo "SSL support enabled (disable with --without-openssl)" ;
66                bjam/openssl.printEnv ;
67        } else {
68                echo "SSL support DISABLED (enable with --with-openssl)" ;
69        }
70
71        if [ bjam/boost.isEnabled ] = true {
72                echo "boost found (disable with --without-boost)" ;
73                bjam/boost.printEnv ;
74        } else {
75                echo "boost not avaliable! some features DISABLED (for instance regular expressions) (enable with --with-boost)" ;
76        }
77
78        if [ bjam/cryptopp.isEnabled ] = true {
79                echo "Crypto++ found (disable with --without-cryptopp)" ;
80                bjam/cryptopp.printEnv ;
81        } else {
82                echo "cryptopp not avaliable! encryption (NSCA) DISABLED (enable with --with-cryptopp)" ;
83        }
84
85        if [ bjam/psdk.isEnabled ] = true {
86                echo "Platform SDK found (disable with --without-psdk)" ;
87                bjam/psdk.printEnv ;
88        } else {
89                echo "Plattform SDK not avaliable! Various features wont work (enable with --with-psdk)" ;
90        }
91}
92
93project master
94        : requirements
95        <include>$(TOP)/include
96        <find-static-library>advapi32
97        <find-static-library>user32
98        <find-static-library>shell32
99        <threading>multi
100        <link>shared
101        $(result)
102
103        : default-build debug
104
105        : build-dir bjam-tmp-build
106        ;
107
108#
109# Copy various files
110#
111make $(target-config) : files/nsc.dist : common.copy ;
112explicit $(target-config) ;
113
114make $(target-readme) : docs/readme.txt : common.copy ;
115explicit $(target-readme) ;
116make $(target-guide) : "docs/Nagios Usage Guide.pdf" : common.copy ;
117explicit $(target-guide) ;
118make $(target-refman) : "docs/NSClient++ Reference Manual.pdf" : common.copy ;
119explicit $(target-refman) ;
120
121make $(target-license) : files/license.txt : common.copy ;
122explicit $(target-license) ;
123
124make $(target-changelog) : changelog : common.copy ;
125explicit $(target-changelog) ;
126
127make $(target-counters) : files/counters.defs : common.copy ;
128explicit $(target-counters) ;
129
130all-modules =
131    [ MATCH .*modules/(.*)/.* : [ glob modules/*/Jamfile ] ]
132    ;
133
134all-scripts =
135    [ MATCH .*scripts/(.+\\..*) : [ glob scripts/* ] ]
136    ;
137local all-scripts-lst ;
138if $(toolset) = "msvc" {
139        if ! ( [ bjam/lua.isEnabled ] = true ) {
140                echo "LUA support disabled skipping build of modules..." ;
141                local result ;
142                for local l in $(all-modules)
143                {
144                        if [ MATCH (.*LUA.*) : $(l) ]
145                        {
146                                echo "Not building module: $(l)" ;
147                        } else {
148                                result += $(l) ;
149                        }
150                }
151                all-modules = $(result) ;
152        }
153        if ! ( [ bjam/psdk.isEnabled ] = true ) {
154                echo "PSDK support disabled skipping build of modules..." ;
155                local result ;
156                for local l in $(all-modules)
157                {
158                        if [ MATCH (.*CheckTaskSched.*) : $(l) ] {
159                                echo "Not building module: $(l)" ;
160                        } else if [ MATCH (.*CheckWMI.*) : $(l) ] {
161                                echo "Not building module: $(l)" ;
162                        } else {
163                                result += $(l) ;
164                        }
165                }
166                all-modules = $(result) ;
167        }
168        all-modules-text = "" ;
169        for local l in $(all-modules) {
170                alias $(l)
171                        : # sources
172                        modules/$(l)
173                        : # requirements
174                        : # default build
175                        : # usage requirements
176                        #<dependency>$(target)
177                        ;
178                explicit $(l) ;
179                all-modules-text = "$(all-modules-text) $(l)" ;
180        }
181        echo "Building modules: $(all-modules-text)" ;
182        for local l in $(all-scripts) {
183                all-scripts-lst = $(all-scripts-lst) scripts/$(l) ;
184        }
185} else {
186        all-installers =
187                [ MATCH .*helpers/(.*)/.* : [ glob helpers/*installer/Jamfile ] ]
188                ;
189        all-installers-text = "" ;
190        for local l in $(all-installers)
191        {
192                alias $(l) : helpers/$(l) ;
193                explicit $(l) ;
194                all-installers-text = "$(all-installers-text) $(l)" ;
195        }
196        echo "Building installers: $(all-installers-text)" ;
197}
198
199all-archive =
200    [ MATCH .*helpers/(.*)/.* : [ glob helpers/*archive/Jamfile ] ]
201    ;
202for local l in $(all-archive)
203{
204        alias $(l) : helpers/$(l) ;
205        echo "Adding archive target for: $(l)" ;
206        explicit $(l) ;
207}
208
209alias cryptopp-headers : helpers/cryptopp-headers ;
210explicit cryptopp-headers ;
211
212alias installer_dll : helpers/installer_dll helpers/installer_dll_fw ;
213explicit installer_dll ;
214
215alias all-helpers-targets : installer_dll ;
216explicit all-helpers-targets ;
217
218alias all-scripts-targets : $(all-scripts-lst) ;
219explicit all-scripts-targets ;
220
221alias all-root-targets : service $(target-config) $(target-readme) $(target-guide) $(target-refman) $(target-license) $(target-changelog) $(target-counters) helpers/systray_helper ;
222explicit all-root-targets ;
223
224alias all-modules-targets : $(all-modules) ;
225explicit all-modules-targets ;
226alias all-installer-targets : $(all-installers) ;
227explicit all-installer-targets ;
228alias all-archive-targets : $(all-archive) ;
229explicit all-archive-targets ;
230
231rule get-root-prefix ( properties * )
232{
233        tag = "UNKNOWN" ;
234    if <architecture>ia64 in $(properties) {
235                tag = "IA64" ;
236        } else {
237                if <address-model>64 in $(properties) {
238                        tag = "x64" ;
239                } else {
240                        tag = "Win32" ;
241                }
242        }
243    #if <variant>debug in $(properties) {
244        #       tag = "$(tag)-debug" ;
245        #}
246        return $(tag) ;
247}
248rule generate-binary-location ( properties * )
249{
250        local tag = [ get-root-prefix $(properties) ] ;
251        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries ;
252}
253rule generate-helper-location ( properties * )
254{
255        local tag = [ get-root-prefix $(properties) ] ;
256        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/helpers ;
257}
258rule generate-scripts-location ( properties * )
259{
260        local tag = [ get-root-prefix $(properties) ] ;
261        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries/scripts ;
262}
263rule generate-module-location ( properties * )
264{
265        local tag = [ get-root-prefix $(properties) ] ;
266        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries/modules ;
267}
268
269install dist-root : all-root-targets : <conditional>@generate-binary-location ;
270explicit dist-root ;
271
272install dist-modules : all-modules-targets : <conditional>@generate-module-location ;
273explicit dist-modules ;
274
275install dist-helpers : all-helpers-targets : <conditional>@generate-helper-location ;
276explicit dist-helpers ;
277
278install dist-scripts : all-scripts-targets : <conditional>@generate-scripts-location ;
279explicit dist-scripts ;
280
281# alias build-binaries : dist-root dist-modules dist-helpers dist-scripts ;
282alias build-binaries : dist-root dist-modules dist-scripts ;
283explicit build-binaries ;
284
285alias build-archives : all-archive-targets : <location>$(BOOST_STAGE_LOCATE)/archive ;
286explicit build-archives ;
287
288alias build-installer : all-installer-targets : <location>$(BOOST_STAGE_LOCATE)/installer ;
289explicit build-installer ;
290
291alias source-archive : helpers/build-source : <location>$(BOOST_STAGE_LOCATE)/archive ;
292explicit source-archive ;
293
294
Note: See TracBrowser for help on using the repository browser.