-
Notifications
You must be signed in to change notification settings - Fork 63
/
configure_server
executable file
·76 lines (55 loc) · 2.02 KB
/
configure_server
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
#!/usr/bin/env python2.7
# Copyright 2016 Nidium Inc. All rights reserved.
# Use of this source code is governed by a MIT license
# that can be found in the LICENSE file.
from konstructor import Build
from konstructor import Builder
from konstructor import Konstruct
from konstructor import Variables
from konstructor import Deps
from konstructor import CommandLine
from konstructor import Tests
import os
CONFIGURE_PATH = os.path.dirname(os.path.realpath(__file__))
Gyp = Builder.Gyp
Gyp.set("nidium_js_disable_window_global", 1)
Gyp.set("nidium_product_define", "NIDIUM_PRODUCT_SERVER")
Variables.set('product', 'nidiumserver')
Deps.set(
Deps.Konstruct("libnidiumcore", "configure_libnidiumcore"),
)
@Deps.register("jemalloc")
def jemalloc():
return {
"location": Deps.GitRepo("https://github.com/jemalloc/jemalloc.git", tag="4.1.0"),
"build": ["./autogen.sh", "./configure --enable-prof", "make"],
"outputs": ["lib/libjemalloc.a"]
}
@CommandLine.option("--jemalloc", default=False)
def jemalloc(jemalloc):
if jemalloc:
Deps.set("jemalloc")
Gyp.set("jemalloc", 1)
@CommandLine.option("--no-fork", default=False)
def nofork(nofork):
if nofork:
Gyp.set("nofork", 1)
@CommandLine.option("--heap-profiling", default=False)
def heapProfiling(profiling):
if profiling:
jemalloc(True)
Deps.set("gperftools")
@CommandLine.option("--unit-tests", default=False)
@CommandLine.option("--auto-tests", default=False)
def testServer(unitTests, autoTests):
tests = []
if unitTests:
tests.append(("../../bin/nidium-server unittests.js", "tests/jsunittest/"))
# XXX : Nidium server needs only a subset of the auto tests. How to handle this ?
# if autoTests:
# tests.append("dist/nidium-server nativejscore/var/js/tests/autotests/auto_suites.js")
Tests.register(tests)
Gyp.setArgs("--depth ./ --include=gyp/config.gypi --include=gyp/common.gypi")
Build.add(Gyp("gyp/nidium-server.gyp"));
if __name__ == '__main__':
Konstruct.start()