From b8d189b2967843015376d5696b244958cba44202 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 5 Oct 2008 15:32:00 +0000 Subject: [PATCH] Separate the architecture config file and function script. /trunk/kconfig/kconfig.mk | 46 23 23 0 +++++++++++++++++++++++----------------------- /trunk/scripts/crosstool.sh | 2 1 1 0 +- /trunk/docs/overview.txt | 28 11 17 0 +++++++++++----------------- 3 files changed, 35 insertions(+), 41 deletions(-) --- config/arch/{alpha/config.in => alpha.in} | 0 config/arch/{arm/config.in => arm.in} | 0 config/arch/{ia64/config.in => ia64.in} | 0 config/arch/{mips/config.in => mips.in} | 0 config/arch/{powerpc/config.in => powerpc.in} | 0 config/arch/{sh/config.in => sh.in} | 0 config/arch/{x86/config.in => x86.in} | 0 config/arch/{x86_64/config.in => x86_64.in} | 0 docs/overview.txt | 28 +++++------ kconfig/kconfig.mk | 46 +++++++++---------- .../functions => scripts/build/arch/alpha.sh | 0 .../functions => scripts/build/arch/arm.sh | 0 .../functions => scripts/build/arch/ia64.sh | 0 .../functions => scripts/build/arch/mips.sh | 0 .../build/arch/powerpc.sh | 0 .../sh/functions => scripts/build/arch/sh.sh | 0 .../functions => scripts/build/arch/x86.sh | 0 .../functions => scripts/build/arch/x86_64.sh | 0 scripts/crosstool.sh | 2 +- 19 files changed, 35 insertions(+), 41 deletions(-) rename config/arch/{alpha/config.in => alpha.in} (100%) rename config/arch/{arm/config.in => arm.in} (100%) rename config/arch/{ia64/config.in => ia64.in} (100%) rename config/arch/{mips/config.in => mips.in} (100%) rename config/arch/{powerpc/config.in => powerpc.in} (100%) rename config/arch/{sh/config.in => sh.in} (100%) rename config/arch/{x86/config.in => x86.in} (100%) rename config/arch/{x86_64/config.in => x86_64.in} (100%) rename config/arch/alpha/functions => scripts/build/arch/alpha.sh (100%) rename config/arch/arm/functions => scripts/build/arch/arm.sh (100%) rename config/arch/ia64/functions => scripts/build/arch/ia64.sh (100%) rename config/arch/mips/functions => scripts/build/arch/mips.sh (100%) rename config/arch/powerpc/functions => scripts/build/arch/powerpc.sh (100%) rename config/arch/sh/functions => scripts/build/arch/sh.sh (100%) rename config/arch/x86/functions => scripts/build/arch/x86.sh (100%) rename config/arch/x86_64/functions => scripts/build/arch/x86_64.sh (100%) diff --git a/config/arch/alpha/config.in b/config/arch/alpha.in similarity index 100% rename from config/arch/alpha/config.in rename to config/arch/alpha.in diff --git a/config/arch/arm/config.in b/config/arch/arm.in similarity index 100% rename from config/arch/arm/config.in rename to config/arch/arm.in diff --git a/config/arch/ia64/config.in b/config/arch/ia64.in similarity index 100% rename from config/arch/ia64/config.in rename to config/arch/ia64.in diff --git a/config/arch/mips/config.in b/config/arch/mips.in similarity index 100% rename from config/arch/mips/config.in rename to config/arch/mips.in diff --git a/config/arch/powerpc/config.in b/config/arch/powerpc.in similarity index 100% rename from config/arch/powerpc/config.in rename to config/arch/powerpc.in diff --git a/config/arch/sh/config.in b/config/arch/sh.in similarity index 100% rename from config/arch/sh/config.in rename to config/arch/sh.in diff --git a/config/arch/x86/config.in b/config/arch/x86.in similarity index 100% rename from config/arch/x86/config.in rename to config/arch/x86.in diff --git a/config/arch/x86_64/config.in b/config/arch/x86_64.in similarity index 100% rename from config/arch/x86_64/config.in rename to config/arch/x86_64.in diff --git a/docs/overview.txt b/docs/overview.txt index f7cf10a9..5ff9d617 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -541,20 +541,14 @@ An architecture is defined by: - a human-readable name, in lower case letters, with numbers as appropriate. The underscore is allowed; space and special characters are not. Eg.: arm, x86_64 - - a directory in "config/arch/" named after the architecture, with the same - letters as above. Eg.: arch/arm, arch/x86_64 - This directory contains the following files, and only those files: - - a configuration file in kconfig syntax, named "config.in", which shall - follow the API defined below. - Eg.: config/arch/arm/config.in - - a function script in bash-3.0 syntax, named "functions", which shall - follow the API defined below. - Eg.: config/arch/arm/functions - - an optional file, named "experimental" (in lower case!), which, if it - is present, means that support for this architecture is EXPERIMENTAL. - Eg.: config/arch/arm/experimental + - a file in "config/arch/", named after the architecture's name, and suffixed + with ".in". + Eg.: config/arch/arm.in + - a file in "scripts/build/arch/", named after the architecture's name, and + suffixed with ".sh". + Eg.: scripts/build/arch/arm.sh -The "config.in" file API: +The architecture's ".in" file API: > the config option "ARCH_%arch%" (where %arch% is to be replaced with the actual architecture name). That config option must have *neither* a type, *nor* a prompt! Also, it can @@ -584,7 +578,7 @@ The "config.in" file API: this, as the architecture name was written all upper case. However, the prefix is unique among architectures, and does not cause harm). -The "functions" file API: +The architecture's ".sh" file API: > the function "CT_DoArchValues" + parameters: none + environment: @@ -656,8 +650,8 @@ The "functions" file API: - default to: - all empty -You can have a look at "config/arch/arm/" for an quite complete example of -what an actual architecture description looks like. +You can have a look at "config/arch/arm.in" and "scripts/build/arch/arm.sh" for +a quite complete example of what an actual architecture description looks like. Kernel specific | ----------------+ @@ -760,7 +754,7 @@ The kernel's ".sh" file API: any name-clashing. You can have a look at "config/kernel/linux.in" and "scripts/build/kernel/linux.sh" -as an example of what a complex kernel description looks like, +as an example of what a complex kernel description looks like. Adding a new version of a component | ------------------------------------+ diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index ab706609..38efb406 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -19,7 +19,7 @@ CFLAGS += -DKBUILD_NO_NLS endif # Build a list of all config files -ARCH_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/arch/*/config.in) +ARCH_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/arch/*.in) KERN_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/kernel/*.in) DEBUG_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/debug/*.in) TOOLS_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/tools/*.in) @@ -33,7 +33,7 @@ GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/arch.in \ CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES) # Build list of items -ARCHS = $(patsubst $(CT_LIB_DIR)/config/arch/%/config.in,%,$(ARCH_CONFIG_FILES)) +ARCHS = $(patsubst $(CT_LIB_DIR)/config/arch/%.in,%,$(ARCH_CONFIG_FILES)) KERNELS = $(patsubst $(CT_LIB_DIR)/config/kernel/%.in,%,$(KERN_CONFIG_FILES)) $(GEN_CONFIG_FILES): $(CT_TOP_DIR)/config.gen \ @@ -44,27 +44,27 @@ $(CT_TOP_DIR)/config.gen: $(KCONFIG_TOP) $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES) @echo ' IN config.gen/arch.in' - @(echo "# Architectures menu"; \ - echo "# Generated file, do not edit!!!"; \ - echo ""; \ - for arch in $(ARCHS); do \ - _arch=$$(echo "$${arch}" |sed -r -s -e 's/[-.+]/_/g;'); \ - echo "config ARCH_$${_arch}"; \ - echo " bool"; \ - printf " prompt \"$${arch}"; \ - if grep -E '^# +EXPERIMENTAL$$' config/arch/$${arch}/config.in >/dev/null 2>&1; then \ - echo " (EXPERIMENTAL)\""; \ - echo " depends on EXPERIMENTAL"; \ - else \ - echo "\""; \ - fi; \ - echo "if ARCH_$${_arch}"; \ - echo "config ARCH"; \ - echo " default \"$${arch}\" if ARCH_$${_arch}"; \ - echo "source config/arch/$${arch}/config.in"; \ - echo "endif"; \ - echo ""; \ - done; \ + @(echo "# Architectures menu"; \ + echo "# Generated file, do not edit!!!"; \ + echo ""; \ + for arch in $(ARCHS); do \ + _arch=$$(echo "$${arch}" |sed -r -s -e 's/[-.+]/_/g;'); \ + echo "config ARCH_$${_arch}"; \ + echo " bool"; \ + printf " prompt \"$${arch}"; \ + if grep -E '^# +EXPERIMENTAL$$' config/arch/$${arch}.in >/dev/null 2>&1; then \ + echo " (EXPERIMENTAL)\""; \ + echo " depends on EXPERIMENTAL"; \ + else \ + echo "\""; \ + fi; \ + echo "if ARCH_$${_arch}"; \ + echo "config ARCH"; \ + echo " default \"$${arch}\" if ARCH_$${_arch}"; \ + echo "source config/arch/$${arch}.in"; \ + echo "endif"; \ + echo ""; \ + done; \ ) >$@ $(CT_TOP_DIR)/config.gen/kernel.in: $(KERN_CONFIG_FILES) diff --git a/config/arch/alpha/functions b/scripts/build/arch/alpha.sh similarity index 100% rename from config/arch/alpha/functions rename to scripts/build/arch/alpha.sh diff --git a/config/arch/arm/functions b/scripts/build/arch/arm.sh similarity index 100% rename from config/arch/arm/functions rename to scripts/build/arch/arm.sh diff --git a/config/arch/ia64/functions b/scripts/build/arch/ia64.sh similarity index 100% rename from config/arch/ia64/functions rename to scripts/build/arch/ia64.sh diff --git a/config/arch/mips/functions b/scripts/build/arch/mips.sh similarity index 100% rename from config/arch/mips/functions rename to scripts/build/arch/mips.sh diff --git a/config/arch/powerpc/functions b/scripts/build/arch/powerpc.sh similarity index 100% rename from config/arch/powerpc/functions rename to scripts/build/arch/powerpc.sh diff --git a/config/arch/sh/functions b/scripts/build/arch/sh.sh similarity index 100% rename from config/arch/sh/functions rename to scripts/build/arch/sh.sh diff --git a/config/arch/x86/functions b/scripts/build/arch/x86.sh similarity index 100% rename from config/arch/x86/functions rename to scripts/build/arch/x86.sh diff --git a/config/arch/x86_64/functions b/scripts/build/arch/x86_64.sh similarity index 100% rename from config/arch/x86_64/functions rename to scripts/build/arch/x86_64.sh diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh index 4b0f524c..b0abbf37 100755 --- a/scripts/crosstool.sh +++ b/scripts/crosstool.sh @@ -57,7 +57,7 @@ GREP_OPTIONS= CT_DoLog INFO "Building environment variables" # Parse architecture-specific functions -. "${CT_LIB_DIR}/config/arch/${CT_ARCH}/functions" +. "${CT_LIB_DIR}/scripts/build/arch/${CT_ARCH}.sh" # Target tuple: CT_TARGET needs a little love: CT_DoBuildTargetTuple