source: nscp/Jamroot @ 6f5e626

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

Fixed build environment to work better (stand alone)

  • Property mode set to 100644
File size: 7.8 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-changelog = changelog.txt ;
33local target-license = license.txt ;
34local target-counters = counters.defs ;
35
36ECHO "OS =" [ os.name ] ;
37ECHO "name =" $(__name__) ;
38
39# what kind of layout are we doing?
40layout = [ MATCH "^--layout=(.*)" : [ modules.peek : ARGV ] ] ;
41layout ?= versioned ;
42layout-$(layout) = true ;
43
44path-constant TOP : . ;
45
46# possible stage only location
47local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ;
48stage-locate ?= stage ;
49path-constant BOOST_STAGE_LOCATE : $(stage-locate) ;
50
51if $(toolset) = "msvc" {
52        using bjam/openssl : : $(TOP)/lib-source/openssl-0.9.8g/include $(TOP)/lib ;
53        using bjam/boost : : $(TOP)/lib-source/boost_1_35_0 $(TOP)/lib ;
54        using bjam/lua : : $(TOP)/lib-source/lua-5.1.2 ;
55        using bjam/cryptopp : : $(TOP)/lib-source/"Crypto++"/src ;
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        notfile update_version : @update_version ;
86        actions update_version
87        {
88                D:\source\tools\XAutobuild.exe -f $(TOP)
89        }
90       
91}
92
93
94
95project master
96        : requirements
97        <include>include
98        <find-static-library>advapi32
99        <find-static-library>user32
100        <find-static-library>shell32
101        <threading>multi
102        <link>shared
103        $(result)
104
105        : default-build debug
106
107        : build-dir bjam-tmp-build
108        ;
109
110make $(target).exe.manifest : NSClient++.manifest : common.copy ;
111explicit $(target).exe.manifest ;
112
113
114exe $(target)
115
116        : # sources
117        NSClient++.cpp
118        NSCPlugin.cpp
119        include/NSCHelper.cpp
120        include/arrayBuffer.cpp
121        include/ServiceCmd.cpp
122        include/Socket.cpp
123        include/b64/b64.c
124
125        : # requirements
126        <dependency>$(target).exe.manifest
127        #<runtime-link>static
128        <find-static-library>ws2_32
129        <find-static-library>Userenv
130        <find-static-library>ole32
131        <variant>release:<dependency>update_version
132        : # default build
133
134        : # usage requirements
135# depends $(target).manifest
136        ;
137explicit $(target) ;
138
139#
140# Copy various files
141#
142make $(target-config) : nsc.dist : common.copy ;
143explicit $(target-config) ;
144
145make $(target-readme) : files/readme.txt : common.copy ;
146explicit $(target-readme) ;
147
148make $(target-license) : files/license.txt : common.copy ;
149explicit $(target-license) ;
150
151make $(target-changelog) : changelog : common.copy ;
152explicit $(target-changelog) ;
153
154make $(target-counters) : files/counters.defs : common.copy ;
155explicit $(target-counters) ;
156
157all-modules =
158    [ MATCH .*modules/(.*)/.* : [ glob modules/*/Jamfile ] ]
159    ;
160
161# all-modules = NSCAAgent ;
162
163all-scripts =
164    [ MATCH .*scripts/(.+\\..*) : [ glob scripts/* ] ]
165    ;
166local all-scripts-lst ;
167if $(toolset) = "msvc" {
168        if ! ( [ bjam/lua.isEnabled ] = true ) {
169                echo "LUA support disabled skipping build of modules..." ;
170                local result ;
171                for local l in $(all-modules)
172                {
173                        if [ MATCH (.*LUA.*) : $(l) ]
174                        {
175                                echo "Not building module: $(l)" ;
176                        } else {
177                                result += $(l) ;
178                        }
179                }
180                all-modules = $(result) ;
181        }
182        if ! ( [ bjam/psdk.isEnabled ] = true ) {
183                echo "PSDK support disabled skipping build of modules..." ;
184                local result ;
185                for local l in $(all-modules)
186                {
187                        if [ MATCH (.*CheckTaskSched.*) : $(l) ] {
188                                echo "Not building module: $(l)" ;
189                        } else if [ MATCH (.*CheckWMI.*) : $(l) ] {
190                                echo "Not building module: $(l)" ;
191                        } else {
192                                result += $(l) ;
193                        }
194                }
195                all-modules = $(result) ;
196        }
197        for local l in $(all-modules)
198        {
199                alias $(l)
200                        : # sources
201                        modules/$(l)
202                        : # requirements
203                        : # default build
204                        : # usage requirements
205                        <dependency>$(target)
206                        ;
207                echo "Adding module: $(l)" ;
208                explicit $(l) ;
209        }
210        for local l in $(all-scripts)
211        {
212                #make scripts-$(l) : scripts/$(l) : common.copy ;
213                #explicit scripts/$(l) ;
214
215                #alias scripts-$(l) : scripts/$(l) ;
216                #explicit scripts-$(l) ;
217
218                all-scripts-lst = $(all-scripts-lst) scripts/$(l) ;
219
220                echo "Adding script: $(l)" ;
221        }
222}
223
224all-installers =
225    [ MATCH .*helpers/(.*)/.* : [ glob helpers/*installer/Jamfile ] ]
226    ;
227for local l in $(all-installers)
228{
229        alias $(l) : helpers/$(l) ;
230        echo "Adding installer target for: $(l)" ;
231        explicit $(l) ;
232}
233
234all-archive =
235    [ MATCH .*helpers/(.*)/.* : [ glob helpers/*archive/Jamfile ] ]
236    ;
237for local l in $(all-archive)
238{
239        alias $(l) : helpers/$(l) ;
240        echo "Adding archive target for: $(l)" ;
241        explicit $(l) ;
242}
243
244alias installer_dll : helpers/installer_dll ;
245explicit installer_dll ;
246
247all-helpers = installer_dll ;
248alias all-helpers-targets : $(all-helpers) ;
249explicit all-helpers-targets ;
250
251alias all-scripts-targets : $(all-scripts-lst) ;
252explicit all-scripts-targets ;
253
254alias all-root-targets : $(target) $(target-config) $(target-readme) $(target-license) $(target-changelog) $(target-counters) helpers/systray_helper ;
255explicit all-root-targets ;
256
257alias all-modules-targets : $(all-modules) ;
258explicit all-modules-targets ;
259alias all-installer-targets : $(all-installers) ;
260explicit all-installer-targets ;
261alias all-archive-targets : $(all-archive) ;
262explicit all-archive-targets ;
263
264rule get-root-prefix ( properties * )
265{
266    if <architecture>ia64 in $(properties) {
267                return IA64 ;
268        } else {
269                if <address-model>64 in $(properties) { return x64 ; }
270                else { return Win32 ; }
271        }
272}
273rule generate-binary-location ( properties * )
274{
275        local tag = [ get-root-prefix $(properties) ] ;
276        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries ;
277}
278rule generate-helper-location ( properties * )
279{
280        local tag = [ get-root-prefix $(properties) ] ;
281        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/helpers ;
282}
283rule generate-scripts-location ( properties * )
284{
285        local tag = [ get-root-prefix $(properties) ] ;
286        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries/scripts ;
287}
288rule generate-module-location ( properties * )
289{
290        local tag = [ get-root-prefix $(properties) ] ;
291        return <location>$(BOOST_STAGE_LOCATE)/$(tag)/binaries/modules ;
292}
293
294install dist : all-root-targets : <conditional>@generate-binary-location ;
295explicit dist ;
296
297install dist-modules : all-modules-targets : <conditional>@generate-module-location ;
298explicit dist-modules ;
299
300install dist-helpers : all-helpers-targets : <conditional>@generate-helper-location ;
301explicit dist-helpers ;
302
303install dist-scripts : all-scripts-targets : <conditional>@generate-scripts-location ;
304explicit dist-scripts ;
305
306
307
308alias build-binaries : dist dist-modules dist-helpers dist-scripts ;
309explicit build-binaries ;
310
311
312alias build-archives : all-archive-targets : <location>$(BOOST_STAGE_LOCATE)/archive ;
313explicit build-archives ;
314
315
316alias build-installer : all-installer-targets : <location>$(BOOST_STAGE_LOCATE)/installer ;
317explicit build-installer ;
318
319
320
Note: See TracBrowser for help on using the repository browser.