summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorD. Andrei Măceș <dmaces@nd.edu>2016-12-25 17:12:04 -0500
committerAndreas Blaesius <skate4life@gmx.de>2017-02-06 21:33:38 +0000
commitfa7907d256b6896ec2cb96303340653af9732f8e (patch)
tree2f03943310bbe59d34cc95ad17453d41fe352d94
parent9afe730d4f5b2cd0fda720228be697d60e98eba4 (diff)
downloadhardware_ti_omap4-fa7907d256b6896ec2cb96303340653af9732f8e.zip
hardware_ti_omap4-fa7907d256b6896ec2cb96303340653af9732f8e.tar.gz
hardware_ti_omap4-fa7907d256b6896ec2cb96303340653af9732f8e.tar.bz2
SGX-BIN: build: android: Add fallback PLATFORM_VERSION mechanism
When build.prop doesn't exist (pretty much the case always), have a fallback by extracting the needed platform variable from build/core/ version_defaults.mk. This is necessary since this build information doesn't permeate here, and we would like to avoid re-including the whole core makefile. Change-Id: Ia98e0a4e6b060ad8ace8b947e6c93741a875c05d
-rw-r--r--pvr-source/eurasiacon/build/linux2/common/android/platform_version.mk26
1 files changed, 19 insertions, 7 deletions
diff --git a/pvr-source/eurasiacon/build/linux2/common/android/platform_version.mk b/pvr-source/eurasiacon/build/linux2/common/android/platform_version.mk
index 698efa3..28f1a80 100644
--- a/pvr-source/eurasiacon/build/linux2/common/android/platform_version.mk
+++ b/pvr-source/eurasiacon/build/linux2/common/android/platform_version.mk
@@ -40,13 +40,25 @@
# Figure out the version of Android we're building against.
#
-PLATFORM_VERSION := $(shell \
- if [ -f $(TARGET_ROOT)/product/$(TARGET_PRODUCT)/system/build.prop ]; then \
- cat $(TARGET_ROOT)/product/$(TARGET_PRODUCT)/system/build.prop | \
- grep ^ro.build.version.release | cut -f2 -d'=' | cut -f1 -d'-'; \
- else \
- echo 4.0.3; \
- fi)
+BUILD_PROP := $(ANDROID_PRODUCT_OUT)/system/build.prop
+ifeq ($(wildcard $(BUILD_PROP)),)
+$(warning *** No device prop file ($(BUILD_PROP)). Extracting from \
+ build/core/version_defaults.mk)
+# Android version information doesn't permeate here. Set it up manually,
+# but avoid including the whole of core/version_defaults.mk
+$(eval $(shell cat $(ANDROID_BUILD_TOP)/build/core/version_defaults.mk |\
+ grep 'PLATFORM_VERSION\s.*='))
+else
+# Extract version.release from the build.prop file. If it's not in the build.prop,
+# the Make variables won't be defined, and fallback handling will take place.
+#
+# $(eval $(shell cat $(BUILD_PROP) | grep '^ro.build.version.release=' | \
+# sed -e 's,ro.build.version.release,PLATFORM_VERSION,'))
+PLATFORM_VERSION := $(shell grep '^ro.build.version.release=' \
+ $(BUILD_PROP) | cut -f2 -d'=' | cut -f1 -d'-')
+endif
+
+$(info PLATFORM_VERSION=$(PLATFORM_VERSION))
define version-starts-with
$(shell echo $(PLATFORM_VERSION) | grep -q ^$(1); \