Jamroot 7.35 KB
Newer Older
1 2 3 4 5 6 7 8 9
# -*- coding: iso-8859-1-unix -*-

import os ;
import modules ;

path-constant here : . ;
path-constant root : $(here)/.. ;
path-constant deps : $(root)/.. ;

10 11
local lua = [ os.environ LUA ] ;
if ! $(lua)
12
{
13
  lua = "$(deps)/lua" ;
14
}
15
use-project lua : $(lua)/bbuild ; 
16

17 18
local luuid = [ os.environ LUUID ] ;
if ! $(luuid)
19
{
20
  luuid = "$(deps)/luuid" ;
21
}
22
use-project luuid : $(luuid)/bbuild ;
23

24
local openssl-jam = [ os.environ OPENSSL_JAM ] ;
25
if ! $(openssl-jam)
26
{
27
  openssl-jam = "$(deps)/openssl.jam" ;
28
}
29
use-project openssl : $(openssl-jam) ; 
30

31 32
local lce = [ os.environ LCE ] ;
if ! $(lce)
33
{
34
  lce = "$(deps)/lce" ;
35
}
36
use-project lce : $(lce)/bbuild ;
37

38 39
local lfs = [ os.environ LUAFILESYSTEM ] ;
if ! $(lfs)
40
{
41
  lfs = "$(deps)/luafilesystem" ;
42
}
43
use-project lfs : $(lfs)/bbuild ;
44

45 46
local luavararg = [ os.environ LUAVARARG ] ;
if ! $(luavararg)
47
{
48
  luavararg = "$(deps)/luavararg" ;
49
}
50
use-project luavararg : $(luavararg)/bbuild ;
51

52 53
local luastruct = [ os.environ LUASTRUCT ] ;
if ! $(luastruct)
54
{
55
  luastruct = "$(deps)/luastruct" ;
56
}
57
use-project luastruct : $(luastruct)/bbuild ;
58

59 60
local luasocket = [ os.environ LUASOCKET ] ;
if ! $(luasocket)
61
{
62
  luasocket = "$(deps)/luasocket" ;
63
}
64
use-project luasocket : $(luasocket)/bbuild ;
65

66 67
local loop = [ os.environ LOOP ] ;
if ! $(loop)
68
{
69
  loop = "$(deps)/loop" ;
70
}
71
use-project loop : $(loop)/bbuild ;
72

73 74
local oil = [ os.environ OIL ] ;
if ! $(oil)
75
{
76
  oil = "$(deps)/oil" ;
77
}
78
use-project oil : $(oil)/bbuild ;
79

80 81
local luascs = [ os.environ LUASCS ] ;
if ! $(luascs)
82
{
83
  luascs = "$(deps)/luascs" ;
84
}
85
use-project luascs : $(luascs)/bbuild ;
86

87 88
local luasec = [ os.environ LUASEC ] ;
if ! $(luasec)
89
{
90
  luasec = "$(deps)/luasec" ;
91
}
92
use-project luasec : $(luasec)/bbuild ;
93

94 95 96 97 98 99 100
local luasqlite3 = [ os.environ LUASQLITE3 ] ;
if ! $(luasqlite3)
{
  luasqlite3 = "$(deps)/luasqlite3" ;
}
use-project luasqlite3 : $(luasqlite3)/bbuild ;

101 102
scs-idl = [ os.environ SCS_IDL ] ;
if ! $(scs-idl)
103
{
104
  scs-idl = "$(deps)/scs-idl" ;
105 106
}

107 108
openbus-idl = [ os.environ OPENBUS_IDL ] ;
if ! $(openbus-idl)
109
{
110
  openbus-idl = "$(deps)/openbus-idl" ;
111 112
}

113 114
openbus-legacy-idl = [ os.environ OPENBUS_LEGACY_IDL ] ;
if ! $(openbus-legacy-idl)
115
{
116
  openbus-legacy-idl = "$(deps)/openbus-legacy-idl" ;
117 118
}

119 120
openbus-lib-idl = [ os.environ OPENBUS_LIB_IDL ] ;
if ! $(openbus-lib-idl)
121
{
122
  openbus-lib-idl = "$(deps)/openbus-lib-idl" ;
123 124
}

125
modules.load preloader : : $(loop)/bbuild ;
126
import preloader ; 
127 128

using preloader : $(lua) ;
129 130 131 132 133 134 135 136 137 138

project luaopenbus
  : requirements
    <target-os>windows:<pch>off
    <target-os>windows,<link>shared:<runtime-link>shared
    <target-os>windows,<link>static:<runtime-link>static
    <target-os>windows:<debug-store>database
    <target-os>windows:<define>_CRT_SECURE_NO_WARNINGS
    <toolset>msvc-12.0:<cxxflags>/FS
    <debug-symbols>on
139
    <threading>multi
140 141 142 143 144 145
  : default-build
    <variant>release
    <link>static
  ;

make luaopenbus.c
146
  : $(root)/lua/openbus/assistant.lua
147 148 149 150 151 152 153 154 155 156 157 158 159
    $(root)/lua/openbus/assistant2.lua
    $(root)/lua/openbus/core/Access.lua
    $(root)/lua/openbus/core/idl/makeaux.lua
    $(root)/lua/openbus/core/idl.lua
    $(root)/lua/openbus/core/legacy/idl.lua
    $(root)/lua/openbus/core/legacy/parsed.lua
    $(root)/lua/openbus/core/messages.lua
    $(root)/lua/openbus/console/costdin.lua
    $(root)/lua/openbus/console/utils.lua    
    $(root)/lua/openbus/idl/parsed.lua
    $(root)/lua/openbus/idl.lua
    $(root)/lua/openbus/util/argcheck.lua
    $(root)/lua/openbus/util/autotable.lua
160
    $(root)/lua/openbus/util/database_converter.lua
161
    $(root)/lua/openbus/util/database.lua
162
    $(root)/lua/openbus/util/database_legacy.lua
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
    $(root)/lua/openbus/util/except.lua
    $(root)/lua/openbus/util/logger.lua
    $(root)/lua/openbus/util/messages.lua
    $(root)/lua/openbus/util/oo.lua
    $(root)/lua/openbus/util/sandbox.lua
    $(root)/lua/openbus/util/server.lua
    $(root)/lua/openbus/util/sysex.lua
    $(root)/lua/openbus/util/tickets.lua
    $(root)/lua/openbus.lua
    $(root)/src/lthreadlib.c
    $(root)/src/lecholib.c
    $(root)/lua/openbus/core/idl/parsed.lua
  : preloader.pre-compile
  : <search>$(root)
    <location>$(here)
  ;

make luaconsole.c
  : $(root)/lua/openbus/console.lua
  : preloader.pre-compile
183 184
  : <dependency>/lua//stage
    <search>$(root)
185 186 187
    <location>$(here)
  ;

188
modules.load idl2lua : : $(oil)/bbuild ;
189
import idl2lua ; 
190
using idl2lua : $(lua) ;
191 192

make $(root)/lua/openbus/idl/parsed.lua 
193 194 195 196 197 198 199 200
  : $(openbus-lib-idl)/src/openbus.idl
    $(openbus-lib-idl)/src/corba.idl
    $(openbus-idl)/src/openbus_access-2.1.idl
    $(openbus-idl)/src/openbus_offers-2.1.idl
    $(openbus-idl)/src/openbus_export-2.1.idl
    $(openbus-idl)/src/openbus_core-2.1.idl
    $(openbus-idl)/src/openbus_creden-2.1.idl
    $(scs-idl)/src/scs.idl
201
  : idl2lua.compile
202 203 204
  : <include>$(openbus-lib-idl)/src
    <include>$(openbus-idl)/src
    <include>$(scs-idl)/src
205 206 207 208
    <location>$(here)
  ;

make $(root)/lua/openbus/core/idl/parsed.lua 
209 210 211 212 213 214
  : $(openbus-idl)/src/openbus_access-2.1.idl
    $(openbus-idl)/src/openbus_offers-2.1.idl
    $(openbus-idl)/src/openbus_export-2.1.idl
    $(openbus-idl)/src/openbus_core-2.1.idl
    $(openbus-idl)/src/openbus_creden-2.1.idl
    $(scs-idl)/src/scs.idl
215
  : idl2lua.compile
216 217 218
  : <include>$(openbus-idl)/src
    <include>$(openbus-legacy-idl)/src
    <include>$(scs-idl)/src
219 220 221 222
    <location>$(here)
  ;

make $(root)/lua/openbus/core/legacy/parsed.lua 
223 224 225 226 227 228 229 230 231 232
  : $(openbus-legacy-idl)/src/access_control.idl
    $(openbus-legacy-idl)/src/offer_registry.idl
    $(openbus-legacy-idl)/src/data_export.idl
    $(openbus-legacy-idl)/src/core.idl
    $(openbus-legacy-idl)/src/credential.idl
    $(scs-idl)/src/scs.idl
    $(openbus-idl)/src/openbus_legacy-2.1.idl
    $(openbus-idl)/src/openbus_access-2.1.idl
    $(openbus-idl)/src/openbus_core-2.1.idl
    $(openbus-idl)/src/openbus_creden-2.1.idl
233
  : idl2lua.compile
234 235 236
  : <include>$(openbus-legacy-idl)/src
    <include>$(openbus-idl)/src
    <include>$(scs-idl)/src
237 238 239
    <location>$(here)
  ;

240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
local common-requirements =
  <library>/lua//lua
  <library>/luuid//luuid
  <library>/lce//lce
  <library>/luafilesystem//lfs
  <library>/luavararg//luavararg
  <library>/luastruct//luastruct
  <library>/luasocket//luasocket
  <library>/luasec//luasec
  <library>/loop//loop
  <library>/loop//luatuple
  <library>/loop//luacothread
  <library>/oil//oil
  <library>/oil//luaidl
  <library>/luascs//luascs
  <library>/sqlite//sqlite3
  <library>/luasqlite3//lsqlite3
  <dependency>/lce//lce
  <dependency>/loop//loop
  <dependency>/loop//luacothread
  <dependency>/loop//luatuple
  <dependency>/oil//oil
  <dependency>/oil//luaidl
  <dependency>/luascs//luascs
  <dependency>/luasocket//luasocket
  <dependency>/luasec//luasec
  <dependency>/luastruct//luastruct
  <dependency>/luavararg//luavararg    
  <dependency>/sqlite//sqlite3
  <dependency>/luasqlite3//lsqlite3
;


273 274 275 276 277
lib luaopenbus
  : luaopenbus.c
    $(root)/src/openbuslua.c
    $(root)/src/lthreadlib.c
    $(root)/src/lecholib.c
278
  : $(common-requirements)
279 280 281 282 283 284 285 286 287 288 289 290 291 292
    <dependency>luaopenbus.c
    <include>$(root)/src
    <include>$(here)
    <target-os>windows,<link>shared:<linkflags>"/def:$(here)/luaopenbus.def"
  :
  : <include>$(here)
    <include>$(root)/src
  ;
explicit luaopenbus ;

exe busconsole
  : $(root)/src/launcher.c
    $(root)/src/consolelibs.c
    luaconsole.c
293 294
  : $(common-requirements)
    <library>/luaopenbus//luaopenbus    
295 296 297 298 299 300 301 302 303 304
    <dependency>/luaopenbus//luaopenbus
    <define>OPENBUS_PROGNAME=\\\""busconsole\\\""
;
explicit busconsole ;

install stage
  : luaopenbus
    busconsole
  : <location>install
  ;