Cross-Compiling Environment
This section documents the changes to the Python environment beyond just making
cross-python behave like host-python.
Environment variables
Crossenv sets PYTHON_CROSSENV to a non-empty value.
The sys module
- sys.cross_compiling
Set to
Trueincross-python. May be used like so:if getattr(sys, 'cross_compiling', False): ...
- sys.build_path
Analagous to
sys.path, but applies when importing packages frombuild-python. This path is searched just before the entries onsys.paththat point to the Python standard library. This means thatsys.build_pathis preferred when loading modules from the standard library, but prepending tosys.pathstill works as expected.
The os module
- os.uname()
In addition to returning
host-python’s information, it always reports thenodeas “build”.
The platform module
- platform.uname()
In addition to returning
host-python’s information, it always reports thenodeas “build”.