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
7 valid_archs = "alpha cris ia64 m68knommu ppc sh \
8 sparc64 x86_64 arm h8300 m32r mips \
9 ppc64 sh64 um arm26 i386 m68k \
10 parisc s390 sparc v850"
12 def map_kernel_arch(a, d):
15 valid_archs = bb.data.getVar('valid_archs', d, 1).split()
17 if re.match('(i.86|athlon)$', a): return 'i386'
18 elif re.match('arm26$', a): return 'arm26'
19 elif re.match('armeb$', a): return 'arm'
20 elif re.match('powerpc$', a): return 'ppc'
21 elif re.match('mipsel$', a): return 'mips'
22 elif a in valid_archs: return a
24 bb.error("cannot map '%s' to a linux kernel architecture" % a)
26 export ARCH = "${@map_kernel_arch(bb.data.getVar('TARGET_ARCH', d, 1), d)}"