Files
linux-kernel-module-cheat/build-qemu
Ciro Santilli 六四事件 法轮功 4b99e522dd common.run_cmd: assert result == 0 by default
2018-10-23 09:58:30 +01:00

56 lines
1.4 KiB
Python
Executable File

#!/usr/bin/env python3
import multiprocessing
import os
import subprocess
import common
class QemuComponent(common.Component):
def add_parser_arguments(self, parser):
parser.add_argument(
'extra_config_args',
default=[],
metavar='extra-config-args',
nargs='*'
)
def do_build(self, args):
build_dir = self.get_build_dir(args)
os.makedirs(build_dir, exist_ok=True)
if args.verbose:
verbose = ['V=1']
else:
verbose = []
common.run_cmd(
[
os.path.join(common.qemu_src_dir, 'configure'),
'--enable-debug',
'--enable-trace-backends=simple',
'--target-list={}-softmmu'.format(args.arch),
'--enable-sdl',
'--with-sdlabi=2.0',
] +
args.extra_config_args,
extra_paths=[common.ccache_dir],
cwd=build_dir
)
common.run_cmd(
(
[
'make',
'-j', str(multiprocessing.cpu_count()),
] +
verbose
),
cwd=build_dir,
extra_paths=[common.ccache_dir],
)
def get_build_dir(self, args):
return common.qemu_build_dir
if __name__ == '__main__':
QemuComponent().build()