diff options
Diffstat (limited to 'classes/abi-arch.bbclass')
-rw-r--r-- | classes/abi-arch.bbclass | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/classes/abi-arch.bbclass b/classes/abi-arch.bbclass new file mode 100644 index 0000000..826fed4 --- /dev/null +++ b/classes/abi-arch.bbclass | |||
@@ -0,0 +1,41 @@ | |||
1 | ############################################################################## | ||
2 | ## | ||
3 | ## Copyright (C) 2016 The Qt Company Ltd. | ||
4 | ## Contact: http://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:COMM$ | ||
9 | ## | ||
10 | ## Commercial License Usage | ||
11 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
12 | ## accordance with the commercial license agreement provided with the | ||
13 | ## Software or, alternatively, in accordance with the terms contained in | ||
14 | ## a written agreement between you and The Qt Company. For licensing terms | ||
15 | ## and conditions see http://www.qt.io/terms-conditions. For further | ||
16 | ## information use the contact form at http://www.qt.io/contact-us. | ||
17 | ## | ||
18 | ## $QT_END_LICENSE$ | ||
19 | ## | ||
20 | ############################################################################## | ||
21 | |||
22 | # map target architecture to abi architectures used by Qt Creator | ||
23 | valid_archs = "arm x86 itanium mips ppc sh" | ||
24 | |||
25 | def map_abi_arch(a, d): | ||
26 | import re | ||
27 | |||
28 | valid_archs = d.getVar('valid_archs', True).split() | ||
29 | |||
30 | if re.match('i.86$', a): return 'x86' | ||
31 | elif re.match('x86.64$', a): return 'x86' | ||
32 | elif re.match('armeb$', a): return 'arm' | ||
33 | elif re.match('aarch64', a): return 'arm' | ||
34 | elif re.match('mips(el|64|64el)$', a): return 'mips' | ||
35 | elif re.match('p(pc|owerpc)(|64)', a): return 'ppc' | ||
36 | elif re.match('sh(3|4)$', a): return 'sh' | ||
37 | elif a in valid_archs: return a | ||
38 | else: | ||
39 | bb.error("cannot map '%s' to a abi architecture" % a) | ||
40 | |||
41 | ABI = "${@map_abi_arch(d.getVar('TARGET_ARCH', True), d)}" | ||