diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-09 15:00:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-10 11:51:19 +0000 |
commit | c8dee9b92dfd545852ecac8dc2adfc95ac02e957 (patch) | |
tree | 5f1b86954646a0f3bb914407994388a6a4346769 /meta/recipes-core/uclibc | |
parent | 5d3860f4a8abb8e95442b04f8b84a333af362fcd (diff) | |
download | poky-c8dee9b92dfd545852ecac8dc2adfc95ac02e957.tar.gz |
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/uclibc')
-rw-r--r-- | meta/recipes-core/uclibc/uclibc-config.inc | 16 | ||||
-rw-r--r-- | meta/recipes-core/uclibc/uclibc.inc | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-config.inc b/meta/recipes-core/uclibc/uclibc-config.inc index 697164c008..a30188d209 100644 --- a/meta/recipes-core/uclibc/uclibc-config.inc +++ b/meta/recipes-core/uclibc/uclibc-config.inc | |||
@@ -35,7 +35,7 @@ def map_uclibc_arch(a, d): | |||
35 | """Return the uClibc architecture for the given TARGET_ARCH.""" | 35 | """Return the uClibc architecture for the given TARGET_ARCH.""" |
36 | import re | 36 | import re |
37 | 37 | ||
38 | valid_archs = bb.data.getVar('valid_archs', d, 1).split() | 38 | valid_archs = d.getVar('valid_archs', 1).split() |
39 | 39 | ||
40 | if re.match('^(arm|sa110).*', a): return 'arm' | 40 | if re.match('^(arm|sa110).*', a): return 'arm' |
41 | elif re.match('^(i.86|athlon)$', a): return 'i386' | 41 | elif re.match('^(i.86|athlon)$', a): return 'i386' |
@@ -50,14 +50,14 @@ def map_uclibc_arch(a, d): | |||
50 | else: | 50 | else: |
51 | bb.error("cannot map '%s' to a uClibc architecture" % a) | 51 | bb.error("cannot map '%s' to a uClibc architecture" % a) |
52 | 52 | ||
53 | export UCLIBC_ARCH = "${@map_uclibc_arch(bb.data.getVar('TARGET_ARCH', d, 1), d)}" | 53 | export UCLIBC_ARCH = "${@map_uclibc_arch(d.getVar('TARGET_ARCH', 1), d)}" |
54 | 54 | ||
55 | def map_uclibc_abi(o, d): | 55 | def map_uclibc_abi(o, d): |
56 | """Return the uClibc ABI for the given TARGET_OS.""" | 56 | """Return the uClibc ABI for the given TARGET_OS.""" |
57 | import re | 57 | import re |
58 | 58 | ||
59 | arch = bb.data.getVar('TARGET_ARCH', d, 1) | 59 | arch = d.getVar('TARGET_ARCH', 1) |
60 | if map_uclibc_arch(bb.data.getVar('TARGET_ARCH', d, 1), d) == "arm": | 60 | if map_uclibc_arch(d.getVar('TARGET_ARCH', 1), d) == "arm": |
61 | if re.match('.*eabi$', o): return 'ARM_EABI' | 61 | if re.match('.*eabi$', o): return 'ARM_EABI' |
62 | else: return 'ARM_OABI' | 62 | else: return 'ARM_OABI' |
63 | # FIXME: This is inaccurate! Handle o32, n32, n64 | 63 | # FIXME: This is inaccurate! Handle o32, n32, n64 |
@@ -65,7 +65,7 @@ def map_uclibc_abi(o, d): | |||
65 | elif re.match('^mips.*', arch): return 'MIPS_O32_ABI' | 65 | elif re.match('^mips.*', arch): return 'MIPS_O32_ABI' |
66 | return "" | 66 | return "" |
67 | 67 | ||
68 | export UCLIBC_ABI = "${@map_uclibc_abi(bb.data.getVar('TARGET_OS', d, 1), d)}" | 68 | export UCLIBC_ABI = "${@map_uclibc_abi(d.getVar('TARGET_OS', 1), d)}" |
69 | 69 | ||
70 | def map_uclibc_endian(a, d): | 70 | def map_uclibc_endian(a, d): |
71 | """Return the uClibc endianess for the given TARGET_ARCH.""" | 71 | """Return the uClibc endianess for the given TARGET_ARCH.""" |
@@ -79,7 +79,7 @@ def map_uclibc_endian(a, d): | |||
79 | return 'BIG' | 79 | return 'BIG' |
80 | return 'LITTLE' | 80 | return 'LITTLE' |
81 | 81 | ||
82 | export UCLIBC_ENDIAN = "${@map_uclibc_endian(bb.data.getVar('TARGET_ARCH', d, 1), d)}" | 82 | export UCLIBC_ENDIAN = "${@map_uclibc_endian(d.getVar('TARGET_ARCH', 1), d)}" |
83 | 83 | ||
84 | # internal helper | 84 | # internal helper |
85 | def uclibc_cfg(feature, features, tokens, cnf, rem): | 85 | def uclibc_cfg(feature, features, tokens, cnf, rem): |
@@ -94,8 +94,8 @@ def uclibc_cfg(feature, features, tokens, cnf, rem): | |||
94 | # Map distro and machine features to config settings | 94 | # Map distro and machine features to config settings |
95 | def features_to_uclibc_settings(d): | 95 | def features_to_uclibc_settings(d): |
96 | cnf, rem = ([], []) | 96 | cnf, rem = ([], []) |
97 | distro_features = bb.data.getVar('DISTRO_FEATURES', d, True).split() | 97 | distro_features = d.getVar('DISTRO_FEATURES', True).split() |
98 | machine_features = bb.data.getVar('MACHINE_FEATURES', d, True).split() | 98 | machine_features = d.getVar('MACHINE_FEATURES', True).split() |
99 | uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem) | 99 | uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem) |
100 | uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem) | 100 | uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem) |
101 | uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem) | 101 | uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem) |
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc index 222c34f383..8438f25450 100644 --- a/meta/recipes-core/uclibc/uclibc.inc +++ b/meta/recipes-core/uclibc/uclibc.inc | |||
@@ -125,9 +125,9 @@ configmangle = '/^KERNEL_HEADERS/d; \ | |||
125 | /^SHARED_LIB_LOADER_PREFIX/d; \ | 125 | /^SHARED_LIB_LOADER_PREFIX/d; \ |
126 | /^UCLIBC_EXTRA_CFLAGS/d; \ | 126 | /^UCLIBC_EXTRA_CFLAGS/d; \ |
127 | s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \ | 127 | s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \ |
128 | ${@["","s,.*COMPILE_IN_THUMB_MODE.*,COMPILE_IN_THUMB_MODE=y,;"][bb.data.getVar("ARM_INSTRUCTION_SET", d, 1) != "arm"]} \ | 128 | ${@["","s,.*COMPILE_IN_THUMB_MODE.*,COMPILE_IN_THUMB_MODE=y,;"][d.getVar("ARM_INSTRUCTION_SET", 1) != "arm"]} \ |
129 | ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][bb.data.getVar("USE_NLS", d, 1) == "yes"]} \ | 129 | ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][d.getVar("USE_NLS", 1) == "yes"]} \ |
130 | ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][bb.data.getVar("TARGET_ARCH", d, 1) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]} \ | 130 | ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][d.getVar("TARGET_ARCH", 1) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]} \ |
131 | /^CROSS/d; \ | 131 | /^CROSS/d; \ |
132 | /^TARGET_ARCH=/d; \ | 132 | /^TARGET_ARCH=/d; \ |
133 | /^TARGET_/s,^\([^=]*\).*,# \1 is not set,g; \ | 133 | /^TARGET_/s,^\([^=]*\).*,# \1 is not set,g; \ |
@@ -139,7 +139,7 @@ OE_FEATURES := "${@features_to_uclibc_conf(d)}" | |||
139 | OE_DEL := "${@features_to_uclibc_del(d)}" | 139 | OE_DEL := "${@features_to_uclibc_del(d)}" |
140 | python () { | 140 | python () { |
141 | if "${OE_DEL}": | 141 | if "${OE_DEL}": |
142 | bb.data.setVar('configmangle_append', "${OE_DEL}" + "\n", d) | 142 | d.setVar('configmangle_append', "${OE_DEL}" + "\n") |
143 | if "${OE_FEATURES}": | 143 | if "${OE_FEATURES}": |
144 | bb.data.setVar('configmangle_append', | 144 | bb.data.setVar('configmangle_append', |
145 | "/^### DISTRO FEATURES$/a\\\n%s\n\n" % | 145 | "/^### DISTRO FEATURES$/a\\\n%s\n\n" % |
@@ -161,7 +161,7 @@ python () { | |||
161 | ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}"), | 161 | ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}"), |
162 | d) | 162 | d) |
163 | bb.data.setVar('configmangle_append', | 163 | bb.data.setVar('configmangle_append', |
164 | "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]]), d) | 164 | "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][d.getVar('TARGET_FPU', 1) in [ 'soft' ]]), d) |
165 | if "${UCLIBC_ENDIAN}": | 165 | if "${UCLIBC_ENDIAN}": |
166 | bb.data.setVar('configmangle_append', | 166 | bb.data.setVar('configmangle_append', |
167 | "/^### ABI$/a\\\nARCH_WANTS_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}"), | 167 | "/^### ABI$/a\\\nARCH_WANTS_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}"), |