source: nscp/Jamroot @ 2e8b33f

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

Changes to the build system to fix broken psdk.jam libs as well as addition to support building debug symbols.

  • Property mode set to 100644
File size: 8.7 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        all-modules-text = "" ;
211        for local l in $(all-modules) {
212                alias $(l)
213                        : # sources
214                        modules/$(l)
215                        : # requirements
216                        : # default build
217                        : # usage requirements
218                        <dependency>$(target)
219                        ;
220                explicit $(l) ;
221                all-modules-text = "$(all-modules-text) $(l)" ;
222        }
223        echo "Building modules: $(all-modules-text)" ;
224        for local l in $(all-scripts) {
225                all-scripts-lst = $(all-scripts-lst) scripts/$(l) ;
226        }
227} else {
228        all-installers =
229                [ MATCH .*helpers/(.*)/.* : [ glob helpers/*installer/Jamfile ] ]
230                ;
231        all-installers-text = "" ;
232        for local l in $(all-installers)
233        {
234                alias $(l) : helpers/$(l) ;
235                explicit $(l) ;
236                all-installers-text = "$(all-installers-text) $(l)" ;
237        }
238        echo "Building installers: $(all-installers-text)" ;
239}
240
241all-archive =
242    [ MATCH .*helpers/(.*)/.* : [ glob helpers/*archive/Jamfile ] ]
243    ;
244for local l in $(all-archive)
245{
246        alias $(l) : helpers/$(l) ;
247        echo "Adding archive target for: $(l)" ;
248        explicit $(l) ;
249}
250
251alias cryptopp-headers : helpers/cryptopp-headers ;
252explicit cryptopp-headers ;
253
254alias installer_dll : helpers/installer_dll helpers/installer_dll_fw ;
255explicit installer_dll ;
256
257alias all-helpers-targets : installer_dll ;
258explicit all-helpers-targets ;
259
260alias all-scripts-targets : $(all-scripts-lst) ;
261explicit all-scripts-targets ;
262
263alias all-root-targets : $(target) $(target-config) $(target-readme) $(target-guide) $(target-refman) $(target-license) $(target-changelog) $(target-counters) helpers/systray_helper ;
264explicit all-root-targets ;
265
266alias all-modules-targets : $(all-modules) ;
267explicit all-modules-targets ;
268alias all-installer-targets : $(all-installers) ;
269explicit all-installer-targets ;
270alias all-archive-targets : $(all-archive) ;
271explicit all-archive-targets ;
272
273rule get-root-prefix ( properties * )
274{
275        tag = "UNKNOWN" ;
276    if <architecture>ia64 in $(properties) {
277                tag = "IA64" ;
278        } else {
279                if <address-model>64 in $(properties) {
280                        tag = "x64" ;
281                } else {
282                        tag = "Win32" ;
283                }
284        }
285    if <variant>debug in $(properties) {
286                tag = "$(tag)-debug" ;
287        }
288        return $(tag) ;
289}
290rule generate-binary-location ( properties * )
291{
292        local tag = [ get-root-prefix $(properties) ] ;
293        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries ;
294}
295rule generate-helper-location ( properties * )
296{
297        local tag = [ get-root-prefix $(properties) ] ;
298        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/helpers ;
299}
300rule generate-scripts-location ( properties * )
301{
302        local tag = [ get-root-prefix $(properties) ] ;
303        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries/scripts ;
304}
305rule generate-module-location ( properties * )
306{
307        local tag = [ get-root-prefix $(properties) ] ;
308        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries/modules ;
309}
310
311install dist : all-root-targets : <conditional>@generate-binary-location ;
312explicit dist ;
313
314install dist-modules : all-modules-targets : <conditional>@generate-module-location ;
315explicit dist-modules ;
316
317install dist-helpers : all-helpers-targets : <conditional>@generate-helper-location ;
318explicit dist-helpers ;
319
320install dist-scripts : all-scripts-targets : <conditional>@generate-scripts-location ;
321explicit dist-scripts ;
322
323alias build-binaries : dist dist-modules dist-helpers dist-scripts ;
324explicit build-binaries ;
325
326
327alias build-archives : all-archive-targets : <location>$(BOOST_STAGE_LOCATE)/archive ;
328explicit build-archives ;
329
330alias build-installer : all-installer-targets : <location>$(BOOST_STAGE_LOCATE)/installer ;
331explicit build-installer ;
332
333alias source-archive : helpers/build-source : <location>$(BOOST_STAGE_LOCATE)/archive ;
334explicit source-archive ;
335
336
Note: See TracBrowser for help on using the repository browser.