summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAlex Franco <alejandro.franco@linux.intel.com>2016-03-23 19:39:11 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-28 15:55:48 +0100
commit201d9d37f05ebc6efa8dfe430e66dc6fd23856d9 (patch)
tree10098befa3556101d198190c2173046040a2cea5 /meta
parentda00f6cc4210a316cce1dd5297ee64d0fe9894e0 (diff)
downloadpoky-201d9d37f05ebc6efa8dfe430e66dc6fd23856d9.tar.gz
icecc.bbclass: replace icc with icecc
Make this class more clear and consistent, and avoid confusion with the Intel C compiler (icc); the changes affect function names, and calls to those functions [YOCTO #8934] (From OE-Core rev: daf59103c26ca8f1be7229f73a5b496d862e1f1e) Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/icecc.bbclass56
1 files changed, 28 insertions, 28 deletions
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index b4f1be553f..e1c06c49cb 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -63,7 +63,7 @@ def create_path(compilers, bb, d):
63 Create Symlinks for the icecc in the staging directory 63 Create Symlinks for the icecc in the staging directory
64 """ 64 """
65 staging = os.path.join(d.expand('${STAGING_BINDIR}'), "ice") 65 staging = os.path.join(d.expand('${STAGING_BINDIR}'), "ice")
66 if icc_is_kernel(bb, d): 66 if icecc_is_kernel(bb, d):
67 staging += "-kernel" 67 staging += "-kernel"
68 68
69 #check if the icecc path is set by the user 69 #check if the icecc path is set by the user
@@ -90,13 +90,13 @@ def create_path(compilers, bb, d):
90 90
91 return staging 91 return staging
92 92
93def use_icc(bb,d): 93def use_icecc(bb,d):
94 if d.getVar('ICECC_DISABLED', False) == "1": 94 if d.getVar('ICECC_DISABLED', False) == "1":
95 # don't even try it, when explicitly disabled 95 # don't even try it, when explicitly disabled
96 return "no" 96 return "no"
97 97
98 # allarch recipes don't use compiler 98 # allarch recipes don't use compiler
99 if icc_is_allarch(bb, d): 99 if icecc_is_allarch(bb, d):
100 return "no" 100 return "no"
101 101
102 pn = d.getVar('PN', True) 102 pn = d.getVar('PN', True)
@@ -137,29 +137,29 @@ def use_icc(bb,d):
137 137
138 return "yes" 138 return "yes"
139 139
140def icc_is_allarch(bb, d): 140def icecc_is_allarch(bb, d):
141 return d.getVar("PACKAGE_ARCH", True) == "all" or bb.data.inherits_class('allarch', d) 141 return d.getVar("PACKAGE_ARCH", True) == "all" or bb.data.inherits_class('allarch', d)
142 142
143def icc_is_kernel(bb, d): 143def icecc_is_kernel(bb, d):
144 return \ 144 return \
145 bb.data.inherits_class("kernel", d); 145 bb.data.inherits_class("kernel", d);
146 146
147def icc_is_native(bb, d): 147def icecc_is_native(bb, d):
148 return \ 148 return \
149 bb.data.inherits_class("cross", d) or \ 149 bb.data.inherits_class("cross", d) or \
150 bb.data.inherits_class("native", d); 150 bb.data.inherits_class("native", d);
151 151
152# Don't pollute allarch signatures with TARGET_FPU 152# Don't pollute allarch signatures with TARGET_FPU
153icc_version[vardepsexclude] += "TARGET_FPU" 153icecc_version[vardepsexclude] += "TARGET_FPU"
154def icc_version(bb, d): 154def icecc_version(bb, d):
155 if use_icc(bb, d) == "no": 155 if use_icecc(bb, d) == "no":
156 return "" 156 return ""
157 157
158 parallel = d.getVar('ICECC_PARALLEL_MAKE', False) or "" 158 parallel = d.getVar('ICECC_PARALLEL_MAKE', False) or ""
159 if not d.getVar('PARALLEL_MAKE', False) == "" and parallel: 159 if not d.getVar('PARALLEL_MAKE', False) == "" and parallel:
160 d.setVar("PARALLEL_MAKE", parallel) 160 d.setVar("PARALLEL_MAKE", parallel)
161 161
162 if icc_is_native(bb, d): 162 if icecc_is_native(bb, d):
163 archive_name = "local-host-env" 163 archive_name = "local-host-env"
164 elif d.expand('${HOST_PREFIX}') == "": 164 elif d.expand('${HOST_PREFIX}') == "":
165 bb.fatal(d.expand("${PN}"), " NULL prefix") 165 bb.fatal(d.expand("${PN}"), " NULL prefix")
@@ -169,7 +169,7 @@ def icc_version(bb, d):
169 target_sys = d.expand('${TARGET_SYS}') 169 target_sys = d.expand('${TARGET_SYS}')
170 float = d.getVar('TARGET_FPU', False) or "hard" 170 float = d.getVar('TARGET_FPU', False) or "hard"
171 archive_name = prefix + distro + "-" + target_sys + "-" + float 171 archive_name = prefix + distro + "-" + target_sys + "-" + float
172 if icc_is_kernel(bb, d): 172 if icecc_is_kernel(bb, d):
173 archive_name += "-kernel" 173 archive_name += "-kernel"
174 174
175 import socket 175 import socket
@@ -178,29 +178,29 @@ def icc_version(bb, d):
178 178
179 return tar_file 179 return tar_file
180 180
181def icc_path(bb,d): 181def icecc_path(bb,d):
182 if use_icc(bb, d) == "no": 182 if use_icecc(bb, d) == "no":
183 # don't create unnecessary directories when icecc is disabled 183 # don't create unnecessary directories when icecc is disabled
184 return 184 return
185 185
186 if icc_is_kernel(bb, d): 186 if icecc_is_kernel(bb, d):
187 return create_path( [get_cross_kernel_cc(bb,d), ], bb, d) 187 return create_path( [get_cross_kernel_cc(bb,d), ], bb, d)
188 188
189 else: 189 else:
190 prefix = d.expand('${HOST_PREFIX}') 190 prefix = d.expand('${HOST_PREFIX}')
191 return create_path( [prefix+"gcc", prefix+"g++"], bb, d) 191 return create_path( [prefix+"gcc", prefix+"g++"], bb, d)
192 192
193def icc_get_external_tool(bb, d, tool): 193def icecc_get_external_tool(bb, d, tool):
194 external_toolchain_bindir = d.expand('${EXTERNAL_TOOLCHAIN}${bindir_cross}') 194 external_toolchain_bindir = d.expand('${EXTERNAL_TOOLCHAIN}${bindir_cross}')
195 target_prefix = d.expand('${TARGET_PREFIX}') 195 target_prefix = d.expand('${TARGET_PREFIX}')
196 return os.path.join(external_toolchain_bindir, '%s%s' % (target_prefix, tool)) 196 return os.path.join(external_toolchain_bindir, '%s%s' % (target_prefix, tool))
197 197
198# Don't pollute native signatures with target TUNE_PKGARCH through STAGING_BINDIR_TOOLCHAIN 198# Don't pollute native signatures with target TUNE_PKGARCH through STAGING_BINDIR_TOOLCHAIN
199icc_get_tool[vardepsexclude] += "STAGING_BINDIR_TOOLCHAIN" 199icecc_get_tool[vardepsexclude] += "STAGING_BINDIR_TOOLCHAIN"
200def icc_get_tool(bb, d, tool): 200def icecc_get_tool(bb, d, tool):
201 if icc_is_native(bb, d): 201 if icecc_is_native(bb, d):
202 return bb.utils.which(os.getenv("PATH"), tool) 202 return bb.utils.which(os.getenv("PATH"), tool)
203 elif icc_is_kernel(bb, d): 203 elif icecc_is_kernel(bb, d):
204 return bb.utils.which(os.getenv("PATH"), get_cross_kernel_cc(bb, d)) 204 return bb.utils.which(os.getenv("PATH"), get_cross_kernel_cc(bb, d))
205 else: 205 else:
206 ice_dir = d.expand('${STAGING_BINDIR_TOOLCHAIN}') 206 ice_dir = d.expand('${STAGING_BINDIR_TOOLCHAIN}')
@@ -209,17 +209,17 @@ def icc_get_tool(bb, d, tool):
209 if os.path.isfile(tool_bin): 209 if os.path.isfile(tool_bin):
210 return tool_bin 210 return tool_bin
211 else: 211 else:
212 external_tool_bin = icc_get_external_tool(bb, d, tool) 212 external_tool_bin = icecc_get_external_tool(bb, d, tool)
213 if os.path.isfile(external_tool_bin): 213 if os.path.isfile(external_tool_bin):
214 return external_tool_bin 214 return external_tool_bin
215 else: 215 else:
216 return "" 216 return ""
217 217
218def icc_get_and_check_tool(bb, d, tool): 218def icecc_get_and_check_tool(bb, d, tool):
219 # Check that g++ or gcc is not a symbolic link to icecc binary in 219 # Check that g++ or gcc is not a symbolic link to icecc binary in
220 # PATH or icecc-create-env script will silently create an invalid 220 # PATH or icecc-create-env script will silently create an invalid
221 # compiler environment package. 221 # compiler environment package.
222 t = icc_get_tool(bb, d, tool) 222 t = icecc_get_tool(bb, d, tool)
223 if t and os.popen("readlink -f %s" % t).read()[:-1] == get_icecc(d): 223 if t and os.popen("readlink -f %s" % t).read()[:-1] == get_icecc(d):
224 bb.error("%s is a symlink to %s in PATH and this prevents icecc from working" % (t, get_icecc(d))) 224 bb.error("%s is a symlink to %s in PATH and this prevents icecc from working" % (t, get_icecc(d)))
225 return "" 225 return ""
@@ -246,27 +246,27 @@ def set_icecc_env():
246 return 246 return
247 247
248set_icecc_env() { 248set_icecc_env() {
249 if [ "${@use_icc(bb, d)}" = "no" ] 249 if [ "${@use_icecc(bb, d)}" = "no" ]
250 then 250 then
251 return 251 return
252 fi 252 fi
253 ICECC_VERSION="${@icc_version(bb, d)}" 253 ICECC_VERSION="${@icecc_version(bb, d)}"
254 if [ "x${ICECC_VERSION}" = "x" ] 254 if [ "x${ICECC_VERSION}" = "x" ]
255 then 255 then
256 bbwarn "Cannot use icecc: could not get ICECC_VERSION" 256 bbwarn "Cannot use icecc: could not get ICECC_VERSION"
257 return 257 return
258 fi 258 fi
259 259
260 ICE_PATH="${@icc_path(bb, d)}" 260 ICE_PATH="${@icecc_path(bb, d)}"
261 if [ "x${ICE_PATH}" = "x" ] 261 if [ "x${ICE_PATH}" = "x" ]
262 then 262 then
263 bbwarn "Cannot use icecc: could not get ICE_PATH" 263 bbwarn "Cannot use icecc: could not get ICE_PATH"
264 return 264 return
265 fi 265 fi
266 266
267 ICECC_CC="${@icc_get_and_check_tool(bb, d, "gcc")}" 267 ICECC_CC="${@icecc_get_and_check_tool(bb, d, "gcc")}"
268 ICECC_CXX="${@icc_get_and_check_tool(bb, d, "g++")}" 268 ICECC_CXX="${@icecc_get_and_check_tool(bb, d, "g++")}"
269 # cannot use icc_get_and_check_tool here because it assumes as without target_sys prefix 269 # cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix
270 ICECC_WHICH_AS="${@bb.utils.which(os.getenv('PATH'), 'as')}" 270 ICECC_WHICH_AS="${@bb.utils.which(os.getenv('PATH'), 'as')}"
271 if [ ! -x "${ICECC_CC}" -o ! -x "${ICECC_CXX}" ] 271 if [ ! -x "${ICECC_CC}" -o ! -x "${ICECC_CXX}" ]
272 then 272 then