summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc/eglibc-options.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-options.inc')
-rw-r--r--meta/recipes-core/eglibc/eglibc-options.inc162
1 files changed, 162 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 0000000..0432758
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-options.inc
@@ -0,0 +1,162 @@
1def eglibc_cfg(feature, tokens, cnf):
2 if type(tokens) == type(""):
3 tokens = [tokens]
4 if feature:
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
14def features_to_eglibc_settings(d):
15 cnf = ([])
16
17 ipv4 = base_contains('DISTRO_FEATURES', 'ipv4', True, False, d)
18 ipv6 = base_contains('DISTRO_FEATURES', 'ipv6', True, False, d)
19 libc_backtrace = base_contains('DISTRO_FEATURES', 'libc-backtrace', True, False, d)
20 libc_big_macros = base_contains('DISTRO_FEATURES', 'libc-big-macros', True, False, d)
21 libc_bsd = base_contains('DISTRO_FEATURES', 'libc-bsd', True, False, d)
22 libc_cxx_tests = base_contains('DISTRO_FEATURES', 'libc-cxx-tests', True, False, d)
23 libc_catgets = base_contains('DISTRO_FEATURES', 'libc-catgets', True, False, d)
24 libc_charsets = base_contains('DISTRO_FEATURES', 'libc-charsets', True, False, d)
25 libc_crypt = base_contains('DISTRO_FEATURES', 'libc-crypt', True, False, d)
26 libc_crypt_ufc = base_contains('DISTRO_FEATURES', 'libc-crypt-ufc', True, False, d)
27 libc_db_aliases = base_contains('DISTRO_FEATURES', 'libc-db-aliases', True, False, d)
28 libc_envz = base_contains('DISTRO_FEATURES', 'libc-envz', True, False, d)
29 libc_fcvt = base_contains('DISTRO_FEATURES', 'libc-fcvt', True, False, d)
30 libc_fmtmsg = base_contains('DISTRO_FEATURES', 'libc-fmtmsg', True, False, d)
31 libc_fstab = base_contains('DISTRO_FEATURES', 'libc-fstab', True, False, d)
32 libc_ftraverse = base_contains('DISTRO_FEATURES', 'libc-ftraverse', True, False, d)
33 libc_getlogin = base_contains('DISTRO_FEATURES', 'libc-getlogin', True, False, d)
34 libc_idn = base_contains('DISTRO_FEATURES', 'libc-idn', True, False, d)
35 libc_inet_anl = base_contains('DISTRO_FEATURES', 'libc-inet-anl', True, False, d)
36 libc_libm = base_contains('DISTRO_FEATURES', 'libc-libm', True, False, d)
37 libc_locales = base_contains('DISTRO_FEATURES', 'libc-locales', True, False, d)
38 libc_locale_code = base_contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d)
39 libc_memusage = base_contains('DISTRO_FEATURES', 'libc-memusage', True, False, d)
40 libc_nis = base_contains('DISTRO_FEATURES', 'libc-nis', True, False, d)
41 libc_nsswitch = base_contains('DISTRO_FEATURES', 'libc-nsswitch', True, False, d)
42 libc_rcmd = base_contains('DISTRO_FEATURES', 'libc-rcmd', True, False, d)
43 libc_rtld_debug = base_contains('DISTRO_FEATURES', 'libc-rtld-debug', True, False, d)
44 libc_spawn = base_contains('DISTRO_FEATURES', 'libc-spawn', True, False, d)
45 libc_streams = base_contains('DISTRO_FEATURES', 'libc-streams', True, False, d)
46 libc_sunrpc = base_contains('DISTRO_FEATURES', 'libc-sunrpc', True, False, d)
47 libc_utmp = base_contains('DISTRO_FEATURES', 'libc-utmp', True, False, d)
48 libc_utmpx = base_contains('DISTRO_FEATURES', 'libc-utmpx', True, False, d)
49 libc_wordexp = base_contains('DISTRO_FEATURES', 'libc-wordexp', True, False, d)
50 libc_posix_clang_wchar = base_contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', True, False, d)
51 libc_posix_regexp = base_contains('DISTRO_FEATURES', 'libc-posix-regexp', True, False, d)
52 libc_posix_regexp_glibc = base_contains('DISTRO_FEATURES', 'libc-posix-regexp-glibc', True, False, d)
53 libc_posix_wchar_io = base_contains('DISTRO_FEATURES', 'libc-posix-wchar-io', True, False, d)
54
55 # arrange the dependencies among eglibc configuable options according to file option-groups.def from eglibc source code
56 new_dep = True
57 while new_dep:
58 new_dep = False
59
60 if ipv6 and not ipv4:
61 new_dep = True
62 ipv4 = True
63
64 if ipv4 and not libc_nsswitch:
65 new_dep = True
66 libc_nsswitch = True
67
68 if libc_cxx_tests:
69 if not libc_posix_wchar_io:
70 new_dep = True
71 libc_posix_wchar_io = True
72 if not libc_libm:
73 new_dep = True
74 libc_libm = True
75
76 if libc_catgets and not libc_locale_code:
77 new_dep = True
78 libc_locale_code = True
79
80 if libc_crypt_ufc and not libc_crypt:
81 new_dep = True
82 libc_crypt = True
83
84 if libc_getlogin and not libc_utmp:
85 new_dep = True
86 libc_utmp = True
87
88 if libc_inet_anl and not ipv4:
89 new_dep = True
90 ipv4 = True
91
92 if libc_locale_code and not libc_posix_clang_wchar:
93 new_dep = True
94 libc_posix_clang_wchar = True
95
96 if libc_nis:
97 if not ipv4:
98 new_dep = True
99 ipv4 = True
100 if not libc_sunrpc:
101 new_dep = True
102 libc_sunrpc = True
103
104 if libc_rcmd and not ipv4:
105 new_dep = True
106 ipv4 = True
107
108 if libc_sunrpc and not ipv4:
109 new_dep = True
110 ipv4 = True
111
112 if libc_utmpx and not libc_utmp:
113 new_dep = True
114 libc_utmp = True
115
116 if libc_posix_regexp_glibc and not libc_posix_regexp:
117 new_dep = True
118 libc_posix_regexp = True
119
120 if libc_posix_wchar_io and not libc_posix_clang_wchar:
121 new_dep = True
122 libc_posix_clang_wchar = True
123
124 eglibc_cfg(ipv6, 'OPTION_EGLIBC_ADVANCED_INET6', cnf)
125 eglibc_cfg(libc_backtrace, 'OPTION_EGLIBC_BACKTRACE', cnf)
126 eglibc_cfg(libc_big_macros, 'OPTION_EGLIBC_BIG_MACROS', cnf)
127 eglibc_cfg(libc_bsd, 'OPTION_EGLIBC_BSD', cnf)
128 eglibc_cfg(libc_cxx_tests, 'OPTION_EGLIBC_CXX_TESTS', cnf)
129 eglibc_cfg(libc_catgets, 'OPTION_EGLIBC_CATGETS', cnf)
130 eglibc_cfg(libc_charsets, 'OPTION_EGLIBC_CHARSETS', cnf)
131 eglibc_cfg(libc_crypt, 'OPTION_EGLIBC_CRYPT', cnf)
132 eglibc_cfg(libc_crypt_ufc, 'OPTION_EGLIBC_CRYPT_UFC', cnf)
133 eglibc_cfg(libc_db_aliases, 'OPTION_EGLIBC_DB_ALIASES', cnf)
134 eglibc_cfg(libc_envz, 'OPTION_EGLIBC_ENVZ', cnf)
135 eglibc_cfg(libc_fcvt, 'OPTION_EGLIBC_FCVT', cnf)
136 eglibc_cfg(libc_fmtmsg, 'OPTION_EGLIBC_FMTMSG', cnf)
137 eglibc_cfg(libc_fstab, 'OPTION_EGLIBC_FSTAB', cnf)
138 eglibc_cfg(libc_ftraverse, 'OPTION_EGLIBC_FTRAVERSE', cnf)
139 eglibc_cfg(libc_getlogin, 'OPTION_EGLIBC_GETLOGIN', cnf)
140 eglibc_cfg(libc_idn, 'OPTION_EGLIBC_IDN', cnf)
141 eglibc_cfg(ipv4, 'OPTION_EGLIBC_INET', cnf)
142 eglibc_cfg(libc_inet_anl, 'OPTION_EGLIBC_INET_ANL', cnf)
143 eglibc_cfg(libc_libm, 'OPTION_EGLIBC_LIBM', cnf)
144 eglibc_cfg(libc_locales, 'OPTION_EGLIBC_LOCALES', cnf)
145 eglibc_cfg(libc_locale_code, 'OPTION_EGLIBC_LOCALE_CODE', cnf)
146 eglibc_cfg(libc_memusage, 'OPTION_EGLIBC_MEMUSAGE', cnf)
147 eglibc_cfg(libc_nis, 'OPTION_EGLIBC_NIS', cnf)
148 eglibc_cfg(libc_nsswitch, 'OPTION_EGLIBC_NSSWITCH', cnf)
149 eglibc_cfg(libc_rcmd, 'OPTION_EGLIBC_RCMD', cnf)
150 eglibc_cfg(libc_rtld_debug, 'OPTION_EGLIBC_RTLD_DEBUG', cnf)
151 eglibc_cfg(libc_spawn, 'OPTION_EGLIBC_SPAWN', cnf)
152 eglibc_cfg(libc_streams, 'OPTION_EGLIBC_STREAMS', cnf)
153 eglibc_cfg(libc_sunrpc, 'OPTION_EGLIBC_SUNRPC', cnf)
154 eglibc_cfg(libc_utmp, 'OPTION_EGLIBC_UTMP', cnf)
155 eglibc_cfg(libc_utmpx, 'OPTION_EGLIBC_UTMPX', cnf)
156 eglibc_cfg(libc_wordexp, 'OPTION_EGLIBC_WORDEXP', cnf)
157 eglibc_cfg(libc_posix_clang_wchar, 'OPTION_POSIX_C_LANG_WIDE_CHAR', cnf)
158 eglibc_cfg(libc_posix_regexp, 'OPTION_POSIX_REGEXP', cnf)
159 eglibc_cfg(libc_posix_regexp_glibc, 'OPTION_POSIX_REGEXP_GLIBC', cnf)
160 eglibc_cfg(libc_posix_wchar_io, 'OPTION_POSIX_WIDE_CHAR_DEVICE_IO', cnf)
161
162 return "\n".join(cnf)