1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-28 10:46:15 +01:00

- added: missing last parts of Cross Development support

* although other targets do work, only activated arm and sh4 targets for Cross Build
   * powerpc could also be used for Cross Build, but uses Native Build atm
   * thes limited switching on of Cross Build is due to a new interface for workers that will handle workers with *super capabilites* in the future.
   * then you can configure Cross Build at configure/runtime, not by changing the code
This commit is contained in:
Martin Mohring 2008-11-22 16:38:40 +00:00
parent 8383e9e895
commit 61740adee9

View File

@ -31,14 +31,21 @@ change_personality = {
's390': 's390', 's390': 's390',
} }
change_personality_cross = {
'armv4l': ' ',
'armv5el': ' ',
'sh4': ' ',
}
can_also_build = { can_also_build = {
'armv4l': [ 'armv4l' ], 'armv4l': [ 'armv4l' ],
'armv5el':[ 'armv4l', 'armv5el' ], 'armv5el':[ 'armv4l', 'armv5el' ],
'x86_64': ['i686', 'i586', 'i386'],
'i686': ['i586'],
'i386': ['i586'],
'ppc64': ['ppc'],
's390x': ['s390' ], 's390x': ['s390' ],
'ppc64': [ 'ppc', 'ppc64', ],
'i386': [ 'i586', 'armv4l', 'armv5el', 'sh4' ],
'i586': [ 'i386', 'armv4l', 'armv5el', 'sh4' ],
'i686': [ 'i586', 'armv4l', 'armv5el', 'sh4' ],
'x86_64': ['i686', 'i586', 'i386', 'armv4l', 'armv5el', 'sh4' ],
} }
# real arch of this machine # real arch of this machine
@ -235,6 +242,7 @@ def main(opts, argv):
repo = argv[0] repo = argv[0]
arch = argv[1] arch = argv[1]
build_descr = argv[2] build_descr = argv[2]
crossbuild = False
build_type = os.path.splitext(build_descr)[1][1:] build_type = os.path.splitext(build_descr)[1][1:]
if build_type not in ['spec', 'dsc', 'kiwi']: if build_type not in ['spec', 'dsc', 'kiwi']:
@ -404,6 +412,23 @@ def main(opts, argv):
print 'Running build' print 'Running build'
# check for cross-build
if hostarch == 'x86_64':
if bi.buildarch == 'armv4l':
crossbuild = True
if bi.buildarch == 'armv5el':
crossbuild = True
if bi.buildarch == 'sh4':
crossbuild = True
if hostarch == 'i586':
if bi.buildarch == 'armv4l':
crossbuild = True
if bi.buildarch == 'armv5el':
crossbuild = True
if bi.buildarch == 'sh4':
crossbuild = True
cmd = '%s --root=%s --rpmlist=%s --dist=%s %s %s' \ cmd = '%s --root=%s --rpmlist=%s --dist=%s %s %s' \
% (config['build-cmd'], % (config['build-cmd'],
config['build-root'], config['build-root'],
@ -416,12 +441,16 @@ def main(opts, argv):
tmpl = '%s \'%s\'' tmpl = '%s \'%s\''
else: else:
tmpl = '%s %s' tmpl = '%s %s'
cmd = tmpl % (config['su-wrapper'], cmd)
# change personality, if needed # change personality, if needed
cmd = tmpl % (config['su-wrapper'], cmd)
if crossbuild == False:
if hostarch != bi.buildarch: if hostarch != bi.buildarch:
cmd = change_personality[bi.buildarch] + ' ' + cmd cmd = change_personality[bi.buildarch] + ' ' + cmd
if crossbuild == True:
cmd = change_personality_cross[bi.buildarch] + ' ' + cmd + ' --arch=%s' % (bi.buildarch)
print cmd print cmd
rc = subprocess.call(cmd, shell=True) rc = subprocess.call(cmd, shell=True)
if rc: if rc: