From b8d189b2967843015376d5696b244958cba44202 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 5 Oct 2008 15:32:00 +0000 Subject: 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(-) diff --git a/config/arch/alpha.in b/config/arch/alpha.in new file mode 100644 index 0000000..cf8157a --- /dev/null +++ b/config/arch/alpha.in @@ -0,0 +1,62 @@ +# Alpha specific configuration file + +config ARCH_alpha + select ARCH_SUPPORT_CPU + select ARCH_SUPPORT_TUNE + help + The Alpha architecture. + +choice + bool + prompt "Variant" + +config ARCH_ALPHA_EV4 + bool + prompt "EV4" + +config ARCH_ALPHA_EV45 + bool + prompt "EV45" + +config ARCH_ALPHA_EV5 + bool + prompt "EV5" + +config ARCH_ALPHA_EV56 + bool + prompt "EV56" + +config ARCH_ALPHA_EV6 + bool + prompt "EV6" + +config ARCH_ALPHA_EV67 + bool + prompt "EV67" + +endchoice + +config ARCH_ALPHA_VARIANT + string + default "ev4" if ARCH_ALPHA_EV4 + default "ev45" if ARCH_ALPHA_EV45 + default "ev5" if ARCH_ALPHA_EV5 + default "ev56" if ARCH_ALPHA_EV56 + default "ev6" if ARCH_ALPHA_EV6 + default "ev67" if ARCH_ALPHA_EV67 + +config ARCH_CPU + default "ev4" if ARCH_ALPHA_EV4 + default "ev45" if ARCH_ALPHA_EV45 + default "ev5" if ARCH_ALPHA_EV5 + default "ev56" if ARCH_ALPHA_EV56 + default "ev6" if ARCH_ALPHA_EV6 + default "ev67" if ARCH_ALPHA_EV67 + +config ARCH_TUNE + default "ev4" if ARCH_ALPHA_EV4 + default "ev45" if ARCH_ALPHA_EV45 + default "ev5" if ARCH_ALPHA_EV5 + default "ev56" if ARCH_ALPHA_EV56 + default "ev6" if ARCH_ALPHA_EV6 + default "ev67" if ARCH_ALPHA_EV67 diff --git a/config/arch/alpha/config.in b/config/arch/alpha/config.in deleted file mode 100644 index cf8157a..0000000 --- a/config/arch/alpha/config.in +++ /dev/null @@ -1,62 +0,0 @@ -# Alpha specific configuration file - -config ARCH_alpha - select ARCH_SUPPORT_CPU - select ARCH_SUPPORT_TUNE - help - The Alpha architecture. - -choice - bool - prompt "Variant" - -config ARCH_ALPHA_EV4 - bool - prompt "EV4" - -config ARCH_ALPHA_EV45 - bool - prompt "EV45" - -config ARCH_ALPHA_EV5 - bool - prompt "EV5" - -config ARCH_ALPHA_EV56 - bool - prompt "EV56" - -config ARCH_ALPHA_EV6 - bool - prompt "EV6" - -config ARCH_ALPHA_EV67 - bool - prompt "EV67" - -endchoice - -config ARCH_ALPHA_VARIANT - string - default "ev4" if ARCH_ALPHA_EV4 - default "ev45" if ARCH_ALPHA_EV45 - default "ev5" if ARCH_ALPHA_EV5 - default "ev56" if ARCH_ALPHA_EV56 - default "ev6" if ARCH_ALPHA_EV6 - default "ev67" if ARCH_ALPHA_EV67 - -config ARCH_CPU - default "ev4" if ARCH_ALPHA_EV4 - default "ev45" if ARCH_ALPHA_EV45 - default "ev5" if ARCH_ALPHA_EV5 - default "ev56" if ARCH_ALPHA_EV56 - default "ev6" if ARCH_ALPHA_EV6 - default "ev67" if ARCH_ALPHA_EV67 - -config ARCH_TUNE - default "ev4" if ARCH_ALPHA_EV4 - default "ev45" if ARCH_ALPHA_EV45 - default "ev5" if ARCH_ALPHA_EV5 - default "ev56" if ARCH_ALPHA_EV56 - default "ev6" if ARCH_ALPHA_EV6 - default "ev67" if ARCH_ALPHA_EV67 diff --git a/config/arch/alpha/functions b/config/arch/alpha/functions deleted file mode 100644 index ea8ef53..0000000 --- a/config/arch/alpha/functions +++ /dev/null @@ -1,9 +0,0 @@ -# Compute Alpha-specific values - -CT_DoArchValues () { - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_ALPHA_VARIANT}" - - # The kernel ARCH: - CT_KERNEL_ARCH=${CT_ARCH} -} diff --git a/config/arch/arm.in b/config/arch/arm.in new file mode 100644 index 0000000..a3c3d97 --- /dev/null +++ b/config/arch/arm.in @@ -0,0 +1,26 @@ +# ARM specific configuration file + +config ARCH_arm + select ARCH_SUPPORTS_BOTH_ENDIAN + select ARCH_DEFAULT_LE + select ARCH_SUPPORT_ARCH + select ARCH_SUPPORT_CPU + select ARCH_SUPPORT_TUNE + select ARCH_SUPPORT_FPU + help + The ARM architecture, as defined by: + http://www.arm.com/ + +config ARCH_ARM_EABI + bool + prompt "Use EABI" + default n + help + Set up the toolchain so that it generates EABI-compliant binaries. + +config ARCH_ARM_ABI_OK + bool + default y + depends on ! ARCH_ARM_EABI + select ARCH_SUPPORT_ABI + diff --git a/config/arch/arm/config.in b/config/arch/arm/config.in deleted file mode 100644 index a3c3d97..0000000 --- a/config/arch/arm/config.in +++ /dev/null @@ -1,26 +0,0 @@ -# ARM specific configuration file - -config ARCH_arm - select ARCH_SUPPORTS_BOTH_ENDIAN - select ARCH_DEFAULT_LE - select ARCH_SUPPORT_ARCH - select ARCH_SUPPORT_CPU - select ARCH_SUPPORT_TUNE - select ARCH_SUPPORT_FPU - help - The ARM architecture, as defined by: - http://www.arm.com/ - -config ARCH_ARM_EABI - bool - prompt "Use EABI" - default n - help - Set up the toolchain so that it generates EABI-compliant binaries. - -config ARCH_ARM_ABI_OK - bool - default y - depends on ! ARCH_ARM_EABI - select ARCH_SUPPORT_ABI - diff --git a/config/arch/arm/functions b/config/arch/arm/functions deleted file mode 100644 index a1b8542..0000000 --- a/config/arch/arm/functions +++ /dev/null @@ -1,17 +0,0 @@ -# Compute ARM-specific values - -CT_DoArchValues() { - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}${target_endian_eb}" - - # The system part of the tuple: - case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in - *glibc,y) CT_TARGET_SYS=gnueabi;; - uClibc,y) CT_TARGET_SYS=uclibcgnueabi;; - none,y) CT_TARGET_SYS=eabi;; - esac - - # In case we're EABI, do *not* specify any ABI! - # which means, either we do not have an ABI specified, or we're not EABI. - CT_TestOrAbort "Internal error: CT_ARCH_ABI should not be set for EABI build." -z "${CT_ARCH_ABI}" -o -z "${CT_ARCH_ARM_EABI}" -} diff --git a/config/arch/ia64.in b/config/arch/ia64.in new file mode 100644 index 0000000..ad0d9fd --- /dev/null +++ b/config/arch/ia64.in @@ -0,0 +1,8 @@ +# ia64 specific config options +# EXPERIMENTAL + +config ARCH_ia64 + select ARCH_SUPPORTS_BOTH_ENDIAN + help + The ia64 architecture, as defined by: + http://www.intel.com/design/itanium/arch_spec.htm diff --git a/config/arch/ia64/config.in b/config/arch/ia64/config.in deleted file mode 100644 index ad0d9fd..0000000 --- a/config/arch/ia64/config.in +++ /dev/null @@ -1,8 +0,0 @@ -# ia64 specific config options -# EXPERIMENTAL - -config ARCH_ia64 - select ARCH_SUPPORTS_BOTH_ENDIAN - help - The ia64 architecture, as defined by: - http://www.intel.com/design/itanium/arch_spec.htm diff --git a/config/arch/ia64/functions b/config/arch/ia64/functions deleted file mode 100644 index 76f34dd..0000000 --- a/config/arch/ia64/functions +++ /dev/null @@ -1,6 +0,0 @@ -# Compute IA-64-specific values - -CT_DoArchValues() { - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}" -} diff --git a/config/arch/mips.in b/config/arch/mips.in new file mode 100644 index 0000000..0f91e83 --- /dev/null +++ b/config/arch/mips.in @@ -0,0 +1,11 @@ +# MIPS specific config options + +config ARCH_mips + select ARCH_SUPPORTS_BOTH_ENDIAN + select ARCH_DEFAULT_BE + select ARCH_SUPPORT_ARCH + select ARCH_SUPPORT_ABI + select ARCH_SUPPORT_TUNE + help + The MIPS architecture, as defined by: + http://www.mips.com/ diff --git a/config/arch/mips/config.in b/config/arch/mips/config.in deleted file mode 100644 index 0f91e83..0000000 --- a/config/arch/mips/config.in +++ /dev/null @@ -1,11 +0,0 @@ -# MIPS specific config options - -config ARCH_mips - select ARCH_SUPPORTS_BOTH_ENDIAN - select ARCH_DEFAULT_BE - select ARCH_SUPPORT_ARCH - select ARCH_SUPPORT_ABI - select ARCH_SUPPORT_TUNE - help - The MIPS architecture, as defined by: - http://www.mips.com/ diff --git a/config/arch/mips/functions b/config/arch/mips/functions deleted file mode 100644 index 4bf0501..0000000 --- a/config/arch/mips/functions +++ /dev/null @@ -1,12 +0,0 @@ -# Compute IA-64-specific values - -CT_DoArchValues() { - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}${target_endian_el}" - - # Override CFLAGS for endianness: - case "${CT_ARCH_BE},${CT_ARCH_LE}" in - y,) CT_ARCH_ENDIAN_CFLAG="-EB";; - ,y) CT_ARCH_ENDIAN_CFLAG="-EL";; - esac -} diff --git a/config/arch/powerpc.in b/config/arch/powerpc.in new file mode 100644 index 0000000..448065a --- /dev/null +++ b/config/arch/powerpc.in @@ -0,0 +1,25 @@ +# powerpc specific configuration file + +config ARCH_powerpc + select ARCH_SUPPORT_ABI + select ARCH_SUPPORT_CPU + select ARCH_SUPPORT_TUNE + help + The PowerPC architecture, as defined by: + http://www.ibm.com/developerworks/eserver/articles/archguide.html + +config ARCH_POWERPC_SPE + bool + prompt "Enable SPE support" + default n + help + Add support for the Signal Processing Engine. This will set up + the toolchain so that it supports the SPE ABI extensions. This + mainly targets Freescale e500 processors. + + Setting this option will append "spe" to the end of your target + tuple name (e.g., powerpc-e500v2-linux-gnuspe) so that the gcc + configure/build system will know to include SPE ABI support. + It will also automatically add "-mabi=spe -mspe" to your + TARGET_CFLAGS, and "--enable-e500_double" to your CC_EXTRA_CONFIG, + so you do not need to explicitly add them. diff --git a/config/arch/powerpc/config.in b/config/arch/powerpc/config.in deleted file mode 100644 index 448065a..0000000 --- a/config/arch/powerpc/config.in +++ /dev/null @@ -1,25 +0,0 @@ -# powerpc specific configuration file - -config ARCH_powerpc - select ARCH_SUPPORT_ABI - select ARCH_SUPPORT_CPU - select ARCH_SUPPORT_TUNE - help - The PowerPC architecture, as defined by: - http://www.ibm.com/developerworks/eserver/articles/archguide.html - -config ARCH_POWERPC_SPE - bool - prompt "Enable SPE support" - default n - help - Add support for the Signal Processing Engine. This will set up - the toolchain so that it supports the SPE ABI extensions. This - mainly targets Freescale e500 processors. - - Setting this option will append "spe" to the end of your target - tuple name (e.g., powerpc-e500v2-linux-gnuspe) so that the gcc - configure/build system will know to include SPE ABI support. - It will also automatically add "-mabi=spe -mspe" to your - TARGET_CFLAGS, and "--enable-e500_double" to your CC_EXTRA_CONFIG, - so you do not need to explicitly add them. diff --git a/config/arch/powerpc/functions b/config/arch/powerpc/functions deleted file mode 100644 index 94ad11c..0000000 --- a/config/arch/powerpc/functions +++ /dev/null @@ -1,22 +0,0 @@ -# Compute powerpc-specific values - -CT_DoArchValues () { - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}" - - # The kernel ARCH: - CT_KERNEL_ARCH=powerpc - - # Add spe in the tuplet if needed - case "${CT_LIBC},${CT_ARCH_POWERPC_SPE}" in - glibc,|eglibc,) CT_TARGET_SYS=gnu;; - glibc,y|eglibc,y) CT_TARGET_SYS=gnuspe;; - esac - - # Add extra flags for SPE if needed - if [ "${CT_ARCH_POWERPC_SPE}" = "y" ]; then - CT_ARCH_TARGET_CFLAGS="-mabi=spe -mspe" - CT_ARCH_CC_CORE_EXTRA_CONFIG="--enable-e500_double" - CT_ARCH_CC_EXTRA_CONFIG="--enable-e500_double" - fi -} diff --git a/config/arch/sh.in b/config/arch/sh.in new file mode 100644 index 0000000..b21ee1b --- /dev/null +++ b/config/arch/sh.in @@ -0,0 +1,33 @@ +# Super-H specific configuration file +# EXPERIMENTAL + +config ARCH_sh + select ARCH_SUPPORTS_BOTH_ENDIAN + select ARCH_DEFAULT_LE + help + The Super-H architecture, as defined by: + http://www.renesas.com/fmwk.jsp?cnt=superh_family_landing.jsp&fp=/products/mpumcu/superh_family/ + +choice + bool + prompt "Variant" + +config ARCH_SH_SH3 + bool + prompt "sh3" + +config ARCH_SH_SH4 + bool + prompt "sh4" + +config ARCH_SH_SH4A + bool + prompt "sh4a" + +endchoice + +config ARCH_SH_VARIANT + string + default "sh3" if ARCH_SH_SH3 + default "sh4" if ARCH_SH_SH4 + default "sh4a" if ARCH_SH_SH4A diff --git a/config/arch/sh/config.in b/config/arch/sh/config.in deleted file mode 100644 index b21ee1b..0000000 --- a/config/arch/sh/config.in +++ /dev/null @@ -1,33 +0,0 @@ -# Super-H specific configuration file -# EXPERIMENTAL - -config ARCH_sh - select ARCH_SUPPORTS_BOTH_ENDIAN - select ARCH_DEFAULT_LE - help - The Super-H architecture, as defined by: - http://www.renesas.com/fmwk.jsp?cnt=superh_family_landing.jsp&fp=/products/mpumcu/superh_family/ - -choice - bool - prompt "Variant" - -config ARCH_SH_SH3 - bool - prompt "sh3" - -config ARCH_SH_SH4 - bool - prompt "sh4" - -config ARCH_SH_SH4A - bool - prompt "sh4a" - -endchoice - -config ARCH_SH_VARIANT - string - default "sh3" if ARCH_SH_SH3 - default "sh4" if ARCH_SH_SH4 - default "sh4a" if ARCH_SH_SH4A diff --git a/config/arch/sh/functions b/config/arch/sh/functions deleted file mode 100644 index b6dbc02..0000000 --- a/config/arch/sh/functions +++ /dev/null @@ -1,32 +0,0 @@ -# Compute sh-specific values - -CT_DoArchValues () { - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH_SH_VARIANT}${target_endian_eb}" - - # gcc ./configure flags - CT_ARCH_WITH_ARCH= - CT_ARCH_WITH_ABI= - CT_ARCH_WITH_CPU= - CT_ARCH_WITH_TUNE= - CT_ARCH_WITH_FPU= - CT_ARCH_WITH_FLOAT= - - # Endianness stuff - case "${CT_ARCH_BE},${CT_ARCH_LE}" in - y,) CT_ARCH_ENDIAN_CFLAG=-mb;; - ,y) CT_ARCH_ENDIAN_CFLAG=-ml;; - esac - - # CFLAGS - case "${CT_ARCH_SH_VARIENT}" in - sh3) CT_ARCH_ARCH_CFLAG=-m3;; - sh4*) - case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in - y,) CT_ARCH_ARCH_CFLAG="-m4${CT_ARCH_SH_VARIANT##sh?}";; - ,y) CT_ARCH_ARCH_CFLAG="-m4${CT_ARCH_SH_VARIANT##sh?}-nofpu";; - esac - ;; - esac - CT_ARCH_FLOAT_CFLAG= -} diff --git a/config/arch/x86.in b/config/arch/x86.in new file mode 100644 index 0000000..4a5c2f8 --- /dev/null +++ b/config/arch/x86.in @@ -0,0 +1,9 @@ +# x86 specific options + +config ARCH_x86 + select ARCH_SUPPORT_ARCH + select ARCH_SUPPORT_CPU + select ARCH_SUPPORT_TUNE + help + The x86 architecture, as defined by: + http://www.intel.com/ diff --git a/config/arch/x86/config.in b/config/arch/x86/config.in deleted file mode 100644 index 4a5c2f8..0000000 --- a/config/arch/x86/config.in +++ /dev/null @@ -1,9 +0,0 @@ -# x86 specific options - -config ARCH_x86 - select ARCH_SUPPORT_ARCH - select ARCH_SUPPORT_CPU - select ARCH_SUPPORT_TUNE - help - The x86 architecture, as defined by: - http://www.intel.com/ diff --git a/config/arch/x86/functions b/config/arch/x86/functions deleted file mode 100644 index ae67692..0000000 --- a/config/arch/x86/functions +++ /dev/null @@ -1,22 +0,0 @@ -# Compute x86-specific values - -# This one really need a little love! :-( - -CT_DoArchValues() { - # The architecture part of the tuple: - arch="${CT_ARCH_ARCH}" - [ -z "${arch}" ] && arch="${CT_ARCH_TUNE}" - case "${arch}" in - nocona|athlon*64|k8|athlon-fx|opteron) - CT_DoError "Architecture is x86 (32-bit) but selected processor is \"${arch}\" (64-bit)";; - "") CT_TARGET_ARCH=i386;; - i386|i486|i586|i686) CT_TARGET_ARCH="${arch}";; - winchip*) CT_TARGET_ARCH=i486;; - pentium|pentium-mmx|c3*) CT_TARGET_ARCH=i586;; - pentiumpro|pentium*|athlon*) CT_TARGET_ARCH=i686;; - *) CT_TARGET_ARCH=i586;; - esac - - # The kernel ARCH: - CT_KERNEL_ARCH=i386 -} diff --git a/config/arch/x86_64.in b/config/arch/x86_64.in new file mode 100644 index 0000000..83b6e83 --- /dev/null +++ b/config/arch/x86_64.in @@ -0,0 +1,9 @@ +# x86_64 specific options + +config ARCH_x86_64 + select ARCH_SUPPORT_ARCH + select ARCH_SUPPORT_CPU + select ARCH_SUPPORT_TUNE + help + The x86_64 architecture, as defined by: + http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_875_7044,00.html diff --git a/config/arch/x86_64/config.in b/config/arch/x86_64/config.in deleted file mode 100644 index 83b6e83..0000000 --- a/config/arch/x86_64/config.in +++ /dev/null @@ -1,9 +0,0 @@ -# x86_64 specific options - -config ARCH_x86_64 - select ARCH_SUPPORT_ARCH - select ARCH_SUPPORT_CPU - select ARCH_SUPPORT_TUNE - help - The x86_64 architecture, as defined by: - http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_875_7044,00.html diff --git a/config/arch/x86_64/functions b/config/arch/x86_64/functions deleted file mode 100644 index 2626abf..0000000 --- a/config/arch/x86_64/functions +++ /dev/null @@ -1,6 +0,0 @@ -# Compute x86_64-specific values - -CT_DoArchValues() { - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}" -} diff --git a/docs/overview.txt b/docs/overview.txt index f7cf10a..5ff9d61 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 - -The "config.in" file API: + - 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 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 ab70660..38efb40 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/scripts/build/arch/alpha.sh b/scripts/build/arch/alpha.sh new file mode 100644 index 0000000..ea8ef53 --- /dev/null +++ b/scripts/build/arch/alpha.sh @@ -0,0 +1,9 @@ +# Compute Alpha-specific values + +CT_DoArchValues () { + # The architecture part of the tuple: + CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_ALPHA_VARIANT}" + + # The kernel ARCH: + CT_KERNEL_ARCH=${CT_ARCH} +} diff --git a/scripts/build/arch/arm.sh b/scripts/build/arch/arm.sh new file mode 100644 index 0000000..a1b8542 --- /dev/null +++ b/scripts/build/arch/arm.sh @@ -0,0 +1,17 @@ +# Compute ARM-specific values + +CT_DoArchValues() { + # The architecture part of the tuple: + CT_TARGET_ARCH="${CT_ARCH}${target_endian_eb}" + + # The system part of the tuple: + case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in + *glibc,y) CT_TARGET_SYS=gnueabi;; + uClibc,y) CT_TARGET_SYS=uclibcgnueabi;; + none,y) CT_TARGET_SYS=eabi;; + esac + + # In case we're EABI, do *not* specify any ABI! + # which means, either we do not have an ABI specified, or we're not EABI. + CT_TestOrAbort "Internal error: CT_ARCH_ABI should not be set for EABI build." -z "${CT_ARCH_ABI}" -o -z "${CT_ARCH_ARM_EABI}" +} diff --git a/scripts/build/arch/ia64.sh b/scripts/build/arch/ia64.sh new file mode 100644 index 0000000..76f34dd --- /dev/null +++ b/scripts/build/arch/ia64.sh @@ -0,0 +1,6 @@ +# Compute IA-64-specific values + +CT_DoArchValues() { + # The architecture part of the tuple: + CT_TARGET_ARCH="${CT_ARCH}" +} diff --git a/scripts/build/arch/mips.sh b/scripts/build/arch/mips.sh new file mode 100644 index 0000000..4bf0501 --- /dev/null +++ b/scripts/build/arch/mips.sh @@ -0,0 +1,12 @@ +# Compute IA-64-specific values + +CT_DoArchValues() { + # The architecture part of the tuple: + CT_TARGET_ARCH="${CT_ARCH}${target_endian_el}" + + # Override CFLAGS for endianness: + case "${CT_ARCH_BE},${CT_ARCH_LE}" in + y,) CT_ARCH_ENDIAN_CFLAG="-EB";; + ,y) CT_ARCH_ENDIAN_CFLAG="-EL";; + esac +} diff --git a/scripts/build/arch/powerpc.sh b/scripts/build/arch/powerpc.sh new file mode 100644 index 0000000..94ad11c --- /dev/null +++ b/scripts/build/arch/powerpc.sh @@ -0,0 +1,22 @@ +# Compute powerpc-specific values + +CT_DoArchValues () { + # The architecture part of the tuple: + CT_TARGET_ARCH="${CT_ARCH}" + + # The kernel ARCH: + CT_KERNEL_ARCH=powerpc + + # Add spe in the tuplet if needed + case "${CT_LIBC},${CT_ARCH_POWERPC_SPE}" in + glibc,|eglibc,) CT_TARGET_SYS=gnu;; + glibc,y|eglibc,y) CT_TARGET_SYS=gnuspe;; + esac + + # Add extra flags for SPE if needed + if [ "${CT_ARCH_POWERPC_SPE}" = "y" ]; then + CT_ARCH_TARGET_CFLAGS="-mabi=spe -mspe" + CT_ARCH_CC_CORE_EXTRA_CONFIG="--enable-e500_double" + CT_ARCH_CC_EXTRA_CONFIG="--enable-e500_double" + fi +} diff --git a/scripts/build/arch/sh.sh b/scripts/build/arch/sh.sh new file mode 100644 index 0000000..b6dbc02 --- /dev/null +++ b/scripts/build/arch/sh.sh @@ -0,0 +1,32 @@ +# Compute sh-specific values + +CT_DoArchValues () { + # The architecture part of the tuple: + CT_TARGET_ARCH="${CT_ARCH_SH_VARIANT}${target_endian_eb}" + + # gcc ./configure flags + CT_ARCH_WITH_ARCH= + CT_ARCH_WITH_ABI= + CT_ARCH_WITH_CPU= + CT_ARCH_WITH_TUNE= + CT_ARCH_WITH_FPU= + CT_ARCH_WITH_FLOAT= + + # Endianness stuff + case "${CT_ARCH_BE},${CT_ARCH_LE}" in + y,) CT_ARCH_ENDIAN_CFLAG=-mb;; + ,y) CT_ARCH_ENDIAN_CFLAG=-ml;; + esac + + # CFLAGS + case "${CT_ARCH_SH_VARIENT}" in + sh3) CT_ARCH_ARCH_CFLAG=-m3;; + sh4*) + case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in + y,) CT_ARCH_ARCH_CFLAG="-m4${CT_ARCH_SH_VARIANT##sh?}";; + ,y) CT_ARCH_ARCH_CFLAG="-m4${CT_ARCH_SH_VARIANT##sh?}-nofpu";; + esac + ;; + esac + CT_ARCH_FLOAT_CFLAG= +} diff --git a/scripts/build/arch/x86.sh b/scripts/build/arch/x86.sh new file mode 100644 index 0000000..ae67692 --- /dev/null +++ b/scripts/build/arch/x86.sh @@ -0,0 +1,22 @@ +# Compute x86-specific values + +# This one really need a little love! :-( + +CT_DoArchValues() { + # The architecture part of the tuple: + arch="${CT_ARCH_ARCH}" + [ -z "${arch}" ] && arch="${CT_ARCH_TUNE}" + case "${arch}" in + nocona|athlon*64|k8|athlon-fx|opteron) + CT_DoError "Architecture is x86 (32-bit) but selected processor is \"${arch}\" (64-bit)";; + "") CT_TARGET_ARCH=i386;; + i386|i486|i586|i686) CT_TARGET_ARCH="${arch}";; + winchip*) CT_TARGET_ARCH=i486;; + pentium|pentium-mmx|c3*) CT_TARGET_ARCH=i586;; + pentiumpro|pentium*|athlon*) CT_TARGET_ARCH=i686;; + *) CT_TARGET_ARCH=i586;; + esac + + # The kernel ARCH: + CT_KERNEL_ARCH=i386 +} diff --git a/scripts/build/arch/x86_64.sh b/scripts/build/arch/x86_64.sh new file mode 100644 index 0000000..2626abf --- /dev/null +++ b/scripts/build/arch/x86_64.sh @@ -0,0 +1,6 @@ +# Compute x86_64-specific values + +CT_DoArchValues() { + # The architecture part of the tuple: + CT_TARGET_ARCH="${CT_ARCH}" +} diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh index 4b0f524..b0abbf3 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 -- cgit v0.10.2-6-g49f6