1cc_defaults { 2 name: "toolbox_defaults", 3 4 cflags: [ 5 "-Werror", 6 "-Wno-unused-parameter", 7 "-Wno-unused-const-variable", 8 "-include bsd-compatibility.h", 9 "-D_FILE_OFFSET_BITS=64", 10 ], 11 local_include_dirs: ["upstream-netbsd/include/"], 12} 13 14cc_library_static { 15 name: "libtoolbox_dd", 16 defaults: ["toolbox_defaults"], 17 vendor_available: true, 18 srcs: [ 19 "upstream-netbsd/bin/dd/args.c", 20 "upstream-netbsd/bin/dd/conv.c", 21 "upstream-netbsd/bin/dd/dd.c", 22 "upstream-netbsd/bin/dd/dd_hostops.c", 23 "upstream-netbsd/bin/dd/misc.c", 24 "upstream-netbsd/bin/dd/position.c", 25 "upstream-netbsd/lib/libc/gen/getbsize.c", 26 "upstream-netbsd/lib/libc/gen/humanize_number.c", 27 "upstream-netbsd/lib/libc/stdlib/strsuftoll.c", 28 "upstream-netbsd/lib/libc/string/swab.c", 29 "upstream-netbsd/lib/libutil/raise_default_signal.c", 30 ], 31 cflags: [ 32 "-Dmain=dd_main", 33 "-DNO_CONV", 34 ], 35} 36 37genrule { 38 name: "toolbox_input_labels", 39 tool_files: ["generate-input.h-labels.py"], 40 cmd: "$(location) $(in) >$(out)", 41 srcs: [":kernel_input_headers"], 42 out: ["input.h-labels.h"], 43} 44 45cc_defaults { 46 name: "toolbox_binary_defaults", 47 defaults: ["toolbox_defaults"], 48 cpp_std: "experimental", 49 srcs: [ 50 "toolbox.c", 51 "getevent.c", 52 "getprop.cpp", 53 "newfs_msdos.c", 54 ], 55 generated_headers: [ 56 "toolbox_input_labels", 57 ], 58 whole_static_libs: ["libtoolbox_dd"], 59 shared_libs: [ 60 "libbase", 61 "libcutils", 62 ], 63 static_libs: ["libpropertyinfoparser"], 64 65 symlinks: [ 66 "dd", 67 "getevent", 68 "getprop", 69 "newfs_msdos", 70 ], 71} 72 73cc_binary { 74 name: "toolbox", 75 defaults: ["toolbox_binary_defaults"], 76} 77 78cc_binary { 79 name: "toolbox_vendor", 80 stem: "toolbox", 81 vendor: true, 82 defaults: ["toolbox_binary_defaults"], 83} 84 85// We only want 'r' on userdebug and eng builds. 86cc_binary { 87 name: "r", 88 defaults: ["toolbox_defaults"], 89 srcs: ["r.c"], 90} 91 92// We build BSD grep separately, so it can provide egrep and fgrep too. 93cc_defaults { 94 name: "grep_common", 95 defaults: ["toolbox_defaults"], 96 srcs: [ 97 "upstream-netbsd/usr.bin/grep/fastgrep.c", 98 "upstream-netbsd/usr.bin/grep/file.c", 99 "upstream-netbsd/usr.bin/grep/grep.c", 100 "upstream-netbsd/usr.bin/grep/queue.c", 101 "upstream-netbsd/usr.bin/grep/util.c", 102 ], 103 symlinks: [ 104 "egrep", 105 "fgrep", 106 ], 107 108 sanitize: { 109 integer_overflow: false, 110 }, 111} 112 113cc_binary { 114 name: "grep", 115 defaults: ["grep_common"], 116} 117 118// Build vendor grep. 119// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module 120// when vendor_available is fully supported. 121cc_binary { 122 name: "grep_vendor", 123 stem: "grep", 124 vendor: true, 125 defaults: ["grep_common"], 126} 127