[Scons-users] Configure() when cross-compiling

Mats Wichmann mats at wichmann.us
Wed Feb 26 11:58:08 EST 2020


On 2/26/20 7:58 AM, tossel at gmail.com wrote:
> Greetings,
> 
> sorry, that's probably a basic question, but I couldn't find the
> answer in the docs. The user manual describes a way to define a
> configuration context (Configure(env)) that would find libraries and
> headers about the same way as autoconf or cmake do.
> 
> When cross-compiling for a Linux target it is necessary to set a
> sysroot, so that the libraries are searched in the target root, not
> host root. In cmake it's done with CMAKE_SYSROOT variable, in
> autotools it's PKG_CONFIG_SYSROOT_DIR. Is there something similar in
> SCons?


You can add it manually... which may not be the most elegant answer.
I'll point you to this project which can do cross builds for Yocto and
WebOs setups.  Don't claim it's best-practice or anything, but it did
work (now largely obsoleted as that project has moved on to a rewrite
with more limited scope):

https://github.com/iotivity/iotivity/blob/master/build_common/SConscript

it sets up to accept specifiers of TC_PREFIX and TC_PATH for the
toolchain (see around line 270) and respects setting of PKG_CONFIG_PATH
and PKG_CONFIG_SYSROOT_DIR (see about line 375).




More information about the Scons-users mailing list