Support cross compiling for Windows target.

Restructure deploy.py by moving the platform decisions out of the calling
scripts. This is necessary when cross compiling since this is only decided in
deploy.py. Add support for passing a cross compiler prefix on the command line
and always build targeting Windows if set.

Correct some whitespace errors and long lines while at it.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29531 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2011-03-06 00:04:26 +00:00
parent 71e4b03ed6
commit 43a40caa37
3 changed files with 119 additions and 97 deletions

View file

@ -17,7 +17,6 @@
#
import deploy
import sys
deploy.program = "RockboxUtility"
deploy.project = "rbutil/rbutilqt/rbutilqt.pro"
@ -48,22 +47,29 @@ deploy.bundlecopy = {
"icons/rbutilqt.icns" : "Contents/Resources/",
"Info.plist" : "Contents/"
}
# Windows nees some special treatment. Differentiate between program name
# and executable filename.
if sys.platform == "win32":
deploy.progexe = "Release/" + deploy.program + ".exe"
deploy.make = "mingw32-make"
elif sys.platform == "darwin":
deploy.progexe = deploy.program + ".app"
# OS X 10.6 defaults to gcc 4.2. Building universal binaries that are
# compatible with 10.4 requires using gcc-4.0.
if not "QMAKESPEC" in deploy.environment:
deploy.environment["QMAKESPEC"] = "macx-g++40"
else:
deploy.progexe = deploy.program
deploy.progexe = {
"win32" : "release/RockboxUtility.exe",
"darwin" : "RockboxUtility.app",
"linux" : "RockboxUtility"
}
# OS X 10.6 defaults to gcc 4.2. Building universal binaries that are
# compatible with 10.4 requires using gcc-4.0.
deploy.qmakespec = {
"win32" : "",
"darwin" : "macx-g++40",
"linux" : ""
}
deploy.make = {
"win32" : "mingw32-make",
"darwin" : "make",
"linux" : "make"
}
# all files of the program. Will get put into an archive after building
# (zip on w32, tar.bz2 on Linux). Does not apply on Mac which uses dmg.
deploy.programfiles = [ deploy.progexe ]
# progexe will get added automatically.
deploy.programfiles = [ ]
deploy.nsisscript = ""
deploy.deploy()