mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 19:00:33 +02:00
fix some cross compiling setups
"i686-w64-mingw32" is actually a 32 bit compiler, and using --tool directly didn't update path before
This commit is contained in:
10
SConscript
10
SConscript
@@ -106,25 +106,27 @@ if not tool and compilePlatform == "Linux" and compilePlatform != platform:
|
|||||||
if platform == "Darwin":
|
if platform == "Darwin":
|
||||||
crossList = ["i686-apple-darwin9", "i686-apple-darwin10"]
|
crossList = ["i686-apple-darwin9", "i686-apple-darwin10"]
|
||||||
elif not GetOption('64bit'):
|
elif not GetOption('64bit'):
|
||||||
crossList = ["mingw32", "i386-mingw32msvc", "i486-mingw32msvc", "i586-mingw32msvc", "i686-mingw32msvc"]
|
crossList = ["mingw32", "i686-w64-mingw32", "i386-mingw32msvc", "i486-mingw32msvc", "i586-mingw32msvc", "i686-mingw32msvc"]
|
||||||
else:
|
else:
|
||||||
crossList = ["x86_64-w64-mingw32", "i686-w64-mingw32", "amd64-mingw32msvc"]
|
crossList = ["x86_64-w64-mingw32", "amd64-mingw32msvc"]
|
||||||
for i in crossList:
|
for i in crossList:
|
||||||
|
#found a cross compiler, set tool here, which will update everything in env later
|
||||||
if WhereIs("{0}-g++".format(i)):
|
if WhereIs("{0}-g++".format(i)):
|
||||||
env['ENV']['PATH'] = "/usr/{0}/bin:{1}".format(i, os.environ['PATH'])
|
|
||||||
tool = i+"-"
|
tool = i+"-"
|
||||||
break
|
break
|
||||||
if not tool:
|
if not tool:
|
||||||
print("Could not automatically find cross compiler, use --tool to specify manually")
|
print("Could not automatically find cross compiler, use --tool to specify manually")
|
||||||
|
|
||||||
#set tool prefix
|
#set tool prefix
|
||||||
#more things may to be set (http://clam-project.org/clam/trunk/CLAM/scons/sconstools/crossmingw.py), but this works for us
|
#more things may need to be set (http://clam-project.org/clam/trunk/CLAM/scons/sconstools/crossmingw.py), but this works for us
|
||||||
if tool:
|
if tool:
|
||||||
env['CC'] = tool+env['CC']
|
env['CC'] = tool+env['CC']
|
||||||
env['CXX'] = tool+env['CXX']
|
env['CXX'] = tool+env['CXX']
|
||||||
if platform == "Windows":
|
if platform == "Windows":
|
||||||
env['RC'] = tool+env['RC']
|
env['RC'] = tool+env['RC']
|
||||||
env['STRIP'] = tool+'strip'
|
env['STRIP'] = tool+'strip'
|
||||||
|
if os.path.isdir("/usr/{0}/bin".format(tool[:-1])):
|
||||||
|
env['ENV']['PATH'] = "/usr/{0}/bin:{1}".format(tool[:-1], os.environ['PATH'])
|
||||||
|
|
||||||
#copy environment variables because scons doesn't do this by default
|
#copy environment variables because scons doesn't do this by default
|
||||||
for var in ["CC","CXX","LD","LIBPATH"]:
|
for var in ["CC","CXX","LD","LIBPATH"]:
|
||||||
|
Reference in New Issue
Block a user