• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cc_defaults {
2    name: "toolbox_defaults",
3
4    cflags: [
5        "-Werror",
6        "-Wno-unused-parameter",
7        "-Wno-unused-const-variable",
8        "-D_FILE_OFFSET_BITS=64",
9        "-DWITHOUT_NLS",
10        "-DWITHOUT_BZ2",
11        "-DWITHOUT_GZIP",
12    ],
13}
14
15genrule {
16    name: "toolbox_input_labels",
17    tool_files: ["generate-input.h-labels.py"],
18    cmd: "$(location) $(in) >$(out)",
19    srcs: [":kernel_input_headers"],
20    out: ["input.h-labels.h"],
21}
22
23cc_defaults {
24    name: "toolbox_binary_defaults",
25    defaults: ["toolbox_defaults"],
26    cpp_std: "experimental",
27    srcs: [
28        "toolbox.c",
29        "getevent.c",
30        "getprop.cpp",
31    ],
32    generated_headers: [
33        "toolbox_input_labels",
34    ],
35    shared_libs: [
36        "libbase",
37    ],
38    static_libs: ["libpropertyinfoparser"],
39
40    symlinks: [
41        "getevent",
42        "getprop",
43    ],
44}
45
46cc_binary {
47    name: "toolbox",
48    defaults: ["toolbox_binary_defaults"],
49    recovery_available: true,
50}
51
52cc_binary {
53    name: "toolbox_vendor",
54    stem: "toolbox",
55    vendor: true,
56    defaults: ["toolbox_binary_defaults"],
57}
58
59// We only want 'r' on userdebug and eng builds.
60cc_binary {
61    name: "r",
62    defaults: ["toolbox_defaults"],
63    srcs: ["r.c"],
64    vendor_available: true,
65}
66
67// We build BSD grep separately (but see http://b/111849261).
68cc_defaults {
69    name: "grep_common",
70    defaults: ["toolbox_defaults"],
71    srcs: [
72        "upstream-netbsd/usr.bin/grep/fastgrep.c",
73        "upstream-netbsd/usr.bin/grep/file.c",
74        "upstream-netbsd/usr.bin/grep/grep.c",
75        "upstream-netbsd/usr.bin/grep/queue.c",
76        "upstream-netbsd/usr.bin/grep/util.c",
77    ],
78    symlinks: [
79        "egrep",
80        "fgrep",
81    ],
82    sanitize: {
83        integer_overflow: false,
84    },
85}
86
87cc_binary {
88    name: "grep",
89    defaults: ["grep_common"],
90    recovery_available: true,
91}
92
93// Build vendor grep.
94// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
95//       when vendor_available is fully supported.
96cc_binary {
97    name: "grep_vendor",
98    stem: "grep",
99    vendor: true,
100    defaults: ["grep_common"],
101}
102