-
Notifications
You must be signed in to change notification settings - Fork 20
/
wscript
89 lines (70 loc) · 1.86 KB
/
wscript
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
# -*- mode: python -*-
# vi: set ft=python :
import sys
import os
def options(opt):
opt.load('compiler_c')
def configure(conf):
conf.load('compiler_c')
conf.load('clib')
if sys.platform == 'darwin':
conf.env.prepend_value('LINKFLAGS', ['-framework', 'CoreFoundation'])
conf.env.prepend_value('LINKFLAGS', ['-framework', 'CoreServices'])
def build(bld):
bld.load('clib')
includes = []
cflags = """
-g
-Werror=int-to-pointer-cast
-Werror=unused-variable
-Werror=return-type
-Werror=uninitialized
-Werror=pointer-to-int-cast
""".split()
lib = ['uv', 'h2o', 'ssl', 'crypto', 'ck']
libpath = [os.getcwd()]
if sys.platform == 'darwin':
cflags.extend("""
-fcolor-diagnostics
-fdiagnostics-color
""".split())
includes.append('/usr/local/opt/openssl/include')
libpath.append('/usr/local/opt/openssl/lib')
elif sys.platform.startswith('linux'):
lib.append('pthread')
lib.append('rt')
clibs = """
b64
bmon
container_of
h2o_helpers
heap
lmdb
lmdb_helpers
minmax
pidfile
uv_helpers
uv_multiplex
""".split()
h2o_includes = """
./deps/h2o/include
./deps/picohttpparser
./deps/klib
./deps/kstr
""".split()
uv_includes = """
./deps/libuv/include
""".split()
ck_includes = """
./deps/ck/include
""".split()
bld.program(
source="""
src/main.c
""".split() + bld.clib_c_files(clibs),
includes=['./include'] + includes + bld.clib_h_paths(clibs) + h2o_includes + uv_includes + ck_includes,
target='pearl',
stlibpath=['.'],
libpath=libpath,
lib=lib,
cflags=cflags)