Yifan Hong | 49641ba | 2017-05-22 18:08:02 -0700 | [diff] [blame] | 1 | common_cflags = [ |
| 2 | "-Werror", |
| 3 | "-Wno-unused-parameter", |
| 4 | "-Wno-unused-const-variable", |
| 5 | "-include bsd-compatibility.h" |
| 6 | ] |
| 7 | |
| 8 | cc_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 Staats | 0c3b1bd | 2017-06-09 09:10:59 -0700 | [diff] [blame] | 31 | cc_defaults { |
| 32 | name: "grep_common", |
Yifan Hong | 49641ba | 2017-05-22 18:08:02 -0700 | [diff] [blame] | 33 | 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 Lozano | f4dafbc | 2017-11-13 14:06:08 -0800 | [diff] [blame] | 43 | |
| 44 | sanitize: { |
| 45 | integer_overflow: false, |
| 46 | }, |
Erik Staats | 0c3b1bd | 2017-06-09 09:10:59 -0700 | [diff] [blame] | 47 | } |
Yifan Hong | 49641ba | 2017-05-22 18:08:02 -0700 | [diff] [blame] | 48 | |
Erik Staats | 0c3b1bd | 2017-06-09 09:10:59 -0700 | [diff] [blame] | 49 | cc_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. |
| 57 | cc_binary { |
| 58 | name: "grep_vendor", |
| 59 | stem: "grep", |
| 60 | vendor: true, |
| 61 | defaults: ["grep_common"], |
Yifan Hong | 49641ba | 2017-05-22 18:08:02 -0700 | [diff] [blame] | 62 | } |