summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKang Kai <kai.kang@windriver.com>2011-08-18 10:04:57 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-19 09:29:20 -0700
commitddc01beb5d44940812dcef55b2b0368339620153 (patch)
tree4cb8481533a730785425414f1fb04ba7c99546e9
parentf6206cbfb023fe8de211932b572a132725b4e234 (diff)
downloadpoky-ddc01beb5d44940812dcef55b2b0368339620153.tar.gz
eglibc: check dependencies among eglibc options
Fixes [Yocto #1212] 'libc-inet' and 'ipv4' are the same thing, so remove 'libc-inet' from the default DISTRO_FEATURES_LIBC in file default-distrovars.inc. Check the dependencies among eglibc configurable options, make sure that eglibc could be compile successfully only with part of the options. (From OE-Core rev: 4b8d13b72c2c338ec5606f19aa5d7554558c51e5) Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/conf/distro/include/default-distrovars.inc2
-rw-r--r--meta/recipes-core/eglibc/eglibc-options.inc75
2 files changed, 75 insertions, 2 deletions
diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
index 45b03d5cc4..79c6e148d2 100644
--- a/meta/conf/distro/include/default-distrovars.inc
+++ b/meta/conf/distro/include/default-distrovars.inc
@@ -12,7 +12,7 @@ LOCALE_UTF8_ONLY ?= "0"
12 12
13DISTRO_FEATURES_LIBC ?= "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt \ 13DISTRO_FEATURES_LIBC ?= "ipv4 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 \ 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 \ 15 libc-getlogin libc-idn 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 \ 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 \ 17 libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc \
18 libc-posix-wchar-io" 18 libc-posix-wchar-io"
diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc
index 119ceefdd7..112029dab8 100644
--- a/meta/recipes-core/eglibc/eglibc-options.inc
+++ b/meta/recipes-core/eglibc/eglibc-options.inc
@@ -10,10 +10,83 @@ def eglibc_cfg(feature, features, tokens, cnf):
10 cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${S}/nss/nsswitch.conf"]) 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"]) 11 cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${S}/nss/fixed-nsswitch.functions"])
12 12
13# arrange the dependencies among eglibc configuable options according to file option-groups.def from eglibc source code
14def distro_features_check_deps(distro_features):
15 new_dep = True
16 while new_dep:
17 new_dep = False
18
19 if 'ipv6' in distro_features and 'ipv4' not in distro_features:
20 new_dep = True
21 distro_features.extend(['ipv4'])
22
23 if 'ipv4' in distro_features and 'libc-nsswitch' not in distro_features:
24 new_dep = True
25 distro_features.extend(['libc-nsswitch'])
26
27 if 'libc-cxx-tests' in distro_features:
28 if 'libc-posix-wchar-io' not in distro_features:
29 new_dep = True
30 distro_features.extend(['libc-posix-wchar-io'])
31 if 'libc-libm' not in distro_features:
32 new_dep = True
33 distro_features.extend(['libc-libm'])
34
35 if 'libc-catgets' in distro_features and 'libc-locale-code' not in distro_features:
36 new_dep = True
37 distro_features.extend(['libc-locale-code'])
38
39 if 'libc-crypt-ufc' in distro_features and 'libc-crypt' not in distro_features:
40 new_dep = True
41 distro_features.extend(['libc-crypt'])
42
43 if 'libc-getlogin' in distro_features and 'libc-utmp' not in distro_features:
44 new_dep = True
45 distro_features.extend(['libc-utmp'])
46
47 if 'libc-inet-anl' in distro_features and 'ipv4' not in distro_features:
48 new_dep = True
49 distro_features.extend(['ipv4'])
50
51 if 'libc-locale-code' in distro_features and 'libc-posix-clang-wchar' not in distro_features:
52 new_dep = True
53 distro_features.extend(['libc-posix-clang-wchar'])
54
55 if 'libc-nis' in distro_features:
56 if 'ipv4' not in distro_features:
57 new_dep = True
58 distro_features.extend(['ipv4'])
59 if 'libc-sunrpc' not in distro_features:
60 new_dep = True
61 distro_features.extend(['libc-sunrpc'])
62
63 if 'libc-rcmd' in distro_features and 'ipv4' not in distro_features:
64 new_dep = True
65 distro_features.extend(['ipv4'])
66
67 if 'libc-sunrpc' in distro_features and 'ipv4' not in distro_features:
68 new_dep = True
69 distro_features.extend(['ipv4'])
70
71 if 'libc-utmpx' in distro_features and 'libc-utmp' not in distro_features:
72 new_dep = True
73 distro_features.extend(['libc-utmp'])
74
75 if 'libc-posix-regexp-glibc' in distro_features and 'libc-posix-regexp' not in distro_features:
76 new_dep = True
77 distro_features.extend(['libc-posix-regexp'])
78
79 if 'libc-posix-wchar-io' in distro_features and 'libc-posix-clang-wchar' not in distro_features:
80 new_dep = True
81 distro_features.extend(['libc-posix-clang-wchar'])
82
13# Map distro features to eglibc options settings 83# Map distro features to eglibc options settings
14def features_to_eglibc_settings(d): 84def features_to_eglibc_settings(d):
15 cnf = ([]) 85 cnf = ([])
16 distro_features = (bb.data.getVar('DISTRO_FEATURES', d, True) or '').split() 86 distro_features = (bb.data.getVar('DISTRO_FEATURES', d, True) or '').split()
87
88 distro_features_check_deps(distro_features)
89
17 eglibc_cfg('ipv6', distro_features, 'OPTION_EGLIBC_ADVANCED_INET6', cnf) 90 eglibc_cfg('ipv6', distro_features, 'OPTION_EGLIBC_ADVANCED_INET6', cnf)
18 eglibc_cfg('libc-backtrace', distro_features, 'OPTION_EGLIBC_BACKTRACE', cnf) 91 eglibc_cfg('libc-backtrace', distro_features, 'OPTION_EGLIBC_BACKTRACE', cnf)
19 eglibc_cfg('libc-big-macros', distro_features, 'OPTION_EGLIBC_BIG_MACROS', cnf) 92 eglibc_cfg('libc-big-macros', distro_features, 'OPTION_EGLIBC_BIG_MACROS', cnf)
@@ -31,7 +104,7 @@ def features_to_eglibc_settings(d):
31 eglibc_cfg('libc-ftraverse', distro_features, 'OPTION_EGLIBC_FTRAVERSE', cnf) 104 eglibc_cfg('libc-ftraverse', distro_features, 'OPTION_EGLIBC_FTRAVERSE', cnf)
32 eglibc_cfg('libc-getlogin', distro_features, 'OPTION_EGLIBC_GETLOGIN', cnf) 105 eglibc_cfg('libc-getlogin', distro_features, 'OPTION_EGLIBC_GETLOGIN', cnf)
33 eglibc_cfg('libc-idn', distro_features, 'OPTION_EGLIBC_IDN', cnf) 106 eglibc_cfg('libc-idn', distro_features, 'OPTION_EGLIBC_IDN', cnf)
34 eglibc_cfg('libc-inet', distro_features, 'OPTION_EGLIBC_INET', cnf) 107 eglibc_cfg('ipv4', distro_features, 'OPTION_EGLIBC_INET', cnf)
35 eglibc_cfg('libc-inet-anl', distro_features, 'OPTION_EGLIBC_INET_ANL', cnf) 108 eglibc_cfg('libc-inet-anl', distro_features, 'OPTION_EGLIBC_INET_ANL', cnf)
36 eglibc_cfg('libc-libm', distro_features, 'OPTION_EGLIBC_LIBM', cnf) 109 eglibc_cfg('libc-libm', distro_features, 'OPTION_EGLIBC_LIBM', cnf)
37 eglibc_cfg('libc-libm-big', distro_features, 'OPTION_EGLIBC_LIBM_BIG', cnf) 110 eglibc_cfg('libc-libm-big', distro_features, 'OPTION_EGLIBC_LIBM_BIG', cnf)