Created
July 6, 2016 22:52
-
-
Save wrl/8cc6b77e4d9792ea258f0d76a3d410f5 to your computer and use it in GitHub Desktop.
waf cross compilation tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
def override_find_program(prefix): | |
from waflib.Configure import find_program as orig_find | |
from waflib.Configure import conf | |
if prefix[-1] != '-': | |
prefix += '-' | |
@conf | |
def find_program(self, filename, **kw): | |
if type(filename) == str: | |
return orig_find(self, prefix + filename, **kw) | |
else: | |
return orig_find(self, [prefix + x for x in filename], **kw) | |
return orig_find(self, filename, **kw) | |
def options(ctx): | |
xcomp_opts = ctx.add_option_group('cross-compilation') | |
xcomp_opts.add_option('--host', action='store', default=False) | |
def configure(ctx): | |
if ctx.options.host: | |
override_find_program(ctx.options.host) | |
# vim: set ts=4 sts=4 noet : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment