blob: 9c2cafac27b3ccca028afa1250ea0d7aed00e2d1 [file] [log] [blame]
Yifan Hong49641ba2017-05-22 18:08:02 -07001common_cflags = [
2 "-Werror",
3 "-Wno-unused-parameter",
4 "-Wno-unused-const-variable",
5 "-include bsd-compatibility.h"
6]
7
8cc_library_static {
9 srcs: [
10 "upstream-netbsd/bin/dd/args.c",
11 "upstream-netbsd/bin/dd/conv.c",
12 "upstream-netbsd/bin/dd/dd.c",
13 "upstream-netbsd/bin/dd/dd_hostops.c",
14 "upstream-netbsd/bin/dd/misc.c",
15 "upstream-netbsd/bin/dd/position.c",
16 "upstream-netbsd/lib/libc/gen/getbsize.c",
17 "upstream-netbsd/lib/libc/gen/humanize_number.c",
18 "upstream-netbsd/lib/libc/stdlib/strsuftoll.c",
19 "upstream-netbsd/lib/libc/string/swab.c",
20 "upstream-netbsd/lib/libutil/raise_default_signal.c",
21 ],
22 cflags: common_cflags + [
23 "-Dmain=dd_main",
24 "-DNO_CONV",
25 ],
26 local_include_dirs: ["upstream-netbsd/include/"],
27 name: "libtoolbox_dd",
28}
29
30// We build BSD grep separately, so it can provide egrep and fgrep too.
Erik Staats0c3b1bd2017-06-09 09:10:59 -070031cc_defaults {
32 name: "grep_common",
Yifan Hong49641ba2017-05-22 18:08:02 -070033 srcs: [
34 "upstream-netbsd/usr.bin/grep/fastgrep.c",
35 "upstream-netbsd/usr.bin/grep/file.c",
36 "upstream-netbsd/usr.bin/grep/grep.c",
37 "upstream-netbsd/usr.bin/grep/queue.c",
38 "upstream-netbsd/usr.bin/grep/util.c",
39 ],
40 cflags: common_cflags,
41 local_include_dirs: ["upstream-netbsd/include/"],
42 symlinks: ["egrep", "fgrep"],
Ivan Lozanof4dafbc2017-11-13 14:06:08 -080043
44 sanitize: {
45 integer_overflow: false,
46 },
Erik Staats0c3b1bd2017-06-09 09:10:59 -070047}
Yifan Hong49641ba2017-05-22 18:08:02 -070048
Erik Staats0c3b1bd2017-06-09 09:10:59 -070049cc_binary {
50 name: "grep",
51 defaults: ["grep_common"],
52}
53
54// Build vendor grep.
55// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
56// when vendor_available is fully supported.
57cc_binary {
58 name: "grep_vendor",
59 stem: "grep",
60 vendor: true,
61 defaults: ["grep_common"],
Yifan Hong49641ba2017-05-22 18:08:02 -070062}