diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/classes/kernel-arch.bbclass | |
download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/classes/kernel-arch.bbclass')
-rw-r--r-- | meta/classes/kernel-arch.bbclass | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass new file mode 100644 index 0000000000..4a140ebdaf --- /dev/null +++ b/meta/classes/kernel-arch.bbclass | |||
@@ -0,0 +1,58 @@ | |||
1 | # | ||
2 | # set the ARCH environment variable for kernel compilation (including | ||
3 | # modules). return value must match one of the architecture directories | ||
4 | # in the kernel source "arch" directory | ||
5 | # | ||
6 | |||
7 | valid_archs = "alpha cris ia64 \ | ||
8 | i386 x86 \ | ||
9 | m68knommu m68k ppc powerpc powerpc64 ppc64 \ | ||
10 | sparc sparc64 \ | ||
11 | arm aarch64 \ | ||
12 | m32r mips \ | ||
13 | sh sh64 um h8300 \ | ||
14 | parisc s390 v850 \ | ||
15 | avr32 blackfin \ | ||
16 | microblaze" | ||
17 | |||
18 | def map_kernel_arch(a, d): | ||
19 | import re | ||
20 | |||
21 | valid_archs = d.getVar('valid_archs', True).split() | ||
22 | |||
23 | if re.match('(i.86|athlon|x86.64)$', a): return 'x86' | ||
24 | elif re.match('armeb$', a): return 'arm' | ||
25 | elif re.match('aarch64$', a): return 'arm64' | ||
26 | elif re.match('mips(el|64|64el)$', a): return 'mips' | ||
27 | elif re.match('p(pc|owerpc)(|64)', a): return 'powerpc' | ||
28 | elif re.match('sh(3|4)$', a): return 'sh' | ||
29 | elif re.match('bfin', a): return 'blackfin' | ||
30 | elif re.match('microblazeel', a): return 'microblaze' | ||
31 | elif a in valid_archs: return a | ||
32 | else: | ||
33 | bb.error("cannot map '%s' to a linux kernel architecture" % a) | ||
34 | |||
35 | export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH', True), d)}" | ||
36 | |||
37 | def map_uboot_arch(a, d): | ||
38 | import re | ||
39 | |||
40 | if re.match('p(pc|owerpc)(|64)', a): return 'ppc' | ||
41 | elif re.match('i.86$', a): return 'x86' | ||
42 | return a | ||
43 | |||
44 | export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH', True), d)}" | ||
45 | |||
46 | # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture | ||
47 | # specific options necessary for building the kernel and modules. | ||
48 | TARGET_CC_KERNEL_ARCH ?= "" | ||
49 | HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}" | ||
50 | TARGET_LD_KERNEL_ARCH ?= "" | ||
51 | HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" | ||
52 | TARGET_AR_KERNEL_ARCH ?= "" | ||
53 | HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}" | ||
54 | |||
55 | KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH}" | ||
56 | KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" | ||
57 | KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" | ||
58 | |||