Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a nice thing to use --target indeed, but that can be another PR.

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')
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down