diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-05-22 12:02:12 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-23 15:53:28 +0100 |
commit | 4ea8b2fde48134dd58a9876c9ddc21b4b51e78f2 (patch) | |
tree | f0bdb225cabf12d58369be1514cd641ebf05341d /meta/recipes-core/uclibc/uclibc-config.inc | |
parent | ed6f039bca9bd8da640ba8c76a4751bc818a091b (diff) | |
download | poky-4ea8b2fde48134dd58a9876c9ddc21b4b51e78f2.tar.gz |
uclibc: Upgrade to 0.9.32-rc3
Bring in the uclibc recipes from meta-oe they have been well
tested by now.
Delete 0.9.30.1 recipes
(From OE-Core rev: ac60a936e737680c16b287a3dab6aa285d87c5c0)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/uclibc/uclibc-config.inc')
-rw-r--r-- | meta/recipes-core/uclibc/uclibc-config.inc | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-config.inc b/meta/recipes-core/uclibc/uclibc-config.inc new file mode 100644 index 0000000000..3679c104c7 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-config.inc | |||
@@ -0,0 +1,116 @@ | |||
1 | # | ||
2 | # Set the ARCH environment variable for uClibc compilation. | ||
3 | # Return value must match one of the architectures known to uClibc: | ||
4 | # libc/sysdeps/*/* | ||
5 | # | ||
6 | |||
7 | valid_archs = "\ | ||
8 | alpha \ | ||
9 | arm \ | ||
10 | avr32 \ | ||
11 | bfin \ | ||
12 | cris \ | ||
13 | e1 \ | ||
14 | frv \ | ||
15 | h8300 \ | ||
16 | hppa \ | ||
17 | i386 \ | ||
18 | i960 \ | ||
19 | ia64 \ | ||
20 | m68k \ | ||
21 | microblaze \ | ||
22 | mips \ | ||
23 | nios \ | ||
24 | nios2 \ | ||
25 | powerpc \ | ||
26 | sh \ | ||
27 | sh64 \ | ||
28 | sparc \ | ||
29 | v850 \ | ||
30 | vax \ | ||
31 | x86_64 \ | ||
32 | xtensa \ | ||
33 | " | ||
34 | def map_uclibc_arch(a, d): | ||
35 | """Return the uClibc architecture for the given TARGET_ARCH.""" | ||
36 | import re | ||
37 | |||
38 | valid_archs = bb.data.getVar('valid_archs', d, 1).split() | ||
39 | |||
40 | if re.match('^(arm|sa110).*', a): return 'arm' | ||
41 | elif re.match('^(i.86|athlon)$', a): return 'i386' | ||
42 | elif re.match('^mips.*', a): return 'mips' | ||
43 | elif re.match('^parisc.*', a): return 'hppa' | ||
44 | elif re.match('^ppc.*', a): return 'powerpc' | ||
45 | elif re.match('^s390.*', a): return 's390' | ||
46 | elif re.match('^sh.*', a): return 'sh' | ||
47 | elif re.match('^(sun|sparc).*', a): return 'sparc' | ||
48 | elif re.match('^xtensa.*', a): return 'xtensa' | ||
49 | elif a in valid_archs: return a | ||
50 | else: | ||
51 | bb.error("cannot map '%s' to a uClibc architecture" % a) | ||
52 | |||
53 | export UCLIBC_ARCH = "${@map_uclibc_arch(bb.data.getVar('TARGET_ARCH', d, 1), d)}" | ||
54 | |||
55 | def map_uclibc_abi(o, d): | ||
56 | """Return the uClibc ABI for the given TARGET_OS.""" | ||
57 | import re | ||
58 | |||
59 | arch = bb.data.getVar('TARGET_ARCH', d, 1) | ||
60 | if map_uclibc_arch(bb.data.getVar('TARGET_ARCH', d, 1), d) == "arm": | ||
61 | if re.match('.*eabi$', o): return 'ARM_EABI' | ||
62 | else: return 'ARM_OABI' | ||
63 | # FIXME: This is inaccurate! Handle o32, n32, n64 | ||
64 | elif re.match('^mips.*64$', arch): return 'MIPS_N64_ABI' | ||
65 | elif re.match('^mips.*', arch): return 'MIPS_O32_ABI' | ||
66 | return "" | ||
67 | |||
68 | export UCLIBC_ABI = "${@map_uclibc_abi(bb.data.getVar('TARGET_OS', d, 1), d)}" | ||
69 | |||
70 | def map_uclibc_endian(a, d): | ||
71 | """Return the uClibc endianess for the given TARGET_ARCH.""" | ||
72 | import re | ||
73 | |||
74 | # Always BE | ||
75 | if re.match('^(avr32|e1|frv|(parisc|hppa)|m68k|microblaze|powerpc.*|(sparc|sun).*)$', a): | ||
76 | return 'BIG' | ||
77 | # Possibly BE | ||
78 | elif re.match('^((arm|sa110|arm.*eb)|h8300.*eb|(parisc|hppa).*eb|mips|sh.*eb|xtensa.*eb)$', a): | ||
79 | return 'BIG' | ||
80 | return 'LITTLE' | ||
81 | |||
82 | export UCLIBC_ENDIAN = "${@map_uclibc_endian(bb.data.getVar('TARGET_ARCH', d, 1), d)}" | ||
83 | |||
84 | # internal helper | ||
85 | def uclibc_cfg(feature, features, tokens, cnf, rem): | ||
86 | if type(tokens) == type(""): | ||
87 | tokens = [tokens] | ||
88 | rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens]) | ||
89 | if type(features) == type([]) and feature in features: | ||
90 | cnf.extend([token + '=y' for token in tokens]) | ||
91 | else: | ||
92 | cnf.extend(['# ' + token + ' is not set' for token in tokens]) | ||
93 | |||
94 | # Map distro and machine features to config settings | ||
95 | def features_to_uclibc_settings(d): | ||
96 | cnf, rem = ([], []) | ||
97 | distro_features = bb.data.getVar('DISTRO_FEATURES', d, True).split() | ||
98 | machine_features = bb.data.getVar('MACHINE_FEATURES', d, True).split() | ||
99 | uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem) | ||
100 | uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem) | ||
101 | uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem) | ||
102 | uclibc_cfg('nls', distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem) | ||
103 | uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem) | ||
104 | uclibc_cfg('xattr', distro_features, 'UCLIBC_HAS_XATTR', cnf, rem) | ||
105 | uclibc_cfg('ssp', distro_features, 'UCLIBC_HAS_SSP', cnf, rem) | ||
106 | uclibc_cfg('argp', distro_features, 'UCLIBC_HAS_ARGP', cnf, rem) | ||
107 | uclibc_cfg('kernel24', machine_features,'UCLIBC_LINUX_MODULE_24', cnf, rem) | ||
108 | return "\n".join(cnf), "\n".join(rem) | ||
109 | # X, Y = ${@features_to_uclibc_settings(d)} | ||
110 | # unfortunately doesn't seem to work with bitbake, workaround: | ||
111 | def features_to_uclibc_conf(d): | ||
112 | cnf, rem = features_to_uclibc_settings(d) | ||
113 | return cnf | ||
114 | def features_to_uclibc_del(d): | ||
115 | cnf, rem = features_to_uclibc_settings(d) | ||
116 | return rem | ||