From d2fe51a715cf16f94abb23b34b48549b0d63d4e4 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 13 Oct 2008 11:23:51 +0000 Subject: Generate the choice menu for C libraries, the same way arch and kernels are generated. /trunk/kconfig/kconfig.mk | 10 8 2 0 ++++++-- /trunk/scripts/build/libc/glibc.sh | 2 1 1 0 +- /trunk/config/libc/glibc.in | 22 6 16 0 +++++------------- /trunk/config/libc/uClibc.in | 7 6 1 0 +++++- /trunk/config/libc/eglibc.in | 12 11 1 0 +++++++++- /trunk/config/libc.in | 53 4 49 0 +++----------------------------------------- 6 files changed, 36 insertions(+), 70 deletions(-) diff --git a/config/libc.in b/config/libc.in index 27228d1..a373990 100644 --- a/config/libc.in +++ b/config/libc.in @@ -2,10 +2,7 @@ config LIBC string - default "none" if BARE_METAL - default "glibc" if LIBC_GLIBC - default "eglibc" if LIBC_EGLIBC - default "uClibc" if LIBC_UCLIBC + default "none" if BARE_METAL if ! BARE_METAL @@ -25,37 +22,7 @@ config LIBC_VERSION So if you want to be able to re-build your toolchain later, you will have to save your C library tarball by yourself. -choice - bool - prompt "C-library to use:" - default LIBC_GLIBC - -config LIBC_GLIBC - bool - prompt "glibc" - select LIBC_SUPPORT_NPTL - select LIBC_SUPPORT_LINUXTHREADS - -config LIBC_EGLIBC - bool - prompt "eglibc (EXPERIMENTAL)" - select LIBC_SUPPORT_NPTL - select LIBC_SUPPORT_LINUXTHREADS - depends on EXPERIMENTAL - help - EGLIBC (Embedded GLIBC) is a variant of the standard GNU GLIBC - that is designed to work well on embedded systems. EGLIBC strives - to be source and binary compatible with GLIBC. Its goals include - a reduced footprint, configurable components, and improved - cross-compilation support. EGLIBC also includes some embedded ports - (such as e500/spe) that are normally separate add-ons of GLIBC. - -config LIBC_UCLIBC - bool - prompt "uClibc" - select LIBC_SUPPORT_LINUXTHREADS - -endchoice +source config.gen/libc.in comment "Common C library options" @@ -96,23 +63,11 @@ config THREADS_NONE endchoice -if LIBC_GLIBC -source config/libc/glibc.in -endif - -if LIBC_EGLIBC -source config/libc/eglibc.in -endif - # Hack: mconf does not allow to include a file multiple times, # so include glibc and eglibc common options from here, rather # than from each config files. -if LIBC_GLIBC || LIBC_EGLIBC -source config/libc/glibc-eglibc-common.in -endif - -if LIBC_UCLIBC -source config/libc/uClibc.in +if LIBC_glibc || LIBC_eglibc +source config/libc/glibc-eglibc.in-common endif endmenu diff --git a/config/libc/eglibc.in b/config/libc/eglibc.in index bf0e4ed..bcda338 100644 --- a/config/libc/eglibc.in +++ b/config/libc/eglibc.in @@ -1,6 +1,16 @@ +# EXPERIMENTAL # eglibc options -comment "eglibc specific options" +config LIBC_eglibc + select LIBC_SUPPORT_NPTL + select LIBC_SUPPORT_LINUXTHREADS + help + EGLIBC (Embedded GLIBC) is a variant of the standard GNU GLIBC + that is designed to work well on embedded systems. EGLIBC strives + to be source and binary compatible with GLIBC. Its goals include + a reduced footprint, configurable components, and improved + cross-compilation support. EGLIBC also includes some embedded ports + (such as e500/spe) that are normally separate add-ons of GLIBC. choice bool diff --git a/config/libc/glibc-eglibc-common.in b/config/libc/glibc-eglibc-common.in deleted file mode 100644 index 61becfb..0000000 --- a/config/libc/glibc-eglibc-common.in +++ /dev/null @@ -1,169 +0,0 @@ -# This file contains the common configuration options -# that apply to both glibc and eglibc. -# -# Please note: -# the symlink is a hack around the fact that mconf can not parse -# the same file more than once, and errors out if it is the case. -# If mconf is updated to accept multiple inclusion of the same -# file, then the symlink can go (and the includers be updated). - -comment "glibc/eglibc common options" - -config LIBC_GLIBC_EXTRA_CONFIG - string - prompt "extra config" - default "" - help - Extra flags to pass onto ./configure when configuring. - - Eg.: --enable-static-nss - -config LIBC_GLIBC_EXTRA_CFLAGS - string - prompt "extra target CFLAGS" - default "" - help - Extra target CFLAGS to use when building. - -config LIBC_EXTRA_CC_ARGS - string - prompt "gcc extra flags" - default "" - help - Extra flags to pass gcc when building. - - Seldom used, except for sparc64 which seems to need the flag -64 - to be passed onto gcc. - -config LIBC_GLIBC_USE_PORTS - bool - prompt "Use the ports addon" - default n - help - The ports addon contains some architecture ports that are not available - in the official distribution. - - For example, this is the case for ARM with for 2.4 and above. - - Say n only if you're sure that your architecture is in the official - distribution for your chosen version. - -config LIBC_ADDONS - bool - prompt "Pass extra addons list" - default n - help - If you say Y here, you'll be able to give the list of addons you want to - include in your C library. - -config LIBC_ADDONS_LIST - string - prompt "Extra addons" - default "" - depends on LIBC_ADDONS - help - Extra addons to include. Space separated list. - - You need to specify neither linuxthreads nor nptl, as they are added - automagically for you depending on the threading model you choosed - earlier. - - Eg.: crypt (for very old libces) - -if KERNEL_linux - -choice - bool - prompt "Minimum supported kernel version" - default LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS - -config LIBC_GLIBC_KERNEL_VERSION_NONE - bool - prompt "Let ./configure decide" - help - Let ./configure decide what minimum kernel version glibc/eglibc - will be able to run against. - - This will inclde legacy compatibility code for older kernels in - the C library, thus ensuring that it will run on a large number - of old kernels. - - The minimum kernel version supported will be dependent upon the - target you build for. For example: - alpha*-*-linux-gnu Requires Linux 2.6.9 for NPTL - sh[34]-*-linux-gnu Requires Linux 2.6.11 - powerpc* Requires Linux 2.4.19 - arm*-*-linux-*gnueabi Requires Linux 2.6.16 - -config LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS - bool - prompt "Same as kernel headers (default)" - help - Normaly, you'll want glibc/eglibc to run against the same kernel - version as the one used for the headers. - - This is the default. - - If enabled, crosstool-ng will use the chosen version of kernel - headers for the glibc minimum kernel version supported, which is - what gets passed to "--enable-kernel=" when configuring glibc. - - Enabling this will ensure that no legacy compatibility code for - older kernels is built into your C libraries, but it will - be unable to run on kernel versions older than whichever kernel - headers version you've built the toolchain for. - - If you know for sure that your toolchain will never need to build - applications that will run under a kernel version older than your - chosen kernel headers version (CT_KERNEL_VERSION), you can choose - "y" here. - -config LIBC_GLIBC_KERNEL_VERSION_CHOSEN - bool - prompt "Specific kernel version" - help - Specify the earliest Linux kernel version you want glibc to - include support for. This does not have to match the kernel - headers version used for your toolchain. This controls what is - passed to the "--enable-kernel=" option to the glibc configure - script. - - If you want to be able to statically link programs with your - toolchain's C library, make sure this kernel version is lower than - all kernels you wish to support to avoid "FATAL: kernel too old" - errors. The higher the version you specify, the less legacy code - will be built into libc. - - Most people can leave this at the default value of "2.6.9". - -if LIBC_GLIBC_KERNEL_VERSION_CHOSEN - -config LIBC_GLIBC_MIN_KERNEL_VERSION - string - prompt "Minimum kernel version to support" - default "2.6.9" - help - Enter here the lowest kernel version glibc/eglibc will be able to - run against. - - The minimum kernel version supported will be dependent upon the - target you build for. For example: - alpha*-*-linux-gnu Requires Linux 2.6.9 for NPTL - sh[34]-*-linux-gnu Requires Linux 2.6.11 - powerpc* Requires Linux 2.4.19 - arm*-*-linux-*gnueabi Requires Linux 2.6.16 - - Note that no sanity check is performed by crosstool-NG to ensure - that the value you enter here is appropriate for your target. - -endif # LIBC_GLIBC_KERNEL_VERSION_CHOSEN - -endchoice - -config LIBC_GLIBC_MIN_KERNEL - string - default "" if LIBC_GLIBC_KERNEL_VERSION_NONE - default KERNEL_VERSION if LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS - default LIBC_GLIBC_MIN_KERNEL_VERSION if LIBC_GLIBC_USE_HEADERS_MIN_KERNEL - -endif # KERNEL_linux diff --git a/config/libc/glibc-eglibc.in-common b/config/libc/glibc-eglibc.in-common new file mode 100644 index 0000000..61becfb --- /dev/null +++ b/config/libc/glibc-eglibc.in-common @@ -0,0 +1,169 @@ +# This file contains the common configuration options +# that apply to both glibc and eglibc. +# +# Please note: +# the symlink is a hack around the fact that mconf can not parse +# the same file more than once, and errors out if it is the case. +# If mconf is updated to accept multiple inclusion of the same +# file, then the symlink can go (and the includers be updated). + +comment "glibc/eglibc common options" + +config LIBC_GLIBC_EXTRA_CONFIG + string + prompt "extra config" + default "" + help + Extra flags to pass onto ./configure when configuring. + + Eg.: --enable-static-nss + +config LIBC_GLIBC_EXTRA_CFLAGS + string + prompt "extra target CFLAGS" + default "" + help + Extra target CFLAGS to use when building. + +config LIBC_EXTRA_CC_ARGS + string + prompt "gcc extra flags" + default "" + help + Extra flags to pass gcc when building. + + Seldom used, except for sparc64 which seems to need the flag -64 + to be passed onto gcc. + +config LIBC_GLIBC_USE_PORTS + bool + prompt "Use the ports addon" + default n + help + The ports addon contains some architecture ports that are not available + in the official distribution. + + For example, this is the case for ARM with for 2.4 and above. + + Say n only if you're sure that your architecture is in the official + distribution for your chosen version. + +config LIBC_ADDONS + bool + prompt "Pass extra addons list" + default n + help + If you say Y here, you'll be able to give the list of addons you want to + include in your C library. + +config LIBC_ADDONS_LIST + string + prompt "Extra addons" + default "" + depends on LIBC_ADDONS + help + Extra addons to include. Space separated list. + + You need to specify neither linuxthreads nor nptl, as they are added + automagically for you depending on the threading model you choosed + earlier. + + Eg.: crypt (for very old libces) + +if KERNEL_linux + +choice + bool + prompt "Minimum supported kernel version" + default LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS + +config LIBC_GLIBC_KERNEL_VERSION_NONE + bool + prompt "Let ./configure decide" + help + Let ./configure decide what minimum kernel version glibc/eglibc + will be able to run against. + + This will inclde legacy compatibility code for older kernels in + the C library, thus ensuring that it will run on a large number + of old kernels. + + The minimum kernel version supported will be dependent upon the + target you build for. For example: + alpha*-*-linux-gnu Requires Linux 2.6.9 for NPTL + sh[34]-*-linux-gnu Requires Linux 2.6.11 + powerpc* Requires Linux 2.4.19 + arm*-*-linux-*gnueabi Requires Linux 2.6.16 + +config LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS + bool + prompt "Same as kernel headers (default)" + help + Normaly, you'll want glibc/eglibc to run against the same kernel + version as the one used for the headers. + + This is the default. + + If enabled, crosstool-ng will use the chosen version of kernel + headers for the glibc minimum kernel version supported, which is + what gets passed to "--enable-kernel=" when configuring glibc. + + Enabling this will ensure that no legacy compatibility code for + older kernels is built into your C libraries, but it will + be unable to run on kernel versions older than whichever kernel + headers version you've built the toolchain for. + + If you know for sure that your toolchain will never need to build + applications that will run under a kernel version older than your + chosen kernel headers version (CT_KERNEL_VERSION), you can choose + "y" here. + +config LIBC_GLIBC_KERNEL_VERSION_CHOSEN + bool + prompt "Specific kernel version" + help + Specify the earliest Linux kernel version you want glibc to + include support for. This does not have to match the kernel + headers version used for your toolchain. This controls what is + passed to the "--enable-kernel=" option to the glibc configure + script. + + If you want to be able to statically link programs with your + toolchain's C library, make sure this kernel version is lower than + all kernels you wish to support to avoid "FATAL: kernel too old" + errors. The higher the version you specify, the less legacy code + will be built into libc. + + Most people can leave this at the default value of "2.6.9". + +if LIBC_GLIBC_KERNEL_VERSION_CHOSEN + +config LIBC_GLIBC_MIN_KERNEL_VERSION + string + prompt "Minimum kernel version to support" + default "2.6.9" + help + Enter here the lowest kernel version glibc/eglibc will be able to + run against. + + The minimum kernel version supported will be dependent upon the + target you build for. For example: + alpha*-*-linux-gnu Requires Linux 2.6.9 for NPTL + sh[34]-*-linux-gnu Requires Linux 2.6.11 + powerpc* Requires Linux 2.4.19 + arm*-*-linux-*gnueabi Requires Linux 2.6.16 + + Note that no sanity check is performed by crosstool-NG to ensure + that the value you enter here is appropriate for your target. + +endif # LIBC_GLIBC_KERNEL_VERSION_CHOSEN + +endchoice + +config LIBC_GLIBC_MIN_KERNEL + string + default "" if LIBC_GLIBC_KERNEL_VERSION_NONE + default KERNEL_VERSION if LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS + default LIBC_GLIBC_MIN_KERNEL_VERSION if LIBC_GLIBC_USE_HEADERS_MIN_KERNEL + +endif # KERNEL_linux diff --git a/config/libc/glibc.in b/config/libc/glibc.in index 250a56b..12c3192 100644 --- a/config/libc/glibc.in +++ b/config/libc/glibc.in @@ -1,6 +1,11 @@ # glibc options -comment "glibc specific options" +config LIBC_glibc + select LIBC_SUPPORT_NPTL + select LIBC_SUPPORT_LINUXTHREADS + help + The de-facto standard for Linux distributions. + Feature-rich, but large... Most usefull for desktop-like systems. choice bool @@ -60,18 +65,3 @@ config LIBC_VERSION # CT_INSERT_VERSION_STRING_ABOVE # Don't remove above line! -# Please note: This is not used for now (no sh support). -config LIBC_GLIBC_CONFIGPARMS - string -# prompt "Extra config params (READ HELP)" - default "" if ARCH != "sh3" && ARCH != "sh4" - default "no-z-defs=yes" if ARCH = "sh3" || ARCH = "sh4" - help - Some architectures need to set options in the file configparms. - This is the case for sh3/4, which really need to set configparms as of - gcc-3.4/glibc-2.3.2. - - Unless you are building a toolchain for sh3/4, you should leave that empty. - - Note: this is awkward, doesn't work well if you need more than one - line in configparms diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in index a84fae2..c3784f9 100644 --- a/config/libc/uClibc.in +++ b/config/libc/uClibc.in @@ -1,6 +1,11 @@ # uClibc options -comment "uClibc specific options" +config LIBC_uClibc + select LIBC_SUPPORT_LINUXTHREADS + help + The de-facto standard for embeded linux systems. + Highly configurable, thus as feature-rich as you need, without + compromising for size. choice bool diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index cdd8c87..f20f7e7 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -20,13 +20,15 @@ endif # Build a list of all config files ARCH_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/arch/*.in) -KERNEL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/kernel/*.in) +KERNEL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/kernel/*.in) +LIBC_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/libc/*.in) DEBUG_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/debug/*.in) -TOOL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/tools/*.in) +TOOL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/tools/*.in) STATIC_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config -type f -name '*.in') GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/arch.in \ $(CT_TOP_DIR)/config.gen/kernel.in \ + $(CT_TOP_DIR)/config.gen/libc.in \ $(CT_TOP_DIR)/config.gen/tools.in \ $(CT_TOP_DIR)/config.gen/debug.in @@ -35,6 +37,7 @@ CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES) # Build list of items ARCHS = $(patsubst $(CT_LIB_DIR)/config/arch/%.in,%,$(ARCH_CONFIG_FILES)) KERNELS = $(patsubst $(CT_LIB_DIR)/config/kernel/%.in,%,$(KERNEL_CONFIG_FILES)) +LIBCS = $(patsubst $(CT_LIB_DIR)/config/libc/%.in,%,$(LIBC_CONFIG_FILES)) DEBUGS = $(patsubst $(CT_LIB_DIR)/config/debug/%.in,%,$(DEBUG_CONFIG_FILES)) TOOLS = $(patsubst $(CT_LIB_DIR)/config/tools/%.in,%,$(TOOL_CONFIG_FILES)) @@ -96,6 +99,9 @@ $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES) $(CT_TOP_DIR)/config.gen/kernel.in: $(KERNEL_CONFIG_FILES) $(call build_gen_choice_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Target OS,KERNEL,config/kernel,$(KERNELS)) +$(CT_TOP_DIR)/config.gen/libc.in: $(LIBC_CONFIG_FILES) + $(call build_gen_choice_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),C library,LIBC,config/libc,$(LIBCS)) + # Function build_gen_menu_in: # $1 : destination file # $2 : name of entries family (eg. Tools, Debug...) diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 844f949..32e12f6 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -282,7 +282,7 @@ do_libc_start_files() { # Super-H really needs to set configparms as of gcc-3.4/glibc-2.3.2 # note: this is awkward, doesn't work well if you need more than one # line in configparms - echo ${CT_LIBC_GLIBC_CONFIGPARMS} > configparms + [ "${CT_ARCH_sh}" = "y" ] && echo "no-z-defs=yes" > configparms echo "libc_cv_forced_unwind=yes" > config.cache echo "libc_cv_c_cleanup=yes" >> config.cache -- cgit v0.10.2-6-g49f6