Removed hard coded values of toolchain and gcc cpu flags

This commit is contained in:
Amit Mahajan
2009-10-27 15:35:37 +05:30
parent 2b29170633
commit 91c617d0b2
26 changed files with 162 additions and 89 deletions

View File

@@ -52,9 +52,24 @@ class Container:
class configuration:
def __init__(self):
# Mapping between platform selected and gcc flags for it
self.cpu_to_gcc_flag = (['PB926', 'arm926ej-s'],
['CORTEXA8', 'cortex-a8'],
['ARM11MPCORE', 'mpcore'],
['CORTEXA9', 'cortex-a9'],
['ARM1136', 'arm1136jf-s'],
['ARM1176', '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
self.gcc_cpu_flag = None
self.user_toolchain = None
self.kernel_toolchain = None
self.all = []
self.containers = []
self.ncontainers = 0
@@ -72,10 +87,17 @@ 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):
@@ -88,6 +110,9 @@ class configuration:
if name[:len("CONFIG_PLATFORM_")] == "CONFIG_PLATFORM_":
parts = name.split("_", 3)
self.platform = parts[2].lower()
for i in self.cpu_to_gcc_flag:
if i[0] == parts[2]:
self.gcc_cpu_flag = i[1]
# Extract number of containers
def get_ncontainers(self, name, val):

View File

@@ -7,3 +7,4 @@ def conv_hex(val):
if hexval[-1:] == 'L':
hexval = hexval[:-1]
return hexval