summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2020-12-28 05:17:46 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2020-12-28 05:17:46 (GMT)
commit91e60397c7792d33b2df9f39608aec51d383d118 (patch)
treecdb9c808e50166dd58da7f2c49ce54ef653b657d
parenta251629aa5e103f357f7d13b2920cbce59853d3f (diff)
downloadSCons-91e60397c7792d33b2df9f39608aec51d383d118.zip
SCons-91e60397c7792d33b2df9f39608aec51d383d118.tar.gz
SCons-91e60397c7792d33b2df9f39608aec51d383d118.tar.bz2
Fix test\win32\mingw.py. Note still need to track down why _LIBDIRFLAGS is evaluating to $( $) in the new code, but not in master
-rw-r--r--SCons/Tool/clang.py25
-rw-r--r--SCons/Tool/gcc.py24
-rw-r--r--SCons/Tool/gnulink.py18
-rw-r--r--SCons/Tool/linkCommon/SharedLibrary.py10
-rw-r--r--SCons/Tool/mingw.py9
-rw-r--r--test/Clang/clang_shared_library.py6
-rw-r--r--test/MinGW/MinGWSharedLibrary.py7
-rw-r--r--test/Win32/mingw.py16
8 files changed, 58 insertions, 57 deletions
diff --git a/SCons/Tool/clang.py b/SCons/Tool/clang.py
index e39c742..e033cfa 100644
--- a/SCons/Tool/clang.py
+++ b/SCons/Tool/clang.py
@@ -1,17 +1,8 @@
# -*- coding: utf-8; -*-
-
-"""SCons.Tool.clang
-
-Tool-specific initialization for clang.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -32,8 +23,16 @@ selection method.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+"""SCons.Tool.clang
+
+Tool-specific initialization for clang.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
-# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
# Based on SCons/Tool/gcc.py by Paweł Tomulik 2014 as a separate tool.
# Brought into the SCons mainline by Russel Winder 2017.
diff --git a/SCons/Tool/gcc.py b/SCons/Tool/gcc.py
index 37626ef..6470002 100644
--- a/SCons/Tool/gcc.py
+++ b/SCons/Tool/gcc.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.gcc
-
-Tool-specific initialization for gcc.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,9 +20,16 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""SCons.Tool.gcc
+
+Tool-specific initialization for gcc.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
from . import cc
import re
diff --git a/SCons/Tool/gnulink.py b/SCons/Tool/gnulink.py
index fb5acd0..e8b668f 100644
--- a/SCons/Tool/gnulink.py
+++ b/SCons/Tool/gnulink.py
@@ -1,13 +1,3 @@
-"""SCons.Tool.gnulink
-
-Tool-specific initialization for the gnu linker.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
#
# MIT License
#
@@ -32,7 +22,15 @@ selection method.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+"""SCons.Tool.gnulink
+Tool-specific initialization for the gnu linker.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
import SCons.Tool.linkCommon
import SCons.Util
diff --git a/SCons/Tool/linkCommon/SharedLibrary.py b/SCons/Tool/linkCommon/SharedLibrary.py
index 9214939..38f0c61 100644
--- a/SCons/Tool/linkCommon/SharedLibrary.py
+++ b/SCons/Tool/linkCommon/SharedLibrary.py
@@ -41,7 +41,7 @@ def shlib_symlink_emitter(target, source, env, **kw):
if shlib_soname_symlink != libnode:
# If soname and library name machine, don't symlink them together
symlinks.append((env.File(shlib_soname_symlink), libnode))
-
+
symlinks.append((env.File(shlib_noversion_symlink), libnode))
if verbose:
@@ -152,9 +152,7 @@ def setup_shared_lib_logic(env):
# This is the non versioned shlib filename
# If SHLIBVERSION is defined then this will symlink to $SHLIBNAME
- env[
- "SHLIB_NOVERSION_SYMLINK"
- ] = "${_get_shlib_dir}${SHLIBPREFIX}$_get_shlib_stem${SHLIBSUFFIX}"
+ env["SHLIB_NOVERSION_SYMLINK"] = "${_get_shlib_dir}${SHLIBPREFIX}$_get_shlib_stem${SHLIBSUFFIX}"
# This is the sonamed file name
# If SHLIBVERSION is defined then this will symlink to $SHLIBNAME
@@ -172,8 +170,6 @@ def setup_shared_lib_logic(env):
env["SHLINKFLAGS"] = CLVar("$LINKFLAGS -shared")
- env[
- "SHLINKCOM"
- ] = "$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS"
+ env["SHLINKCOM"] = "$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS"
env["SHLINKCOMSTR"] = "$SHLINKCOM"
env["SHLINK"] = "$LINK"
diff --git a/SCons/Tool/mingw.py b/SCons/Tool/mingw.py
index b8337db..f72c64d 100644
--- a/SCons/Tool/mingw.py
+++ b/SCons/Tool/mingw.py
@@ -48,6 +48,7 @@ mingw_paths = [
r'C:\msys64\mingw64\bin',
r'C:\cygwin\bin',
r'C:\msys',
+ r'C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin'
]
@@ -141,6 +142,11 @@ def generate(env):
mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths)
if mingw:
mingw_bin_dir = os.path.dirname(mingw)
+
+ # Adjust path if we found it in a chocolatey install
+ if mingw_bin_dir == r'C:\ProgramData\chocolatey\bin':
+ mingw_bin_dir = r'C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin'
+
env.AppendENVPath('PATH', mingw_bin_dir)
# Most of mingw is the same as gcc and friends...
@@ -161,6 +167,7 @@ def generate(env):
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
env['SHLINKCOM'] = shlib_action
+ env['SHLINKCOMSTR'] = shlib_generator
env['LDMODULECOM'] = ldmodule_action
env.Append(SHLIBEMITTER=[shlib_emitter])
env.Append(LDMODULEEMITTER=[shlib_emitter])
@@ -189,6 +196,8 @@ def generate(env):
# Handle new versioned shared library logic
env['_SHLIBSUFFIX'] = '$SHLIBSUFFIX'
+ env["SHLIBPREFIX"] = ""
+
def exists(env):
diff --git a/test/Clang/clang_shared_library.py b/test/Clang/clang_shared_library.py
index 83fa4dd..4f3e50d 100644
--- a/test/Clang/clang_shared_library.py
+++ b/test/Clang/clang_shared_library.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -22,8 +24,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-
import TestSCons
from SCons.Environment import Base
diff --git a/test/MinGW/MinGWSharedLibrary.py b/test/MinGW/MinGWSharedLibrary.py
index badfcb9..f563909 100644
--- a/test/MinGW/MinGWSharedLibrary.py
+++ b/test/MinGW/MinGWSharedLibrary.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test the ability to configure the $RCCOM construction variable
diff --git a/test/Win32/mingw.py b/test/Win32/mingw.py
index ca31f6b..c45b7c6 100644
--- a/test/Win32/mingw.py
+++ b/test/Win32/mingw.py
@@ -1,10 +1,7 @@
-"""
-This tests the MinGW C/C++ compiler support.
-"""
-
#!/usr/bin/env python
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -24,9 +21,10 @@ This tests the MinGW C/C++ compiler support.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
+"""
+This tests the MinGW C/C++ compiler support.
+"""
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import sys
@@ -45,6 +43,9 @@ if sys.platform != 'win32':
test.write('SConstruct',"""
from SCons.Tool.mingw import exists
import sys
+
+DefaultEnvironment(tools=[])
+
env = Environment()
if exists(env):
print('mingw exists')
@@ -59,6 +60,7 @@ test.subdir('header')
# Do the actual testing:
test.write('SConstruct',"""
+DefaultEnvironment(tools=[])
env=Environment(tools=['mingw'])
assert env['CC'] == 'gcc'
env.StaticLibrary('static', 'static.cpp')