aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandeep Patil <sspatil@google.com>2017-04-12 14:53:55 -0700
committerSandeep Patil <sspatil@google.com>2017-04-13 13:37:26 -0700
commit19da0701da03ab44053780ea24d2586b66763222 (patch)
treea10abc6244a737f385cf2aaffea322aafcdcb536
parente67e1e041133e7bcc0d4702b8e830e324d1ef979 (diff)
downloadtoybox-19da0701da03ab44053780ea24d2586b66763222.tar.gz
Add toybox_vendor for treble products
Make the executable static so it doesn't have links back to /system and build it only for treble products. Bug: 36463595 Test: toybox_vendor and its symlinks are installed in /vendor and working on sailfish Change-Id: I1f5c8ba6b7f243a163cbefbfe76d1b098d31fcd8 Signed-off-by: Sandeep Patil <sspatil@google.com>
-rw-r--r--Android.mk31
1 files changed, 31 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 551cce70..3a9e12aa 100644
--- a/Android.mk
+++ b/Android.mk
@@ -401,6 +401,37 @@ LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGE
include $(BUILD_EXECUTABLE)
+ifeq ($(PRODUCT_FULL_TREBLE),true)
+############################################
+# static version to be installed in /vendor
+#
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(common_SRC_FILES)
+
+LOCAL_CFLAGS := $(common_CFLAGS)
+
+LOCAL_CLANG := true
+
+LOCAL_STATIC_LIBRARIES := liblog libcutils libselinux libcrypto libm libc
+
+# libc++_static is needed by static liblog
+LOCAL_CXX_STL := libc++_static
+
+LOCAL_VENDOR_MODULE := true
+
+LOCAL_MODULE := toybox_vendor
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_FORCE_STATIC_EXECUTABLE := true
+
+# Install the symlinks.
+LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf ${LOCAL_MODULE} $(TARGET_OUT_VENDOR_EXECUTABLES)/$(t);)
+
+include $(BUILD_EXECUTABLE)
+endif
+
############################################
# static version to be installed in recovery