summaryrefslogtreecommitdiff
path: root/meta/recipes-core/eglibc/eglibc-options.inc
diff options
context:
space:
mode:
authorKang Kai <kai.kang@windriver.com>2011-06-07 16:16:43 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-14 14:37:31 +0100
commit022ca1d1357caafdfe23aa9ab82f90ba89b6942b (patch)
tree028c6037cc51e8ecd69e75e29075582f707454ba /meta/recipes-core/eglibc/eglibc-options.inc
parent0596f6a3c3f901ba5051ff233a793474194d5de5 (diff)
downloadopenembedded-core-022ca1d1357caafdfe23aa9ab82f90ba89b6942b.tar.gz
openembedded-core-022ca1d1357caafdfe23aa9ab82f90ba89b6942b.tar.bz2
openembedded-core-022ca1d1357caafdfe23aa9ab82f90ba89b6942b.zip
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. Signed-off-by: Kang Kai <kai.kang@windriver.com>
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-options.inc')
-rw-r--r--meta/recipes-core/eglibc/eglibc-options.inc62
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 @@
+def eglibc_cfg(feature, features, tokens, cnf):
+ if type(tokens) == type(""):
+ tokens = [tokens]
+ if type(features) == type([]) and feature in features:
+ cnf.extend([token + ' = y' for token in tokens])
+ else:
+ for token in tokens:
+ cnf.extend([token + ' = n'])
+ if token == 'OPTION_EGLIBC_NSSWITCH':
+ cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${S}/nss/nsswitch.conf"])
+ cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${S}/nss/fixed-nsswitch.functions"])
+
+# Map distro features to eglibc options settings
+def features_to_eglibc_settings(d):
+ cnf = ([])
+ distro_features = (bb.data.getVar('DISTRO_FEATURES', d, True) or '').split()
+ eglibc_cfg('ipv6', distro_features, 'OPTION_EGLIBC_ADVANCED_INET6', cnf)
+ eglibc_cfg('libc-backtrace', distro_features, 'OPTION_EGLIBC_BACKTRACE', cnf)
+ eglibc_cfg('libc-big-macros', distro_features, 'OPTION_EGLIBC_BIG_MACROS', cnf)
+ eglibc_cfg('libc-bsd', distro_features, 'OPTION_EGLIBC_BSD', cnf)
+ eglibc_cfg('libc-cxx-tests', distro_features, 'OPTION_EGLIBC_CXX_TESTS', cnf)
+ eglibc_cfg('libc-catgets', distro_features, 'OPTION_EGLIBC_CATGETS', cnf)
+ eglibc_cfg('libc-charsets', distro_features, 'OPTION_EGLIBC_CHARSETS', cnf)
+ eglibc_cfg('libc-crypt', distro_features, 'OPTION_EGLIBC_CRYPT', cnf)
+ eglibc_cfg('libc-crypt-ufc', distro_features, 'OPTION_EGLIBC_CRYPT_UFC', cnf)
+ eglibc_cfg('libc-db-aliases', distro_features, 'OPTION_EGLIBC_DB_ALIASES', cnf)
+ eglibc_cfg('libc-envz', distro_features, 'OPTION_EGLIBC_ENVZ', cnf)
+ eglibc_cfg('libc-fcvt', distro_features, 'OPTION_EGLIBC_FCVT', cnf)
+ eglibc_cfg('libc-fmtmsg', distro_features, 'OPTION_EGLIBC_FMTMSG', cnf)
+ eglibc_cfg('libc-fstab', distro_features, 'OPTION_EGLIBC_FSTAB', cnf)
+ eglibc_cfg('libc-ftraverse', distro_features, 'OPTION_EGLIBC_FTRAVERSE', cnf)
+ eglibc_cfg('libc-getlogin', distro_features, 'OPTION_EGLIBC_GETLOGIN', cnf)
+ eglibc_cfg('libc-idn', distro_features, 'OPTION_EGLIBC_IDN', cnf)
+ eglibc_cfg('libc-inet', distro_features, 'OPTION_EGLIBC_INET', cnf)
+ eglibc_cfg('libc-inet-anl', distro_features, 'OPTION_EGLIBC_INET_ANL', cnf)
+ eglibc_cfg('libc-libm', distro_features, 'OPTION_EGLIBC_LIBM', cnf)
+ eglibc_cfg('libc-libm-big', distro_features, 'OPTION_EGLIBC_LIBM_BIG', cnf)
+ eglibc_cfg('libc-locales', distro_features, 'OPTION_EGLIBC_LOCALES', cnf)
+ eglibc_cfg('libc-locale-code', distro_features, 'OPTION_EGLIBC_LOCALE_CODE', cnf)
+ eglibc_cfg('libc-memusage', distro_features, 'OPTION_EGLIBC_MEMUSAGE', cnf)
+ eglibc_cfg('libc-nis', distro_features, 'OPTION_EGLIBC_NIS', cnf)
+ eglibc_cfg('libc-nsswitch', distro_features, 'OPTION_EGLIBC_NSSWITCH', cnf)
+ eglibc_cfg('libc-rcmd', distro_features, 'OPTION_EGLIBC_RCMD', cnf)
+ eglibc_cfg('libc-rtld-debug', distro_features, 'OPTION_EGLIBC_RTLD_DEBUG', cnf)
+ eglibc_cfg('libc-spawn', distro_features, 'OPTION_EGLIBC_SPAWN', cnf)
+ eglibc_cfg('libc-streams', distro_features, 'OPTION_EGLIBC_STREAMS', cnf)
+ eglibc_cfg('libc-sunrpc', distro_features, 'OPTION_EGLIBC_SUNRPC', cnf)
+ eglibc_cfg('libc-utmp', distro_features, 'OPTION_EGLIBC_UTMP', cnf)
+ eglibc_cfg('libc-utmpx', distro_features, 'OPTION_EGLIBC_UTMPX', cnf)
+ eglibc_cfg('libc-wordexp', distro_features, 'OPTION_EGLIBC_WORDEXP', cnf)
+ eglibc_cfg('libc-posix-clang-wchar', distro_features, 'OPTION_POSIX_C_LANG_WIDE_CHAR', cnf)
+ eglibc_cfg('libc-posix-regexp', distro_features, 'OPTION_POSIX_REGEXP', cnf)
+ eglibc_cfg('libc-posix-regexp-glibc', distro_features, 'OPTION_POSIX_REGEXP_GLIBC', cnf)
+ eglibc_cfg('libc-posix-wchar-io', distro_features, 'OPTION_POSIX_WIDE_CHAR_DEVICE_IO', cnf)
+
+ # try to fix disable charsets/locales/locale-code compile fail
+ if 'libc-charsets' in distro_features and 'libc-locales' in distro_features and 'libc-locale-code' in distro_features:
+ bb.data.setVar('PACKAGE_NO_GCONV', '0', d)
+ else:
+ bb.data.setVar('PACKAGE_NO_GCONV', '1', d)
+
+ return "\n".join(cnf)