From eb765a2a46fea273e582cb26720344e8e3e617a9 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 29 Mar 2010 12:06:58 +0200 Subject: config: hide arch and kernel selection when used as a backend When used as a backend, it is the responsibility of the upper-layer build system to set the target architecture and kernel. diff --git a/config/config.mk b/config/config.mk index f8265b3..09dc12d 100644 --- a/config/config.mk +++ b/config/config.mk @@ -66,7 +66,8 @@ DEBUGS = $(patsubst config/debug/%.in,%,$(DEBUG_CONFIG_FILES)) # $2 : name for the entries family (eg. Architecture, kernel...) # $3 : prefix for the choice entries (eg. ARCH, KERNEL...) # $4 : base directory containing config files -# $5 : list of config entries (eg. for architectures: "alpha arm ia64"..., +# $5 : generate backend conditionals if Y, don't if anything else +# $6 : list of config entries (eg. for architectures: "alpha arm ia64"..., # and for kernels: "bare-metal linux"...) # Example to build the kernels generated config file: # $(call build_gen_choice_in,config.gen/kernel.in,Target OS,KERNEL,config/kernel,$(KERNELS)) @@ -79,7 +80,7 @@ define build_gen_choice_in echo " bool"; \ echo " prompt \"$(2)\""; \ echo ""; \ - for entry in $(5); do \ + for entry in $(6); do \ file="$(4)/$${entry}.in"; \ _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \ echo "config $(3)_$${_entry}"; \ @@ -89,10 +90,13 @@ define build_gen_choice_in if [ -n "$${dep_val}" ]; then \ echo " $${dep_val#\# }"; \ fi; \ + if [ "$(5)" = "Y" ]; then \ + echo " depends on BACKEND_$(3) = \"$${_entry}\" || ! BACKEND"; \ + fi; \ echo ""; \ done; \ echo "endchoice"; \ - for entry in $(5); do \ + for entry in $(6); do \ file="$(4)/$${entry}.in"; \ _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \ echo ""; \ @@ -145,16 +149,16 @@ endef # The rules for the generated config files config.gen/arch.in: $(ARCH_CONFIG_FILES) - $(call build_gen_choice_in,$@,Target Architecture,ARCH,config/arch,$(ARCHS)) + $(call build_gen_choice_in,$@,Target Architecture,ARCH,config/arch,Y,$(ARCHS)) config.gen/kernel.in: $(KERNEL_CONFIG_FILES) - $(call build_gen_choice_in,$@,Target OS,KERNEL,config/kernel,$(KERNELS)) + $(call build_gen_choice_in,$@,Target OS,KERNEL,config/kernel,Y,$(KERNELS)) config.gen/cc.in: $(CC_CONFIG_FILES) - $(call build_gen_choice_in,$@,C compiler,CC,config/cc,$(CCS)) + $(call build_gen_choice_in,$@,C compiler,CC,config/cc,,$(CCS)) config.gen/libc.in: $(LIBC_CONFIG_FILES) - $(call build_gen_choice_in,$@,C library,LIBC,config/libc,$(LIBCS)) + $(call build_gen_choice_in,$@,C library,LIBC,config/libc,,$(LIBCS)) config.gen/debug.in: $(DEBUG_CONFIG_FILES) $(call build_gen_menu_in,$@,Debug,DEBUG,config/debug,$(DEBUGS)) diff --git a/config/global/ct-behave.in b/config/global/ct-behave.in index f3be63e..45da2b8 100644 --- a/config/global/ct-behave.in +++ b/config/global/ct-behave.in @@ -11,6 +11,22 @@ config BACKEND default y if IS_A_BACKEND = "y" || IS_A_BACKEND = "Y" default n if IS_A_BACKEND != "y" && IS_A_BACKEND != "Y" +config BACKEND_ARCH + string + option env="CT_BACKEND_ARCH" + +if BACKEND && BACKEND_ARCH = "" +comment "ERROR !!! Backend architecture is NOT set !" +endif + +config BACKEND_KERNEL + string + option env="CT_BACKEND_KERNEL" + +if BACKEND && BACKEND_KERNEL = "" +comment "ERROR !!! Backend kernel is NOT set !" +endif + config OBSOLETE bool prompt "Use obsolete features" -- cgit v0.10.2-6-g49f6