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

@@ -51,8 +51,11 @@ class AtagsBuilder:
def build_atags(self):
print 'Building Atags for linux kenel...'
# IO files from this build
# TODO: Need to sort this, we cannot call it in global space
# as configuration file is not presnt in beginning
config = configuration_retrieve()
# IO files from this build
os.chdir(LINUX_ATAGSDIR)
if not os.path.exists(self.LINUX_ATAGS_BUILDDIR):
os.makedirs(self.LINUX_ATAGS_BUILDDIR)
@@ -65,7 +68,7 @@ class AtagsBuilder:
with open(self.atags_h_in, 'r') as input:
output.write(input.read() % {'cn' : self.cont_id})
os.system("arm-none-linux-gnueabi-cpp -I%s -P %s > %s" % \
os.system(config.user_toolchain + "cpp -I%s -P %s > %s" % \
(self.LINUX_ATAGS_BUILDDIR, self.atags_lds_in, \
self.atags_lds_out))
@@ -73,7 +76,7 @@ class AtagsBuilder:
with open(self.atags_c_in, 'r') as input:
output.write(input.read() % {'cn' : self.cont_id})
os.system("arm-none-linux-gnueabi-gcc " + \
os.system(config.user_toolchain + "gcc " + \
"-g -ffreestanding -std=gnu99 -Wall -Werror " + \
"-nostdlib -o %s -T%s %s" % \
(self.atags_elf_out, self.atags_lds_out, self.atags_c_out))

View File

@@ -66,7 +66,7 @@ class LinuxUpdateKernel:
break
if flag == 0:
print 'Warning: No match found for the parameter'
#print 'Warning: No match found for the parameter'
return
else:
# Prevent recompilation in case kernel parameter is same
@@ -205,6 +205,10 @@ class LinuxBuilder:
def build_linux(self):
print '\nBuilding the linux kernel...'
# TODO: Need to sort this, we cannot call it in global space
# as configuration file is not presnt in beginning
config = configuration_retrieve()
os.chdir(self.LINUX_KERNELDIR)
if not os.path.exists(self.LINUX_KERNEL_BUILDDIR):
os.makedirs(self.LINUX_KERNEL_BUILDDIR)
@@ -215,7 +219,7 @@ class LinuxBuilder:
os.system("make defconfig ARCH=arm O=" + self.LINUX_KERNEL_BUILDDIR)
os.system("make ARCH=arm " + \
"CROSS_COMPILE=arm-none-linux-gnueabi- O=" + \
"CROSS_COMPILE=" + config.user_toolchain + " O=" + \
self.LINUX_KERNEL_BUILDDIR)
with open(self.linux_h_out, 'w+') as output:
@@ -227,10 +231,10 @@ class LinuxBuilder:
content = input.read() % self.kernel_binary_image
output.write(content)
os.system("arm-none-linux-gnueabi-cpp -I%s -P %s > %s" % \
os.system(config.user_toolchain + "cpp -I%s -P %s > %s" % \
(self.LINUX_KERNEL_BUILDDIR, self.linux_lds_in, \
self.linux_lds_out))
os.system("arm-none-linux-gnueabi-gcc -nostdlib -o %s -T%s %s" % \
os.system(config.user_toolchain + "gcc -nostdlib -o %s -T%s %s" % \
(self.linux_elf_out, self.linux_lds_out, self.linux_S_out))
# Get the kernel image path

View File

@@ -15,7 +15,6 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), PROJRELR
from config.projpaths import *
from config.configuration import *
# Create linux kernel build directory path as:
# conts/linux -> build/cont[0-9]/linux
def source_to_builddir(srcdir, id):
@@ -43,8 +42,11 @@ class RootfsBuilder:
def build_rootfs(self):
print 'Building the root filesystem...'
# IO files from this build
# TODO: Need to sort this, we cannot call it in global space
# as configuration file is not presnt in beginning
config = configuration_retrieve()
# IO files from this build
os.chdir(LINUX_ROOTFSDIR)
if not os.path.exists(self.LINUX_ROOTFS_BUILDDIR):
os.makedirs(self.LINUX_ROOTFS_BUILDDIR)
@@ -53,10 +55,10 @@ class RootfsBuilder:
with open(self.rootfs_h_in, 'r') as input:
output.write(input.read() % {'cn' : self.cont_id})
os.system("arm-none-linux-gnueabi-cpp -I%s -P %s > %s" % \
os.system(config.user_toolchain + "cpp -I%s -P %s > %s" % \
(self.LINUX_ROOTFS_BUILDDIR, self.rootfs_lds_in, \
self.rootfs_lds_out))
os.system("arm-none-linux-gnueabi-gcc " + \
os.system(config.user_toolchain + "gcc " + \
"-nostdlib -o %s -T%s rootfs.S" % (self.rootfs_elf_out, \
self.rootfs_lds_out))
print "Done..."