You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
867 B

"""
WAF Tool to select the correct toolchain based on the target archtecture.
This tool must be loaded before compiler tools. Use the environment variable
TOOLCHAIN to define the toolchain prefix.
Example::
def configure(cfg):
cfg.env.TOOLCHAIN = 'arm-linux-gnueabihf'
cfg.load('toolchain')
cfg.load('cxx_compiler')
"""
from waflib import Utils
suffixes = dict(
CXX='g++',
CC='gcc',
AS='gcc',
AR='ar',
LD='g++',
GDB='gdb',
OBJCOPY='objcopy',
)
def configure(cfg):
if not cfg.env.TOOLCHAIN:
cfg.env.TOOLCHAIN = 'native'
prefix = ''
else:
cfg.env.TOOLCHAIN = Utils.to_list(cfg.env.TOOLCHAIN)[0]
cfg.msg('Using toolchain prefix', cfg.env.TOOLCHAIN)
prefix = cfg.env.TOOLCHAIN + '-'
for k in suffixes:
cfg.env.append_value(k, prefix + suffixes[k])