mirror of https://gitlab.com/ita1024/waf.git
Use cross_prefix option for objcopy if available
This commit is contained in:
parent
d536d3ebab
commit
97ab1e5a52
|
@ -15,7 +15,7 @@ objcopy_flags Additional flags passed to objcopy.
|
|||
"""
|
||||
|
||||
from waflib.Utils import def_attrs
|
||||
from waflib import Task
|
||||
from waflib import Task, Options
|
||||
from waflib.TaskGen import feature, after_method
|
||||
|
||||
class objcopy(Task.Task):
|
||||
|
@ -46,5 +46,8 @@ def map_objcopy(self):
|
|||
self.add_install_files(install_to=self.objcopy_install_path, install_from=task.outputs[0])
|
||||
|
||||
def configure(ctx):
|
||||
ctx.find_program('objcopy', var='OBJCOPY', mandatory=True)
|
||||
|
||||
program_name = 'objcopy'
|
||||
prefix = getattr(Options.options, 'cross_prefix', None)
|
||||
if prefix:
|
||||
program_name = '{}-{}'.format(prefix, program_name)
|
||||
ctx.find_program(program_name, var='OBJCOPY', mandatory=True)
|
||||
|
|
Loading…
Reference in New Issue