summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/uclibc
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-08-15 23:18:55 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-21 12:15:32 +0100
commit9a33e7b9a81fd4e6c2bbe2eb832b55d1da998d6b (patch)
treeec12950a760b95090cac7dc22441a45a2f76ffe9 /meta/recipes-core/uclibc
parent48df3fe947c4d900aa6b66d9d8352c0d9e59ebe4 (diff)
downloadpoky-9a33e7b9a81fd4e6c2bbe2eb832b55d1da998d6b.tar.gz
uclibc.inc,uclibc-config.inc: Untabify python snippets
To appease bitbake (From OE-Core rev: cf975073a11c93f4a9fb5bdd72c16dc0ca9c3c54) 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')
-rw-r--r--meta/recipes-core/uclibc/uclibc-config.inc128
-rw-r--r--meta/recipes-core/uclibc/uclibc.inc28
2 files changed, 85 insertions, 71 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-config.inc b/meta/recipes-core/uclibc/uclibc-config.inc
index 265626c38d..fd36fa593a 100644
--- a/meta/recipes-core/uclibc/uclibc-config.inc
+++ b/meta/recipes-core/uclibc/uclibc-config.inc
@@ -32,84 +32,98 @@ x86_64 \
32xtensa \ 32xtensa \
33" 33"
34def map_uclibc_arch(a, d): 34def 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 = d.getVar('valid_archs', True).split() 38 valid_archs = d.getVar('valid_archs', True).split()
39 39
40 if re.match('^(arm|sa110).*', a): return 'arm' 40 if re.match('^(arm|sa110).*', a):
41 elif re.match('^(i.86|athlon)$', a): return 'i386' 41 return 'arm'
42 elif re.match('^mips.*', a): return 'mips' 42 elif re.match('^(i.86|athlon)$', a):
43 elif re.match('^parisc.*', a): return 'hppa' 43 return 'i386'
44 elif re.match('^ppc.*', a): return 'powerpc' 44 elif re.match('^mips.*', a):
45 elif re.match('^s390.*', a): return 's390' 45 return 'mips'
46 elif re.match('^sh.*', a): return 'sh' 46 elif re.match('^parisc.*', a):
47 elif re.match('^(sun|sparc).*', a): return 'sparc' 47 return 'hppa'
48 elif re.match('^xtensa.*', a): return 'xtensa' 48 elif re.match('^ppc.*', a):
49 elif a in valid_archs: return a 49 return 'powerpc'
50 else: 50 elif re.match('^s390.*', a):
51 bb.error("cannot map '%s' to a uClibc architecture" % a) 51 return 's390'
52 elif re.match('^sh.*', a):
53 return 'sh'
54 elif re.match('^(sun|sparc).*', a):
55 return 'sparc'
56 elif re.match('^xtensa.*', a):
57 return 'xtensa'
58 elif a in valid_archs:
59 return a
60 else:
61 bb.error("cannot map '%s' to a uClibc architecture" % a)
52 62
53export UCLIBC_ARCH = "${@map_uclibc_arch(d.getVar('TARGET_ARCH', True), d)}" 63export UCLIBC_ARCH = "${@map_uclibc_arch(d.getVar('TARGET_ARCH', True), d)}"
54 64
55def map_uclibc_abi(o, d): 65def map_uclibc_abi(o, d):
56 """Return the uClibc ABI for the given TARGET_OS.""" 66 """Return the uClibc ABI for the given TARGET_OS."""
57 import re 67 import re
58 68
59 arch = d.getVar('TARGET_ARCH', True) 69 arch = d.getVar('TARGET_ARCH', True)
60 if map_uclibc_arch(d.getVar('TARGET_ARCH', True), d) == "arm": 70 if map_uclibc_arch(d.getVar('TARGET_ARCH', True), d) == "arm":
61 if re.match('.*eabi$', o): return 'ARM_EABI' 71 if re.match('.*eabi$', o):
62 else: return 'ARM_OABI' 72 return 'ARM_EABI'
63 # FIXME: This is inaccurate! Handle o32, n32, n64 73 else:
64 elif re.match('^mips.*64$', arch): return 'MIPS_N64_ABI' 74 return 'ARM_OABI'
65 elif re.match('^mips.*', arch): return 'MIPS_O32_ABI' 75 # FIXME: This is inaccurate! Handle o32, n32, n64
66 return "" 76 elif re.match('^mips.*64$', arch):
77 return 'MIPS_N64_ABI'
78 elif re.match('^mips.*', arch):
79 return 'MIPS_O32_ABI'
80 return ""
67 81
68export UCLIBC_ABI = "${@map_uclibc_abi(d.getVar('TARGET_OS', True), d)}" 82export UCLIBC_ABI = "${@map_uclibc_abi(d.getVar('TARGET_OS', True), d)}"
69 83
70def map_uclibc_endian(a, d): 84def map_uclibc_endian(a, d):
71 """Return the uClibc endianess for the given TARGET_ARCH.""" 85 """Return the uClibc endianess for the given TARGET_ARCH."""
72 import re 86 import re
73 87
74 # Always BE 88 # Always BE
75 if re.match('^(avr32|e1|frv|(parisc|hppa)|m68k|microblaze|powerpc.*|(sparc|sun).*)$', a): 89 if re.match('^(avr32|e1|frv|(parisc|hppa)|m68k|microblaze|powerpc.*|(sparc|sun).*)$', a):
76 return 'BIG' 90 return 'BIG'
77 # Possibly BE 91 # Possibly BE
78 elif re.match('^(((arm|sa110).*eb)|h8300.*eb|(parisc|hppa).*eb|mips|mips64|sh.*eb|xtensa.*eb)$', a): 92 elif re.match('^(((arm|sa110).*eb)|h8300.*eb|(parisc|hppa).*eb|mips|mips64|sh.*eb|xtensa.*eb)$', a):
79 return 'BIG' 93 return 'BIG'
80 return 'LITTLE' 94 return 'LITTLE'
81 95
82export UCLIBC_ENDIAN = "${@map_uclibc_endian(d.getVar('TARGET_ARCH', True), d)}" 96export UCLIBC_ENDIAN = "${@map_uclibc_endian(d.getVar('TARGET_ARCH', True), d)}"
83 97
84# internal helper 98# internal helper
85def uclibc_cfg(feature, features, tokens, cnf, rem): 99def uclibc_cfg(feature, features, tokens, cnf, rem):
86 if type(tokens) == type(""): 100 if type(tokens) == type(""):
87 tokens = [tokens] 101 tokens = [tokens]
88 rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens]) 102 rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
89 if type(features) == type([]) and feature in features: 103 if type(features) == type([]) and feature in features:
90 cnf.extend([token + '=y' for token in tokens]) 104 cnf.extend([token + '=y' for token in tokens])
91 else: 105 else:
92 cnf.extend(['# ' + token + ' is not set' for token in tokens]) 106 cnf.extend(['# ' + token + ' is not set' for token in tokens])
93 107
94# Map distro features to config settings 108# Map distro features to config settings
95def features_to_uclibc_settings(d): 109def features_to_uclibc_settings(d):
96 cnf, rem = ([], []) 110 cnf, rem = ([], [])
97 distro_features = d.getVar('DISTRO_FEATURES', True).split() 111 distro_features = d.getVar('DISTRO_FEATURES', True).split()
98 uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem) 112 uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem)
99 uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem) 113 uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem)
100 uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem) 114 uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem)
101 uclibc_cfg('nls', distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem) 115 uclibc_cfg('nls', distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem)
102 uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem) 116 uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem)
103 uclibc_cfg('xattr', distro_features, 'UCLIBC_HAS_XATTR', cnf, rem) 117 uclibc_cfg('xattr', distro_features, 'UCLIBC_HAS_XATTR', cnf, rem)
104 uclibc_cfg('ssp', distro_features, 'UCLIBC_HAS_SSP', cnf, rem) 118 uclibc_cfg('ssp', distro_features, 'UCLIBC_HAS_SSP', cnf, rem)
105 uclibc_cfg('argp', distro_features, 'UCLIBC_HAS_ARGP', cnf, rem) 119 uclibc_cfg('argp', distro_features, 'UCLIBC_HAS_ARGP', cnf, rem)
106 uclibc_cfg('libc-posix-clang-wchar', distro_features,'UCLIBC_HAS_WCHAR', cnf, rem) 120 uclibc_cfg('libc-posix-clang-wchar', distro_features,'UCLIBC_HAS_WCHAR', cnf, rem)
107 return "\n".join(cnf), "\n".join(rem) 121 return "\n".join(cnf), "\n".join(rem)
108# X, Y = ${@features_to_uclibc_settings(d)} 122# X, Y = ${@features_to_uclibc_settings(d)}
109# unfortunately doesn't seem to work with bitbake, workaround: 123# unfortunately doesn't seem to work with bitbake, workaround:
110def features_to_uclibc_conf(d): 124def features_to_uclibc_conf(d):
111 cnf, rem = features_to_uclibc_settings(d) 125 cnf, rem = features_to_uclibc_settings(d)
112 return cnf 126 return cnf
113def features_to_uclibc_del(d): 127def features_to_uclibc_del(d):
114 cnf, rem = features_to_uclibc_settings(d) 128 cnf, rem = features_to_uclibc_settings(d)
115 return rem 129 return rem
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
index 863bf3a9a5..6c980902f7 100644
--- a/meta/recipes-core/uclibc/uclibc.inc
+++ b/meta/recipes-core/uclibc/uclibc.inc
@@ -83,13 +83,13 @@ configmangle = '/^KERNEL_HEADERS/d; \
83OE_FEATURES := "${@features_to_uclibc_conf(d)}" 83OE_FEATURES := "${@features_to_uclibc_conf(d)}"
84OE_DEL := "${@features_to_uclibc_del(d)}" 84OE_DEL := "${@features_to_uclibc_del(d)}"
85python () { 85python () {
86 if "${OE_DEL}": 86 if "${OE_DEL}":
87 d.setVar('configmangle_append', "${OE_DEL}" + "\n") 87 d.setVar('configmangle_append', "${OE_DEL}" + "\n")
88 if "${OE_FEATURES}": 88 if "${OE_FEATURES}":
89 d.setVar('configmangle_append', 89 d.setVar('configmangle_append',
90 "/^### DISTRO FEATURES$/a\\\n%s\n\n" % 90 "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
91 ("\\n".join((d.expand("${OE_FEATURES}").split("\n"))))) 91 ("\\n".join((d.expand("${OE_FEATURES}").split("\n")))))
92 d.setVar('configmangle_append', 92 d.setVar('configmangle_append',
93 "/^### CROSS$/a\\\n%s\n" % 93 "/^### CROSS$/a\\\n%s\n" %
94 ("\\n".join(["CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"", 94 ("\\n".join(["CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
95 "UCLIBC_EXTRA_CFLAGS=\"${UCLIBC_EXTRA_CFLAGS}\"", 95 "UCLIBC_EXTRA_CFLAGS=\"${UCLIBC_EXTRA_CFLAGS}\"",
@@ -99,23 +99,23 @@ python () {
99 "SHARED_LIB_LOADER_PREFIX=\"/lib\"", 99 "SHARED_LIB_LOADER_PREFIX=\"/lib\"",
100 ]) 100 ])
101 )) 101 ))
102 d.setVar('configmangle_append', 102 d.setVar('configmangle_append',
103 "/^### TGT$/a\\\nTARGET_ARCH=\"%s\"\\nTARGET_%s=y\n" % 103 "/^### TGT$/a\\\nTARGET_ARCH=\"%s\"\\nTARGET_%s=y\n" %
104 ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}")) 104 ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}"))
105 d.setVar('configmangle_append',
106 "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][d.getVar('TARGET_FPU', True) in [ 'soft' ]]))
107 if "${UCLIBC_ENDIAN}":
108 d.setVar('configmangle_append', 105 d.setVar('configmangle_append',
106 "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][d.getVar('TARGET_FPU', True) in [ 'soft' ]]))
107 if "${UCLIBC_ENDIAN}":
108 d.setVar('configmangle_append',
109 "/^### ABI$/a\\\nARCH_WANTS_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}")) 109 "/^### ABI$/a\\\nARCH_WANTS_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}"))
110 if "${UCLIBC_ABI}": 110 if "${UCLIBC_ABI}":
111 d.setVar('configmangle_append', 111 d.setVar('configmangle_append',
112 "/^### ABI$/a\\\nCONFIG_%s=y\n\n" % ("${UCLIBC_ABI}")) 112 "/^### ABI$/a\\\nCONFIG_%s=y\n\n" % ("${UCLIBC_ABI}"))
113} 113}
114 114
115python do_patch_append() { 115python do_patch_append() {
116 import subprocess 116 import subprocess
117 subprocess.call("ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux", shell=True) 117 subprocess.call("ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux", shell=True)
118 subprocess.call("ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm", shell=True) 118 subprocess.call("ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm", shell=True)
119} 119}
120 120
121do_configure() { 121do_configure() {