Prevent SCons from looking for standard tools
There are at least 2 ways to do this, the first way is the easiest, try creating the environment specifying the compiler, as follows:
env = Environment(CC = '/path/to/the/compiler')
You'll probably need to add paths for the linker and other tools as well. Then SCons shouldnt search for them.
Another way to do it would be to create a tool definition for the cross-compiler using the tools
argument on the Environment()
function as mentioned in the CONFIGURATION FILE REFERENCE section of the SCons man page, where the following is mentioned:
Additionally, a specific set of tools with which to initialize the environment may be specified as an optional keyword argument:
env = Environment(tools = ['msvc', 'lex'])
Non-built-in tools may be specified using the toolpath argument:
env = Environment(tools = ['default', 'foo'], toolpath = ['tools'])
...
The individual elements of the tools list may also themselves be two-element lists of the form (toolname, kw_dict). SCons searches for the toolname specification file as described above, and passes kw_dict, which must be a dictionary, as keyword arguments to the tool's generate function. The generate function can use the arguments to modify the tool's behavior by setting up the environment in different ways or otherwise changing its initialization.
tools/my_tool.py:
def generate(env, **kw):
# Sets MY_TOOL to the value of keyword argument 'arg1' or 1.
env['MY_TOOL'] = kw.get('arg1', '1')
def exists(env):
return 1
SConstruct:
env = Environment(tools = ['default', ('my_tool', {'arg1': 'abc'})],
toolpath=['tools'])