summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-06-08 21:26:54 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-06-08 21:26:54 (GMT)
commit43ca5b409558d6eea50c99384b76980ebaf5f52d (patch)
treed5342640753c04d7accf98e64f6f716797857767 /config
parent3c351b899d32c80ab70675b6f6f99f792c72541c (diff)
config: add support for a second part of the generated choices
Some components have configuration options that can depend on generic options, so they should go below those. uClibc for example: - has its own options (wchar...) - uses the generic options (threads...) - if linuxthreads chosen, offers two impls So we need to be able to split the components options in 2, one part that is above the generic options, and one part that ends up below the generic options.
Diffstat (limited to 'config')
-rw-r--r--config/cc.in2
-rw-r--r--config/config.mk40
-rw-r--r--config/kernel.in2
-rw-r--r--config/libc.in2
-rw-r--r--config/target.in2
5 files changed, 38 insertions, 10 deletions
diff --git a/config/cc.in b/config/cc.in
index 8869f03..4afa278 100644
--- a/config/cc.in
+++ b/config/cc.in
@@ -115,4 +115,6 @@ config CC_LANG_OTHERS
endif # ! BARE_METAL
+source "config.gen/cc.in.2"
+
endmenu
diff --git a/config/config.mk b/config/config.mk
index c0247b1..434e463 100644
--- a/config/config.mk
+++ b/config/config.mk
@@ -9,16 +9,20 @@
KCONFIG_TOP = config/config.in
# Build the list of all source config files
-STATIC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(shell find $(CT_LIB_DIR)/config -type f -name '*.in' 2>/dev/null))
+STATIC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(shell find $(CT_LIB_DIR)/config -type f \( -name '*.in' -o -name '*.in.2' \) 2>/dev/null))
# ... and how to access them:
$(STATIC_CONFIG_FILES): config
# Build a list of per-component-type source config files
-ARCH_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in))
-KERNEL_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in))
-CC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in))
-LIBC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in))
-DEBUG_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/debug/*.in))
+ARCH_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in))
+ARCH_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in.2))
+KERNEL_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in))
+KERNEL_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2))
+CC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in))
+CC_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in.2))
+LIBC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in))
+LIBC_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in.2))
+DEBUG_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/debug/*.in))
# Build the list of generated config files
GEN_CONFIG_FILES = config.gen/arch.in \
@@ -117,6 +121,20 @@ define build_gen_choice_in
echo "source \"$${file}\""; \
done; \
) >$(1)
+ $(SILENT)(echo "# $(2) second part options"; \
+ echo "# Generated file, do not edit!!!"; \
+ for entry in $(6); do \
+ file="$(4)/$${entry}.in"; \
+ _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \
+ if [ -f "$${file}.2" ]; then \
+ echo ""; \
+ echo "if $(3)_$${_entry}"; \
+ echo "comment \"$${entry} other options\""; \
+ echo "source \"$${file}.2\""; \
+ echo "endif"; \
+ fi; \
+ done; \
+ ) >$(1).2
endef
# The function 'build_gen_menu_in' builds a menuconfig for each component in
@@ -154,16 +172,18 @@ endef
#-----------------------------------------------------------
# The rules for the generated config files
-config.gen/arch.in: $(ARCH_CONFIG_FILES)
+# WARNING! If a .in file disapears between two runs, that will NOT be detected!
+
+config.gen/arch.in: $(ARCH_CONFIG_FILES) $(ARCH_CONFIG_FILES_2)
$(call build_gen_choice_in,$@,Target Architecture,ARCH,config/arch,Y,$(ARCHS))
-config.gen/kernel.in: $(KERNEL_CONFIG_FILES)
+config.gen/kernel.in: $(KERNEL_CONFIG_FILES) $(KERNEL_CONFIG_FILES_2)
$(call build_gen_choice_in,$@,Target OS,KERNEL,config/kernel,Y,$(KERNELS))
-config.gen/cc.in: $(CC_CONFIG_FILES)
+config.gen/cc.in: $(CC_CONFIG_FILES) $(CC_CONFIG_FILES_2)
$(call build_gen_choice_in,$@,C compiler,CC,config/cc,,$(CCS))
-config.gen/libc.in: $(LIBC_CONFIG_FILES)
+config.gen/libc.in: $(LIBC_CONFIG_FILES) $(LIBC_CONFIG_FILES_2)
$(call build_gen_choice_in,$@,C library,LIBC,config/libc,Y,$(LIBCS))
config.gen/debug.in: $(DEBUG_CONFIG_FILES)
diff --git a/config/kernel.in b/config/kernel.in
index 6dd9c6c..630eae6 100644
--- a/config/kernel.in
+++ b/config/kernel.in
@@ -36,4 +36,6 @@ config SHARED_LIBS
You might not want shared libraries if you're building for a target that
don't support it (maybe some nommu targets, for example, or bare metal).
+source "config.gen/kernel.in.2"
+
endmenu
diff --git a/config/libc.in b/config/libc.in
index de6955e..74bdd1a 100644
--- a/config/libc.in
+++ b/config/libc.in
@@ -63,6 +63,8 @@ config THREADS_NONE
endchoice
+source "config.gen/libc.in.2"
+
endif # ! LIBC_none
endmenu
diff --git a/config/target.in b/config/target.in
index 0a3e1bb..c66ddc2 100644
--- a/config/target.in
+++ b/config/target.in
@@ -311,4 +311,6 @@ config TARGET_LDFLAGS
Leave blank if you don't know better.
+source "config.gen/arch.in.2"
+
endmenu