summaryrefslogtreecommitdiffstats
path: root/toybox
diff options
context:
space:
mode:
authorCaptain Throwback <captainthrowback@hotmail.com>2019-04-26 16:46:32 +0200
committerCaptain Throwback <captainthrowback@hotmail.com>2019-05-01 19:50:36 +0200
commit695baa60cb1911e9ffdf4967479c520fd8b1af85 (patch)
tree49cb95252968faadd79d979c3b8c5d1d685aeecb /toybox
parentext4crypt: add missing cflag (diff)
downloadandroid_bootable_recovery-695baa60cb1911e9ffdf4967479c520fd8b1af85.tar
android_bootable_recovery-695baa60cb1911e9ffdf4967479c520fd8b1af85.tar.gz
android_bootable_recovery-695baa60cb1911e9ffdf4967479c520fd8b1af85.tar.bz2
android_bootable_recovery-695baa60cb1911e9ffdf4967479c520fd8b1af85.tar.lz
android_bootable_recovery-695baa60cb1911e9ffdf4967479c520fd8b1af85.tar.xz
android_bootable_recovery-695baa60cb1911e9ffdf4967479c520fd8b1af85.tar.zst
android_bootable_recovery-695baa60cb1911e9ffdf4967479c520fd8b1af85.zip
Diffstat (limited to 'toybox')
-rw-r--r--toybox/Android.mk27
1 files changed, 17 insertions, 10 deletions
diff --git a/toybox/Android.mk b/toybox/Android.mk
index c88f360f5..687982ca5 100644
--- a/toybox/Android.mk
+++ b/toybox/Android.mk
@@ -189,6 +189,15 @@ LOCAL_SRC_FILES := \
toys/posix/wc.c \
toys/posix/xargs.c
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -eq 26; echo $$?),0)
+# Android 8.0 had some tools in different paths
+LOCAL_SRC_FILES += \
+ toys/pending/dmesg.c
+else
+LOCAL_SRC_FILES += \
+ toys/lsb/dmesg.c
+endif
+
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 23; echo $$?),0)
# there are some conflicts here with AOSP-7.[01] and CM-14.[01]
# the following items have been removed for compatibility
@@ -222,14 +231,6 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 27; echo $$?),0)
LOCAL_SRC_FILES += \
toys/pending/xzcat.c
endif
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -eq 26; echo $$?),0)
-# Android 8.0 had some tools in different paths
-LOCAL_SRC_FILES += \
- toys/pending/dmesg.c
-else
-LOCAL_SRC_FILES += \
- toys/lsb/dmesg.c
-endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
# Android 8.0/8.1 had some tools in different paths
@@ -319,6 +320,7 @@ LOCAL_SRC_FILES += \
endif
LOCAL_CFLAGS += \
+ -std=c99 \
-std=gnu11 \
-Os \
-Wno-char-subscripts \
@@ -330,8 +332,13 @@ LOCAL_CFLAGS += \
-ffunction-sections -fdata-sections \
-fno-asynchronous-unwind-tables \
-toybox_version := $(shell sed 's/#define.*TOYBOX_VERSION.*"\(.*\)"/\1/p;d' $(LOCAL_PATH)/main.c)
-LOCAL_CFLAGS += -DTOYBOX_VERSION=\"$(toybox_version)\"
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
+ toybox_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
+ LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"'
+else
+ toybox_version := $(shell sed 's/#define.*TOYBOX_VERSION.*"\(.*\)"/\1/p;d' $(LOCAL_PATH)/main.c)
+ LOCAL_CFLAGS += -DTOYBOX_VERSION=\"$(toybox_version)\"
+endif
LOCAL_CLANG := true