From 737a5c84680fa01a791ac50237c2578a69b50dec Mon Sep 17 00:00:00 2001 From: f0rt Date: Sat, 25 Jun 2011 19:29:38 +0000 Subject: [PATCH] Allow building with a specific win32 targeted cross compiler (#3305366) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6156 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/build.but | 2 ++ SCons/Config/gnu | 2 +- SCons/Tools/crossmingw.py | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Docs/src/build.but b/Docs/src/build.but index f2eaa551..c1313933 100644 --- a/Docs/src/build.but +++ b/Docs/src/build.but @@ -100,6 +100,8 @@ To build NSIS Menu, install \W{http://www.wxwidgets.org/}{wxWidgets 2.8}, create As of NSIS 2.01, the compiler, makensis, also compiles on POSIX platforms. POSIX platforms include Linux, *BSD, Mac OS X and others. Since the generated installer will eventually run on Windows, a \W{http://www.libsdl.org/extras/win32/cross/README.txt}{cross-compiler} is needed in order to compile them. +The command line option XGCC_W32_PREFIX could be used to explicitly select a specific win32 targeted cross compiler. The value of XGCC_W32_PREFIX has to be the prefix of the toolchain. For example XGCC_W32_PREFIX=i686-w64-mingw32 would deploy the win32 targeted MinGW-w64 cross compiler if it is available on the build system. + If no cross-compiler is available, use the following: \c scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all diff --git a/SCons/Config/gnu b/SCons/Config/gnu index eb6953a7..511415b4 100644 --- a/SCons/Config/gnu +++ b/SCons/Config/gnu @@ -31,7 +31,7 @@ defenv['ALIGN_FLAG'] = '-Wl,--file-alignment,512' defenv['CPP_REQUIRES_STDLIB'] = 1 defenv['SUBSYS_CON'] = '-Wl,--subsystem,console' defenv['MSVCRT_FLAG'] = '' -defenv['STDCALL'] = '__attribute__((__stdcall__))' +defenv['STDCALL'] = '"__attribute__((__stdcall__))"' ### defines diff --git a/SCons/Tools/crossmingw.py b/SCons/Tools/crossmingw.py index d27e01c7..6140a2d3 100644 --- a/SCons/Tools/crossmingw.py +++ b/SCons/Tools/crossmingw.py @@ -61,6 +61,11 @@ prefixes = SCons.Util.Split(""" """) def find(env): + # Explicitly specified toolchain to build Windows executables + # takes predominance. + prefix = SCons.Script.ARGUMENTS.get('XGCC_W32_PREFIX', None) + if prefix: + prefixes.insert(0, prefix) for prefix in prefixes: # First search in the SCons path and then the OS path: if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'):