Add support for Linux 32/64 as host OS for cross compiling to Windows x86

This commit is contained in:
Ivan Kravets
2015-08-10 16:16:16 +03:00
parent 5679271913
commit 2b8f7824c2
2 changed files with 13 additions and 12 deletions

View File

@ -2,7 +2,7 @@
# See LICENSE for details. # See LICENSE for details.
""" """
Builder for Windows x86 Builder for Windows x86 / 32bit
""" """
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
@ -13,13 +13,14 @@ from platformio.util import get_systype
env = DefaultEnvironment() env = DefaultEnvironment()
env.Replace( env.Replace(
AR="$_MINGWPREFIX-ar", _BINPREFIX="",
AS="$_MINGWPREFIX-as", AR="${_BINPREFIX}ar",
CC="$_MINGWPREFIX-gcc", AS="${_BINPREFIX}as",
CXX="$_MINGWPREFIX-g++", CC="${_BINPREFIX}gcc",
OBJCOPY="$_MINGWPREFIX-objcopy", CXX="${_BINPREFIX}g++",
RANLIB="$_MINGWPREFIX-ranlib", OBJCOPY="${_BINPREFIX}objcopy",
SIZETOOL="$_MINGWPREFIX-size", RANLIB="${_BINPREFIX}ranlib",
SIZETOOL="${_BINPREFIX}size",
SIZEPRINTCMD='"$SIZETOOL" $SOURCES', SIZEPRINTCMD='"$SIZETOOL" $SOURCES',
PROGSUFFIX=".exe" PROGSUFFIX=".exe"
@ -27,11 +28,11 @@ env.Replace(
if get_systype() == "darwin_x86_64": if get_systype() == "darwin_x86_64":
env.Replace( env.Replace(
_MINGWPREFIX="i586-mingw32" _BINPREFIX="i586-mingw32-"
) )
elif get_systype() in ("linux_x86_64", "linux_i686"): elif get_systype() in ("linux_x86_64", "linux_i686"):
env.Replace( env.Replace(
_MINGWPREFIX="i686-w64-mingw32" _BINPREFIX="i686-w64-mingw32-"
) )
# #

View File

@ -9,8 +9,8 @@ class Windows_x86Platform(BasePlatform):
""" """
Windows x86 (32-bit) is a metafamily of graphical operating systems Windows x86 (32-bit) is a metafamily of graphical operating systems
developed and marketed by Microsoft. developed and marketed by Microsoft.
Using host OS (Windows or Mac OS X) you can build native application Using host OS (Windows, Linux 32/64 or Mac OS X) you can build native
for Windows x86 platform. application for Windows x86 platform.
http://platformio.org/#!/platforms/windows_x86 http://platformio.org/#!/platforms/windows_x86
""" """