Files
linux-kernel-module-cheat/build-qemu
Ciro Santilli 六四事件 法轮功 4a4407e7a8 qemu: update to d8dae268c0a3e4e361002aca3b382fedd77f2567
Now on top of QEMU v4.0.0.

Ha, everything just worked. That wasn't fun!

Fix https://github.com/cirosantilli/linux-kernel-module-cheat/issues/70
2019-05-29 00:00:04 +00:00

59 lines
1.6 KiB
Python
Executable File

#!/usr/bin/env python3
import os
import common
from shell_helpers import LF
class Main(common.BuildCliFunction):
def __init__(self):
super().__init__()
self.add_argument(
'extra_config_args',
default=[],
metavar='extra-config-args',
nargs='*'
)
def build(self):
build_dir = self.get_build_dir()
os.makedirs(build_dir, exist_ok=True)
if self.env['verbose']:
verbose = ['V=1']
else:
verbose = []
if self.env['mode'] == 'userland':
target_list = '{}-linux-user'.format(self.env['arch'])
else:
target_list = '{}-softmmu'.format(self.env['arch'])
self.sh.run_cmd(
[
os.path.join(self.env['qemu_source_dir'], 'configure'), LF,
'--enable-debug', LF,
'--enable-trace-backends=simple', LF,
'--target-list={}'.format(target_list), LF,
'--enable-sdl', LF,
] +
self.sh.add_newlines(self.env['extra_config_args']),
extra_paths=[self.env['ccache_dir']],
cwd=build_dir
)
self.sh.run_cmd(
(
[
'make', LF,
'-j', str(self.env['nproc']), LF,
] +
verbose
),
cwd=build_dir,
extra_paths=[self.env['ccache_dir']],
)
def get_build_dir(self):
return self.env['qemu_build_dir']
if __name__ == '__main__':
Main().cli()