sync with https://gitlab.com/kraxel/edk2-build-config/
Signed-off-by: Gerd Hoffmann <[email protected]> --- roms/edk2-build.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/roms/edk2-build.py b/roms/edk2-build.py index e564765aaa71..c4bfbae4cffb 100755 --- a/roms/edk2-build.py +++ b/roms/edk2-build.py @@ -51,7 +51,17 @@ def get_toolchain(cfg, build): return cfg[build]['tool'] if cfg.has_option('global', 'tool'): return cfg['global']['tool'] - return 'GCC5' + return 'GCC' + +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): coredir = get_coredir(cfg) @@ -137,7 +147,7 @@ def build_run(cmdline, name, section, silent = False, nologs = False): print(f'### exit code: {result.returncode}') else: secs = int(time.time() - start) - print(f'### OK ({int(secs/60)}:{secs%60:02d})') + print(f'### OK ({int(secs)}sec)') else: print(cmdline, flush = True) result = subprocess.run(cmdline, check = False) @@ -191,7 +201,10 @@ def build_one(cfg, build, jobs = None, silent = False, nologs = False): if jobs: cmdline += [ '-n', jobs ] for arch in b['arch'].split(): - cmdline += [ '-a', arch ] + if arch == 'HOST': + cmdline += [ '-a', get_hostarch() ] + else: + cmdline += [ '-a', arch ] if 'opts' in b: for name in b['opts'].split(): section = 'opts.' + name @@ -235,7 +248,7 @@ def build_one(cfg, build, jobs = None, silent = False, nologs = False): def build_basetools(silent = False, nologs = False): build_message('building: BaseTools', silent = silent) - basedir = os.environ['EDK_TOOLS_PATH'] + basedir = os.environ['EDK_TOOLS_PATH'] + '/Source/C' cmdline = [ 'make', '-C', basedir ] build_run(cmdline, 'BaseTools', 'build.basetools', silent, nologs) -- 2.52.0
