-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathsconstruct
More file actions
430 lines (378 loc) · 18.6 KB
/
sconstruct
File metadata and controls
430 lines (378 loc) · 18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
import os
import shutil
import json
import SCons.Conftest
from collections import deque
class SetDeqEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, set):
return list(obj)
elif isinstance(obj, deque):
return list(obj)
return json.JSONEncoder.default(self, obj)
vars = Variables('scons_options.py')
vars.Add(BoolVariable('MOD_DEBUG', 'Enable Debug', False))
vars.Add(BoolVariable('MOD_MEMORY', 'Enable Memory Cache module', True))
vars.Add(BoolVariable('MOD_MEMCACHED', 'Enable Memcached Cache module', True))
vars.Add(BoolVariable('MOD_REDIS', 'Enable Redis Cache module', True))
vars.Add(BoolVariable('MOD_SDORM_SQL', 'Enable SQL Sdorm module', True))
vars.Add(BoolVariable('MOD_SDORM_MONGO', 'Enable Mongo Sdorm module', True))
vars.Add(BoolVariable('MOD_SDORM_SCYLLA', 'Enable Scylla Sdorm module', False))
vars.Add(BoolVariable('MOD_SER_BIN', 'Enable Binary Serialization module', True))
vars.Add(BoolVariable('MOD_JOBS', 'Enable Jobs module', True))
vars.Add(BoolVariable('MOD_SOLR', 'Enable SOLR Search module', True))
vars.Add(BoolVariable('MOD_ELASTIC', 'Enable Elasticsearch Search module', False))
vars.Add(BoolVariable('SRV_EMB', 'Embedded Http Server Engine', True))
vars.Add(BoolVariable('WITH_RAPIDJSON', 'Use rapidjson for json handling', True))
vars.Add(BoolVariable('WITH_PUGIXML', 'Use pugixml for xml handling', True))
vars.Add(BoolVariable('WITH_PICOEV', 'Enable picoev engine', False))
#print(vars)
# Set our required libraries
libraries = ['z']
library_paths = []
cppDefines = {}
cppFlags = ['-Wall']
cxxFlags = ['-std=c++17']
cppPath = []
#shutil.rmtree('build')
shutil.copy2('src/modules/common/AppDefines.scons.h.in', 'src/modules/common/AppDefines.h')
# define the attributes of the build environment shared between
# both the debug and release builds
common_env = Environment(variables = vars)
Help(vars.GenerateHelpText(common_env))
platform = common_env['PLATFORM']
if platform == 'darwin':
if os.path.isdir('/usr/local/opt/openssl/lib/'):
library_paths.append("/usr/local/opt/openssl/lib/")
cppPath.append("/usr/local/opt/openssl/include")
library_paths.append("/usr/local/lib")
cppPath.append("/usr/local/include")
library_paths.append("/opt/homebrew/lib")
cppPath.append("/opt/homebrew/include")
print("library_paths = %s" % library_paths)
common_env.Append(CPPPATH = cppPath)
common_env.Append(LIBPATH = library_paths)
common_env.Append(CXXFLAGS = cxxFlags)
conf = Configure(common_env)
if conf.CheckDeclaration('SO_REUSEPORT', '#include <sys/socket.h>'):
conf.env.Append(CPPDEFINES=['HAVE_SO_REUSEPORT'])
if conf.CheckDeclaration('SO_REUSEADDR', '#include <sys/socket.h>'):
conf.env.Append(CPPDEFINES=['HAVE_SO_REUSEADDR'])
if conf.CheckDeclaration('TCP_QUICKACK', '#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>'):
conf.env.Append(CPPDEFINES=['HAVE_TCP_QUICKACK'])
if conf.CheckDeclaration('TCP_DEFER_ACCEPT', '#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>'):
conf.env.Append(CPPDEFINES=['HAVE_TCP_DEFER_ACCEPT'])
if conf.CheckDeclaration('TCP_FASTOPEN', '#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>'):
conf.env.Append(CPPDEFINES=['HAVE_TCP_FASTOPEN'])
if conf.CheckDeclaration('SO_ATTACH_REUSEPORT_CBPF', '#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>\n#include <linux/bpf.h>\n#include <linux/filter.h>\n#include <sys/sysinfo.h>'):
conf.env.Append(CPPDEFINES=['HAVE_SO_ATTACH_REUSEPORT_CBPF'])
platform = common_env['PLATFORM']
if platform == 'darwin':
conf.env.Append(CPPDEFINES=['OS_DARWIN', 'APPLE'])
elif platform == 'mingw':
conf.env.Append(CPPDEFINES=['MINGW', 'OS_MINGW', 'USE_WIN_IOCP'])
elif platform == 'cygwin':
conf.env.Append(CPPDEFINES=['CYGWIN'])
elif platform == 'posix':
conf.env.Append(CPPDEFINES=['OS_LINUX'])
else:
print('Incompatible platform %s, exiting!' % platform)
Exit(1)
if conf.CheckCHeader('sys/sysinfo.h'):
conf.env.Append(CPPDEFINES=['HAVE_SYSINFO'])
if conf.CheckLib('uuid'):
conf.env.Append(CPPDEFINES=['HAVE_UUIDLIB'])
elif conf.CheckLib('ossp-uuid'):
conf.env.Append(CPPDEFINES=['HAVE_UUIDLIB'])
else:
print('Did not find uuid library!')
Exit(1)
if conf.CheckCHeader('uuid/uuid.h'):
conf.env.Append(CPPDEFINES=['HAVE_UUIDINC'])
elif conf.CheckCHeader('ossp/uuid.h'):
conf.env.Append(CPPDEFINES=['HAVE_OSSPUUIDINC'])
elif conf.CheckCHeader('ossp/uuid.h'):
conf.env.Append(CPPDEFINES=['HAVE_OSSPUUIDINC_2'])
else:
print('Did not find uuid headers!')
Exit(1)
if not conf.CheckLibWithHeader('curl', 'curl/curl.h', 'c'):
print('Did not find curl library!')
else:
conf.env.Append(CPPDEFINES=['HAVE_CURLLIB', 'HAVE_CURLINC'])
if conf.CheckCHeader('regex.h'):
conf.env.Append(CPPDEFINES=['HAVE_REGEX'])
else:
if not conf.CheckLibWithHeader('onig', 'onigposix.h', 'c'):
print('Did not find oniguruma library!')
else:
conf.env.Append(CPPDEFINES=['HAVE_ONIG_REGEX', 'HAVE_ONIG_REGEX_LIB'])
mod_scylla = ARGUMENTS.get('MOD_SDORM_SCYLLA', False)
if bool(mod_scylla):
if not conf.CheckLibWithHeader('scylla-cpp-driver', 'cassandra.h', 'cxx'):
print('Did not find scylla development files!')
Exit(1)
mod_sql = ARGUMENTS.get('MOD_SDORM_SQL', True)
if bool(mod_sql):
if conf.CheckLibWithHeader('odbc', 'sql.h', 'c'):
conf.env.Append(CPPDEFINES=['HAVE_SQLINC', 'INC_SDORM', 'INC_SDORM_SQL', 'HAVE_ODBCLIB'])
if conf.CheckLib('pq'):
pqhdr = False
if conf.CheckCHeader('libpq-fe.h'):
pqhdr = True
if FindFile('libpq-fe.h', '/usr/include/postgresql'):
pqhdr = True
conf.env.Append(CPPPATH=['/usr/include/postgresql'])
elif FindFile('libpq-fe.h', '/usr/include/pgsql'):
pqhdr = True
conf.env.Append(CPPPATH=['/usr/include/pgsql'])
elif FindFile('libpq-fe.h', '/usr/local/include/postgresql'):
pqhdr = True
conf.env.Append(CPPPATH=['/usr/local/include/postgresql'])
elif FindFile('libpq-fe.h', '/usr/local/include/pgsql'):
pqhdr = True
conf.env.Append(CPPPATH=['/usr/local/include/pgsql'])
elif FindFile('libpq-fe.h', '/opt/homebrew/include/postgresql'):
pqhdr = True
conf.env.Append(CPPPATH=['/opt/homebrew/include/postgresql'])
elif FindFile('libpq-fe.h', '/opt/homebrew/include/pgsql'):
pqhdr = True
conf.env.Append(CPPPATH=['/opt/homebrew/include/pgsql'])
if pqhdr:
conf.env.Append(CPPDEFINES=['HAVE_PQHDR', 'HAVE_LIBPQ'])
if conf.CheckFunc('PQenterBatchMode', '#include <libpq-fe.h>'):
conf.env.Append(CPPDEFINES=['HAVE_LIBPQ_BATCH'])
if conf.CheckFunc('PQenterPipelineMode', '#include <libpq-fe.h>'):
conf.env.Append(CPPDEFINES=['HAVE_LIBPQ_PIPELINE'])
mod_mongo = ARGUMENTS.get('MOD_SDORM_MONGO', True)
if bool(mod_mongo):
if conf.CheckLib('bson-1.0') and conf.CheckLib('mongoc-1.0'):
if FindFile('bson.h', '/usr/include/libbson-1.0'):
conf.env.Append(CPPPATH=['/usr/include/libbson-1.0'])
conf.env.Append(CPPPATH=['/usr/include/libmongoc-1.0'])
conf.env.Append(CPPDEFINES=['HAVE_BSONLIB', 'HAVE_MONGOCLIB', 'HAVE_BSONINC', 'HAVE_MONGOINC', 'INC_SDORM', 'INC_SDORM_MONGO'])
elif FindFile('bson.h', '/usr/local/include/libbson-1.0'):
conf.env.Append(CPPPATH=['/usr/local/include/libbson-1.0'])
conf.env.Append(CPPPATH=['/usr/local/include/libmongoc-1.0'])
conf.env.Append(CPPDEFINES=['HAVE_BSONLIB', 'HAVE_MONGOCLIB', 'HAVE_BSONINC', 'HAVE_MONGOINC', 'INC_SDORM', 'INC_SDORM_MONGO'])
elif FindFile('bson.h', '/opt/homebrewinclude/libbson-1.0'):
conf.env.Append(CPPPATH=['/opt/homebrew/include/libbson-1.0'])
conf.env.Append(CPPPATH=['/opt/homebrew/include/libmongoc-1.0'])
conf.env.Append(CPPDEFINES=['HAVE_BSONLIB', 'HAVE_MONGOCLIB', 'HAVE_BSONINC', 'HAVE_MONGOINC', 'INC_SDORM', 'INC_SDORM_MONGO'])
else:
print('Did not find mongo development files!')
Exit(1)
if conf.CheckLib('ssl') and conf.CheckLib('crypto') and conf.CheckCHeader('openssl/ssl.h'):
conf.env.Append(CPPDEFINES=['HAVE_SSLINC', 'HAVE_CRYPTOLIB', 'HAVE_SSLLIB'])
mod_memcached = ARGUMENTS.get('MOD_MEMCACHED', True)
if bool(mod_memcached):
if conf.CheckLib('memcachedutil') and conf.CheckLibWithHeader('memcached', 'libmemcached/memcached.h', 'c'):
conf.env.Append(CPPDEFINES=['HAVE_MEMCACHEDINC', 'INC_MEMCACHED', 'HAVE_MEMCACHEDLIB'])
else:
mod_memcached = False
mod_redis = ARGUMENTS.get('MOD_REDIS', True)
if bool(mod_redis):
if conf.CheckLibWithHeader('hiredis', 'hiredis/hiredis.h', 'c'):
conf.env.Append(CPPDEFINES=['HAVE_REDISINC', 'INC_REDISCACHE', 'HAVE_REDISLIB'])
if conf.CheckLibWithHeader('redis++', 'sw/redis++/redis++.h', 'cxx'):
conf.env.Append(CPPDEFINES=['HAVE_REDIS_CLUSTERINC', 'HAVE_REDIS_CLUSTERLIB'])
else:
mod_redis = False
mod_solr = ARGUMENTS.get('MOD_SOLR', True)
if bool(mod_solr):
conf.env.Append(CPPDEFINES=['HAVE_SOLR'])
mod_elastic = ARGUMENTS.get('MOD_ELASTIC', False)
if bool(mod_elastic):
if conf.CheckLibWithHeader('elasticlient', 'elasticlient/client.h', 'cxx'):
conf.env.Append(CPPDEFINES=['HAVE_ELASTIC'])
onf.env.Append(CPPDEFINES=['HAVE_ELASTICLIB'])
if conf.CheckLibWithHeader('cpr', 'cpr/response.h', 'cxx'):
conf.env.Append(CPPDEFINES=['HAVE_CPR'])
conf.env.Append(CPPDEFINES=['HAVE_CPRLIB'])
else:
print('Did not find cpr devel files!')
Exit(1)
else:
print('Did not find elasticlient devel files!')
Exit(1)
if conf.CheckLib('dl'):
pass
if conf.CheckLib('pthread'):
pass
if not conf.CheckCXXHeader('libcuckoo/cuckoohash_map.hh'):
if not FindFile('libcuckoo/cuckoohash_map.hh', '/usr/include') and not FindFile('libcuckoo/cuckoohash_map.hh', '/usr/local/include'):
print('Did not find libcuckoo header files!')
Exit(1)
mod_ser_bin = ARGUMENTS.get('MOD_SER_BIN', True)
if bool(mod_ser_bin):
conf.env.Append(CPPDEFINES=['INC_BINSER'])
mod_jobs = ARGUMENTS.get('MOD_JOBS', True)
if bool(mod_jobs):
conf.env.Append(CPPDEFINES=['INC_JOBS'])
mod_withpicoev = ARGUMENTS.get('WITH_PICOEV', False)
if bool(mod_withpicoev):
if not conf.CheckCHeader('liburing'):
conf.env.Append(CPPDEFINES=['USE_PICOEV'])
mod_memory = ARGUMENTS.get('MOD_MEMORY', True)
if bool(mod_memory):
conf.env.Append(CPPDEFINES=['INC_MEMORYCACHE'])
mod_srvenb = ARGUMENTS.get('SRV_EMB', True)
if bool(mod_srvenb):
conf.env.Append(CPPDEFINES=['SRV_EMB'])
mod_withrj = ARGUMENTS.get('WITH_RAPIDJSON', True)
if bool(mod_withrj) and conf.CheckCXXHeader('rapidjson/document.h'):
conf.env.Append(CPPDEFINES=['HAVE_RAPID_JSON'])
mod_withpx = ARGUMENTS.get('WITH_PUGIXML', True)
if bool(mod_withrj) and conf.CheckLibWithHeader('pugixml', 'pugixml.hpp', 'cxx'):
conf.env.Append(CPPDEFINES=['HAVE_PUGI_XML'])
if conf.CheckCHeader('liburing'):
conf.env.Append(CPPDEFINES=['USE_IO_URING'])
elif conf.CheckCHeader('sys/epoll.h'):
conf.env.Append(CPPDEFINES=['USE_EPOLL'])
elif conf.CheckCHeader('sys/event.h'):
conf.env.Append(CPPDEFINES=['USE_KQUEUE'])
elif conf.CheckCHeader('port.h'):
conf.env.Append(CPPDEFINES=['USE_EVPORT'])
elif conf.CheckCHeader('sys/devpoll.h'):
conf.env.Append(CPPDEFINES=['USE_DEVPOLL'])
elif conf.CheckCHeader('sys/poll.h'):
conf.env.Append(CPPDEFINES=['USE_POLL'])
elif conf.CheckCHeader('sys/select.h'):
conf.env.Append(CPPDEFINES=['USE_SELECT'])
if conf.CheckCHeader('execinfo.h'):
conf.env.Append(CPPDEFINES=['HAVE_EXECINFOINC'])
if conf.CheckCHeader('sys/sendfile.h'):
conf.env.Append(CPPDEFINES=['IS_SENDFILE'])
if not conf.CheckFunc('accept4'):
print('Did not find accept4(), using local version')
common_env = conf.Finish()
mod_debug = ARGUMENTS.get('MOD_DEBUG', False)
if bool(mod_debug):
cppFlags.Append('-g');
common_env.Append(CPPPATH = cppPath)
common_env.Append(LIBPATH = library_paths)
#common_env.Append(CXXFLAGS = cxxFlags)
common_env.Append(LIBS = libraries)
common_env.Append(CPPDEFINES = cppDefines)
common_env.Append(CPPFLAGS = cppFlags)
# uncomment to force g++ for c code also--creates warnings but
# avoids need for extern "C"
# env['CC'] = 'g++'
all_libs=[]
libs=common_env.get('LIBS')
for lb in libs:
all_libs.append('-l'+lb)
#print all_libs
Delete("rtdcf/sconstruct")
subst = Environment(tools = ['textfile'])
substitutions = {'@CPPPATH@': json.dumps(common_env.get('CPPPATH'), cls=SetDeqEncoder), '@LIBPATH@': json.dumps(common_env.get('LIBPATH'), cls=SetDeqEncoder), '@CPPFLAGS@': json.dumps(cppFlags, cls=SetDeqEncoder),
'@CXXFLAGS@': json.dumps(cxxFlags, cls=SetDeqEncoder), '@LIBS@': json.dumps(all_libs, cls=SetDeqEncoder), '@CPPDEFINES@': json.dumps(common_env.get('CPPDEFINES'), cls=SetDeqEncoder)}
subst.Substfile('rtdcf/sconstruct.in', SUBST_DICT = substitutions)
# Our release build is derived from the common build environment...
release_env = common_env.Clone()
release_env.Append(CPPDEFINES=['RELEASE'])
release_env.VariantDir('build/release/src/modules', 'src/modules', duplicate=0)
release_env.VariantDir('build/release/src/framework', 'src/framework', duplicate=0)
release_env.VariantDir('build/release/tests', 'tests', duplicate=0)
release_env.VariantDir('build/release/src/server', 'src/server', duplicate=0)
release_env.VariantDir('build/release/web/default', 'web/default', duplicate=0)
release_env.VariantDir('build/release/web/oauthApp', 'web/oauthApp', duplicate=0)
release_env.VariantDir('build/release/web/flexApp', 'web/flexApp', duplicate=0)
release_env.VariantDir('build/release/web/peer-server', 'web/peer-server', duplicate=0)
release_env.VariantDir('build/release/web/markers', 'web/markers', duplicate=0)
release_env.VariantDir('build/release/web/te-benchmark', 'web/te-benchmark', duplicate=0)
release_env.VariantDir('build/release/web/t1', 'web/t1', duplicate=0)
release_env.VariantDir('build/release/web/t2', 'web/t2', duplicate=0)
release_env.VariantDir('build/release/web/t3', 'web/t3', duplicate=0)
release_env.VariantDir('build/release/web/t4', 'web/t4', duplicate=0)
release_env.VariantDir('build/release/web/t5', 'web/t5', duplicate=0)
release_env.VariantDir('build/release/web/t6', 'web/t6', duplicate=0)
release_env.VariantDir('build/release/web/t7', 'web/t7', duplicate=0)
# We define our debug build environment in a similar fashion...
debug_env = common_env.Clone()
debug_env.Append(CPPDEFINES=['DEBUG'])
debug_env.VariantDir('build/debug/src/modules', 'src/modules', duplicate=0)
debug_env.VariantDir('build/debug/src/framework', 'src/framework', duplicate=0)
debug_env.VariantDir('build/debug/tests', 'tests', duplicate=0)
debug_env.VariantDir('build/debug/src/server', 'src/server', duplicate=0)
debug_env.VariantDir('build/debug/web/default', 'web/default', duplicate=0)
debug_env.VariantDir('build/debug/web/oauthApp', 'web/oauthApp', duplicate=0)
debug_env.VariantDir('build/debug/web/flexApp', 'web/flexApp', duplicate=0)
debug_env.VariantDir('build/debug/web/peer-server', 'web/peer-server', duplicate=0)
debug_env.VariantDir('build/debug/web/markers', 'web/markers', duplicate=0)
debug_env.VariantDir('build/debug/web/te-benchmark', 'web/te-benchmark', duplicate=0)
debug_env.VariantDir('build/debug/web/t1', 'web/t1', duplicate=0)
debug_env.VariantDir('build/debug/web/t2', 'web/t2', duplicate=0)
debug_env.VariantDir('build/debug/web/t3', 'web/t3', duplicate=0)
debug_env.VariantDir('build/debug/web/t4', 'web/t4', duplicate=0)
debug_env.VariantDir('build/debug/web/t5', 'web/t5', duplicate=0)
debug_env.VariantDir('build/debug/web/t6', 'web/t6', duplicate=0)
debug_env.VariantDir('build/debug/web/t7', 'web/t7', duplicate=0)
build_env=release_env
mode='release'
if bool(mod_debug):
mode='debug'
build_env=debug_env
modeDir = 'build/%s' % mode
build_env.SConscript('%s/src/modules/sconscript' % modeDir, {'env': build_env, 'mod_mongo': bool(mod_mongo), 'mod_scylla': bool(mod_scylla), 'mod_solr': bool(mod_solr), 'mod_elastic': bool(mod_elastic)})
build_env.SConscript('%s/src/framework/sconscript' % modeDir, {'env': build_env, 'mod_mongo': bool(mod_mongo), 'mod_scylla': bool(mod_scylla), 'mod_solr': bool(mod_solr), 'mod_elastic': bool(mod_elastic)})
build_env.SConscript('%s/src/server/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/tests/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/default/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/oauthApp/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/flexApp/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/peer-server/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/markers/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/te-benchmark/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/t1/sconscript' % modeDir, {'env': build_env})
if bool(mod_mongo):
build_env.SConscript('%s/web/t2/sconscript' % modeDir, {'env': build_env})
if bool(mod_sql):
build_env.SConscript('%s/web/t3/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/t4/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/t5/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/t6/sconscript' % modeDir, {'env': build_env})
build_env.SConscript('%s/web/t7/sconscript' % modeDir, {'env': build_env})
Delete("ffead-cpp-7.0-bin")
Mkdir("ffead-cpp-7.0-bin")
Mkdir("ffead-cpp-7.0-bin/include")
Mkdir("ffead-cpp-7.0-bin/lib")
Mkdir("ffead-cpp-7.0-bin/tests")
Mkdir("ffead-cpp-7.0-bin/logs")
build_env.Install('ffead-cpp-7.0-bin', source = ['resources', 'public', 'web', 'rtdcf', modeDir+'/bin/ffead-cpp'])
build_env.Install('ffead-cpp-7.0-bin', source = Glob('script/*.sh') + Glob('script/*.key') + Glob('script/*.pem') + Glob('script/*.crt'))
build_env.Install('ffead-cpp-7.0-bin/include', source = Glob('src/framework/*.h') + Glob('src/modules/*.h'))
for root, dirnames, filenames in os.walk('src/modules'):
filenames = [f for f in filenames if not f[0] == '.']
dirnames[:] = [d for d in dirnames if not d[0] == '.']
for dirname in dirnames:
dirPath = os.path.join(root,dirname)
if build_env['PLATFORM'] != 'mingw' and 'wepoll' in dirPath:
continue
if 'gtm' in dirPath:
continue
if 'mongo' in dirPath:
if not mod_mongo:
continue
if 'scylla' in dirPath:
if not mod_scylla:
continue
if 'solr' in dirPath:
if not mod_solr:
continue
if 'elasticsearch' in dirPath:
if not mod_elastic:
continue
build_env.Install('ffead-cpp-7.0-bin/include', source = Glob("%s/*.h" % dirPath))
for root, dirnames, filenames in os.walk('web'):
filenames = [f for f in filenames if not f[0] == '.']
dirnames[:] = [d for d in dirnames if not d[0] == '.']
for dirname in dirnames:
dirPath = os.path.join(root, dirname, 'include')
if bool(mod_mongo) and 't2' in dirPath:
continue
if bool(mod_sql) and ('t3' in dirPath or 't4' in dirPath or 't5' in dirPath or 't6' in dirPath or 't7' in dirPath):
continue
#delete src and other build files from web directories
build_env.Install('ffead-cpp-7.0-bin/lib', source = Glob(modeDir+'/bin/lib*'))
build_env.Install('ffead-cpp-7.0-bin/tests', source = Glob('tests/*.sh') + Glob('tests/*.csv') + Glob('tests/*.prop') + Glob('tests/*.pem') + [modeDir+'/bin/tests'])