source: nscp/Jamroot @ 1fc246c

0.4.00.4.10.4.2stable
Last change on this file since 1fc246c was 1fc246c, checked in by Michael Medin <michael@…>, 4 years ago

SOme minor fixes to the installer and added archive project

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