diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-03-29 12:06:58 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-03-29 12:06:58 +0200 |
commit | eb765a2a46fea273e582cb26720344e8e3e617a9 (patch) | |
tree | e4480322a527384866dab05a9e52f3e21b332426 | |
parent | a5c8cbcff7428af67b0d507df6899eb3cd780595 (diff) | |
download | crosstool-ng-eb765a2a46fea273e582cb26720344e8e3e617a9.tar.gz crosstool-ng-eb765a2a46fea273e582cb26720344e8e3e617a9.tar.bz2 crosstool-ng-eb765a2a46fea273e582cb26720344e8e3e617a9.zip |
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.
-rw-r--r-- | config/config.mk | 18 | ||||
-rw-r--r-- | config/global/ct-behave.in | 16 |
2 files changed, 27 insertions, 7 deletions
diff --git a/config/config.mk b/config/config.mk index f8265b36..09dc12dd 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 f3be63e3..45da2b8d 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" |