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 | |
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')
-rw-r--r-- | meta/conf/distro/include/default-distrovars.inc | 9 | ||||
-rw-r--r-- | meta/recipes-core/eglibc/eglibc-options.inc | 62 | ||||
-rw-r--r-- | meta/recipes-core/eglibc/eglibc.inc | 6 |
3 files changed, 76 insertions, 1 deletions
diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc index 4b68a0a54c..2cde46cd7b 100644 --- a/meta/conf/distro/include/default-distrovars.inc +++ b/meta/conf/distro/include/default-distrovars.inc | |||
@@ -10,7 +10,14 @@ LIMIT_BUILT_LOCALES ?= "POSIX en_US en_GB" | |||
10 | ENABLE_BINARY_LOCALE_GENERATION ?= "1" | 10 | ENABLE_BINARY_LOCALE_GENERATION ?= "1" |
11 | LOCALE_UTF8_ONLY ?= "0" | 11 | LOCALE_UTF8_ONLY ?= "0" |
12 | 12 | ||
13 | DISTRO_FEATURES ?= "alsa bluetooth ext2 irda pcmcia usbgadget usbhost wifi nfs zeroconf pci" | 13 | DISTRO_FEATURES_LIBC ?= "ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt \ |
14 | libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse \ | ||
15 | libc-getlogin libc-idn libc-inet libc-inet-anl libc-libm libc-libm-big libc-locales libc-locale-code \ | ||
16 | libc-memusage libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-sunrpc \ | ||
17 | libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc \ | ||
18 | libc-posix-wchar-io" | ||
19 | |||
20 | DISTRO_FEATURES ?= "alsa bluetooth ext2 irda pcmcia usbgadget usbhost wifi nfs zeroconf pci ${DISTRO_FEATURES_LIBC}" | ||
14 | 21 | ||
15 | IMAGE_FEATURES ?= "" | 22 | IMAGE_FEATURES ?= "" |
16 | 23 | ||
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) | ||
diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc index 46ffa82184..616f1aff6d 100644 --- a/meta/recipes-core/eglibc/eglibc.inc +++ b/meta/recipes-core/eglibc/eglibc.inc | |||
@@ -28,6 +28,7 @@ DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers" | |||
28 | PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" | 28 | PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" |
29 | PROVIDES += "virtual/libintl virtual/libiconv" | 29 | PROVIDES += "virtual/libintl virtual/libiconv" |
30 | inherit autotools | 30 | inherit autotools |
31 | require eglibc-options.inc | ||
31 | 32 | ||
32 | LEAD_SONAME = "libc.so" | 33 | LEAD_SONAME = "libc.so" |
33 | 34 | ||
@@ -43,3 +44,8 @@ EXTRA_OEMAKE += ${EGLIBCPARALLELISM} | |||
43 | PARALLEL_MAKE = "" | 44 | PARALLEL_MAKE = "" |
44 | 45 | ||
45 | PACKAGES = "glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile" | 46 | PACKAGES = "glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile" |
47 | |||
48 | OE_FEATURES = "${@features_to_eglibc_settings(d)}" | ||
49 | do_configure_prepend() { | ||
50 | echo '${OE_FEATURES}' > ${B}/option-groups.config | ||
51 | } | ||