[Scons-users] Cross-OS Cross-Building

Fred Wright fw at fwright.net
Tue Aug 9 15:50:46 EDT 2016


I've been looking into some issues with cross-building, and have come
across a problem:

Setting up the proper target environment has to include setting up the
proper platform-related settings.  The code that does that is contained in
platform-related SCons functions that don't directly correspond to the
normal user-visible platform names.  The code to provide that mapping
seems to exist solely in the platform_default() function, which takes no
arguments and gets the values directly from the host Python.

AFAICT, the only way to make this work for a specified target OS is to do
one of two things:

1) Duplicate the logic in platform_default(), thereby relying on knowledge
of SCons internals.

2) Monkey-patch os.name and sys.platform around a call to
platform_default(), so that it can be fed the proper values.

Both of these are rather ugly.  Am I missing something?  Is it really true
that nobody considered the possibility of cross-building for a different
OS?

Fred Wright


More information about the Scons-users mailing list