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(-)
This commit is contained in:
Yann E. MORIN" 2008-10-05 15:32:00 +00:00
parent 689f4b103c
commit b8d189b296
19 changed files with 35 additions and 41 deletions

View File

@ -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 |
------------------------------------+

View File

@ -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)

View File

@ -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