Merge "Move back to BSD grep, and make it available for recovery too."
am: af7e4567a3
Change-Id: I2dc4b70c11a74c436cfa9a4651fc3251ccc6790c
diff --git a/shell_and_utilities/Android.bp b/shell_and_utilities/Android.bp
index 0586381..3d7521c 100644
--- a/shell_and_utilities/Android.bp
+++ b/shell_and_utilities/Android.bp
@@ -27,6 +27,7 @@
phony {
name: "shell_and_utilities_recovery",
required: [
+ "grep.recovery",
"sh.recovery",
"toolbox.recovery",
"toybox.recovery",
diff --git a/toolbox/Android.bp b/toolbox/Android.bp
index e75e4af..f08cf93 100644
--- a/toolbox/Android.bp
+++ b/toolbox/Android.bp
@@ -62,8 +62,8 @@
}
// We build BSD grep separately (but see http://b/111849261).
-cc_binary {
- name: "grep",
+cc_defaults {
+ name: "grep_common",
defaults: ["toolbox_defaults"],
srcs: [
"upstream-netbsd/usr.bin/grep/fastgrep.c",
@@ -72,8 +72,27 @@
"upstream-netbsd/usr.bin/grep/queue.c",
"upstream-netbsd/usr.bin/grep/util.c",
],
-
+ symlinks: [
+ "egrep",
+ "fgrep",
+ ],
sanitize: {
integer_overflow: false,
},
}
+
+cc_binary {
+ name: "grep",
+ defaults: ["grep_common"],
+ recovery_available: true,
+}
+
+// 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"],
+}