From 03b27513775808c4908937c61f83a47eeea560a6 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Tue, 3 Nov 2009 03:02:27 +0530 Subject: [PATCH] Asking user for type of toolchain to be used --- config/cml/arm.ruleset | 16 ++++++++++++++++ config/configuration.py | 24 ++++++++++++------------ configure.py | 3 ++- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/config/cml/arm.ruleset b/config/cml/arm.ruleset index dda89ac..3cc9363 100644 --- a/config/cml/arm.ruleset +++ b/config/cml/arm.ruleset @@ -29,6 +29,10 @@ main_menu 'Codezero Microkernel Configurator' arm_menu 'ARM Architecture Configuration' arm_cpu_menu 'ARM CPU type' arm_platform_menu 'ARM Platform Type' +tools 'Tools to be used' +toolchains 'Toolchains to be used for compilation' +TOOLCHAIN_KERNEL 'Toolchain for kernel space compilation' +TOOLCHAIN_USER 'Toolchain for user space compilation' containers_menu 'Container Setup' arch_type 'Main architecture' @@ -79,11 +83,19 @@ menu arm_menu arm_cpu_menu arm_platform_menu +menu tools + toolchains + +menu toolchains + TOOLCHAIN_KERNEL$ + TOOLCHAIN_USER$ + menu main_menu arch_type arm_menu CONTAINERS% containers_menu + tools #############` # RULES # @@ -116,6 +128,10 @@ derive DRIVER_TIMER_SP804 from SUBARCH_V5 or SUBARCH_V6 or SUBARCH_V7 derive DRIVER_IRQ_PL190 from SUBARCH_V5 derive DRIVER_IRQ_GIC from SUBARCH_V6 or SUBARCH_V7 +# Toolchains: +default TOOLCHAIN_KERNEL from 'arm-none-eabi-' +default TOOLCHAIN_USER from 'arm-none-linux-gnueabi-' + prefix CONFIG_ # Checklist for correct CML2 diff --git a/config/configuration.py b/config/configuration.py index ecb2b37..2356764 100644 --- a/config/configuration.py +++ b/config/configuration.py @@ -56,11 +56,6 @@ class configuration: ['PB11MPCORE', 'mpcore'], ['PB1136', 'arm1136jf-s'], ['PB1176', 'arm1176jz-s'],) - - # Mapping between the processor architecture and toolchain - self.toolchain_kernel = (['ARM', 'arm-none-eabi-'],) - self.toolchain_user = (['ARM', 'arm-none-linux-gnueabi-'],) - self.arch = None self.subarch = None self.platform = None @@ -85,17 +80,10 @@ class configuration: return None # Extract architecture from a name value pair - # And based on this define the toolchains to be used def get_arch(self, name, val): if name[:len("CONFIG_ARCH_")] == "CONFIG_ARCH_": parts = name.split("_", 3) self.arch = parts[2].lower() - for i in self.toolchain_kernel: - if i[0] == parts[2]: - self.kernel_toolchain = i[1] - for i in self.toolchain_user: - if i[0] == parts[2]: - self.user_toolchain = i[1] # Extract subarch from a name value pair def get_subarch(self, name, val): @@ -118,6 +106,18 @@ class configuration: parts = name.split("_", 3) self.cpu = parts[2].lower() + # Extract kernel space toolchain from a name value pair + def get_toolchain_kernel(self, name, val): + if name[:len("CONFIG_TOOLCHAIN_KERNEL")] == "CONFIG_TOOLCHAIN_KERNEL": + parts = val.split("\"", 3) + self.kernel_toolchain = parts[1] + + # Extract user space toolchain from a name value pair + def get_toolchain_user(self, name, val): + if name[:len("CONFIG_TOOLCHAIN_USER")] == "CONFIG_TOOLCHAIN_USER": + parts = val.split("\"", 3) + self.user_toolchain = parts[1] + # Extract number of containers def get_ncontainers(self, name, val): if name[:len("CONFIG_CONTAINERS")] == "CONFIG_CONTAINERS": diff --git a/configure.py b/configure.py index 820b804..56f70c3 100755 --- a/configure.py +++ b/configure.py @@ -42,7 +42,8 @@ def cml2_header_to_symbols(cml2_header, config): config.get_cpu(name, value) config.get_ncontainers(name, value) config.get_container_parameters(name, value) - + config.get_toolchain_kernel(name, value) + config.get_toolchain_user(name, value) def cml2_update_config_h(config_h_path, config): with open(config_h_path, "a") as config_h: