2018-01-08 22:50:55 +01:00
|
|
|
cc_defaults {
|
|
|
|
name: "toolbox_defaults",
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Werror",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-Wno-unused-const-variable",
|
|
|
|
"-include bsd-compatibility.h",
|
2018-01-23 01:15:55 +01:00
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
2018-01-08 22:50:55 +01:00
|
|
|
],
|
|
|
|
local_include_dirs: ["upstream-netbsd/include/"],
|
|
|
|
}
|
2017-05-23 03:08:02 +02:00
|
|
|
|
|
|
|
cc_library_static {
|
2018-01-08 22:50:55 +01:00
|
|
|
name: "libtoolbox_dd",
|
|
|
|
defaults: ["toolbox_defaults"],
|
2018-01-09 22:20:08 +01:00
|
|
|
vendor_available: true,
|
2017-05-23 03:08:02 +02:00
|
|
|
srcs: [
|
|
|
|
"upstream-netbsd/bin/dd/args.c",
|
|
|
|
"upstream-netbsd/bin/dd/conv.c",
|
|
|
|
"upstream-netbsd/bin/dd/dd.c",
|
|
|
|
"upstream-netbsd/bin/dd/dd_hostops.c",
|
|
|
|
"upstream-netbsd/bin/dd/misc.c",
|
|
|
|
"upstream-netbsd/bin/dd/position.c",
|
|
|
|
"upstream-netbsd/lib/libc/gen/getbsize.c",
|
|
|
|
"upstream-netbsd/lib/libc/gen/humanize_number.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/strsuftoll.c",
|
|
|
|
"upstream-netbsd/lib/libc/string/swab.c",
|
|
|
|
"upstream-netbsd/lib/libutil/raise_default_signal.c",
|
|
|
|
],
|
2018-01-08 22:50:55 +01:00
|
|
|
cflags: [
|
2017-05-23 03:08:02 +02:00
|
|
|
"-Dmain=dd_main",
|
|
|
|
"-DNO_CONV",
|
|
|
|
],
|
2018-01-08 22:50:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "toolbox_input_labels",
|
|
|
|
tool_files: ["generate-input.h-labels.py"],
|
|
|
|
cmd: "$(location) $(in) >$(out)",
|
|
|
|
srcs: [":kernel_input_headers"],
|
|
|
|
out: ["input.h-labels.h"],
|
|
|
|
}
|
|
|
|
|
2018-01-09 22:20:08 +01:00
|
|
|
cc_defaults {
|
|
|
|
name: "toolbox_binary_defaults",
|
2018-01-08 22:50:55 +01:00
|
|
|
defaults: ["toolbox_defaults"],
|
2018-01-02 20:50:16 +01:00
|
|
|
cpp_std: "experimental",
|
2018-01-08 22:50:55 +01:00
|
|
|
srcs: [
|
|
|
|
"toolbox.c",
|
|
|
|
"getevent.c",
|
2018-01-02 20:50:16 +01:00
|
|
|
"getprop.cpp",
|
2018-01-08 22:50:55 +01:00
|
|
|
"newfs_msdos.c",
|
|
|
|
],
|
|
|
|
generated_headers: [
|
|
|
|
"toolbox_input_labels",
|
|
|
|
],
|
|
|
|
whole_static_libs: ["libtoolbox_dd"],
|
|
|
|
shared_libs: [
|
2018-01-02 20:50:16 +01:00
|
|
|
"libbase",
|
2018-01-08 22:50:55 +01:00
|
|
|
"libcutils",
|
|
|
|
],
|
2018-01-02 20:50:16 +01:00
|
|
|
static_libs: ["libpropertyinfoparser"],
|
2018-01-08 22:50:55 +01:00
|
|
|
|
|
|
|
symlinks: [
|
|
|
|
"dd",
|
|
|
|
"getevent",
|
2018-01-02 20:50:16 +01:00
|
|
|
"getprop",
|
2018-01-08 22:50:55 +01:00
|
|
|
"newfs_msdos",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2018-01-09 22:20:08 +01:00
|
|
|
cc_binary {
|
|
|
|
name: "toolbox",
|
|
|
|
defaults: ["toolbox_binary_defaults"],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "toolbox_vendor",
|
|
|
|
stem: "toolbox",
|
|
|
|
vendor: true,
|
|
|
|
defaults: ["toolbox_binary_defaults"],
|
|
|
|
}
|
|
|
|
|
2018-01-08 22:50:55 +01:00
|
|
|
// We only want 'r' on userdebug and eng builds.
|
|
|
|
cc_binary {
|
|
|
|
name: "r",
|
|
|
|
defaults: ["toolbox_defaults"],
|
|
|
|
srcs: ["r.c"],
|
2017-05-23 03:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// We build BSD grep separately, so it can provide egrep and fgrep too.
|
2017-06-09 18:10:59 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "grep_common",
|
2018-01-08 22:50:55 +01:00
|
|
|
defaults: ["toolbox_defaults"],
|
2017-05-23 03:08:02 +02:00
|
|
|
srcs: [
|
|
|
|
"upstream-netbsd/usr.bin/grep/fastgrep.c",
|
|
|
|
"upstream-netbsd/usr.bin/grep/file.c",
|
|
|
|
"upstream-netbsd/usr.bin/grep/grep.c",
|
|
|
|
"upstream-netbsd/usr.bin/grep/queue.c",
|
|
|
|
"upstream-netbsd/usr.bin/grep/util.c",
|
|
|
|
],
|
2018-01-08 22:50:55 +01:00
|
|
|
symlinks: [
|
|
|
|
"egrep",
|
|
|
|
"fgrep",
|
|
|
|
],
|
2017-11-13 23:06:08 +01:00
|
|
|
|
|
|
|
sanitize: {
|
|
|
|
integer_overflow: false,
|
|
|
|
},
|
2017-06-09 18:10:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "grep",
|
|
|
|
defaults: ["grep_common"],
|
|
|
|
}
|
2017-05-23 03:08:02 +02:00
|
|
|
|
2017-06-09 18:10:59 +02:00
|
|
|
// Build vendor grep.
|
|
|
|
// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
|
|
|
|
// when vendor_available is fully supported.
|
|
|
|
cc_binary {
|
|
|
|
name: "grep_vendor",
|
|
|
|
stem: "grep",
|
|
|
|
vendor: true,
|
|
|
|
defaults: ["grep_common"],
|
2017-05-23 03:08:02 +02:00
|
|
|
}
|