root/branches/stable/Jamroot @ 261

Revision 261, 9.0 KB (checked in by mickem, 6 months ago)

+ Added new option append-filter-<key>=<value> to CheckEventLog to allow "and" of filter rules.

CheckEventLog file=application file=system filter=out MaxWarn=1 MaxCrit=1 filter-eventID=ne:1 filter-eventID=eq:1 append-filter-eventSource==SecurityCenter? truncate=1023 unique descriptions "syntax=%source%: %id% (%count%)"

+ Added debug option to CheckEventLog (to allow settingdebug on per-check)
+ Added obfuscated_password to NSCA section
+ Added so "global" ([Settings] password=...) passwords are read from the NSCA module

Also various changes to make it build with latest version of boost build.

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