diff options
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.mk | 192 |
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 | # | ||
44 | BUILD_PROP := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor/build.prop | ||
45 | ifeq ($(wildcard $(BUILD_PROP)),) | ||
46 | $(warning *** Could not determine Android version. Did you set ANDROID_ROOT,\ | ||
47 | OUT_DIR and TARGET_DEVICE in your environment correctly?) | ||
48 | $(error Error reading $(BUILD_PROP)) | ||
49 | endif | ||
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 | # | ||
55 | define newline | ||
56 | |||
57 | |||
58 | endef | ||
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 | |||
64 | define release-starts-with | ||
65 | $(shell echo $(PLATFORM_RELEASE) | grep -q ^$(1); \ | ||
66 | [ "$$?" = "0" ] && echo 1 || echo 0) | ||
67 | endef | ||
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 | # | ||
84 | ifeq ($(call release-starts-with,LollipopMR1),1) | ||
85 | override PLATFORM_RELEASE := 5.1 | ||
86 | else ifeq ($(call release-starts-with,Marshmallow),1) | ||
87 | override PLATFORM_RELEASE := 6.0 | ||
88 | else ifeq ($(call release-starts-with,NougatMR),1) | ||
89 | override PLATFORM_RELEASE := 7.1 | ||
90 | else ifeq ($(call release-starts-with,Nougat),1) | ||
91 | override PLATFORM_RELEASE := 7.0 | ||
92 | else ifeq ($(call release-starts-with,Oreo),1) | ||
93 | override PLATFORM_RELEASE := 8.0 | ||
94 | else ifeq ($(PLATFORM_BUILDID),OC) | ||
95 | override PLATFORM_RELEASE := 8.0.80 | ||
96 | else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0) | ||
97 | override PLATFORM_RELEASE := 8.2 | ||
98 | endif | ||
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 | # | ||
103 | ifeq ($(PLATFORM_RELEASE),8.0.80) | ||
104 | override PLATFORM_RELEASE := 8.0 | ||
105 | is_aosp_master := 1 | ||
106 | endif | ||
107 | |||
108 | PLATFORM_RELEASE_MAJ := $(shell echo $(PLATFORM_RELEASE) | cut -f1 -d'.') | ||
109 | PLATFORM_RELEASE_MIN := $(shell echo $(PLATFORM_RELEASE) | cut -f2 -d'.') | ||
110 | PLATFORM_RELEASE_PATCH := $(shell echo $(PLATFORM_RELEASE) | cut -f3 -d'.') | ||
111 | |||
112 | # Not all versions have a patchlevel; fix that up here | ||
113 | # | ||
114 | ifeq ($(PLATFORM_RELEASE_PATCH),) | ||
115 | PLATFORM_RELEASE_PATCH := 0 | ||
116 | endif | ||
117 | |||
118 | # Macros to help categorize support for features and API_LEVEL for tests. | ||
119 | # | ||
120 | is_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) | ||
124 | is_at_least_marshmallow := \ | ||
125 | $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 6 ) && echo 1 || echo 0) | ||
126 | is_at_least_nougat := \ | ||
127 | $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 7 ) && echo 1 || echo 0) | ||
128 | is_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) | ||
132 | is_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 | ||
136 | is_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 | # | ||
146 | ifeq ($(is_future_version),1) | ||
147 | JACK_VERSION ?= 4.32.CANDIDATE | ||
148 | API_LEVEL := 26 | ||
149 | else ifeq ($(is_at_least_oreo),1) | ||
150 | ifeq ($(is_aosp_master),1) | ||
151 | override JACK_VERSION := | ||
152 | else | ||
153 | JACK_VERSION ?= 4.31.CANDIDATE | ||
154 | endif | ||
155 | API_LEVEL := 26 | ||
156 | else ifeq ($(is_at_least_nougat_mr1),1) | ||
157 | JACK_VERSION ?= 3.36.CANDIDATE | ||
158 | API_LEVEL := 25 | ||
159 | else ifeq ($(is_at_least_nougat),1) | ||
160 | JACK_VERSION ?= 3.36.CANDIDATE | ||
161 | API_LEVEL := 24 | ||
162 | else ifeq ($(is_at_least_marshmallow),1) | ||
163 | JACK_VERSION ?= 2.21.RELEASE | ||
164 | API_LEVEL := 23 | ||
165 | else ifeq ($(is_at_least_lollipop_mr1),1) | ||
166 | # This early version had no version-file.version.code; fake it | ||
167 | JACK_VERSION ?= 1.0.RELEASE | ||
168 | API_LEVEL := 22 | ||
169 | else | ||
170 | $(error Must build against Android >= 5.1) | ||
171 | endif | ||
172 | |||
173 | # If the NDK is enabled, check it has API_LEVEL support for us | ||
174 | ifneq ($(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 | ||
183 | endif | ||
184 | |||
185 | # Each DDK is tested against only a single version of the platform. | ||
186 | # Warn if a different platform version is used. | ||
187 | # | ||
188 | ifeq ($(is_future_version),1) | ||
189 | $(info WARNING: Android version is newer than this DDK supports) | ||
190 | else ifneq ($(is_at_least_marshmallow),1) | ||
191 | $(info WARNING: Android version is older than this DDK supports) | ||
192 | endif | ||