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"], |
Erik Staats | 0c3b1bd | 2017-06-09 09:10:59 -0700 | [diff] [blame] | 43 | } |
Yifan Hong | 49641ba | 2017-05-22 18:08:02 -0700 | [diff] [blame] | 44 | |
Erik Staats | 0c3b1bd | 2017-06-09 09:10:59 -0700 | [diff] [blame] | 45 | cc_binary { |
| 46 | name: "grep", |
| 47 | defaults: ["grep_common"], |
| 48 | } |
| 49 | |
| 50 | // Build vendor grep. |
| 51 | // TODO: Add vendor_available to "grep" module and remove "grep_vendor" module |
| 52 | // when vendor_available is fully supported. |
| 53 | cc_binary { |
| 54 | name: "grep_vendor", |
| 55 | stem: "grep", |
| 56 | vendor: true, |
| 57 | defaults: ["grep_common"], |
Yifan Hong | 49641ba | 2017-05-22 18:08:02 -0700 | [diff] [blame] | 58 | } |