userland: make --host awesome

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-10-31 19:00:05 +00:00
parent 8e07146606
commit 6bfb5221d1
6 changed files with 87 additions and 23 deletions

View File

@@ -17,6 +17,15 @@ class UserlandComponent(common.Component):
help='''\
Indicate that a given package is present in the root filesystem, which
allows us to build examples that rely on it.
''',
)
parser.add_argument(
'--host',
action='store_true',
default=False,
help='''\
Build the userland programs for the host instead of guest.
Use the host packaged cross toolchain.
''',
)
parser.add_argument(
@@ -38,7 +47,10 @@ has the OpenBLAS libraries and headers installed.
def do_build(self, args):
build_dir = self.get_build_dir(args)
os.makedirs(build_dir, exist_ok=True)
allowed_toolchains = ['buildroot']
if args.host:
allowed_toolchains = ['host']
else:
allowed_toolchains = ['buildroot']
cc = common.get_toolchain_tool('gcc', allowed_toolchains=allowed_toolchains)
cxx = common.get_toolchain_tool('g++', allowed_toolchains=allowed_toolchains)
common.run_cmd(