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