From e9eb8d316fa80e3398706328c6e45a7452dd894b Mon Sep 17 00:00:00 2001 From: loonycyborg Date: Wed, 2 Dec 2015 16:20:55 +0300 Subject: [PATCH] scons: Added an option to support using multilib gcc in 32-bit mode multilib_arch=32 will pass -m32 to both compiler and linker causing multilib gcc to produce 32bit binaries. --- SConstruct | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SConstruct b/SConstruct index c60323d090d..e67e2db9a35 100755 --- a/SConstruct +++ b/SConstruct @@ -97,6 +97,7 @@ opts.AddVariables( PathVariable('gtkdir', 'Directory where GTK SDK is installed.', "", OptionalPath), PathVariable('luadir', 'Directory where Lua binary package is unpacked.', "", OptionalPath), ('host', 'Cross-compile host.', ''), + EnumVariable('multilib_arch', 'Address model for multilib compiler: 32-bit or 64-bit', "", ["", "32", "64"]), ('jobs', 'Set the number of parallel compilations', "1", lambda key, value, env: int(value), int), BoolVariable('distcc', 'Use distcc', False), BoolVariable('ccache', "Use ccache", False), @@ -304,6 +305,10 @@ configure_args = dict( env.MergeFlags(env["extra_flags_config"]) +if env["multilib_arch"]: + multilib_flag = "-m" + env["multilib_arch"] + env.AppendUnique(CCFLAGS = [multilib_flag], LINKFLAGS = [multilib_flag]) + # Some tests need to load parts of boost env.PrependENVPath('LD_LIBRARY_PATH', env["boostlibdir"])