You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sci-libs/cctbx/files/2010.03.29.2334-flags.patch

95 lines
3.3 KiB

diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
index 16d22b6..f85b664 100644
--- a/cctbx_sources/libtbx/SConscript
+++ b/cctbx_sources/libtbx/SConscript
@@ -5,6 +5,7 @@ from libtbx.str_utils import show_string
from libtbx.path import norm_join, full_command_path
import platform
import sys, os
+import SCons.Util
if (hasattr(Environment, "Clone")):
Environment.Copy = Environment.Clone # XXX backward compatibility 2008_03_30
@@ -132,9 +133,7 @@ if (env_etc.compiler == "unix_icpc"):
static_exe = libtbx.env.build_options.static_exe
def gcc_common_warn_options():
- result = ["-Wall", "-Wno-sign-compare", "-Wno-unknown-pragmas"]
- if (env_etc.gcc_version >= 40000):
- result.append("-Winit-self")
+ result = [""]
return result
def enable_more_warnings(env):
@@ -355,16 +354,22 @@ else:
cc = env_etc.compiler.replace("unix_", "")
cxx = cc.replace("gcc", "g++")
env_etc.gcc_version = libtbx.env_config.get_gcc_version(command_name=cc)
+# linkerflags = os.environ.get("LDFLAGS")
+# link_flags=env_etc.ldflags
+ link_flags=os.environ.get("LDFLAGS")
+ linker_options=SCons.Util.CLVar(os.environ['LDFLAGS'])
env_base.Replace(
CC=cc,
SHCC=cc,
CXX=cxx,
LINK=cxx,
+ LINKFLAGS=linker_options,
SHCXX=cxx,
SHLINK=cxx,
SHLIBSUFFIX=env_etc.shlibsuffix,
)
- env_etc.c_link = cc
+# linkerflags = env_etc.ldflags
+# env_etc.c_link = cc + " " + linkerflags
env_etc.ccflags_base = [
"-fPIC",
"-fno-strict-aliasing"]
@@ -380,7 +385,7 @@ else:
warn_options = gcc_common_warn_options() + ["-Werror"]
env_etc.ccflags_base.extend(warn_options)
if (libtbx.env.build_options.optimization):
- opts = ["-DNDEBUG", "-O3", "-ffast-math"]
+ opts = ["-DNDEBUG"]
if (env_etc.gcc_version >= 40300):
opts.append("-fno-associative-math")
opts.append("-ftrapping-math")
@@ -401,6 +406,7 @@ else:
env_base.Prepend(LINKFLAGS=["-static"])
static_exe = None
env_etc.shlinkflags = ["-shared"]
+ env_etc.shlinkflags.append(linker_options)
env_etc.shlinkflags_bpl = env_etc.shlinkflags
if (libtbx.env.build_options.mode == "profile"):
env_base.Prepend(LINKFLAGS=["-pg"])
diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
index ca510b9..68c58ea 100644
--- a/cctbx_sources/libtbx/env_config.py
+++ b/cctbx_sources/libtbx/env_config.py
@@ -1608,6 +1608,7 @@ class build_options:
self.env_cxxflags = ""
self.env_cflags = ""
self.env_cppflags = ""
+ self.env_ldflags = ""
flg = os.environ.get("CXXFLAGS")
if flg is not None:
self.env_cxxflags = flg
@@ -1617,6 +1618,9 @@ class build_options:
flg = os.environ.get("CPPFLAGS")
if flg is not None:
self.env_cppflags = flg
+ flg = os.environ.get("LDFLAGS")
+ if flg is not None:
+ self.env_ldflags = flg
def report(self, f=None):
if (f is None): f = sys.stdout
@@ -1640,6 +1644,7 @@ class build_options:
print >>f, " CXXFLAGS = ", self.env_cxxflags
print >>f, " CFLAGS = ", self.env_cflags
print >>f, " CPPFLAGS = ", self.env_cppflags
+ print >>f, " LDFLAGS = ", self.env_ldflags
class include_registry: