From 258232604c0f84a5edb95d7d74b65326a57a3398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Fri, 25 Feb 2011 20:22:58 +0100 Subject: Use -fPIC on AMD64. diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index 772b485..af2d747 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -1,4 +1,4 @@ -import sys, os, re +import sys, os, re, platform sys.path.append(Dir("BuildTools/SCons").abspath) import SCons.SConf @@ -161,6 +161,10 @@ if env.get("mac105", 0) : "-isysroot", "/Developer/SDKs/MacOSX10.5.sdk", "-arch", "i386"]) +# If we build shared libs on AMD64, we need -fPIC. +# This should have no performance impact om AMD64 +if env["PLATFORM"] == "posix" and platform.machine() == "x86_64" : + env.Append(CCFLAGS = ["-fPIC"]) # Warnings if env["PLATFORM"] == "win32" : diff --git a/Sluift/SConscript b/Sluift/SConscript index cf0f4d0..dbf7459 100644 --- a/Sluift/SConscript +++ b/Sluift/SConscript @@ -1,5 +1,3 @@ -import platform - Import("env") if env["SCONS_STAGE"] == "build" : @@ -14,9 +12,6 @@ if env["SCONS_STAGE"] == "build" : elif myenv["PLATFORM"] == "darwin" : myenv["SHLIBSUFFIX"] = ".so" - # Temporarily not building plugin on amd64, because it - # requires the whole build to be done with -fPIC - if myenv["PLATFORM"] != "posix" or platform.machine() != "x86_64" : - myenv.SharedLibrary("sluift", [ - "sluift.cpp", - ]) + myenv.SharedLibrary("sluift", [ + "sluift.cpp", + ]) -- cgit v0.10.2-6-g49f6