summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk')
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk192
1 files changed, 192 insertions, 0 deletions
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk
new file mode 100644
index 0000000..0a91f6b
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk
@@ -0,0 +1,192 @@
1########################################################################### ###
2#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
3#@License Dual MIT/GPLv2
4#
5# The contents of this file are subject to the MIT license as set out below.
6#
7# Permission is hereby granted, free of charge, to any person obtaining a copy
8# of this software and associated documentation files (the "Software"), to deal
9# in the Software without restriction, including without limitation the rights
10# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11# copies of the Software, and to permit persons to whom the Software is
12# furnished to do so, subject to the following conditions:
13#
14# The above copyright notice and this permission notice shall be included in
15# all copies or substantial portions of the Software.
16#
17# Alternatively, the contents of this file may be used under the terms of
18# the GNU General Public License Version 2 ("GPL") in which case the provisions
19# of GPL are applicable instead of those above.
20#
21# If you wish to allow use of your version of this file only under the terms of
22# GPL, and not to allow others to use your version of this file under the terms
23# of the MIT license, indicate your decision by deleting the provisions above
24# and replace them with the notice and other provisions required by GPL as set
25# out in the file called "GPL-COPYING" included in this distribution. If you do
26# not delete the provisions above, a recipient may use your version of this file
27# under the terms of either the MIT license or GPL.
28#
29# This License is also included in this distribution in the file called
30# "MIT-COPYING".
31#
32# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
33# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
34# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
35# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
36# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
37# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39### ###########################################################################
40
41# If there's no build.prop file in the expected location, bail out. Tell the
42# user which file we were trying to read in case TARGET_DEVICE was not set.
43#
44BUILD_PROP := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor/build.prop
45ifeq ($(wildcard $(BUILD_PROP)),)
46$(warning *** Could not determine Android version. Did you set ANDROID_ROOT,\
47OUT_DIR and TARGET_DEVICE in your environment correctly?)
48$(error Error reading $(BUILD_PROP))
49endif
50
51# Extract version.release and version.codename from the build.prop file.
52# If either of the values aren't in the build.prop, the Make variables won't
53# be defined, and fallback handling will take place.
54#
55define newline
56
57
58endef
59$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \
60 grep '^ro.build.version.release=\|^ro.build.id=' | \
61 sed -e 's,ro.build.version.release=,PLATFORM_RELEASE=,' \
62 -e 's,ro.build.id=,PLATFORM_BUILDID=,' | tr '\n' '#')))
63
64define release-starts-with
65$(shell echo $(PLATFORM_RELEASE) | grep -q ^$(1); \
66 [ "$$?" = "0" ] && echo 1 || echo 0)
67endef
68
69# ro.build.version.release contains the version number for release builds, or
70# the version codename otherwise. In this case we need to assume that the
71# version of Android we're building against has the features that are in the
72# final release of that version, so we set PLATFORM_RELEASE to the
73# corresponding release number.
74#
75# NOTE: It's the _string_ ordering that matters here, not the version number
76# ordering. You need to make sure that strings that are sub-strings of other
77# checked strings appear _later_ in this list.
78#
79# e.g. 'LollipopMR1' starts with 'Lollipop', but it is not Lollipop.
80#
81# NOTE: The version codenames for Android stopped after KitKat, don't read
82# too much into the below names. They are mostly placeholders/reminders.
83#
84ifeq ($(call release-starts-with,LollipopMR1),1)
85override PLATFORM_RELEASE := 5.1
86else ifeq ($(call release-starts-with,Marshmallow),1)
87override PLATFORM_RELEASE := 6.0
88else ifeq ($(call release-starts-with,NougatMR),1)
89override PLATFORM_RELEASE := 7.1
90else ifeq ($(call release-starts-with,Nougat),1)
91override PLATFORM_RELEASE := 7.0
92else ifeq ($(call release-starts-with,Oreo),1)
93override PLATFORM_RELEASE := 8.0
94else ifeq ($(PLATFORM_BUILDID),OC)
95override PLATFORM_RELEASE := 8.0.80
96else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0)
97override PLATFORM_RELEASE := 8.2
98endif
99
100# Workaround for master. Sometimes there is an AOSP version ahead of
101# the current master version number, but master still has more features.
102#
103ifeq ($(PLATFORM_RELEASE),8.0.80)
104override PLATFORM_RELEASE := 8.0
105is_aosp_master := 1
106endif
107
108PLATFORM_RELEASE_MAJ := $(shell echo $(PLATFORM_RELEASE) | cut -f1 -d'.')
109PLATFORM_RELEASE_MIN := $(shell echo $(PLATFORM_RELEASE) | cut -f2 -d'.')
110PLATFORM_RELEASE_PATCH := $(shell echo $(PLATFORM_RELEASE) | cut -f3 -d'.')
111
112# Not all versions have a patchlevel; fix that up here
113#
114ifeq ($(PLATFORM_RELEASE_PATCH),)
115PLATFORM_RELEASE_PATCH := 0
116endif
117
118# Macros to help categorize support for features and API_LEVEL for tests.
119#
120is_at_least_lollipop_mr1 := \
121 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 5 || \
122 ( test $(PLATFORM_RELEASE_MAJ) -eq 5 && \
123 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
124is_at_least_marshmallow := \
125 $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 6 ) && echo 1 || echo 0)
126is_at_least_nougat := \
127 $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 7 ) && echo 1 || echo 0)
128is_at_least_nougat_mr1 := \
129 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 7 || \
130 ( test $(PLATFORM_RELEASE_MAJ) -eq 7 && \
131 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
132is_at_least_oreo := \
133 $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 8 ) && echo 1 || echo 0)
134
135# Assume "future versions" are >7.1, but we don't really know
136is_future_version := \
137 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 8 || \
138 ( test $(PLATFORM_RELEASE_MAJ) -eq 8 && \
139 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
140
141# Picking an exact match of API_LEVEL for the platform we're building
142# against can avoid compatibility theming and affords better integration.
143#
144# This is also a good place to select the right jack toolchain.
145#
146ifeq ($(is_future_version),1)
147JACK_VERSION ?= 4.32.CANDIDATE
148API_LEVEL := 26
149else ifeq ($(is_at_least_oreo),1)
150ifeq ($(is_aosp_master),1)
151override JACK_VERSION :=
152else
153JACK_VERSION ?= 4.31.CANDIDATE
154endif
155API_LEVEL := 26
156else ifeq ($(is_at_least_nougat_mr1),1)
157JACK_VERSION ?= 3.36.CANDIDATE
158API_LEVEL := 25
159else ifeq ($(is_at_least_nougat),1)
160JACK_VERSION ?= 3.36.CANDIDATE
161API_LEVEL := 24
162else ifeq ($(is_at_least_marshmallow),1)
163JACK_VERSION ?= 2.21.RELEASE
164API_LEVEL := 23
165else ifeq ($(is_at_least_lollipop_mr1),1)
166# This early version had no version-file.version.code; fake it
167JACK_VERSION ?= 1.0.RELEASE
168API_LEVEL := 22
169else
170$(error Must build against Android >= 5.1)
171endif
172
173# If the NDK is enabled, check it has API_LEVEL support for us
174ifneq ($(NDK_ROOT),)
175 NDK_PLATFORMS_ROOT ?= $(NDK_ROOT)/platforms
176 ifeq ($(strip $(wildcard $(NDK_PLATFORMS_ROOT)/android-*)),)
177 $(error NDK_PLATFORMS_ROOT does not point to a valid location)
178 endif
179 override TARGET_PLATFORM := android-$(API_LEVEL)
180 ifeq ($(strip $(wildcard $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM))),)
181 $(error NDK support for $(TARGET_PLATFORM) is missing)
182 endif
183endif
184
185# Each DDK is tested against only a single version of the platform.
186# Warn if a different platform version is used.
187#
188ifeq ($(is_future_version),1)
189$(info WARNING: Android version is newer than this DDK supports)
190else ifneq ($(is_at_least_marshmallow),1)
191$(info WARNING: Android version is older than this DDK supports)
192endif