# HG changeset patch # User "Yann E. MORIN" # Date 1269857218 -7200 # Node ID 89f16f038b9213a212a063880524d5ebcdf669f1 # Parent dc39960ecfd221f2ab921483233caa8f8785dc51 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 -r dc39960ecfd2 -r 89f16f038b92 config/config.mk --- a/config/config.mk Mon Mar 29 10:03:29 2010 +0200 +++ b/config/config.mk Mon Mar 29 12:06:58 2010 +0200 @@ -66,7 +66,8 @@ # $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 @@ 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 @@ 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 @@ # 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 -r dc39960ecfd2 -r 89f16f038b92 config/global/ct-behave.in --- a/config/global/ct-behave.in Mon Mar 29 10:03:29 2010 +0200 +++ b/config/global/ct-behave.in Mon Mar 29 12:06:58 2010 +0200 @@ -11,6 +11,22 @@ 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"