summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-01-05 20:37:18 +0100
committerRémi Verschelde <rverschelde@gmail.com>2018-01-05 20:37:45 +0100
commitdb49f35ab8d2bbcf5b97a58b8a2eff064b942881 (patch)
tree49ad34615e0c7ae865285ee9c0f513431dcea872
parent380ee87e800e44b5e930d784dfb8aeadddf637f3 (diff)
SCons: Fix usage of LD when we meant LINK
Also made LINK and CXXFLAGS configurable as command line options. Note that LINK currently expects the *compiler* that will be used for linking and will call its configured linker behind the scenes (so g++, clang++, etc., not ld.gold). See #15364 for details.
-rw-r--r--SConstruct6
-rw-r--r--platform/osx/detect.py4
-rw-r--r--platform/server/detect.py2
-rw-r--r--platform/windows/detect.py2
-rw-r--r--platform/x11/detect.py2
5 files changed, 9 insertions, 7 deletions
diff --git a/SConstruct b/SConstruct
index 88b29695cb..9fced81f9c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -189,10 +189,12 @@ opts.Add(BoolVariable('builtin_zlib', "Use the builtin zlib library", True))
opts.Add(BoolVariable('builtin_zstd', "Use the builtin zstd library", True))
opts.Add(BoolVariable('no_editor_splash', "Don't use the custom splash screen for the editor", False))
-# Environment setup
+# Compilation environment setup
opts.Add("CXX", "C++ compiler")
opts.Add("CC", "C compiler")
-opts.Add("CCFLAGS", "Custom flags for the C and C++ compilers")
+opts.Add("LINK", "Linker")
+opts.Add("CCFLAGS", "Custom flags for both the C and C++ compilers")
+opts.Add("CXXFLAGS", "Custom flags for the C++ compiler")
opts.Add("CFLAGS", "Custom flags for the C compiler")
opts.Add("LINKFLAGS", "Custom flags for the linker")
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index 2e686fbee4..bb601abd40 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -76,7 +76,7 @@ def configure(env):
mpprefix = os.environ.get("MACPORTS_PREFIX", "/opt/local")
mpclangver = env["macports_clang"]
env["CC"] = mpprefix + "/libexec/llvm-" + mpclangver + "/bin/clang"
- env["LD"] = mpprefix + "/libexec/llvm-" + mpclangver + "/bin/clang++"
+ env["LINK"] = mpprefix + "/libexec/llvm-" + mpclangver + "/bin/clang++"
env["CXX"] = mpprefix + "/libexec/llvm-" + mpclangver + "/bin/clang++"
env['AR'] = mpprefix + "/libexec/llvm-" + mpclangver + "/bin/llvm-ar"
env['RANLIB'] = mpprefix + "/libexec/llvm-" + mpclangver + "/bin/llvm-ranlib"
@@ -110,7 +110,7 @@ def configure(env):
if (env["CXX"] == "clang++"):
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
env["CC"] = "clang"
- env["LD"] = "clang++"
+ env["LINK"] = "clang++"
## Dependencies
diff --git a/platform/server/detect.py b/platform/server/detect.py
index ffec2af933..72c9c770e3 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -59,7 +59,7 @@ def configure(env):
if ('clang++' not in env['CXX']):
env["CC"] = "clang"
env["CXX"] = "clang++"
- env["LD"] = "clang++"
+ env["LINK"] = "clang++"
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
env.extra_suffix = ".llvm" + env.extra_suffix
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 489bac50f5..bd05d5605d 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -265,7 +265,7 @@ def configure(env):
env['CXX'] = mingw_prefix + "g++"
env['AR'] = mingw_prefix + "gcc-ar"
env['RANLIB'] = mingw_prefix + "gcc-ranlib"
- env['LD'] = mingw_prefix + "g++"
+ env['LINK'] = mingw_prefix + "g++"
env["x86_libtheora_opt_gcc"] = True
if env['use_lto']:
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index cb45fed1be..478b42f9f7 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -109,7 +109,7 @@ def configure(env):
if ('clang++' not in env['CXX']):
env["CC"] = "clang"
env["CXX"] = "clang++"
- env["LD"] = "clang++"
+ env["LINK"] = "clang++"
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
env.extra_suffix = ".llvm" + env.extra_suffix