| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #!/usr/bin/env python3
- import multiprocessing
- import os
- import subprocess
- import time
- import common
- parser = common.get_argparse()
- common.add_build_arguments(parser)
- parser.add_argument(
- 'extra_config_args',
- default=[],
- metavar='extra-config-args',
- nargs='*'
- )
- args = common.setup(parser)
- if args.clean:
- common.rmrf(common.qemu_build_dir)
- else:
- start_time = time.time()
- os.makedirs(common.qemu_build_dir, exist_ok=True)
- subprocess.check_call(
- [
- 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,
- cwd=common.qemu_build_dir
- )
- assert common.run_cmd(
- [
- 'make',
- # TODO factor with build.
- '-j', str(multiprocessing.cpu_count()),
- ],
- cwd=common.qemu_build_dir,
- extra_env={'PATH': common.ccache_dir + ':' + os.environ['PATH']},
- ) == 0
- end_time = time.time()
- common.print_time(end_time - start_time)
|