forked from yahoo/proxy-verifier
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Sconstruct
177 lines (154 loc) · 5.48 KB
/
Sconstruct
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
from parts import *
#enable smart linking
SetOptionDefault("LINKFLAGS", ['-Wl,--copy-dt-needed-entries', '-Wl,--as-needed'])
SetOptionDefault("INSTALL_ROOT", "#")
SetOptionDefault("COMPILER", "${_replace('$TOOLCHAIN',',','_')}")
SetOptionDefault("AUTO_MAKE_DESTDIR", "${ABSPATH('#_destdir/$COMPILER/$PART_ALIAS')}")
SetOptionDefault("CMAKE_DESTDIR", "${ABSPATH('#_destdir/$COMPILER/$PART_ALIAS')}")
SetOptionDefault('default_config', "release")
AddOption("--with-ssl",
dest='with_ssl',
nargs=1,
type='string',
action='store',
metavar='DIR',
default=None,
help='Optional path to custom build of OpenSSL'
)
AddOption("--with-nghttp2",
dest='with_nghttp2',
nargs=1,
type='string',
action='store',
metavar='DIR',
default=None,
help='Optional path to custom build of nghttp2'
)
AddOption("--with-ngtcp2",
dest='with_ngtcp2',
nargs=1,
type='string',
action='store',
metavar='DIR',
default=None,
help='Optional path to custom build of ngtcp2'
)
AddOption("--with-nghttp3",
dest='with_nghttp3',
nargs=1,
type='string',
action='store',
metavar='DIR',
default=None,
help='Optional path to custom build of nghttp3'
)
AddOption("--with-libs",
dest='with_libs',
nargs=1,
type='string',
action='store',
metavar='DIR',
default=None,
help='Optional path containing the various libraries'
)
AddOption('--enable-asan',
dest='enable_asan',
action='store_true',
help='Configure compiling and linking for ASan.')
path_ssl = None
path_nghttp2 = None
path_nghttp3 = None
path_ngtcp2 = None
libs_path = GetOption("with_libs")
if libs_path is not None:
# We initially populate these from the broad --with-libs option. Each can
# be overriden by the more specific options with later processing.
path_ssl = os.path.join(libs_path, 'openssl')
path_nghttp2 = os.path.join(libs_path, 'nghttp2')
path_nghttp3 = os.path.join(libs_path, 'nghttp3')
path_ngtcp2 = os.path.join(libs_path, 'ngtcp2')
def GetOptionWithDefault(option_name, default_value):
'''
Return GetOption's result if option_name was specified, otherwise return
default_value.
'''
specific_value = GetOption(option_name)
return specific_value if specific_value is not None else default_value
# For the various QUIC/HTTP3 dependencies, we pin to a particular commit so that
# these libraries do not change out from under us between clean runs.
path_ssl = GetOptionWithDefault("with_ssl", path_ssl)
if path_ssl is not None:
Part("#lib/openssl.part", CUSTOM_PATH=path_ssl)
else:
Part(
"openssl",
"#lib/openssl.part",
vcs_type=VcsGit(server="github.com", repository="quictls/openssl",
protocol="https",
# A pinned commit from branch openssl-3.3.0-quic.
revision="96b7f14fa936d1b8c43c4003f09ef9ded4c4bc93"
),
mode=['SKIP_DOCS'],
)
path_nghttp2 = GetOptionWithDefault("with_nghttp2", path_nghttp2)
if path_nghttp2 is not None:
Part("#lib/nghttp2.part", CUSTOM_PATH=path_nghttp2)
else:
Part(
"nghttp2",
"#lib/nghttp2.part",
vcs_type=VcsGit(server="github.com", repository="nghttp2/nghttp2",
protocol="https",
tag="v1.62.1"
),
GIT_CLONE_ARGS="--depth=1 --recurse-submodules --shallow-submodules",
mode=['SKIP_DOCS'],
)
path_ngtcp2 = GetOptionWithDefault("with_ngtcp2", path_ngtcp2)
if path_ngtcp2 is not None:
Part("#lib/ngtcp2.part", CUSTOM_PATH=path_ngtcp2)
else:
Part(
"ngtcp2",
"#lib/ngtcp2.part",
vcs_type=VcsGit(server="github.com", repository="ngtcp2/ngtcp2",
protocol="https",
# A pinned commit on branch main.
tag="v1.6.0"
),
GIT_CLONE_ARGS="--depth=1 --recurse-submodules --shallow-submodules",
mode=['SKIP_DOCS'],
)
path_nghttp3 = GetOptionWithDefault("with_nghttp3", path_nghttp3)
if path_nghttp3 is not None:
Part("#lib/nghttp3.part", CUSTOM_PATH=path_nghttp3)
else:
Part(
"nghttp3",
"#lib/nghttp3.part",
vcs_type=VcsGit(server="github.com", repository="ngtcp2/nghttp3",
protocol="https",
# A pinned commit on branch main.
tag="v1.4.0"
),
GIT_CLONE_ARGS="--depth=1 --recurse-submodules --shallow-submodules",
mode=['SKIP_DOCS'],
)
Part("#lib/libyaml-cpp.part",vcs_type=VcsGit(server="github.com", repository="jbeder/yaml-cpp.git", tag="0.8.0"), package_group="proxy-verifier")
custom_rpath=[]
if path_ssl is not None:
custom_rpath.append(path_ssl + "/lib")
if path_nghttp2 is not None:
custom_rpath.append(path_nghttp2 + "/lib")
if path_ngtcp2 is not None:
custom_rpath.append(path_ngtcp2 + "/lib")
if path_nghttp3 is not None:
custom_rpath.append(path_nghttp3 + "/lib")
SetOptionDefault("RPATH", custom_rpath)
Part("code/libswoc.part",vcs_type=VcsGit(server="github.com", repository="SolidWallOfCode/libswoc.git", tag="1.5.1"), package_group="proxy-verifier")
pv_mode = []
if GetOption("enable_asan"):
pv_mode.append('enable-asan')
Default("proxy-verifier::")
Part("local/parts/proxy-verifier.part", package_group="proxy-verifier", mode=pv_mode)
Part("test/unit_tests/unit_tests.part")