blob: b10f6738f40f0b48ee25007e532dc74bfa2c6612 [file] [log] [blame]
Sergiusz Bazanski0037eda2020-06-13 22:43:06 +02001# Copyright 2019 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# The Oniguruma library.
16cc_library(
17 name = "oniguruma",
18 hdrs = [
19 "src/oniguruma.h",
20 ],
21 visibility = ["//visibility:public"],
22 deps = [
23 ":ascii",
24 ":big5",
25 ":cp1251",
26 ":euc_jp",
27 ":euc_kr",
28 ":euc_tw",
29 ":gb18030",
30 ":iso8859",
31 ":koi8",
32 ":onig_init",
33 ":regcomp",
34 ":regenc",
35 ":regerror",
36 ":regexec",
37 ":regext",
38 ":reggnu",
39 ":regparse",
40 ":regposix",
41 ":regsyntax",
42 ":regtrav",
43 ":regversion",
44 ":sjis",
45 ":st",
46 ":unicode",
47 ":utf16",
48 ":utf32",
49 ":utf8",
50 ],
51)
52
53# The mktable binary.
54cc_binary(
55 name = "mktable",
56 srcs = [
57 "src/mktable.c",
58 ],
59 deps = [
60 ":oniguruma",
61 ],
62)
63
64# Other libraries linked in with :oniguruma.
65cc_library(
66 name = "ascii",
67 srcs = [
68 "src/ascii.c",
69 ],
70 deps = [
71 ":regenc",
72 ],
73 alwayslink = 1,
74)
75
76cc_library(
77 name = "big5",
78 srcs = [
79 "src/big5.c",
80 ],
81 deps = [
82 ":regenc",
83 ],
84 alwayslink = 1,
85)
86
87cc_library(
88 name = "cp1251",
89 srcs = [
90 "src/cp1251.c",
91 ],
92 deps = [
93 ":regenc",
94 ],
95 alwayslink = 1,
96)
97
98cc_library(
99 name = "euc_jp",
100 srcs = [
101 "src/euc_jp.c",
102 "src/euc_jp_prop.c",
103 ],
104 deps = [
105 ":regenc",
106 ],
107 alwayslink = 1,
108)
109
110cc_library(
111 name = "euc_kr",
112 srcs = [
113 "src/euc_kr.c",
114 ],
115 deps = [
116 ":regenc",
117 ],
118 alwayslink = 1,
119)
120
121cc_library(
122 name = "euc_tw",
123 srcs = [
124 "src/euc_tw.c",
125 ],
126 deps = [
127 ":regenc",
128 ],
129 alwayslink = 1,
130)
131
132cc_library(
133 name = "gb18030",
134 srcs = [
135 "src/gb18030.c",
136 ],
137 deps = [
138 ":regenc",
139 ],
140 alwayslink = 1,
141)
142
143cc_library(
144 name = "iso8859",
145 srcs = [
146 "src/iso8859_1.c",
147 "src/iso8859_10.c",
148 "src/iso8859_11.c",
149 "src/iso8859_13.c",
150 "src/iso8859_14.c",
151 "src/iso8859_15.c",
152 "src/iso8859_16.c",
153 "src/iso8859_2.c",
154 "src/iso8859_3.c",
155 "src/iso8859_4.c",
156 "src/iso8859_5.c",
157 "src/iso8859_6.c",
158 "src/iso8859_7.c",
159 "src/iso8859_8.c",
160 "src/iso8859_9.c",
161 ],
162 deps = [
163 ":regenc",
164 ],
165 alwayslink = 1,
166)
167
168cc_library(
169 name = "koi8",
170 srcs = [
171 "src/koi8.c",
172 "src/koi8_r.c",
173 ],
174 deps = [
175 ":regenc",
176 ],
177 alwayslink = 1,
178)
179
180cc_library(
181 name = "onig_init",
182 srcs = [
183 "src/onig_init.c",
184 ],
185 deps = [
186 ":regenc",
187 ],
188 alwayslink = 1,
189)
190
191cc_library(
192 name = "regcomp",
193 srcs = [
194 "src/regcomp.c",
195 ],
196 deps = [
197 ":regparse",
198 ],
199 alwayslink = 1,
200 copts = [
201 "-Wno-maybe-uninitialized",
202 ],
203)
204
205cc_library(
206 name = "regenc",
207 srcs = [
208 "src/regenc.c",
209 ],
210 hdrs = [
211 "src/oniguruma.h",
212 "src/regenc.h",
213 "src/regint.h",
214 ],
215 deps = [
216 ":config",
217 ],
218 alwayslink = 1,
219)
220
221cc_library(
222 name = "regerror",
223 srcs = [
224 "src/regerror.c",
225 ],
226 deps = [
227 ":regenc",
228 ],
229 alwayslink = 1,
230)
231
232cc_library(
233 name = "regexec",
234 srcs = [
235 "src/regexec.c",
236 ],
237 deps = [
238 ":regenc",
239 ],
240 alwayslink = 1,
241)
242
243cc_library(
244 name = "regext",
245 srcs = [
246 "src/regext.c",
247 ],
248 deps = [
249 ":regenc",
250 ],
251 alwayslink = 1,
252)
253
254cc_library(
255 name = "reggnu",
256 srcs = [
257 "src/reggnu.c",
258 ],
259 hdrs = [
260 "src/oniggnu.h",
261 ],
262 deps = [
263 ":regenc",
264 ],
265 alwayslink = 1,
266)
267
268cc_library(
269 name = "regparse",
270 srcs = [
271 "src/regparse.c",
272 ],
273 hdrs = [
274 "src/regparse.h",
275 ],
276 deps = [
277 ":st",
278 ],
279 alwayslink = 1,
280)
281
282cc_library(
283 name = "regposix",
284 srcs = [
285 "src/regposerr.c",
286 "src/regposix.c",
287 ],
288 hdrs = [
289 "src/onigposix.h",
290 ],
291 deps = [
292 ":config",
293 ":regenc",
294 ],
295 alwayslink = 1,
296)
297
298cc_library(
299 name = "regsyntax",
300 srcs = [
301 "src/regsyntax.c",
302 ],
303 deps = [
304 ":regenc",
305 ],
306 alwayslink = 1,
307)
308
309cc_library(
310 name = "regtrav",
311 srcs = [
312 "src/regtrav.c",
313 ],
314 deps = [
315 ":regenc",
316 ],
317 alwayslink = 1,
318)
319
320cc_library(
321 name = "regversion",
322 srcs = [
323 "src/regversion.c",
324 ],
325 deps = [
326 ":regenc",
327 ],
328 alwayslink = 1,
329)
330
331cc_library(
332 name = "sjis",
333 srcs = [
334 "src/sjis.c",
335 "src/sjis_prop.c",
336 ],
337 deps = [
338 ":regenc",
339 ],
340 alwayslink = 1,
341)
342
343cc_library(
344 name = "st",
345 srcs = [
346 "src/st.c",
347 ],
348 hdrs = [
349 "src/st.h",
350 ],
351 deps = [
352 ":regenc",
353 ],
354 alwayslink = 1,
355)
356
357cc_library(
358 name = "unicode",
359 srcs = [
360 "src/unicode.c",
361 "src/unicode_fold1_key.c",
362 "src/unicode_fold2_key.c",
363 "src/unicode_fold3_key.c",
364 "src/unicode_unfold_key.c",
365 ],
366 deps = [
367 ":config",
368 ":data",
369 ":regenc",
370 ":st",
371 ],
372 alwayslink = 1,
373)
374
375cc_library(
376 name = "utf8",
377 srcs = [
378 "src/utf8.c",
379 ],
380 deps = [
381 ":regenc",
382 ],
383 alwayslink = 1,
384)
385
386cc_library(
387 name = "utf16",
388 srcs = [
389 "src/utf16_be.c",
390 "src/utf16_le.c",
391 ],
392 deps = [
393 ":regenc",
394 ],
395 alwayslink = 1,
396)
397
398cc_library(
399 name = "utf32",
400 srcs = [
401 "src/utf32_be.c",
402 "src/utf32_le.c",
403 ],
404 deps = [
405 ":regenc",
406 ],
407 alwayslink = 1,
408)
409
410# Generated data files.
411cc_library(
412 name = "data",
413 hdrs = [
414 "src/unicode_egcb_data.c",
415 "src/unicode_fold_data.c",
416 "src/unicode_property_data.c",
417 "src/unicode_property_data_posix.c",
418 "src/unicode_wb_data.c",
419 ],
420)
421
422# CC library containing config.h.
423cc_library(
424 name = "config",
425 hdrs = [
426 ":config_h",
427 ],
428)
429
430genrule(
431 name = "config_h",
432 srcs = glob(["**"]),
433 outs = ["config.h"],
434 cmd =
435 "( " +
436 " cd external/com_github_kkos_oniguruma; " +
437 " ./configure > /dev/null; " +
438 "); " +
439 "cp external/com_github_kkos_oniguruma/src/config.h \"$@\"; ",
440)
441