diff options
author | Kang Kai <kai.kang@windriver.com> | 2011-06-07 16:16:43 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-14 15:29:12 +0100 |
commit | fbc60cc5ba2284bfcaea8c82001a49b7795cc2a2 (patch) | |
tree | b126a32adab444f091d012d8d2943d17660d3080 /meta/recipes-core/eglibc/eglibc-options.inc | |
parent | 81d14f5629b4eeb2096ccb52812e5775fe0125e9 (diff) | |
download | poky-fbc60cc5ba2284bfcaea8c82001a49b7795cc2a2.tar.gz |
eglibc: migrate configurability from oe
Migrate configurability from oe, try to shrink minimal image size
All eglibc configuration options are included in conf/distro/include/default-distrovars.inc.
Define DISTRO_FEATURES_LIBC and DISTRO_FEATURES in local.conf with the same way
in local.conf.sample.extended to enable those options.
(From OE-Core rev: 022ca1d1357caafdfe23aa9ab82f90ba89b6942b)
Signed-off-by: Kang Kai <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-options.inc')
-rw-r--r-- | meta/recipes-core/eglibc/eglibc-options.inc | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc new file mode 100644 index 0000000000..119ceefdd7 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-options.inc | |||
@@ -0,0 +1,62 @@ | |||
1 | def eglibc_cfg(feature, features, tokens, cnf): | ||
2 | if type(tokens) == type(""): | ||
3 | tokens = [tokens] | ||
4 | if type(features) == type([]) and feature in features: | ||
5 | cnf.extend([token + ' = y' for token in tokens]) | ||
6 | else: | ||
7 | for token in tokens: | ||
8 | cnf.extend([token + ' = n']) | ||
9 | if token == 'OPTION_EGLIBC_NSSWITCH': | ||
10 | cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${S}/nss/nsswitch.conf"]) | ||
11 | cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${S}/nss/fixed-nsswitch.functions"]) | ||
12 | |||
13 | # Map distro features to eglibc options settings | ||
14 | def features_to_eglibc_settings(d): | ||
15 | cnf = ([]) | ||
16 | distro_features = (bb.data.getVar('DISTRO_FEATURES', d, True) or '').split() | ||
17 | eglibc_cfg('ipv6', distro_features, 'OPTION_EGLIBC_ADVANCED_INET6', cnf) | ||
18 | eglibc_cfg('libc-backtrace', distro_features, 'OPTION_EGLIBC_BACKTRACE', cnf) | ||
19 | eglibc_cfg('libc-big-macros', distro_features, 'OPTION_EGLIBC_BIG_MACROS', cnf) | ||
20 | eglibc_cfg('libc-bsd', distro_features, 'OPTION_EGLIBC_BSD', cnf) | ||
21 | eglibc_cfg('libc-cxx-tests', distro_features, 'OPTION_EGLIBC_CXX_TESTS', cnf) | ||
22 | eglibc_cfg('libc-catgets', distro_features, 'OPTION_EGLIBC_CATGETS', cnf) | ||
23 | eglibc_cfg('libc-charsets', distro_features, 'OPTION_EGLIBC_CHARSETS', cnf) | ||
24 | eglibc_cfg('libc-crypt', distro_features, 'OPTION_EGLIBC_CRYPT', cnf) | ||
25 | eglibc_cfg('libc-crypt-ufc', distro_features, 'OPTION_EGLIBC_CRYPT_UFC', cnf) | ||
26 | eglibc_cfg('libc-db-aliases', distro_features, 'OPTION_EGLIBC_DB_ALIASES', cnf) | ||
27 | eglibc_cfg('libc-envz', distro_features, 'OPTION_EGLIBC_ENVZ', cnf) | ||
28 | eglibc_cfg('libc-fcvt', distro_features, 'OPTION_EGLIBC_FCVT', cnf) | ||
29 | eglibc_cfg('libc-fmtmsg', distro_features, 'OPTION_EGLIBC_FMTMSG', cnf) | ||
30 | eglibc_cfg('libc-fstab', distro_features, 'OPTION_EGLIBC_FSTAB', cnf) | ||
31 | eglibc_cfg('libc-ftraverse', distro_features, 'OPTION_EGLIBC_FTRAVERSE', cnf) | ||
32 | eglibc_cfg('libc-getlogin', distro_features, 'OPTION_EGLIBC_GETLOGIN', cnf) | ||
33 | eglibc_cfg('libc-idn', distro_features, 'OPTION_EGLIBC_IDN', cnf) | ||
34 | eglibc_cfg('libc-inet', distro_features, 'OPTION_EGLIBC_INET', cnf) | ||
35 | eglibc_cfg('libc-inet-anl', distro_features, 'OPTION_EGLIBC_INET_ANL', cnf) | ||
36 | eglibc_cfg('libc-libm', distro_features, 'OPTION_EGLIBC_LIBM', cnf) | ||
37 | eglibc_cfg('libc-libm-big', distro_features, 'OPTION_EGLIBC_LIBM_BIG', cnf) | ||
38 | eglibc_cfg('libc-locales', distro_features, 'OPTION_EGLIBC_LOCALES', cnf) | ||
39 | eglibc_cfg('libc-locale-code', distro_features, 'OPTION_EGLIBC_LOCALE_CODE', cnf) | ||
40 | eglibc_cfg('libc-memusage', distro_features, 'OPTION_EGLIBC_MEMUSAGE', cnf) | ||
41 | eglibc_cfg('libc-nis', distro_features, 'OPTION_EGLIBC_NIS', cnf) | ||
42 | eglibc_cfg('libc-nsswitch', distro_features, 'OPTION_EGLIBC_NSSWITCH', cnf) | ||
43 | eglibc_cfg('libc-rcmd', distro_features, 'OPTION_EGLIBC_RCMD', cnf) | ||
44 | eglibc_cfg('libc-rtld-debug', distro_features, 'OPTION_EGLIBC_RTLD_DEBUG', cnf) | ||
45 | eglibc_cfg('libc-spawn', distro_features, 'OPTION_EGLIBC_SPAWN', cnf) | ||
46 | eglibc_cfg('libc-streams', distro_features, 'OPTION_EGLIBC_STREAMS', cnf) | ||
47 | eglibc_cfg('libc-sunrpc', distro_features, 'OPTION_EGLIBC_SUNRPC', cnf) | ||
48 | eglibc_cfg('libc-utmp', distro_features, 'OPTION_EGLIBC_UTMP', cnf) | ||
49 | eglibc_cfg('libc-utmpx', distro_features, 'OPTION_EGLIBC_UTMPX', cnf) | ||
50 | eglibc_cfg('libc-wordexp', distro_features, 'OPTION_EGLIBC_WORDEXP', cnf) | ||
51 | eglibc_cfg('libc-posix-clang-wchar', distro_features, 'OPTION_POSIX_C_LANG_WIDE_CHAR', cnf) | ||
52 | eglibc_cfg('libc-posix-regexp', distro_features, 'OPTION_POSIX_REGEXP', cnf) | ||
53 | eglibc_cfg('libc-posix-regexp-glibc', distro_features, 'OPTION_POSIX_REGEXP_GLIBC', cnf) | ||
54 | eglibc_cfg('libc-posix-wchar-io', distro_features, 'OPTION_POSIX_WIDE_CHAR_DEVICE_IO', cnf) | ||
55 | |||
56 | # try to fix disable charsets/locales/locale-code compile fail | ||
57 | if 'libc-charsets' in distro_features and 'libc-locales' in distro_features and 'libc-locale-code' in distro_features: | ||
58 | bb.data.setVar('PACKAGE_NO_GCONV', '0', d) | ||
59 | else: | ||
60 | bb.data.setVar('PACKAGE_NO_GCONV', '1', d) | ||
61 | |||
62 | return "\n".join(cnf) | ||