diff --git a/SConstruct b/SConstruct index cf2aca485..c672a25e5 100755 --- a/SConstruct +++ b/SConstruct @@ -2479,9 +2479,29 @@ def which(cmd, paths=os.environ.get('PATH', '').split(os.pathsep)): return True return False +def SetUpLinuxEnvX86(env): + if env.Bit('built_elsewhere'): + def FakeInstall(dest, source, env): + print('Not installing', dest) + # Replace build commands with no-ops + env.Replace(CC='true', CXX='true', LD='true', + AR='true', RANLIB='true', INSTALL=FakeInstall) + else: + env.Prepend(CCFLAGS=sysroot_flags, + ASFLAGS=[], + ) + if env.Bit('clang'): + # TODO use --target=i386-linux-gnu or whetever? + env.Prepend( + CCFLAGS = ['-m32'] + sysroot_flags, + LINKFLAGS = ['-m32'] + sysroot_flags, + ) + else: + env.Replace(CC='i686-linux-gnu-gcc', + CXX='i686-linux-gnu-g++', + LD='i686-linux-gnu-ld') def SetUpLinuxEnvArm(env): - jail = env.GetToolchainDir(toolchain_name='arm_trusted') if not platform.machine().startswith('arm'): # Allow emulation on non-ARM hosts. env.Replace(EMULATOR='qemu-armhf -L /usr/arm-linux-gnueabihf/ -cpu cortex-a9') @@ -2509,9 +2529,6 @@ def SetUpLinuxEnvArm(env): env.Prepend(CCFLAGS=['-march=armv7-a','-mfloat-abi=hard', '-mtune=generic-armv7-a', '-mfpu=neon']) - # get_plugin_dirname.cc has a dependency on dladdr - env.Append(LIBS=['dl']) - def SetUpAndroidEnv(env): env.FilterOut(CPPDEFINES=[['_LARGEFILE64_SOURCE', '1']]) android_ndk_root = os.path.join('${SOURCE_ROOT}', 'third_party', @@ -2695,10 +2712,7 @@ def MakeGenericLinuxEnv(platform=None): ) if linux_env.Bit('build_x86_32'): - linux_env.Prepend( - CCFLAGS = ['-m32'] + sysroot_flags, - LINKFLAGS = ['-m32'] + sysroot_flags, - ) + SetUpLinuxEnvX86(linux_env) elif linux_env.Bit('build_x86_64'): linux_env.Prepend( CCFLAGS = ['-m64'] + sysroot_flags,