update build script
This commit is contained in:
parent
994feb5796
commit
766cf0772e
@ -53,6 +53,16 @@ def get_toolchain(cfg, build):
|
|||||||
return cfg['global']['tool']
|
return cfg['global']['tool']
|
||||||
return 'GCC5'
|
return 'GCC5'
|
||||||
|
|
||||||
|
def get_hostarch():
|
||||||
|
mach = os.uname().machine
|
||||||
|
if mach == 'x86_64':
|
||||||
|
return 'X64'
|
||||||
|
if mach == 'aarch64':
|
||||||
|
return 'AARCH64'
|
||||||
|
if mach == 'riscv64':
|
||||||
|
return 'RISCV64'
|
||||||
|
return 'UNKNOWN'
|
||||||
|
|
||||||
def get_version(cfg, silent = False):
|
def get_version(cfg, silent = False):
|
||||||
coredir = get_coredir(cfg)
|
coredir = get_coredir(cfg)
|
||||||
if version_override:
|
if version_override:
|
||||||
@ -191,7 +201,10 @@ def build_one(cfg, build, jobs = None, silent = False, nologs = False):
|
|||||||
if jobs:
|
if jobs:
|
||||||
cmdline += [ '-n', jobs ]
|
cmdline += [ '-n', jobs ]
|
||||||
for arch in b['arch'].split():
|
for arch in b['arch'].split():
|
||||||
cmdline += [ '-a', arch ]
|
if arch == 'HOST':
|
||||||
|
cmdline += [ '-a', get_hostarch() ]
|
||||||
|
else:
|
||||||
|
cmdline += [ '-a', arch ]
|
||||||
if 'opts' in b:
|
if 'opts' in b:
|
||||||
for name in b['opts'].split():
|
for name in b['opts'].split():
|
||||||
section = 'opts.' + name
|
section = 'opts.' + name
|
||||||
@ -362,7 +375,8 @@ def main():
|
|||||||
type = str, action = 'append', metavar = 'DIR',
|
type = str, action = 'append', metavar = 'DIR',
|
||||||
help = 'location(s) of additional packages '
|
help = 'location(s) of additional packages '
|
||||||
'(can be specified multiple times)')
|
'(can be specified multiple times)')
|
||||||
parser.add_argument('-t', '--toolchain', dest = 'toolchain', type = str, metavar = 'NAME',
|
parser.add_argument('-t', '--toolchain', dest = 'toolchain',
|
||||||
|
type = str, metavar = 'NAME',
|
||||||
help = 'tool chain to be used to build edk2')
|
help = 'tool chain to be used to build edk2')
|
||||||
parser.add_argument('--version-override', dest = 'version_override',
|
parser.add_argument('--version-override', dest = 'version_override',
|
||||||
type = str, metavar = 'VERSION',
|
type = str, metavar = 'VERSION',
|
||||||
|
Loading…
Reference in New Issue
Block a user