From 6c725cc40588f505565f8939322e8b1983b16760 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Tue, 26 May 2015 00:09:09 -0400 Subject: [PATCH] fix some cross compiling setups "i686-w64-mingw32" is actually a 32 bit compiler, and using --tool directly didn't update path before --- SConscript | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SConscript b/SConscript index 15cf9a6e83..5845789357 100644 --- a/SConscript +++ b/SConscript @@ -106,25 +106,27 @@ if not tool and compilePlatform == "Linux" and compilePlatform != platform: if platform == "Darwin": crossList = ["i686-apple-darwin9", "i686-apple-darwin10"] 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: - crossList = ["x86_64-w64-mingw32", "i686-w64-mingw32", "amd64-mingw32msvc"] + crossList = ["x86_64-w64-mingw32", "amd64-mingw32msvc"] for i in crossList: + #found a cross compiler, set tool here, which will update everything in env later if WhereIs("{0}-g++".format(i)): - env['ENV']['PATH'] = "/usr/{0}/bin:{1}".format(i, os.environ['PATH']) tool = i+"-" break if not tool: print("Could not automatically find cross compiler, use --tool to specify manually") #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: env['CC'] = tool+env['CC'] env['CXX'] = tool+env['CXX'] if platform == "Windows": env['RC'] = tool+env['RC'] 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 for var in ["CC","CXX","LD","LIBPATH"]: