summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2019-01-23 11:58:20 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2019-01-24 10:19:05 -0500
commit3bd77b8400fd0b2a0b6820e2ecb0863bcf137040 (patch)
tree5fc3e138ff5a1f91f5632f99fa267ca62f67da61 /src
parent90cd49725f41354509dece813343c62e6ee9f533 (diff)
downloadmongo-3bd77b8400fd0b2a0b6820e2ecb0863bcf137040.tar.gz
SERVER-38004 Upgrade SCons to version 3.0.4
Diffstat (limited to 'src')
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/BoolOption.py50
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/EnumOption.py50
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/ListOption.py50
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/PackageOption.py50
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/PathOption.py76
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/__init__.py67
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Sig.py63
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/BitKeeper.py66
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/CVS.py72
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py413
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/Perforce.py99
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/RCS.py63
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/SCCS.py63
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/Subversion.py70
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/applelink.py71
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/jar.py116
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/xgettext.py339
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_builtins.py107
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_hashlib.py76
-rw-r--r--src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/dblite.py256
-rw-r--r--src/third_party/scons-3.0.4/scons-3.0.4.bat38
-rw-r--r--src/third_party/scons-3.0.4/scons-LICENSE (renamed from src/third_party/scons-2.5.0/scons-LICENSE)2
-rw-r--r--src/third_party/scons-3.0.4/scons-README (renamed from src/third_party/scons-2.5.0/scons-README)2
-rw-r--r--src/third_party/scons-3.0.4/scons-configure-cache.py178
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Action.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Action.py)397
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Builder.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Builder.py)61
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/CacheDir.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/CacheDir.py)22
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Conftest.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Conftest.py)65
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Debug.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Debug.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Defaults.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Defaults.py)27
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Environment.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py)82
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Errors.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Errors.py)155
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Executor.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py)27
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Job.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Memoize.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Memoize.py)20
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/Alias.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/Alias.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/FS.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py)601
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/Python.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/Python.py)34
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py)179
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/PathList.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/PathList.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/__init__.py)81
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/aix.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/aix.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/cygwin.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/cygwin.py)15
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/darwin.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/darwin.py)10
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/hpux.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/hpux.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/irix.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/irix.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/mingw.py39
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/os2.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/os2.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/posix.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/posix.py)13
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/sunos.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/sunos.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/virtualenv.py120
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/win32.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/win32.py)120
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/SConf.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py)53
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/SConsign.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py)39
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/C.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/C.py)11
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/D.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/D.py)20
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Dir.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Dir.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Fortran.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Fortran.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/IDL.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/IDL.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/LaTeX.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/LaTeX.py)145
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Prog.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Prog.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/RC.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/RC.py)27
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/SWIG.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/SWIG.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/__init__.py)42
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/Interactive.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py)36
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/Main.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py)106
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/SConsOptions.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py)42
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/SConscript.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConscript.py)98
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/__init__.py)46
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Subst.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Subst.py)57
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Taskmaster.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py)105
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/386asm.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/386asm.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/DCommon.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/DCommon.py)17
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/FortranCommon.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/FortranCommon.py)17
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/GettextCommon.py469
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/JavaCommon.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/JavaCommon.py)188
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/__init__.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/arch.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/arch.py)12
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/common.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/common.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/netframework.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/netframework.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/sdk.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/vc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/vc.py)297
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/vs.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/vs.py)19
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/PharLapCommon.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/PharLapCommon.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/__init__.py)761
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixc++.py43
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixcc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixcc.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixcxx.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixc++.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixf77.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixf77.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixlink.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixlink.py)12
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/applelink.py218
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ar.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ar.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/as.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/as.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/bcc32.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/bcc32.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/c++.py44
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cc.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clang.py94
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clangCommon/__init__.py17
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clangxx.py102
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cvf.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cvf.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cxx.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/c++.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cyglink.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cyglink.py)50
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/default.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/default.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dmd.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dmd.py)48
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/docbook/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/docbook/__init__.py)31
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvi.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvi.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvipdf.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvipdf.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvips.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvips.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f03.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f03.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f08.py65
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f77.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f77.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f90.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f90.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f95.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f95.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/filesystem.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/filesystem.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/fortran.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/fortran.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/g++.py45
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/g77.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/g77.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gas.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gas.py)9
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gcc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gcc.py)25
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gdc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gdc.py)34
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gettext_tool.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gettext.py)16
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gfortran.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gfortran.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gnulink.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gnulink.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gs.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gs.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gxx.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/g++.py)15
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpc++.py45
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpcc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hpcc.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpcxx.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hpc++.py)9
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hplink.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hplink.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/icc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/icc.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/icl.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/icl.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ifl.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ifl.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ifort.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ifort.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ilink.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ilink.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ilink32.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ilink32.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/install.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/install.py)25
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/intelc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/intelc.py)27
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ipkg.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ipkg.py)28
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/jar.py241
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/javac.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/javac.py)24
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/javah.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/javah.py)14
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/latex.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/latex.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ldc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ldc.py)47
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/lex.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/lex.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/link.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/link.py)191
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/linkloc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/linkloc.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/m4.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/m4.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/masm.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/masm.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/midl.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/midl.py)20
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mingw.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mingw.py)72
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msgfmt.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msgfmt.py)20
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msginit.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msginit.py)22
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msgmerge.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msgmerge.py)21
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mslib.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mslib.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mslink.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mslink.py)21
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mssdk.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mssdk.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msvc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvc.py)34
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msvs.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvs.py)246
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mwcc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mwcc.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mwld.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mwld.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/nasm.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/nasm.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/__init__.py)53
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/ipk.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/ipk.py)14
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/msi.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/msi.py)17
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/rpm.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/rpm.py)68
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_tarbz2.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_tarbz2.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_targz.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_targz.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_tarxz.py43
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_zip.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_zip.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/tarbz2.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/tarbz2.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/targz.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/targz.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/tarxz.py44
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/zip.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/zip.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdf.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdf.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdflatex.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdflatex.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdftex.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdftex.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/qt.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/qt.py)56
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rmic.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rmic.py)19
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpcgen.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpcgen.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpm.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpm.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpmutils.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpmutils.py)14
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgiar.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgiar.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgic++.py43
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgicc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgicc.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgicxx.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgic++.py)9
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgilink.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgilink.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunar.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunar.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunc++.py45
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/suncc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/suncc.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/suncxx.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunc++.py)8
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf77.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf77.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf90.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf90.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf95.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf95.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunlink.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunlink.py)6
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/swig.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/swig.py)26
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tar.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tar.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tex.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tex.py)117
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/textfile.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/textfile.py)115
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tlib.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tlib.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/wix.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/wix.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/xgettext.py374
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/yacc.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/yacc.py)15
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/zip.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/zip.py)46
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Util.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Util.py)392
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/BoolVariable.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/BoolVariable.py)14
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/EnumVariable.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/EnumVariable.py)28
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/ListVariable.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/ListVariable.py)16
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/PackageVariable.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/PackageVariable.py)28
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/PathVariable.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/PathVariable.py)13
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/__init__.py)50
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Warnings.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Warnings.py)17
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/__init__.py)14
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/compat/__init__.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/__init__.py)92
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/compat/_scons_dbm.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_dbm.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/cpp.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/cpp.py)39
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/dblite.py287
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/exitfuncs.py (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/exitfuncs.py)4
-rw-r--r--src/third_party/scons-3.0.4/scons-local-3.0.4/scons-3.0.4.egg-info (renamed from src/third_party/scons-2.5.0/scons-local-2.5.0/scons-2.5.0-py2.7.egg-info)6
-rw-r--r--[-rwxr-xr-x]src/third_party/scons-3.0.4/scons-time.py (renamed from src/third_party/scons-2.5.0/scons-time.py)61
-rw-r--r--src/third_party/scons-3.0.4/scons.bat38
-rw-r--r--[-rwxr-xr-x]src/third_party/scons-3.0.4/scons.py (renamed from src/third_party/scons-2.5.0/scons.py)119
-rw-r--r--[-rwxr-xr-x]src/third_party/scons-3.0.4/sconsign.py (renamed from src/third_party/scons-2.5.0/sconsign.py)289
222 files changed, 7310 insertions, 4872 deletions
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/BoolOption.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/BoolOption.py
deleted file mode 100644
index 3c583868e46..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/BoolOption.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Options/BoolOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-__doc__ = """Place-holder for the old SCons.Options module hierarchy
-
-This is for backwards compatibility. The new equivalent is the Variables/
-class hierarchy. These will have deprecation warnings added (some day),
-and will then be removed entirely (some day).
-"""
-
-import SCons.Variables
-import SCons.Warnings
-
-warned = False
-
-def BoolOption(*args, **kw):
- global warned
- if not warned:
- msg = "The BoolOption() function is deprecated; use the BoolVariable() function instead."
- SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
- warned = True
- return SCons.Variables.BoolVariable(*args, **kw)
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/EnumOption.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/EnumOption.py
deleted file mode 100644
index 913aef68f0a..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/EnumOption.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Options/EnumOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-__doc__ = """Place-holder for the old SCons.Options module hierarchy
-
-This is for backwards compatibility. The new equivalent is the Variables/
-class hierarchy. These will have deprecation warnings added (some day),
-and will then be removed entirely (some day).
-"""
-
-import SCons.Variables
-import SCons.Warnings
-
-warned = False
-
-def EnumOption(*args, **kw):
- global warned
- if not warned:
- msg = "The EnumOption() function is deprecated; use the EnumVariable() function instead."
- SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
- warned = True
- return SCons.Variables.EnumVariable(*args, **kw)
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/ListOption.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/ListOption.py
deleted file mode 100644
index 820358d3a2b..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/ListOption.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Options/ListOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-__doc__ = """Place-holder for the old SCons.Options module hierarchy
-
-This is for backwards compatibility. The new equivalent is the Variables/
-class hierarchy. These will have deprecation warnings added (some day),
-and will then be removed entirely (some day).
-"""
-
-import SCons.Variables
-import SCons.Warnings
-
-warned = False
-
-def ListOption(*args, **kw):
- global warned
- if not warned:
- msg = "The ListOption() function is deprecated; use the ListVariable() function instead."
- SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
- warned = True
- return SCons.Variables.ListVariable(*args, **kw)
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/PackageOption.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/PackageOption.py
deleted file mode 100644
index 4d27f9cdf36..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/PackageOption.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Options/PackageOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-__doc__ = """Place-holder for the old SCons.Options module hierarchy
-
-This is for backwards compatibility. The new equivalent is the Variables/
-class hierarchy. These will have deprecation warnings added (some day),
-and will then be removed entirely (some day).
-"""
-
-import SCons.Variables
-import SCons.Warnings
-
-warned = False
-
-def PackageOption(*args, **kw):
- global warned
- if not warned:
- msg = "The PackageOption() function is deprecated; use the PackageVariable() function instead."
- SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
- warned = True
- return SCons.Variables.PackageVariable(*args, **kw)
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/PathOption.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/PathOption.py
deleted file mode 100644
index db7f921f207..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/PathOption.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Options/PathOption.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-__doc__ = """Place-holder for the old SCons.Options module hierarchy
-
-This is for backwards compatibility. The new equivalent is the Variables/
-class hierarchy. These will have deprecation warnings added (some day),
-and will then be removed entirely (some day).
-"""
-
-import SCons.Variables
-import SCons.Warnings
-
-warned = False
-
-class _PathOptionClass(object):
- def warn(self):
- global warned
- if not warned:
- msg = "The PathOption() function is deprecated; use the PathVariable() function instead."
- SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
- warned = True
-
- def __call__(self, *args, **kw):
- self.warn()
- return SCons.Variables.PathVariable(*args, **kw)
-
- def PathAccept(self, *args, **kw):
- self.warn()
- return SCons.Variables.PathVariable.PathAccept(*args, **kw)
-
- def PathIsDir(self, *args, **kw):
- self.warn()
- return SCons.Variables.PathVariable.PathIsDir(*args, **kw)
-
- def PathIsDirCreate(self, *args, **kw):
- self.warn()
- return SCons.Variables.PathVariable.PathIsDirCreate(*args, **kw)
-
- def PathIsFile(self, *args, **kw):
- self.warn()
- return SCons.Variables.PathVariable.PathIsFile(*args, **kw)
-
- def PathExists(self, *args, **kw):
- self.warn()
- return SCons.Variables.PathVariable.PathExists(*args, **kw)
-
-PathOption = _PathOptionClass()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/__init__.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/__init__.py
deleted file mode 100644
index 6ba4d20ff7b..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Options/__init__.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Options/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-__doc__ = """Place-holder for the old SCons.Options module hierarchy
-
-This is for backwards compatibility. The new equivalent is the Variables/
-class hierarchy. These will have deprecation warnings added (some day),
-and will then be removed entirely (some day).
-"""
-
-import SCons.Variables
-import SCons.Warnings
-
-from BoolOption import BoolOption # okay
-from EnumOption import EnumOption # okay
-from ListOption import ListOption # naja
-from PackageOption import PackageOption # naja
-from PathOption import PathOption # okay
-
-warned = False
-
-class Options(SCons.Variables.Variables):
- def __init__(self, *args, **kw):
- global warned
- if not warned:
- msg = "The Options class is deprecated; use the Variables class instead."
- SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
- warned = True
- SCons.Variables.Variables.__init__(self, *args, **kw)
-
- def AddOptions(self, *args, **kw):
- return SCons.Variables.Variables.AddVariables(self, *args, **kw)
-
- def UnknownOptions(self, *args, **kw):
- return SCons.Variables.Variables.UnknownVariables(self, *args, **kw)
-
- def FormatOptionHelpText(self, *args, **kw):
- return SCons.Variables.Variables.FormatVariableHelpText(self, *args,
- **kw)
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Sig.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Sig.py
deleted file mode 100644
index 2d090982b5c..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Sig.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Sig.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-__doc__ = """Place-holder for the old SCons.Sig module hierarchy
-
-This is no longer used, but code out there (such as the NSIS module on
-the SCons wiki) may try to import SCons.Sig. If so, we generate a warning
-that points them to the line that caused the import, and don't die.
-
-If someone actually tried to use the sub-modules or functions within
-the package (for example, SCons.Sig.MD5.signature()), then they'll still
-get an AttributeError, but at least they'll know where to start looking.
-"""
-
-import SCons.Util
-import SCons.Warnings
-
-msg = 'The SCons.Sig module no longer exists.\n' \
- ' Remove the following "import SCons.Sig" line to eliminate this warning:'
-
-SCons.Warnings.warn(SCons.Warnings.DeprecatedSigModuleWarning, msg)
-
-default_calc = None
-default_module = None
-
-class MD5Null(SCons.Util.Null):
- def __repr__(self):
- return "MD5Null()"
-
-class TimeStampNull(SCons.Util.Null):
- def __repr__(self):
- return "TimeStampNull()"
-
-MD5 = MD5Null()
-TimeStamp = TimeStampNull()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/BitKeeper.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/BitKeeper.py
deleted file mode 100644
index 21a2ab3da44..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/BitKeeper.py
+++ /dev/null
@@ -1,66 +0,0 @@
-"""SCons.Tool.BitKeeper.py
-
-Tool-specific initialization for the BitKeeper source code control
-system.
-
-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 (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/BitKeeper.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import SCons.Action
-import SCons.Builder
-import SCons.Util
-
-def generate(env):
- """Add a Builder factory function and construction variables for
- BitKeeper to an Environment."""
-
- def BitKeeperFactory(env=env):
- """ """
- import SCons.Warnings as W
- W.warn(W.DeprecatedSourceCodeWarning, """The BitKeeper() factory is deprecated and there is no replacement.""")
- act = SCons.Action.Action("$BITKEEPERCOM", "$BITKEEPERCOMSTR")
- return SCons.Builder.Builder(action = act, env = env)
-
- env.BitKeeper = BitKeeperFactory
-
- env['BITKEEPER'] = 'bk'
- env['BITKEEPERGET'] = '$BITKEEPER get'
- env['BITKEEPERGETFLAGS'] = SCons.Util.CLVar('')
- env['BITKEEPERCOM'] = '$BITKEEPERGET $BITKEEPERGETFLAGS $TARGET'
-
-def exists(env):
- return env.Detect('bk')
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/CVS.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/CVS.py
deleted file mode 100644
index 91a8d627ab7..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/CVS.py
+++ /dev/null
@@ -1,72 +0,0 @@
-"""SCons.Tool.CVS.py
-
-Tool-specific initialization for CVS.
-
-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 (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/CVS.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import SCons.Action
-import SCons.Builder
-import SCons.Util
-
-def generate(env):
- """Add a Builder factory function and construction variables for
- CVS to an Environment."""
-
- def CVSFactory(repos, module='', env=env):
- """ """
- import SCons.Warnings as W
- W.warn(W.DeprecatedSourceCodeWarning, """The CVS() factory is deprecated and there is no replacement.""")
- # fail if repos is not an absolute path name?
- if module != '':
- # Don't use os.path.join() because the name we fetch might
- # be across a network and must use POSIX slashes as separators.
- module = module + '/'
- env['CVSCOM'] = '$CVS $CVSFLAGS co $CVSCOFLAGS -d ${TARGET.dir} $CVSMODULE${TARGET.posix}'
- act = SCons.Action.Action('$CVSCOM', '$CVSCOMSTR')
- return SCons.Builder.Builder(action = act,
- env = env,
- CVSREPOSITORY = repos,
- CVSMODULE = module)
-
- env.CVS = CVSFactory
-
- env['CVS'] = 'cvs'
- env['CVSFLAGS'] = SCons.Util.CLVar('-d $CVSREPOSITORY')
- env['CVSCOFLAGS'] = SCons.Util.CLVar('')
- env['CVSCOM'] = '$CVS $CVSFLAGS co $CVSCOFLAGS ${TARGET.posix}'
-
-def exists(env):
- return env.Detect('cvs')
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py
deleted file mode 100644
index 6dfb615b517..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py
+++ /dev/null
@@ -1,413 +0,0 @@
-"""SCons.Tool.GettextCommon module
-
-Used by several tools of `gettext` toolset.
-"""
-
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/GettextCommon.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import SCons.Warnings
-import re
-
-#############################################################################
-class XgettextToolWarning(SCons.Warnings.Warning): pass
-class XgettextNotFound(XgettextToolWarning): pass
-class MsginitToolWarning(SCons.Warnings.Warning): pass
-class MsginitNotFound(MsginitToolWarning): pass
-class MsgmergeToolWarning(SCons.Warnings.Warning): pass
-class MsgmergeNotFound(MsgmergeToolWarning): pass
-class MsgfmtToolWarning(SCons.Warnings.Warning): pass
-class MsgfmtNotFound(MsgfmtToolWarning): pass
-#############################################################################
-SCons.Warnings.enableWarningClass(XgettextToolWarning)
-SCons.Warnings.enableWarningClass(XgettextNotFound)
-SCons.Warnings.enableWarningClass(MsginitToolWarning)
-SCons.Warnings.enableWarningClass(MsginitNotFound)
-SCons.Warnings.enableWarningClass(MsgmergeToolWarning)
-SCons.Warnings.enableWarningClass(MsgmergeNotFound)
-SCons.Warnings.enableWarningClass(MsgfmtToolWarning)
-SCons.Warnings.enableWarningClass(MsgfmtNotFound)
-#############################################################################
-
-#############################################################################
-class _POTargetFactory(object):
- """ A factory of `PO` target files.
-
- Factory defaults differ from these of `SCons.Node.FS.FS`. We set `precious`
- (this is required by builders and actions gettext) and `noclean` flags by
- default for all produced nodes.
- """
- def __init__( self, env, nodefault = True, alias = None, precious = True
- , noclean = True ):
- """ Object constructor.
-
- **Arguments**
-
- - *env* (`SCons.Environment.Environment`)
- - *nodefault* (`boolean`) - if `True`, produced nodes will be ignored
- from default target `'.'`
- - *alias* (`string`) - if provided, produced nodes will be automatically
- added to this alias, and alias will be set as `AlwaysBuild`
- - *precious* (`boolean`) - if `True`, the produced nodes will be set as
- `Precious`.
- - *noclen* (`boolean`) - if `True`, the produced nodes will be excluded
- from `Clean`.
- """
- self.env = env
- self.alias = alias
- self.precious = precious
- self.noclean = noclean
- self.nodefault = nodefault
-
- def _create_node(self, name, factory, directory = None, create = 1):
- """ Create node, and set it up to factory settings. """
- import SCons.Util
- node = factory(name, directory, create)
- node.set_noclean(self.noclean)
- node.set_precious(self.precious)
- if self.nodefault:
- self.env.Ignore('.', node)
- if self.alias:
- self.env.AlwaysBuild(self.env.Alias(self.alias, node))
- return node
-
- def Entry(self, name, directory = None, create = 1):
- """ Create `SCons.Node.FS.Entry` """
- return self._create_node(name, self.env.fs.Entry, directory, create)
-
- def File(self, name, directory = None, create = 1):
- """ Create `SCons.Node.FS.File` """
- return self._create_node(name, self.env.fs.File, directory, create)
-#############################################################################
-
-#############################################################################
-_re_comment = re.compile(r'(#[^\n\r]+)$', re.M)
-_re_lang = re.compile(r'([a-zA-Z0-9_]+)', re.M)
-#############################################################################
-def _read_linguas_from_files(env, linguas_files = None):
- """ Parse `LINGUAS` file and return list of extracted languages """
- import SCons.Util
- import SCons.Environment
- global _re_comment
- global _re_lang
- if not SCons.Util.is_List(linguas_files) \
- and not SCons.Util.is_String(linguas_files) \
- and not isinstance(linguas_files, SCons.Node.FS.Base) \
- and linguas_files:
- # If, linguas_files==True or such, then read 'LINGUAS' file.
- linguas_files = [ 'LINGUAS' ]
- if linguas_files is None:
- return []
- fnodes = env.arg2nodes(linguas_files)
- linguas = []
- for fnode in fnodes:
- contents = _re_comment.sub("", fnode.get_text_contents())
- ls = [ l for l in _re_lang.findall(contents) if l ]
- linguas.extend(ls)
- return linguas
-#############################################################################
-
-#############################################################################
-from SCons.Builder import BuilderBase
-#############################################################################
-class _POFileBuilder(BuilderBase):
- """ `PO` file builder.
-
- This is multi-target single-source builder. In typical situation the source
- is single `POT` file, e.g. `messages.pot`, and there are multiple `PO`
- targets to be updated from this `POT`. We must run
- `SCons.Builder.BuilderBase._execute()` separatelly for each target to track
- dependencies separatelly for each target file.
-
- **NOTE**: if we call `SCons.Builder.BuilderBase._execute(.., target, ...)`
- with target being list of all targets, all targets would be rebuilt each time
- one of the targets from this list is missing. This would happen, for example,
- when new language `ll` enters `LINGUAS_FILE` (at this moment there is no
- `ll.po` file yet). To avoid this, we override
- `SCons.Builder.BuilerBase._execute()` and call it separatelly for each
- target. Here we also append to the target list the languages read from
- `LINGUAS_FILE`.
- """
- #
- #* The argument for overriding _execute(): We must use environment with
- # builder overrides applied (see BuilderBase.__init__(). Here it comes for
- # free.
- #* The argument against using 'emitter': The emitter is called too late
- # by BuilderBase._execute(). If user calls, for example:
- #
- # env.POUpdate(LINGUAS_FILE = 'LINGUAS')
- #
- # the builder throws error, because it is called with target=None,
- # source=None and is trying to "generate" sources or target list first.
- # If user calls
- #
- # env.POUpdate(['foo', 'baz'], LINGUAS_FILE = 'LINGUAS')
- #
- # the env.BuilderWrapper() calls our builder with target=None,
- # source=['foo', 'baz']. The BuilderBase._execute() then splits execution
- # and execute iterativelly (recursion) self._execute(None, source[i]).
- # After that it calls emitter (which is quite too late). The emitter is
- # also called in each iteration, what makes things yet worse.
- def __init__(self, env, **kw):
- if not 'suffix' in kw:
- kw['suffix'] = '$POSUFFIX'
- if not 'src_suffix' in kw:
- kw['src_suffix'] = '$POTSUFFIX'
- if not 'src_builder' in kw:
- kw['src_builder'] = '_POTUpdateBuilder'
- if not 'single_source' in kw:
- kw['single_source'] = True
- alias = None
- if 'target_alias' in kw:
- alias = kw['target_alias']
- del kw['target_alias']
- if not 'target_factory' in kw:
- kw['target_factory'] = _POTargetFactory(env, alias=alias).File
- BuilderBase.__init__(self, **kw)
-
- def _execute(self, env, target, source, *args, **kw):
- """ Execute builder's actions.
-
- Here we append to `target` the languages read from `$LINGUAS_FILE` and
- apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.
- The arguments and return value are same as for
- `SCons.Builder.BuilderBase._execute()`.
- """
- import SCons.Util
- import SCons.Node
- linguas_files = None
- if env.has_key('LINGUAS_FILE') and env['LINGUAS_FILE']:
- linguas_files = env['LINGUAS_FILE']
- # This prevents endless recursion loop (we'll be invoked once for
- # each target appended here, we must not extend the list again).
- env['LINGUAS_FILE'] = None
- linguas = _read_linguas_from_files(env,linguas_files)
- if SCons.Util.is_List(target):
- target.extend(linguas)
- elif target is not None:
- target = [target] + linguas
- else:
- target = linguas
- if not target:
- # Let the SCons.BuilderBase to handle this patologic situation
- return BuilderBase._execute( self, env, target, source, *args, **kw)
- # The rest is ours
- if not SCons.Util.is_List(target):
- target = [ target ]
- result = []
- for tgt in target:
- r = BuilderBase._execute( self, env, [tgt], source, *args, **kw)
- result.extend(r)
- if linguas_files is not None:
- env['LINGUAS_FILE'] = linguas_files
- return SCons.Node.NodeList(result)
-#############################################################################
-
-import SCons.Environment
-#############################################################################
-def _translate(env, target=None, source=SCons.Environment._null, *args, **kw):
- """ Function for `Translate()` pseudo-builder """
- if target is None: target = []
- pot = env.POTUpdate(None, source, *args, **kw)
- po = env.POUpdate(target, pot, *args, **kw)
- return po
-#############################################################################
-
-#############################################################################
-class RPaths(object):
- """ Callable object, which returns pathnames relative to SCons current
- working directory.
-
- It seems like `SCons.Node.FS.Base.get_path()` returns absolute paths
- for nodes that are outside of current working directory (`env.fs.getcwd()`).
- Here, we often have `SConscript`, `POT` and `PO` files within `po/`
- directory and source files (e.g. `*.c`) outside of it. When generating `POT`
- template file, references to source files are written to `POT` template, so
- a translator may later quickly jump to appropriate source file and line from
- its `PO` editor (e.g. `poedit`). Relative paths in `PO` file are usually
- interpreted by `PO` editor as paths relative to the place, where `PO` file
- lives. The absolute paths would make resultant `POT` file nonportable, as
- the references would be correct only on the machine, where `POT` file was
- recently re-created. For such reason, we need a function, which always
- returns relative paths. This is the purpose of `RPaths` callable object.
-
- The `__call__` method returns paths relative to current working directory, but
- we assume, that *xgettext(1)* is run from the directory, where target file is
- going to be created.
-
- Note, that this may not work for files distributed over several hosts or
- across different drives on windows. We assume here, that single local
- filesystem holds both source files and target `POT` templates.
-
- Intended use of `RPaths` - in `xgettext.py`::
-
- def generate(env):
- from GettextCommon import RPaths
- ...
- sources = '$( ${_concat( "", SOURCES, "", __env__, XgettextRPaths, TARGET, SOURCES)} $)'
- env.Append(
- ...
- XGETTEXTCOM = 'XGETTEXT ... ' + sources,
- ...
- XgettextRPaths = RPaths(env)
- )
- """
- # NOTE: This callable object returns pathnames of dirs/files relative to
- # current working directory. The pathname remains relative also for entries
- # that are outside of current working directory (node, that
- # SCons.Node.FS.File and siblings return absolute path in such case). For
- # simplicity we compute path relative to current working directory, this
- # seems be enough for our purposes (don't need TARGET variable and
- # SCons.Defaults.Variable_Caller stuff).
-
- def __init__(self, env):
- """ Initialize `RPaths` callable object.
-
- **Arguments**:
-
- - *env* - a `SCons.Environment.Environment` object, defines *current
- working dir*.
- """
- self.env = env
-
- # FIXME: I'm not sure, how it should be implemented (what the *args are in
- # general, what is **kw).
- def __call__(self, nodes, *args, **kw):
- """ Return nodes' paths (strings) relative to current working directory.
-
- **Arguments**:
-
- - *nodes* ([`SCons.Node.FS.Base`]) - list of nodes.
- - *args* - currently unused.
- - *kw* - currently unused.
-
- **Returns**:
-
- - Tuple of strings, which represent paths relative to current working
- directory (for given environment).
- """
- import os
- import SCons.Node.FS
- rpaths = ()
- cwd = self.env.fs.getcwd().get_abspath()
- for node in nodes:
- rpath = None
- if isinstance(node, SCons.Node.FS.Base):
- rpath = os.path.relpath(node.get_abspath(), cwd)
- # FIXME: Other types possible here?
- if rpath is not None:
- rpaths += (rpath,)
- return rpaths
-#############################################################################
-
-#############################################################################
-def _init_po_files(target, source, env):
- """ Action function for `POInit` builder. """
- nop = lambda target, source, env : 0
- if env.has_key('POAUTOINIT'):
- autoinit = env['POAUTOINIT']
- else:
- autoinit = False
- # Well, if everything outside works well, this loop should do single
- # iteration. Otherwise we are rebuilding all the targets even, if just
- # one has changed (but is this our fault?).
- for tgt in target:
- if not tgt.exists():
- if autoinit:
- action = SCons.Action.Action('$MSGINITCOM', '$MSGINITCOMSTR')
- else:
- msg = 'File ' + repr(str(tgt)) + ' does not exist. ' \
- + 'If you are a translator, you can create it through: \n' \
- + '$MSGINITCOM'
- action = SCons.Action.Action(nop, msg)
- status = action([tgt], source, env)
- if status: return status
- return 0
-#############################################################################
-
-#############################################################################
-def _detect_xgettext(env):
- """ Detects *xgettext(1)* binary """
- if env.has_key('XGETTEXT'):
- return env['XGETTEXT']
- xgettext = env.Detect('xgettext');
- if xgettext:
- return xgettext
- raise SCons.Errors.StopError(XgettextNotFound,"Could not detect xgettext")
- return None
-#############################################################################
-def _xgettext_exists(env):
- return _detect_xgettext(env)
-#############################################################################
-
-#############################################################################
-def _detect_msginit(env):
- """ Detects *msginit(1)* program. """
- if env.has_key('MSGINIT'):
- return env['MSGINIT']
- msginit = env.Detect('msginit');
- if msginit:
- return msginit
- raise SCons.Errors.StopError(MsginitNotFound, "Could not detect msginit")
- return None
-#############################################################################
-def _msginit_exists(env):
- return _detect_msginit(env)
-#############################################################################
-
-#############################################################################
-def _detect_msgmerge(env):
- """ Detects *msgmerge(1)* program. """
- if env.has_key('MSGMERGE'):
- return env['MSGMERGE']
- msgmerge = env.Detect('msgmerge');
- if msgmerge:
- return msgmerge
- raise SCons.Errors.StopError(MsgmergeNotFound, "Could not detect msgmerge")
- return None
-#############################################################################
-def _msgmerge_exists(env):
- return _detect_msgmerge(env)
-#############################################################################
-
-#############################################################################
-def _detect_msgfmt(env):
- """ Detects *msgmfmt(1)* program. """
- if env.has_key('MSGFMT'):
- return env['MSGFMT']
- msgfmt = env.Detect('msgfmt');
- if msgfmt:
- return msgfmt
- raise SCons.Errors.StopError(MsgfmtNotFound, "Could not detect msgfmt")
- return None
-#############################################################################
-def _msgfmt_exists(env):
- return _detect_msgfmt(env)
-#############################################################################
-
-#############################################################################
-def tool_list(platform, env):
- """ List tools that shall be generated by top-level `gettext` tool """
- return [ 'xgettext', 'msginit', 'msgmerge', 'msgfmt' ]
-#############################################################################
-
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/Perforce.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/Perforce.py
deleted file mode 100644
index 47d609658dd..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/Perforce.py
+++ /dev/null
@@ -1,99 +0,0 @@
-"""SCons.Tool.Perforce.py
-
-Tool-specific initialization for Perforce Source Code Management system.
-
-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 (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/Perforce.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import os
-
-import SCons.Action
-import SCons.Builder
-import SCons.Node.FS
-import SCons.Util
-
-
-# Variables that we want to import from the base OS environment.
-_import_env = [ 'P4PORT', 'P4CLIENT', 'P4USER', 'USER', 'USERNAME', 'P4PASSWD',
- 'P4CHARSET', 'P4LANGUAGE', 'SystemRoot' ]
-
-PerforceAction = SCons.Action.Action('$P4COM', '$P4COMSTR')
-
-def generate(env):
- """Add a Builder factory function and construction variables for
- Perforce to an Environment."""
-
- def PerforceFactory(env=env):
- """ """
- import SCons.Warnings as W
- W.warn(W.DeprecatedSourceCodeWarning, """The Perforce() factory is deprecated and there is no replacement.""")
- return SCons.Builder.Builder(action = PerforceAction, env = env)
-
- env.Perforce = PerforceFactory
-
- env['P4'] = 'p4'
- env['P4FLAGS'] = SCons.Util.CLVar('')
- env['P4COM'] = '$P4 $P4FLAGS sync $TARGET'
- try:
- environ = env['ENV']
- except KeyError:
- environ = {}
- env['ENV'] = environ
-
- # Perforce seems to use the PWD environment variable rather than
- # calling getcwd() for itself, which is odd. If no PWD variable
- # is present, p4 WILL call getcwd, but this seems to cause problems
- # with good ol' Windows's tilde-mangling for long file names.
- environ['PWD'] = env.Dir('#').get_abspath()
-
- for var in _import_env:
- v = os.environ.get(var)
- if v:
- environ[var] = v
-
- if SCons.Util.can_read_reg:
- # If we can read the registry, add the path to Perforce to our environment.
- try:
- k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,
- 'Software\\Perforce\\environment')
- val, tok = SCons.Util.RegQueryValueEx(k, 'P4INSTROOT')
- SCons.Util.AddPathIfNotExists(environ, 'PATH', val)
- except SCons.Util.RegError:
- # Can't detect where Perforce is, hope the user has it set in the
- # PATH.
- pass
-
-def exists(env):
- return env.Detect('p4')
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/RCS.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/RCS.py
deleted file mode 100644
index 29dec38d836..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/RCS.py
+++ /dev/null
@@ -1,63 +0,0 @@
-"""SCons.Tool.RCS.py
-
-Tool-specific initialization for RCS.
-
-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 (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/RCS.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import SCons.Action
-import SCons.Builder
-import SCons.Util
-
-def generate(env):
- """Add a Builder factory function and construction variables for
- RCS to an Environment."""
-
- def RCSFactory(env=env):
- """ """
- import SCons.Warnings as W
- W.warn(W.DeprecatedSourceCodeWarning, """The RCS() factory is deprecated and there is no replacement.""")
- act = SCons.Action.Action('$RCS_COCOM', '$RCS_COCOMSTR')
- return SCons.Builder.Builder(action = act, env = env)
-
- env.RCS = RCSFactory
-
- env['RCS'] = 'rcs'
- env['RCS_CO'] = 'co'
- env['RCS_COFLAGS'] = SCons.Util.CLVar('')
- env['RCS_COCOM'] = '$RCS_CO $RCS_COFLAGS $TARGET'
-
-def exists(env):
- return env.Detect('rcs')
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/SCCS.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/SCCS.py
deleted file mode 100644
index faf10b55079..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/SCCS.py
+++ /dev/null
@@ -1,63 +0,0 @@
-"""SCons.Tool.SCCS.py
-
-Tool-specific initialization for SCCS.
-
-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 (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/SCCS.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import SCons.Action
-import SCons.Builder
-import SCons.Util
-
-def generate(env):
- """Add a Builder factory function and construction variables for
- SCCS to an Environment."""
-
- def SCCSFactory(env=env):
- """ """
- import SCons.Warnings as W
- W.warn(W.DeprecatedSourceCodeWarning, """The SCCS() factory is deprecated and there is no replacement.""")
- act = SCons.Action.Action('$SCCSCOM', '$SCCSCOMSTR')
- return SCons.Builder.Builder(action = act, env = env)
-
- env.SCCS = SCCSFactory
-
- env['SCCS'] = 'sccs'
- env['SCCSFLAGS'] = SCons.Util.CLVar('')
- env['SCCSGETFLAGS'] = SCons.Util.CLVar('')
- env['SCCSCOM'] = '$SCCS $SCCSFLAGS get $SCCSGETFLAGS $TARGET'
-
-def exists(env):
- return env.Detect('sccs')
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/Subversion.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/Subversion.py
deleted file mode 100644
index f1f10df26cc..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/Subversion.py
+++ /dev/null
@@ -1,70 +0,0 @@
-"""SCons.Tool.Subversion.py
-
-Tool-specific initialization for Subversion.
-
-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 (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/Subversion.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import os.path
-
-import SCons.Action
-import SCons.Builder
-import SCons.Util
-
-def generate(env):
- """Add a Builder factory function and construction variables for
- Subversion to an Environment."""
-
- def SubversionFactory(repos, module='', env=env):
- """ """
- # fail if repos is not an absolute path name?
- import SCons.Warnings as W
- W.warn(W.DeprecatedSourceCodeWarning, """The Subversion() factory is deprecated and there is no replacement.""")
- if module != '':
- module = os.path.join(module, '')
- act = SCons.Action.Action('$SVNCOM', '$SVNCOMSTR')
- return SCons.Builder.Builder(action = act,
- env = env,
- SVNREPOSITORY = repos,
- SVNMODULE = module)
-
- env.Subversion = SubversionFactory
-
- env['SVN'] = 'svn'
- env['SVNFLAGS'] = SCons.Util.CLVar('')
- env['SVNCOM'] = '$SVN $SVNFLAGS cat $SVNREPOSITORY/$SVNMODULE$TARGET > $TARGET'
-
-def exists(env):
- return env.Detect('svn')
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/applelink.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/applelink.py
deleted file mode 100644
index 5760ac81945..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/applelink.py
+++ /dev/null
@@ -1,71 +0,0 @@
-"""SCons.Tool.applelink
-
-Tool-specific initialization for the Apple gnu-like 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.
-
-"""
-
-#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/applelink.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import SCons.Util
-
-# Even though the Mac is based on the GNU toolchain, it doesn't understand
-# the -rpath option, so we use the "link" tool instead of "gnulink".
-import link
-
-def generate(env):
- """Add Builders and construction variables for applelink to an
- Environment."""
- link.generate(env)
-
- env['FRAMEWORKPATHPREFIX'] = '-F'
- env['_FRAMEWORKPATH'] = '${_concat(FRAMEWORKPATHPREFIX, FRAMEWORKPATH, "", __env__, RDirs)}'
- env['_FRAMEWORKS'] = '${_concat("-framework ", FRAMEWORKS, "", __env__)}'
- env['LINKCOM'] = env['LINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'
- env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -dynamiclib')
- env['SHLINKCOM'] = env['SHLINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'
-
- # override the default for loadable modules, which are different
- # on OS X than dynamic shared libs. echoing what XCode does for
- # pre/suffixes:
- env['LDMODULEPREFIX'] = ''
- env['LDMODULESUFFIX'] = ''
- env['LDMODULEFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -bundle')
- env['LDMODULECOM'] = '$LDMODULE -o ${TARGET} $LDMODULEFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'
-
-
-
-def exists(env):
- return env['PLATFORM'] == 'darwin'
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/jar.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/jar.py
deleted file mode 100644
index eed1bc627e3..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/jar.py
+++ /dev/null
@@ -1,116 +0,0 @@
-"""SCons.Tool.jar
-
-Tool-specific initialization for jar.
-
-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 (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/jar.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import SCons.Subst
-import SCons.Util
-
-def jarSources(target, source, env, for_signature):
- """Only include sources that are not a manifest file."""
- try:
- env['JARCHDIR']
- except KeyError:
- jarchdir_set = False
- else:
- jarchdir_set = True
- jarchdir = env.subst('$JARCHDIR', target=target, source=source)
- if jarchdir:
- jarchdir = env.fs.Dir(jarchdir)
- result = []
- for src in source:
- contents = src.get_text_contents()
- if contents[:16] != "Manifest-Version":
- if jarchdir_set:
- _chdir = jarchdir
- else:
- try:
- _chdir = src.attributes.java_classdir
- except AttributeError:
- _chdir = None
- if _chdir:
- # If we are changing the dir with -C, then sources should
- # be relative to that directory.
- src = SCons.Subst.Literal(src.get_path(_chdir))
- result.append('-C')
- result.append(_chdir)
- result.append(src)
- return result
-
-def jarManifest(target, source, env, for_signature):
- """Look in sources for a manifest file, if any."""
- for src in source:
- contents = src.get_text_contents()
- if contents[:16] == "Manifest-Version":
- return src
- return ''
-
-def jarFlags(target, source, env, for_signature):
- """If we have a manifest, make sure that the 'm'
- flag is specified."""
- jarflags = env.subst('$JARFLAGS', target=target, source=source)
- for src in source:
- contents = src.get_text_contents()
- if contents[:16] == "Manifest-Version":
- if not 'm' in jarflags:
- return jarflags + 'm'
- break
- return jarflags
-
-def generate(env):
- """Add Builders and construction variables for jar to an Environment."""
- SCons.Tool.CreateJarBuilder(env)
-
- env['JAR'] = 'jar'
- env['JARFLAGS'] = SCons.Util.CLVar('cf')
- env['_JARFLAGS'] = jarFlags
- env['_JARMANIFEST'] = jarManifest
- env['_JARSOURCES'] = jarSources
- env['_JARCOM'] = '$JAR $_JARFLAGS $TARGET $_JARMANIFEST $_JARSOURCES'
- env['JARCOM'] = "${TEMPFILE('$_JARCOM','$JARCOMSTR')}"
- env['JARSUFFIX'] = '.jar'
-
-def exists(env):
- # As reported by Jan Nijtmans in issue #2730, the simple
- # return env.Detect('jar')
- # doesn't always work during initialization. For now, we
- # stop trying to detect an executable (analogous to the
- # javac Builder).
- # TODO: Come up with a proper detect() routine...and enable it.
- return 1
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/xgettext.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/xgettext.py
deleted file mode 100644
index 153d71f74de..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/xgettext.py
+++ /dev/null
@@ -1,339 +0,0 @@
-""" xgettext tool
-
-Tool specific initialization of `xgettext` tool.
-"""
-
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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__ = "src/engine/SCons/Tool/xgettext.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-#############################################################################
-class _CmdRunner(object):
- """ Callabe object, which runs shell command storing its stdout and stderr to
- variables. It also provides `strfunction()` method, which shall be used by
- scons Action objects to print command string. """
-
- def __init__( self, command, commandstr = None):
- self.out = None
- self.err = None
- self.status = None
- self.command = command
- self.commandstr = commandstr
-
- def __call__(self, target, source, env):
- import SCons.Action
- import subprocess
- import os
- import sys
- kw = {
- 'stdin' : 'devnull',
- 'stdout' : subprocess.PIPE,
- 'stderr' : subprocess.PIPE,
- 'universal_newlines' : True,
- 'shell' : True
- }
- command = env.subst(self.command, target = target, source = source)
- proc = SCons.Action._subproc(env, command, **kw)
- self.out, self.err = proc.communicate()
- self.status = proc.wait()
- if self.err: sys.stderr.write(unicode(self.err))
- return self.status
-
- def strfunction(self, target, source, env):
- import os
- comstr = self.commandstr
- if env.subst(comstr, target = target, source = source) == "":
- comstr = self.command
- s = env.subst(comstr, target = target, source = source)
- return s
-#############################################################################
-
-#############################################################################
-def _update_pot_file(target, source, env):
- """ Action function for `POTUpdate` builder """
- import re
- import os
- import SCons.Action
- nop = lambda target, source, env : 0
-
- # Save scons cwd and os cwd (NOTE: they may be different. After the job, we
- # revert each one to its original state).
- save_cwd = env.fs.getcwd()
- save_os_cwd = os.getcwd()
- chdir = target[0].dir
- chdir_str = repr(chdir.get_abspath())
- # Print chdir message (employ SCons.Action.Action for that. It knows better
- # than me how to to this correctly).
- env.Execute(SCons.Action.Action(nop, "Entering " + chdir_str))
- # Go to target's directory and do our job
- env.fs.chdir(chdir, 1) # Go into target's directory
- try:
- cmd = _CmdRunner('$XGETTEXTCOM', '$XGETTEXTCOMSTR')
- action = SCons.Action.Action(cmd, strfunction=cmd.strfunction)
- status = action([ target[0] ], source, env)
- except:
- # Something went wrong.
- env.Execute(SCons.Action.Action(nop, "Leaving " + chdir_str))
- # Revert working dirs to previous state and re-throw exception.
- env.fs.chdir(save_cwd, 0)
- os.chdir(save_os_cwd)
- raise
- # Print chdir message.
- env.Execute(SCons.Action.Action(nop, "Leaving " + chdir_str))
- # Revert working dirs to previous state.
- env.fs.chdir(save_cwd, 0)
- os.chdir(save_os_cwd)
- # If the command was not successfull, return error code.
- if status: return status
-
- new_content = cmd.out
-
- if not new_content:
- # When xgettext finds no internationalized messages, no *.pot is created
- # (because we don't want to bother translators with empty POT files).
- needs_update = False
- explain = "no internationalized messages encountered"
- else:
- if target[0].exists():
- # If the file already exists, it's left unaltered unless its messages
- # are outdated (w.r.t. to these recovered by xgettext from sources).
- old_content = target[0].get_text_contents()
- re_cdate = re.compile(r'^"POT-Creation-Date: .*"$[\r\n]?', re.M)
- old_content_nocdate = re.sub(re_cdate,"",old_content)
- new_content_nocdate = re.sub(re_cdate,"",new_content)
- if(old_content_nocdate == new_content_nocdate):
- # Messages are up-to-date
- needs_update = False
- explain = "messages in file found to be up-to-date"
- else:
- # Messages are outdated
- needs_update = True
- explain = "messages in file were outdated"
- else:
- # No POT file found, create new one
- needs_update = True
- explain = "new file"
- if needs_update:
- # Print message employing SCons.Action.Action for that.
- msg = "Writing " + repr(str(target[0])) + " (" + explain + ")"
- env.Execute(SCons.Action.Action(nop, msg))
- f = open(str(target[0]),"w")
- f.write(new_content)
- f.close()
- return 0
- else:
- # Print message employing SCons.Action.Action for that.
- msg = "Not writing " + repr(str(target[0])) + " (" + explain + ")"
- env.Execute(SCons.Action.Action(nop, msg))
- return 0
-#############################################################################
-
-#############################################################################
-from SCons.Builder import BuilderBase
-#############################################################################
-class _POTBuilder(BuilderBase):
- def _execute(self, env, target, source, *args):
- if not target:
- if env.has_key('POTDOMAIN') and env['POTDOMAIN']:
- domain = env['POTDOMAIN']
- else:
- domain = 'messages'
- target = [ domain ]
- return BuilderBase._execute(self, env, target, source, *args)
-#############################################################################
-
-#############################################################################
-def _scan_xgettext_from_files(target, source, env, files = None, path = None):
- """ Parses `POTFILES.in`-like file and returns list of extracted file names.
- """
- import re
- import SCons.Util
- import SCons.Node.FS
-
- if files is None:
- return 0
- if not SCons.Util.is_List(files):
- files = [ files ]
-
- if path is None:
- if env.has_key('XGETTEXTPATH'):
- path = env['XGETTEXTPATH']
- else:
- path = []
- if not SCons.Util.is_List(path):
- path = [ path ]
-
- path = SCons.Util.flatten(path)
-
- dirs = ()
- for p in path:
- if not isinstance(p, SCons.Node.FS.Base):
- if SCons.Util.is_String(p):
- p = env.subst(p, source = source, target = target)
- p = env.arg2nodes(p, env.fs.Dir)
- dirs += tuple(p)
- # cwd is the default search path (when no path is defined by user)
- if not dirs:
- dirs = (env.fs.getcwd(),)
-
- # Parse 'POTFILE.in' files.
- re_comment = re.compile(r'^#[^\n\r]*$\r?\n?', re.M)
- re_emptyln = re.compile(r'^[ \t\r]*$\r?\n?', re.M)
- re_trailws = re.compile(r'[ \t\r]+$')
- for f in files:
- # Find files in search path $XGETTEXTPATH
- if isinstance(f, SCons.Node.FS.Base) and f.rexists():
- contents = f.get_text_contents()
- contents = re_comment.sub("", contents)
- contents = re_emptyln.sub("", contents)
- contents = re_trailws.sub("", contents)
- depnames = contents.splitlines()
- for depname in depnames:
- depfile = SCons.Node.FS.find_file(depname, dirs)
- if not depfile:
- depfile = env.arg2nodes(depname, dirs[0].File)
- env.Depends(target, depfile)
- return 0
-#############################################################################
-
-#############################################################################
-def _pot_update_emitter(target, source, env):
- """ Emitter function for `POTUpdate` builder """
- from SCons.Tool.GettextCommon import _POTargetFactory
- import SCons.Util
- import SCons.Node.FS
-
- if env.has_key('XGETTEXTFROM'):
- xfrom = env['XGETTEXTFROM']
- else:
- return target, source
- if not SCons.Util.is_List(xfrom):
- xfrom = [ xfrom ]
-
- xfrom = SCons.Util.flatten(xfrom)
-
- # Prepare list of 'POTFILE.in' files.
- files = []
- for xf in xfrom:
- if not isinstance(xf, SCons.Node.FS.Base):
- if SCons.Util.is_String(xf):
- # Interpolate variables in strings
- xf = env.subst(xf, source = source, target = target)
- xf = env.arg2nodes(xf)
- files.extend(xf)
- if files:
- env.Depends(target, files)
- _scan_xgettext_from_files(target, source, env, files)
- return target, source
-#############################################################################
-
-#############################################################################
-from SCons.Environment import _null
-#############################################################################
-def _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw):
- return env._POTUpdateBuilder(target, source, **kw)
-#############################################################################
-
-#############################################################################
-def _POTUpdateBuilder(env, **kw):
- """ Creates `POTUpdate` builder object """
- import SCons.Action
- from SCons.Tool.GettextCommon import _POTargetFactory
- kw['action'] = SCons.Action.Action(_update_pot_file, None)
- kw['suffix'] = '$POTSUFFIX'
- kw['target_factory'] = _POTargetFactory(env, alias='$POTUPDATE_ALIAS').File
- kw['emitter'] = _pot_update_emitter
- return _POTBuilder(**kw)
-#############################################################################
-
-#############################################################################
-def generate(env,**kw):
- """ Generate `xgettext` tool """
- import SCons.Util
- from SCons.Tool.GettextCommon import RPaths, _detect_xgettext
-
- try:
- env['XGETTEXT'] = _detect_xgettext(env)
- except:
- env['XGETTEXT'] = 'xgettext'
- # NOTE: sources="$SOURCES" would work as well. However, we use following
- # construction to convert absolute paths provided by scons onto paths
- # relative to current working dir. Note, that scons expands $SOURCE(S) to
- # absolute paths for sources $SOURCE(s) outside of current subtree (e.g. in
- # "../"). With source=$SOURCE these absolute paths would be written to the
- # resultant *.pot file (and its derived *.po files) as references to lines in
- # source code (e.g. referring lines in *.c files). Such references would be
- # correct (e.g. in poedit) only on machine on which *.pot was generated and
- # would be of no use on other hosts (having a copy of source code located
- # in different place in filesystem).
- sources = '$( ${_concat( "", SOURCES, "", __env__, XgettextRPaths, TARGET' \
- + ', SOURCES)} $)'
-
- # NOTE: the output from $XGETTEXTCOM command must go to stdout, not to a file.
- # This is required by the POTUpdate builder's action.
- xgettextcom = '$XGETTEXT $XGETTEXTFLAGS $_XGETTEXTPATHFLAGS' \
- + ' $_XGETTEXTFROMFLAGS -o - ' + sources
-
- xgettextpathflags = '$( ${_concat( XGETTEXTPATHPREFIX, XGETTEXTPATH' \
- + ', XGETTEXTPATHSUFFIX, __env__, RDirs, TARGET, SOURCES)} $)'
- xgettextfromflags = '$( ${_concat( XGETTEXTFROMPREFIX, XGETTEXTFROM' \
- + ', XGETTEXTFROMSUFFIX, __env__, target=TARGET, source=SOURCES)} $)'
-
- env.SetDefault(
- _XGETTEXTDOMAIN = '${TARGET.filebase}',
- XGETTEXTFLAGS = [ ],
- XGETTEXTCOM = xgettextcom,
- XGETTEXTCOMSTR = '',
- XGETTEXTPATH = [ ],
- XGETTEXTPATHPREFIX = '-D',
- XGETTEXTPATHSUFFIX = '',
- XGETTEXTFROM = None,
- XGETTEXTFROMPREFIX = '-f',
- XGETTEXTFROMSUFFIX = '',
- _XGETTEXTPATHFLAGS = xgettextpathflags,
- _XGETTEXTFROMFLAGS = xgettextfromflags,
- POTSUFFIX = ['.pot'],
- POTUPDATE_ALIAS = 'pot-update',
- XgettextRPaths = RPaths(env)
- )
- env.Append( BUILDERS = {
- '_POTUpdateBuilder' : _POTUpdateBuilder(env)
- } )
- env.AddMethod(_POTUpdateBuilderWrapper, 'POTUpdate')
- env.AlwaysBuild(env.Alias('$POTUPDATE_ALIAS'))
-#############################################################################
-
-#############################################################################
-def exists(env):
- """ Check, whether the tool exists """
- from SCons.Tool.GettextCommon import _xgettext_exists
- try:
- return _xgettext_exists(env)
- except:
- return False
-#############################################################################
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_builtins.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_builtins.py
deleted file mode 100644
index cc97faf8f28..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_builtins.py
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# Copyright (c) 2001 - 2015 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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.
-#
-
-# Portions of the following are derived from the compat.py file in
-# Twisted, under the following copyright:
-#
-# Copyright (c) 2001-2004 Twisted Matrix Laboratories
-
-__doc__ = """
-Compatibility idioms for builtins names
-
-This module adds names to the builtins module for things that we want
-to use in SCons but which don't show up until later Python versions than
-the earliest ones we support.
-
-This module checks for the following builtins names:
-
- all()
- any()
- memoryview()
-
-Implementations of functions are *NOT* guaranteed to be fully compliant
-with these functions in later versions of Python. We are only concerned
-with adding functionality that we actually use in SCons, so be wary
-if you lift this code for other uses. (That said, making these more
-nearly the same as later, official versions is still a desirable goal,
-we just don't need to be obsessive about it.)
-
-If you're looking at this with pydoc and various names don't show up in
-the FUNCTIONS or DATA output, that means those names are already built in
-to this version of Python and we don't need to add them from this module.
-"""
-
-__revision__ = "src/engine/SCons/compat/_scons_builtins.py rel_2.4.1:3480:df381b06597b 2015/11/21 07:35:35 bdbaddog"
-
-import builtins
-
-try:
- all
-except NameError:
- # Pre-2.5 Python has no all() function.
- def all(iterable):
- """
- Returns True if all elements of the iterable are true.
- """
- for element in iterable:
- if not element:
- return False
- return True
- builtins.all = all
- all = all
-
-try:
- any
-except NameError:
- # Pre-2.5 Python has no any() function.
- def any(iterable):
- """
- Returns True if any element of the iterable is true.
- """
- for element in iterable:
- if element:
- return True
- return False
- builtins.any = any
- any = any
-
-try:
- memoryview
-except NameError:
- # Pre-2.7 doesn't have the memoryview() built-in.
- class memoryview(object):
- def __init__(self, obj):
- # wrapping buffer in () keeps the fixer from changing it
- self.obj = (buffer)(obj)
- def __getitem__(self, indx):
- if isinstance(indx, slice):
- return self.obj[indx.start:indx.stop]
- else:
- return self.obj[indx]
- builtins.memoryview = memoryview
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_hashlib.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_hashlib.py
deleted file mode 100644
index e86078262a2..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_hashlib.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# Copyright (c) 2001 - 2015 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# 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.
-#
-
-__doc__ = """
-hashlib backwards-compatibility module for older (pre-2.5) Python versions
-
-This does not not NOT (repeat, *NOT*) provide complete hashlib
-functionality. It only wraps the portions of MD5 functionality used
-by SCons, in an interface that looks like hashlib (or enough for our
-purposes, anyway). In fact, this module will raise an ImportError if
-the underlying md5 module isn't available.
-"""
-
-__revision__ = "src/engine/SCons/compat/_scons_hashlib.py rel_2.4.1:3480:df381b06597b 2015/11/21 07:35:35 bdbaddog"
-
-import md5
-from string import hexdigits
-
-class md5obj(object):
-
- md5_module = md5
-
- def __init__(self, name, string=''):
- if not name in ('MD5', 'md5'):
- raise ValueError("unsupported hash type")
- self.name = 'md5'
- self.m = self.md5_module.md5()
-
- def __repr__(self):
- return '<%s HASH object @ %#x>' % (self.name, id(self))
-
- def copy(self):
- import copy
- result = copy.copy(self)
- result.m = self.m.copy()
- return result
-
- def digest(self):
- return self.m.digest()
-
- def update(self, arg):
- return self.m.update(arg)
-
- def hexdigest(self):
- return self.m.hexdigest()
-
-new = md5obj
-
-def md5(string=''):
- return md5obj('md5', string)
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/dblite.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/dblite.py
deleted file mode 100644
index 707a4f88b89..00000000000
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/dblite.py
+++ /dev/null
@@ -1,256 +0,0 @@
-# dblite.py module contributed by Ralf W. Grosse-Kunstleve.
-# Extended for Unicode by Steven Knight.
-
-import SCons.compat
-
-import os
-# compat layer imports "cPickle" for us if it's available.
-import pickle
-import shutil
-import time
-
-keep_all_files = 00000
-ignore_corrupt_dbfiles = 0
-
-def corruption_warning(filename):
- print "Warning: Discarding corrupt database:", filename
-
-try: unicode
-except NameError:
- def is_string(s):
- return isinstance(s, str)
-else:
- def is_string(s):
- return type(s) in (str, unicode)
-
-try:
- unicode('a')
-except NameError:
- def unicode(s): return s
-
-dblite_suffix = '.dblite'
-tmp_suffix = '.tmp'
-
-class dblite(object):
-
- # Squirrel away references to the functions in various modules
- # that we'll use when our __del__() method calls our sync() method
- # during shutdown. We might get destroyed when Python is in the midst
- # of tearing down the different modules we import in an essentially
- # arbitrary order, and some of the various modules's global attributes
- # may already be wiped out from under us.
- #
- # See the discussion at:
- # http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html
-
- _open = open
- _pickle_dump = staticmethod(pickle.dump)
- _os_chmod = os.chmod
- try:
- _os_chown = os.chown
- except AttributeError:
- _os_chown = None
- _os_rename = os.rename
- _os_unlink = os.unlink
- _shutil_copyfile = shutil.copyfile
- _time_time = time.time
-
- def __init__(self, file_base_name, flag, mode):
- assert flag in (None, "r", "w", "c", "n")
- if (flag is None): flag = "r"
- base, ext = os.path.splitext(file_base_name)
- if ext == dblite_suffix:
- # There's already a suffix on the file name, don't add one.
- self._file_name = file_base_name
- self._tmp_name = base + tmp_suffix
- else:
- self._file_name = file_base_name + dblite_suffix
- self._tmp_name = file_base_name + tmp_suffix
- self._flag = flag
- self._mode = mode
- self._dict = {}
- self._needs_sync = 00000
- if self._os_chown is not None and (os.geteuid()==0 or os.getuid()==0):
- # running as root; chown back to current owner/group when done
- try:
- statinfo = os.stat(self._file_name)
- self._chown_to = statinfo.st_uid
- self._chgrp_to = statinfo.st_gid
- except OSError, e:
- # db file doesn't exist yet.
- # Check os.environ for SUDO_UID, use if set
- self._chown_to = int(os.environ.get('SUDO_UID', -1))
- self._chgrp_to = int(os.environ.get('SUDO_GID', -1))
- else:
- self._chown_to = -1 # don't chown
- self._chgrp_to = -1 # don't chgrp
- if (self._flag == "n"):
- self._open(self._file_name, "wb", self._mode)
- else:
- try:
- f = self._open(self._file_name, "rb")
- except IOError, e:
- if (self._flag != "c"):
- raise e
- self._open(self._file_name, "wb", self._mode)
- else:
- p = f.read()
- if (len(p) > 0):
- try:
- self._dict = pickle.loads(p)
- except (pickle.UnpicklingError, EOFError, KeyError):
- # Note how we catch KeyErrors too here, which might happen
- # when we don't have cPickle available (default pickle
- # throws it).
- if (ignore_corrupt_dbfiles == 0): raise
- if (ignore_corrupt_dbfiles == 1):
- corruption_warning(self._file_name)
-
- def close(self):
- if (self._needs_sync):
- self.sync()
-
- def __del__(self):
- self.close()
-
- def sync(self):
- self._check_writable()
- f = self._open(self._tmp_name, "wb", self._mode)
- self._pickle_dump(self._dict, f, 1)
- f.close()
- # Windows doesn't allow renaming if the file exists, so unlink
- # it first, chmod'ing it to make sure we can do so. On UNIX, we
- # may not be able to chmod the file if it's owned by someone else
- # (e.g. from a previous run as root). We should still be able to
- # unlink() the file if the directory's writable, though, so ignore
- # any OSError exception thrown by the chmod() call.
- try: self._os_chmod(self._file_name, 0777)
- except OSError: pass
- self._os_unlink(self._file_name)
- self._os_rename(self._tmp_name, self._file_name)
- if self._os_chown is not None and self._chown_to > 0: # don't chown to root or -1
- try:
- self._os_chown(self._file_name, self._chown_to, self._chgrp_to)
- except OSError:
- pass
- self._needs_sync = 00000
- if (keep_all_files):
- self._shutil_copyfile(
- self._file_name,
- self._file_name + "_" + str(int(self._time_time())))
-
- def _check_writable(self):
- if (self._flag == "r"):
- raise IOError("Read-only database: %s" % self._file_name)
-
- def __getitem__(self, key):
- return self._dict[key]
-
- def __setitem__(self, key, value):
- self._check_writable()
- if (not is_string(key)):
- raise TypeError("key `%s' must be a string but is %s" % (key, type(key)))
- if (not is_string(value)):
- raise TypeError("value `%s' must be a string but is %s" % (value, type(value)))
- self._dict[key] = value
- self._needs_sync = 0001
-
- def keys(self):
- return list(self._dict.keys())
-
- def has_key(self, key):
- return key in self._dict
-
- def __contains__(self, key):
- return key in self._dict
-
- def iterkeys(self):
- # Wrapping name in () prevents fixer from "fixing" this
- return (self._dict.iterkeys)()
-
- __iter__ = iterkeys
-
- def __len__(self):
- return len(self._dict)
-
-def open(file, flag=None, mode=0666):
- return dblite(file, flag, mode)
-
-def _exercise():
- db = open("tmp", "n")
- assert len(db) == 0
- db["foo"] = "bar"
- assert db["foo"] == "bar"
- db[unicode("ufoo")] = unicode("ubar")
- assert db[unicode("ufoo")] == unicode("ubar")
- db.sync()
- db = open("tmp", "c")
- assert len(db) == 2, len(db)
- assert db["foo"] == "bar"
- db["bar"] = "foo"
- assert db["bar"] == "foo"
- db[unicode("ubar")] = unicode("ufoo")
- assert db[unicode("ubar")] == unicode("ufoo")
- db.sync()
- db = open("tmp", "r")
- assert len(db) == 4, len(db)
- assert db["foo"] == "bar"
- assert db["bar"] == "foo"
- assert db[unicode("ufoo")] == unicode("ubar")
- assert db[unicode("ubar")] == unicode("ufoo")
- try:
- db.sync()
- except IOError, e:
- assert str(e) == "Read-only database: tmp.dblite"
- else:
- raise RuntimeError("IOError expected.")
- db = open("tmp", "w")
- assert len(db) == 4
- db["ping"] = "pong"
- db.sync()
- try:
- db[(1,2)] = "tuple"
- except TypeError, e:
- assert str(e) == "key `(1, 2)' must be a string but is <type 'tuple'>", str(e)
- else:
- raise RuntimeError("TypeError exception expected")
- try:
- db["list"] = [1,2]
- except TypeError, e:
- assert str(e) == "value `[1, 2]' must be a string but is <type 'list'>", str(e)
- else:
- raise RuntimeError("TypeError exception expected")
- db = open("tmp", "r")
- assert len(db) == 5
- db = open("tmp", "n")
- assert len(db) == 0
- dblite._open("tmp.dblite", "w")
- db = open("tmp", "r")
- dblite._open("tmp.dblite", "w").write("x")
- try:
- db = open("tmp", "r")
- except pickle.UnpicklingError:
- pass
- else:
- raise RuntimeError("pickle exception expected.")
- global ignore_corrupt_dbfiles
- ignore_corrupt_dbfiles = 2
- db = open("tmp", "r")
- assert len(db) == 0
- os.unlink("tmp.dblite")
- try:
- db = open("tmp", "w")
- except IOError, e:
- assert str(e) == "[Errno 2] No such file or directory: 'tmp.dblite'", str(e)
- else:
- raise RuntimeError("IOError expected.")
- print "OK"
-
-if (__name__ == "__main__"):
- _exercise()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-3.0.4/scons-3.0.4.bat b/src/third_party/scons-3.0.4/scons-3.0.4.bat
new file mode 100644
index 00000000000..21ed3a876a2
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-3.0.4.bat
@@ -0,0 +1,38 @@
+@REM Copyright (c) 2001 - 2019 The SCons Foundation
+@REM src/script/scons.bat 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan
+@echo off
+set SCONS_ERRORLEVEL=
+if "%OS%" == "Windows_NT" goto WinNT
+
+@REM for 9x/Me you better not have more than 9 args
+python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.0.4'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.0.4'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
+@REM no way to set exit status of this script for 9x/Me
+goto endscons
+
+@REM Credit where credit is due: we return the exit code despite our
+@REM use of setlocal+endlocal using a technique from Bear's Journal:
+@REM http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/
+
+:WinNT
+setlocal
+@REM ensure the script will be executed with the Python it was installed for
+pushd %~dp0..
+set path=%~dp0;%CD%;%path%
+popd
+@REM try the script named as the .bat file in current dir, then in Scripts subdir
+set scriptname=%~dp0%~n0.py
+if not exist "%scriptname%" set scriptname=%~dp0Scripts\%~n0.py
+@REM Handle when running from wheel where the script has no .py extension
+if not exist "%scriptname%" set scriptname=%~dp0%~n0
+python "%scriptname%" %*
+endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL%
+
+if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode
+if errorlevel 9009 echo you do not have python in your PATH
+goto endscons
+
+:returncode
+exit /B %SCONS_ERRORLEVEL%
+
+:endscons
+call :returncode %SCONS_ERRORLEVEL%
diff --git a/src/third_party/scons-2.5.0/scons-LICENSE b/src/third_party/scons-3.0.4/scons-LICENSE
index 060ceaf2530..e7268d5e2dc 100644
--- a/src/third_party/scons-2.5.0/scons-LICENSE
+++ b/src/third_party/scons-3.0.4/scons-LICENSE
@@ -3,7 +3,7 @@
This copyright and license do not apply to any other software
with which this software may have been included.
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2019 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/src/third_party/scons-2.5.0/scons-README b/src/third_party/scons-3.0.4/scons-README
index 7717b9bd2da..5b318068b0a 100644
--- a/src/third_party/scons-2.5.0/scons-README
+++ b/src/third_party/scons-3.0.4/scons-README
@@ -1,4 +1,4 @@
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
SCons - a software construction tool
diff --git a/src/third_party/scons-3.0.4/scons-configure-cache.py b/src/third_party/scons-3.0.4/scons-configure-cache.py
new file mode 100644
index 00000000000..a9af1afee84
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-configure-cache.py
@@ -0,0 +1,178 @@
+#! /usr/bin/env python
+#
+# SCons - a Software Constructor
+#
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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.
+
+'''Show or convert the configuration of an SCons cache directory.
+
+A cache of derived files is stored by file signature.
+The files are split into directories named by the first few
+digits of the signature. The prefix length used for directory
+names can be changed by this script.
+'''
+
+from __future__ import print_function
+import argparse
+import glob
+import json
+import os
+
+__revision__ = "src/script/scons-configure-cache.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+__version__ = "3.0.4"
+
+__build__ = "3a41ed6b288cee8d085373ad7fa02894e1903864"
+
+__buildsys__ = "kufra"
+
+__date__ = "2019-01-20 22:51:36"
+
+__developer__ = "bdeegan"
+
+
+def rearrange_cache_entries(current_prefix_len, new_prefix_len):
+ '''Move cache files if prefix length changed.
+
+ Move the existing cache files to new directories of the
+ appropriate name length and clean up the old directories.
+ '''
+ print('Changing prefix length from', current_prefix_len,
+ 'to', new_prefix_len)
+ dirs = set()
+ old_dirs = set()
+ for file in glob.iglob(os.path.join('*', '*')):
+ name = os.path.basename(file)
+ dname = name[:current_prefix_len].upper()
+ if dname not in old_dirs:
+ print('Migrating', dname)
+ old_dirs.add(dname)
+ dname = name[:new_prefix_len].upper()
+ if dname not in dirs:
+ os.mkdir(dname)
+ dirs.add(dname)
+ os.rename(file, os.path.join(dname, name))
+
+ # Now delete the original directories
+ for dname in old_dirs:
+ os.rmdir(dname)
+
+
+# The configuration dictionary should have one entry per entry in the
+# cache config. The value of each entry should include the following:
+# implicit - (optional) This is to allow adding a new config entry and also
+# changing the behaviour of the system at the same time. This
+# indicates the value the config entry would have had if it had
+# been specified.
+# default - The value the config entry should have if it wasn't previously
+# specified
+# command-line - parameters to pass to ArgumentParser.add_argument
+# converter - (optional) Function to call if conversion is required
+# if this configuration entry changes
+config_entries = {
+ 'prefix_len': {
+ 'implicit': 1,
+ 'default': 2,
+ 'command-line': {
+ 'help': 'Length of cache file name used as subdirectory prefix',
+ 'metavar': '<number>',
+ 'type': int
+ },
+ 'converter': rearrange_cache_entries
+ }
+}
+
+parser = argparse.ArgumentParser(
+ description='Modify the configuration of an scons cache directory',
+ epilog='''
+ Unspecified options will not be changed unless they are not
+ set at all, in which case they are set to an appropriate default.
+ ''')
+
+parser.add_argument('cache-dir', help='Path to scons cache directory')
+for param in config_entries:
+ parser.add_argument('--' + param.replace('_', '-'),
+ **config_entries[param]['command-line'])
+parser.add_argument('--version',
+ action='version',
+ version='%(prog)s 1.0')
+parser.add_argument('--show',
+ action="store_true",
+ help="show current configuration")
+
+# Get the command line as a dict without any of the unspecified entries.
+args = dict([x for x in vars(parser.parse_args()).items() if x[1]])
+
+# It seems somewhat strange to me, but positional arguments don't get the -
+# in the name changed to _, whereas optional arguments do...
+cache = args['cache-dir']
+if not os.path.isdir(cache):
+ raise RuntimeError("There is no cache directory named %s" % cache)
+os.chdir(cache)
+del args['cache-dir']
+
+if not os.path.exists('config'):
+ # old config dirs did not have a 'config' file. Try to update.
+ # Validate the only files in the directory are directories 0-9, a-f
+ expected = ['{:X}'.format(x) for x in range(0, 16)]
+ if not set(os.listdir('.')).issubset(expected):
+ raise RuntimeError(
+ "%s does not look like a valid version 1 cache directory" % cache)
+ config = dict()
+else:
+ with open('config') as conf:
+ config = json.load(conf)
+
+if args.get('show', None):
+ print("Current configuration in '%s':" % cache)
+ print(json.dumps(config, sort_keys=True,
+ indent=4, separators=(',', ': ')))
+ # in case of the show argument, emit some stats as well
+ file_count = 0
+ for _, _, files in os.walk('.'):
+ file_count += len(files)
+ if file_count: # skip config file if it exists
+ file_count -= 1
+ print("Cache contains %s files" % file_count)
+ del args['show']
+
+# Find any keys that are not currently set but should be
+for key in config_entries:
+ if key not in config:
+ if 'implicit' in config_entries[key]:
+ config[key] = config_entries[key]['implicit']
+ else:
+ config[key] = config_entries[key]['default']
+ if key not in args:
+ args[key] = config_entries[key]['default']
+
+# Now go through each entry in args to see if it changes an existing config
+# setting.
+for key in args:
+ if args[key] != config[key]:
+ if 'converter' in config_entries[key]:
+ config_entries[key]['converter'](config[key], args[key])
+ config[key] = args[key]
+
+# and write the updated config file
+with open('config', 'w') as conf:
+ json.dump(config, conf)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Action.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Action.py
index 6c34a4331fa..d633327a4b8 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Action.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Action.py
@@ -60,6 +60,7 @@ this module:
get_presig()
Fetches the "contents" of a subclass for signature calculation.
The varlist is added to this to produce the Action's contents.
+ TODO(?): Change this to always return ascii/bytes and not unicode (or py3 strings)
strfunction()
Returns a substituted string representation of the Action.
@@ -76,7 +77,7 @@ way for wrapping up the functions.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -97,15 +98,16 @@ way for wrapping up the functions.
# 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__ = "src/engine/SCons/Action.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Action.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import dis
import os
-# compat layer imports "cPickle" for us if it's available.
import pickle
import re
import sys
import subprocess
+import itertools
+import inspect
+from collections import OrderedDict
import SCons.Debug
from SCons.Debug import logInstanceCreation
@@ -114,8 +116,7 @@ import SCons.Util
import SCons.Subst
# we use these a lot, so try to optimize them
-is_String = SCons.Util.is_String
-is_List = SCons.Util.is_List
+from SCons.Util import is_String, is_List
class _null(object):
pass
@@ -124,37 +125,25 @@ print_actions = 1
execute_actions = 1
print_actions_presub = 0
+# Use pickle protocol 1 when pickling functions for signature
+# otherwise python3 and python2 will yield different pickles
+# for the same object.
+# This is due to default being 1 for python 2.7, and 3 for 3.x
+# TODO: We can roll this forward to 2 (if it has value), but not
+# before a deprecation cycle as the sconsigns will change
+ACTION_SIGNATURE_PICKLE_PROTOCOL = 1
+
+
def rfile(n):
try:
return n.rfile()
except AttributeError:
return n
+
def default_exitstatfunc(s):
return s
-try:
- SET_LINENO = dis.SET_LINENO
- HAVE_ARGUMENT = dis.HAVE_ARGUMENT
-except AttributeError:
- remove_set_lineno_codes = lambda x: x
-else:
- def remove_set_lineno_codes(code):
- result = []
- n = len(code)
- i = 0
- while i < n:
- c = code[i]
- op = ord(c)
- if op >= HAVE_ARGUMENT:
- if op != SET_LINENO:
- result.append(code[i:i+3])
- i = i+3
- else:
- result.append(c)
- i = i+1
- return ''.join(result)
-
strip_quotes = re.compile('^[\'"](.*)[\'"]$')
@@ -163,12 +152,12 @@ def _callable_contents(obj):
"""
try:
# Test if obj is a method.
- return _function_contents(obj.im_func)
+ return _function_contents(obj.__func__)
except AttributeError:
try:
# Test if obj is a callable object.
- return _function_contents(obj.__call__.im_func)
+ return _function_contents(obj.__call__.__func__)
except AttributeError:
try:
@@ -176,8 +165,8 @@ def _callable_contents(obj):
return _code_contents(obj)
except AttributeError:
- # Test if obj is a function object.
- return _function_contents(obj)
+ # Test if obj is a function object.
+ return _function_contents(obj)
def _object_contents(obj):
@@ -188,12 +177,12 @@ def _object_contents(obj):
"""
try:
# Test if obj is a method.
- return _function_contents(obj.im_func)
+ return _function_contents(obj.__func__)
except AttributeError:
try:
# Test if obj is a callable object.
- return _function_contents(obj.__call__.im_func)
+ return _function_contents(obj.__call__.__func__)
except AttributeError:
try:
@@ -205,20 +194,23 @@ def _object_contents(obj):
# Test if obj is a function object.
return _function_contents(obj)
- except AttributeError:
- # Should be a pickable Python object.
+ except AttributeError as ae:
+ # Should be a pickle-able Python object.
try:
- return pickle.dumps(obj)
- except (pickle.PicklingError, TypeError):
+ return _object_instance_content(obj)
+ # pickling an Action instance or object doesn't yield a stable
+ # content as instance property may be dumped in different orders
+ # return pickle.dumps(obj, ACTION_SIGNATURE_PICKLE_PROTOCOL)
+ except (pickle.PicklingError, TypeError, AttributeError) as ex:
# This is weird, but it seems that nested classes
# are unpickable. The Python docs say it should
# always be a PicklingError, but some Python
# versions seem to return TypeError. Just do
# the best we can.
- return str(obj)
+ return bytearray(repr(obj), 'utf-8')
-def _code_contents(code):
+def _code_contents(code, docstring=None):
"""Return the signature contents of a code object.
By providing direct access to the code object of the
@@ -228,61 +220,172 @@ def _code_contents(code):
number indications in the compiled byte code. Boo!
So we remove the line number byte codes to prevent
recompilations from moving a Python function.
+
+ See:
+ - https://docs.python.org/2/library/inspect.html
+ - http://python-reference.readthedocs.io/en/latest/docs/code/index.html
+
+ For info on what each co\_ variable provides
+
+ The signature is as follows (should be byte/chars):
+ co_argcount, len(co_varnames), len(co_cellvars), len(co_freevars),
+ ( comma separated signature for each object in co_consts ),
+ ( comma separated signature for each object in co_names ),
+ ( The bytecode with line number bytecodes removed from co_code )
+
+ co_argcount - Returns the number of positional arguments (including arguments with default values).
+ co_varnames - Returns a tuple containing the names of the local variables (starting with the argument names).
+ co_cellvars - Returns a tuple containing the names of local variables that are referenced by nested functions.
+ co_freevars - Returns a tuple containing the names of free variables. (?)
+ co_consts - Returns a tuple containing the literals used by the bytecode.
+ co_names - Returns a tuple containing the names used by the bytecode.
+ co_code - Returns a string representing the sequence of bytecode instructions.
+
"""
- contents = []
+ # contents = []
# The code contents depends on the number of local variables
# but not their actual names.
- contents.append("%s,%s" % (code.co_argcount, len(code.co_varnames)))
- contents.append(",%s,%s" % (len(code.co_cellvars), len(code.co_freevars)))
+ contents = bytearray("{}, {}".format(code.co_argcount, len(code.co_varnames)), 'utf-8')
+
+ contents.extend(b", ")
+ contents.extend(bytearray(str(len(code.co_cellvars)), 'utf-8'))
+ contents.extend(b", ")
+ contents.extend(bytearray(str(len(code.co_freevars)), 'utf-8'))
# The code contents depends on any constants accessed by the
# function. Note that we have to call _object_contents on each
# constants because the code object of nested functions can
# show-up among the constants.
- #
- # Note that we also always ignore the first entry of co_consts
- # which contains the function doc string. We assume that the
- # function does not access its doc string.
- contents.append(',(' + ','.join(map(_object_contents,code.co_consts[1:])) + ')')
+ z = [_object_contents(cc) for cc in code.co_consts if cc != docstring]
+ contents.extend(b',(')
+ contents.extend(bytearray(',', 'utf-8').join(z))
+ contents.extend(b')')
# The code contents depends on the variable names used to
# accessed global variable, as changing the variable name changes
# the variable actually accessed and therefore changes the
# function result.
- contents.append(',(' + ','.join(map(_object_contents,code.co_names)) + ')')
-
+ z= [bytearray(_object_contents(cc)) for cc in code.co_names]
+ contents.extend(b',(')
+ contents.extend(bytearray(',','utf-8').join(z))
+ contents.extend(b')')
# The code contents depends on its actual code!!!
- contents.append(',(' + str(remove_set_lineno_codes(code.co_code)) + ')')
+ contents.extend(b',(')
+ contents.extend(code.co_code)
+ contents.extend(b')')
- return ''.join(contents)
+ return contents
def _function_contents(func):
- """Return the signature contents of a function."""
+ """
+ The signature is as follows (should be byte/chars):
+ < _code_contents (see above) from func.__code__ >
+ ,( comma separated _object_contents for function argument defaults)
+ ,( comma separated _object_contents for any closure contents )
- contents = [_code_contents(func.func_code)]
+
+ See also: https://docs.python.org/3/reference/datamodel.html
+ - func.__code__ - The code object representing the compiled function body.
+ - func.__defaults__ - A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value
+ - func.__closure__ - None or a tuple of cells that contain bindings for the function's free variables.
+
+ :Returns:
+ Signature contents of a function. (in bytes)
+ """
+
+ contents = [_code_contents(func.__code__, func.__doc__)]
# The function contents depends on the value of defaults arguments
- if func.func_defaults:
- contents.append(',(' + ','.join(map(_object_contents,func.func_defaults)) + ')')
+ if func.__defaults__:
+
+ function_defaults_contents = [_object_contents(cc) for cc in func.__defaults__]
+
+ defaults = bytearray(b',(')
+ defaults.extend(bytearray(b',').join(function_defaults_contents))
+ defaults.extend(b')')
+
+ contents.append(defaults)
else:
- contents.append(',()')
+ contents.append(b',()')
# The function contents depends on the closure captured cell values.
- closure = func.func_closure or []
+ closure = func.__closure__ or []
- #xxx = [_object_contents(x.cell_contents) for x in closure]
try:
- xxx = [_object_contents(x.cell_contents) for x in closure]
+ closure_contents = [_object_contents(x.cell_contents) for x in closure]
except AttributeError:
- xxx = []
- contents.append(',(' + ','.join(xxx) + ')')
+ closure_contents = []
- return ''.join(contents)
+ contents.append(b',(')
+ contents.append(bytearray(b',').join(closure_contents))
+ contents.append(b')')
+ retval = bytearray(b'').join(contents)
+ return retval
+
+
+def _object_instance_content(obj):
+ """
+ Returns consistant content for a action class or an instance thereof
+
+ :Parameters:
+ - `obj` Should be either and action class or an instance thereof
+
+ :Returns:
+ bytearray or bytes representing the obj suitable for generating a signature from.
+ """
+ retval = bytearray()
+
+ if obj is None:
+ return b'N.'
+
+ if isinstance(obj, SCons.Util.BaseStringTypes):
+ return SCons.Util.to_bytes(obj)
+
+ inst_class = obj.__class__
+ inst_class_name = bytearray(obj.__class__.__name__,'utf-8')
+ inst_class_module = bytearray(obj.__class__.__module__,'utf-8')
+ inst_class_hierarchy = bytearray(repr(inspect.getclasstree([obj.__class__,])),'utf-8')
+ # print("ICH:%s : %s"%(inst_class_hierarchy, repr(obj)))
+
+ properties = [(p, getattr(obj, p, "None")) for p in dir(obj) if not (p[:2] == '__' or inspect.ismethod(getattr(obj, p)) or inspect.isbuiltin(getattr(obj,p))) ]
+ properties.sort()
+ properties_str = ','.join(["%s=%s"%(p[0],p[1]) for p in properties])
+ properties_bytes = bytearray(properties_str,'utf-8')
+
+ methods = [p for p in dir(obj) if inspect.ismethod(getattr(obj, p))]
+ methods.sort()
+
+ method_contents = []
+ for m in methods:
+ # print("Method:%s"%m)
+ v = _function_contents(getattr(obj, m))
+ # print("[%s->]V:%s [%s]"%(m,v,type(v)))
+ method_contents.append(v)
+
+ retval = bytearray(b'{')
+ retval.extend(inst_class_name)
+ retval.extend(b":")
+ retval.extend(inst_class_module)
+ retval.extend(b'}[[')
+ retval.extend(inst_class_hierarchy)
+ retval.extend(b']]{{')
+ retval.extend(bytearray(b",").join(method_contents))
+ retval.extend(b"}}{{{")
+ retval.extend(properties_bytes)
+ retval.extend(b'}}}')
+ return retval
+
+ # print("class :%s"%inst_class)
+ # print("class_name :%s"%inst_class_name)
+ # print("class_module :%s"%inst_class_module)
+ # print("Class hier :\n%s"%pp.pformat(inst_class_hierarchy))
+ # print("Inst Properties:\n%s"%pp.pformat(properties))
+ # print("Inst Methods :\n%s"%pp.pformat(methods))
def _actionAppend(act1, act2):
# This function knows how to slap two actions together.
@@ -305,6 +408,7 @@ def _actionAppend(act1, act2):
else:
return ListAction([ a1, a2 ])
+
def _do_create_keywords(args, kw):
"""This converts any arguments after the action argument into
their equivalent keywords and adds them to the kw argument.
@@ -332,6 +436,7 @@ def _do_create_keywords(args, kw):
raise SCons.Errors.UserError(
'Cannot have both strfunction and cmdstr args to Action()')
+
def _do_create_action(act, kw):
"""This is the actual "implementation" for the
Action factory method, below. This handles the
@@ -362,7 +467,7 @@ def _do_create_action(act, kw):
# The list of string commands may include a LazyAction, so we
# reprocess them via _do_create_list_action.
return _do_create_list_action(commands, kw)
-
+
if is_List(act):
return CommandAction(act, **kw)
@@ -384,6 +489,7 @@ def _do_create_action(act, kw):
# Else fail silently (???)
return None
+
def _do_create_list_action(act, kw):
"""A factory for list actions. Convert the input list into Actions
and then wrap them in a ListAction."""
@@ -398,6 +504,7 @@ def _do_create_list_action(act, kw):
else:
return ListAction(acts)
+
def Action(act, *args, **kw):
"""A factory for action objects."""
# Really simple: the _do_create_* routines do the heavy lifting.
@@ -406,13 +513,14 @@ def Action(act, *args, **kw):
return _do_create_list_action(act, kw)
return _do_create_action(act, kw)
+
class ActionBase(object):
"""Base class for all types of action objects that can be held by
other objects (Builders, Executors, etc.) This provides the
common methods for manipulating and combining those actions."""
- def __cmp__(self, other):
- return cmp(self.__dict__, other)
+ def __eq__(self, other):
+ return self.__dict__ == other
def no_batch_key(self, env, target, source):
return None
@@ -423,7 +531,18 @@ class ActionBase(object):
return str(self)
def get_contents(self, target, source, env):
- result = [ self.get_presig(target, source, env) ]
+ result = self.get_presig(target, source, env)
+
+ if not isinstance(result,(bytes, bytearray)):
+ result = bytearray("",'utf-8').join([ SCons.Util.to_bytes(r) for r in result ])
+ else:
+ # Make a copy and put in bytearray, without this the contents returned by get_presig
+ # can be changed by the logic below, appending with each call and causing very
+ # hard to track down issues...
+ result = bytearray(result)
+
+ # At this point everything should be a bytearray
+
# This should never happen, as the Action() factory should wrap
# the varlist, but just in case an action is created directly,
# we duplicate this check here.
@@ -431,8 +550,18 @@ class ActionBase(object):
if is_String(vl): vl = (vl,)
for v in vl:
# do the subst this way to ignore $(...$) parts:
- result.append(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source))
- return ''.join(result)
+ if isinstance(result, bytearray):
+ result.extend(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source)))
+ else:
+ raise Exception("WE SHOULD NEVER GET HERE result should be bytearray not:%s"%type(result))
+ # result.append(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source)))
+
+
+ if isinstance(result, (bytes,bytearray)):
+ return result
+ else:
+ raise Exception("WE SHOULD NEVER GET HERE - #2 result should be bytearray not:%s" % type(result))
+ # return b''.join(result)
def __add__(self, other):
return _actionAppend(self, other)
@@ -462,6 +591,7 @@ class ActionBase(object):
"""
return self.targets
+
class _ActionAction(ActionBase):
"""Base class for actions that create output objects."""
def __init__(self, cmdstr=_null, strfunction=_null, varlist=(),
@@ -495,16 +625,18 @@ class _ActionAction(ActionBase):
SCons.Util.AddMethod(self, batch_key, 'batch_key')
def print_cmd_line(self, s, target, source, env):
- # In python 3, and in some of our tests, sys.stdout is
- # a String io object, and it takes unicode strings only
- # In other cases it's a regular Python 2.x file object
- # which takes strings (bytes), and if you pass those a
- # unicode object they try to decode with 'ascii' codec
- # which fails if the cmd line has any hi-bit-set chars.
- # This code assumes s is a regular string, but should
- # work if it's unicode too.
+ """
+ In python 3, and in some of our tests, sys.stdout is
+ a String io object, and it takes unicode strings only
+ In other cases it's a regular Python 2.x file object
+ which takes strings (bytes), and if you pass those a
+ unicode object they try to decode with 'ascii' codec
+ which fails if the cmd line has any hi-bit-set chars.
+ This code assumes s is a regular string, but should
+ work if it's unicode too.
+ """
try:
- sys.stdout.write(unicode(s + "\n"))
+ sys.stdout.write(s + u"\n")
except UnicodeDecodeError:
sys.stdout.write(s + "\n")
@@ -601,13 +733,17 @@ def _string_from_cmd_list(cmd_list):
cl.append(arg)
return ' '.join(cl)
-# A fiddlin' little function that has an 'import SCons.Environment' which
-# can't be moved to the top level without creating an import loop. Since
-# this import creates a local variable named 'SCons', it blocks access to
-# the global variable, so we move it here to prevent complaints about local
-# variables being used uninitialized.
default_ENV = None
+
+
def get_default_ENV(env):
+ """
+ A fiddlin' little function that has an 'import SCons.Environment' which
+ can't be moved to the top level without creating an import loop. Since
+ this import creates a local variable named 'SCons', it blocks access to
+ the global variable, so we move it here to prevent complaints about local
+ variables being used uninitialized.
+ """
global default_ENV
try:
return env['ENV']
@@ -622,12 +758,15 @@ def get_default_ENV(env):
default_ENV = SCons.Environment.Environment()['ENV']
return default_ENV
-# This function is still in draft mode. We're going to need something like
-# it in the long run as more and more places use subprocess, but I'm sure
-# it'll have to be tweaked to get the full desired functionality.
-# one special arg (so far?), 'error', to tell what to do with exceptions.
+
def _subproc(scons_env, cmd, error = 'ignore', **kw):
- """Do common setup for a subprocess.Popen() call"""
+ """Do common setup for a subprocess.Popen() call
+
+ This function is still in draft mode. We're going to need something like
+ it in the long run as more and more places use subprocess, but I'm sure
+ it'll have to be tweaked to get the full desired functionality.
+ one special arg (so far?), 'error', to tell what to do with exceptions.
+ """
# allow std{in,out,err} to be "'devnull'"
io = kw.get('stdin')
if is_String(io) and io == 'devnull':
@@ -663,13 +802,13 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw):
kw['env'] = new_env
try:
- return subprocess.Popen(cmd, **kw)
- except EnvironmentError, e:
+ pobj = subprocess.Popen(cmd, **kw)
+ except EnvironmentError as e:
if error == 'raise': raise
# return a dummy Popen instance that only returns error
class dummyPopen(object):
def __init__(self, e): self.exception = e
- def communicate(self,input=None): return ('','')
+ def communicate(self, input=None): return ('', '')
def wait(self): return -self.exception.errno
stdin = None
class f(object):
@@ -677,7 +816,14 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw):
def readline(self): return ''
def __iter__(self): return iter(())
stdout = stderr = f()
- return dummyPopen(e)
+ pobj = dummyPopen(e)
+ finally:
+ # clean up open file handles stored in parent's kw
+ for k, v in kw.items():
+ if hasattr(v, 'close'):
+ v.close()
+ return pobj
+
class CommandAction(_ActionAction):
"""Class for command-execution actions."""
@@ -695,9 +841,9 @@ class CommandAction(_ActionAction):
_ActionAction.__init__(self, **kw)
if is_List(cmd):
- if list(filter(is_List, cmd)):
- raise TypeError("CommandAction should be given only " \
- "a single command")
+ if [c for c in cmd if is_List(c)]:
+ raise TypeError("CommandAction should be given only "
+ "a single command")
self.cmd_list = cmd
def __str__(self):
@@ -845,6 +991,7 @@ class CommandAction(_ActionAction):
res.append(env.fs.File(d))
return res
+
class CommandGeneratorAction(ActionBase):
"""Class for command-generator actions."""
def __init__(self, generator, kw):
@@ -916,25 +1063,25 @@ class CommandGeneratorAction(ActionBase):
return self._generate(None, None, env, 1, executor).get_targets(env, executor)
-
-# A LazyAction is a kind of hybrid generator and command action for
-# strings of the form "$VAR". These strings normally expand to other
-# strings (think "$CCCOM" to "$CC -c -o $TARGET $SOURCE"), but we also
-# want to be able to replace them with functions in the construction
-# environment. Consequently, we want lazy evaluation and creation of
-# an Action in the case of the function, but that's overkill in the more
-# normal case of expansion to other strings.
-#
-# So we do this with a subclass that's both a generator *and*
-# a command action. The overridden methods all do a quick check
-# of the construction variable, and if it's a string we just call
-# the corresponding CommandAction method to do the heavy lifting.
-# If not, then we call the same-named CommandGeneratorAction method.
-# The CommandGeneratorAction methods work by using the overridden
-# _generate() method, that is, our own way of handling "generation" of
-# an action based on what's in the construction variable.
-
class LazyAction(CommandGeneratorAction, CommandAction):
+ """
+ A LazyAction is a kind of hybrid generator and command action for
+ strings of the form "$VAR". These strings normally expand to other
+ strings (think "$CCCOM" to "$CC -c -o $TARGET $SOURCE"), but we also
+ want to be able to replace them with functions in the construction
+ environment. Consequently, we want lazy evaluation and creation of
+ an Action in the case of the function, but that's overkill in the more
+ normal case of expansion to other strings.
+
+ So we do this with a subclass that's both a generator *and*
+ a command action. The overridden methods all do a quick check
+ of the construction variable, and if it's a string we just call
+ the corresponding CommandAction method to do the heavy lifting.
+ If not, then we call the same-named CommandGeneratorAction method.
+ The CommandGeneratorAction methods work by using the overridden
+ _generate() method, that is, our own way of handling "generation" of
+ an action based on what's in the construction variable.
+ """
def __init__(self, var, kw):
if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.LazyAction')
@@ -1013,6 +1160,7 @@ class FunctionAction(_ActionAction):
c = env.subst(self.cmdstr, SUBST_RAW, target, source)
if c:
return c
+
def array(a):
def quote(s):
try:
@@ -1052,11 +1200,11 @@ class FunctionAction(_ActionAction):
rsources = list(map(rfile, source))
try:
result = self.execfunction(target=target, source=rsources, env=env)
- except KeyboardInterrupt, e:
+ except KeyboardInterrupt as e:
raise
- except SystemExit, e:
+ except SystemExit as e:
raise
- except Exception, e:
+ except Exception as e:
result = e
exc_info = sys.exc_info()
@@ -1086,7 +1234,6 @@ class FunctionAction(_ActionAction):
# more information about this issue.
del exc_info
-
def get_presig(self, target, source, env):
"""Return the signature contents of this callable action."""
try:
@@ -1126,7 +1273,7 @@ class ListAction(ActionBase):
Simple concatenation of the signatures of the elements.
"""
- return "".join([x.get_contents(target, source, env) for x in self.list])
+ return b"".join([bytes(x.get_contents(target, source, env)) for x in self.list])
def __call__(self, target, source, env, exitstatfunc=_null, presub=_null,
show=_null, execute=_null, chdir=_null, executor=None):
@@ -1147,12 +1294,13 @@ class ListAction(ActionBase):
return result
def get_varlist(self, target, source, env, executor=None):
- result = SCons.Util.OrderedDict()
+ result = OrderedDict()
for act in self.list:
for var in act.get_varlist(target, source, env, executor):
result[var] = True
return list(result.keys())
+
class ActionCaller(object):
"""A class for delaying calling an Action function with specific
(positional and keyword) arguments until the Action is actually
@@ -1171,16 +1319,16 @@ class ActionCaller(object):
actfunc = self.parent.actfunc
try:
# "self.actfunc" is a function.
- contents = str(actfunc.func_code.co_code)
+ contents = actfunc.__code__.co_code
except AttributeError:
# "self.actfunc" is a callable object.
try:
- contents = str(actfunc.__call__.im_func.func_code.co_code)
+ contents = actfunc.__call__.__func__.__code__.co_code
except AttributeError:
# No __call__() method, so it might be a builtin
# or something like that. Do the best we can.
- contents = str(actfunc)
- contents = remove_set_lineno_codes(contents)
+ contents = repr(actfunc)
+
return contents
def subst(self, s, target, source, env):
@@ -1206,7 +1354,7 @@ class ActionCaller(object):
def subst_kw(self, target, source, env):
kw = {}
- for key in self.kw.keys():
+ for key in list(self.kw.keys()):
kw[key] = self.subst(self.kw[key], target, source, env)
return kw
@@ -1223,6 +1371,7 @@ class ActionCaller(object):
def __str__(self):
return self.parent.strfunc(*self.args, **self.kw)
+
class ActionFactory(object):
"""A factory class that will wrap up an arbitrary function
as an SCons-executable Action object.
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Builder.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Builder.py
index 060b1a865d8..073efcccfc3 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Builder.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Builder.py
@@ -1,4 +1,5 @@
-"""SCons.Builder
+"""
+SCons.Builder
Builder object subsystem.
@@ -31,7 +32,7 @@ There is also a proxy that looks like a Builder:
Builders and their proxies have the following public interface methods
used by other modules:
- __call__()
+ - __call__()
THE public interface. Calling a Builder object (with the
use of internal helper methods) sets up the target and source
dependencies, appropriate mapping to a specific action, and the
@@ -39,12 +40,12 @@ used by other modules:
variable. This also takes care of warning about possible mistakes
in keyword arguments.
- add_emitter()
+ - add_emitter()
Adds an emitter for a specific file suffix, used by some Tool
modules to specify that (for example) a yacc invocation on a .y
can create a .h *and* a .c file.
- add_action()
+ - add_action()
Adds an action for a specific file suffix, heavily used by
Tool modules to add their specific action(s) for turning
a source file into an object file to the global static
@@ -52,23 +53,23 @@ used by other modules:
There are the following methods for internal use within this module:
- _execute()
+ - _execute()
The internal method that handles the heavily lifting when a
Builder is called. This is used so that the __call__() methods
can set up warning about possible mistakes in keyword-argument
overrides, and *then* execute all of the steps necessary so that
the warnings only occur once.
- get_name()
+ - get_name()
Returns the Builder's name within a specific Environment,
primarily used to try to return helpful information in error
messages.
- adjust_suffix()
- get_prefix()
- get_suffix()
- get_src_suffix()
- set_src_suffix()
+ - adjust_suffix()
+ - get_prefix()
+ - get_suffix()
+ - get_src_suffix()
+ - set_src_suffix()
Miscellaneous stuff for handling the prefix and suffix
manipulation we use in turning source file names into target
file names.
@@ -76,7 +77,7 @@ There are the following methods for internal use within this module:
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -97,7 +98,7 @@ There are the following methods for internal use within this module:
# 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__ = "src/engine/SCons/Builder.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Builder.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import collections
@@ -166,7 +167,7 @@ class DictCmdGenerator(SCons.Util.Selector):
try:
ret = SCons.Util.Selector.__call__(self, env, source, ext)
- except KeyError, e:
+ except KeyError as e:
raise UserError("Ambiguous suffixes after environment substitution: %s == %s == %s" % (e.args[0], e.args[1], e.args[2]))
if ret is None:
raise UserError("While building `%s' from `%s': Don't know how to build from a source file with suffix `%s'. Expected a suffix in this list: %s." % \
@@ -229,7 +230,7 @@ class OverrideWarner(collections.UserDict):
def warn(self):
if self.already_warned:
return
- for k in self.keys():
+ for k in list(self.keys()):
if k in misleading_keywords:
alt = misleading_keywords[k]
msg = "Did you mean to use `%s' instead of `%s'?" % (alt, k)
@@ -290,7 +291,14 @@ def _node_errors(builder, env, tlist, slist):
if t.side_effect:
raise UserError("Multiple ways to build the same target were specified for: %s" % t)
if t.has_explicit_builder():
- if not t.env is None and not t.env is env:
+ # Check for errors when the environments are different
+ # No error if environments are the same Environment instance
+ if (not t.env is None and not t.env is env and
+ # Check OverrideEnvironment case - no error if wrapped Environments
+ # are the same instance, and overrides lists match
+ not (getattr(t.env, '__subject', 0) is getattr(env, '__subject', 1) and
+ getattr(t.env, 'overrides', 0) == getattr(env, 'overrides', 1) and
+ not builder.multi)):
action = t.builder.action
t_contents = t.builder.action.get_contents(tlist, slist, t.env)
contents = builder.action.get_contents(tlist, slist, env)
@@ -299,7 +307,10 @@ def _node_errors(builder, env, tlist, slist):
msg = "Two different environments were specified for target %s,\n\tbut they appear to have the same action: %s" % (t, action.genstring(tlist, slist, t.env))
SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg)
else:
- msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents,contents)
+ try:
+ msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8'))
+ except UnicodeDecodeError as e:
+ msg = "Two environments with different actions were specified for the same target: %s"%t
raise UserError(msg)
if builder.multi:
if t.builder != builder:
@@ -344,8 +355,11 @@ class EmitterProxy(object):
return (target, source)
- def __cmp__(self, other):
- return cmp(self.var, other.var)
+ def __eq__(self, other):
+ return self.var == other.var
+
+ def __lt__(self, other):
+ return self.var < other.var
class BuilderBase(object):
"""Base class for Builders, objects that create output
@@ -423,6 +437,9 @@ class BuilderBase(object):
def __nonzero__(self):
raise InternalError("Do not test for the Node.builder attribute directly; use Node.has_builder() instead")
+ def __bool__(self):
+ return self.__nonzero__()
+
def get_name(self, env):
"""Attempts to get the name of the Builder.
@@ -440,8 +457,8 @@ class BuilderBase(object):
except AttributeError:
return str(self.__class__)
- def __cmp__(self, other):
- return cmp(self.__dict__, other.__dict__)
+ def __eq__(self, other):
+ return self.__dict__ == other.__dict__
def splitext(self, path, env=None):
if not env:
@@ -604,6 +621,8 @@ class BuilderBase(object):
else:
ekw = self.executor_kw.copy()
ekw['chdir'] = chdir
+ if 'chdir' in ekw and SCons.Util.is_String(ekw['chdir']):
+ ekw['chdir'] = env.subst(ekw['chdir'])
if kw:
if 'srcdir' in kw:
def prependDirIfRelative(f, srcdir=kw['srcdir']):
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/CacheDir.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/CacheDir.py
index a5b85a01fb8..e98e42a1c0d 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/CacheDir.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/CacheDir.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,12 +21,13 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/CacheDir.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/CacheDir.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """
CacheDir support
"""
+import hashlib
import json
import os
import stat
@@ -52,12 +53,13 @@ def CacheRetrieveFunc(target, source, env):
cd.CacheDebug('CacheRetrieve(%s): retrieving from %s\n', t, cachefile)
if SCons.Action.execute_actions:
if fs.islink(cachefile):
- realpath = fs.readlink(cachefile)
- fs.symlink(realpath, t.get_internal_path())
- os.utime(realpath, None)
+ fs.symlink(fs.readlink(cachefile), t.get_internal_path())
else:
env.copy_from_cache(cachefile, t.get_internal_path())
- os.utime(cachefile, None)
+ try:
+ os.utime(cachefile, None)
+ except OSError:
+ pass
st = fs.stat(cachefile)
fs.chmod(t.get_internal_path(), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
return 0
@@ -137,12 +139,6 @@ warned = dict()
class CacheDir(object):
def __init__(self, path):
- try:
- import hashlib
- except ImportError:
- msg = "No hashlib or MD5 module available, CacheDir() not supported"
- SCons.Warnings.warn(SCons.Warnings.NoMD5ModuleWarning, msg)
- path = None
self.path = path
self.current_cache_debug = None
self.debugFP = None
@@ -225,7 +221,9 @@ class CacheDir(object):
return None, None
sig = node.get_cachedir_bsig()
+
subdir = sig[:self.config['prefix_len']].upper()
+
dir = os.path.join(self.path, subdir)
return dir, os.path.join(dir, sig)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Conftest.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Conftest.py
index 87a30229f5f..84aa9925e4b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Conftest.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Conftest.py
@@ -101,7 +101,6 @@ Autoconf-like configuration support; low level implementation of tests.
#
import re
-from types import IntType
#
# PUBLIC VARIABLES
@@ -137,7 +136,7 @@ def CheckBuilder(context, text = None, language = None):
if not text:
text = """
-int main() {
+int main(void) {
return 0;
}
"""
@@ -158,7 +157,7 @@ def CheckCC(context):
"""
context.Display("Checking whether the C compiler works... ")
text = """
-int main()
+int main(void)
{
return 0;
}
@@ -178,7 +177,7 @@ def CheckSHCC(context):
"""
context.Display("Checking whether the (shared) C compiler works... ")
text = """
-int foo()
+int foo(void)
{
return 0;
}
@@ -198,7 +197,7 @@ def CheckCXX(context):
"""
context.Display("Checking whether the C++ compiler works... ")
text = """
-int main()
+int main(void)
{
return 0;
}
@@ -218,7 +217,7 @@ def CheckSHCXX(context):
"""
context.Display("Checking whether the (shared) C++ compiler works... ")
text = """
-int main()
+int main(void)
{
return 0;
}
@@ -291,7 +290,7 @@ char %s();""" % function_name
#include <assert.h>
%(hdr)s
-int main() {
+int main(void) {
#if defined (__stub_%(name)s) || defined (__stub___%(name)s)
fail fail fail
#else
@@ -401,7 +400,7 @@ def CheckType(context, type_name, fallback = None,
%(include)s
%(header)s
-int main() {
+int main(void) {
if ((%(name)s *) 0)
return 0;
if (sizeof (%(name)s))
@@ -466,7 +465,7 @@ def CheckTypeSize(context, type_name, header = None, language = None, expect = N
src = src + r"""
typedef %s scons_check_type;
-int main()
+int main(void)
{
static int test_array[1 - 2 * !(((long int) (sizeof(scons_check_type))) == %d)];
test_array[0] = 0;
@@ -499,7 +498,7 @@ int main()
src = src + """
#include <stdlib.h>
#include <stdio.h>
-int main() {
+int main(void) {
printf("%d", (int)sizeof(""" + type_name + """));
return 0;
}
@@ -561,7 +560,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None):
context.Display('Checking whether %s is declared... ' % symbol)
src = src + r"""
-int main()
+int main(void)
{
#ifndef %s
(void) %s;
@@ -707,11 +706,12 @@ def CheckProg(context, prog_name):
def _YesNoResult(context, ret, key, text, comment = None):
"""
Handle the result of a test with a "yes" or "no" result.
- "ret" is the return value: empty if OK, error message when not.
- "key" is the name of the symbol to be defined (HAVE_foo).
- "text" is the source code of the program used for testing.
- "comment" is the C comment to add above the line defining the symbol (the
- comment is automatically put inside a /* */). If None, no comment is added.
+
+ :Parameters:
+ - `ret` is the return value: empty if OK, error message when not.
+ - `key` is the name of the symbol to be defined (HAVE_foo).
+ - `text` is the source code of the program used for testing.
+ - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added.
"""
if key:
_Have(context, key, not ret, comment)
@@ -725,18 +725,20 @@ def _YesNoResult(context, ret, key, text, comment = None):
def _Have(context, key, have, comment = None):
"""
Store result of a test in context.havedict and context.headerfilename.
- "key" is a "HAVE_abc" name. It is turned into all CAPITALS and non-
- alphanumerics are replaced by an underscore.
+
+ :Parameters:
+ - `key` - is a "HAVE_abc" name. It is turned into all CAPITALS and non-alphanumerics are replaced by an underscore.
+ - `have` - value as it should appear in the header file, include quotes when desired and escape special characters!
+ - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added.
+
+
The value of "have" can be:
- 1 - Feature is defined, add "#define key".
- 0 - Feature is not defined, add "/* #undef key */".
- Adding "undef" is what autoconf does. Not useful for the
- compiler, but it shows that the test was done.
- number - Feature is defined to this number "#define key have".
- Doesn't work for 0 or 1, use a string then.
- string - Feature is defined to this string "#define key have".
- Give "have" as is should appear in the header file, include quotes
- when desired and escape special characters!
+ - 1 - Feature is defined, add "#define key".
+ - 0 - Feature is not defined, add "/\* #undef key \*/". Adding "undef" is what autoconf does. Not useful for the compiler, but it shows that the test was done.
+ - number - Feature is defined to this number "#define key have". Doesn't work for 0 or 1, use a string then.
+ - string - Feature is defined to this string "#define key have".
+
+
"""
key_up = key.upper()
key_up = re.sub('[^A-Z0-9_]', '_', key_up)
@@ -745,7 +747,7 @@ def _Have(context, key, have, comment = None):
line = "#define %s 1\n" % key_up
elif have == 0:
line = "/* #undef %s */\n" % key_up
- elif isinstance(have, IntType):
+ elif isinstance(have, int):
line = "#define %s %d\n" % (key_up, have)
else:
line = "#define %s %s\n" % (key_up, str(have))
@@ -787,10 +789,11 @@ def _lang2suffix(lang):
When "lang" is empty or None C is assumed.
Returns a tuple (lang, suffix, None) when it works.
For an unrecognized language returns (None, None, msg).
+
Where:
- lang = the unified language name
- suffix = the suffix, including the leading dot
- msg = an error message
+ - lang = the unified language name
+ - suffix = the suffix, including the leading dot
+ - msg = an error message
"""
if not lang or lang in ["C", "c"]:
return ("C", ".c", None)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Debug.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Debug.py
index 2ba97cd3a59..eee90158918 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Debug.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Debug.py
@@ -9,7 +9,7 @@ caller_trace()
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ caller_trace()
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Debug.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Debug.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import sys
@@ -97,7 +97,8 @@ def dumpLoggedInstances(classes, file=sys.stdout):
if sys.platform[:5] == "linux":
# Linux doesn't actually support memory usage stats from getrusage().
def memory():
- mstr = open('/proc/self/stat').read()
+ with open('/proc/self/stat') as f:
+ mstr = f.read()
mstr = mstr.split()[22]
return int(mstr)
elif sys.platform[:6] == 'darwin':
@@ -233,6 +234,7 @@ def Trace(msg, file=None, mode='w', tstamp=None):
PreviousTime = now
fp.write(msg)
fp.flush()
+ fp.close()
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Defaults.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Defaults.py
index 91f8f2c74ee..e1a4ba193d3 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Defaults.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Defaults.py
@@ -10,7 +10,7 @@ from distutils.msvccompiler.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -33,7 +33,7 @@ from distutils.msvccompiler.
#
from __future__ import division
-__revision__ = "src/engine/SCons/Defaults.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Defaults.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
@@ -261,9 +261,13 @@ def copy_func(dest, src, symlinks=True):
else:
return copy_func(dest, os.path.realpath(src))
elif os.path.isfile(src):
- return shutil.copy2(src, dest)
+ shutil.copy2(src, dest)
+ return 0
else:
- return shutil.copytree(src, dest, symlinks)
+ shutil.copytree(src, dest, symlinks)
+ # copytree returns None in python2 and destination string in python3
+ # A error is raised in both cases, so we can just return 0 for success
+ return 0
Copy = ActionFactory(
copy_func,
@@ -298,7 +302,7 @@ def mkdir_func(dest):
for entry in dest:
try:
os.makedirs(str(entry))
- except os.error, e:
+ except os.error as e:
p = str(entry)
if (e.args[0] == errno.EEXIST or
(sys.platform=='win32' and e.args[0]==183)) \
@@ -338,6 +342,7 @@ Touch = ActionFactory(touch_func,
# Internal utility functions
+
def _concat(prefix, list, suffix, env, f=lambda x: x, target=None, source=None):
"""
Creates a new list from 'list' by first interpolating each element
@@ -354,6 +359,7 @@ def _concat(prefix, list, suffix, env, f=lambda x: x, target=None, source=None):
return _concat_ixes(prefix, list, suffix, env)
+
def _concat_ixes(prefix, list, suffix, env):
"""
Creates a new list from 'list' by concatenating the 'prefix' and
@@ -391,6 +397,7 @@ def _concat_ixes(prefix, list, suffix, env):
return result
+
def _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None):
"""
This is a wrapper around _concat()/_concat_ixes() that checks for
@@ -458,7 +465,7 @@ def processDefines(defs):
else:
l.append(str(d[0]))
elif SCons.Util.is_Dict(d):
- for macro,value in d.iteritems():
+ for macro,value in d.items():
if value is not None:
l.append(str(macro) + '=' + str(value))
else:
@@ -484,6 +491,7 @@ def processDefines(defs):
l = [str(defs)]
return l
+
def _defines(prefix, defs, suffix, env, c=_concat_ixes):
"""A wrapper around _concat_ixes that turns a list or string
into a list of C preprocessor command-line definitions.
@@ -491,6 +499,7 @@ def _defines(prefix, defs, suffix, env, c=_concat_ixes):
return c(prefix, env.subst_path(processDefines(defs)), suffix, env)
+
class NullCmdGenerator(object):
"""This is a callable class that can be used in place of other
command generators if you don't want them to do anything.
@@ -509,6 +518,7 @@ class NullCmdGenerator(object):
def __call__(self, target, source, env, for_signature=None):
return self.cmd
+
class Variable_Method_Caller(object):
"""A class for finding a construction variable on the stack and
calling one of its methods.
@@ -540,10 +550,10 @@ class Variable_Method_Caller(object):
frame = frame.f_back
return None
-# if env[version_var] id defined, returns env[flags_var], otherwise returns None
+# if $version_var is not empty, returns env[flags_var], otherwise returns None
def __libversionflags(env, version_var, flags_var):
try:
- if env[version_var]:
+ if env.subst('$'+version_var):
return env[flags_var]
except KeyError:
pass
@@ -558,7 +568,6 @@ ConstructionEnvironment = {
'DSUFFIXES' : SCons.Tool.DSuffixes,
'ENV' : {},
'IDLSUFFIXES' : SCons.Tool.IDLSuffixes,
-# 'LATEXSUFFIXES' : SCons.Tool.LaTeXSuffixes, # moved to the TeX tools generate functions
'_concat' : _concat,
'_defines' : _defines,
'_stripixes' : _stripixes,
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Environment.py
index 71361add4a8..2d8f9bb6623 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Environment.py
@@ -10,7 +10,7 @@ Environment
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ Environment
# 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__ = "src/engine/SCons/Environment.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Environment.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import copy
@@ -128,7 +128,7 @@ future_reserved_construction_var_names = [
def copy_non_reserved_keywords(dict):
result = semi_deepcopy(dict)
- for k in result.keys():
+ for k in list(result.keys()):
if k in reserved_construction_var_names:
msg = "Ignoring attempt to set reserved variable `$%s'"
SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % k)
@@ -147,10 +147,10 @@ def _set_future_reserved(env, key, value):
def _set_BUILDERS(env, key, value):
try:
bd = env._dict[key]
- for k in bd.keys():
+ for k in list(bd.keys()):
del bd[k]
except KeyError:
- bd = BuilderDict(kwbd, env)
+ bd = BuilderDict(bd, env)
env._dict[key] = bd
for k, v in value.items():
if not SCons.Builder.is_a_Builder(v):
@@ -167,7 +167,7 @@ def _set_SCANNERS(env, key, value):
def _delete_duplicates(l, keep_last):
"""Delete duplicates from a sequence, keeping the first or last."""
- seen={}
+ seen=set()
result=[]
if keep_last: # reverse in & out, then keep first
l.reverse()
@@ -175,7 +175,7 @@ def _delete_duplicates(l, keep_last):
try:
if i not in seen:
result.append(i)
- seen[i]=1
+ seen.add(i)
except TypeError:
# probably unhashable. Just keep it.
result.append(i)
@@ -342,7 +342,7 @@ def is_valid_construction_var(varstr):
class SubstitutionEnvironment(object):
"""Base class for different flavors of construction environments.
- This class contains a minimal set of methods that handle contruction
+ This class contains a minimal set of methods that handle construction
variable expansion and conversion of strings to Nodes, which may or
may not be actually useful as a stand-alone class. Which methods
ended up in this class is pretty arbitrary right now. They're
@@ -396,8 +396,8 @@ class SubstitutionEnvironment(object):
# gotten better than dict.has_key() in Python 2.5.)
self._special_set_keys = list(self._special_set.keys())
- def __cmp__(self, other):
- return cmp(self._dict, other._dict)
+ def __eq__(self, other):
+ return self._dict == other._dict
def __delitem__(self, key):
special = self._special_del.get(key)
@@ -589,7 +589,7 @@ class SubstitutionEnvironment(object):
out,err = p.communicate()
status = p.wait()
if err:
- sys.stderr.write(unicode(err))
+ sys.stderr.write(u"" + err)
if status:
raise OSError("'%s' exited %d" % (command, status))
return out
@@ -1185,7 +1185,7 @@ class Base(SubstitutionEnvironment):
if SCons.Util.is_List(val):
if key == 'CPPDEFINES':
tmp = []
- for (k, v) in orig.iteritems():
+ for (k, v) in orig.items():
if v is not None:
tmp.append((k, v))
else:
@@ -1273,7 +1273,7 @@ class Base(SubstitutionEnvironment):
# Construct a list of (key, value) tuples.
if SCons.Util.is_Dict(dk):
tmp = []
- for (k, v) in dk.iteritems():
+ for (k, v) in dk.items():
if v is not None:
tmp.append((k, v))
else:
@@ -1321,7 +1321,7 @@ class Base(SubstitutionEnvironment):
# Construct a list of (key, value) tuples.
if SCons.Util.is_Dict(val):
tmp = []
- for (k, v) in val.iteritems():
+ for (k, v) in val.items():
if v is not None:
tmp.append((k, v))
else:
@@ -1330,7 +1330,7 @@ class Base(SubstitutionEnvironment):
elif SCons.Util.is_String(val):
val = [(val,)]
if delete_existing:
- dk = filter(lambda x, val=val: x not in val, dk)
+ dk = list(filter(lambda x, val=val: x not in val, dk))
self._dict[key] = dk + val
else:
dk = [x for x in dk if x not in val]
@@ -1339,7 +1339,7 @@ class Base(SubstitutionEnvironment):
# By elimination, val is not a list. Since dk is a
# list, wrap val in a list first.
if delete_existing:
- dk = filter(lambda x, val=val: x not in val, dk)
+ dk = list(filter(lambda x, val=val: x not in val, dk))
self._dict[key] = dk + [val]
else:
if not val in dk:
@@ -1350,7 +1350,7 @@ class Base(SubstitutionEnvironment):
dk = [dk]
elif SCons.Util.is_Dict(dk):
tmp = []
- for (k, v) in dk.iteritems():
+ for (k, v) in dk.items():
if v is not None:
tmp.append((k, v))
else:
@@ -1363,7 +1363,7 @@ class Base(SubstitutionEnvironment):
val = [val]
elif SCons.Util.is_Dict(val):
tmp = []
- for i,j in val.iteritems():
+ for i,j in val.items():
if j is not None:
tmp.append((i,j))
else:
@@ -1771,7 +1771,7 @@ class Base(SubstitutionEnvironment):
return os.path.join(dir, new_prefix+name+new_suffix)
def SetDefault(self, **kw):
- for k in kw.keys():
+ for k in list(kw.keys()):
if k in self._dict:
del kw[k]
self.Replace(**kw)
@@ -1833,7 +1833,7 @@ class Base(SubstitutionEnvironment):
uniq = {}
for executor in [n.get_executor() for n in nodes]:
uniq[executor] = 1
- for executor in uniq.keys():
+ for executor in list(uniq.keys()):
executor.add_pre_action(action)
return nodes
@@ -1843,7 +1843,7 @@ class Base(SubstitutionEnvironment):
uniq = {}
for executor in [n.get_executor() for n in nodes]:
uniq[executor] = 1
- for executor in uniq.keys():
+ for executor in list(uniq.keys()):
executor.add_post_action(action)
return nodes
@@ -1983,6 +1983,15 @@ class Base(SubstitutionEnvironment):
return result
return self.fs.Dir(s, *args, **kw)
+ def PyPackageDir(self, modulename):
+ s = self.subst(modulename)
+ if SCons.Util.is_Sequence(s):
+ result=[]
+ for e in s:
+ result.append(self.fs.PyPackageDir(e))
+ return result
+ return self.fs.PyPackageDir(s)
+
def NoClean(self, *targets):
"""Tags a target so that it will not be cleaned by -c"""
tlist = []
@@ -2180,13 +2189,16 @@ class Base(SubstitutionEnvironment):
"""This function converts a string or list into a list of strings
or Nodes. This makes things easier for users by allowing files to
be specified as a white-space separated list to be split.
+
The input rules are:
- A single string containing names separated by spaces. These will be
split apart at the spaces.
- A single Node instance
- A list containing either strings or Node instances. Any strings
in the list are not split at spaces.
+
In all cases, the function returns a list of Nodes and strings."""
+
if SCons.Util.is_List(arg):
return list(map(self.subst, arg))
elif SCons.Util.is_String(arg):
@@ -2246,7 +2258,7 @@ class Base(SubstitutionEnvironment):
while (node != node.srcnode()):
node = node.srcnode()
return node
- sources = map( final_source, sources );
+ sources = list(map(final_source, sources))
# remove duplicates
return list(set(sources))
@@ -2368,19 +2380,21 @@ class OverrideEnvironment(Base):
Environment = Base
-# An entry point for returning a proxy subclass instance that overrides
-# the subst*() methods so they don't actually perform construction
-# variable substitution. This is specifically intended to be the shim
-# layer in between global function calls (which don't want construction
-# variable substitution) and the DefaultEnvironment() (which would
-# substitute variables if left to its own devices)."""
-#
-# We have to wrap this in a function that allows us to delay definition of
-# the class until it's necessary, so that when it subclasses Environment
-# it will pick up whatever Environment subclass the wrapper interface
-# might have assigned to SCons.Environment.Environment.
def NoSubstitutionProxy(subject):
+ """
+ An entry point for returning a proxy subclass instance that overrides
+ the subst*() methods so they don't actually perform construction
+ variable substitution. This is specifically intended to be the shim
+ layer in between global function calls (which don't want construction
+ variable substitution) and the DefaultEnvironment() (which would
+ substitute variables if left to its own devices).
+
+ We have to wrap this in a function that allows us to delay definition of
+ the class until it's necessary, so that when it subclasses Environment
+ it will pick up whatever Environment subclass the wrapper interface
+ might have assigned to SCons.Environment.Environment.
+ """
class _NoSubstitutionProxy(Environment):
def __init__(self, subject):
self.__dict__['__subject'] = subject
@@ -2389,7 +2403,7 @@ def NoSubstitutionProxy(subject):
def __setattr__(self, name, value):
return setattr(self.__dict__['__subject'], name, value)
def executor_to_lvars(self, kwdict):
- if kwdict.has_key('executor'):
+ if 'executor' in kwdict:
kwdict['lvars'] = kwdict['executor'].get_lvars()
del kwdict['executor']
else:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Errors.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Errors.py
index 0ddd7b35c03..1797ea91f3e 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Errors.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Errors.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,72 +28,74 @@ and user errors in SCons.
"""
-__revision__ = "src/engine/SCons/Errors.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Errors.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+import shutil
import SCons.Util
-import exceptions
class BuildError(Exception):
- """ Errors occuring while building.
+ """ Errors occurring while building.
BuildError have the following attributes:
+ =========================================
- Information about the cause of the build error:
- -----------------------------------------------
-
- errstr : a description of the error message
-
- status : the return code of the action that caused the build
- error. Must be set to a non-zero value even if the
- build error is not due to an action returning a
- non-zero returned code.
-
- exitstatus : SCons exit status due to this build error.
- Must be nonzero unless due to an explicit Exit()
- call. Not always the same as status, since
- actions return a status code that should be
- respected, but SCons typically exits with 2
- irrespective of the return value of the failed
- action.
-
- filename : The name of the file or directory that caused the
- build error. Set to None if no files are associated with
- this error. This might be different from the target
- being built. For example, failure to create the
- directory in which the target file will appear. It
- can be None if the error is not due to a particular
- filename.
-
- exc_info : Info about exception that caused the build
- error. Set to (None, None, None) if this build
- error is not due to an exception.
-
-
- Information about the cause of the location of the error:
- ---------------------------------------------------------
-
- node : the error occured while building this target node(s)
-
- executor : the executor that caused the build to fail (might
- be None if the build failures is not due to the
- executor failing)
-
- action : the action that caused the build to fail (might be
- None if the build failures is not due to the an
- action failure)
-
- command : the command line for the action that caused the
- build to fail (might be None if the build failures
- is not due to the an action failure)
- """
-
- def __init__(self,
+ Information about the cause of the build error:
+ -----------------------------------------------
+
+ errstr : a description of the error message
+
+ status : the return code of the action that caused the build error.
+ Must be set to a non-zero value even if the build error is not due
+ to an action returning a non-zero returned code.
+
+ exitstatus : SCons exit status due to this build error.
+ Must be nonzero unless due to an explicit Exit()
+ call. Not always the same as status, since
+ actions return a status code that should be
+ respected, but SCons typically exits with 2
+ irrespective of the return value of the failed
+ action.
+
+ filename : The name of the file or directory that caused the
+ build error. Set to None if no files are associated with
+ this error. This might be different from the target
+ being built. For example, failure to create the
+ directory in which the target file will appear. It
+ can be None if the error is not due to a particular
+ filename.
+
+ exc_info : Info about exception that caused the build
+ error. Set to (None, None, None) if this build
+ error is not due to an exception.
+
+
+ Information about the cause of the location of the error:
+ ---------------------------------------------------------
+
+ node : the error occured while building this target node(s)
+
+ executor : the executor that caused the build to fail (might
+ be None if the build failures is not due to the
+ executor failing)
+
+ action : the action that caused the build to fail (might be
+ None if the build failures is not due to the an
+ action failure)
+
+ command : the command line for the action that caused the
+ build to fail (might be None if the build failures
+ is not due to the an action failure)
+ """
+
+ def __init__(self,
node=None, errstr="Unknown error", status=2, exitstatus=2,
filename=None, executor=None, action=None, command=None,
exc_info=(None, None, None)):
-
- self.errstr = errstr
+
+ # py3: errstr should be string and not bytes.
+
+ self.errstr = SCons.Util.to_String(errstr)
self.status = status
self.exitstatus = exitstatus
self.filename = filename
@@ -104,7 +106,7 @@ class BuildError(Exception):
self.action = action
self.command = command
- Exception.__init__(self, node, errstr, status, exitstatus, filename,
+ Exception.__init__(self, node, errstr, status, exitstatus, filename,
executor, action, command, exc_info)
def __str__(self):
@@ -139,13 +141,17 @@ def convert_to_BuildError(status, exc_info=None):
"""
Convert any return code a BuildError Exception.
- `status' can either be a return code or an Exception.
+ :Parameters:
+ - `status`: can either be a return code or an Exception.
+
The buildError.status we set here will normally be
used as the exit status of the "scons" process.
"""
+
if not exc_info and isinstance(status, Exception):
exc_info = (status.__class__, status, None)
+
if isinstance(status, BuildError):
buildError = status
buildError.exitstatus = 2 # always exit with 2 on build errors
@@ -163,17 +169,34 @@ def convert_to_BuildError(status, exc_info=None):
status=2,
exitstatus=2,
exc_info=exc_info)
- elif isinstance(status, exceptions.EnvironmentError):
+ elif isinstance(status, shutil.SameFileError):
+ # PY3 has a exception for when copying file to itself
+ # It's object provides info differently than below
+ try:
+ filename = status.filename
+ except AttributeError:
+ filename = None
+
+ buildError = BuildError(
+ errstr=status.args[0],
+ status=status.errno,
+ exitstatus=2,
+ filename=filename,
+ exc_info=exc_info)
+
+ elif isinstance(status, (EnvironmentError, OSError, IOError)):
# If an IOError/OSError happens, raise a BuildError.
# Report the name of the file or directory that caused the
# error, which might be different from the target being built
# (for example, failure to create the directory in which the
# target file will appear).
- try: filename = status.filename
- except AttributeError: filename = None
- buildError = BuildError(
- errstr=status.strerror,
- status=status.errno,
+ filename = getattr(status, 'filename', None)
+ strerror = getattr(status, 'strerror', str(status))
+ errno = getattr(status, 'errno', 2)
+
+ buildError = BuildError(
+ errstr=strerror,
+ status=errno,
exitstatus=2,
filename=filename,
exc_info=exc_info)
@@ -193,9 +216,9 @@ def convert_to_BuildError(status, exc_info=None):
errstr="Error %s" % status,
status=status,
exitstatus=2)
-
+
#import sys
- #sys.stderr.write("convert_to_BuildError: status %s => (errstr %s, status %s)"%(status,buildError.errstr, buildError.status))
+ #sys.stderr.write("convert_to_BuildError: status %s => (errstr %s, status %s)\n"%(status,buildError.errstr, buildError.status))
return buildError
# Local Variables:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Executor.py
index 8161502cc9f..b6d2fb6c447 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Executor.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Executor.py
@@ -6,7 +6,7 @@ Nodes.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,8 +26,9 @@ Nodes.
# 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.
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Executor.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Executor.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import collections
@@ -35,7 +36,7 @@ import SCons.Debug
from SCons.Debug import logInstanceCreation
import SCons.Errors
import SCons.Memoize
-
+from SCons.compat import with_metaclass, NoSlotsPyPy
class Batch(object):
"""Remembers exact association between targets
@@ -154,7 +155,7 @@ _execute_str_map = {0 : execute_null_str,
1 : execute_actions_str}
-class Executor(object):
+class Executor(object, with_metaclass(NoSlotsPyPy)):
"""A class for controlling instances of executing an action.
This largely exists to hold a single association of an action,
@@ -449,16 +450,24 @@ class Executor(object):
"""Fetch the signature contents. This is the main reason this
class exists, so we can compute this once and cache it regardless
of how many target or source Nodes there are.
+
+ Returns bytes
"""
try:
return self._memo['get_contents']
except KeyError:
pass
env = self.get_build_env()
- result = "".join([action.get_contents(self.get_all_targets(),
- self.get_all_sources(),
- env)
- for action in self.get_action_list()])
+
+ action_list = self.get_action_list()
+ all_targets = self.get_all_targets()
+ all_sources = self.get_all_sources()
+
+ result = bytearray("",'utf-8').join([action.get_contents(all_targets,
+ all_sources,
+ env)
+ for action in action_list])
+
self._memo['get_contents'] = result
return result
@@ -580,7 +589,7 @@ def get_NullEnvironment():
nullenv = NullEnvironment()
return nullenv
-class Null(object):
+class Null(object, with_metaclass(NoSlotsPyPy)):
"""A null Executor, with a null build Environment, that does
nothing when the rest of the methods call it.
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Job.py
index 19cf3be9d2f..8029d43b5ac 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Job.py
@@ -7,7 +7,7 @@ stop, and wait on jobs.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +29,7 @@ stop, and wait on jobs.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Job.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Job.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.compat
@@ -278,14 +278,14 @@ else:
try:
prev_size = threading.stack_size(stack_size*1024)
- except AttributeError, e:
+ except AttributeError as e:
# Only print a warning if the stack size has been
# explicitly set.
if not explicit_stack_size is None:
msg = "Setting stack size is unsupported by this version of Python:\n " + \
e.args[0]
SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)
- except ValueError, e:
+ except ValueError as e:
msg = "Setting stack size failed:\n " + str(e)
SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Memoize.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Memoize.py
index 495e13c05da..d8912c90aba 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Memoize.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Memoize.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,8 +20,9 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Memoize.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Memoize.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """Memoizer
@@ -33,7 +34,7 @@ values in a consistent way. In particular, it requires that the class uses a
dictionary named "_memo" to store the cached values.
Here is an example of wrapping a method that returns a computed value,
-with no input parameters:
+with no input parameters::
@SCons.Memoize.CountMethodCall
def foo(self):
@@ -50,7 +51,7 @@ with no input parameters:
return result
Here is an example of wrapping a method that will return different values
-based on one or more input arguments:
+based on one or more input arguments::
def _bar_key(self, argument): # Memoization
return argument # Memoization
@@ -123,13 +124,12 @@ class Counter(object):
def key(self):
return self.cls_name+'.'+self.method_name
def display(self):
- fmt = " %7d hits %7d misses %s()"
- print fmt % (self.hit, self.miss, self.key())
- def __cmp__(self, other):
+ print(" {:7d} hits {:7d} misses {}()".format(self.hit, self.miss, self.key()))
+ def __eq__(self, other):
try:
- return cmp(self.key(), other.key())
+ return self.key() == other.key()
except AttributeError:
- return 0
+ return True
class CountValue(Counter):
"""
@@ -185,7 +185,7 @@ def Dump(title=None):
collected so far.
"""
if title:
- print title
+ print(title)
for counter in sorted(CounterList):
CounterList[counter].display()
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/Alias.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/Alias.py
index d6adbf8e902..3570a2f6138 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/Alias.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/Alias.py
@@ -8,7 +8,7 @@ This creates a hash of global Aliases (dummy targets).
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ This creates a hash of global Aliases (dummy targets).
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Node/Alias.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Node/Alias.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import collections
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/FS.py
index 952be01ca91..01305df3db1 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/FS.py
@@ -11,7 +11,7 @@ that can be used by scripts or modules looking for the canonical default.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,8 +31,9 @@ that can be used by scripts or modules looking for the canonical default.
# 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.
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Node/FS.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Node/FS.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import fnmatch
import os
@@ -42,6 +43,7 @@ import stat
import sys
import time
import codecs
+from itertools import chain
import SCons.Action
import SCons.Debug
@@ -55,15 +57,7 @@ import SCons.Util
import SCons.Warnings
from SCons.Debug import Trace
-
-# SERVER-25436: to work around an issue with python on windows where shutil.copy<2> methods
-# didn't appropriately close files, which caused build failures with the cached build.
-if sys.platform == "win32":
- import win32api
- _copy = _copy2 = win32api.CopyFile
-else:
- _copy = shutil.copy
- _copy2 = shutil.copy2
+from . import DeciderNeedsNode
print_duplicate = 0
@@ -82,6 +76,9 @@ def sconsign_dir(node):
_sconsign_map = {0 : sconsign_none,
1 : sconsign_dir}
+class FileBuildInfoFileToCsigMappingError(Exception):
+ pass
+
class EntryProxyAttributeError(AttributeError):
"""
An AttributeError subclass for recording and displaying the name
@@ -131,7 +128,7 @@ def save_strings(val):
# tells us whether or not os.path.splitdrive() actually does anything
# on this system, and therefore whether we need to bother calling it
# when looking up path names in various methods below.
-#
+#
do_splitdrive = None
_my_splitdrive =None
@@ -140,7 +137,10 @@ def initialize_do_splitdrive():
global do_splitdrive
global has_unc
drive, path = os.path.splitdrive('X:/foo')
- has_unc = hasattr(os.path, 'splitunc')
+ # splitunc is removed from python 3.7 and newer
+ # so we can also just test if splitdrive works with UNC
+ has_unc = (hasattr(os.path, 'splitunc')
+ or os.path.splitdrive(r'\\split\drive\test')[0] == r'\\split\drive')
do_splitdrive = not not drive or has_unc
@@ -166,7 +166,7 @@ def initialize_do_splitdrive():
global OS_SEP
global UNC_PREFIX
global os_sep_is_slash
-
+
OS_SEP = os.sep
UNC_PREFIX = OS_SEP + OS_SEP
os_sep_is_slash = OS_SEP == '/'
@@ -187,7 +187,7 @@ needs_normpath_check = re.compile(
# b) The path starts with '..'. E.g. '../' or '../moredirs'
# but we not match '..abc/'.
# c) The path ends with '..'. E.g. '/..' or 'dirs/..'
- # d) The path contains a '..' in the middle.
+ # d) The path contains a '..' in the middle.
# E.g. dirs/../moredirs
(.*/)?\.\.(?:/|$) |
@@ -209,7 +209,7 @@ needs_normpath_check = re.compile(
\./|.*/\.(?:/|$)
- ''',
+ ''',
re.VERBOSE
)
needs_normpath_match = needs_normpath_check.match
@@ -228,7 +228,12 @@ needs_normpath_match = needs_normpath_check.match
# there should be *no* changes to the external file system(s)...
#
-if hasattr(os, 'link'):
+# For Now disable hard & softlinks for win32
+# PY3 supports them, but the rest of SCons is not ready for this
+# in some cases user permissions may be required.
+# TODO: See if theres a reasonable way to enable using links on win32/64
+
+if hasattr(os, 'link') and sys.platform != 'win32':
def _hardlink_func(fs, src, dst):
# If the source is a symlink, we can't just hard-link to it
# because a relative symlink may point somewhere completely
@@ -244,14 +249,14 @@ if hasattr(os, 'link'):
else:
_hardlink_func = None
-if hasattr(os, 'symlink'):
+if hasattr(os, 'symlink') and sys.platform != 'win32':
def _softlink_func(fs, src, dst):
fs.symlink(src, dst)
else:
_softlink_func = None
def _copy_func(fs, src, dest):
- _copy2(src, dest)
+ shutil.copy2(src, dest)
st = fs.stat(src)
fs.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
@@ -285,11 +290,13 @@ def set_duplicate(duplicate):
Link_Funcs.append(link_dict[func])
def LinkFunc(target, source, env):
- # Relative paths cause problems with symbolic links, so
- # we use absolute paths, which may be a problem for people
- # who want to move their soft-linked src-trees around. Those
- # people should use the 'hard-copy' mode, softlinks cannot be
- # used for that; at least I have no idea how ...
+ """
+ Relative paths cause problems with symbolic links, so
+ we use absolute paths, which may be a problem for people
+ who want to move their soft-linked src-trees around. Those
+ people should use the 'hard-copy' mode, softlinks cannot be
+ used for that; at least I have no idea how ...
+ """
src = source[0].get_abspath()
dest = target[0].get_abspath()
dir, file = os.path.split(dest)
@@ -331,7 +338,12 @@ Unlink = SCons.Action.Action(UnlinkFunc, None)
def MkdirFunc(target, source, env):
t = target[0]
- if not t.exists():
+ # This os.path.exists test looks redundant, but it's possible
+ # when using Install() to install multiple dirs outside the
+ # source tree to get a case where t.exists() is true but
+ # the path does already exist, so this prevents spurious
+ # build failures in that case. See test/Install/multi-dir.
+ if not t.exists() and not os.path.exists(t.get_abspath()):
t.fs.mkdir(t.get_abspath())
return 0
@@ -359,33 +371,6 @@ class _Null(object):
_null = _Null()
-DefaultSCCSBuilder = None
-DefaultRCSBuilder = None
-
-def get_DefaultSCCSBuilder():
- global DefaultSCCSBuilder
- if DefaultSCCSBuilder is None:
- import SCons.Builder
- # "env" will get filled in by Executor.get_build_env()
- # calling SCons.Defaults.DefaultEnvironment() when necessary.
- act = SCons.Action.Action('$SCCSCOM', '$SCCSCOMSTR')
- DefaultSCCSBuilder = SCons.Builder.Builder(action = act,
- env = None,
- name = "DefaultSCCSBuilder")
- return DefaultSCCSBuilder
-
-def get_DefaultRCSBuilder():
- global DefaultRCSBuilder
- if DefaultRCSBuilder is None:
- import SCons.Builder
- # "env" will get filled in by Executor.get_build_env()
- # calling SCons.Defaults.DefaultEnvironment() when necessary.
- act = SCons.Action.Action('$RCS_COCOM', '$RCS_COCOMSTR')
- DefaultRCSBuilder = SCons.Builder.Builder(action = act,
- env = None,
- name = "DefaultRCSBuilder")
- return DefaultRCSBuilder
-
# Cygwin's os.path.normcase pretends it's on a case-sensitive filesystem.
_is_cygwin = sys.platform == "cygwin"
if os.path.normcase("TeSt") == os.path.normpath("TeSt") and not _is_cygwin:
@@ -430,46 +415,12 @@ def do_diskcheck_match(node, predicate, errorfmt):
def ignore_diskcheck_match(node, predicate, errorfmt):
pass
-def do_diskcheck_rcs(node, name):
- try:
- rcs_dir = node.rcs_dir
- except AttributeError:
- if node.entry_exists_on_disk('RCS'):
- rcs_dir = node.Dir('RCS')
- else:
- rcs_dir = None
- node.rcs_dir = rcs_dir
- if rcs_dir:
- return rcs_dir.entry_exists_on_disk(name+',v')
- return None
-
-def ignore_diskcheck_rcs(node, name):
- return None
-def do_diskcheck_sccs(node, name):
- try:
- sccs_dir = node.sccs_dir
- except AttributeError:
- if node.entry_exists_on_disk('SCCS'):
- sccs_dir = node.Dir('SCCS')
- else:
- sccs_dir = None
- node.sccs_dir = sccs_dir
- if sccs_dir:
- return sccs_dir.entry_exists_on_disk('s.'+name)
- return None
-
-def ignore_diskcheck_sccs(node, name):
- return None
diskcheck_match = DiskChecker('match', do_diskcheck_match, ignore_diskcheck_match)
-diskcheck_rcs = DiskChecker('rcs', do_diskcheck_rcs, ignore_diskcheck_rcs)
-diskcheck_sccs = DiskChecker('sccs', do_diskcheck_sccs, ignore_diskcheck_sccs)
diskcheckers = [
diskcheck_match,
- diskcheck_rcs,
- diskcheck_sccs,
]
def set_diskcheck(list):
@@ -485,6 +436,11 @@ class EntryProxy(SCons.Util.Proxy):
__str__ = SCons.Util.Delegate('__str__')
+ # In PY3 if a class defines __eq__, then it must explicitly provide
+ # __hash__. Since SCons.Util.Proxy provides __eq__ we need the following
+ # see: https://docs.python.org/3.1/reference/datamodel.html#object.__hash__
+ __hash__ = SCons.Util.Delegate('__hash__')
+
def __get_abspath(self):
entry = self.get()
return SCons.Subst.SpecialAttrWrapper(entry.get_abspath(),
@@ -573,7 +529,7 @@ class EntryProxy(SCons.Util.Proxy):
except KeyError:
try:
attr = SCons.Util.Proxy.__getattr__(self, name)
- except AttributeError, e:
+ except AttributeError as e:
# Raise our own AttributeError subclass with an
# overridden __str__() method that identifies the
# name of the entry that caused the exception.
@@ -582,6 +538,7 @@ class EntryProxy(SCons.Util.Proxy):
else:
return attr_function(self)
+
class Base(SCons.Node.Node):
"""A generic class for file system entries. This class is for
when we don't know yet whether the entry being looked up is a file
@@ -617,14 +574,13 @@ class Base(SCons.Node.Node):
our relative and absolute paths, identify our parent
directory, and indicate that this node should use
signatures."""
+
if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Base')
SCons.Node.Node.__init__(self)
- # Filenames and paths are probably reused and are intern'ed to
- # save some memory.
-
- #: Filename with extension as it was specified when the object was
- #: created; to obtain filesystem path, use Python str() function
+ # Filenames and paths are probably reused and are intern'ed to save some memory.
+ # Filename with extension as it was specified when the object was
+ # created; to obtain filesystem path, use Python str() function
self.name = SCons.Util.silent_intern(name)
self.fs = fs #: Reference to parent Node.FS object
@@ -679,14 +635,14 @@ class Base(SCons.Node.Node):
single variables lazily when required, in order to save memory.
The redirection to the getters lets older Tools and
SConstruct continue to work without any additional changes,
- fully transparent to the user.
+ fully transparent to the user.
Note, that __getattr__ is only called as fallback when the
requested attribute can't be found, so there should be no
speed performance penalty involved for standard builds.
"""
if attr in node_bwcomp:
return node_bwcomp[attr](self)
-
+
raise AttributeError("%r object has no attribute %r" %
(self.__class__, attr))
@@ -698,13 +654,17 @@ class Base(SCons.Node.Node):
return self._save_str()
return self._get_str()
+ def __lt__(self, other):
+ """ less than operator used by sorting on py3"""
+ return str(self) < str(other)
+
@SCons.Memoize.CountMethodCall
def _save_str(self):
try:
return self._memo['_save_str']
except KeyError:
pass
- result = sys.intern(self._get_str())
+ result = SCons.Util.silent_intern(self._get_str())
self._memo['_save_str'] = result
return result
@@ -737,10 +697,15 @@ class Base(SCons.Node.Node):
@SCons.Memoize.CountMethodCall
def stat(self):
- try: return self._memo['stat']
- except KeyError: pass
- try: result = self.fs.stat(self.get_abspath())
- except os.error: result = None
+ try:
+ return self._memo['stat']
+ except KeyError:
+ pass
+ try:
+ result = self.fs.stat(self.get_abspath())
+ except os.error:
+ result = None
+
self._memo['stat'] = result
return result
@@ -752,13 +717,17 @@ class Base(SCons.Node.Node):
def getmtime(self):
st = self.stat()
- if st: return st[stat.ST_MTIME]
- else: return None
+ if st:
+ return st[stat.ST_MTIME]
+ else:
+ return None
def getsize(self):
st = self.stat()
- if st: return st[stat.ST_SIZE]
- else: return None
+ if st:
+ return st[stat.ST_SIZE]
+ else:
+ return None
def isdir(self):
st = self.stat()
@@ -808,7 +777,7 @@ class Base(SCons.Node.Node):
path_elems = self.get_path_elements()
pathname = ''
try: i = path_elems.index(dir)
- except ValueError:
+ except ValueError:
for p in path_elems[:-1]:
pathname += p.dirname
else:
@@ -849,13 +818,13 @@ class Base(SCons.Node.Node):
return self.name
else:
return self.dir.entry_path(self.name)
-
+
def get_tpath(self):
if self.dir._tpath == '.':
return self.name
else:
return self.dir.entry_tpath(self.name)
-
+
def get_path_elements(self):
return self.dir._path_elements + [self]
@@ -948,7 +917,7 @@ class Base(SCons.Node.Node):
def _glob1(self, pattern, ondisk=True, source=False, strings=False):
return []
-
+
# Dict that provides a simple backward compatibility
# layer for the Node attributes 'abspath', 'labspath',
# 'path', 'tpath' and 'path_elements'.
@@ -980,15 +949,13 @@ class Entry(Base):
'root',
'dirname',
'on_disk_entries',
- 'sccs_dir',
- 'rcs_dir',
'released_target_info',
'contentsig']
def __init__(self, name, directory, fs):
Base.__init__(self, name, directory, fs)
self._func_exists = 3
- self._func_get_contents = 1
+ self._func_get_contents = 1
def diskcheck_match(self):
pass
@@ -1105,29 +1072,30 @@ _classEntry = Entry
class LocalFS(object):
-
- # This class implements an abstraction layer for operations involving
- # a local file system. Essentially, this wraps any function in
- # the os, os.path or shutil modules that we use to actually go do
- # anything with or to the local file system.
- #
- # Note that there's a very good chance we'll refactor this part of
- # the architecture in some way as we really implement the interface(s)
- # for remote file system Nodes. For example, the right architecture
- # might be to have this be a subclass instead of a base class.
- # Nevertheless, we're using this as a first step in that direction.
- #
- # We're not using chdir() yet because the calling subclass method
- # needs to use os.chdir() directly to avoid recursion. Will we
- # really need this one?
+ """
+ This class implements an abstraction layer for operations involving
+ a local file system. Essentially, this wraps any function in
+ the os, os.path or shutil modules that we use to actually go do
+ anything with or to the local file system.
+
+ Note that there's a very good chance we'll refactor this part of
+ the architecture in some way as we really implement the interface(s)
+ for remote file system Nodes. For example, the right architecture
+ might be to have this be a subclass instead of a base class.
+ Nevertheless, we're using this as a first step in that direction.
+
+ We're not using chdir() yet because the calling subclass method
+ needs to use os.chdir() directly to avoid recursion. Will we
+ really need this one?
+ """
#def chdir(self, path):
# return os.chdir(path)
def chmod(self, path, mode):
return os.chmod(path, mode)
def copy(self, src, dst):
- return _copy(src, dst)
+ return shutil.copy(src, dst)
def copy2(self, src, dst):
- return _copy2(src, dst)
+ return shutil.copy2(src, dst)
def exists(self, path):
return os.path.exists(path)
def getmtime(self, path):
@@ -1207,7 +1175,7 @@ class FS(LocalFS):
DirNodeInfo.fs = self
FileNodeInfo.fs = self
-
+
def set_SConstruct_dir(self, dir):
self.SConstruct_dir = dir
@@ -1219,9 +1187,9 @@ class FS(LocalFS):
def getcwd(self):
if hasattr(self, "_cwd"):
- return self._cwd
+ return self._cwd
else:
- return "<no cwd>"
+ return "<no cwd>"
def chdir(self, dir, change_os_dir=0):
"""Change the current working directory for lookups.
@@ -1319,7 +1287,7 @@ class FS(LocalFS):
p = p.strip('/')
needs_normpath = needs_normpath_match(p)
-
+
# The path is relative to the top-level SCons directory.
if p in ('', '.'):
p = directory.get_labspath()
@@ -1447,6 +1415,35 @@ class FS(LocalFS):
d = self.Dir(d)
self.Top.addRepository(d)
+ def PyPackageDir(self, modulename):
+ """Locate the directory of a given python module name
+
+ For example scons might resolve to
+ Windows: C:\Python27\Lib\site-packages\scons-2.5.1
+ Linux: /usr/lib/scons
+
+ This can be useful when we want to determine a toolpath based on a python module name"""
+
+ dirpath = ''
+ if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0,1,2,3,4)):
+ # Python2 Code
+ import imp
+ splitname = modulename.split('.')
+ srchpths = sys.path
+ for item in splitname:
+ file, path, desc = imp.find_module(item, srchpths)
+ if file is not None:
+ path = os.path.dirname(path)
+ srchpths = [path]
+ dirpath = path
+ else:
+ # Python3 Code
+ import importlib.util
+ modspec = importlib.util.find_spec(modulename)
+ dirpath = os.path.dirname(modspec.origin)
+ return self._lookup(dirpath, None, Dir, True)
+
+
def variant_dir_target_climb(self, orig, dir, tail):
"""Create targets in corresponding variant directories
@@ -1478,7 +1475,7 @@ class FS(LocalFS):
"""
Globs
- This is mainly a shim layer
+ This is mainly a shim layer
"""
if cwd is None:
cwd = self.getcwd()
@@ -1527,8 +1524,6 @@ class Dir(Base):
'root',
'dirname',
'on_disk_entries',
- 'sccs_dir',
- 'rcs_dir',
'released_target_info',
'contentsig']
@@ -1564,7 +1559,7 @@ class Dir(Base):
self._func_sconsign = 1
self._func_exists = 2
self._func_get_contents = 2
-
+
self._abspath = SCons.Util.silent_intern(self.dir.entry_abspath(self.name))
self._labspath = SCons.Util.silent_intern(self.dir.entry_labspath(self.name))
if self.dir._path == '.':
@@ -1603,7 +1598,7 @@ class Dir(Base):
# Prepend MkdirBuilder action to existing action list
l = self.get_executor().action_list
a = get_MkdirBuilder().action
- l.insert(0, a)
+ l.insert(0, a)
self.get_executor().set_action_list(l)
def diskcheck_match(self):
@@ -1615,7 +1610,7 @@ class Dir(Base):
This clears any cached information that is invalidated by changing
the repository."""
- for node in self.entries.values():
+ for node in list(self.entries.values()):
if node != self.dir:
if node != self and isinstance(node, Dir):
node.__clearRepositoryCache(duplicate)
@@ -1751,7 +1746,7 @@ class Dir(Base):
path_elems = ['..'] * (len(self._path_elements) - i) \
+ [n.name for n in other._path_elements[i:]]
-
+
result = OS_SEP.join(path_elems)
memo_dict[other] = result
@@ -1922,10 +1917,10 @@ class Dir(Base):
def get_internal_path(self):
return self._path
-
+
def get_tpath(self):
return self._tpath
-
+
def get_path_elements(self):
return self._path_elements
@@ -1945,7 +1940,7 @@ class Dir(Base):
""" Searches through the file/dir entries of the current
directory, and returns True if a physical entry with the given
name could be found.
-
+
@see rentry_exists_on_disk
"""
try:
@@ -1979,10 +1974,10 @@ class Dir(Base):
The local directory (self) gets searched first, so
repositories take a lower precedence regarding the
searching order.
-
+
@see entry_exists_on_disk
"""
-
+
rentry_exists = self.entry_exists_on_disk(name)
if not rentry_exists:
# Search through the repository folders
@@ -2094,9 +2089,7 @@ class Dir(Base):
return node
def file_on_disk(self, name):
- if self.entry_exists_on_disk(name) or \
- diskcheck_rcs(self, name) or \
- diskcheck_sccs(self, name):
+ if self.entry_exists_on_disk(name):
try: return self.File(name)
except TypeError: pass
node = self.srcdir_duplicate(name)
@@ -2187,7 +2180,7 @@ class Dir(Base):
for x in excludeList:
r = self.glob(x, ondisk, source, strings)
excludes.extend(r)
- result = filter(lambda x: not any(fnmatch.fnmatch(str(x), str(e)) for e in SCons.Util.flatten(excludes)), result)
+ result = [x for x in result if not any(fnmatch.fnmatch(str(x), str(e)) for e in SCons.Util.flatten(excludes))]
return sorted(result, key=lambda a: str(a))
def _glob1(self, pattern, ondisk=True, source=False, strings=False):
@@ -2265,9 +2258,9 @@ class RootDir(Dir):
add a separator when creating the path names of entries within
this directory.
"""
-
+
__slots__ = ['_lookupDict']
-
+
def __init__(self, drive, fs):
if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir')
SCons.Node.Node.__init__(self)
@@ -2275,7 +2268,7 @@ class RootDir(Dir):
# Handle all the types of drives:
if drive == '':
# No drive, regular UNIX root or Windows default drive.
- name = OS_SEP
+ name = OS_SEP
dirname = OS_SEP
elif drive == '//':
# UNC path
@@ -2286,8 +2279,8 @@ class RootDir(Dir):
name = drive
dirname = drive + OS_SEP
- #: Filename with extension as it was specified when the object was
- #: created; to obtain filesystem path, use Python str() function
+ # Filename with extension as it was specified when the object was
+ # created; to obtain filesystem path, use Python str() function
self.name = SCons.Util.silent_intern(name)
self.fs = fs #: Reference to parent Node.FS object
@@ -2345,7 +2338,7 @@ class RootDir(Dir):
self._func_sconsign = 1
self._func_exists = 2
self._func_get_contents = 2
-
+
# Don't just reset the executor, replace its action list,
# because it might have some pre-or post-actions that need to
# be preserved.
@@ -2361,9 +2354,9 @@ class RootDir(Dir):
# Prepend MkdirBuilder action to existing action list
l = self.get_executor().action_list
a = get_MkdirBuilder().action
- l.insert(0, a)
+ l.insert(0, a)
self.get_executor().set_action_list(l)
-
+
def must_be_same(self, klass):
if klass is Dir:
@@ -2442,6 +2435,7 @@ class RootDir(Dir):
def src_builder(self):
return _null
+
class FileNodeInfo(SCons.Node.NodeInfoBase):
__slots__ = ('csig', 'timestamp', 'size')
current_version_id = 2
@@ -2493,10 +2487,42 @@ class FileNodeInfo(SCons.Node.NodeInfoBase):
if key not in ('__weakref__',):
setattr(self, key, value)
+ def __eq__(self, other):
+ return self.csig == other.csig and self.timestamp == other.timestamp and self.size == other.size
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+
class FileBuildInfo(SCons.Node.BuildInfoBase):
- __slots__ = ()
+ """
+ This is info loaded from sconsign.
+
+ Attributes unique to FileBuildInfo:
+ dependency_map : Caches file->csig mapping
+ for all dependencies. Currently this is only used when using
+ MD5-timestamp decider.
+ It's used to ensure that we copy the correct
+ csig from previous build to be written to .sconsign when current build
+ is done. Previously the matching of csig to file was strictly by order
+ they appeared in bdepends, bsources, or bimplicit, and so a change in order
+ or count of any of these could yield writing wrong csig, and then false positive
+ rebuilds
+ """
+ __slots__ = ('dependency_map')
current_version_id = 2
+ def __setattr__(self, key, value):
+
+ # If any attributes are changed in FileBuildInfo, we need to
+ # invalidate the cached map of file name to content signature
+ # heald in dependency_map. Currently only used with
+ # MD5-timestamp decider
+ if key != 'dependency_map' and hasattr(self, 'dependency_map'):
+ del self.dependency_map
+
+ return super(FileBuildInfo, self).__setattr__(key, value)
+
def convert_to_sconsign(self):
"""
Converts this FileBuildInfo object for writing to a .sconsign file
@@ -2523,6 +2549,7 @@ class FileBuildInfo(SCons.Node.BuildInfoBase):
pass
else:
setattr(self, attr, list(map(node_to_str, val)))
+
def convert_from_sconsign(self, dir, name):
"""
Converts a newly-read FileBuildInfo object for in-SCons use
@@ -2531,6 +2558,7 @@ class FileBuildInfo(SCons.Node.BuildInfoBase):
perform--but we're leaving this method here to make that clear.
"""
pass
+
def prepare_dependencies(self):
"""
Prepares a FileBuildInfo object for explaining what changed
@@ -2559,6 +2587,7 @@ class FileBuildInfo(SCons.Node.BuildInfoBase):
s = ni.str_to_node(s)
nodes.append(s)
setattr(self, nattr, nodes)
+
def format(self, names=0):
result = []
bkids = self.bsources + self.bdepends + self.bimplicit
@@ -2571,6 +2600,7 @@ class FileBuildInfo(SCons.Node.BuildInfoBase):
result.append('%s [%s]' % (self.bactsig, self.bact))
return '\n'.join(result)
+
class File(Base):
"""A class for files in a file system.
"""
@@ -2587,8 +2617,6 @@ class File(Base):
'root',
'dirname',
'on_disk_entries',
- 'sccs_dir',
- 'rcs_dir',
'released_target_info',
'contentsig']
@@ -2637,11 +2665,11 @@ class File(Base):
self.store_info = 1
self._func_exists = 4
self._func_get_contents = 3
-
+
# Initialize this Node's decider function to decide_source() because
# every file is a source file until it has a Builder attached...
self.changed_since_last_build = 4
-
+
# If there was already a Builder set on this entry, then
# we need to make sure we call the target-decider function,
# not the source-decider. Reaching in and doing this by hand
@@ -2661,10 +2689,12 @@ class File(Base):
def get_contents(self):
return SCons.Node._get_contents_map[self._func_get_contents](self)
- # This attempts to figure out what the encoding of the text is
- # based upon the BOM bytes, and then decodes the contents so that
- # it's a valid python string.
def get_text_contents(self):
+ """
+ This attempts to figure out what the encoding of the text is
+ based upon the BOM bytes, and then decodes the contents so that
+ it's a valid python string.
+ """
contents = self.get_contents()
# The behavior of various decode() methods and functions
# w.r.t. the initial BOM bytes is different for different
@@ -2672,13 +2702,20 @@ class File(Base):
# them, but has a 'utf-8-sig' which does; 'utf-16' seems to
# strip them; etc.) Just sidestep all the complication by
# explicitly stripping the BOM before we decode().
- if contents.startswith(codecs.BOM_UTF8):
+ if contents[:len(codecs.BOM_UTF8)] == codecs.BOM_UTF8:
return contents[len(codecs.BOM_UTF8):].decode('utf-8')
- if contents.startswith(codecs.BOM_UTF16_LE):
+ if contents[:len(codecs.BOM_UTF16_LE)] == codecs.BOM_UTF16_LE:
return contents[len(codecs.BOM_UTF16_LE):].decode('utf-16-le')
- if contents.startswith(codecs.BOM_UTF16_BE):
+ if contents[:len(codecs.BOM_UTF16_BE)] == codecs.BOM_UTF16_BE:
return contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be')
- return contents
+ try:
+ return contents.decode('utf-8')
+ except UnicodeDecodeError as e:
+ try:
+ return contents.decode('latin-1')
+ except UnicodeDecodeError as e:
+ return contents.decode('utf-8', error='backslashreplace')
+
def get_content_hash(self):
"""
@@ -2690,12 +2727,12 @@ class File(Base):
try:
cs = SCons.Util.MD5filesignature(fname,
chunksize=SCons.Node.FS.File.md5_chunksize*1024)
- except EnvironmentError, e:
+ except EnvironmentError as e:
if not e.filename:
e.filename = fname
raise
return cs
-
+
@SCons.Memoize.CountMethodCall
def get_size(self):
try:
@@ -2969,30 +3006,30 @@ class File(Base):
def release_target_info(self):
"""Called just after this node has been marked
up-to-date or was built completely.
-
+
This is where we try to release as many target node infos
as possible for clean builds and update runs, in order
to minimize the overall memory consumption.
-
+
We'd like to remove a lot more attributes like self.sources
and self.sources_set, but they might get used
in a next build step. For example, during configuration
- the source files for a built *.o file are used to figure out
+ the source files for a built E{*}.o file are used to figure out
which linker to use for the resulting Program (gcc vs. g++)!
That's why we check for the 'keep_targetinfo' attribute,
config Nodes and the Interactive mode just don't allow
- an early release of most variables.
+ an early release of most variables.
In the same manner, we can't simply remove the self.attributes
here. The smart linking relies on the shared flag, and some
parts of the java Tool use it to transport information
about nodes...
-
+
@see: built() and Node.release_target_info()
"""
if (self.released_target_info or SCons.Node.interactive):
return
-
+
if not hasattr(self.attributes, 'keep_targetinfo'):
# Cache some required values, before releasing
# stuff like env, executor and builder...
@@ -3023,12 +3060,7 @@ class File(Base):
return None
scb = self.dir.src_builder()
if scb is _null:
- if diskcheck_sccs(self.dir, self.name):
- scb = get_DefaultSCCSBuilder()
- elif diskcheck_rcs(self.dir, self.name):
- scb = get_DefaultRCSBuilder()
- else:
- scb = None
+ scb = None
if scb is not None:
try:
b = self.builder
@@ -3065,7 +3097,7 @@ class File(Base):
def _rmv_existing(self):
self.clear_memoized_values()
if SCons.Node.print_duplicate:
- print "dup: removing existing target %s"%self
+ print("dup: removing existing target {}".format(self))
e = Unlink(self, [], None)
if isinstance(e, SCons.Errors.BuildError):
raise e
@@ -3089,9 +3121,8 @@ class File(Base):
else:
try:
self._createDir()
- except SCons.Errors.StopError, drive:
- desc = "No drive `%s' for target `%s'." % (drive, self)
- raise SCons.Errors.StopError(desc)
+ except SCons.Errors.StopError as drive:
+ raise SCons.Errors.StopError("No drive `{}' for target `{}'.".format(drive, self))
#
#
@@ -3107,12 +3138,11 @@ class File(Base):
def do_duplicate(self, src):
self._createDir()
if SCons.Node.print_duplicate:
- print "dup: relinking variant '%s' from '%s'"%(self, src)
+ print("dup: relinking variant '{}' from '{}'".format(self, src))
Unlink(self, None, None)
e = Link(self, src, None)
if isinstance(e, SCons.Errors.BuildError):
- desc = "Cannot duplicate `%s' in `%s': %s." % (src.get_internal_path(), self.dir._path, e.errstr)
- raise SCons.Errors.StopError(desc)
+ raise SCons.Errors.StopError("Cannot duplicate `{}' in `{}': {}.".format(src.get_internal_path(), self.dir._path, e.errstr))
self.linked = 1
# The Link() action may or may not have actually
# created the file, depending on whether the -n
@@ -3126,7 +3156,6 @@ class File(Base):
return self._memo['exists']
except KeyError:
pass
-
result = SCons.Node._exists_map[self._func_exists](self)
self._memo['exists'] = result
return result
@@ -3208,37 +3237,37 @@ class File(Base):
def built(self):
"""Called just after this File node is successfully built.
-
+
Just like for 'release_target_info' we try to release
some more target node attributes in order to minimize the
overall memory consumption.
-
+
@see: release_target_info
"""
SCons.Node.Node.built(self)
- if (not SCons.Node.interactive and
+ if (not SCons.Node.interactive and
not hasattr(self.attributes, 'keep_targetinfo')):
- # Ensure that the build infos get computed and cached...
+ # Ensure that the build infos get computed and cached...
SCons.Node.store_info_map[self.store_info](self)
# ... then release some more variables.
self._specific_sources = False
self._labspath = None
self._save_str()
self.cwd = None
-
+
self.scanner_paths = None
def changed(self, node=None, allowcache=False):
"""
Returns if the node is up-to-date with respect to the BuildInfo
- stored last time it was built.
-
+ stored last time it was built.
+
For File nodes this is basically a wrapper around Node.changed(),
but we allow the return value to get cached after the reference
to the Executor got released in release_target_info().
-
+
@see: Node.changed()
"""
if node is None:
@@ -3246,7 +3275,7 @@ class File(Base):
return self._memo['changed']
except KeyError:
pass
-
+
has_changed = SCons.Node.Node.changed(self, node)
if allowcache:
self._memo['changed'] = has_changed
@@ -3262,9 +3291,108 @@ class File(Base):
def changed_state(self, target, prev_ni):
return self.state != SCons.Node.up_to_date
- def changed_timestamp_then_content(self, target, prev_ni):
+
+ # Caching node -> string mapping for the below method
+ __dmap_cache = {}
+ __dmap_sig_cache = {}
+
+
+ def _build_dependency_map(self, binfo):
+ """
+ Build mapping from file -> signature
+
+ Args:
+ self - self
+ binfo - buildinfo from node being considered
+
+ Returns:
+ dictionary of file->signature mappings
+ """
+
+ # For an "empty" binfo properties like bsources
+ # do not exist: check this to avoid exception.
+ if (len(binfo.bsourcesigs) + len(binfo.bdependsigs) + \
+ len(binfo.bimplicitsigs)) == 0:
+ return {}
+
+
+ # store this info so we can avoid regenerating it.
+ binfo.dependency_map = { str(child):signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit),
+ chain(binfo.bsourcesigs, binfo.bdependsigs, binfo.bimplicitsigs))}
+
+ return binfo.dependency_map
+
+ def _get_previous_signatures(self, dmap):
+ """
+ Return a list of corresponding csigs from previous
+ build in order of the node/files in children.
+
+ Args:
+ self - self
+ dmap - Dictionary of file -> csig
+
+ Returns:
+ List of csigs for provided list of children
+ """
+ prev = []
+
+ # First try the simple name for node
+ c_str = str(self)
+ if os.altsep:
+ c_str = c_str.replace(os.sep, os.altsep)
+ df = dmap.get(c_str, None)
+ if not df:
+ try:
+ # this should yield a path which matches what's in the sconsign
+ c_str = self.get_path()
+ if os.altsep:
+ c_str = c_str.replace(os.sep, os.altsep)
+
+ df = dmap.get(c_str, None)
+
+ except AttributeError as e:
+ raise FileBuildInfoFileToCsigMappingError("No mapping from file name to content signature for :%s"%c_str)
+
+ return df
+
+ def changed_timestamp_then_content(self, target, prev_ni, node=None):
+ """
+ Used when decider for file is Timestamp-MD5
+
+ NOTE: If the timestamp hasn't changed this will skip md5'ing the
+ file and just copy the prev_ni provided. If the prev_ni
+ is wrong. It will propagate it.
+ See: https://github.com/SCons/scons/issues/2980
+
+ Args:
+ self - dependency
+ target - target
+ prev_ni - The NodeInfo object loaded from previous builds .sconsign
+ node - Node instance. This is the only changed* function which requires
+ node to function. So if we detect that it's not passed.
+ we throw DeciderNeedsNode, and caller should handle this and pass node.
+
+ Returns:
+ Boolean - Indicates if node(File) has changed.
+ """
+ if node is None:
+ # We need required node argument to get BuildInfo to function
+ raise DeciderNeedsNode(self.changed_timestamp_then_content)
+
+ # Now get sconsign name -> csig map and then get proper prev_ni if possible
+ bi = node.get_stored_info().binfo
+ rebuilt = False
+ try:
+ dependency_map = bi.dependency_map
+ except AttributeError as e:
+ dependency_map = self._build_dependency_map(bi)
+ rebuilt = True
+
+ prev_ni = self._get_previous_signatures(dependency_map)
+
if not self.changed_timestamp_match(target, prev_ni):
try:
+ # NOTE: We're modifying the current node's csig in a query.
self.get_ninfo().csig = prev_ni.csig
except AttributeError:
pass
@@ -3278,6 +3406,12 @@ class File(Base):
return 1
def changed_timestamp_match(self, target, prev_ni):
+ """
+ Return True if the timestamps don't match or if there is no previous timestamp
+ :param target:
+ :param prev_ni: Information about the node from the previous build
+ :return:
+ """
try:
return self.get_timestamp() != prev_ni.timestamp
except AttributeError:
@@ -3299,7 +3433,9 @@ class File(Base):
# ...and they'd like a local copy.
e = LocalCopy(self, r, None)
if isinstance(e, SCons.Errors.BuildError):
- raise
+ # Likely this should be re-raising exception e
+ # (which would be BuildError)
+ raise e
SCons.Node.store_info_map[self.store_info](self)
if T: Trace(' 1\n')
return 1
@@ -3320,11 +3456,14 @@ class File(Base):
result = self
if not self.exists():
norm_name = _my_normcase(self.name)
- for dir in self.dir.get_all_rdirs():
- try: node = dir.entries[norm_name]
- except KeyError: node = dir.file_on_disk(self.name)
+ for repo_dir in self.dir.get_all_rdirs():
+ try:
+ node = repo_dir.entries[norm_name]
+ except KeyError:
+ node = repo_dir.file_on_disk(self.name)
+
if node and node.exists() and \
- (isinstance(node, File) or isinstance(node, Entry) \
+ (isinstance(node, File) or isinstance(node, Entry)
or not node.is_derived()):
result = node
# Copy over our local attributes to the repository
@@ -3344,6 +3483,28 @@ class File(Base):
self._memo['rfile'] = result
return result
+ def find_repo_file(self):
+ """
+ For this node, find if there exists a corresponding file in one or more repositories
+ :return: list of corresponding files in repositories
+ """
+ retvals = []
+
+ norm_name = _my_normcase(self.name)
+ for repo_dir in self.dir.get_all_rdirs():
+ try:
+ node = repo_dir.entries[norm_name]
+ except KeyError:
+ node = repo_dir.file_on_disk(self.name)
+
+ if node and node.exists() and \
+ (isinstance(node, File) or isinstance(node, Entry) \
+ or not node.is_derived()):
+ retvals.append(node)
+
+ return retvals
+
+
def rstr(self):
return str(self.rfile())
@@ -3381,12 +3542,12 @@ class File(Base):
It computes and returns the signature for this
node's contents.
"""
-
+
try:
return self.contentsig
except AttributeError:
pass
-
+
executor = self.get_executor()
result = self.contentsig = SCons.Util.MD5signature(executor.get_contents())
@@ -3401,19 +3562,24 @@ class File(Base):
because multiple targets built by the same action will all
have the same build signature, and we have to differentiate
them somehow.
+
+ Signature should normally be string of hex digits.
"""
try:
return self.cachesig
except AttributeError:
pass
-
+
# Collect signatures for all children
children = self.children()
sigs = [n.get_cachedir_csig() for n in children]
+
# Append this node's signature...
sigs.append(self.get_contents_sig())
+
# ...and it's path
sigs.append(self.get_internal_path())
+
# Merge this all into a single signature
result = self.cachesig = SCons.Util.MD5collect(sigs)
return result
@@ -3470,24 +3636,19 @@ class FileFinder(object):
def _find_file_key(self, filename, paths, verbose=None):
return (filename, paths)
-
+
@SCons.Memoize.CountDictCall(_find_file_key)
def find_file(self, filename, paths, verbose=None):
"""
- find_file(str, [Dir()]) -> [nodes]
+ Find a node corresponding to either a derived file or a file that exists already.
- filename - a filename to find
- paths - a list of directory path *nodes* to search in. Can be
- represented as a list, a tuple, or a callable that is
- called with no arguments and returns the list or tuple.
+ Only the first file found is returned, and none is returned if no file is found.
- returns - the node created from the found file.
+ filename: A filename to find
+ paths: A list of directory path *nodes* to search in. Can be represented as a list, a tuple, or a callable that is called with no arguments and returns the list or tuple.
- Find a node corresponding to either a derived file or a file
- that exists already.
+ returns The node created from the found file.
- Only the first file found is returned, and none is returned
- if no file is found.
"""
memo_key = self._find_file_key(filename, paths)
try:
@@ -3556,7 +3717,7 @@ def invalidate_node_memos(targets):
if not SCons.Util.is_List(targets):
targets = [targets]
-
+
for entry in targets:
# If the target is a Node object, clear the cache. If it is a
# filename, look up potentially existing Node object first.
@@ -3568,7 +3729,7 @@ def invalidate_node_memos(targets):
# do not correspond to an existing Node object.
node = get_default_fs().Entry(entry)
if node:
- node.clear_memoized_values()
+ node.clear_memoized_values()
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/Python.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/Python.py
index f3f6c2316cc..5229b0568dc 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/Python.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/Python.py
@@ -5,7 +5,7 @@ Python nodes.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ Python nodes.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Node/Python.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Node/Python.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Node
@@ -58,7 +58,7 @@ class ValueNodeInfo(SCons.Node.NodeInfoBase):
del state['__weakref__']
except KeyError:
pass
-
+
return state
def __setstate__(self, state):
@@ -77,7 +77,7 @@ class ValueBuildInfo(SCons.Node.BuildInfoBase):
current_version_id = 2
class Value(SCons.Node.Node):
- """A class for Python variables, typically passed on the command line
+ """A class for Python variables, typically passed on the command line
or generated by a script, but not from a file or some other source.
"""
@@ -108,7 +108,7 @@ class Value(SCons.Node.Node):
is_up_to_date = SCons.Node.Node.children_are_up_to_date
def is_under(self, dir):
- # Make Value nodes get built regardless of
+ # Make Value nodes get built regardless of
# what directory scons was run from. Value nodes
# are outside the filesystem:
return 1
@@ -133,10 +133,21 @@ class Value(SCons.Node.Node):
###TODO: something reasonable about universal newlines
contents = str(self.value)
for kid in self.children(None):
- contents = contents + kid.get_contents()
+ contents = contents + kid.get_contents().decode()
return contents
- get_contents = get_text_contents ###TODO should return 'bytes' value
+ def get_contents(self):
+ """
+ Get contents for signature calculations.
+ :return: bytes
+ """
+ text_contents = self.get_text_contents()
+ try:
+ return text_contents.encode()
+ except UnicodeDecodeError:
+ # Already encoded as python2 str are bytes
+ return text_contents
+
def changed_since_last_build(self, target, prev_ni):
cur_csig = self.get_csig()
@@ -148,12 +159,17 @@ class Value(SCons.Node.Node):
def get_csig(self, calc=None):
"""Because we're a Python value node and don't have a real
timestamp, we get to ignore the calculator and just use the
- value contents."""
+ value contents.
+
+ Returns string. Ideally string of hex digits. (Not bytes)
+ """
try:
return self.ninfo.csig
except AttributeError:
pass
- contents = self.get_contents()
+
+ contents = self.get_text_contents()
+
self.get_ninfo().csig = contents
return contents
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/__init__.py
index 6567489c30a..61013f8b196 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/__init__.py
@@ -19,8 +19,10 @@ be able to depend on any other type of "thing."
"""
+from __future__ import print_function
+
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -41,8 +43,9 @@ be able to depend on any other type of "thing."
# 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__ = "src/engine/SCons/Node/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Node/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+import os
import collections
import copy
from itertools import chain
@@ -55,6 +58,8 @@ import SCons.Util
from SCons.Debug import Trace
+from SCons.compat import with_metaclass, NoSlotsPyPy
+
print_duplicate = 0
def classname(obj):
@@ -135,6 +140,7 @@ def exists_entry(node):
node.disambiguate()
return _exists_map[node._func_exists](node)
+
def exists_file(node):
# Duplicate from source path if we are set up to do this.
if node.duplicate and not node.is_derived() and not node.linked:
@@ -151,7 +157,7 @@ def exists_file(node):
# The source file does not exist. Make sure no old
# copy remains in the variant directory.
if print_duplicate:
- print "dup: no src for %s, unlinking old variant copy"%self
+ print("dup: no src for %s, unlinking old variant copy" % node)
if exists_base(node) or node.islink():
node.fs.unlink(node.get_internal_path())
# Return None explicitly because the Base.exists() call
@@ -205,13 +211,14 @@ def get_contents_dir(node):
contents.append('%s %s\n' % (n.get_csig(), n.name))
return ''.join(contents)
-def get_contents_file(node):
+def get_contents_file(node):
if not node.rexists():
- return ''
+ return b''
fname = node.rfile().get_abspath()
try:
- contents = open(fname, "rb").read()
- except EnvironmentError, e:
+ with open(fname, "rb") as fp:
+ contents = fp.read()
+ except EnvironmentError as e:
if not e.filename:
e.filename = fname
raise
@@ -241,6 +248,21 @@ _target_from_source_map = {0 : target_from_source_none,
# used by it.
#
+
+class DeciderNeedsNode(Exception):
+ """
+ Indicate that the decider needs the node as well as the target and the dependency.
+ Normally the node and the target are the same, but in the case of repository
+ They may be different. Also the NodeInfo is retrieved from the node
+ """
+ def __init__(self, call_this_decider):
+ """
+ :param call_this_decider: to return the decider to call directly since deciders
+ are called through several levels of indirection
+ """
+ self.decider = call_this_decider
+
+
#
# First, the single decider functions
#
@@ -264,6 +286,7 @@ def changed_since_last_build_node(node, target, prev_ni):
"""
raise NotImplementedError
+
def changed_since_last_build_alias(node, target, prev_ni):
cur_csig = node.get_csig()
try:
@@ -271,19 +294,24 @@ def changed_since_last_build_alias(node, target, prev_ni):
except AttributeError:
return 1
+
def changed_since_last_build_entry(node, target, prev_ni):
node.disambiguate()
return _decider_map[node.changed_since_last_build](node, target, prev_ni)
+
def changed_since_last_build_state_changed(node, target, prev_ni):
- return (node.state != SCons.Node.up_to_date)
+ return node.state != SCons.Node.up_to_date
+
def decide_source(node, target, prev_ni):
return target.get_build_env().decide_source(node, target, prev_ni)
+
def decide_target(node, target, prev_ni):
return target.get_build_env().decide_target(node, target, prev_ni)
+
def changed_since_last_build_python(node, target, prev_ni):
cur_csig = node.get_csig()
try:
@@ -345,6 +373,7 @@ class NodeInfoBase(object):
"""
__slots__ = ('__weakref__',)
current_version_id = 2
+
def update(self, node):
try:
field_list = self.field_list
@@ -361,8 +390,10 @@ class NodeInfoBase(object):
pass
else:
setattr(self, f, func())
+
def convert(self, node, val):
pass
+
def merge(self, other):
"""
Merge the fields of another object into this object. Already existing
@@ -372,12 +403,13 @@ class NodeInfoBase(object):
"""
state = other.__getstate__()
self.__setstate__(state)
+
def format(self, field_list=None, names=0):
if field_list is None:
try:
field_list = self.field_list
except AttributeError:
- field_list = getattr(self, '__dict__', {}).keys()
+ field_list = list(getattr(self, '__dict__', {}).keys())
for obj in type(self).mro():
for slot in getattr(obj, '__slots__', ()):
if slot not in ('__weakref__', '__dict__'):
@@ -407,21 +439,21 @@ class NodeInfoBase(object):
for name in getattr(obj,'__slots__',()):
if hasattr(self, name):
state[name] = getattr(self, name)
-
+
state['_version_id'] = self.current_version_id
try:
del state['__weakref__']
except KeyError:
pass
return state
-
+
def __setstate__(self, state):
"""
Restore the attributes from a pickled state. The version is discarded.
"""
# TODO check or discard version
del state['_version_id']
-
+
for key, value in state.items():
if key not in ('__weakref__',):
setattr(self, key, value)
@@ -440,6 +472,7 @@ class BuildInfoBase(object):
__slots__ = ("bsourcesigs", "bdependsigs", "bimplicitsigs", "bactsig",
"bsources", "bdepends", "bact", "bimplicit", "__weakref__")
current_version_id = 2
+
def __init__(self):
# Create an object attribute from the class attribute so it ends up
# in the pickled data in the .sconsign file.
@@ -447,6 +480,7 @@ class BuildInfoBase(object):
self.bdependsigs = []
self.bimplicitsigs = []
self.bactsig = None
+
def merge(self, other):
"""
Merge the fields of another object into this object. Already existing
@@ -456,7 +490,7 @@ class BuildInfoBase(object):
"""
state = other.__getstate__()
self.__setstate__(state)
-
+
def __getstate__(self):
"""
Return all fields that shall be pickled. Walk the slots in the class
@@ -487,7 +521,8 @@ class BuildInfoBase(object):
if key not in ('__weakref__',):
setattr(self, key, value)
-class Node(object):
+
+class Node(object, with_metaclass(NoSlotsPyPy)):
"""The base Node class, for entities that we know how to
build, or use to build other Nodes.
"""
@@ -536,7 +571,7 @@ class Node(object):
class Attrs(object):
__slots__ = ('shared', '__dict__')
-
+
def __init__(self):
if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node')
@@ -588,7 +623,7 @@ class Node(object):
self._func_rexists = 1
self._func_get_contents = 0
self._func_target_from_source = 0
-
+
self.clear_memoized_values()
# Let the interface in which the build engine is embedded
@@ -654,7 +689,7 @@ class Node(object):
executor.cleanup()
def reset_executor(self):
- "Remove cached executor; forces recompute when needed."
+ """Remove cached executor; forces recompute when needed."""
try:
delattr(self, 'executor')
except AttributeError:
@@ -737,7 +772,7 @@ class Node(object):
"""
try:
self.get_executor()(self, **kw)
- except SCons.Errors.BuildError, e:
+ except SCons.Errors.BuildError as e:
e.node = self
raise
@@ -776,16 +811,16 @@ class Node(object):
def release_target_info(self):
"""Called just after this node has been marked
up-to-date or was built completely.
-
+
This is where we try to release as many target node infos
as possible for clean builds and update runs, in order
to minimize the overall memory consumption.
-
+
By purging attributes that aren't needed any longer after
a Node (=File) got built, we don't have to care that much how
many KBytes a Node actually requires...as long as we free
the memory shortly afterwards.
-
+
@see: built() and File.release_target_info()
"""
pass
@@ -965,9 +1000,9 @@ class Node(object):
# no scanner could be found for the given node's scanner key;
# thus, make an attempt at using a default.
scanner = root_node_scanner
-
+
return scanner
-
+
def get_env_scanner(self, env, kw={}):
return env.get_scanner(self.scanner_key())
@@ -1125,38 +1160,26 @@ class Node(object):
binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())
if self._specific_sources:
- sources = []
- for s in self.sources:
- if s not in ignore_set:
- sources.append(s)
+ sources = [s for s in self.sources if not s in ignore_set]
+
else:
sources = executor.get_unignored_sources(self, self.ignore)
+
seen = set()
- bsources = []
- bsourcesigs = []
- for s in sources:
- if not s in seen:
- seen.add(s)
- bsources.append(s)
- bsourcesigs.append(s.get_ninfo())
- binfo.bsources = bsources
- binfo.bsourcesigs = bsourcesigs
-
- depends = self.depends
- dependsigs = []
- for d in depends:
- if d not in ignore_set:
- dependsigs.append(d.get_ninfo())
- binfo.bdepends = depends
- binfo.bdependsigs = dependsigs
-
- implicit = self.implicit or []
- implicitsigs = []
- for i in implicit:
- if i not in ignore_set:
- implicitsigs.append(i.get_ninfo())
- binfo.bimplicit = implicit
- binfo.bimplicitsigs = implicitsigs
+ binfo.bsources = [s for s in sources if s not in seen and not seen.add(s)]
+ binfo.bsourcesigs = [s.get_ninfo() for s in binfo.bsources]
+
+ binfo.bdepends = [d for d in self.depends if d not in ignore_set]
+ binfo.bdependsigs = [d.get_ninfo() for d in self.depends]
+
+ # Because self.implicit is initialized to None (and not empty list [])
+ # we have to handle this case
+ if not self.implicit:
+ binfo.bimplicit = []
+ binfo.bimplicitsigs = []
+ else:
+ binfo.bimplicit = [i for i in self.implicit if i not in ignore_set]
+ binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit]
return binfo
@@ -1218,7 +1241,7 @@ class Node(object):
return _exists_map[self._func_exists](self)
def rexists(self):
- """Does this node exist locally or in a repositiory?"""
+ """Does this node exist locally or in a repository?"""
# There are no repositories by default:
return _rexists_map[self._func_rexists](self)
@@ -1239,7 +1262,7 @@ class Node(object):
"""Adds dependencies."""
try:
self._add_child(self.depends, self.depends_set, depend)
- except TypeError, e:
+ except TypeError as e:
e = e.args[0]
if SCons.Util.is_List(e):
s = list(map(str, e))
@@ -1258,7 +1281,7 @@ class Node(object):
"""Adds dependencies to ignore."""
try:
self._add_child(self.ignore, self.ignore_set, depend)
- except TypeError, e:
+ except TypeError as e:
e = e.args[0]
if SCons.Util.is_List(e):
s = list(map(str, e))
@@ -1272,7 +1295,7 @@ class Node(object):
return
try:
self._add_child(self.sources, self.sources_set, source)
- except TypeError, e:
+ except TypeError as e:
e = e.args[0]
if SCons.Util.is_List(e):
s = list(map(str, e))
@@ -1332,7 +1355,7 @@ class Node(object):
# dictionary patterns I found all ended up using "not in"
# internally anyway...)
if self.ignore_set:
- iter = chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit]))
+ iter = chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f])
children = []
for i in iter:
@@ -1366,7 +1389,7 @@ class Node(object):
# using dictionary keys, lose the order, and the only ordered
# dictionary patterns I found all ended up using "not in"
# internally anyway...)
- return list(chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit])))
+ return list(chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f]))
def children(self, scan=1):
"""Return a list of the node's direct children, minus those
@@ -1390,7 +1413,7 @@ class Node(object):
def Decider(self, function):
foundkey = None
- for k, v in _decider_map.iteritems():
+ for k, v in _decider_map.items():
if v == function:
foundkey = k
break
@@ -1424,14 +1447,14 @@ class Node(object):
any difference, but we now rely on checking every dependency
to make sure that any necessary Node information (for example,
the content signature of an #included .h file) is updated.
-
+
The allowcache option was added for supporting the early
release of the executor/builder structures, right after
a File target was built. When set to true, the return
value of this changed method gets cached for File nodes.
Like this, the executor isn't needed any longer for subsequent
calls to changed().
-
+
@see: FS.File.changed(), FS.File.release_target_info()
"""
t = 0
@@ -1457,13 +1480,18 @@ class Node(object):
result = True
for child, prev_ni in zip(children, then):
- if _decider_map[child.changed_since_last_build](child, self, prev_ni):
- if t: Trace(': %s changed' % child)
- result = True
+ try:
+ if _decider_map[child.changed_since_last_build](child, self, prev_ni):
+ if t: Trace(': %s changed' % child)
+ result = True
+ except DeciderNeedsNode as e:
+ if e.decider(self, prev_ni, node=node):
+ if t: Trace(': %s changed' % child)
+ result = True
- contents = self.get_executor().get_contents()
if self.has_builder():
import SCons.Util
+ contents = self.get_executor().get_contents()
newsig = SCons.Util.MD5signature(contents)
if bi.bactsig != newsig:
if t: Trace(': bactsig %s != newsig %s' % (bi.bactsig, newsig))
@@ -1603,8 +1631,8 @@ class Node(object):
new_bkids = new.bsources + new.bdepends + new.bimplicit
new_bkidsigs = new.bsourcesigs + new.bdependsigs + new.bimplicitsigs
- osig = dict(zip(old_bkids, old_bkidsigs))
- nsig = dict(zip(new_bkids, new_bkidsigs))
+ osig = dict(list(zip(old_bkids, old_bkidsigs)))
+ nsig = dict(list(zip(new_bkids, new_bkidsigs)))
# The sources and dependencies we'll want to report are all stored
# as relative paths to this target's directory, but we want to
@@ -1612,7 +1640,7 @@ class Node(object):
# so we only print them after running them through this lambda
# to turn them into the right relative Node and then return
# its string.
- def stringify( s, E=self.dir.Entry ) :
+ def stringify( s, E=self.dir.Entry):
if hasattr( s, 'dir' ) :
return str(E(s))
return str(s)
@@ -1621,15 +1649,21 @@ class Node(object):
removed = [x for x in old_bkids if not x in new_bkids]
if removed:
- removed = list(map(stringify, removed))
+ removed = [stringify(r) for r in removed]
fmt = "`%s' is no longer a dependency\n"
lines.extend([fmt % s for s in removed])
for k in new_bkids:
if not k in old_bkids:
lines.append("`%s' is a new dependency\n" % stringify(k))
- elif _decider_map[k.changed_since_last_build](k, self, osig[k]):
- lines.append("`%s' changed\n" % stringify(k))
+ else:
+ try:
+ changed = _decider_map[k.changed_since_last_build](k, self, osig[k])
+ except DeciderNeedsNode as e:
+ changed = e.decider(self, osig[k], node=self)
+
+ if changed:
+ lines.append("`%s' changed\n" % stringify(k))
if len(lines) == 0 and old_bkids != new_bkids:
lines.append("the dependency order changed:\n" +
@@ -1645,6 +1679,9 @@ class Node(object):
if old.bact == new.bact:
lines.append("the contents of the build action changed\n" +
fmt_with_title('action: ', new.bact))
+
+ # lines.append("the contents of the build action changed [%s] [%s]\n"%(old.bactsig,new.bactsig) +
+ # fmt_with_title('action: ', new.bact))
else:
lines.append("the build action changed:\n" +
fmt_with_title('old: ', old.bact) +
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/PathList.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/PathList.py
index a0d9e744e47..61254cfd473 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/PathList.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/PathList.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/PathList.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/PathList.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """SCons.PathList
@@ -104,11 +104,11 @@ class _PathList(object):
pl = []
for p in pathlist:
try:
- index = p.find('$')
+ found = '$' in p
except (AttributeError, TypeError):
type = TYPE_OBJECT
else:
- if index == -1:
+ if not found:
type = TYPE_STRING_NO_SUBST
else:
type = TYPE_STRING_SUBST
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/__init__.py
index e3db28a3201..61bbb9571fd 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/__init__.py
@@ -20,8 +20,8 @@ their own platform definition.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
@@ -41,8 +41,9 @@ their own platform definition.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Platform/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.compat
@@ -55,6 +56,7 @@ import SCons.Errors
import SCons.Subst
import SCons.Tool
+
def platform_default():
"""Return the platform string for our execution environment.
@@ -85,6 +87,7 @@ def platform_default():
else:
return sys.platform
+
def platform_module(name = platform_default()):
"""Return the imported module for the platform.
@@ -115,11 +118,13 @@ def platform_module(name = platform_default()):
setattr(SCons.Platform, name, mod)
return sys.modules[full_name]
+
def DefaultToolList(platform, env):
"""Select a default tool list for the specified platform.
"""
return SCons.Tool.tool_list(platform, env)
+
class PlatformSpec(object):
def __init__(self, name, generate):
self.name = name
@@ -130,7 +135,8 @@ class PlatformSpec(object):
def __str__(self):
return self.name
-
+
+
class TempFileMunge(object):
"""A callable class. You can set an Environment variable to this,
then call it with a string argument, then it will perform temporary
@@ -138,15 +144,20 @@ class TempFileMunge(object):
line limitation.
Example usage:
- env["TEMPFILE"] = TempFileMunge
- env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}"
+ env["TEMPFILE"] = TempFileMunge
+ env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}"
By default, the name of the temporary file used begins with a
- prefix of '@'. This may be configred for other tool chains by
- setting '$TEMPFILEPREFIX'.
+ prefix of '@'. This may be configured for other tool chains by
+ setting '$TEMPFILEPREFIX':
+ env["TEMPFILEPREFIX"] = '-@' # diab compiler
+ env["TEMPFILEPREFIX"] = '-via' # arm tool chain
+ env["TEMPFILEPREFIX"] = '' # (the empty string) PC Lint
- env["TEMPFILEPREFIX"] = '-@' # diab compiler
- env["TEMPFILEPREFIX"] = '-via' # arm tool chain
+ You can configure the extension of the temporary file through the
+ TEMPFILEEXTENSION variable, which defaults to '.lnk' (see comments
+ in the code below):
+ env["TEMPFILEEXTENSION"] = '.lnt' # PC Lint
"""
def __init__(self, cmd, cmdstr = None):
self.cmd = cmd
@@ -183,21 +194,26 @@ class TempFileMunge(object):
node = target[0] if SCons.Util.is_List(target) else target
cmdlist = getattr(node.attributes, 'tempfile_cmdlist', None) \
if node is not None else None
- if cmdlist is not None :
+ if cmdlist is not None:
return cmdlist
-
+
# We do a normpath because mktemp() has what appears to be
# a bug in Windows that will use a forward slash as a path
- # delimiter. Windows's link mistakes that for a command line
+ # delimiter. Windows' link mistakes that for a command line
# switch and barfs.
#
- # We use the .lnk suffix for the benefit of the Phar Lap
+ # Default to the .lnk suffix for the benefit of the Phar Lap
# linkloc linker, which likes to append an .lnk suffix if
# none is given.
- (fd, tmp) = tempfile.mkstemp('.lnk', text=True)
+ if env.has_key('TEMPFILESUFFIX'):
+ suffix = env.subst('$TEMPFILESUFFIX')
+ else:
+ suffix = '.lnk'
+
+ fd, tmp = tempfile.mkstemp(suffix, text=True)
native_tmp = SCons.Util.get_native_path(os.path.normpath(tmp))
- if env.get('SHELL',None) == 'sh':
+ if env.get('SHELL', None) == 'sh':
# The sh shell will try to escape the backslashes in the
# path, so unescape them.
native_tmp = native_tmp.replace('\\', r'\\\\')
@@ -215,7 +231,7 @@ class TempFileMunge(object):
prefix = '@'
args = list(map(SCons.Subst.quote_spaces, cmd[1:]))
- os.write(fd, " ".join(args) + "\n")
+ os.write(fd, bytearray(" ".join(args) + "\n",'utf-8'))
os.close(fd)
# XXX Using the SCons.Action.print_actions value directly
# like this is bogus, but expedient. This class should
@@ -233,14 +249,15 @@ class TempFileMunge(object):
# purity get in the way of just being helpful, so we'll
# reach into SCons.Action directly.
if SCons.Action.print_actions:
- cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target,
+ cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target,
source) if self.cmdstr is not None else ''
# Print our message only if XXXCOMSTR returns an empty string
if len(cmdstr) == 0 :
- print("Using tempfile "+native_tmp+" for command line:\n"+
- str(cmd[0]) + " " + " ".join(args))
-
- # Store the temporary file command list into the target Node.attributes
+ cmdstr = ("Using tempfile "+native_tmp+" for command line:\n"+
+ str(cmd[0]) + " " + " ".join(args))
+ self._print_cmd_str(target, source, env, cmdstr)
+
+ # Store the temporary file command list into the target Node.attributes
# to avoid creating two temporary files one for print and one for execute.
cmdlist = [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ]
if node is not None:
@@ -249,7 +266,25 @@ class TempFileMunge(object):
except AttributeError:
pass
return cmdlist
-
+
+ def _print_cmd_str(self, target, source, env, cmdstr):
+ # check if the user has specified a cmd line print function
+ print_func = None
+ try:
+ get = env.get
+ except AttributeError:
+ pass
+ else:
+ print_func = get('PRINT_CMD_LINE_FUNC')
+
+ # use the default action cmd line print if user did not supply one
+ if not print_func:
+ action = SCons.Action._ActionAction()
+ action.print_cmd_line(cmdstr, target, source, env)
+ else:
+ print_func(cmdstr, target, source, env)
+
+
def Platform(name = platform_default()):
"""Select a canned Platform specification.
"""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/aix.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/aix.py
index 65ee701e20c..b49768b19c4 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/aix.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/aix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,12 +30,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/aix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/aix.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import subprocess
-import posix
+from . import posix
import SCons.Util
import SCons.Action
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/cygwin.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/cygwin.py
index 3f8fc17890e..4c9f177209f 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/cygwin.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/cygwin.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,11 +30,20 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/cygwin.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/cygwin.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import posix
+import sys
+
+from . import posix
from SCons.Platform import TempFileMunge
+CYGWIN_DEFAULT_PATHS = []
+if sys.platform == 'win32':
+ CYGWIN_DEFAULT_PATHS = [
+ r'C:\cygwin64\bin',
+ r'C:\cygwin\bin'
+ ]
+
def generate(env):
posix.generate(env)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/darwin.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/darwin.py
index 279cfc296d4..a0aab823d80 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/darwin.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/darwin.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,9 +30,9 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/darwin.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/darwin.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import posix
+from . import posix
import os
def generate(env):
@@ -63,6 +63,10 @@ def generate(env):
env.AppendENVPath('PATHOSX', line.strip('\n'))
f.close()
+ # Not sure why this wasn't the case all along?
+ if env['ENV'].get('PATHOSX', False) and os.environ.get('SCONS_USE_MAC_PATHS', False):
+ env.AppendENVPath('PATH',env['ENV']['PATHOSX'])
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/hpux.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/hpux.py
index d2de3035d3d..6d73ad142d8 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/hpux.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/hpux.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,9 +30,9 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/hpux.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/hpux.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import posix
+from . import posix
def generate(env):
posix.generate(env)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/irix.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/irix.py
index c55713108a9..fbd3750e1ee 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/irix.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/irix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,9 +30,9 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/irix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/irix.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import posix
+from . import posix
def generate(env):
posix.generate(env)
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/mingw.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/mingw.py
new file mode 100644
index 00000000000..2114e6f887e
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/mingw.py
@@ -0,0 +1,39 @@
+"""SCons.Platform.mingw
+
+Platform-specific initialization for the MinGW system.
+
+"""
+
+#
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Platform/mingw.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+import sys
+
+MINGW_DEFAULT_PATHS = []
+if sys.platform == 'win32':
+ MINGW_DEFAULT_PATHS = [
+ r'C:\msys64',
+ r'C:\msys'
+ ] \ No newline at end of file
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/os2.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/os2.py
index 7363636088a..91cd262d816 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/os2.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/os2.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,8 +30,8 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/os2.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-import win32
+__revision__ = "src/engine/SCons/Platform/os2.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+from . import win32
def generate(env):
if 'ENV' not in env:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/posix.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/posix.py
index 6edfd784a98..d44face6d91 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/posix.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/posix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/posix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/posix.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import errno
import os
@@ -41,6 +41,8 @@ import select
import SCons.Util
from SCons.Platform import TempFileMunge
+from SCons.Platform.virtualenv import ImportVirtualenv
+from SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv
exitvalmap = {
2 : 127,
@@ -48,7 +50,7 @@ exitvalmap = {
}
def escape(arg):
- "escape shell special characters"
+ """escape shell special characters"""
slash = '\\'
special = '"$'
@@ -56,7 +58,7 @@ def escape(arg):
for c in special:
arg = arg.replace(c, slash+c)
- # print "ESCAPE RESULT: %s"%arg
+ # print("ESCAPE RESULT: %s" % arg)
return '"' + arg + '"'
@@ -119,6 +121,9 @@ def generate(env):
# Must be able to have GCC and DMD work in the same build, so:
env['__DRPATH'] = '$_DRPATH'
+ if enable_virtualenv and not ignore_virtualenv:
+ ImportVirtualenv(env)
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/sunos.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/sunos.py
index d053e218022..73f9a2c1b49 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/sunos.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/sunos.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,9 +30,9 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/sunos.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/sunos.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import posix
+from . import posix
def generate(env):
posix.generate(env)
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/virtualenv.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/virtualenv.py
new file mode 100644
index 00000000000..43fc8898f7c
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/virtualenv.py
@@ -0,0 +1,120 @@
+"""SCons.Platform.virtualenv
+
+Support for virtualenv.
+"""
+
+#
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Platform/virtualenv.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+import os
+import sys
+import SCons.Util
+
+
+virtualenv_enabled_by_default = False
+
+
+def _enable_virtualenv_default():
+ return SCons.Util.get_os_env_bool('SCONS_ENABLE_VIRTUALENV', virtualenv_enabled_by_default)
+
+
+def _ignore_virtualenv_default():
+ return SCons.Util.get_os_env_bool('SCONS_IGNORE_VIRTUALENV', False)
+
+
+enable_virtualenv = _enable_virtualenv_default()
+ignore_virtualenv = _ignore_virtualenv_default()
+virtualenv_variables = ['VIRTUAL_ENV', 'PIPENV_ACTIVE']
+
+
+def _running_in_virtualenv():
+ """Returns True, if scons is executed within a virtualenv"""
+ # see https://stackoverflow.com/a/42580137
+ return (hasattr(sys, 'real_prefix') or
+ (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix))
+
+
+def _is_path_in(path, base):
+ """Returns true, if **path** is located under the **base** directory."""
+ if not path or not base: # empty path may happen, base too
+ return False
+ rp = os.path.relpath(path, base)
+ return ((not rp.startswith(os.path.pardir)) and (not rp == os.path.curdir))
+
+
+def _inject_venv_variables(env):
+ if 'ENV' not in env:
+ env['ENV'] = {}
+ ENV = env['ENV']
+ for name in virtualenv_variables:
+ try:
+ ENV[name] = os.environ[name]
+ except KeyError:
+ pass
+
+def _inject_venv_path(env, path_list=None):
+ """Modify environment such that SCons will take into account its virtualenv
+ when running external tools."""
+ if path_list is None:
+ path_list = os.getenv('PATH')
+ env.PrependENVPath('PATH', select_paths_in_venv(path_list))
+
+
+def select_paths_in_venv(path_list):
+ """Returns a list of paths from **path_list** which are under virtualenv's
+ home directory."""
+ if SCons.Util.is_String(path_list):
+ path_list = path_list.split(os.path.pathsep)
+ # Find in path_list the paths under the virtualenv's home
+ return [path for path in path_list if IsInVirtualenv(path)]
+
+
+def ImportVirtualenv(env):
+ """Copies virtualenv-related environment variables from OS environment
+ to ``env['ENV']`` and prepends virtualenv's PATH to ``env['ENV']['PATH']``.
+ """
+ _inject_venv_variables(env)
+ _inject_venv_path(env)
+
+
+def Virtualenv():
+ """Returns path to the virtualenv home if scons is executing within a
+ virtualenv or None, if not."""
+ if _running_in_virtualenv():
+ return sys.prefix
+ return None
+
+
+def IsInVirtualenv(path):
+ """Returns True, if **path** is under virtualenv's home directory. If not,
+ or if we don't use virtualenv, returns False."""
+ return _is_path_in(path, Virtualenv())
+
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/win32.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/win32.py
index 556c7d480bb..b54b8c55aab 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Platform/win32.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Platform/win32.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/win32.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/win32.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
@@ -39,6 +39,8 @@ import tempfile
from SCons.Platform.posix import exitvalmap
from SCons.Platform import TempFileMunge
+from SCons.Platform.virtualenv import ImportVirtualenv
+from SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv
import SCons.Util
try:
@@ -60,15 +62,8 @@ except AttributeError:
else:
parallel_msg = None
- _builtin_file = file
_builtin_open = open
- class _scons_file(_builtin_file):
- def __init__(self, *args, **kw):
- _builtin_file.__init__(self, *args, **kw)
- win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()),
- win32con.HANDLE_FLAG_INHERIT, 0)
-
def _scons_open(*args, **kw):
fp = _builtin_open(*args, **kw)
win32api.SetHandleInformation(msvcrt.get_osfhandle(fp.fileno()),
@@ -76,19 +71,62 @@ else:
0)
return fp
- file = _scons_file
open = _scons_open
+ if sys.version_info.major == 2:
+ _builtin_file = file
+ class _scons_file(_builtin_file):
+ def __init__(self, *args, **kw):
+ _builtin_file.__init__(self, *args, **kw)
+ win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()),
+ win32con.HANDLE_FLAG_INHERIT, 0)
+ file = _scons_file
+ else:
+ # No longer needed for python 3.4 and above. Files are opened non sharable
+ pass
+
+
+
+if False:
+ # Now swap out shutil.filecopy and filecopy2 for win32 api native CopyFile
+ try:
+ from ctypes import windll
+ import shutil
+
+ CopyFile = windll.kernel32.CopyFileA
+ SetFileTime = windll.kernel32.SetFileTime
+
+ _shutil_copy = shutil.copy
+ _shutil_copy2 = shutil.copy2
+
+ shutil.copy2 = CopyFile
+
+ def win_api_copyfile(src,dst):
+ CopyFile(src,dst)
+ os.utime(dst)
+
+ shutil.copy = win_api_copyfile
+
+ except AttributeError:
+ parallel_msg = \
+ "Couldn't override shutil.copy or shutil.copy2 falling back to shutil defaults"
+
+
+
+
+
+
+
try:
import threading
spawn_lock = threading.Lock()
-
+
# This locked version of spawnve works around a Windows
# MSVCRT bug, because its spawnve is not thread-safe.
# Without this, python can randomly crash while using -jN.
# See the python bug at http://bugs.python.org/issue6476
# and SCons issue at
- # http://scons.tigris.org/issues/show_bug.cgi?id=2449
+ # https://github.com/SCons/scons/issues/2449
def spawnve(mode, file, args, env):
spawn_lock.acquire()
try:
@@ -111,11 +149,12 @@ except ImportError:
# simulating a non-existent package.
def spawnve(mode, file, args, env):
return os.spawnve(mode, file, args, env)
-
+
# The upshot of all this is that, if you are using Python 1.5.2,
# you had better have cmd or command.com in your PATH when you run
# scons.
+
def piped_spawn(sh, escape, cmd, args, env, stdout, stderr):
# There is no direct way to do that in python. What we do
# here should work for most cases:
@@ -136,8 +175,7 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr):
stderrRedirected = 0
for arg in args:
# are there more possibilities to redirect stdout ?
- if (arg.find( ">", 0, 1 ) != -1 or
- arg.find( "1>", 0, 2 ) != -1):
+ if arg.find( ">", 0, 1 ) != -1 or arg.find( "1>", 0, 2 ) != -1:
stdoutRedirected = 1
# are there more possibilities to redirect stderr ?
if arg.find( "2>", 0, 2 ) != -1:
@@ -153,14 +191,14 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr):
try:
args = [sh, '/C', escape(' '.join(args)) ]
ret = spawnve(os.P_WAIT, sh, args, env)
- except OSError, e:
+ except OSError as e:
# catch any error
try:
- ret = exitvalmap[e[0]]
+ ret = exitvalmap[e.errno]
except KeyError:
- sys.stderr.write("scons: unknown OSError exception code %d - %s: %s\n" % (e[0], cmd, e[1]))
+ sys.stderr.write("scons: unknown OSError exception code %d - %s: %s\n" % (e.errno, cmd, e.strerror))
if stderr is not None:
- stderr.write("scons: %s: %s\n" % (cmd, e[1]))
+ stderr.write("scons: %s: %s\n" % (cmd, e.strerror))
# copy child output from tempfiles to our streams
# and do clean up stuff
if stdout is not None and stdoutRedirected == 0:
@@ -178,13 +216,14 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr):
pass
return ret
+
def exec_spawn(l, env):
try:
result = spawnve(os.P_WAIT, l[0], l, env)
- except OSError, e:
+ except (OSError, EnvironmentError) as e:
try:
- result = exitvalmap[e[0]]
- sys.stderr.write("scons: %s: %s\n" % (l[0], e[1]))
+ result = exitvalmap[e.errno]
+ sys.stderr.write("scons: %s: %s\n" % (l[0], e.strerror))
except KeyError:
result = 127
if len(l) > 2:
@@ -194,9 +233,10 @@ def exec_spawn(l, env):
command = l[0]
else:
command = l[0]
- sys.stderr.write("scons: unknown OSError exception code %d - '%s': %s\n" % (e[0], command, e[1]))
+ sys.stderr.write("scons: unknown OSError exception code %d - '%s': %s\n" % (e.errno, command, e.strerror))
return result
+
def spawn(sh, escape, cmd, args, env):
if not sh:
sys.stderr.write("scons: Could not find command interpreter, is it in your PATH?\n")
@@ -216,6 +256,7 @@ def escape(x):
# Get the windows system directory name
_system_root = None
+
def get_system_root():
global _system_root
if _system_root is not None:
@@ -240,11 +281,21 @@ def get_system_root():
raise
except:
pass
+
+ # Ensure system root is a string and not unicode
+ # (This only matters for py27 were unicode in env passed to POpen fails)
+ val = str(val)
_system_root = val
return val
-# Get the location of the program files directory
+
def get_program_files_dir():
+ """
+ Get the location of the program files directory
+ Returns
+ -------
+
+ """
# Now see if we can look in the registry...
val = ''
if SCons.Util.can_read_reg:
@@ -261,14 +312,13 @@ def get_program_files_dir():
# A reasonable default if we can't read the registry
# (Actually, it's pretty reasonable even if we can :-)
val = os.path.join(os.path.dirname(get_system_root()),"Program Files")
-
- return val
+ return val
-# Determine which windows CPU were running on.
class ArchDefinition(object):
"""
+ Determine which windows CPU were running on.
A class for defining architecture-specific settings and logic.
"""
def __init__(self, arch, synonyms=[]):
@@ -298,6 +348,7 @@ for a in SupportedArchitectureList:
for s in a.synonyms:
SupportedArchitectureMap[s] = a
+
def get_architecture(arch=None):
"""Returns the definition for the specified architecture string.
@@ -311,6 +362,7 @@ def get_architecture(arch=None):
arch = os.environ.get('PROCESSOR_ARCHITECTURE')
return SupportedArchitectureMap.get(arch, ArchDefinition('', ['']))
+
def generate(env):
# Attempt to find cmd.exe (for WinNT/2k/XP) or
# command.com for Win9x
@@ -346,7 +398,7 @@ def generate(env):
os.path.join(systemroot,'System32')
tmp_pathext = '.com;.exe;.bat;.cmd'
if 'PATHEXT' in os.environ:
- tmp_pathext = os.environ['PATHEXT']
+ tmp_pathext = os.environ['PATHEXT']
cmd_interp = SCons.Util.WhereIs('cmd', tmp_path, tmp_pathext)
if not cmd_interp:
cmd_interp = SCons.Util.WhereIs('command', tmp_path, tmp_pathext)
@@ -356,7 +408,6 @@ def generate(env):
if not cmd_interp:
cmd_interp = env.Detect('command')
-
if 'ENV' not in env:
env['ENV'] = {}
@@ -368,7 +419,7 @@ def generate(env):
# for SystemDrive because it's related.
#
# Weigh the impact carefully before adding other variables to this list.
- import_env = [ 'SystemDrive', 'SystemRoot', 'TEMP', 'TMP' ]
+ import_env = ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP' ]
for var in import_env:
v = os.environ.get(var)
if v:
@@ -379,7 +430,7 @@ def generate(env):
if v:
env['ENV']['COMSPEC'] = v
- env.AppendENVPath('PATH', get_system_root() + '\System32')
+ env.AppendENVPath('PATH', get_system_root() + '\\System32')
env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD'
env['OBJPREFIX'] = ''
@@ -401,10 +452,13 @@ def generate(env):
env['TEMPFILEPREFIX'] = '@'
env['MAXLINELENGTH'] = 2048
env['ESCAPE'] = escape
-
+
env['HOST_OS'] = 'win32'
env['HOST_ARCH'] = get_architecture().arch
-
+
+ if enable_virtualenv and not ignore_virtualenv:
+ ImportVirtualenv(env)
+
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/SConf.py
index fb1124b1fbd..e3f3d4bbc1c 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/SConf.py
@@ -12,7 +12,7 @@ libraries are installed, if some command line options are supported etc.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -33,8 +33,9 @@ libraries are installed, if some command line options are supported etc.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/SConf.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/SConf.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.compat
@@ -109,7 +110,7 @@ def _createConfigH(target, source, env):
#define %(DEFNAME)s_SEEN
""" % {'DEFNAME' : defname})
- t.write(source[0].get_contents())
+ t.write(source[0].get_contents().decode())
t.write("""
#endif /* %(DEFNAME)s_SEEN */
""" % {'DEFNAME' : defname})
@@ -131,10 +132,10 @@ def CreateConfigHBuilder(env):
_stringConfigH)
sconfigHBld = SCons.Builder.Builder(action=action)
env.Append( BUILDERS={'SConfigHBuilder':sconfigHBld} )
- for k in _ac_config_hs.keys():
+ for k in list(_ac_config_hs.keys()):
env.SConfigHBuilder(k, env.Value(_ac_config_hs[k]))
-
+
class SConfWarning(SCons.Warnings.Warning):
pass
SCons.Warnings.enableWarningClass(SConfWarning)
@@ -163,11 +164,11 @@ class ConfigureCacheError(SConfError):
# define actions for building text files
def _createSource( target, source, env ):
fd = open(str(target[0]), "w")
- fd.write(source[0].get_contents())
+ fd.write(source[0].get_contents().decode())
fd.close()
def _stringSource( target, source, env ):
return (str(target[0]) + ' <-\n |' +
- source[0].get_contents().replace( '\n', "\n |" ) )
+ source[0].get_contents().decode().replace( '\n', "\n |" ) )
class SConfBuildInfo(SCons.Node.FS.FileBuildInfo):
"""
@@ -176,7 +177,7 @@ class SConfBuildInfo(SCons.Node.FS.FileBuildInfo):
contains messages of the original build phase.
"""
__slots__ = ('result', 'string')
-
+
def __init__(self):
self.result = None # -> 0/None -> no error, != 0 error
self.string = None # the stdout / stderr output when building the target
@@ -217,7 +218,7 @@ class Streamer(object):
if self.orig:
self.orig.flush()
self.s.flush()
-
+
class SConfBuildTask(SCons.Taskmaster.AlwaysTask):
"""
@@ -311,7 +312,7 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask):
binfo = self.targets[0].get_stored_info().binfo
self.display_cached_string(binfo)
raise SCons.Errors.BuildError # will be 'caught' in self.failed
- elif is_up_to_date:
+ elif is_up_to_date:
self.display("\"%s\" is up to date." % str(self.targets[0]))
binfo = self.targets[0].get_stored_info().binfo
self.display_cached_string(binfo)
@@ -332,7 +333,7 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask):
env_decider=env.decide_source):
env_decider(dependency, target, prev_ni)
return True
- if env.decide_source.func_code is not force_build.func_code:
+ if env.decide_source.__code__ is not force_build.__code__:
env.Decider(force_build)
env['PSTDOUT'] = env['PSTDERR'] = s
try:
@@ -346,7 +347,7 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask):
except SystemExit:
exc_value = sys.exc_info()[1]
raise SCons.Errors.ExplicitExit(self.targets[0],exc_value.code)
- except Exception, e:
+ except Exception as e:
for t in self.targets:
binfo = SConfBuildInfo()
binfo.merge(t.get_binfo())
@@ -396,7 +397,7 @@ class SConfBase(object):
"""
def __init__(self, env, custom_tests = {}, conf_dir='$CONFIGUREDIR',
- log_file='$CONFIGURELOG', config_h = None, _depth = 0):
+ log_file='$CONFIGURELOG', config_h = None, _depth = 0):
"""Constructor. Pass additional tests in the custom_tests-dictionary,
e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest
defines a custom test.
@@ -457,10 +458,10 @@ class SConfBase(object):
If value is None (default), then #define name is written. If value is not
none, then #define name value is written.
-
- comment is a string which will be put as a C comment in the
- header, to explain the meaning of the value (appropriate C comments /* and
- */ will be put automatically."""
+
+ comment is a string which will be put as a C comment in the header, to explain the meaning of the value
+ (appropriate C comments will be added automatically).
+ """
lines = []
if comment:
comment_str = "/* %s */" % comment
@@ -608,7 +609,7 @@ class SConfBase(object):
ok = self.TryBuild(self.env.SConfActionBuilder, text, extension)
del self.env['BUILDERS']['SConfActionBuilder']
if ok:
- outputStr = self.lastTarget.get_contents()
+ outputStr = self.lastTarget.get_text_contents()
return (1, outputStr)
return (0, "")
@@ -642,7 +643,7 @@ class SConfBase(object):
node = self.env.Command(output, prog, [ [ pname, ">", "${TARGET}"] ])
ok = self.BuildNodes(node)
if ok:
- outputStr = output.get_contents()
+ outputStr = SCons.Util.to_str(output.get_contents())
return( 1, outputStr)
return (0, "")
@@ -670,7 +671,7 @@ class SConfBase(object):
"""Adds all the tests given in the tests dictionary to this SConf
instance
"""
- for name in tests.keys():
+ for name in list(tests.keys()):
self.AddTest(name, tests[name])
def _createDir( self, node ):
@@ -689,7 +690,7 @@ class SConfBase(object):
global _ac_config_logs
global sconf_global
global SConfFS
-
+
self.lastEnvFs = self.env.fs
self.env.fs = SConfFS
self._createDir(self.confdir)
@@ -716,7 +717,7 @@ class SConfBase(object):
self.logstream.write('file %s,line %d:\n\tConfigure(confdir = %s)\n' %
(tb[0], tb[1], str(self.confdir)) )
SConfFS.chdir(old_fs_dir)
- else:
+ else:
self.logstream = None
# we use a special builder to create source files from TEXT
action = SCons.Action.Action(_createSource,
@@ -913,14 +914,14 @@ def CheckType(context, type_name, includes = "", language = None):
def CheckTypeSize(context, type_name, includes = "", language = None, expect = None):
res = SCons.Conftest.CheckTypeSize(context, type_name,
- header = includes, language = language,
+ header = includes, language = language,
expect = expect)
context.did_show_result = 1
return res
def CheckDeclaration(context, declaration, includes = "", language = None):
res = SCons.Conftest.CheckDeclaration(context, declaration,
- includes = includes,
+ includes = includes,
language = language)
context.did_show_result = 1
return not res
@@ -999,12 +1000,12 @@ def CheckLib(context, library = None, symbol = "main",
compiles without flags.
"""
- if library == []:
+ if not library:
library = [None]
if not SCons.Util.is_List(library):
library = [library]
-
+
# ToDo: accept path for the library
res = SCons.Conftest.CheckLib(context, library, symbol, header = header,
language = language, autoadd = autoadd)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/SConsign.py
index 3166258a373..ad14ce87f6d 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConsign.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/SConsign.py
@@ -5,7 +5,7 @@ Writing and reading information to the .sconsign file or files.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,17 +27,21 @@ Writing and reading information to the .sconsign file or files.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/SConsign.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+from __future__ import print_function
+
+__revision__ = "src/engine/SCons/SConsign.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.compat
import os
-# compat layer imports "cPickle" for us if it's available.
import pickle
import SCons.dblite
import SCons.Warnings
+from SCons.compat import PICKLE_PROTOCOL
+
+
def corrupt_dblite_warning(filename):
SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,
"Ignoring corrupt .sconsign file: %s"%filename)
@@ -45,7 +49,7 @@ def corrupt_dblite_warning(filename):
SCons.dblite.ignore_corrupt_dbfiles = 1
SCons.dblite.corruption_warning = corrupt_dblite_warning
-#XXX Get rid of the global array so this becomes re-entrant.
+# XXX Get rid of the global array so this becomes re-entrant.
sig_files = []
# Info for the database SConsign implementation (now the default):
@@ -59,6 +63,7 @@ DB_Module = SCons.dblite
DB_Name = ".sconsign"
DB_sync_list = []
+
def Get_DataBase(dir):
global DataBase, DB_Module, DB_Name
top = dir.fs.Top
@@ -84,9 +89,10 @@ def Get_DataBase(dir):
DB_sync_list.append(db)
return db, "c"
except TypeError:
- print "DataBase =", DataBase
+ print("DataBase =", DataBase)
raise
+
def Reset():
"""Reset global state. Used by unit tests that end up using
SConsign multiple times to get a clean slate for each test."""
@@ -96,6 +102,7 @@ def Reset():
normcase = os.path.normcase
+
def write():
global sig_files
for sig_file in sig_files:
@@ -114,6 +121,7 @@ def write():
else:
closemethod()
+
class SConsignEntry(object):
"""
Wrapper class for the generic entry in a .sconsign file.
@@ -124,16 +132,16 @@ class SConsignEntry(object):
"""
__slots__ = ("binfo", "ninfo", "__weakref__")
current_version_id = 2
-
+
def __init__(self):
# Create an object attribute from the class attribute so it ends up
# in the pickled data in the .sconsign file.
#_version_id = self.current_version_id
pass
-
+
def convert_to_sconsign(self):
self.binfo.convert_to_sconsign()
-
+
def convert_from_sconsign(self, dir, name):
self.binfo.convert_from_sconsign(dir, name)
@@ -155,7 +163,8 @@ class SConsignEntry(object):
for key, value in state.items():
if key not in ('_version_id','__weakref__'):
setattr(self, key, value)
-
+
+
class Base(object):
"""
This is the controlling class for the signatures for the collection of
@@ -210,6 +219,7 @@ class Base(object):
self.entries[key] = entry
self.to_be_merged = {}
+
class DB(Base):
"""
A Base subclass that reads and writes signature information
@@ -239,7 +249,7 @@ class DB(Base):
raise TypeError
except KeyboardInterrupt:
raise
- except Exception, e:
+ except Exception as e:
SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,
"Ignoring corrupt sconsign entry : %s (%s)\n"%(self.dir.get_tpath(), e))
for key, entry in self.entries.items():
@@ -271,7 +281,7 @@ class DB(Base):
path = normcase(self.dir.get_internal_path())
for key, entry in self.entries.items():
entry.convert_to_sconsign()
- db[path] = pickle.dumps(self.entries, 1)
+ db[path] = pickle.dumps(self.entries, PICKLE_PROTOCOL)
if sync:
try:
@@ -282,6 +292,7 @@ class DB(Base):
else:
syncmethod()
+
class Dir(Base):
def __init__(self, fp=None, dir=None):
"""
@@ -301,6 +312,7 @@ class Dir(Base):
for key, entry in self.entries.items():
entry.convert_from_sconsign(dir, key)
+
class DirFile(Dir):
"""
Encapsulates reading and writing a per-directory .sconsign file.
@@ -359,12 +371,12 @@ class DirFile(Dir):
return
for key, entry in self.entries.items():
entry.convert_to_sconsign()
- pickle.dump(self.entries, file, 1)
+ pickle.dump(self.entries, file, PICKLE_PROTOCOL)
file.close()
if fname != self.sconsign:
try:
mode = os.stat(self.sconsign)[0]
- os.chmod(self.sconsign, 0666)
+ os.chmod(self.sconsign, 0o666)
os.unlink(self.sconsign)
except (IOError, OSError):
# Try to carry on in the face of either OSError
@@ -391,6 +403,7 @@ class DirFile(Dir):
ForDirectory = DB
+
def File(name, dbm_module=None):
"""
Arrange for all signatures to be stored in a global .sconsign.db*
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/C.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/C.py
index 4c61187395c..59fb7745fb7 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/C.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/C.py
@@ -5,7 +5,7 @@ This module implements the dependency scanner for C/C++ code.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ This module implements the dependency scanner for C/C++ code.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Scanner/C.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/C.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Node.FS
import SCons.Scanner
@@ -58,12 +58,11 @@ class SConsCPPScanner(SCons.cpp.PreProcessor):
return result
def read_file(self, file):
try:
- fp = open(str(file.rfile()))
- except EnvironmentError, e:
+ with open(str(file.rfile())) as fp:
+ return fp.read()
+ except EnvironmentError as e:
self.missing.append((file, self.current_file))
return ''
- else:
- return fp.read()
def dictify_CPPDEFINES(env):
cppdefines = env.get('CPPDEFINES', {})
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/D.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/D.py
index eba6e385a7c..1b8ec22f1e0 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/D.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/D.py
@@ -8,7 +8,7 @@ Coded by Andy Friesen
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,9 +30,7 @@ Coded by Andy Friesen
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Scanner/D.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-
-import re
+__revision__ = "src/engine/SCons/Scanner/D.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Scanner
@@ -43,13 +41,13 @@ def DScanner():
class D(SCons.Scanner.Classic):
def __init__ (self):
- SCons.Scanner.Classic.__init__ (self,
+ SCons.Scanner.Classic.__init__ (
+ self,
name = "DScanner",
suffixes = '$DSUFFIXES',
path_variable = 'DPATH',
- regex = 'import\s+(?:[a-zA-Z0-9_.]+)\s*(?:,\s*(?:[a-zA-Z0-9_.]+)\s*)*;')
-
- self.cre2 = re.compile ('(?:import\s)?\s*([a-zA-Z0-9_.]+)\s*(?:,|;)', re.M)
+ regex = '(?:import\s+)([\w\s=,.]+)(?:\s*:[\s\w,=]+)?(?:;)'
+ )
def find_include(self, include, source_dir, path):
# translate dots (package separators) to slashes
@@ -62,8 +60,10 @@ class D(SCons.Scanner.Classic):
def find_include_names(self, node):
includes = []
- for i in self.cre.findall(node.get_text_contents()):
- includes = includes + self.cre2.findall(i)
+ for iii in self.cre.findall(node.get_text_contents()):
+ for jjj in iii.split(','):
+ kkk = jjj.split('=')[-1]
+ includes.append(kkk.strip())
return includes
# Local Variables:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Dir.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Dir.py
index d744c41fc11..9f8b8704da3 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Dir.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Dir.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,14 +20,14 @@
# 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__ = "src/engine/SCons/Scanner/Dir.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/Dir.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Node.FS
import SCons.Scanner
def only_dirs(nodes):
is_Dir = lambda n: isinstance(n.disambiguate(), SCons.Node.FS.Dir)
- return list(filter(is_Dir, nodes))
+ return [node for node in nodes if is_Dir(node)]
def DirScanner(**kw):
"""Return a prototype Scanner instance for scanning
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Fortran.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Fortran.py
index 887232ff1cf..79ca5d8acc0 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Fortran.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Fortran.py
@@ -5,7 +5,7 @@ This module implements the dependency scanner for Fortran code.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ This module implements the dependency scanner for Fortran code.
# 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__ = "src/engine/SCons/Scanner/Fortran.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/Fortran.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import re
@@ -78,7 +78,7 @@ class F90Scanner(SCons.Scanner.Classic):
def scan(self, node, env, path=()):
# cache the includes list in node so we only scan it once:
- if node.includes != None:
+ if node.includes is not None:
mods_and_includes = node.includes
else:
# retrieve all included filenames
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/IDL.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/IDL.py
index 84616e938c2..b0caa1d08b0 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/IDL.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/IDL.py
@@ -6,7 +6,7 @@ Definition Language) files.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ Definition Language) files.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Scanner/IDL.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/IDL.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Node.FS
import SCons.Scanner
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/LaTeX.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/LaTeX.py
index 10a61973e23..d3d4ba43795 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/LaTeX.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/LaTeX.py
@@ -5,7 +5,7 @@ This module implements the dependency scanner for LaTeX code.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ This module implements the dependency scanner for LaTeX code.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Scanner/LaTeX.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/LaTeX.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import re
@@ -37,7 +37,9 @@ import SCons.Util
# list of graphics file extensions for TeX and LaTeX
TexGraphics = ['.eps', '.ps']
-LatexGraphics = ['.pdf', '.png', '.jpg', '.gif', '.tif']
+#LatexGraphics = ['.pdf', '.png', '.jpg', '.gif', '.tif']
+LatexGraphics = [ '.png', '.jpg', '.gif', '.tif']
+
# Used as a return value of modify_env_var if the variable is not set.
class _Null(object):
@@ -76,8 +78,10 @@ def modify_env_var(env, var, abspath):
return save
class FindENVPathDirs(object):
- """A class to bind a specific *PATH variable name to a function that
- will return all of the *path directories."""
+ """
+ A class to bind a specific E{*}PATH variable name to a function that
+ will return all of the E{*}path directories.
+ """
def __init__(self, variable):
self.variable = variable
def __call__(self, env, dir=None, target=None, source=None, argument=None):
@@ -94,7 +98,8 @@ class FindENVPathDirs(object):
def LaTeXScanner():
- """Return a prototype Scanner instance for scanning LaTeX source files
+ """
+ Return a prototype Scanner instance for scanning LaTeX source files
when built with latex.
"""
ds = LaTeX(name = "LaTeXScanner",
@@ -105,7 +110,8 @@ def LaTeXScanner():
return ds
def PDFLaTeXScanner():
- """Return a prototype Scanner instance for scanning LaTeX source files
+ """
+ Return a prototype Scanner instance for scanning LaTeX source files
when built with pdflatex.
"""
ds = LaTeX(name = "PDFLaTeXScanner",
@@ -116,13 +122,14 @@ def PDFLaTeXScanner():
return ds
class LaTeX(SCons.Scanner.Base):
- """Class for scanning LaTeX files for included files.
+ """
+ Class for scanning LaTeX files for included files.
Unlike most scanners, which use regular expressions that just
return the included file name, this returns a tuple consisting
of the keyword for the inclusion ("include", "includegraphics",
- "input", or "bibliography"), and then the file name itself.
- Based on a quick look at LaTeX documentation, it seems that we
+ "input", or "bibliography"), and then the file name itself.
+ Based on a quick look at LaTeX documentation, it seems that we
should append .tex suffix for the "include" keywords, append .tex if
there is no extension for the "input" keyword, and need to add .bib
for the "bibliography" keyword that does not accept extensions by itself.
@@ -130,13 +137,15 @@ class LaTeX(SCons.Scanner.Base):
Finally, if there is no extension for an "includegraphics" keyword
latex will append .ps or .eps to find the file, while pdftex may use .pdf,
.jpg, .tif, .mps, or .png.
-
+
The actual subset and search order may be altered by
DeclareGraphicsExtensions command. This complication is ignored.
- The default order corresponds to experimentation with teTeX
+ The default order corresponds to experimentation with teTeX::
+
$ latex --version
pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4)
kpathsea version 3.5.4
+
The order is:
['.eps', '.ps'] for latex
['.png', '.pdf', '.jpg', '.tif'].
@@ -148,8 +157,7 @@ class LaTeX(SCons.Scanner.Base):
env['TEXINPUTS'] for "lstinputlisting" keyword
env['BIBINPUTS'] for "bibliography" keyword
env['BSTINPUTS'] for "bibliographystyle" keyword
- env['INDEXSTYLE'] for "makeindex" keyword, no scanning support needed
- just allows user to set it if needed.
+ env['INDEXSTYLE'] for "makeindex" keyword, no scanning support needed just allows user to set it if needed.
FIXME: also look for the class or style in document[class|style]{}
FIXME: also look for the argument of bibliographystyle{}
@@ -166,6 +174,9 @@ class LaTeX(SCons.Scanner.Base):
'usepackage': 'TEXINPUTS',
'lstinputlisting': 'TEXINPUTS'}
env_variables = SCons.Util.unique(list(keyword_paths.values()))
+ two_arg_commands = ['import', 'subimport',
+ 'includefrom', 'subincludefrom',
+ 'inputfrom', 'subinputfrom']
def __init__(self, name, suffixes, graphics_extensions, *args, **kw):
@@ -175,8 +186,29 @@ class LaTeX(SCons.Scanner.Base):
# line followed by one or more newline characters (i.e. blank
# lines), interfering with a match on the next line.
# add option for whitespace before the '[options]' or the '{filename}'
- regex = r'^[^%\n]*\\(include|includegraphics(?:\s*\[[^\]]+\])?|lstinputlisting(?:\[[^\]]+\])?|input|bibliography|addbibresource|addglobalbib|addsectionbib|usepackage)\s*{([^}]*)}'
- self.cre = re.compile(regex, re.M)
+ regex = r'''
+ ^[^%\n]*
+ \\(
+ include
+ | includegraphics(?:\s*\[[^\]]+\])?
+ | lstinputlisting(?:\[[^\]]+\])?
+ | input
+ | import
+ | subimport
+ | includefrom
+ | subincludefrom
+ | inputfrom
+ | subinputfrom
+ | bibliography
+ | addbibresource
+ | addglobalbib
+ | addsectionbib
+ | usepackage
+ )
+ \s*{([^}]*)} # first arg
+ (?: \s*{([^}]*)} )? # maybe another arg
+ '''
+ self.cre = re.compile(regex, re.M | re.X)
self.comment_re = re.compile(r'^((?:(?:\\%)|[^%\n])*)(.*)$', re.M)
self.graphics_extensions = graphics_extensions
@@ -236,23 +268,26 @@ class LaTeX(SCons.Scanner.Base):
SCons.Scanner.Base.__init__(self, *args, **kw)
- def _latex_names(self, include):
- filename = include[1]
- if include[0] == 'input':
+ def _latex_names(self, include_type, filename):
+ if include_type == 'input':
base, ext = os.path.splitext( filename )
if ext == "":
return [filename + '.tex']
- if (include[0] == 'include'):
- return [filename + '.tex']
- if include[0] == 'bibliography':
+ if include_type in ('include', 'import', 'subimport',
+ 'includefrom', 'subincludefrom',
+ 'inputfrom', 'subinputfrom'):
+ base, ext = os.path.splitext( filename )
+ if ext == "":
+ return [filename + '.tex']
+ if include_type == 'bibliography':
base, ext = os.path.splitext( filename )
if ext == "":
return [filename + '.bib']
- if include[0] == 'usepackage':
+ if include_type == 'usepackage':
base, ext = os.path.splitext( filename )
if ext == "":
return [filename + '.sty']
- if include[0] == 'includegraphics':
+ if include_type == 'includegraphics':
base, ext = os.path.splitext( filename )
if ext == "":
#return [filename+e for e in self.graphics_extensions + TexGraphics]
@@ -267,21 +302,26 @@ class LaTeX(SCons.Scanner.Base):
return SCons.Node.FS._my_normcase(str(include))
def find_include(self, include, source_dir, path):
+ inc_type, inc_subdir, inc_filename = include
try:
- sub_path = path[include[0]]
+ sub_paths = path[inc_type]
except (IndexError, KeyError):
- sub_path = ()
- try_names = self._latex_names(include)
+ sub_paths = ((), ())
+ try_names = self._latex_names(inc_type, inc_filename)
+
+ # There are three search paths to try:
+ # 1. current directory "source_dir"
+ # 2. env[var]
+ # 3. env['ENV'][var]
+ search_paths = [(source_dir,)] + list(sub_paths)
+
for n in try_names:
- # see if we find it using the path in env[var]
- i = SCons.Node.FS.find_file(n, (source_dir,) + sub_path[0])
- if i:
- return i, include
- # see if we find it using the path in env['ENV'][var]
- i = SCons.Node.FS.find_file(n, (source_dir,) + sub_path[1])
- if i:
- return i, include
- return i, include
+ for search_path in search_paths:
+ paths = tuple([d.Dir(inc_subdir) for d in search_path])
+ i = SCons.Node.FS.find_file(n, paths)
+ if i:
+ return i, include
+ return None, include
def canonical_text(self, text):
"""Standardize an input TeX-file contents.
@@ -293,14 +333,14 @@ class LaTeX(SCons.Scanner.Base):
line_continues_a_comment = False
for line in text.splitlines():
line,comment = self.comment_re.findall(line)[0]
- if line_continues_a_comment == True:
+ if line_continues_a_comment:
out[-1] = out[-1] + line.lstrip()
else:
out.append(line)
line_continues_a_comment = len(comment) > 0
return '\n'.join(out).rstrip()+'\n'
- def scan(self, node):
+ def scan(self, node, subdir='.'):
# Modify the default scan function to allow for the regular
# expression to return a comma separated list of file names
# as can be the case with the bibliography keyword.
@@ -309,7 +349,7 @@ class LaTeX(SCons.Scanner.Base):
# path_dict = dict(list(path))
# add option for whitespace (\s) before the '['
noopt_cre = re.compile('\s*\[.*$')
- if node.includes != None:
+ if node.includes is not None:
includes = node.includes
else:
text = self.canonical_text(node.get_text_contents())
@@ -326,9 +366,14 @@ class LaTeX(SCons.Scanner.Base):
split_includes = []
for include in includes:
inc_type = noopt_cre.sub('', include[0])
- inc_list = include[1].split(',')
+ inc_subdir = subdir
+ if inc_type in self.two_arg_commands:
+ inc_subdir = os.path.join(subdir, include[1])
+ inc_list = include[2].split(',')
+ else:
+ inc_list = include[1].split(',')
for j in range(len(inc_list)):
- split_includes.append( (inc_type, inc_list[j]) )
+ split_includes.append( (inc_type, inc_subdir, inc_list[j]) )
#
includes = split_includes
node.includes = includes
@@ -341,8 +386,8 @@ class LaTeX(SCons.Scanner.Base):
directory of the main file just as latex does"""
path_dict = dict(list(path))
-
- queue = []
+
+ queue = []
queue.extend( self.scan(node) )
seen = {}
@@ -357,13 +402,15 @@ class LaTeX(SCons.Scanner.Base):
source_dir = node.get_dir()
#for include in includes:
while queue:
-
+
include = queue.pop()
+ inc_type, inc_subdir, inc_filename = include
+
try:
- if seen[include[1]] == 1:
+ if seen[inc_filename] == 1:
continue
except KeyError:
- seen[include[1]] = 1
+ seen[inc_filename] = 1
#
# Handle multiple filenames in include[1]
@@ -372,14 +419,14 @@ class LaTeX(SCons.Scanner.Base):
if n is None:
# Do not bother with 'usepackage' warnings, as they most
# likely refer to system-level files
- if include[0] != 'usepackage':
+ if inc_type != 'usepackage':
SCons.Warnings.warn(SCons.Warnings.DependencyWarning,
"No dependency generated for file: %s (included from: %s) -- file not found" % (i, node))
else:
sortkey = self.sort_key(n)
nodes.append((sortkey, n))
- # recurse down
- queue.extend( self.scan(n) )
+ # recurse down
+ queue.extend( self.scan(n, inc_subdir) )
return [pair[1] for pair in sorted(nodes)]
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Prog.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Prog.py
index de842d5e222..c100a09208e 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Prog.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/Prog.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Scanner/Prog.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/Prog.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Node
import SCons.Node.FS
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/RC.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/RC.py
index 527a0fbf819..2c2ef4e3077 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/RC.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/RC.py
@@ -6,7 +6,7 @@ Definition Language) files.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,23 +28,34 @@ Definition Language) files.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Scanner/RC.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/RC.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+import re
import SCons.Node.FS
import SCons.Scanner
-import re
+
+
+def no_tlb(nodes):
+ """
+ Filter out .tlb files as they are binary and shouldn't be scanned
+ """
+ # print("Nodes:%s"%[str(n) for n in nodes])
+ return [n for n in nodes if str(n)[-4:] != '.tlb']
+
def RCScan():
"""Return a prototype Scanner instance for scanning RC source files"""
-
+
res_re= r'^(?:\s*#\s*(?:include)|' \
'.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \
'\s*.*?)' \
'\s*(<|"| )([^>"\s]+)(?:[>"\s])*$'
- resScanner = SCons.Scanner.ClassicCPP( "ResourceScanner",
- "$RCSUFFIXES",
- "CPPPATH",
- res_re )
+ resScanner = SCons.Scanner.ClassicCPP("ResourceScanner",
+ "$RCSUFFIXES",
+ "CPPPATH",
+ res_re,
+ recursive=no_tlb)
return resScanner
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/SWIG.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/SWIG.py
index 1e70ddc838e..861990dfda1 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/SWIG.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/SWIG.py
@@ -5,7 +5,7 @@ This module implements the dependency scanner for SWIG code.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ This module implements the dependency scanner for SWIG code.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Scanner/SWIG.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/SWIG.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Scanner
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/__init__.py
index b13120cea1d..b28dabfc729 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Scanner/__init__.py
@@ -5,7 +5,7 @@ The Scanner package for the SCons software construction utility.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ The Scanner package for the SCons software construction utility.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Scanner/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import re
@@ -62,8 +62,10 @@ def Scanner(function, *args, **kw):
class FindPathDirs(object):
- """A class to bind a specific *PATH variable name to a function that
- will return all of the *path directories."""
+ """
+ A class to bind a specific E{*}PATH variable name to a function that
+ will return all of the E{*}path directories.
+ """
def __init__(self, variable):
self.variable = variable
def __call__(self, env, dir=None, target=None, source=None, argument=None):
@@ -188,12 +190,12 @@ class Base(object):
def path(self, env, dir=None, target=None, source=None):
if not self.path_function:
return ()
- if not self.argument is _null:
+ if self.argument is not _null:
return self.path_function(env, dir, target, source, self.argument)
else:
return self.path_function(env, dir, target, source)
- def __call__(self, node, env, path = ()):
+ def __call__(self, node, env, path=()):
"""
This method scans a single object. 'node' is the node
that will be passed to the scanner function, and 'env' is the
@@ -206,27 +208,27 @@ class Base(object):
self = self.select(node)
if not self.argument is _null:
- list = self.function(node, env, path, self.argument)
+ node_list = self.function(node, env, path, self.argument)
else:
- list = self.function(node, env, path)
+ node_list = self.function(node, env, path)
kw = {}
if hasattr(node, 'dir'):
kw['directory'] = node.dir
node_factory = env.get_factory(self.node_factory)
nodes = []
- for l in list:
+ for l in node_list:
if self.node_class and not isinstance(l, self.node_class):
l = node_factory(l, **kw)
nodes.append(l)
return nodes
- def __cmp__(self, other):
+ def __eq__(self, other):
try:
- return cmp(self.__dict__, other.__dict__)
+ return self.__dict__ == other.__dict__
except AttributeError:
# other probably doesn't have a __dict__
- return cmp(self.__dict__, other)
+ return self.__dict__ == other
def __hash__(self):
return id(self)
@@ -259,7 +261,7 @@ class Base(object):
def _recurse_no_nodes(self, nodes):
return []
- recurse_nodes = _recurse_no_nodes
+ # recurse_nodes = _recurse_no_nodes
def add_scanner(self, skey, scanner):
self.function[skey] = scanner
@@ -283,7 +285,7 @@ class Selector(Base):
self.dict = dict
self.skeys = list(dict.keys())
- def __call__(self, node, env, path = ()):
+ def __call__(self, node, env, path=()):
return self.select(node)(node, env, path)
def select(self, node):
@@ -326,7 +328,7 @@ class Classic(Current):
self.cre = re.compile(regex, re.M)
- def _scan(node, env, path=(), self=self):
+ def _scan(node, _, path=(), self=self):
node = node.rfile()
if not node.exists():
return []
@@ -334,7 +336,12 @@ class Classic(Current):
kw['function'] = _scan
kw['path_function'] = FindPathDirs(path_variable)
- kw['recursive'] = 1
+
+ # Allow recursive to propagate if child class specifies.
+ # In this case resource scanner needs to specify a filter on which files
+ # get recursively processed. Previously was hardcoded to 1 instead of
+ # defaulted to 1.
+ kw['recursive'] = kw.get('recursive', 1)
kw['skeys'] = suffixes
kw['name'] = name
@@ -356,7 +363,7 @@ class Classic(Current):
if node.includes is not None:
includes = node.includes
else:
- includes = self.find_include_names (node)
+ includes = self.find_include_names(node)
# Intern the names of the include files. Saves some memory
# if the same header is included many times.
node.includes = list(map(SCons.Util.silent_intern, includes))
@@ -393,6 +400,7 @@ class ClassicCPP(Classic):
the contained filename in group 1.
"""
def find_include(self, include, source_dir, path):
+ include = list(map(SCons.Util.to_str, include))
if include[0] == '"':
paths = (source_dir,) + tuple(path)
else:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/Interactive.py
index bb9ab933216..9bbe104ed14 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Interactive.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/Interactive.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -19,8 +19,9 @@
# 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.
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Script/Interactive.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Interactive.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """
SCons interactive mode
@@ -98,17 +99,14 @@ except ImportError:
class SConsInteractiveCmd(cmd.Cmd):
"""\
- build [TARGETS] Build the specified TARGETS and their dependencies.
- 'b' is a synonym.
- clean [TARGETS] Clean (remove) the specified TARGETS and their
- dependencies. 'c' is a synonym.
- exit Exit SCons interactive mode.
- help [COMMAND] Prints help for the specified COMMAND. 'h' and
- '?' are synonyms.
- shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and '!'
- are synonyms.
- version Prints SCons version information.
- """
+
+build [TARGETS] Build the specified TARGETS and their dependencies. 'b' is a synonym.
+clean [TARGETS] Clean (remove) the specified TARGETS and their dependencies. 'c' is a synonym.
+exit Exit SCons interactive mode.
+help [COMMAND] Prints help for the specified COMMAND. 'h' and '?' are synonyms.
+shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and '!' are synonyms.
+version Prints SCons version information.
+"""
synonyms = {
'b' : 'build',
@@ -129,12 +127,12 @@ class SConsInteractiveCmd(cmd.Cmd):
self.shell_variable = 'SHELL'
def default(self, argv):
- print "*** Unknown command: %s" % argv[0]
+ print("*** Unknown command: %s" % argv[0])
def onecmd(self, line):
line = line.strip()
if not line:
- print self.lastcmd
+ print(self.lastcmd)
return self.emptyline()
self.lastcmd = line
if line[0] == '!':
@@ -221,7 +219,7 @@ class SConsInteractiveCmd(cmd.Cmd):
def get_unseen_children(node, parent, seen_nodes=seen_nodes):
def is_unseen(node, seen_nodes=seen_nodes):
return node not in seen_nodes
- return list(filter(is_unseen, node.children(scan=1)))
+ return [child for child in node.children(scan=1) if is_unseen(child)]
def add_to_seen_nodes(node, parent, seen_nodes=seen_nodes):
seen_nodes[node] = 1
@@ -249,7 +247,7 @@ class SConsInteractiveCmd(cmd.Cmd):
while n:
n = walker.get_next()
- for node in seen_nodes.keys():
+ for node in list(seen_nodes.keys()):
# Call node.clear() to clear most of the state
node.clear()
# node.clear() doesn't reset node.state, so call
@@ -274,7 +272,7 @@ class SConsInteractiveCmd(cmd.Cmd):
return self.do_build(['build', '--clean'] + argv[1:])
def do_EOF(self, argv):
- print
+ print()
self.do_exit(argv)
def _do_one_help(self, arg):
@@ -351,7 +349,7 @@ class SConsInteractiveCmd(cmd.Cmd):
# Doing the right thing with an argument list currently
# requires different shell= values on Windows and Linux.
p = subprocess.Popen(argv, shell=(sys.platform=='win32'))
- except EnvironmentError, e:
+ except EnvironmentError as e:
sys.stderr.write('scons: %s: %s\n' % (argv[0], e.strerror))
else:
p.wait()
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/Main.py
index d7c3a5940a0..7d63d3a609b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/Main.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/Main.py
@@ -10,10 +10,14 @@ some other module. If it's specific to the "scons" script invocation,
it goes here.
"""
+from __future__ import print_function
+
+
unsupported_python_version = (2, 6, 0)
deprecated_python_version = (2, 7, 0)
-# Copyright (c) 2001 - 2016 The SCons Foundation
+
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,7 +38,8 @@ deprecated_python_version = (2, 7, 0)
# 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__ = "src/engine/SCons/Script/Main.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Main.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
import SCons.compat
@@ -42,6 +47,8 @@ import os
import sys
import time
import traceback
+import sysconfig
+import platform
import SCons.CacheDir
import SCons.Debug
@@ -52,6 +59,7 @@ import SCons.Job
import SCons.Node
import SCons.Node.FS
import SCons.Platform
+import SCons.Platform.virtualenv
import SCons.SConf
import SCons.Script
import SCons.Taskmaster
@@ -60,6 +68,7 @@ import SCons.Warnings
import SCons.Script.Interactive
+
def fetch_win32_parallel_msg():
# A subsidiary function that exists solely to isolate this import
# so we don't have to pull it in on all platforms, and so that an
@@ -70,6 +79,7 @@ def fetch_win32_parallel_msg():
import SCons.Platform.win32
return SCons.Platform.win32.parallel_msg
+
def revert_io():
# This call is added to revert stderr and stdout to the original
# ones just in case some build rule or something else in the system
@@ -86,6 +96,7 @@ progress_display = SCons.Util.DisplayEngine()
first_command_start = None
last_command_end = None
+
class Progressor(object):
prev = ''
count = 0
@@ -149,9 +160,11 @@ def Progress(*args, **kw):
_BuildFailures = []
+
def GetBuildFailures():
return _BuildFailures
+
class BuildTask(SCons.Taskmaster.OutOfDateTask):
"""An SCons build task."""
progress = ProgressObject
@@ -220,7 +233,7 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
self.exception_set()
self.do_failed()
else:
- print "scons: Nothing to be done for `%s'." % t
+ print("scons: Nothing to be done for `%s'." % t)
SCons.Taskmaster.OutOfDateTask.executed(self)
else:
SCons.Taskmaster.OutOfDateTask.executed(self)
@@ -289,8 +302,8 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
if self.options.debug_includes:
tree = t.render_include_tree()
if tree:
- print
- print tree
+ print()
+ print(tree)
SCons.Taskmaster.OutOfDateTask.postprocess(self)
def make_ready(self):
@@ -301,6 +314,7 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
if explanation:
sys.stdout.write("scons: " + explanation)
+
class CleanTask(SCons.Taskmaster.AlwaysTask):
"""An SCons clean task."""
def fs_delete(self, path, pathstr, remove=True):
@@ -325,10 +339,10 @@ class CleanTask(SCons.Taskmaster.AlwaysTask):
else:
errstr = "Path '%s' exists but isn't a file or directory."
raise SCons.Errors.UserError(errstr % (pathstr))
- except SCons.Errors.UserError, e:
- print e
- except (IOError, OSError), e:
- print "scons: Could not remove '%s':" % pathstr, e.strerror
+ except SCons.Errors.UserError as e:
+ print(e)
+ except (IOError, OSError) as e:
+ print("scons: Could not remove '%s':" % pathstr, e.strerror)
def _get_files_to_clean(self):
result = []
@@ -354,13 +368,13 @@ class CleanTask(SCons.Taskmaster.AlwaysTask):
for t in self._get_files_to_clean():
try:
removed = t.remove()
- except OSError, e:
+ except OSError as e:
# An OSError may indicate something like a permissions
# issue, an IOError would indicate something like
# the file not existing. In either case, print a
# message and keep going to try to remove as many
# targets as possible.
- print "scons: Could not remove '%s':" % str(t), e.strerror
+ print("scons: Could not remove '{0}'".format(str(t)), e.strerror)
else:
if removed:
display("Removed " + str(t))
@@ -600,7 +614,7 @@ def _scons_internal_error():
"""Handle all errors but user errors. Print out a message telling
the user what to do in this case and print a normal trace.
"""
- print 'internal error'
+ print('internal error')
traceback.print_exc()
sys.exit(2)
@@ -610,7 +624,7 @@ def _SConstruct_exists(dirname='', repositories=[], filelist=None):
current directory.
"""
if not filelist:
- filelist = ['SConstruct', 'Sconstruct', 'sconstruct']
+ filelist = ['SConstruct', 'Sconstruct', 'sconstruct', 'SConstruct.py', 'Sconstruct.py', 'sconstruct.py']
for file in filelist:
sfile = os.path.join(dirname, file)
if os.path.isfile(sfile):
@@ -714,7 +728,7 @@ def _load_site_scons_dir(topdir, site_dir_name=None):
# the error checking makes it longer.
try:
m = sys.modules['SCons.Script']
- except Exception, e:
+ except Exception as e:
fmt = 'cannot import site_init.py: missing SCons.Script module %s'
raise SCons.Errors.InternalError(fmt % repr(e))
try:
@@ -722,15 +736,15 @@ def _load_site_scons_dir(topdir, site_dir_name=None):
modname = os.path.basename(pathname)[:-len(sfx)]
site_m = {"__file__": pathname, "__name__": modname, "__doc__": None}
re_special = re.compile("__[^_]+__")
- for k in m.__dict__.keys():
+ for k in list(m.__dict__.keys()):
if not re_special.match(k):
site_m[k] = m.__dict__[k]
# This is the magic.
- exec fp in site_m
+ exec(compile(fp.read(), fp.name, 'exec'), site_m)
except KeyboardInterrupt:
raise
- except Exception, e:
+ except Exception as e:
fmt = '*** Error loading site_init file %s:\n'
sys.stderr.write(fmt % repr(site_init_file))
raise
@@ -740,7 +754,7 @@ def _load_site_scons_dir(topdir, site_dir_name=None):
m.__dict__[k] = site_m[k]
except KeyboardInterrupt:
raise
- except ImportError, e:
+ except ImportError as e:
fmt = '*** cannot import site init file %s:\n'
sys.stderr.write(fmt % repr(site_init_file))
raise
@@ -792,7 +806,7 @@ def _load_all_site_scons_dirs(topdir, verbose=None):
dirs=sysdirs + [topdir]
for d in dirs:
if verbose: # this is used by unit tests.
- print "Loading site dir ", d
+ print("Loading site dir ", d)
_load_site_scons_dir(d)
def test_load_all_site_scons_dirs(d):
@@ -850,6 +864,13 @@ def _main(parser):
for warning_type, message in delayed_warnings:
SCons.Warnings.warn(warning_type, message)
+ if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:
+ if options.enable_virtualenv:
+ SCons.Platform.virtualenv.enable_virtualenv = True
+
+ if options.ignore_virtualenv:
+ SCons.Platform.virtualenv.ignore_virtualenv = True
+
if options.diskcheck:
SCons.Node.FS.set_diskcheck(options.diskcheck)
@@ -992,7 +1013,7 @@ def _main(parser):
try:
for script in scripts:
SCons.Script._SConscript._SConscript(fs, script)
- except SCons.Errors.StopError, e:
+ except SCons.Errors.StopError as e:
# We had problems reading an SConscript file, such as it
# couldn't be copied in to the VariantDir. Since we're just
# reading SConscript files and haven't started building
@@ -1053,8 +1074,8 @@ def _main(parser):
# SConscript files. Give them the options usage.
raise SConsPrintHelpException
else:
- print help_text
- print "Use scons -H for help about command-line options."
+ print(help_text)
+ print("Use scons -H for help about command-line options.")
exit_status = 0
return
@@ -1091,7 +1112,7 @@ def _main(parser):
nodes = _build_targets(fs, options, targets, target_top)
if not nodes:
revert_io()
- print 'Found nothing to build'
+ print('Found nothing to build')
exit_status = 2
def _build_targets(fs, options, targets, target_top):
@@ -1157,7 +1178,7 @@ def _build_targets(fs, options, targets, target_top):
# or not a file, so go ahead and keep it as a default
# target and let the engine sort it out:
return 1
- d = list(filter(check_dir, SCons.Script.DEFAULT_TARGETS))
+ d = [tgt for tgt in SCons.Script.DEFAULT_TARGETS if check_dir(tgt)]
SCons.Script.DEFAULT_TARGETS[:] = d
target_top = None
lookup_top = None
@@ -1231,7 +1252,7 @@ def _build_targets(fs, options, targets, target_top):
if options.taskmastertrace_file == '-':
tmtrace = sys.stdout
elif options.taskmastertrace_file:
- tmtrace = open(options.taskmastertrace_file, 'wb')
+ tmtrace = open(options.taskmastertrace_file, 'w')
else:
tmtrace = None
taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, order, tmtrace)
@@ -1240,16 +1261,23 @@ def _build_targets(fs, options, targets, target_top):
# various print_* settings, tree_printer list, etc.
BuildTask.options = options
+
+ is_pypy = platform.python_implementation() == 'PyPy'
+ # As of 3.7, python removed support for threadless platforms.
+ # See https://www.python.org/dev/peps/pep-0011/
+ is_37_or_later = sys.version_info >= (3, 7)
+ python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy or is_37_or_later
+ # to check if python configured with threads.
global num_jobs
num_jobs = options.num_jobs
jobs = SCons.Job.Jobs(num_jobs, taskmaster)
if num_jobs > 1:
msg = None
- if jobs.num_jobs == 1:
+ if sys.platform == 'win32':
+ msg = fetch_win32_parallel_msg()
+ elif jobs.num_jobs == 1 or not python_has_threads:
msg = "parallel builds are unsupported by this version of Python;\n" + \
"\tignoring -j or num_jobs option.\n"
- elif sys.platform == 'win32':
- msg = fetch_win32_parallel_msg()
if msg:
SCons.Warnings.warn(SCons.Warnings.NoParallelSupportWarning, msg)
@@ -1332,10 +1360,10 @@ def main():
pass
parts.append(version_string("engine", SCons))
parts.append(path_string("engine", SCons))
- parts.append("Copyright (c) 2001 - 2016 The SCons Foundation")
+ parts.append("Copyright (c) 2001 - 2019 The SCons Foundation")
version = ''.join(parts)
- import SConsOptions
+ from . import SConsOptions
parser = SConsOptions.Parser(version)
values = SConsOptions.SConsValues(parser.get_default_values())
@@ -1346,23 +1374,23 @@ def main():
_exec_main(parser, values)
finally:
revert_io()
- except SystemExit, s:
+ except SystemExit as s:
if s:
exit_status = s
except KeyboardInterrupt:
print("scons: Build interrupted.")
sys.exit(2)
- except SyntaxError, e:
+ except SyntaxError as e:
_scons_syntax_error(e)
except SCons.Errors.InternalError:
_scons_internal_error()
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
_scons_user_error(e)
except SConsPrintHelpException:
parser.print_help()
exit_status = 0
- except SCons.Errors.BuildError, e:
- print e
+ except SCons.Errors.BuildError as e:
+ print(e)
exit_status = e.exitstatus
except:
# An exception here is likely a builtin Python exception Python
@@ -1398,10 +1426,10 @@ def main():
else:
ct = last_command_end - first_command_start
scons_time = total_time - sconscript_time - ct
- print "Total build time: %f seconds"%total_time
- print "Total SConscript file execution time: %f seconds"%sconscript_time
- print "Total SCons execution time: %f seconds"%scons_time
- print "Total command execution time: %f seconds"%ct
+ print("Total build time: %f seconds"%total_time)
+ print("Total SConscript file execution time: %f seconds"%sconscript_time)
+ print("Total SCons execution time: %f seconds"%scons_time)
+ print("Total command execution time: %f seconds"%ct)
sys.exit(exit_status)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/SConsOptions.py
index 9e9d5ce0c5b..258fc1f883a 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/SConsOptions.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/SConsOptions.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConsOptions.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import optparse
import re
@@ -38,6 +38,7 @@ except ImportError:
_ = gettext
import SCons.Node.FS
+import SCons.Platform.virtualenv
import SCons.Warnings
OptionValueError = optparse.OptionValueError
@@ -63,6 +64,7 @@ def diskcheck_convert(value):
raise ValueError(v)
return result
+
class SConsValues(optparse.Values):
"""
Holder class for uniform access to SCons options, regardless
@@ -112,7 +114,18 @@ class SConsValues(optparse.Values):
try:
return self.__dict__['__SConscript_settings__'][attr]
except KeyError:
- return getattr(self.__dict__['__defaults__'], attr)
+ try:
+ return getattr(self.__dict__['__defaults__'], attr)
+ except KeyError:
+ # Added because with py3 this is a new class,
+ # not a classic class, and due to the way
+ # In that case it will create an object without
+ # __defaults__, and then query for __setstate__
+ # which will throw an exception of KeyError
+ # deepcopy() is expecting AttributeError if __setstate__
+ # is not available.
+ raise AttributeError(attr)
+
settable = [
'clean',
@@ -127,6 +140,7 @@ class SConsValues(optparse.Values):
'random',
'stack_size',
'warn',
+ 'silent'
]
def set_option(self, name, value):
@@ -161,7 +175,7 @@ class SConsValues(optparse.Values):
elif name == 'diskcheck':
try:
value = diskcheck_convert(value)
- except ValueError, v:
+ except ValueError as v:
raise SCons.Errors.UserError("Not a valid diskcheck value: %s"%v)
if 'diskcheck' not in self.__dict__:
# No --diskcheck= option was specified on the command line.
@@ -186,6 +200,7 @@ class SConsValues(optparse.Values):
self.__SConscript_settings__[name] = value
+
class SConsOption(optparse.Option):
def convert_value(self, opt, value):
if value is not None:
@@ -638,7 +653,7 @@ def Parser(version):
for value in value__.split(','):
if value in debug_options:
parser.values.debug.append(value)
- elif value in deprecated_debug_options.keys():
+ elif value in list(deprecated_debug_options.keys()):
parser.values.debug.append(value)
try:
parser.values.delayed_warnings
@@ -663,7 +678,7 @@ def Parser(version):
def opt_diskcheck(option, opt, value, parser):
try:
diskcheck_value = diskcheck_convert(value)
- except ValueError, e:
+ except ValueError as e:
raise OptionValueError("`%s' is not a valid diskcheck type" % e)
setattr(parser.values, option.dest, diskcheck_value)
@@ -692,6 +707,12 @@ def Parser(version):
action="callback", callback=opt_duplicate,
help=opt_duplicate_help)
+ if not SCons.Platform.virtualenv.virtualenv_enabled_by_default:
+ op.add_option('--enable-virtualenv',
+ dest="enable_virtualenv",
+ action="store_true",
+ help="Import certain virtualenv variables to SCons")
+
op.add_option('-f', '--file', '--makefile', '--sconstruct',
nargs=1, type="string",
dest="file", default=[],
@@ -719,6 +740,11 @@ def Parser(version):
help="Search DIR for imported Python modules.",
metavar="DIR")
+ op.add_option('--ignore-virtualenv',
+ dest="ignore_virtualenv",
+ action="store_true",
+ help="Do not import virtualenv variables to SCons")
+
op.add_option('--implicit-cache',
dest='implicit_cache', default=False,
action="store_true",
@@ -830,7 +856,7 @@ def Parser(version):
tree_options = ["all", "derived", "prune", "status"]
def opt_tree(option, opt, value, parser, tree_options=tree_options):
- import Main
+ from . import Main
tp = Main.TreePrinter()
for o in value.split(','):
if o == 'all':
@@ -892,6 +918,7 @@ def Parser(version):
action="append",
help="Search REPOSITORY for source and target files.")
+
# Options from Make and Cons classic that we do not yet support,
# but which we may support someday and whose (potential) meanings
# we don't want to change. These all get a "the -X option is not
@@ -964,7 +991,6 @@ def Parser(version):
action="callback", callback=opt_not_yet,
# help="Warn when an undefined variable is referenced."
help=SUPPRESS_HELP)
-
return op
# Local Variables:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConscript.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/SConscript.py
index f1c238f136b..f34a5c0fef3 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConscript.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/SConscript.py
@@ -6,7 +6,7 @@ files.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,10 +26,8 @@ files.
# 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.
-from __future__ import division
-from __future__ import print_function
-__revision__ = "src/engine/SCons/Script/SConscript.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConscript.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons
import SCons.Action
@@ -46,12 +44,15 @@ import SCons.Script.Main
import SCons.Tool
import SCons.Util
+from . import Main
+
import collections
import os
import os.path
import re
import sys
import traceback
+import time
class SConscriptReturn(Exception):
pass
@@ -70,7 +71,7 @@ def get_calling_namespaces():
"""Return the locals and globals for the function that called
into this module in the current call stack."""
try: 1//0
- except ZeroDivisionError:
+ except ZeroDivisionError:
# Don't start iterating with the current stack-frame to
# prevent creating reference cycles (f_back is safe).
frame = sys.exc_info()[2].tb_frame.f_back
@@ -104,7 +105,7 @@ def compute_exports(exports):
retval[export] = loc[export]
except KeyError:
retval[export] = glob[export]
- except KeyError, x:
+ except KeyError as x:
raise SCons.Errors.UserError("Export of non-existent variable '%s'"%x)
return retval
@@ -136,7 +137,7 @@ def Return(*vars, **kw):
for var in fvars:
for v in var.split():
retval.append(call_stack[-1].globals[v])
- except KeyError, x:
+ except KeyError as x:
raise SCons.Errors.UserError("Return of non-existent variable '%s'"%x)
if len(retval) == 1:
@@ -152,6 +153,35 @@ def Return(*vars, **kw):
stack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :)
+def handle_missing_SConscript(f, must_exist=None):
+ """Take appropriate action on missing file in SConscript() call.
+
+ Print a warning or raise an exception on missing file.
+ On first warning, print a deprecation message.
+
+ Args:
+ f (str): path of missing configuration file
+ must_exist (bool): raise exception if file does not exist
+
+ Raises:
+ UserError if 'must_exist' is True or if global
+ SCons.Script._no_missing_sconscript is True.
+ """
+
+ if must_exist or (SCons.Script._no_missing_sconscript and must_exist is not False):
+ msg = "Fatal: missing SConscript '%s'" % f.get_internal_path()
+ raise SCons.Errors.UserError(msg)
+
+ if SCons.Script._warn_missing_sconscript_deprecated:
+ msg = "Calling missing SConscript without error is deprecated.\n" + \
+ "Transition by adding must_exist=0 to SConscript calls.\n" + \
+ "Missing SConscript '%s'" % f.get_internal_path()
+ SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
+ SCons.Script._warn_missing_sconscript_deprecated = False
+ else:
+ msg = "Ignoring missing SConscript '%s'" % f.get_internal_path()
+ SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
+
def _SConscript(fs, *files, **kw):
top = fs.Top
sd = fs.SConstruct_dir.rdir()
@@ -165,7 +195,7 @@ def _SConscript(fs, *files, **kw):
try:
SCons.Script.sconscript_reading = SCons.Script.sconscript_reading + 1
if fn == "-":
- exec sys.stdin in call_stack[-1].globals
+ exec(sys.stdin.read(), call_stack[-1].globals)
else:
if isinstance(fn, SCons.Node.Node):
f = fn
@@ -179,10 +209,10 @@ def _SConscript(fs, *files, **kw):
fs.chdir(top, change_os_dir=1)
if f.rexists():
actual = f.rfile()
- _file_ = open(actual.get_abspath(), "r")
+ _file_ = open(actual.get_abspath(), "rb")
elif f.srcnode().rexists():
actual = f.srcnode().rfile()
- _file_ = open(actual.get_abspath(), "r")
+ _file_ = open(actual.get_abspath(), "rb")
elif f.has_src_builder():
# The SConscript file apparently exists in a source
# code management system. Build it, but then clear
@@ -192,7 +222,7 @@ def _SConscript(fs, *files, **kw):
f.built()
f.builder_set(None)
if f.exists():
- _file_ = open(f.get_abspath(), "r")
+ _file_ = open(f.get_abspath(), "rb")
if _file_:
# Chdir to the SConscript directory. Use a path
# name relative to the SConstruct file so that if
@@ -248,15 +278,22 @@ def _SConscript(fs, *files, **kw):
pass
try:
try:
- exec _file_ in call_stack[-1].globals
+# _file_ = SCons.Util.to_str(_file_)
+ if Main.print_time:
+ time1 = time.time()
+ exec(compile(_file_.read(), _file_.name, 'exec'),
+ call_stack[-1].globals)
except SConscriptReturn:
pass
finally:
+ if Main.print_time:
+ time2 = time.time()
+ print('SConscript:%s took %0.3f ms' % (f.get_abspath(), (time2 - time1) * 1000.0))
+
if old_file is not None:
call_stack[-1].globals.update({__file__:old_file})
else:
- SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning,
- "Ignoring missing SConscript '%s'" % f.get_internal_path())
+ handle_missing_SConscript(f, kw.get('must_exist', None))
finally:
SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1
@@ -273,7 +310,7 @@ def _SConscript(fs, *files, **kw):
rdir._create() # Make sure there's a directory there.
try:
os.chdir(rdir.get_abspath())
- except OSError, e:
+ except OSError as e:
# We still couldn't chdir there, so raise the error,
# but only if actions are being executed.
#
@@ -463,7 +500,7 @@ class SConsEnvironment(SCons.Environment.Base):
scons_ver_string = '%d.%d.%d' % (major, minor, revision)
else:
scons_ver_string = '%d.%d' % (major, minor)
- print ("SCons %s or greater required, but you have SCons %s" % \
+ print("SCons %s or greater required, but you have SCons %s" % \
(scons_ver_string, SCons.__version__))
sys.exit(2)
@@ -471,7 +508,7 @@ class SConsEnvironment(SCons.Environment.Base):
"""Exit abnormally if the Python version is not late enough."""
if sys.version_info < (major, minor):
v = sys.version.split()[0]
- print ("Python %d.%d or greater required, but you have Python %s" %(major,minor,v))
+ print("Python %d.%d or greater required, but you have Python %s" %(major,minor,v))
sys.exit(2)
def Exit(self, value=0):
@@ -510,10 +547,35 @@ class SConsEnvironment(SCons.Environment.Base):
globals[v] = exports[v]
else:
globals[v] = global_exports[v]
- except KeyError,x:
+ except KeyError as x:
raise SCons.Errors.UserError("Import of non-existent variable '%s'"%x)
def SConscript(self, *ls, **kw):
+ """Execute SCons configuration files.
+
+ Parameters:
+ *ls (str or list): configuration file(s) to execute.
+
+ Keyword arguments:
+ dirs (list): execute SConscript in each listed directory.
+ name (str): execute script 'name' (used only with 'dirs').
+ exports (list or dict): locally export variables the
+ called script(s) can import.
+ variant_dir (str): mirror sources needed for the build in
+ a variant directory to allow building in it.
+ duplicate (bool): physically duplicate sources instead of just
+ adjusting paths of derived files (used only with 'variant_dir')
+ (default is True).
+ must_exist (bool): fail if a requested script is missing
+ (default is False, default is deprecated).
+
+ Returns:
+ list of variables returned by the called script
+
+ Raises:
+ UserError: a script is not found and such exceptions are enabled.
+ """
+
if 'build_dir' in kw:
msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead."""
SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/__init__.py
index 56f06cfcc0d..927b02340e7 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Script/__init__.py
@@ -12,7 +12,7 @@ it goes here.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,14 +34,19 @@ it goes here.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Script/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import time
start_time = time.time()
import collections
import os
-import StringIO
+
+try:
+ from StringIO import StringIO
+except ImportError:
+ from io import StringIO
+
import sys
# Special chicken-and-egg handling of the "--debug=memoizer" flag:
@@ -67,7 +72,7 @@ if "--debug=memoizer" in _args:
except SCons.Warnings.Warning:
# Some warning was thrown. Arrange for it to be displayed
# or not after warnings are configured.
- import Main
+ from . import Main
exc_type, exc_value, tb = sys.exc_info()
Main.delayed_warnings.append((exc_type, exc_value))
del _args
@@ -76,8 +81,8 @@ import SCons.Action
import SCons.Builder
import SCons.Environment
import SCons.Node.FS
-import SCons.Options
import SCons.Platform
+import SCons.Platform.virtualenv
import SCons.Scanner
import SCons.SConf
import SCons.Subst
@@ -86,7 +91,7 @@ import SCons.Util
import SCons.Variables
import SCons.Defaults
-import Main
+from . import Main
main = Main.main
@@ -130,7 +135,7 @@ GetBuildFailures = Main.GetBuildFailures
#repositories = Main.repositories
#
-import SConscript
+from . import SConscript
_SConscript = SConscript
call_stack = _SConscript.call_stack
@@ -145,6 +150,7 @@ Environment = SCons.Environment.Environment
#OptParser = SCons.SConsOptions.OptParser
FindPathDirs = SCons.Scanner.FindPathDirs
Platform = SCons.Platform.Platform
+Virtualenv = SCons.Platform.virtualenv.Virtualenv
Return = _SConscript.Return
Scanner = SCons.Scanner.Base
Tool = SCons.Tool.Tool
@@ -157,12 +163,6 @@ ListVariable = SCons.Variables.ListVariable
PackageVariable = SCons.Variables.PackageVariable
PathVariable = SCons.Variables.PathVariable
-# Deprecated names that will go away some day.
-BoolOption = SCons.Options.BoolOption
-EnumOption = SCons.Options.EnumOption
-ListOption = SCons.Options.ListOption
-PackageOption = SCons.Options.PackageOption
-PathOption = SCons.Options.PathOption
# Action factories.
Chmod = SCons.Defaults.Chmod
@@ -264,7 +264,7 @@ def HelpFunction(text, append=False):
global help_text
if help_text is None:
if append:
- s = StringIO.StringIO()
+ s = StringIO()
PrintHelp(s)
help_text = s.getvalue()
s.close()
@@ -278,12 +278,20 @@ def HelpFunction(text, append=False):
# Will be non-zero if we are reading an SConscript file.
sconscript_reading = 0
+_no_missing_sconscript = False
+_warn_missing_sconscript_deprecated = True
+
+def set_missing_sconscript_error(flag=1):
+ """Set behavior on missing file in SConscript() call. Returns previous value"""
+ global _no_missing_sconscript
+ old = _no_missing_sconscript
+ _no_missing_sconscript = flag
+ return old
+
#
def Variables(files=[], args=ARGUMENTS):
return SCons.Variables.Variables(files, args)
-def Options(files=[], args=ARGUMENTS):
- return SCons.Options.Options(files, args)
# The list of global functions to add to the SConscript name space
# that end up calling corresponding methods or Builders in the
@@ -332,6 +340,7 @@ GlobalDefaultEnvironmentFunctions = [
'Local',
'ParseDepends',
'Precious',
+ 'PyPackageDir',
'Repository',
'Requires',
'SConsignFile',
@@ -354,6 +363,7 @@ GlobalDefaultBuilders = [
'Java',
'JavaH',
'Library',
+ 'LoadableModule',
'M4',
'MSVSProject',
'Object',
@@ -367,14 +377,16 @@ GlobalDefaultBuilders = [
'SharedObject',
'StaticLibrary',
'StaticObject',
+ 'Substfile',
'Tar',
+ 'Textfile',
'TypeLibrary',
'Zip',
'Package',
]
for name in GlobalDefaultEnvironmentFunctions + GlobalDefaultBuilders:
- exec "%s = _SConscript.DefaultEnvironmentCall(%s)" % (name, repr(name))
+ exec ("%s = _SConscript.DefaultEnvironmentCall(%s)" % (name, repr(name)))
del name
# There are a handful of variables that used to live in the
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Subst.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Subst.py
index 63c15423b72..d2151fb7201 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Subst.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Subst.py
@@ -5,7 +5,7 @@ SCons string substitution.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ SCons string substitution.
# 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__ = "src/engine/SCons/Subst.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Subst.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import collections
import re
@@ -86,6 +86,9 @@ class Literal(object):
def __neq__(self, other):
return not self.__eq__(other)
+ def __hash__(self):
+ return hash(self.lstr)
+
class SpecialAttrWrapper(object):
"""This is a wrapper for what we call a 'Node special attribute.'
This is any of the attributes of a Node that we can reference from
@@ -338,24 +341,31 @@ SUBST_RAW = 1
SUBST_SIG = 2
_rm = re.compile(r'\$[()]')
-_remove = re.compile(r'\$\([^\$]*(\$[^\)][^\$]*)*\$\)')
+
+# Note the pattern below only matches $( or $) when there is no
+# preceeding $. (Thus the (?<!\$))
+_rm_split = re.compile(r'(?<!\$)(\$[()])')
# Indexed by the SUBST_* constants above.
-_regex_remove = [ _rm, None, _remove ]
+_regex_remove = [ _rm, None, _rm_split ]
def _rm_list(list):
return [l for l in list if not l in ('$(', '$)')]
def _remove_list(list):
result = []
- do_append = result.append
+ depth = 0
for l in list:
if l == '$(':
- do_append = lambda x: None
+ depth += 1
elif l == '$)':
- do_append = result.append
- else:
- do_append(l)
+ depth -= 1
+ if depth < 0:
+ break
+ elif depth == 0:
+ result.append(l)
+ if depth != 0:
+ return None
return result
# Indexed by the SUBST_* constants above.
@@ -433,19 +443,23 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={
if s0 != '$':
return s
if s1 == '$':
- return '$'
+ # In this case keep the double $'s which we'll later
+ # swap for a single dollar sign as we need to retain
+ # this information to properly avoid matching "$("" when
+ # the actual text was "$$("" (or "$)"" when "$$)"" )
+ return '$$'
elif s1 in '()':
return s
else:
key = s[1:]
- if key[0] == '{' or key.find('.') >= 0:
+ if key[0] == '{' or '.' in key:
if key[0] == '{':
key = key[1:-1]
try:
s = eval(key, self.gvars, lvars)
except KeyboardInterrupt:
raise
- except Exception, e:
+ except Exception as e:
if e.__class__ in AllowableExceptions:
return ''
raise_exception(e, lvars['TARGETS'], s)
@@ -562,20 +576,35 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={
except KeyError:
pass
+ res = result
if is_String(result):
# Remove $(-$) pairs and any stuff in between,
# if that's appropriate.
remove = _regex_remove[mode]
if remove:
- result = remove.sub('', result)
+ if mode == SUBST_SIG:
+ result = _list_remove[mode](remove.split(result))
+ if result is None:
+ raise SCons.Errors.UserError("Unbalanced $(/$) in: " + res)
+ result = ' '.join(result)
+ else:
+ result = remove.sub('', result)
if mode != SUBST_RAW:
# Compress strings of white space characters into
# a single space.
result = _space_sep.sub(' ', result).strip()
+
+ # Now replace escaped $'s currently "$$"
+ # This is needed because we now retain $$ instead of
+ # replacing them during substition to avoid
+ # improperly trying to escape "$$(" as being "$("
+ result = result.replace('$$','$')
elif is_Sequence(result):
remove = _list_remove[mode]
if remove:
result = remove(result)
+ if result is None:
+ raise SCons.Errors.UserError("Unbalanced $(/$) in: " + str(res))
return result
@@ -652,7 +681,7 @@ def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gv
s = eval(key, self.gvars, lvars)
except KeyboardInterrupt:
raise
- except Exception, e:
+ except Exception as e:
if e.__class__ in AllowableExceptions:
return
raise_exception(e, lvars['TARGETS'], s)
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Taskmaster.py
index 829e1fc3047..74ebfd3e360 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Taskmaster.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Taskmaster.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,17 +20,24 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__doc__ = """
-Generic Taskmaster module for the SCons build engine.
+from __future__ import print_function
-This module contains the primary interface(s) between a wrapping user
-interface and the SCons build engine. There are two key classes here:
+import sys
+__doc__ = """
+ Generic Taskmaster module for the SCons build engine.
+ =====================================================
+
+ This module contains the primary interface(s) between a wrapping user
+ interface and the SCons build engine. There are two key classes here:
+
Taskmaster
+ ----------
This is the main engine for walking the dependency graph and
calling things to decide what does or doesn't need to be built.
Task
+ ----
This is the base class for allowing a wrapping interface to
decide what does or doesn't actually need to be done. The
intention is for a wrapping interface to subclass this as
@@ -38,7 +45,7 @@ interface and the SCons build engine. There are two key classes here:
The canonical example is the SCons native Python interface,
which has Task subclasses that handle its specific behavior,
- like printing "`foo' is up to date" when a top-level target
+ like printing "'foo' is up to date" when a top-level target
doesn't need to be built, and handling the -c option by removing
targets as its "build" action. There is also a separate subclass
for suppressing this output when the -q option is used.
@@ -47,7 +54,7 @@ interface and the SCons build engine. There are two key classes here:
target(s) that it decides need to be evaluated and/or built.
"""
-__revision__ = "src/engine/SCons/Taskmaster.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Taskmaster.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from itertools import chain
import operator
@@ -107,7 +114,7 @@ fmt = "%(considered)3d "\
def dump_stats():
for n in sorted(StatsNodes, key=lambda a: str(a)):
- print (fmt % n.attributes.stats.__dict__) + str(n)
+ print((fmt % n.attributes.stats.__dict__) + str(n))
@@ -191,13 +198,13 @@ class Task(object):
executor.prepare()
for t in executor.get_action_targets():
if print_prepare:
- print "Preparing target %s..."%t
+ print("Preparing target %s..."%t)
for s in t.side_effects:
- print "...with side-effect %s..."%s
+ print("...with side-effect %s..."%s)
t.prepare()
for s in t.side_effects:
if print_prepare:
- print "...Preparing side-effect %s..."%s
+ print("...Preparing side-effect %s..."%s)
s.prepare()
def get_target(self):
@@ -256,7 +263,7 @@ class Task(object):
raise
except SCons.Errors.BuildError:
raise
- except Exception, e:
+ except Exception as e:
buildError = SCons.Errors.convert_to_BuildError(e)
buildError.node = self.targets[0]
buildError.exc_info = sys.exc_info()
@@ -305,7 +312,7 @@ class Task(object):
t.push_to_cache()
t.built()
t.visited()
- if (not print_prepare and
+ if (not print_prepare and
(not hasattr(self, 'options') or not self.options.debug_includes)):
t.release_target_info()
else:
@@ -402,7 +409,7 @@ class Task(object):
t.disambiguate().make_ready()
is_up_to_date = not t.has_builder() or \
(not t.always_build and t.is_up_to_date())
- except EnvironmentError, e:
+ except EnvironmentError as e:
raise SCons.Errors.BuildError(node=t, errstr=e.strerror, filename=e.filename)
if not is_up_to_date:
@@ -423,7 +430,7 @@ class Task(object):
# parallel build...)
t.visited()
t.set_state(NODE_UP_TO_DATE)
- if (not print_prepare and
+ if (not print_prepare and
(not hasattr(self, 'options') or not self.options.debug_includes)):
t.release_target_info()
@@ -463,14 +470,23 @@ class Task(object):
pending_children.discard(t)
for p in t.waiting_parents:
parents[p] = parents.get(p, 0) + 1
+ t.waiting_parents = set()
for t in targets:
if t.side_effects is not None:
for s in t.side_effects:
if s.get_state() == NODE_EXECUTING:
s.set_state(NODE_NO_STATE)
+
+ # The side-effects may have been transferred to
+ # NODE_NO_STATE by executed_with{,out}_callbacks, but was
+ # not taken out of the waiting parents/pending children
+ # data structures. Check for that now.
+ if s.get_state() == NODE_NO_STATE and s.waiting_parents:
+ pending_children.discard(s)
for p in s.waiting_parents:
parents[p] = parents.get(p, 0) + 1
+ s.waiting_parents = set()
for p in s.waiting_s_e:
if p.ref_count == 0:
self.tm.candidates.append(p)
@@ -537,7 +553,23 @@ class Task(object):
except ValueError:
exc_type, exc_value = exc
exc_traceback = None
- raise exc_type, exc_value, exc_traceback
+
+ # raise exc_type(exc_value).with_traceback(exc_traceback)
+ if sys.version_info[0] == 2:
+ exec("raise exc_type, exc_value, exc_traceback")
+ else: # sys.version_info[0] == 3:
+ if isinstance(exc_value, Exception): #hasattr(exc_value, 'with_traceback'):
+ # If exc_value is an exception, then just reraise
+ exec("raise exc_value.with_traceback(exc_traceback)")
+ else:
+ # else we'll create an exception using the value and raise that
+ exec("raise exc_type(exc_value).with_traceback(exc_traceback)")
+
+
+ # raise e.__class__, e.__class__(e), sys.exc_info()[2]
+ # exec("raise exc_type(exc_value).with_traceback(exc_traceback)")
+
+
class AlwaysTask(Task):
def needs_execute(self):
@@ -669,14 +701,14 @@ class Taskmaster(object):
at node A. The Taskmaster first considers whether node A's
child B is up-to-date. Then, recursively, node B needs to
check whether node C is up-to-date. This leaves us with a
- dependency graph looking like:
+ dependency graph looking like::
- Next candidate \
- \
- Node A (Pending) --> Node B(Pending) --> Node C (NoState)
- ^ |
- | |
- +-------------------------------------+
+ Next candidate \
+ \
+ Node A (Pending) --> Node B(Pending) --> Node C (NoState)
+ ^ |
+ | |
+ +-------------------------------------+
Now, when the Taskmaster examines the Node C's child Node A,
it finds that Node A is in the "pending" state. Therefore,
@@ -685,15 +717,14 @@ class Taskmaster(object):
Pending children indicate that the Taskmaster has potentially
loop back through a cycle. We say potentially because it could
also occur when a DAG is evaluated in parallel. For example,
- consider the following graph:
-
+ consider the following graph::
- Node A (Pending) --> Node B(Pending) --> Node C (Pending) --> ...
- | ^
- | |
- +----------> Node D (NoState) --------+
- /
- Next candidate /
+ Node A (Pending) --> Node B(Pending) --> Node C (Pending) --> ...
+ | ^
+ | |
+ +----------> Node D (NoState) --------+
+ /
+ Next candidate /
The Taskmaster first evaluates the nodes A, B, and C and
starts building some children of node C. Assuming, that the
@@ -761,7 +792,7 @@ class Taskmaster(object):
self.ready_exc = None
T = self.trace
- if T: T.write(u'\n' + self.trace_message('Looking for a node to evaluate'))
+ if T: T.write(SCons.Util.UnicodeType('\n') + self.trace_message('Looking for a node to evaluate'))
while True:
node = self.next_candidate()
@@ -810,7 +841,7 @@ class Taskmaster(object):
self.ready_exc = (SCons.Errors.ExplicitExit, e)
if T: T.write(self.trace_message(' SystemExit'))
return node
- except Exception, e:
+ except Exception as e:
# We had a problem just trying to figure out the
# children (like a child couldn't be linked in to a
# VariantDir, or a Scanner threw something). Arrange to
@@ -840,13 +871,13 @@ class Taskmaster(object):
if childstate <= NODE_EXECUTING:
children_not_ready.append(child)
-
# These nodes have not even been visited yet. Add
# them to the list so that on some next pass we can
# take a stab at evaluating them (or their children).
children_not_visited.reverse()
self.candidates.extend(self.order(children_not_visited))
- #if T and children_not_visited:
+
+ # if T and children_not_visited:
# T.write(self.trace_message(' adding to candidates: %s' % map(str, children_not_visited)))
# T.write(self.trace_message(' candidates now: %s\n' % map(str, self.candidates)))
@@ -943,13 +974,13 @@ class Taskmaster(object):
executor = node.get_executor()
if executor is None:
return None
-
+
tlist = executor.get_all_targets()
task = self.tasker(self, tlist, node in self.original_top, node)
try:
task.make_ready()
- except:
+ except Exception as e :
# We had a problem just trying to get this task ready (like
# a child couldn't be linked to a VariantDir when deciding
# whether this node is current). Arrange to raise the
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/386asm.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/386asm.py
index 2a87a28198a..e69debab682 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/386asm.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/386asm.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,12 +32,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/386asm.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/386asm.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Tool.PharLapCommon import addPharLapPaths
import SCons.Util
-as_module = __import__('as', globals(), locals(), [])
+as_module = __import__('as', globals(), locals(), [], 1)
def generate(env):
"""Add Builders and construction variables for ar to an Environment."""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/DCommon.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/DCommon.py
index 8738ece7270..031520c3ddf 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/DCommon.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/DCommon.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
"""SCons.Tool.DCommon
Common code for the various D tools.
@@ -5,8 +7,9 @@ Common code for the various D tools.
Coded by Russel Winder (russel@winder.org.uk)
2012-09-06
"""
+
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,10 +31,11 @@ Coded by Russel Winder (russel@winder.org.uk)
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/DCommon.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/DCommon.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
+
def isD(env, source):
if not source:
return 0
@@ -42,6 +46,7 @@ def isD(env, source):
return 1
return 0
+
def addDPATHToEnv(env, executable):
dPath = env.WhereIs(executable)
if dPath:
@@ -49,6 +54,14 @@ def addDPATHToEnv(env, executable):
if os.path.isdir(phobosDir):
env.Append(DPATH=[phobosDir])
+
+def allAtOnceEmitter(target, source, env):
+ if env['DC'] in ('ldc2', 'dmd'):
+ env.SideEffect(str(target[0]) + '.o', target[0])
+ env.Clean(target[0], str(target[0]) + '.o')
+ return target, source
+
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/FortranCommon.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/FortranCommon.py
index cf648688009..3ef730aadd4 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/FortranCommon.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/FortranCommon.py
@@ -5,7 +5,7 @@ Stuff for processing Fortran, common to all fortran dialects.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,8 +26,9 @@ Stuff for processing Fortran, common to all fortran dialects.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Tool/FortranCommon.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/FortranCommon.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import re
import os.path
@@ -61,7 +62,7 @@ def isfortran(env, source):
def _fortranEmitter(target, source, env):
node = source[0].rfile()
if not node.exists() and not node.is_derived():
- print "Could not locate " + str(node.name)
+ print("Could not locate " + str(node.name))
return ([], [])
mod_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)"""
cre = re.compile(mod_regex,re.M)
@@ -167,7 +168,7 @@ def add_fortran_to_env(env):
except KeyError:
FortranSuffixes = ['.f', '.for', '.ftn']
- #print "Adding %s to fortran suffixes" % FortranSuffixes
+ #print("Adding %s to fortran suffixes" % FortranSuffixes)
try:
FortranPPSuffixes = env['FORTRANPPFILESUFFIXES']
except KeyError:
@@ -191,7 +192,7 @@ def add_f77_to_env(env):
except KeyError:
F77Suffixes = ['.f77']
- #print "Adding %s to f77 suffixes" % F77Suffixes
+ #print("Adding %s to f77 suffixes" % F77Suffixes)
try:
F77PPSuffixes = env['F77PPFILESUFFIXES']
except KeyError:
@@ -206,7 +207,7 @@ def add_f90_to_env(env):
except KeyError:
F90Suffixes = ['.f90']
- #print "Adding %s to f90 suffixes" % F90Suffixes
+ #print("Adding %s to f90 suffixes" % F90Suffixes)
try:
F90PPSuffixes = env['F90PPFILESUFFIXES']
except KeyError:
@@ -222,7 +223,7 @@ def add_f95_to_env(env):
except KeyError:
F95Suffixes = ['.f95']
- #print "Adding %s to f95 suffixes" % F95Suffixes
+ #print("Adding %s to f95 suffixes" % F95Suffixes)
try:
F95PPSuffixes = env['F95PPFILESUFFIXES']
except KeyError:
@@ -238,7 +239,7 @@ def add_f03_to_env(env):
except KeyError:
F03Suffixes = ['.f03']
- #print "Adding %s to f95 suffixes" % F95Suffixes
+ #print("Adding %s to f95 suffixes" % F95Suffixes)
try:
F03PPSuffixes = env['F03PPFILESUFFIXES']
except KeyError:
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/GettextCommon.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/GettextCommon.py
new file mode 100644
index 00000000000..a7c5e89c324
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/GettextCommon.py
@@ -0,0 +1,469 @@
+"""SCons.Tool.GettextCommon module
+
+Used by several tools of `gettext` toolset.
+"""
+
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/GettextCommon.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+import SCons.Warnings
+import re
+
+
+#############################################################################
+class XgettextToolWarning(SCons.Warnings.Warning): pass
+
+
+class XgettextNotFound(XgettextToolWarning): pass
+
+
+class MsginitToolWarning(SCons.Warnings.Warning): pass
+
+
+class MsginitNotFound(MsginitToolWarning): pass
+
+
+class MsgmergeToolWarning(SCons.Warnings.Warning): pass
+
+
+class MsgmergeNotFound(MsgmergeToolWarning): pass
+
+
+class MsgfmtToolWarning(SCons.Warnings.Warning): pass
+
+
+class MsgfmtNotFound(MsgfmtToolWarning): pass
+
+
+#############################################################################
+SCons.Warnings.enableWarningClass(XgettextToolWarning)
+SCons.Warnings.enableWarningClass(XgettextNotFound)
+SCons.Warnings.enableWarningClass(MsginitToolWarning)
+SCons.Warnings.enableWarningClass(MsginitNotFound)
+SCons.Warnings.enableWarningClass(MsgmergeToolWarning)
+SCons.Warnings.enableWarningClass(MsgmergeNotFound)
+SCons.Warnings.enableWarningClass(MsgfmtToolWarning)
+SCons.Warnings.enableWarningClass(MsgfmtNotFound)
+
+
+#############################################################################
+
+#############################################################################
+class _POTargetFactory(object):
+ """ A factory of `PO` target files.
+
+ Factory defaults differ from these of `SCons.Node.FS.FS`. We set `precious`
+ (this is required by builders and actions gettext) and `noclean` flags by
+ default for all produced nodes.
+ """
+
+ def __init__(self, env, nodefault=True, alias=None, precious=True
+ , noclean=True):
+ """ Object constructor.
+
+ **Arguments**
+
+ - *env* (`SCons.Environment.Environment`)
+ - *nodefault* (`boolean`) - if `True`, produced nodes will be ignored
+ from default target `'.'`
+ - *alias* (`string`) - if provided, produced nodes will be automatically
+ added to this alias, and alias will be set as `AlwaysBuild`
+ - *precious* (`boolean`) - if `True`, the produced nodes will be set as
+ `Precious`.
+ - *noclen* (`boolean`) - if `True`, the produced nodes will be excluded
+ from `Clean`.
+ """
+ self.env = env
+ self.alias = alias
+ self.precious = precious
+ self.noclean = noclean
+ self.nodefault = nodefault
+
+ def _create_node(self, name, factory, directory=None, create=1):
+ """ Create node, and set it up to factory settings. """
+ import SCons.Util
+ node = factory(name, directory, create)
+ node.set_noclean(self.noclean)
+ node.set_precious(self.precious)
+ if self.nodefault:
+ self.env.Ignore('.', node)
+ if self.alias:
+ self.env.AlwaysBuild(self.env.Alias(self.alias, node))
+ return node
+
+ def Entry(self, name, directory=None, create=1):
+ """ Create `SCons.Node.FS.Entry` """
+ return self._create_node(name, self.env.fs.Entry, directory, create)
+
+ def File(self, name, directory=None, create=1):
+ """ Create `SCons.Node.FS.File` """
+ return self._create_node(name, self.env.fs.File, directory, create)
+
+
+#############################################################################
+
+#############################################################################
+_re_comment = re.compile(r'(#[^\n\r]+)$', re.M)
+_re_lang = re.compile(r'([a-zA-Z0-9_]+)', re.M)
+
+
+#############################################################################
+def _read_linguas_from_files(env, linguas_files=None):
+ """ Parse `LINGUAS` file and return list of extracted languages """
+ import SCons.Util
+ import SCons.Environment
+ global _re_comment
+ global _re_lang
+ if not SCons.Util.is_List(linguas_files) \
+ and not SCons.Util.is_String(linguas_files) \
+ and not isinstance(linguas_files, SCons.Node.FS.Base) \
+ and linguas_files:
+ # If, linguas_files==True or such, then read 'LINGUAS' file.
+ linguas_files = ['LINGUAS']
+ if linguas_files is None:
+ return []
+ fnodes = env.arg2nodes(linguas_files)
+ linguas = []
+ for fnode in fnodes:
+ contents = _re_comment.sub("", fnode.get_text_contents())
+ ls = [l for l in _re_lang.findall(contents) if l]
+ linguas.extend(ls)
+ return linguas
+
+
+#############################################################################
+
+#############################################################################
+from SCons.Builder import BuilderBase
+
+
+#############################################################################
+class _POFileBuilder(BuilderBase):
+ """ `PO` file builder.
+
+ This is multi-target single-source builder. In typical situation the source
+ is single `POT` file, e.g. `messages.pot`, and there are multiple `PO`
+ targets to be updated from this `POT`. We must run
+ `SCons.Builder.BuilderBase._execute()` separatelly for each target to track
+ dependencies separatelly for each target file.
+
+ **NOTE**: if we call `SCons.Builder.BuilderBase._execute(.., target, ...)`
+ with target being list of all targets, all targets would be rebuilt each time
+ one of the targets from this list is missing. This would happen, for example,
+ when new language `ll` enters `LINGUAS_FILE` (at this moment there is no
+ `ll.po` file yet). To avoid this, we override
+ `SCons.Builder.BuilerBase._execute()` and call it separatelly for each
+ target. Here we also append to the target list the languages read from
+ `LINGUAS_FILE`.
+ """
+
+ #
+ # * The argument for overriding _execute(): We must use environment with
+ # builder overrides applied (see BuilderBase.__init__(). Here it comes for
+ # free.
+ # * The argument against using 'emitter': The emitter is called too late
+ # by BuilderBase._execute(). If user calls, for example:
+ #
+ # env.POUpdate(LINGUAS_FILE = 'LINGUAS')
+ #
+ # the builder throws error, because it is called with target=None,
+ # source=None and is trying to "generate" sources or target list first.
+ # If user calls
+ #
+ # env.POUpdate(['foo', 'baz'], LINGUAS_FILE = 'LINGUAS')
+ #
+ # the env.BuilderWrapper() calls our builder with target=None,
+ # source=['foo', 'baz']. The BuilderBase._execute() then splits execution
+ # and execute iterativelly (recursion) self._execute(None, source[i]).
+ # After that it calls emitter (which is quite too late). The emitter is
+ # also called in each iteration, what makes things yet worse.
+ def __init__(self, env, **kw):
+ if not 'suffix' in kw:
+ kw['suffix'] = '$POSUFFIX'
+ if not 'src_suffix' in kw:
+ kw['src_suffix'] = '$POTSUFFIX'
+ if not 'src_builder' in kw:
+ kw['src_builder'] = '_POTUpdateBuilder'
+ if not 'single_source' in kw:
+ kw['single_source'] = True
+ alias = None
+ if 'target_alias' in kw:
+ alias = kw['target_alias']
+ del kw['target_alias']
+ if not 'target_factory' in kw:
+ kw['target_factory'] = _POTargetFactory(env, alias=alias).File
+ BuilderBase.__init__(self, **kw)
+
+ def _execute(self, env, target, source, *args, **kw):
+ """ Execute builder's actions.
+
+ Here we append to `target` the languages read from `$LINGUAS_FILE` and
+ apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.
+ The arguments and return value are same as for
+ `SCons.Builder.BuilderBase._execute()`.
+ """
+ import SCons.Util
+ import SCons.Node
+ linguas_files = None
+ if 'LINGUAS_FILE' in env and env['LINGUAS_FILE']:
+ linguas_files = env['LINGUAS_FILE']
+ # This prevents endless recursion loop (we'll be invoked once for
+ # each target appended here, we must not extend the list again).
+ env['LINGUAS_FILE'] = None
+ linguas = _read_linguas_from_files(env, linguas_files)
+ if SCons.Util.is_List(target):
+ target.extend(linguas)
+ elif target is not None:
+ target = [target] + linguas
+ else:
+ target = linguas
+ if not target:
+ # Let the SCons.BuilderBase to handle this patologic situation
+ return BuilderBase._execute(self, env, target, source, *args, **kw)
+ # The rest is ours
+ if not SCons.Util.is_List(target):
+ target = [target]
+ result = []
+ for tgt in target:
+ r = BuilderBase._execute(self, env, [tgt], source, *args, **kw)
+ result.extend(r)
+ if linguas_files is not None:
+ env['LINGUAS_FILE'] = linguas_files
+ return SCons.Node.NodeList(result)
+
+
+#############################################################################
+
+import SCons.Environment
+
+
+#############################################################################
+def _translate(env, target=None, source=SCons.Environment._null, *args, **kw):
+ """ Function for `Translate()` pseudo-builder """
+ if target is None: target = []
+ pot = env.POTUpdate(None, source, *args, **kw)
+ po = env.POUpdate(target, pot, *args, **kw)
+ return po
+
+
+#############################################################################
+
+#############################################################################
+class RPaths(object):
+ """ Callable object, which returns pathnames relative to SCons current
+ working directory.
+
+ It seems like `SCons.Node.FS.Base.get_path()` returns absolute paths
+ for nodes that are outside of current working directory (`env.fs.getcwd()`).
+ Here, we often have `SConscript`, `POT` and `PO` files within `po/`
+ directory and source files (e.g. `*.c`) outside of it. When generating `POT`
+ template file, references to source files are written to `POT` template, so
+ a translator may later quickly jump to appropriate source file and line from
+ its `PO` editor (e.g. `poedit`). Relative paths in `PO` file are usually
+ interpreted by `PO` editor as paths relative to the place, where `PO` file
+ lives. The absolute paths would make resultant `POT` file nonportable, as
+ the references would be correct only on the machine, where `POT` file was
+ recently re-created. For such reason, we need a function, which always
+ returns relative paths. This is the purpose of `RPaths` callable object.
+
+ The `__call__` method returns paths relative to current working directory, but
+ we assume, that *xgettext(1)* is run from the directory, where target file is
+ going to be created.
+
+ Note, that this may not work for files distributed over several hosts or
+ across different drives on windows. We assume here, that single local
+ filesystem holds both source files and target `POT` templates.
+
+ Intended use of `RPaths` - in `xgettext.py`::
+
+ def generate(env):
+ from GettextCommon import RPaths
+ ...
+ sources = '$( ${_concat( "", SOURCES, "", __env__, XgettextRPaths, TARGET, SOURCES)} $)'
+ env.Append(
+ ...
+ XGETTEXTCOM = 'XGETTEXT ... ' + sources,
+ ...
+ XgettextRPaths = RPaths(env)
+ )
+ """
+
+ # NOTE: This callable object returns pathnames of dirs/files relative to
+ # current working directory. The pathname remains relative also for entries
+ # that are outside of current working directory (node, that
+ # SCons.Node.FS.File and siblings return absolute path in such case). For
+ # simplicity we compute path relative to current working directory, this
+ # seems be enough for our purposes (don't need TARGET variable and
+ # SCons.Defaults.Variable_Caller stuff).
+
+ def __init__(self, env):
+ """ Initialize `RPaths` callable object.
+
+ **Arguments**:
+
+ - *env* - a `SCons.Environment.Environment` object, defines *current
+ working dir*.
+ """
+ self.env = env
+
+ # FIXME: I'm not sure, how it should be implemented (what the *args are in
+ # general, what is **kw).
+ def __call__(self, nodes, *args, **kw):
+ """ Return nodes' paths (strings) relative to current working directory.
+
+ **Arguments**:
+
+ - *nodes* ([`SCons.Node.FS.Base`]) - list of nodes.
+ - *args* - currently unused.
+ - *kw* - currently unused.
+
+ **Returns**:
+
+ - Tuple of strings, which represent paths relative to current working
+ directory (for given environment).
+ """
+ import os
+ import SCons.Node.FS
+ rpaths = ()
+ cwd = self.env.fs.getcwd().get_abspath()
+ for node in nodes:
+ rpath = None
+ if isinstance(node, SCons.Node.FS.Base):
+ rpath = os.path.relpath(node.get_abspath(), cwd)
+ # FIXME: Other types possible here?
+ if rpath is not None:
+ rpaths += (rpath,)
+ return rpaths
+
+
+#############################################################################
+
+#############################################################################
+def _init_po_files(target, source, env):
+ """ Action function for `POInit` builder. """
+ nop = lambda target, source, env: 0
+ if 'POAUTOINIT' in env:
+ autoinit = env['POAUTOINIT']
+ else:
+ autoinit = False
+ # Well, if everything outside works well, this loop should do single
+ # iteration. Otherwise we are rebuilding all the targets even, if just
+ # one has changed (but is this our fault?).
+ for tgt in target:
+ if not tgt.exists():
+ if autoinit:
+ action = SCons.Action.Action('$MSGINITCOM', '$MSGINITCOMSTR')
+ else:
+ msg = 'File ' + repr(str(tgt)) + ' does not exist. ' \
+ + 'If you are a translator, you can create it through: \n' \
+ + '$MSGINITCOM'
+ action = SCons.Action.Action(nop, msg)
+ status = action([tgt], source, env)
+ if status: return status
+ return 0
+
+
+#############################################################################
+
+#############################################################################
+def _detect_xgettext(env):
+ """ Detects *xgettext(1)* binary """
+ if 'XGETTEXT' in env:
+ return env['XGETTEXT']
+ xgettext = env.Detect('xgettext')
+ if xgettext:
+ return xgettext
+ raise SCons.Errors.StopError(XgettextNotFound, "Could not detect xgettext")
+ return None
+
+
+#############################################################################
+def _xgettext_exists(env):
+ return _detect_xgettext(env)
+
+
+#############################################################################
+
+#############################################################################
+def _detect_msginit(env):
+ """ Detects *msginit(1)* program. """
+ if 'MSGINIT' in env:
+ return env['MSGINIT']
+ msginit = env.Detect('msginit')
+ if msginit:
+ return msginit
+ raise SCons.Errors.StopError(MsginitNotFound, "Could not detect msginit")
+ return None
+
+
+#############################################################################
+def _msginit_exists(env):
+ return _detect_msginit(env)
+
+
+#############################################################################
+
+#############################################################################
+def _detect_msgmerge(env):
+ """ Detects *msgmerge(1)* program. """
+ if 'MSGMERGE' in env:
+ return env['MSGMERGE']
+ msgmerge = env.Detect('msgmerge')
+ if msgmerge:
+ return msgmerge
+ raise SCons.Errors.StopError(MsgmergeNotFound, "Could not detect msgmerge")
+ return None
+
+
+#############################################################################
+def _msgmerge_exists(env):
+ return _detect_msgmerge(env)
+
+
+#############################################################################
+
+#############################################################################
+def _detect_msgfmt(env):
+ """ Detects *msgmfmt(1)* program. """
+ if 'MSGFMT' in env:
+ return env['MSGFMT']
+ msgfmt = env.Detect('msgfmt')
+ if msgfmt:
+ return msgfmt
+ raise SCons.Errors.StopError(MsgfmtNotFound, "Could not detect msgfmt")
+ return None
+
+
+#############################################################################
+def _msgfmt_exists(env):
+ return _detect_msgfmt(env)
+
+
+#############################################################################
+
+#############################################################################
+def tool_list(platform, env):
+ """ List tools that shall be generated by top-level `gettext` tool """
+ return ['xgettext', 'msginit', 'msgmerge', 'msgfmt']
+
+#############################################################################
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/JavaCommon.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/JavaCommon.py
index 26be530274f..ad18b906bfb 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/JavaCommon.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/JavaCommon.py
@@ -5,7 +5,7 @@ Stuff for processing Java.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,16 +27,21 @@ Stuff for processing Java.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/JavaCommon.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/JavaCommon.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
import re
+import glob
java_parsing = 1
default_java_version = '1.4'
+# a switch for which jdk versions to use the Scope state for smarter
+# anonymous inner class parsing.
+scopeStateVersions = ('1.8')
+
if java_parsing:
# Parse Java files for class names.
#
@@ -64,8 +69,9 @@ if java_parsing:
interfaces, and anonymous inner classes."""
def __init__(self, version=default_java_version):
- if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6', '1.7',
- '1.8', '5', '6'):
+ if not version in ('1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7',
+ '1.8', '5', '6', '9.0', '10.0', '11.0'):
+
msg = "Java version %s not supported" % version
raise NotImplementedError(msg)
@@ -115,8 +121,8 @@ if java_parsing:
ret = SkipState(1, self)
self.skipState = ret
return ret
-
- def __getAnonStack(self):
+
+ def _getAnonStack(self):
return self.anonStacksStack[-1]
def openBracket(self):
@@ -125,15 +131,16 @@ if java_parsing:
def closeBracket(self):
self.brackets = self.brackets - 1
if len(self.stackBrackets) and \
- self.brackets == self.stackBrackets[-1]:
+ self.brackets == self.stackBrackets[-1]:
self.listOutputs.append('$'.join(self.listClasses))
self.localClasses.pop()
self.listClasses.pop()
self.anonStacksStack.pop()
self.stackBrackets.pop()
if len(self.stackAnonClassBrackets) and \
- self.brackets == self.stackAnonClassBrackets[-1]:
- self.__getAnonStack().pop()
+ self.brackets == self.stackAnonClassBrackets[-1] and \
+ self.version not in scopeStateVersions:
+ self._getAnonStack().pop()
self.stackAnonClassBrackets.pop()
def parseToken(self, token):
@@ -171,21 +178,87 @@ if java_parsing:
if self.version in ('1.1', '1.2', '1.3', '1.4'):
clazz = self.listClasses[0]
self.listOutputs.append('%s$%d' % (clazz, self.nextAnon))
- elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6'):
+ elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6', '9.0', '10.0', '11.0'):
self.stackAnonClassBrackets.append(self.brackets)
className = []
className.extend(self.listClasses)
- self.__getAnonStack()[-1] = self.__getAnonStack()[-1] + 1
- for anon in self.__getAnonStack():
+ self._getAnonStack()[-1] = self._getAnonStack()[-1] + 1
+ for anon in self._getAnonStack():
className.append(str(anon))
self.listOutputs.append('$'.join(className))
self.nextAnon = self.nextAnon + 1
- self.__getAnonStack().append(0)
+ self._getAnonStack().append(0)
def setPackage(self, package):
self.package = package
+ class ScopeState(object):
+ """
+ A state that parses code within a scope normally,
+ within the confines of a scope.
+ """
+ def __init__(self, old_state):
+ self.outer_state = old_state.outer_state
+ self.old_state = old_state
+ self.brackets = 0
+
+ def __getClassState(self):
+ try:
+ return self.classState
+ except AttributeError:
+ ret = ClassState(self)
+ self.classState = ret
+ return ret
+
+ def __getAnonClassState(self):
+ try:
+ return self.anonState
+ except AttributeError:
+ ret = SkipState(1, AnonClassState(self))
+ self.anonState = ret
+ return ret
+
+ def __getSkipState(self):
+ try:
+ return self.skipState
+ except AttributeError:
+ ret = SkipState(1, self)
+ self.skipState = ret
+ return ret
+
+ def openBracket(self):
+ self.brackets = self.brackets + 1
+
+ def closeBracket(self):
+ self.brackets = self.brackets - 1
+
+ def parseToken(self, token):
+ # if self.brackets == 0:
+ # return self.old_state.parseToken(token)
+ if token[:2] == '//':
+ return IgnoreState('\n', self)
+ elif token == '/*':
+ return IgnoreState('*/', self)
+ elif token == '{':
+ self.openBracket()
+ elif token == '}':
+ self.closeBracket()
+ if self.brackets == 0:
+ self.outer_state._getAnonStack().pop()
+ return self.old_state
+ elif token in ['"', "'"]:
+ return IgnoreState(token, self)
+ elif token == "new":
+ # anonymous inner class
+ return self.__getAnonClassState()
+ elif token == '.':
+ # Skip the attribute, it might be named "class", in which
+ # case we don't want to treat the following token as
+ # an inner class name...
+ return self.__getSkipState()
+ return self
+
class AnonClassState(object):
"""A state that looks for anonymous inner classes."""
def __init__(self, old_state):
@@ -212,13 +285,15 @@ if java_parsing:
if token == 'new':
# look further for anonymous inner class
return SkipState(1, AnonClassState(self))
- elif token in [ '"', "'" ]:
+ elif token in ['"', "'"]:
return IgnoreState(token, self)
elif token == ')':
self.brace_level = self.brace_level - 1
return self
if token == '{':
self.outer_state.addAnonClass()
+ if self.outer_state.version in scopeStateVersions:
+ return ScopeState(old_state = self.old_state).parseToken(token)
return self.old_state.parseToken(token)
class SkipState(object):
@@ -245,10 +320,10 @@ if java_parsing:
# If that's an inner class which is declared in a method, it
# requires an index prepended to the class-name, e.g.
# 'Foo$1Inner'
- # http://scons.tigris.org/issues/show_bug.cgi?id=2087
+ # https://github.com/SCons/scons/issues/2087
if self.outer_state.localClasses and \
- self.outer_state.stackBrackets[-1] > \
- self.outer_state.stackBrackets[-2]+1:
+ self.outer_state.stackBrackets[-1] > \
+ self.outer_state.stackBrackets[-2]+1:
locals = self.outer_state.localClasses[-1]
try:
idx = locals[token]
@@ -315,7 +390,84 @@ else:
is that the file name matches the public class name, and that
the path to the file is the same as the package name.
"""
- return os.path.split(file)
+ return os.path.split(fn)
+
+
+
+java_win32_version_dir_glob = 'C:/Program Files*/Java/jdk%s*/bin'
+java_win32_dir_glob = 'C:/Program Files*/Java/jdk*/bin'
+
+java_macos_include_dir = '/System/Library/Frameworks/JavaVM.framework/Headers/'
+java_macos_version_include_dir = '/System/Library/Frameworks/JavaVM.framework/Versions/%s*/Headers/'
+
+java_linux_include_dirs = ['/usr/lib/jvm/default-java/include',
+ '/usr/lib/jvm/java-*/include']
+# Need to match path like below (from Centos 7)
+# /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/include/
+java_linux_version_include_dirs = ['/usr/lib/jvm/java-*-sun-%s*/include',
+ '/usr/lib/jvm/java-%s*-openjdk*/include',
+ '/usr/java/jdk%s*/include']
+
+
+
+def get_java_install_dirs(platform, version=None):
+ """
+ Using patterns above find the java jdk install dir
+ :param platform:
+ :param version: If specified, only look for java sdk's of this version
+ :return: list of default paths for java.
+ """
+ paths = []
+ if platform == 'win32':
+ if version:
+ paths = glob.glob(java_win32_version_dir_glob%version)
+ else:
+ paths = glob.glob(java_win32_dir_glob)
+ else:
+ # do nothing for now
+ pass
+
+ paths=sorted(paths)
+
+ return paths
+
+def get_java_include_paths(env, javac, version):
+ """
+ Return java include paths
+ :param platform:
+ :param javac:
+ :return:
+ """
+ paths = []
+ if not javac:
+ # there are no paths if we've not detected javac.
+ pass
+ elif env['PLATFORM'] == 'win32':
+ javac_bin_dir = os.path.dirname(javac)
+ java_inc_dir = os.path.normpath(os.path.join(javac_bin_dir, '..', 'include'))
+ paths = [java_inc_dir, os.path.join(java_inc_dir, 'win32')]
+ elif env['PLATFORM'] == 'darwin':
+ if not version:
+ paths = [java_macos_include_dir]
+ else:
+ paths = sorted(glob.glob(java_macos_version_include_dir%version))
+ else:
+ base_paths=[]
+ if not version:
+ for p in java_linux_include_dirs:
+ base_paths.extend(glob.glob(p))
+ else:
+ for p in java_linux_version_include_dirs:
+ base_paths.extend(glob.glob(p%version))
+
+ for p in base_paths:
+ paths.extend([p, os.path.join(p,'linux')])
+
+ #print("PATHS:%s"%paths)
+ return paths
+
+
+
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/__init__.py
index 615ea8cbff8..d617aa7053b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """
Common functions for Microsoft Visual Studio and Visual C/C++.
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/arch.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/arch.py
index 1cf3b41d8a4..ae0b241261f 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/arch.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/arch.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """Module to define supported Windows chip architectures.
"""
@@ -37,22 +37,22 @@ class ArchDefinition(object):
self.synonyms = synonyms
SupportedArchitectureList = [
- ArchitectureDefinition(
+ ArchDefinition(
'x86',
['i386', 'i486', 'i586', 'i686'],
),
- ArchitectureDefinition(
+ ArchDefinition(
'x86_64',
['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'],
),
- ArchitectureDefinition(
+ ArchDefinition(
'ia64',
['IA64'],
),
- ArchitectureDefinition(
+ ArchDefinition(
'arm',
['ARM'],
),
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/common.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/common.py
index 4d52104a40c..a4bd7b301c0 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/common.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/common.py
@@ -2,7 +2,7 @@
Common helper functions for working with the Microsoft tool chain.
"""
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -25,7 +25,7 @@ Common helper functions for working with the Microsoft tool chain.
#
from __future__ import print_function
-__revision__ = "src/engine/SCons/Tool/MSCommon/common.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/common.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import copy
import os
@@ -46,7 +46,7 @@ elif LOGFILE:
debug = lambda message: open(LOGFILE, 'a').write(message + '\n')
else:
logging.basicConfig(filename=LOGFILE, level=logging.DEBUG)
- debug = logging.debug
+ debug = logging.getLogger(name=__name__).debug
else:
debug = lambda x: None
@@ -206,7 +206,7 @@ def get_output(vcbat, args = None, env = None):
output = stdout.decode("mbcs")
return output
-def parse_output(output, keep=("INCLUDE", "LIB", "LIBPATH", "PATH")):
+def parse_output(output, keep=("INCLUDE", "LIB", "LIBPATH", "PATH", 'VSCMD_ARG_app_plat')):
"""
Parse output from running visual c++/studios vcvarsall.bat and running set
To capture the values listed in keep
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/netframework.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/netframework.py
index 64b9417d8f8..20d3aa2166d 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/netframework.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/netframework.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +20,7 @@
# 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__ = "src/engine/SCons/Tool/MSCommon/netframework.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """
"""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/sdk.py
index ca3a9ff372f..0aac856ce3b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/sdk.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """Module to detect the Platform/Windows SDK
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/vc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/vc.py
index 4139ee34a4f..73d12959c73 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/vc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/vc.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@
# * test on 64 bits XP + VS 2005 (and VS 6 if possible)
# * SDK
# * Assembly
-__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """Module for Visual C/C++ detection and configuration.
"""
@@ -43,6 +43,7 @@ import platform
from string import digits as string_digits
import SCons.Warnings
+from SCons.Tool import find_program_path
from . import common
@@ -79,15 +80,43 @@ _ARCH_TO_CANONICAL = {
"i486" : "x86",
"i586" : "x86",
"i686" : "x86",
- "ia64" : "ia64",
- "itanium" : "ia64",
+ "ia64" : "ia64", # deprecated
+ "itanium" : "ia64", # deprecated
"x86" : "x86",
"x86_64" : "amd64",
- "x86_amd64" : "x86_amd64", # Cross compile to 64 bit from 32bits
+ "arm" : "arm",
+ "arm64" : "arm64",
+ "aarch64" : "arm64",
+}
+
+# get path to the cl.exe dir for newer VS versions
+# based off a tuple of (host, target) platforms
+_HOST_TARGET_TO_CL_DIR_GREATER_THAN_14 = {
+ ("amd64","amd64") : "Hostx64\\x64",
+ ("amd64","x86") : "Hostx64\\x86",
+ ("amd64","arm") : "Hostx64\\arm",
+ ("amd64","arm64") : "Hostx64\\arm64",
+ ("x86","amd64") : "Hostx86\\x64",
+ ("x86","x86") : "Hostx86\\x86",
+ ("x86","arm") : "Hostx86\\arm",
+ ("x86","arm64") : "Hostx86\\arm64",
+}
+
+# get path to the cl.exe dir for older VS versions
+# based off a tuple of (host, target) platforms
+_HOST_TARGET_TO_CL_DIR = {
+ ("amd64","amd64") : "amd64",
+ ("amd64","x86") : "amd64_x86",
+ ("amd64","arm") : "amd64_arm",
+ ("amd64","arm64") : "amd64_arm64",
+ ("x86","amd64") : "x86_amd64",
+ ("x86","x86") : "",
+ ("x86","arm") : "x86_arm",
+ ("x86","arm64") : "x86_arm64",
}
-# Given a (host, target) tuple, return the argument for the bat file. Both host
-# and targets should be canonalized.
+# Given a (host, target) tuple, return the argument for the bat file.
+# Both host and targets should be canonalized.
_HOST_TARGET_ARCH_TO_BAT_ARCH = {
("x86", "x86"): "x86",
("x86", "amd64"): "x86_amd64",
@@ -95,9 +124,32 @@ _HOST_TARGET_ARCH_TO_BAT_ARCH = {
("amd64", "x86_amd64"): "x86_amd64", # This is present in (at least) VS2012 express
("amd64", "amd64"): "amd64",
("amd64", "x86"): "x86",
- ("x86", "ia64"): "x86_ia64"
+ ("x86", "ia64"): "x86_ia64", # gone since 14.0
+ ("arm", "arm"): "arm", # since 14.0, maybe gone 14.1?
+ ("x86", "arm"): "x86_arm", # since 14.0
+ ("x86", "arm64"): "x86_arm64", # since 14.1
+ ("amd64", "arm"): "amd64_arm", # since 14.0
+ ("amd64", "arm64"): "amd64_arm64", # since 14.1
}
+_CL_EXE_NAME = 'cl.exe'
+
+def get_msvc_version_numeric(msvc_version):
+ """Get the raw version numbers from a MSVC_VERSION string, so it
+ could be cast to float or other numeric values. For example, '14.0Exp'
+ would get converted to '14.0'.
+
+ Args:
+ msvc_version: str
+ string representing the version number, could contain non
+ digit characters
+
+ Returns:
+ str: the value converted to a numeric only string
+
+ """
+ return ''.join([x for x in msvc_version if x in string_digits + '.'])
+
def get_host_target(env):
debug('vc.py:get_host_target()')
@@ -188,7 +240,7 @@ _VCVER_TO_PRODUCT_DIR = {
}
def msvc_version_to_maj_min(msvc_version):
- msvc_version_numeric = ''.join([x for x in msvc_version if x in string_digits + '.'])
+ msvc_version_numeric = get_msvc_version_numeric(msvc_version)
t = msvc_version_numeric.split(".")
if not len(t) == 2:
@@ -201,21 +253,21 @@ def msvc_version_to_maj_min(msvc_version):
raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric))
def is_host_target_supported(host_target, msvc_version):
- """Return True if the given (host, target) tuple is supported given the
- msvc version.
-
- Parameters
- ----------
- host_target: tuple
- tuple of (canonalized) host-target, e.g. ("x86", "amd64") for cross
- compilation from 32 bits windows to 64 bits.
- msvc_version: str
- msvc version (major.minor, e.g. 10.0)
-
- Note
- ----
- This only check whether a given version *may* support the given (host,
- target), not that the toolchain is actually present on the machine.
+ """Check if the given (host, target) tuple is supported for given version.
+
+ Args:
+ host_target: tuple
+ tuple of (canonalized) host-targets, e.g. ("x86", "amd64")
+ for cross compilation from 32 bit Windows to 64 bits.
+ msvc_version: str
+ msvc version (major.minor, e.g. 10.0)
+
+ Returns:
+ bool:
+
+ Note:
+ This only checks whether a given version *may* support the given (host,
+ target), not that the toolchain is actually present on the machine.
"""
# We assume that any Visual Studio version supports x86 as a target
if host_target[1] != "x86":
@@ -228,10 +280,11 @@ def is_host_target_supported(host_target, msvc_version):
def find_vc_pdir_vswhere(msvc_version):
"""
- Find the MSVC product directory using vswhere.exe .
+ Find the MSVC product directory using vswhere.exe.
+
Run it asking for specified version and get MSVS install location
:param msvc_version:
- :return: MSVC install dir
+ :return: MSVC install dir or None
"""
vswhere_path = os.path.join(
'C:\\',
@@ -240,14 +293,17 @@ def find_vc_pdir_vswhere(msvc_version):
'Installer',
'vswhere.exe'
)
- vswhere_cmd = [vswhere_path, '-version', msvc_version, '-property', 'installationPath']
+ vswhere_cmd = [vswhere_path, '-products', '*', '-version', msvc_version, '-property', 'installationPath']
if os.path.exists(vswhere_path):
sp = subprocess.Popen(vswhere_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
vsdir, err = sp.communicate()
- vsdir = vsdir.decode("mbcs")
- vsdir = vsdir.rstrip()
- vc_pdir = os.path.join(vsdir, 'VC')
+ vsdir = vsdir.decode("mbcs").splitlines()
+ # vswhere could easily return multiple lines
+ # we could define a way to pick the one we prefer, but since
+ # this data is currently only used to make a check for existence,
+ # returning the first hit should be good enough for now.
+ vc_pdir = os.path.join(vsdir[0], 'VC')
return vc_pdir
else:
# No vswhere on system, no install info available
@@ -255,13 +311,25 @@ def find_vc_pdir_vswhere(msvc_version):
def find_vc_pdir(msvc_version):
- """Try to find the product directory for the given
- version.
+ """Find the product directory for the given version.
+
+ Tries to look up the path using a registry key from the table
+ _VCVER_TO_PRODUCT_DIR; if there is no key, calls find_vc_pdir_wshere
+ for help instead.
+
+ Args:
+ msvc_version: str
+ msvc version (major.minor, e.g. 10.0)
+
+ Returns:
+ str: Path found in registry, or None
+
+ Raises:
+ UnsupportedVersion: if the version is not known by this file.
+ MissingConfiguration: found version but the directory is missing.
- Note
- ----
- If for some reason the requested version could not be found, an
- exception which inherits from VisualCException will be raised."""
+ Both exceptions inherit from VisualCException.
+ """
root = 'Software\\'
try:
hkeys = _VCVER_TO_PRODUCT_DIR[msvc_version]
@@ -275,8 +343,10 @@ def find_vc_pdir(msvc_version):
if not key:
comps = find_vc_pdir_vswhere(msvc_version)
if not comps:
- debug('find_vc_dir(): no VC found via vswhere for version {}'.format(repr(key)))
+ debug('find_vc_pdir_vswhere(): no VC found for version {}'.format(repr(msvc_version)))
raise SCons.Util.WinError
+ debug('find_vc_pdir_vswhere(): VC found: {}'.format(repr(msvc_version)))
+ return comps
else:
if common.is_win64():
try:
@@ -308,10 +378,10 @@ def find_batch_file(env,msvc_version,host_arch,target_arch):
if pdir is None:
raise NoVersionFound("No version of Visual Studio found")
- debug('vc.py: find_batch_file() pdir:{}'.format(pdir))
+ debug('vc.py: find_batch_file() in {}'.format(pdir))
# filter out e.g. "Exp" from the version name
- msvc_ver_numeric = ''.join([x for x in msvc_version if x in string_digits + "."])
+ msvc_ver_numeric = get_msvc_version_numeric(msvc_version)
vernum = float(msvc_ver_numeric)
if 7 <= vernum < 8:
pdir = os.path.join(pdir, os.pardir, "Common7", "Tools")
@@ -343,23 +413,132 @@ def find_batch_file(env,msvc_version,host_arch,target_arch):
__INSTALLED_VCS_RUN = None
-def cached_get_installed_vcs():
+def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version):
+ """Find the cl.exe on the filesystem in the vc_dir depending on
+ TARGET_ARCH, HOST_ARCH and the msvc version. TARGET_ARCH and
+ HOST_ARCH can be extracted from the passed env, unless its None,
+ which then the native platform is assumed the host and target.
+
+ Args:
+ env: Environment
+ a construction environment, usually if this is passed its
+ because there is a desired TARGET_ARCH to be used when searching
+ for a cl.exe
+ vc_dir: str
+ the path to the VC dir in the MSVC installation
+ msvc_version: str
+ msvc version (major.minor, e.g. 10.0)
+
+ Returns:
+ bool:
+
+ """
+
+ # determine if there is a specific target platform we want to build for and
+ # use that to find a list of valid VCs, default is host platform == target platform
+ # and same for if no env is specified to extract target platform from
+ if env:
+ (host_platform, target_platform, req_target_platform) = get_host_target(env)
+ else:
+ host_platform = platform.machine().lower()
+ target_platform = host_platform
+
+ host_platform = _ARCH_TO_CANONICAL[host_platform]
+ target_platform = _ARCH_TO_CANONICAL[target_platform]
+
+ debug('_check_cl_exists_in_vc_dir(): host platform %s, target platform %s' % (host_platform, target_platform))
+
+ ver_num = float(get_msvc_version_numeric(msvc_version))
+
+ # make sure the cl.exe exists meaning the tool is installed
+ if ver_num > 14:
+ # 2017 and newer allowed multiple versions of the VC toolset to be installed at the same time.
+ # Just get the default tool version for now
+ #TODO: support setting a specific minor VC version
+ default_toolset_file = os.path.join(vc_dir, r'Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')
+ try:
+ with open(default_toolset_file) as f:
+ vc_specific_version = f.readlines()[0].strip()
+ except IOError:
+ debug('_check_cl_exists_in_vc_dir(): failed to read ' + default_toolset_file)
+ return False
+ except IndexError:
+ debug('_check_cl_exists_in_vc_dir(): failed to find MSVC version in ' + default_toolset_file)
+ return False
+
+ host_trgt_dir = _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14.get((host_platform, target_platform), None)
+ if not host_trgt_dir:
+ debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo')
+ return False
+
+ cl_path = os.path.join(vc_dir, r'Tools\MSVC', vc_specific_version, 'bin', host_trgt_dir, _CL_EXE_NAME)
+ debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path)
+ if os.path.exists(cl_path):
+ debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!')
+ return True
+
+ elif ver_num <= 14 and ver_num >= 8:
+
+ host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None)
+ if not host_trgt_dir:
+ debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo')
+ return False
+
+ cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME)
+ debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path)
+
+ cl_path_exists = os.path.exists(cl_path)
+ if not cl_path_exists and host_platform == 'amd64':
+ # older versions of visual studio only had x86 binaries,
+ # so if the host platform is amd64, we need to check cross
+ # compile options (x86 binary compiles some other target on a 64 bit os)
+ host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None)
+ if not host_trgt_dir:
+ return False
+
+ cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME)
+ debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path)
+ cl_path_exists = os.path.exists(cl_path)
+
+ if cl_path_exists:
+ debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!')
+ return True
+
+ elif ver_num < 8 and ver_num >= 6:
+ # not sure about these versions so if a walk the VC dir (could be slow)
+ for root, _, files in os.walk(vc_dir):
+ if _CL_EXE_NAME in files:
+ debug('get_installed_vcs ' + _CL_EXE_NAME + ' found %s' % os.path.join(root, _CL_EXE_NAME))
+ return True
+ return False
+ else:
+ # version not support return false
+ debug('_check_cl_exists_in_vc_dir(): unsupported MSVC version: ' + str(ver_num))
+
+ return False
+
+def cached_get_installed_vcs(env=None):
global __INSTALLED_VCS_RUN
if __INSTALLED_VCS_RUN is None:
- ret = get_installed_vcs()
+ ret = get_installed_vcs(env)
__INSTALLED_VCS_RUN = ret
return __INSTALLED_VCS_RUN
-def get_installed_vcs():
+def get_installed_vcs(env=None):
installed_versions = []
+
for ver in _VCVER:
debug('trying to find VC %s' % ver)
try:
- if find_vc_pdir(ver):
+ VC_DIR = find_vc_pdir(ver)
+ if VC_DIR:
debug('found VC %s' % ver)
- installed_versions.append(ver)
+ if _check_cl_exists_in_vc_dir(env, VC_DIR, ver):
+ installed_versions.append(ver)
+ else:
+ debug('find_vc_pdir no compiler found %s' % ver)
else:
debug('find_vc_pdir return None for ver %s' % ver)
except VisualCException as e:
@@ -416,7 +595,7 @@ def get_default_version(env):
% (msvc_version, msvs_version))
return msvs_version
if not msvc_version:
- installed_vcs = cached_get_installed_vcs()
+ installed_vcs = cached_get_installed_vcs(env)
debug('installed_vcs:%s' % installed_vcs)
if not installed_vcs:
#msg = 'No installed VCs'
@@ -443,16 +622,17 @@ def msvc_find_valid_batch_script(env,version):
debug('vc.py:msvc_find_valid_batch_script()')
# Find the host platform, target platform, and if present the requested
# target platform
- (host_platform, target_platform,req_target_platform) = get_host_target(env)
+ platforms = get_host_target(env)
+ debug("vc.py: msvs_find_valid_batch_script(): host_platform %s, target_platform %s req_target_platform:%s" % platforms)
+ host_platform, target_platform, req_target_platform = platforms
try_target_archs = [target_platform]
- debug("msvs_find_valid_batch_script(): req_target_platform %s target_platform:%s"%(req_target_platform,target_platform))
# VS2012 has a "cross compile" environment to build 64 bit
# with x86_amd64 as the argument to the batch setup script
- if req_target_platform in ('amd64','x86_64'):
+ if req_target_platform in ('amd64', 'x86_64'):
try_target_archs.append('x86_amd64')
- elif not req_target_platform and target_platform in ['amd64','x86_64']:
+ elif not req_target_platform and target_platform in ['amd64', 'x86_64']:
# There may not be "native" amd64, but maybe "cross" x86_amd64 tools
try_target_archs.append('x86_amd64')
# If the user hasn't specifically requested a TARGET_ARCH, and
@@ -474,7 +654,7 @@ def msvc_find_valid_batch_script(env,version):
(host_target, version)
SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)
arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target]
-
+
# Get just version numbers
maj, min = msvc_version_to_maj_min(version)
# VS2015+
@@ -493,15 +673,17 @@ def msvc_find_valid_batch_script(env,version):
warn_msg = "VC version %s not installed. " + \
"C/C++ compilers are most likely not set correctly.\n" + \
" Installed versions are: %s"
- warn_msg = warn_msg % (version, cached_get_installed_vcs())
+ warn_msg = warn_msg % (version, cached_get_installed_vcs(env))
SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg)
continue
# Try to use the located batch file for this host/target platform combo
debug('vc.py:msvc_find_valid_batch_script() use_script 2 %s, args:%s\n' % (repr(vc_script), arg))
+ found = None
if vc_script:
try:
d = script_env(vc_script, args=arg)
+ found = vc_script
except BatchFileExecutionError as e:
debug('vc.py:msvc_find_valid_batch_script() use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e))
vc_script=None
@@ -510,6 +692,7 @@ def msvc_find_valid_batch_script(env,version):
debug('vc.py:msvc_find_valid_batch_script() use_script 4: trying sdk script: %s'%(sdk_script))
try:
d = script_env(sdk_script)
+ found = sdk_script
except BatchFileExecutionError as e:
debug('vc.py:msvc_find_valid_batch_script() use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e))
continue
@@ -517,7 +700,7 @@ def msvc_find_valid_batch_script(env,version):
debug('vc.py:msvc_find_valid_batch_script() use_script 6: Neither VC script nor SDK script found')
continue
- debug("vc.py:msvc_find_valid_batch_script() Found a working script/target: %s %s"%(repr(sdk_script),arg))
+ debug("vc.py:msvc_find_valid_batch_script() Found a working script/target: %s/%s"%(repr(found),arg))
break # We've found a working target_platform, so stop looking
# If we cannot find a viable installed compiler, reset the TARGET_ARCH
@@ -566,8 +749,14 @@ def msvc_setup_env(env):
debug('vc.py:msvc_setup_env() env:%s -> %s'%(k,v))
env.PrependENVPath(k, v, delete_existing=True)
-def msvc_exists(version=None):
- vcs = cached_get_installed_vcs()
+ # final check to issue a warning if the compiler is not present
+ msvc_cl = find_program_path(env, 'cl')
+ if not msvc_cl:
+ SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning,
+ "Could not find MSVC compiler 'cl', it may need to be installed separately with Visual Studio")
+
+def msvc_exists(env=None, version=None):
+ vcs = cached_get_installed_vcs(env)
if version is None:
return len(vcs) > 0
return version in vcs
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/vs.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/vs.py
index e732079f036..0404dc40566 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/vs.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/MSCommon/vs.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """Module to detect Visual Studio and/or Visual C/C++
"""
@@ -68,9 +68,9 @@ class VisualStudio(object):
SCons.Tool.MSCommon.vc.get_installed_vcs()
dir = SCons.Tool.MSCommon.vc.find_vc_pdir(self.vc_version)
if not dir:
- debug('find_vs_dir(): no installed VC %s' % self.vc_version)
+ debug('find_vs_dir_by_vc(): no installed VC %s' % self.vc_version)
return None
- return dir
+ return os.path.abspath(os.path.join(dir, os.pardir))
def find_vs_dir_by_reg(self):
root = 'Software\\'
@@ -95,12 +95,11 @@ class VisualStudio(object):
First try to find by registry, and if that fails find via VC dir
"""
-
- if True:
- vs_dir=self.find_vs_dir_by_reg()
- return vs_dir
- else:
- return self.find_vs_dir_by_vc()
+ vs_dir=self.find_vs_dir_by_reg()
+ if not vs_dir:
+ vs_dir = self.find_vs_dir_by_vc()
+ debug('find_vs_dir(): found VS in ' + str(vs_dir ))
+ return vs_dir
def find_executable(self):
vs_dir = self.get_vs_dir()
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/PharLapCommon.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/PharLapCommon.py
index 863d2080f48..66d9932ea15 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/PharLapCommon.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/PharLapCommon.py
@@ -7,7 +7,7 @@ Phar Lap ETS tool chain. Right now, this is linkloc and
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +29,7 @@ Phar Lap ETS tool chain. Right now, this is linkloc and
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/PharLapCommon.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/PharLapCommon.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/__init__.py
index 0207292d746..9a6a9d021ed 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/__init__.py
@@ -14,7 +14,7 @@ tool definition.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -35,9 +35,10 @@ tool definition.
# 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__ = "src/engine/SCons/Tool/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import imp
+import importlib
import sys
import re
import os
@@ -52,8 +53,9 @@ import SCons.Scanner.D
import SCons.Scanner.LaTeX
import SCons.Scanner.Prog
import SCons.Scanner.SWIG
+import collections
-DefaultToolpath=[]
+DefaultToolpath = []
CScanner = SCons.Scanner.C.CScanner()
DScanner = SCons.Scanner.D.DScanner()
@@ -94,9 +96,20 @@ for suffix in LaTeXSuffixes:
SourceFileScanner.add_scanner(suffix, LaTeXScanner)
SourceFileScanner.add_scanner(suffix, PDFLaTeXScanner)
+# Tool aliases are needed for those tools whos module names also
+# occur in the python standard library. This causes module shadowing and
+# can break using python library functions under python3
+TOOL_ALIASES = {
+ 'gettext': 'gettext_tool',
+ 'clang++': 'clangxx',
+}
+
+
class Tool(object):
def __init__(self, name, toolpath=[], **kw):
- self.name = name
+
+ # Rename if there's a TOOL_ALIAS for this tool
+ self.name = TOOL_ALIASES.get(name, name)
self.toolpath = toolpath + DefaultToolpath
# remember these so we can merge them into the call
self.init_kw = kw
@@ -107,35 +120,129 @@ class Tool(object):
if hasattr(module, 'options'):
self.options = module.options
+ def _load_dotted_module_py2(self, short_name, full_name, searchpaths=None):
+ splitname = short_name.split('.')
+ index = 0
+ srchpths = searchpaths
+ for item in splitname:
+ file, path, desc = imp.find_module(item, srchpths)
+ mod = imp.load_module(full_name, file, path, desc)
+ srchpths = [path]
+ return mod, file
+
def _tool_module(self):
- # TODO: Interchange zipimport with normal initialization for better error reporting
oldpythonpath = sys.path
sys.path = self.toolpath + sys.path
+ # sys.stderr.write("Tool:%s\nPATH:%s\n"%(self.name,sys.path))
- try:
+ if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0, 1, 2, 3, 4)):
+ # Py 2 code
try:
- file, path, desc = imp.find_module(self.name, self.toolpath)
- try:
- return imp.load_module(self.name, file, path, desc)
- finally:
- if file:
- file.close()
- except ImportError, e:
- if str(e)!="No module named %s"%self.name:
- raise SCons.Errors.EnvironmentError(e)
try:
- import zipimport
- except ImportError:
- pass
+ file = None
+ try:
+ mod, file = self._load_dotted_module_py2(self.name, self.name, self.toolpath)
+ return mod
+ finally:
+ if file:
+ file.close()
+ except ImportError as e:
+ splitname = self.name.split('.')
+ if str(e) != "No module named %s" % splitname[0]:
+ raise SCons.Errors.EnvironmentError(e)
+ try:
+ import zipimport
+ except ImportError:
+ pass
+ else:
+ for aPath in self.toolpath:
+ try:
+ importer = zipimport.zipimporter(aPath)
+ return importer.load_module(self.name)
+ except ImportError as e:
+ pass
+ finally:
+ sys.path = oldpythonpath
+ elif sys.version_info[1] > 4:
+ # From: http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path/67692#67692
+ # import importlib.util
+ # spec = importlib.util.spec_from_file_location("module.name", "/path/to/file.py")
+ # foo = importlib.util.module_from_spec(spec)
+ # spec.loader.exec_module(foo)
+ # foo.MyClass()
+ # Py 3 code
+
+ # import pdb; pdb.set_trace()
+ import importlib.util
+
+ # sys.stderr.write("toolpath:%s\n" % self.toolpath)
+ # sys.stderr.write("SCONS.TOOL path:%s\n" % sys.modules['SCons.Tool'].__path__)
+ debug = False
+ spec = None
+ found_name = self.name
+ add_to_scons_tools_namespace = False
+ for path in self.toolpath:
+ sepname = self.name.replace('.', os.path.sep)
+ file_path = os.path.join(path, "%s.py" % sepname)
+ file_package = os.path.join(path, sepname)
+
+ if debug: sys.stderr.write("Trying:%s %s\n" % (file_path, file_package))
+
+ if os.path.isfile(file_path):
+ spec = importlib.util.spec_from_file_location(self.name, file_path)
+ if debug: print("file_Path:%s FOUND" % file_path)
+ break
+ elif os.path.isdir(file_package):
+ file_package = os.path.join(file_package, '__init__.py')
+ spec = importlib.util.spec_from_file_location(self.name, file_package)
+ if debug: print("PACKAGE:%s Found" % file_package)
+ break
+
else:
- for aPath in self.toolpath:
- try:
- importer = zipimport.zipimporter(aPath)
- return importer.load_module(self.name)
- except ImportError, e:
- pass
- finally:
- sys.path = oldpythonpath
+ continue
+
+ if spec is None:
+ if debug: sys.stderr.write("NO SPEC :%s\n" % self.name)
+ spec = importlib.util.find_spec("." + self.name, package='SCons.Tool')
+ if spec:
+ found_name = 'SCons.Tool.' + self.name
+ add_to_scons_tools_namespace = True
+ if debug: sys.stderr.write("Spec Found? .%s :%s\n" % (self.name, spec))
+
+ if spec is None:
+ error_string = "No module named %s" % self.name
+ raise SCons.Errors.EnvironmentError(error_string)
+
+ module = importlib.util.module_from_spec(spec)
+ if module is None:
+ if debug: print("MODULE IS NONE:%s" % self.name)
+ error_string = "No module named %s" % self.name
+ raise SCons.Errors.EnvironmentError(error_string)
+
+ # Don't reload a tool we already loaded.
+ sys_modules_value = sys.modules.get(found_name, False)
+
+ found_module = None
+ if sys_modules_value and sys_modules_value.__file__ == spec.origin:
+ found_module = sys.modules[found_name]
+ else:
+ # Not sure what to do in the case that there already
+ # exists sys.modules[self.name] but the source file is
+ # different.. ?
+ module = spec.loader.load_module(spec.name)
+
+ sys.modules[found_name] = module
+ if add_to_scons_tools_namespace:
+ # If we found it in SCons.Tool, then add it to the module
+ setattr(SCons.Tool, self.name, module)
+
+ found_module = module
+
+ if found_module is not None:
+ sys.path = oldpythonpath
+ return found_module
+
+ sys.path = oldpythonpath
full_name = 'SCons.Tool.' + self.name
try:
@@ -144,25 +251,24 @@ class Tool(object):
try:
smpath = sys.modules['SCons.Tool'].__path__
try:
- file, path, desc = imp.find_module(self.name, smpath)
- module = imp.load_module(full_name, file, path, desc)
+ module, file = self._load_dotted_module_py2(self.name, full_name, smpath)
setattr(SCons.Tool, self.name, module)
if file:
file.close()
return module
- except ImportError, e:
- if str(e)!="No module named %s"%self.name:
+ except ImportError as e:
+ if str(e) != "No module named %s" % self.name:
raise SCons.Errors.EnvironmentError(e)
try:
import zipimport
- importer = zipimport.zipimporter( sys.modules['SCons.Tool'].__path__[0] )
+ importer = zipimport.zipimporter(sys.modules['SCons.Tool'].__path__[0])
module = importer.load_module(full_name)
setattr(SCons.Tool, self.name, module)
return module
- except ImportError, e:
+ except ImportError as e:
m = "No tool named '%s': %s" % (self.name, e)
raise SCons.Errors.EnvironmentError(m)
- except ImportError, e:
+ except ImportError as e:
m = "No tool named '%s': %s" % (self.name, e)
raise SCons.Errors.EnvironmentError(m)
@@ -176,13 +282,13 @@ class Tool(object):
kw.update(call_kw)
else:
kw = self.init_kw
- env.Append(TOOLS = [ self.name ])
+ env.Append(TOOLS=[self.name])
if hasattr(self, 'options'):
import SCons.Variables
if 'options' not in env:
from SCons.Script import ARGUMENTS
- env['options']=SCons.Variables.Variables(args=ARGUMENTS)
- opts=env['options']
+ env['options'] = SCons.Variables.Variables(args=ARGUMENTS)
+ opts = env['options']
self.options(opts)
opts.Update(env)
@@ -192,6 +298,7 @@ class Tool(object):
def __str__(self):
return self.name
+
##########################################################################
# Create common executable program / library / object builders
@@ -206,17 +313,18 @@ def createProgBuilder(env):
program = env['BUILDERS']['Program']
except KeyError:
import SCons.Defaults
- program = SCons.Builder.Builder(action = SCons.Defaults.LinkAction,
- emitter = '$PROGEMITTER',
- prefix = '$PROGPREFIX',
- suffix = '$PROGSUFFIX',
- src_suffix = '$OBJSUFFIX',
- src_builder = 'Object',
- target_scanner = ProgramScanner)
+ program = SCons.Builder.Builder(action=SCons.Defaults.LinkAction,
+ emitter='$PROGEMITTER',
+ prefix='$PROGPREFIX',
+ suffix='$PROGSUFFIX',
+ src_suffix='$OBJSUFFIX',
+ src_builder='Object',
+ target_scanner=ProgramScanner)
env['BUILDERS']['Program'] = program
return program
+
def createStaticLibBuilder(env):
"""This is a utility function that creates the StaticLibrary
Builder in an Environment if it is not there already.
@@ -227,23 +335,24 @@ def createStaticLibBuilder(env):
try:
static_lib = env['BUILDERS']['StaticLibrary']
except KeyError:
- action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ]
- if env.Detect('ranlib'):
+ action_list = [SCons.Action.Action("$ARCOM", "$ARCOMSTR")]
+ if env.get('RANLIB', False) or env.Detect('ranlib'):
ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR")
action_list.append(ranlib_action)
- static_lib = SCons.Builder.Builder(action = action_list,
- emitter = '$LIBEMITTER',
- prefix = '$LIBPREFIX',
- suffix = '$LIBSUFFIX',
- src_suffix = '$OBJSUFFIX',
- src_builder = 'StaticObject')
+ static_lib = SCons.Builder.Builder(action=action_list,
+ emitter='$LIBEMITTER',
+ prefix='$LIBPREFIX',
+ suffix='$LIBSUFFIX',
+ src_suffix='$OBJSUFFIX',
+ src_builder='StaticObject')
env['BUILDERS']['StaticLibrary'] = static_lib
env['BUILDERS']['Library'] = static_lib
return static_lib
-def _call_linker_cb(env, callback, args, result = None):
+
+def _call_linker_cb(env, callback, args, result=None):
"""Returns the result of env['LINKCALLBACKS'][callback](*args)
if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback]
is callable. If these conditions are not met, return the value provided as
@@ -254,97 +363,122 @@ def _call_linker_cb(env, callback, args, result = None):
Verbose = False
if Verbose:
- print '_call_linker_cb: args=%r' % args
- print '_call_linker_cb: callback=%r' % callback
-
+ print('_call_linker_cb: args=%r' % args)
+ print('_call_linker_cb: callback=%r' % callback)
+
try:
cbfun = env['LINKCALLBACKS'][callback]
except (KeyError, TypeError):
if Verbose:
- print '_call_linker_cb: env["LINKCALLBACKS"][%r] not found or can not be used' % callback
+ print('_call_linker_cb: env["LINKCALLBACKS"][%r] not found or can not be used' % callback)
pass
else:
if Verbose:
- print '_call_linker_cb: env["LINKCALLBACKS"][%r] found' % callback
- print '_call_linker_cb: env["LINKCALLBACKS"][%r]=%r' % (callback, cbfun)
- if(callable(cbfun)):
+ print('_call_linker_cb: env["LINKCALLBACKS"][%r] found' % callback)
+ print('_call_linker_cb: env["LINKCALLBACKS"][%r]=%r' % (callback, cbfun))
+ if isinstance(cbfun, collections.Callable):
if Verbose:
- print '_call_linker_cb: env["LINKCALLBACKS"][%r] is callable' % callback
+ print('_call_linker_cb: env["LINKCALLBACKS"][%r] is callable' % callback)
result = cbfun(env, *args)
return result
+
def _call_env_subst(env, string, *args, **kw):
kw2 = {}
for k in ('raw', 'target', 'source', 'conv', 'executor'):
- try: kw2[k] = kw[k]
- except KeyError: pass
+ try:
+ kw2[k] = kw[k]
+ except KeyError:
+ pass
return env.subst(string, *args, **kw2)
+
class _ShLibInfoSupport(object):
def get_libtype(self):
return 'ShLib'
+
def get_lib_prefix(self, env, *args, **kw):
- return _call_env_subst(env,'$SHLIBPREFIX', *args, **kw)
+ return _call_env_subst(env, '$SHLIBPREFIX', *args, **kw)
+
def get_lib_suffix(self, env, *args, **kw):
- return _call_env_subst(env,'$SHLIBSUFFIX', *args, **kw)
+ return _call_env_subst(env, '$SHLIBSUFFIX', *args, **kw)
+
def get_lib_version(self, env, *args, **kw):
- return _call_env_subst(env,'$SHLIBVERSION', *args, **kw)
+ return _call_env_subst(env, '$SHLIBVERSION', *args, **kw)
+
def get_lib_noversionsymlinks(self, env, *args, **kw):
- return _call_env_subst(env,'$SHLIBNOVERSIONSYMLINKS', *args, **kw)
+ return _call_env_subst(env, '$SHLIBNOVERSIONSYMLINKS', *args, **kw)
+
class _LdModInfoSupport(object):
def get_libtype(self):
return 'LdMod'
+
def get_lib_prefix(self, env, *args, **kw):
- return _call_env_subst(env,'$LDMODULEPREFIX', *args, **kw)
+ return _call_env_subst(env, '$LDMODULEPREFIX', *args, **kw)
+
def get_lib_suffix(self, env, *args, **kw):
- return _call_env_subst(env,'$LDMODULESUFFIX', *args, **kw)
+ return _call_env_subst(env, '$LDMODULESUFFIX', *args, **kw)
+
def get_lib_version(self, env, *args, **kw):
- return _call_env_subst(env,'$LDMODULEVERSION', *args, **kw)
+ return _call_env_subst(env, '$LDMODULEVERSION', *args, **kw)
+
def get_lib_noversionsymlinks(self, env, *args, **kw):
- return _call_env_subst(env,'$LDMODULENOVERSIONSYMLINKS', *args, **kw)
+ return _call_env_subst(env, '$LDMODULENOVERSIONSYMLINKS', *args, **kw)
+
class _ImpLibInfoSupport(object):
def get_libtype(self):
return 'ImpLib'
+
def get_lib_prefix(self, env, *args, **kw):
- return _call_env_subst(env,'$IMPLIBPREFIX', *args, **kw)
+ return _call_env_subst(env, '$IMPLIBPREFIX', *args, **kw)
+
def get_lib_suffix(self, env, *args, **kw):
- return _call_env_subst(env,'$IMPLIBSUFFIX', *args, **kw)
+ return _call_env_subst(env, '$IMPLIBSUFFIX', *args, **kw)
+
def get_lib_version(self, env, *args, **kw):
- version = _call_env_subst(env,'$IMPLIBVERSION', *args, **kw)
+ version = _call_env_subst(env, '$IMPLIBVERSION', *args, **kw)
if not version:
- try: lt = kw['implib_libtype']
- except KeyError: pass
+ try:
+ lt = kw['implib_libtype']
+ except KeyError:
+ pass
else:
if lt == 'ShLib':
- version = _call_env_subst(env,'$SHLIBVERSION', *args, **kw)
+ version = _call_env_subst(env, '$SHLIBVERSION', *args, **kw)
elif lt == 'LdMod':
- version = _call_env_subst(env,'$LDMODULEVERSION', *args, **kw)
+ version = _call_env_subst(env, '$LDMODULEVERSION', *args, **kw)
return version
+
def get_lib_noversionsymlinks(self, env, *args, **kw):
disable = None
- try: env['IMPLIBNOVERSIONSYMLINKS']
+ try:
+ env['IMPLIBNOVERSIONSYMLINKS']
except KeyError:
- try: lt = kw['implib_libtype']
- except KeyError: pass
+ try:
+ lt = kw['implib_libtype']
+ except KeyError:
+ pass
else:
if lt == 'ShLib':
- disable = _call_env_subst(env,'$SHLIBNOVERSIONSYMLINKS', *args, **kw)
+ disable = _call_env_subst(env, '$SHLIBNOVERSIONSYMLINKS', *args, **kw)
elif lt == 'LdMod':
- disable = _call_env_subst(env,'$LDMODULENOVERSIONSYMLINKS', *args, **kw)
+ disable = _call_env_subst(env, '$LDMODULENOVERSIONSYMLINKS', *args, **kw)
else:
- disable = _call_env_subst(env,'$IMPLIBNOVERSIONSYMLINKS', *args, **kw)
+ disable = _call_env_subst(env, '$IMPLIBNOVERSIONSYMLINKS', *args, **kw)
return disable
+
class _LibInfoGeneratorBase(object):
"""Generator base class for library-related info such as suffixes for
versioned libraries, symlink maps, sonames etc. It handles commonities
of SharedLibrary and LoadableModule
"""
- _support_classes = { 'ShLib' : _ShLibInfoSupport,
- 'LdMod' : _LdModInfoSupport,
- 'ImpLib' : _ImpLibInfoSupport }
+ _support_classes = {'ShLib': _ShLibInfoSupport,
+ 'LdMod': _LdModInfoSupport,
+ 'ImpLib': _ImpLibInfoSupport}
+
def __init__(self, libtype, infoname):
self.set_libtype(libtype)
self.set_infoname(infoname)
@@ -366,37 +500,41 @@ class _LibInfoGeneratorBase(object):
return self.infoname
def get_lib_prefix(self, env, *args, **kw):
- return self._support.get_lib_prefix(env,*args,**kw)
+ return self._support.get_lib_prefix(env, *args, **kw)
def get_lib_suffix(self, env, *args, **kw):
- return self._support.get_lib_suffix(env,*args,**kw)
+ return self._support.get_lib_suffix(env, *args, **kw)
def get_lib_version(self, env, *args, **kw):
- return self._support.get_lib_version(env,*args,**kw)
+ return self._support.get_lib_version(env, *args, **kw)
def get_lib_noversionsymlinks(self, env, *args, **kw):
- return self._support.get_lib_noversionsymlinks(env,*args,**kw)
+ return self._support.get_lib_noversionsymlinks(env, *args, **kw)
# Returns name of generator linker callback that shall be used to generate
# our info for a versioned library. For example, if our libtype is 'ShLib'
# and infoname is 'Prefix', it would return 'VersionedShLibPrefix'.
def get_versioned_lib_info_generator(self, **kw):
- try: libtype = kw['generator_libtype']
- except KeyError: libtype = self.get_libtype()
+ try:
+ libtype = kw['generator_libtype']
+ except KeyError:
+ libtype = self.get_libtype()
infoname = self.get_infoname()
return 'Versioned%s%s' % (libtype, infoname)
- def generate_versioned_lib_info(self, env, args, result = None, **kw):
+ def generate_versioned_lib_info(self, env, args, result=None, **kw):
callback = self.get_versioned_lib_info_generator(**kw)
- return _call_linker_cb(env, callback, args, result)
+ return _call_linker_cb(env, callback, args, result)
+
class _LibPrefixGenerator(_LibInfoGeneratorBase):
"""Library prefix generator, used as target_prefix in SharedLibrary and
LoadableModule builders"""
+
def __init__(self, libtype):
super(_LibPrefixGenerator, self).__init__(libtype, 'Prefix')
- def __call__(self, env, sources = None, **kw):
+ def __call__(self, env, sources=None, **kw):
Verbose = False
if sources and 'source' not in kw:
@@ -405,32 +543,35 @@ class _LibPrefixGenerator(_LibInfoGeneratorBase):
else:
kw2 = kw
- prefix = self.get_lib_prefix(env,**kw2)
+ prefix = self.get_lib_prefix(env, **kw2)
if Verbose:
- print "_LibPrefixGenerator: input prefix=%r" % prefix
+ print("_LibPrefixGenerator: input prefix=%r" % prefix)
version = self.get_lib_version(env, **kw2)
if Verbose:
- print "_LibPrefixGenerator: version=%r" % version
+ print("_LibPrefixGenerator: version=%r" % version)
if version:
prefix = self.generate_versioned_lib_info(env, [prefix, version], prefix, **kw2)
if Verbose:
- print "_LibPrefixGenerator: return prefix=%r" % prefix
+ print("_LibPrefixGenerator: return prefix=%r" % prefix)
return prefix
-ShLibPrefixGenerator = _LibPrefixGenerator('ShLib')
-LdModPrefixGenerator = _LibPrefixGenerator('LdMod')
+
+ShLibPrefixGenerator = _LibPrefixGenerator('ShLib')
+LdModPrefixGenerator = _LibPrefixGenerator('LdMod')
ImpLibPrefixGenerator = _LibPrefixGenerator('ImpLib')
+
class _LibSuffixGenerator(_LibInfoGeneratorBase):
"""Library suffix generator, used as target_suffix in SharedLibrary and
LoadableModule builders"""
+
def __init__(self, libtype):
super(_LibSuffixGenerator, self).__init__(libtype, 'Suffix')
- def __call__(self, env, sources = None, **kw):
+ def __call__(self, env, sources=None, **kw):
Verbose = False
if sources and 'source' not in kw:
@@ -441,26 +582,29 @@ class _LibSuffixGenerator(_LibInfoGeneratorBase):
suffix = self.get_lib_suffix(env, **kw2)
if Verbose:
- print "_LibSuffixGenerator: input suffix=%r" % suffix
+ print("_LibSuffixGenerator: input suffix=%r" % suffix)
version = self.get_lib_version(env, **kw2)
if Verbose:
- print "_LibSuffixGenerator: version=%r" % version
+ print("_LibSuffixGenerator: version=%r" % version)
if version:
suffix = self.generate_versioned_lib_info(env, [suffix, version], suffix, **kw2)
if Verbose:
- print "_LibSuffixGenerator: return suffix=%r" % suffix
+ print("_LibSuffixGenerator: return suffix=%r" % suffix)
return suffix
-ShLibSuffixGenerator = _LibSuffixGenerator('ShLib')
-LdModSuffixGenerator = _LibSuffixGenerator('LdMod')
+
+ShLibSuffixGenerator = _LibSuffixGenerator('ShLib')
+LdModSuffixGenerator = _LibSuffixGenerator('LdMod')
ImpLibSuffixGenerator = _LibSuffixGenerator('ImpLib')
+
class _LibSymlinkGenerator(_LibInfoGeneratorBase):
"""Library symlink map generator. It generates a list of symlinks that
should be created by SharedLibrary or LoadableModule builders"""
+
def __init__(self, libtype):
super(_LibSymlinkGenerator, self).__init__(libtype, 'Symlinks')
@@ -474,32 +618,34 @@ class _LibSymlinkGenerator(_LibInfoGeneratorBase):
kw2 = kw
if Verbose:
- print "_LibSymLinkGenerator: libnode=%r" % libnode.get_path()
+ print("_LibSymLinkGenerator: libnode=%r" % libnode.get_path())
symlinks = None
version = self.get_lib_version(env, **kw2)
disable = self.get_lib_noversionsymlinks(env, **kw2)
if Verbose:
- print '_LibSymlinkGenerator: version=%r' % version
- print '_LibSymlinkGenerator: disable=%r' % disable
+ print('_LibSymlinkGenerator: version=%r' % version)
+ print('_LibSymlinkGenerator: disable=%r' % disable)
if version and not disable:
- prefix = self.get_lib_prefix(env,**kw2)
- suffix = self.get_lib_suffix(env,**kw2)
+ prefix = self.get_lib_prefix(env, **kw2)
+ suffix = self.get_lib_suffix(env, **kw2)
symlinks = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2)
if Verbose:
- print '_LibSymlinkGenerator: return symlinks=%r' % StringizeLibSymlinks(symlinks)
+ print('_LibSymlinkGenerator: return symlinks=%r' % StringizeLibSymlinks(symlinks))
return symlinks
-ShLibSymlinkGenerator = _LibSymlinkGenerator('ShLib')
-LdModSymlinkGenerator = _LibSymlinkGenerator('LdMod')
+
+ShLibSymlinkGenerator = _LibSymlinkGenerator('ShLib')
+LdModSymlinkGenerator = _LibSymlinkGenerator('LdMod')
ImpLibSymlinkGenerator = _LibSymlinkGenerator('ImpLib')
+
class _LibNameGenerator(_LibInfoGeneratorBase):
"""Generates "unmangled" library name from a library file node.
-
+
Generally, it's thought to revert modifications done by prefix/suffix
generators (_LibPrefixGenerator/_LibSuffixGenerator) used by a library
builder. For example, on gnulink the suffix generator used by SharedLibrary
@@ -509,8 +655,9 @@ class _LibNameGenerator(_LibInfoGeneratorBase):
"$SHLIBSUFFIX" in the node's basename. So that, if $SHLIBSUFFIX is ".so",
$SHLIBVERSION is "0.1.2" and the node path is "/foo/bar/libfoo.so.0.1.2",
the _LibNameGenerator shall return "libfoo.so". Other link tools may
- implement it's own way of library name unmangling.
+ implement it's own way of library name unmangling.
"""
+
def __init__(self, libtype):
super(_LibNameGenerator, self).__init__(libtype, 'Name')
@@ -525,33 +672,36 @@ class _LibNameGenerator(_LibInfoGeneratorBase):
kw2 = kw
if Verbose:
- print "_LibNameGenerator: libnode=%r" % libnode.get_path()
+ print("_LibNameGenerator: libnode=%r" % libnode.get_path())
version = self.get_lib_version(env, **kw2)
if Verbose:
- print '_LibNameGenerator: version=%r' % version
+ print('_LibNameGenerator: version=%r' % version)
name = None
if version:
- prefix = self.get_lib_prefix(env,**kw2)
- suffix = self.get_lib_suffix(env,**kw2)
+ prefix = self.get_lib_prefix(env, **kw2)
+ suffix = self.get_lib_suffix(env, **kw2)
name = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2)
if not name:
name = os.path.basename(libnode.get_path())
if Verbose:
- print '_LibNameGenerator: return name=%r' % name
+ print('_LibNameGenerator: return name=%r' % name)
return name
-ShLibNameGenerator = _LibNameGenerator('ShLib')
-LdModNameGenerator = _LibNameGenerator('LdMod')
+
+ShLibNameGenerator = _LibNameGenerator('ShLib')
+LdModNameGenerator = _LibNameGenerator('LdMod')
ImpLibNameGenerator = _LibNameGenerator('ImpLib')
+
class _LibSonameGenerator(_LibInfoGeneratorBase):
- """Library soname generator. Returns library soname (e.g. libfoo.so.0) for
+ """Library soname generator. Returns library soname (e.g. libfoo.so.0) for
a given node (e.g. /foo/bar/libfoo.so.0.1.2)"""
+
def __init__(self, libtype):
super(_LibSonameGenerator, self).__init__(libtype, 'Soname')
@@ -566,114 +716,121 @@ class _LibSonameGenerator(_LibInfoGeneratorBase):
kw2 = kw
if Verbose:
- print "_LibSonameGenerator: libnode=%r" % libnode.get_path()
+ print("_LibSonameGenerator: libnode=%r" % libnode.get_path())
soname = _call_env_subst(env, '$SONAME', **kw2)
if not soname:
- version = self.get_lib_version(env,**kw2)
+ version = self.get_lib_version(env, **kw2)
if Verbose:
- print "_LibSonameGenerator: version=%r" % version
+ print("_LibSonameGenerator: version=%r" % version)
if version:
- prefix = self.get_lib_prefix(env,**kw2)
- suffix = self.get_lib_suffix(env,**kw2)
+ prefix = self.get_lib_prefix(env, **kw2)
+ suffix = self.get_lib_suffix(env, **kw2)
soname = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2)
if not soname:
# fallback to library name (as returned by appropriate _LibNameGenerator)
soname = _LibNameGenerator(self.get_libtype())(env, libnode)
if Verbose:
- print "_LibSonameGenerator: FALLBACK: soname=%r" % soname
+ print("_LibSonameGenerator: FALLBACK: soname=%r" % soname)
if Verbose:
- print "_LibSonameGenerator: return soname=%r" % soname
+ print("_LibSonameGenerator: return soname=%r" % soname)
return soname
-ShLibSonameGenerator = _LibSonameGenerator('ShLib')
-LdModSonameGenerator = _LibSonameGenerator('LdMod')
+
+ShLibSonameGenerator = _LibSonameGenerator('ShLib')
+LdModSonameGenerator = _LibSonameGenerator('LdMod')
+
def StringizeLibSymlinks(symlinks):
"""Converts list with pairs of nodes to list with pairs of node paths
(strings). Used mainly for debugging."""
if SCons.Util.is_List(symlinks):
try:
- return [ (k.get_path(), v.get_path()) for k,v in symlinks ]
+ return [(k.get_path(), v.get_path()) for k, v in symlinks]
except (TypeError, ValueError):
return symlinks
else:
return symlinks
+
def EmitLibSymlinks(env, symlinks, libnode, **kw):
"""Used by emitters to handle (shared/versioned) library symlinks"""
Verbose = False
# nodes involved in process... all symlinks + library
- nodes = list(set([ x for x,y in symlinks ] + [libnode]))
+ nodes = list(set([x for x, y in symlinks] + [libnode]))
clean_targets = kw.get('clean_targets', [])
if not SCons.Util.is_List(clean_targets):
- clean_targets = [ clean_targets ]
-
+ clean_targets = [clean_targets]
+
for link, linktgt in symlinks:
env.SideEffect(link, linktgt)
- if(Verbose):
- print "EmitLibSymlinks: SideEffect(%r,%r)" % (link.get_path(), linktgt.get_path())
- clean_list = filter(lambda x : x != linktgt, nodes)
+ if (Verbose):
+ print("EmitLibSymlinks: SideEffect(%r,%r)" % (link.get_path(), linktgt.get_path()))
+ clean_list = [x for x in nodes if x != linktgt]
env.Clean(list(set([linktgt] + clean_targets)), clean_list)
- if(Verbose):
- print "EmitLibSymlinks: Clean(%r,%r)" % (linktgt.get_path(), map(lambda x : x.get_path(), clean_list))
+ if (Verbose):
+ print("EmitLibSymlinks: Clean(%r,%r)" % (linktgt.get_path(), [x.get_path() for x in clean_list]))
+
def CreateLibSymlinks(env, symlinks):
"""Physically creates symlinks. The symlinks argument must be a list in
form [ (link, linktarget), ... ], where link and linktarget are SCons
nodes.
"""
-
+
Verbose = False
for link, linktgt in symlinks:
linktgt = link.get_dir().rel_path(linktgt)
link = link.get_path()
- if(Verbose):
- print "CreateLibSymlinks: preparing to add symlink %r -> %r" % (link, linktgt)
+ if (Verbose):
+ print("CreateLibSymlinks: preparing to add symlink %r -> %r" % (link, linktgt))
# Delete the (previously created) symlink if exists. Let only symlinks
# to be deleted to prevent accidental deletion of source files...
if env.fs.islink(link):
env.fs.unlink(link)
- if(Verbose):
- print "CreateLibSymlinks: removed old symlink %r" % link
+ if (Verbose):
+ print("CreateLibSymlinks: removed old symlink %r" % link)
# If a file or directory exists with the same name as link, an OSError
# will be thrown, which should be enough, I think.
env.fs.symlink(linktgt, link)
- if(Verbose):
- print "CreateLibSymlinks: add symlink %r -> %r" % (link, linktgt)
+ if (Verbose):
+ print("CreateLibSymlinks: add symlink %r -> %r" % (link, linktgt))
return 0
+
def LibSymlinksActionFunction(target, source, env):
for tgt in target:
- symlinks = getattr(getattr(tgt,'attributes', None), 'shliblinks', None)
+ symlinks = getattr(getattr(tgt, 'attributes', None), 'shliblinks', None)
if symlinks:
CreateLibSymlinks(env, symlinks)
return 0
+
def LibSymlinksStrFun(target, source, env, *args):
cmd = None
for tgt in target:
- symlinks = getattr(getattr(tgt,'attributes', None), 'shliblinks', None)
+ symlinks = getattr(getattr(tgt, 'attributes', None), 'shliblinks', None)
if symlinks:
if cmd is None: cmd = ""
if cmd: cmd += "\n"
cmd += "Create symlinks for: %r" % tgt.get_path()
try:
- linkstr = ', '.join([ "%r->%r" %(k,v) for k,v in StringizeLibSymlinks(symlinks)])
+ linkstr = ', '.join(["%r->%r" % (k, v) for k, v in StringizeLibSymlinks(symlinks)])
except (KeyError, ValueError):
pass
else:
cmd += ": %s" % linkstr
return cmd
-
+
LibSymlinksAction = SCons.Action.Action(LibSymlinksActionFunction, LibSymlinksStrFun)
+
def createSharedLibBuilder(env):
"""This is a utility function that creates the SharedLibrary
Builder in an Environment if it is not there already.
@@ -685,20 +842,21 @@ def createSharedLibBuilder(env):
shared_lib = env['BUILDERS']['SharedLibrary']
except KeyError:
import SCons.Defaults
- action_list = [ SCons.Defaults.SharedCheck,
- SCons.Defaults.ShLinkAction,
- LibSymlinksAction ]
- shared_lib = SCons.Builder.Builder(action = action_list,
- emitter = "$SHLIBEMITTER",
- prefix = ShLibPrefixGenerator,
- suffix = ShLibSuffixGenerator,
- target_scanner = ProgramScanner,
- src_suffix = '$SHOBJSUFFIX',
- src_builder = 'SharedObject')
+ action_list = [SCons.Defaults.SharedCheck,
+ SCons.Defaults.ShLinkAction,
+ LibSymlinksAction]
+ shared_lib = SCons.Builder.Builder(action=action_list,
+ emitter="$SHLIBEMITTER",
+ prefix=ShLibPrefixGenerator,
+ suffix=ShLibSuffixGenerator,
+ target_scanner=ProgramScanner,
+ src_suffix='$SHOBJSUFFIX',
+ src_builder='SharedObject')
env['BUILDERS']['SharedLibrary'] = shared_lib
return shared_lib
+
def createLoadableModuleBuilder(env):
"""This is a utility function that creates the LoadableModule
Builder in an Environment if it is not there already.
@@ -710,20 +868,21 @@ def createLoadableModuleBuilder(env):
ld_module = env['BUILDERS']['LoadableModule']
except KeyError:
import SCons.Defaults
- action_list = [ SCons.Defaults.SharedCheck,
- SCons.Defaults.LdModuleLinkAction,
- LibSymlinksAction ]
- ld_module = SCons.Builder.Builder(action = action_list,
- emitter = "$LDMODULEEMITTER",
- prefix = LdModPrefixGenerator,
- suffix = LdModSuffixGenerator,
- target_scanner = ProgramScanner,
- src_suffix = '$SHOBJSUFFIX',
- src_builder = 'SharedObject')
+ action_list = [SCons.Defaults.SharedCheck,
+ SCons.Defaults.LdModuleLinkAction,
+ LibSymlinksAction]
+ ld_module = SCons.Builder.Builder(action=action_list,
+ emitter="$LDMODULEEMITTER",
+ prefix=LdModPrefixGenerator,
+ suffix=LdModSuffixGenerator,
+ target_scanner=ProgramScanner,
+ src_suffix='$SHOBJSUFFIX',
+ src_builder='SharedObject')
env['BUILDERS']['LoadableModule'] = ld_module
return ld_module
+
def createObjBuilders(env):
"""This is a utility function that creates the StaticObject
and SharedObject Builders in an Environment if they
@@ -737,34 +896,34 @@ def createObjBuilders(env):
The return is a 2-tuple of (StaticObject, SharedObject)
"""
-
try:
static_obj = env['BUILDERS']['StaticObject']
except KeyError:
- static_obj = SCons.Builder.Builder(action = {},
- emitter = {},
- prefix = '$OBJPREFIX',
- suffix = '$OBJSUFFIX',
- src_builder = ['CFile', 'CXXFile'],
- source_scanner = SourceFileScanner,
- single_source = 1)
+ static_obj = SCons.Builder.Builder(action={},
+ emitter={},
+ prefix='$OBJPREFIX',
+ suffix='$OBJSUFFIX',
+ src_builder=['CFile', 'CXXFile'],
+ source_scanner=SourceFileScanner,
+ single_source=1)
env['BUILDERS']['StaticObject'] = static_obj
env['BUILDERS']['Object'] = static_obj
try:
shared_obj = env['BUILDERS']['SharedObject']
except KeyError:
- shared_obj = SCons.Builder.Builder(action = {},
- emitter = {},
- prefix = '$SHOBJPREFIX',
- suffix = '$SHOBJSUFFIX',
- src_builder = ['CFile', 'CXXFile'],
- source_scanner = SourceFileScanner,
- single_source = 1)
+ shared_obj = SCons.Builder.Builder(action={},
+ emitter={},
+ prefix='$SHOBJPREFIX',
+ suffix='$SHOBJSUFFIX',
+ src_builder=['CFile', 'CXXFile'],
+ source_scanner=SourceFileScanner,
+ single_source=1)
env['BUILDERS']['SharedObject'] = shared_obj
return (static_obj, shared_obj)
+
def createCFileBuilders(env):
"""This is a utility function that creates the CFile/CXXFile
Builders in an Environment if they
@@ -781,95 +940,109 @@ def createCFileBuilders(env):
try:
c_file = env['BUILDERS']['CFile']
except KeyError:
- c_file = SCons.Builder.Builder(action = {},
- emitter = {},
- suffix = {None:'$CFILESUFFIX'})
+ c_file = SCons.Builder.Builder(action={},
+ emitter={},
+ suffix={None: '$CFILESUFFIX'})
env['BUILDERS']['CFile'] = c_file
- env.SetDefault(CFILESUFFIX = '.c')
+ env.SetDefault(CFILESUFFIX='.c')
try:
cxx_file = env['BUILDERS']['CXXFile']
except KeyError:
- cxx_file = SCons.Builder.Builder(action = {},
- emitter = {},
- suffix = {None:'$CXXFILESUFFIX'})
+ cxx_file = SCons.Builder.Builder(action={},
+ emitter={},
+ suffix={None: '$CXXFILESUFFIX'})
env['BUILDERS']['CXXFile'] = cxx_file
- env.SetDefault(CXXFILESUFFIX = '.cc')
+ env.SetDefault(CXXFILESUFFIX='.cc')
return (c_file, cxx_file)
+
##########################################################################
# Create common Java builders
def CreateJarBuilder(env):
+ """The Jar builder expects a list of class files
+ which it can package into a jar file.
+
+ The jar tool provides an interface for passing other types
+ of java files such as .java, directories or swig interfaces
+ and will build them to class files in which it can package
+ into the jar.
+ """
try:
- java_jar = env['BUILDERS']['Jar']
+ java_jar = env['BUILDERS']['JarFile']
except KeyError:
fs = SCons.Node.FS.get_default_fs()
jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR')
- java_jar = SCons.Builder.Builder(action = jar_com,
- suffix = '$JARSUFFIX',
- src_suffix = '$JAVACLASSSUFIX',
- src_builder = 'JavaClassFile',
- source_factory = fs.Entry)
- env['BUILDERS']['Jar'] = java_jar
+ java_jar = SCons.Builder.Builder(action=jar_com,
+ suffix='$JARSUFFIX',
+ src_suffix='$JAVACLASSSUFFIX',
+ src_builder='JavaClassFile',
+ source_factory=fs.Entry)
+ env['BUILDERS']['JarFile'] = java_jar
return java_jar
+
def CreateJavaHBuilder(env):
try:
java_javah = env['BUILDERS']['JavaH']
except KeyError:
fs = SCons.Node.FS.get_default_fs()
java_javah_com = SCons.Action.Action('$JAVAHCOM', '$JAVAHCOMSTR')
- java_javah = SCons.Builder.Builder(action = java_javah_com,
- src_suffix = '$JAVACLASSSUFFIX',
- target_factory = fs.Entry,
- source_factory = fs.File,
- src_builder = 'JavaClassFile')
+ java_javah = SCons.Builder.Builder(action=java_javah_com,
+ src_suffix='$JAVACLASSSUFFIX',
+ target_factory=fs.Entry,
+ source_factory=fs.File,
+ src_builder='JavaClassFile')
env['BUILDERS']['JavaH'] = java_javah
return java_javah
+
def CreateJavaClassFileBuilder(env):
try:
java_class_file = env['BUILDERS']['JavaClassFile']
except KeyError:
fs = SCons.Node.FS.get_default_fs()
javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')
- java_class_file = SCons.Builder.Builder(action = javac_com,
- emitter = {},
- #suffix = '$JAVACLASSSUFFIX',
- src_suffix = '$JAVASUFFIX',
- src_builder = ['JavaFile'],
- target_factory = fs.Entry,
- source_factory = fs.File)
+ java_class_file = SCons.Builder.Builder(action=javac_com,
+ emitter={},
+ # suffix = '$JAVACLASSSUFFIX',
+ src_suffix='$JAVASUFFIX',
+ src_builder=['JavaFile'],
+ target_factory=fs.Entry,
+ source_factory=fs.File)
env['BUILDERS']['JavaClassFile'] = java_class_file
return java_class_file
+
def CreateJavaClassDirBuilder(env):
try:
java_class_dir = env['BUILDERS']['JavaClassDir']
except KeyError:
fs = SCons.Node.FS.get_default_fs()
javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR')
- java_class_dir = SCons.Builder.Builder(action = javac_com,
- emitter = {},
- target_factory = fs.Dir,
- source_factory = fs.Dir)
+ java_class_dir = SCons.Builder.Builder(action=javac_com,
+ emitter={},
+ target_factory=fs.Dir,
+ source_factory=fs.Dir)
env['BUILDERS']['JavaClassDir'] = java_class_dir
return java_class_dir
+
def CreateJavaFileBuilder(env):
try:
java_file = env['BUILDERS']['JavaFile']
except KeyError:
- java_file = SCons.Builder.Builder(action = {},
- emitter = {},
- suffix = {None:'$JAVASUFFIX'})
+ java_file = SCons.Builder.Builder(action={},
+ emitter={},
+ suffix={None: '$JAVASUFFIX'})
env['BUILDERS']['JavaFile'] = java_file
env['JAVASUFFIX'] = '.java'
return java_file
+
class ToolInitializerMethod(object):
"""
This is added to a construction environment in place of a
@@ -880,6 +1053,7 @@ class ToolInitializerMethod(object):
whatever builder was (presumably) added to the construction
environment in place of this particular instance.
"""
+
def __init__(self, name, initializer):
"""
Note: we store the tool name as __name__ so it can be used by
@@ -890,9 +1064,9 @@ class ToolInitializerMethod(object):
def get_builder(self, env):
"""
- Returns the appropriate real Builder for this method name
- after having the associated ToolInitializer object apply
- the appropriate Tool module.
+ Returns the appropriate real Builder for this method name
+ after having the associated ToolInitializer object apply
+ the appropriate Tool module.
"""
builder = getattr(env, self.__name__)
@@ -918,6 +1092,7 @@ class ToolInitializerMethod(object):
return [], []
return builder(*args, **kw)
+
class ToolInitializer(object):
"""
A class for delayed initialization of Tools modules.
@@ -929,6 +1104,7 @@ class ToolInitializer(object):
ToolInitializerMethod objects for the various Builder methods
that we want to use to delay Tool searches until necessary.
"""
+
def __init__(self, env, tools, names):
if not SCons.Util.is_List(tools):
tools = [tools]
@@ -949,13 +1125,13 @@ class ToolInitializer(object):
so we no longer copy and re-bind them when the construction
environment gets cloned.
"""
- for method in self.methods.values():
+ for method in list(self.methods.values()):
env.RemoveMethod(method)
def apply_tools(self, env):
"""
- Searches the list of associated Tool modules for one that
- exists, and applies that to the construction environment.
+ Searches the list of associated Tool modules for one that
+ exists, and applies that to the construction environment.
"""
for t in self.tools:
tool = SCons.Tool.Tool(t)
@@ -963,24 +1139,30 @@ class ToolInitializer(object):
env.Tool(tool)
return
- # If we fall through here, there was no tool module found.
- # This is where we can put an informative error message
- # about the inability to find the tool. We'll start doing
- # this as we cut over more pre-defined Builder+Tools to use
- # the ToolInitializer class.
+ # If we fall through here, there was no tool module found.
+ # This is where we can put an informative error message
+ # about the inability to find the tool. We'll start doing
+ # this as we cut over more pre-defined Builder+Tools to use
+ # the ToolInitializer class.
+
def Initializers(env):
ToolInitializer(env, ['install'], ['_InternalInstall', '_InternalInstallAs', '_InternalInstallVersionedLib'])
+
def Install(self, *args, **kw):
return self._InternalInstall(*args, **kw)
+
def InstallAs(self, *args, **kw):
return self._InternalInstallAs(*args, **kw)
+
def InstallVersionedLib(self, *args, **kw):
return self._InternalInstallVersionedLib(*args, **kw)
+
env.AddMethod(Install)
env.AddMethod(InstallAs)
env.AddMethod(InstallVersionedLib)
+
def FindTool(tools, env):
for tool in tools:
t = Tool(tool)
@@ -988,14 +1170,16 @@ def FindTool(tools, env):
return tool
return None
+
def FindAllTools(tools, env):
def ToolExists(tool, env=env):
return Tool(tool).exists(env)
- return list(filter (ToolExists, tools))
-def tool_list(platform, env):
+ return list(filter(ToolExists, tools))
- other_plat_tools=[]
+
+def tool_list(platform, env):
+ other_plat_tools = []
# XXX this logic about what tool to prefer on which platform
# should be moved into either the platform files or
# the tool files themselves.
@@ -1003,26 +1187,26 @@ def tool_list(platform, env):
# change these search orders, update the man page as well.
if str(platform) == 'win32':
"prefer Microsoft tools on Windows"
- linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32' ]
- c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32' ]
- cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'c++', 'bcc32' ]
- assemblers = ['masm', 'nasm', 'gas', '386asm' ]
+ linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32']
+ c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32']
+ cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'cxx', 'bcc32']
+ assemblers = ['masm', 'nasm', 'gas', '386asm']
fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran']
ars = ['mslib', 'ar', 'tlib']
other_plat_tools = ['msvs', 'midl']
elif str(platform) == 'os2':
"prefer IBM tools on OS/2"
- linkers = ['ilink', 'gnulink', ]#'mslink']
- c_compilers = ['icc', 'gcc',]# 'msvc', 'cc']
- cxx_compilers = ['icc', 'g++',]# 'msvc', 'c++']
- assemblers = ['nasm',]# 'masm', 'gas']
+ linkers = ['ilink', 'gnulink', ] # 'mslink']
+ c_compilers = ['icc', 'gcc', ] # 'msvc', 'cc']
+ cxx_compilers = ['icc', 'g++', ] # 'msvc', 'cxx']
+ assemblers = ['nasm', ] # 'masm', 'gas']
fortran_compilers = ['ifl', 'g77']
- ars = ['ar',]# 'mslib']
+ ars = ['ar', ] # 'mslib']
elif str(platform) == 'irix':
"prefer MIPSPro on IRIX"
linkers = ['sgilink', 'gnulink']
c_compilers = ['sgicc', 'gcc', 'cc']
- cxx_compilers = ['sgic++', 'g++', 'c++']
+ cxx_compilers = ['sgicxx', 'g++', 'cxx']
assemblers = ['as', 'gas']
fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']
ars = ['sgiar']
@@ -1030,7 +1214,7 @@ def tool_list(platform, env):
"prefer Forte tools on SunOS"
linkers = ['sunlink', 'gnulink']
c_compilers = ['suncc', 'gcc', 'cc']
- cxx_compilers = ['sunc++', 'g++', 'c++']
+ cxx_compilers = ['suncxx', 'g++', 'cxx']
assemblers = ['as', 'gas']
fortran_compilers = ['sunf95', 'sunf90', 'sunf77', 'f95', 'f90', 'f77',
'gfortran', 'g77', 'fortran']
@@ -1039,7 +1223,7 @@ def tool_list(platform, env):
"prefer aCC tools on HP-UX"
linkers = ['hplink', 'gnulink']
c_compilers = ['hpcc', 'gcc', 'cc']
- cxx_compilers = ['hpc++', 'g++', 'c++']
+ cxx_compilers = ['hpcxx', 'g++', 'cxx']
assemblers = ['as', 'gas']
fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']
ars = ['ar']
@@ -1047,7 +1231,7 @@ def tool_list(platform, env):
"prefer AIX Visual Age tools on AIX"
linkers = ['aixlink', 'gnulink']
c_compilers = ['aixcc', 'gcc', 'cc']
- cxx_compilers = ['aixc++', 'g++', 'c++']
+ cxx_compilers = ['aixcxx', 'g++', 'cxx']
assemblers = ['as', 'gas']
fortran_compilers = ['f95', 'f90', 'aixf77', 'g77', 'fortran']
ars = ['ar']
@@ -1055,7 +1239,7 @@ def tool_list(platform, env):
"prefer GNU tools on Mac OS X, except for some linkers and IBM tools"
linkers = ['applelink', 'gnulink']
c_compilers = ['gcc', 'cc']
- cxx_compilers = ['g++', 'c++']
+ cxx_compilers = ['g++', 'cxx']
assemblers = ['as']
fortran_compilers = ['gfortran', 'f95', 'f90', 'g77']
ars = ['ar']
@@ -1063,18 +1247,18 @@ def tool_list(platform, env):
"prefer GNU tools on Cygwin, except for a platform-specific linker"
linkers = ['cyglink', 'mslink', 'ilink']
c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']
- cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'c++']
+ cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'cxx']
assemblers = ['gas', 'nasm', 'masm']
fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']
ars = ['ar', 'mslib']
else:
"prefer GNU tools on all other platforms"
- linkers = ['gnulink', 'mslink', 'ilink']
- c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']
- cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'c++']
+ linkers = ['gnulink', 'ilink']
+ c_compilers = ['gcc', 'intelc', 'icc', 'cc']
+ cxx_compilers = ['g++', 'intelc', 'icc', 'cxx']
assemblers = ['gas', 'nasm', 'masm']
fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']
- ars = ['ar', 'mslib']
+ ars = ['ar', ]
if not str(platform) == 'win32':
other_plat_tools += ['m4', 'rpm']
@@ -1102,29 +1286,26 @@ def tool_list(platform, env):
fortran_compiler = FindTool(fortran_compilers, env) or fortran_compilers[0]
ar = FindTool(ars, env) or ars[0]
- d_compilers = ['dmd', 'gdc', 'ldc']
+ d_compilers = ['dmd', 'ldc', 'gdc']
d_compiler = FindTool(d_compilers, env) or d_compilers[0]
other_tools = FindAllTools(other_plat_tools + [
- #TODO: merge 'install' into 'filesystem' and
- # make 'filesystem' the default
- 'filesystem',
- 'wix', #'midl', 'msvs',
- # Parser generators
- 'lex', 'yacc',
- # Foreign function interface
- 'rpcgen', 'swig',
- # Java
- 'jar', 'javac', 'javah', 'rmic',
- # TeX
- 'dvipdf', 'dvips', 'gs',
- 'tex', 'latex', 'pdflatex', 'pdftex',
- # Archivers
- 'tar', 'zip',
- # SourceCode factories
- 'BitKeeper', 'CVS', 'Perforce',
- 'RCS', 'SCCS', # 'Subversion',
- ], env)
+ # TODO: merge 'install' into 'filesystem' and
+ # make 'filesystem' the default
+ 'filesystem',
+ 'wix', # 'midl', 'msvs',
+ # Parser generators
+ 'lex', 'yacc',
+ # Foreign function interface
+ 'rpcgen', 'swig',
+ # Java
+ 'jar', 'javac', 'javah', 'rmic',
+ # TeX
+ 'dvipdf', 'dvips', 'gs',
+ 'tex', 'latex', 'pdflatex', 'pdftex',
+ # Archivers
+ 'tar', 'zip',
+ ], env)
tools = ([linker, c_compiler, cxx_compiler,
fortran_compiler, assembler, ar, d_compiler]
@@ -1132,9 +1313,35 @@ def tool_list(platform, env):
return [x for x in tools if x]
+
+def find_program_path(env, key_program, default_paths=[]):
+ """
+ Find the location of key_program and then return the path it was located at.
+ Checking the default install locations.
+ Mainly for windows where tools aren't all installed in /usr/bin,etc
+ :param env: Current Environment()
+ :param key_program: Program we're using to locate the directory to add to PATH.
+ """
+ # First search in the SCons path
+ path = env.WhereIs(key_program)
+ if (path):
+ return path
+ # then the OS path:
+ path = SCons.Util.WhereIs(key_program)
+ if (path):
+ return path
+
+ # If that doesn't work try default location for mingw
+ save_path = env['ENV']['PATH']
+ for p in default_paths:
+ env.AppendENVPath('PATH', p)
+ path = env.WhereIs(key_program)
+ if not path:
+ env['ENV']['PATH'] = save_path
+ return path
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
-
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixc++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixc++.py
new file mode 100644
index 00000000000..05c212d269c
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixc++.py
@@ -0,0 +1,43 @@
+"""SCons.Tool.aixc++
+
+Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
+
+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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/aixc++.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+#forward proxy to the preffered cxx version
+from SCons.Tool.aixcxx import *
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixcc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixcc.py
index 30735c96a94..b5e30ca8cf2 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixcc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixcc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,13 +30,13 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/aixcc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixcc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import SCons.Platform.aix
-import cc
+from . import cc
packages = ['vac.C', 'ibmcxx.cmp']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixc++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixcxx.py
index 699dacb8d7d..58191e6a65f 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixc++.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixcxx.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,13 +31,15 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/aixc++.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixcxx.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import SCons.Platform.aix
-cplusplus = __import__('c++', globals(), locals(), [])
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('cxx', globals(), locals(), [])
packages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixf77.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixf77.py
index f23c1cbd8d9..f8a86ce7486 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixf77.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixf77.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,13 +30,13 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/aixf77.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixf77.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
#import SCons.Platform.aix
-import f77
+from . import f77
# It would be good to look for the AIX F77 package the same way we're now
# looking for the C and C++ packages. This should be as easy as supplying
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixlink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixlink.py
index 483068c4f15..0e76ebb0d12 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/aixlink.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/aixlink.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,16 +30,20 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/aixlink.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixlink.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
import SCons.Util
-import link
+from . import aixcc
+from . import link
+
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('cxx', globals(), locals(), [])
-cplusplus = __import__('c++', globals(), locals(), [])
def smart_linkflags(source, target, env, for_signature):
if cplusplus.iscplusplus(source):
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/applelink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/applelink.py
new file mode 100644
index 00000000000..876b4a4f235
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/applelink.py
@@ -0,0 +1,218 @@
+"""SCons.Tool.applelink
+
+Tool-specific initialization for Apple's gnu-like 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.
+
+"""
+
+#
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/applelink.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+import SCons.Util
+
+# Even though the Mac is based on the GNU toolchain, it doesn't understand
+# the -rpath option, so we use the "link" tool instead of "gnulink".
+from . import link
+
+
+class AppleLinkInvalidCurrentVersionException(Exception):
+ pass
+
+class AppleLinkInvalidCompatibilityVersionException(Exception):
+ pass
+
+
+def _applelib_versioned_lib_suffix(env, suffix, version):
+ """For suffix='.dylib' and version='0.1.2' it returns '.0.1.2.dylib'"""
+ Verbose = False
+ if Verbose:
+ print("_applelib_versioned_lib_suffix: suffix={!r}".format(suffix))
+ print("_applelib_versioned_lib_suffix: version={!r}".format(version))
+ if version not in suffix:
+ suffix = "." + version + suffix
+ if Verbose:
+ print("_applelib_versioned_lib_suffix: return suffix={!r}".format(suffix))
+ return suffix
+
+
+def _applelib_versioned_lib_soname(env, libnode, version, prefix, suffix, name_func):
+ """For libnode='/optional/dir/libfoo.X.Y.Z.dylib' it returns 'libfoo.X.dylib'"""
+ Verbose = False
+ if Verbose:
+ print("_applelib_versioned_lib_soname: version={!r}".format(version))
+ name = name_func(env, libnode, version, prefix, suffix)
+ if Verbose:
+ print("_applelib_versioned_lib_soname: name={!r}".format(name))
+ major = version.split('.')[0]
+ (libname,_suffix) = name.split('.')
+ soname = '.'.join([libname, major, _suffix])
+ if Verbose:
+ print("_applelib_versioned_lib_soname: soname={!r}".format(soname))
+ return soname
+
+def _applelib_versioned_shlib_soname(env, libnode, version, prefix, suffix):
+ return _applelib_versioned_lib_soname(env, libnode, version, prefix, suffix, link._versioned_shlib_name)
+
+
+# User programmatically describes how SHLIBVERSION maps to values for compat/current.
+_applelib_max_version_values = (65535, 255, 255)
+def _applelib_check_valid_version(version_string):
+ """
+ Check that the version # is valid.
+ X[.Y[.Z]]
+ where X 0-65535
+ where Y either not specified or 0-255
+ where Z either not specified or 0-255
+ :param version_string:
+ :return:
+ """
+ parts = version_string.split('.')
+ if len(parts) > 3:
+ return False, "Version string has too many periods [%s]"%version_string
+ if len(parts) <= 0:
+ return False, "Version string unspecified [%s]"%version_string
+
+ for (i, p) in enumerate(parts):
+ try:
+ p_i = int(p)
+ except ValueError:
+ return False, "Version component %s (from %s) is not a number"%(p, version_string)
+ if p_i < 0 or p_i > _applelib_max_version_values[i]:
+ return False, "Version component %s (from %s) is not valid value should be between 0 and %d"%(p, version_string, _applelib_max_version_values[i])
+
+ return True, ""
+
+
+def _applelib_currentVersionFromSoVersion(source, target, env, for_signature):
+ """
+ A generator function to create the -Wl,-current_version flag if needed.
+ If env['APPLELINK_NO_CURRENT_VERSION'] contains a true value no flag will be generated
+ Otherwise if APPLELINK_CURRENT_VERSION is not specified, env['SHLIBVERSION']
+ will be used.
+
+ :param source:
+ :param target:
+ :param env:
+ :param for_signature:
+ :return: A string providing the flag to specify the current_version of the shared library
+ """
+ if env.get('APPLELINK_NO_CURRENT_VERSION', False):
+ return ""
+ elif env.get('APPLELINK_CURRENT_VERSION', False):
+ version_string = env['APPLELINK_CURRENT_VERSION']
+ elif env.get('SHLIBVERSION', False):
+ version_string = env['SHLIBVERSION']
+ else:
+ return ""
+
+ version_string = ".".join(version_string.split('.')[:3])
+
+ valid, reason = _applelib_check_valid_version(version_string)
+ if not valid:
+ raise AppleLinkInvalidCurrentVersionException(reason)
+
+ return "-Wl,-current_version,%s" % version_string
+
+
+def _applelib_compatVersionFromSoVersion(source, target, env, for_signature):
+ """
+ A generator function to create the -Wl,-compatibility_version flag if needed.
+ If env['APPLELINK_NO_COMPATIBILITY_VERSION'] contains a true value no flag will be generated
+ Otherwise if APPLELINK_COMPATIBILITY_VERSION is not specified
+ the first two parts of env['SHLIBVERSION'] will be used with a .0 appended.
+
+ :param source:
+ :param target:
+ :param env:
+ :param for_signature:
+ :return: A string providing the flag to specify the compatibility_version of the shared library
+ """
+ if env.get('APPLELINK_NO_COMPATIBILITY_VERSION', False):
+ return ""
+ elif env.get('APPLELINK_COMPATIBILITY_VERSION', False):
+ version_string = env['APPLELINK_COMPATIBILITY_VERSION']
+ elif env.get('SHLIBVERSION', False):
+ version_string = ".".join(env['SHLIBVERSION'].split('.')[:2] + ['0'])
+ else:
+ return ""
+
+ if version_string is None:
+ return ""
+
+ valid, reason = _applelib_check_valid_version(version_string)
+ if not valid:
+ raise AppleLinkInvalidCompatibilityVersionException(reason)
+
+ return "-Wl,-compatibility_version,%s" % version_string
+
+
+def generate(env):
+ """Add Builders and construction variables for applelink to an
+ Environment."""
+ link.generate(env)
+
+ env['FRAMEWORKPATHPREFIX'] = '-F'
+ env['_FRAMEWORKPATH'] = '${_concat(FRAMEWORKPATHPREFIX, FRAMEWORKPATH, "", __env__, RDirs)}'
+
+ env['_FRAMEWORKS'] = '${_concat("-framework ", FRAMEWORKS, "", __env__)}'
+ env['LINKCOM'] = env['LINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'
+ env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -dynamiclib')
+ env['SHLINKCOM'] = env['SHLINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'
+
+
+ # see: http://docstore.mik.ua/orelly/unix3/mac/ch05_04.htm for proper naming
+ link._setup_versioned_lib_variables(env, tool = 'applelink')#, use_soname = use_soname)
+ env['LINKCALLBACKS'] = link._versioned_lib_callbacks()
+ env['LINKCALLBACKS']['VersionedShLibSuffix'] = _applelib_versioned_lib_suffix
+ env['LINKCALLBACKS']['VersionedShLibSoname'] = _applelib_versioned_shlib_soname
+
+ env['_APPLELINK_CURRENT_VERSION'] = _applelib_currentVersionFromSoVersion
+ env['_APPLELINK_COMPATIBILITY_VERSION'] = _applelib_compatVersionFromSoVersion
+ env['_SHLIBVERSIONFLAGS'] = '$_APPLELINK_CURRENT_VERSION $_APPLELINK_COMPATIBILITY_VERSION '
+ env['_LDMODULEVERSIONFLAGS'] = '$_APPLELINK_CURRENT_VERSION $_APPLELINK_COMPATIBILITY_VERSION '
+
+ # override the default for loadable modules, which are different
+ # on OS X than dynamic shared libs. echoing what XCode does for
+ # pre/suffixes:
+ env['LDMODULEPREFIX'] = ''
+ env['LDMODULESUFFIX'] = ''
+ env['LDMODULEFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -bundle')
+ env['LDMODULECOM'] = '$LDMODULE -o ${TARGET} $LDMODULEFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'
+
+ env['__SHLIBVERSIONFLAGS'] = '${__libversionflags(__env__,"SHLIBVERSION","_SHLIBVERSIONFLAGS")}'
+
+
+
+def exists(env):
+ return env['PLATFORM'] == 'darwin'
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ar.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ar.py
index a64ddfaee59..93a8b1c2018 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ar.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ar.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/ar.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ar.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
@@ -48,8 +48,8 @@ def generate(env):
env['LIBPREFIX'] = 'lib'
env['LIBSUFFIX'] = '.a'
- if env.Detect('ranlib'):
- env['RANLIB'] = 'ranlib'
+ if env.get('RANLIB',env.Detect('ranlib')) :
+ env['RANLIB'] = env.get('RANLIB','ranlib')
env['RANLIBFLAGS'] = SCons.Util.CLVar('')
env['RANLIBCOM'] = '$RANLIB $RANLIBFLAGS $TARGET'
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/as.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/as.py
index 75992d59e64..1210042ac7a 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/as.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/as.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/as.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/as.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/bcc32.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/bcc32.py
index ffd29f263f7..43371ada777 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/bcc32.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/bcc32.py
@@ -5,7 +5,7 @@ XXX
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ XXX
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/bcc32.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/bcc32.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/c++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/c++.py
new file mode 100644
index 00000000000..e7edba3f883
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/c++.py
@@ -0,0 +1,44 @@
+"""SCons.Tool.c++
+
+Tool-specific initialization for generic Posix C++ compilers.
+
+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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/c++.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+
+#forward proxy to the preffered cxx version
+from SCons.Tool.cxx import *
+
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cc.py
index b0a73f843ef..d9628edbfb1 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/cc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/cc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Tool
import SCons.Defaults
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clang.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clang.py
new file mode 100644
index 00000000000..bf7acdf738f
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clang.py
@@ -0,0 +1,94 @@
+# -*- 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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/clang.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+# Based on SCons/Tool/gcc.py by Paweł Tomulik 2014 as a separate tool.
+# Brought into the SCons mainline by Russel Winder 2017.
+
+import os
+import re
+import subprocess
+import sys
+
+import SCons.Util
+import SCons.Tool.cc
+from SCons.Tool.clangCommon import get_clang_install_dirs
+
+
+compilers = ['clang']
+
+def generate(env):
+ """Add Builders and construction variables for clang to an Environment."""
+ SCons.Tool.cc.generate(env)
+
+ if env['PLATFORM'] == 'win32':
+ # Ensure that we have a proper path for clang
+ clang = SCons.Tool.find_program_path(env, compilers[0],
+ default_paths=get_clang_install_dirs(env['PLATFORM']))
+ if clang:
+ clang_bin_dir = os.path.dirname(clang)
+ env.AppendENVPath('PATH', clang_bin_dir)
+
+ env['CC'] = env.Detect(compilers) or 'clang'
+ if env['PLATFORM'] in ['cygwin', 'win32']:
+ env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
+ else:
+ env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')
+
+ # determine compiler version
+ if env['CC']:
+ #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'],
+ pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
+ stdin='devnull',
+ stderr='devnull',
+ stdout=subprocess.PIPE)
+ if pipe.wait() != 0: return
+ # clang -dumpversion is of no use
+ line = pipe.stdout.readline()
+ if sys.version_info[0] > 2:
+ line = line.decode()
+ match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line)
+ if match:
+ env['CCVERSION'] = match.group(1)
+
+def exists(env):
+ return env.Detect(compilers)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clangCommon/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clangCommon/__init__.py
new file mode 100644
index 00000000000..37efbf691e7
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clangCommon/__init__.py
@@ -0,0 +1,17 @@
+"""
+Common routines and data for clang tools
+"""
+
+clang_win32_dirs = [
+ r'C:\Program Files\LLVM\bin',
+ r'C:\cygwin64\bin',
+ r'C:\msys64',
+ r'C:\cygwin\bin',
+ r'C:\msys',
+]
+
+def get_clang_install_dirs(platform):
+ if platform == 'win32':
+ return clang_win32_dirs
+ else:
+ return [] \ No newline at end of file
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clangxx.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clangxx.py
new file mode 100644
index 00000000000..0e59bc9733b
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/clangxx.py
@@ -0,0 +1,102 @@
+# -*- 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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/clangxx.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+# Based on SCons/Tool/g++.py by Paweł Tomulik 2014 as a separate tool.
+# Brought into the SCons mainline by Russel Winder 2017.
+
+import os.path
+import re
+import subprocess
+import sys
+
+import SCons.Tool
+import SCons.Util
+import SCons.Tool.cxx
+from SCons.Tool.clangCommon import get_clang_install_dirs
+
+
+compilers = ['clang++']
+
+def generate(env):
+ """Add Builders and construction variables for clang++ to an Environment."""
+ static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+ SCons.Tool.cxx.generate(env)
+
+ env['CXX'] = env.Detect(compilers) or 'clang++'
+
+ # platform specific settings
+ if env['PLATFORM'] == 'aix':
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
+ env['SHOBJSUFFIX'] = '$OBJSUFFIX'
+ elif env['PLATFORM'] == 'hpux':
+ env['SHOBJSUFFIX'] = '.pic.o'
+ elif env['PLATFORM'] == 'sunos':
+ env['SHOBJSUFFIX'] = '.pic.o'
+ elif env['PLATFORM'] == 'win32':
+ # Ensure that we have a proper path for clang++
+ clangxx = SCons.Tool.find_program_path(env, compilers[0], default_paths=get_clang_install_dirs(env['PLATFORM']))
+ if clangxx:
+ clangxx_bin_dir = os.path.dirname(clangxx)
+ env.AppendENVPath('PATH', clangxx_bin_dir)
+
+ # determine compiler version
+ if env['CXX']:
+ pipe = SCons.Action._subproc(env, [env['CXX'], '--version'],
+ stdin='devnull',
+ stderr='devnull',
+ stdout=subprocess.PIPE)
+ if pipe.wait() != 0:
+ return
+
+ # clang -dumpversion is of no use
+ line = pipe.stdout.readline()
+ if sys.version_info[0] > 2:
+ line = line.decode()
+ match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line)
+ if match:
+ env['CXXVERSION'] = match.group(1)
+
+def exists(env):
+ return env.Detect(compilers)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cvf.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cvf.py
index 06ea0637898..14fc7de7790 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cvf.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cvf.py
@@ -5,7 +5,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,9 +27,9 @@ Tool-specific initialization for the Compaq Visual Fortran compiler.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/cvf.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/cvf.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import fortran
+from . import fortran
compilers = ['f90']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/c++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cxx.py
index b0c4e62e3ca..f207c9c8a19 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/c++.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cxx.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/c++.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/cxx.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cyglink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cyglink.py
index 921f0ebf49b..f69b886dd82 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cyglink.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/cyglink.py
@@ -7,6 +7,9 @@ It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
+
+from __future__ import absolute_import, print_function
+
import re
import os
@@ -14,12 +17,13 @@ import SCons.Action
import SCons.Util
import SCons.Tool
-import gnulink
-import link
+#MAYBE: from . import gnulink
+from . import gnulink
+from . import link
def _lib_generator(target, source, env, for_signature, **kw):
try: cmd = kw['cmd']
- except KeyError: cmd = SCons.Util.CLVar(['$SHLINK'])
+ except KeyError: cmd = SCons.Util.CLVar(['$SHLINK'])
try: vp = kw['varprefix']
except KeyError: vp = 'SHLIB'
@@ -40,7 +44,7 @@ def _lib_generator(target, source, env, for_signature, **kw):
])
else:
cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
-
+
return [cmd]
@@ -58,37 +62,37 @@ def _lib_emitter(target, source, env, **kw):
Verbose = False
if Verbose:
- print "_lib_emitter: target[0]=%r" % target[0].get_path()
+ print("_lib_emitter: target[0]=%r" % target[0].get_path())
try: vp = kw['varprefix']
except KeyError: vp = 'SHLIB'
try: libtype = kw['libtype']
except KeyError: libtype = 'ShLib'
-
+
dll = env.FindIxes(target, '%sPREFIX' % vp, '%sSUFFIX' % vp)
no_import_lib = env.get('no_import_lib', 0)
if Verbose:
- print "_lib_emitter: dll=%r" % dll.get_path()
+ print("_lib_emitter: dll=%r" % dll.get_path())
if not dll or len(target) > 1:
raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s" % env.subst("$%sSUFFIX" % vp))
-
+
# Remove any "lib" after the prefix
pre = env.subst('$%sPREFIX' % vp)
if dll.name[len(pre):len(pre)+3] == 'lib':
dll.name = pre + dll.name[len(pre)+3:]
if Verbose:
- print "_lib_emitter: dll.name=%r" % dll.name
+ print("_lib_emitter: dll.name=%r" % dll.name)
orig_target = target
target = [env.fs.File(dll)]
target[0].attributes.shared = 1
if Verbose:
- print "_lib_emitter: after target=[env.fs.File(dll)]: target[0]=%r" % target[0].get_path()
+ print("_lib_emitter: after target=[env.fs.File(dll)]: target[0]=%r" % target[0].get_path())
# Append an import lib target
if not no_import_lib:
@@ -97,11 +101,11 @@ def _lib_emitter(target, source, env, **kw):
'%sPREFIX' % vp, '%sSUFFIX' % vp,
'IMPLIBPREFIX', 'IMPLIBSUFFIX')
if Verbose:
- print "_lib_emitter: target_strings=%r" % target_strings
-
+ print("_lib_emitter: target_strings=%r" % target_strings)
+
implib_target = env.fs.File(target_strings)
if Verbose:
- print "_lib_emitter: implib_target=%r" % implib_target.get_path()
+ print("_lib_emitter: implib_target=%r" % implib_target.get_path())
implib_target.attributes.shared = 1
target.append(implib_target)
@@ -109,7 +113,7 @@ def _lib_emitter(target, source, env, **kw):
implib_libtype=libtype,
generator_libtype=libtype+'ImpLib')
if Verbose:
- print "_lib_emitter: implib symlinks=%r" % SCons.Tool.StringizeLibSymlinks(symlinks)
+ print("_lib_emitter: implib symlinks=%r" % SCons.Tool.StringizeLibSymlinks(symlinks))
if symlinks:
SCons.Tool.EmitLibSymlinks(env, symlinks, implib_target, clean_targets = target[0])
implib_target.attributes.shliblinks = symlinks
@@ -121,19 +125,19 @@ def shlib_emitter(target, source, env):
def ldmod_emitter(target, source, env):
return _lib_emitter(target, source, env, varprefix='LDMODULE', libtype='LdMod')
-
+
def _versioned_lib_suffix(env, suffix, version):
"""Generate versioned shared library suffix from a unversioned one.
If suffix='.dll', and version='0.1.2', then it returns '-0-1-2.dll'"""
Verbose = False
if Verbose:
- print "_versioned_lib_suffix: suffix= ", suffix
- print "_versioned_lib_suffix: version= ", version
+ print("_versioned_lib_suffix: suffix= ", suffix)
+ print("_versioned_lib_suffix: version= ", version)
cygversion = re.sub('\.', '-', version)
if not suffix.startswith('-' + cygversion):
suffix = '-' + cygversion + suffix
if Verbose:
- print "_versioned_lib_suffix: return suffix= ", suffix
+ print("_versioned_lib_suffix: return suffix= ", suffix)
return suffix
def _versioned_implib_name(env, libnode, version, prefix, suffix, **kw):
@@ -149,8 +153,8 @@ def _versioned_implib_symlinks(env, libnode, version, prefix, suffix, **kw):
Verbose = False
if Verbose:
- print "_versioned_implib_symlinks: libnode=%r" % libnode.get_path()
- print "_versioned_implib_symlinks: version=%r" % version
+ print("_versioned_implib_symlinks: libnode=%r" % libnode.get_path())
+ print("_versioned_implib_symlinks: version=%r" % version)
try: libtype = kw['libtype']
except KeyError: libtype = 'ShLib'
@@ -158,13 +162,13 @@ def _versioned_implib_symlinks(env, libnode, version, prefix, suffix, **kw):
linkdir = os.path.dirname(libnode.get_path())
if Verbose:
- print "_versioned_implib_symlinks: linkdir=%r" % linkdir
+ print("_versioned_implib_symlinks: linkdir=%r" % linkdir)
name = SCons.Tool.ImpLibNameGenerator(env, libnode,
implib_libtype=libtype,
generator_libtype=libtype+'ImpLib')
if Verbose:
- print "_versioned_implib_symlinks: name=%r" % name
+ print("_versioned_implib_symlinks: name=%r" % name)
major = version.split('.')[0]
@@ -172,7 +176,7 @@ def _versioned_implib_symlinks(env, libnode, version, prefix, suffix, **kw):
symlinks = [(link0, libnode)]
if Verbose:
- print "_versioned_implib_symlinks: return symlinks=%r" % SCons.Tool.StringizeLibSymlinks(symlinks)
+ print("_versioned_implib_symlinks: return symlinks=%r" % SCons.Tool.StringizeLibSymlinks(symlinks))
return symlinks
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/default.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/default.py
index 848e0b72cb0..e85e0e7c82d 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/default.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/default.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/default.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/default.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Tool
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dmd.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dmd.py
index a08421c1045..33847f65b63 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dmd.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dmd.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
"""SCons.Tool.dmd
Tool-specific initialization for the Digital Mars D compiler.
@@ -9,13 +11,6 @@ Originally coded by Andy Friesen (andy@ikagames.com)
Evolved by Russel Winder (russel@winder.org.uk)
2010-02-07 onwards
-There are a number of problems with this script at this point in time.
-The one that irritates the most is the Windows linker setup. The D
-linker doesn't have a way to add lib paths on the commandline, as far
-as I can see. You have to specify paths relative to the SConscript or
-use absolute paths. To hack around it, add '#/blah'. This will link
-blah.lib from the directory where SConstruct resides.
-
Compiler variables:
DC - The name of the D compiler to use. Defaults to dmd or gdmd,
whichever is found.
@@ -36,7 +31,7 @@ Lib tool variables:
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -58,7 +53,7 @@ Lib tool variables:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/dmd.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/dmd.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import subprocess
@@ -69,7 +64,7 @@ import SCons.Defaults
import SCons.Scanner.D
import SCons.Tool
-import SCons.Tool.DCommon
+import SCons.Tool.DCommon as DCommon
def generate(env):
@@ -80,7 +75,7 @@ def generate(env):
static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter)
shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter)
- env['DC'] = env.Detect(['dmd', 'gdmd'])
+ env['DC'] = env.Detect(['dmd', 'ldmd2', 'gdmd']) or 'dmd'
env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -of$TARGET $SOURCES'
env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}'
@@ -96,7 +91,7 @@ def generate(env):
env['DDEBUG'] = []
if env['DC']:
- SCons.Tool.DCommon.addDPATHToEnv(env, env['DC'])
+ DCommon.addDPATHToEnv(env, env['DC'])
env['DINCPREFIX'] = '-I'
env['DINCSUFFIX'] = ''
@@ -112,9 +107,9 @@ def generate(env):
env['DLINKFLAGS'] = SCons.Util.CLVar('')
env['DLINKCOM'] = '$DLINK -of$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
- env['DSHLINK'] = '$DC'
- env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=libphobos2.so')
- env['SHDLINKCOM'] = '$DLINK -of$TARGET $DSHLINKFLAGS $__DSHLIBVERSIONFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
+ env['SHDLINK'] = '$DC'
+ env['SHDLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=libphobos2.so')
+ env['SHDLINKCOM'] = '$DLINK -of$TARGET $SHDLINKFLAGS $__SHDLIBVERSIONFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l'
env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else ''
@@ -124,37 +119,40 @@ def generate(env):
env['DLIBDIRSUFFIX'] = ''
env['_DLIBDIRFLAGS'] = '${_concat(DLIBDIRPREFIX, LIBPATH, DLIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
-
env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
- #env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}'
+ # env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}'
env['DLIBFLAGPREFIX'] = '-'
env['DLIBFLAGSUFFIX'] = ''
# __RPATH is set to $_RPATH in the platform specification if that
# platform supports it.
- env['DRPATHPREFIX'] = '-L-rpath='
+ env['DRPATHPREFIX'] = '-L-rpath,' if env['PLATFORM'] == 'darwin' else '-L-rpath='
env['DRPATHSUFFIX'] = ''
env['_DRPATH'] = '${_concat(DRPATHPREFIX, RPATH, DRPATHSUFFIX, __env__)}'
# Support for versioned libraries
- env['_DSHLIBVERSIONFLAGS'] = '$DSHLIBVERSIONFLAGS -L-soname=$_DSHLIBSONAME'
- env['_DSHLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}'
+ env['_SHDLIBVERSIONFLAGS'] = '$SHDLIBVERSIONFLAGS -L-soname=$_SHDLIBSONAME'
+ env['_SHDLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}'
# NOTE: this is a quick hack, the soname will only work if there is
# c/c++ linker loaded which provides callback for the ShLibSonameGenerator
env['DShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator
- # NOTE: this is only for further reference, currently $DSHLIBVERSION does
+ # NOTE: this is only for further reference, currently $SHDLIBVERSION does
# not work, the user must use $SHLIBVERSION
- env['DSHLIBVERSION'] = '$SHLIBVERSION'
- env['DSHLIBVERSIONFLAGS'] = []
+ env['SHDLIBVERSION'] = '$SHLIBVERSION'
+ env['SHDLIBVERSIONFLAGS'] = []
- SCons.Tool.createStaticLibBuilder(env)
+ env['BUILDERS']['ProgramAllAtOnce'] = SCons.Builder.Builder(
+ action='$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -of$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS',
+ emitter=DCommon.allAtOnceEmitter,
+ )
def exists(env):
- return env.Detect(['dmd', 'gdmd'])
+ return env.Detect(['dmd', 'ldmd2', 'gdmd'])
+
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/docbook/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/docbook/__init__.py
index 83b3ecd904f..d7d10c00fc2 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/docbook/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/docbook/__init__.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -43,6 +43,8 @@ import SCons.Script
import SCons.Tool
import SCons.Util
+
+__debug_tool_location = False
# Get full path to this script
scriptpath = os.path.dirname(os.path.realpath(__file__))
@@ -157,8 +159,15 @@ def __create_output_dir(base_dir):
#
# Supported command line tools and their call "signature"
#
+xsltproc_com_priority = ['xsltproc', 'saxon', 'saxon-xslt', 'xalan']
+
+# TODO: Set minimum version of saxon-xslt to be 8.x (lower than this only supports xslt 1.0.
+# see: http://saxon.sourceforge.net/saxon6.5.5/
+# see: http://saxon.sourceforge.net/
xsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE',
'saxon' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
+ # Note if saxon-xslt is version 5.5 the proper arguments are: (swap order of docbook_xsl and source)
+ # 'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $SOURCE $DOCBOOK_XSL $DOCBOOK_XSLTPROCPARAMS',
'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'}
xmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'}
@@ -166,19 +175,27 @@ fop_com = {'fop' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET',
'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET',
'jw' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET'}
-def __detect_cl_tool(env, chainkey, cdict):
+def __detect_cl_tool(env, chainkey, cdict, cpriority=None):
"""
Helper function, picks a command line tool from the list
and initializes its environment variables.
"""
if env.get(chainkey,'') == '':
clpath = ''
- for cltool in cdict:
+
+ if cpriority is None:
+ cpriority = cdict.keys()
+ for cltool in cpriority:
+ if __debug_tool_location:
+ print("DocBook: Looking for %s"%cltool)
clpath = env.WhereIs(cltool)
if clpath:
+ if __debug_tool_location:
+ print("DocBook: Found:%s"%cltool)
env[chainkey] = clpath
if not env[chainkey + 'COM']:
env[chainkey + 'COM'] = cdict[cltool]
+ break
def _detect(env):
"""
@@ -192,10 +209,10 @@ def _detect(env):
if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)):
# Try to find the XSLT processors
- __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com)
+ __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com, xsltproc_com_priority)
__detect_cl_tool(env, 'DOCBOOK_XMLLINT', xmllint_com)
- __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com)
+ __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com, ['fop','xep','jw'])
#
# Scanners
@@ -335,7 +352,7 @@ def __build_lxml(target, source, env):
result = transform(doc)
try:
- of = open(str(target[0]), "w")
+ of = open(str(target[0]), "wb")
of.write(of.write(etree.tostring(result, pretty_print=True)))
of.close()
except:
@@ -461,7 +478,7 @@ def DocbookEpub(env, target, source=None, *args, **kw):
# Create xpath context
xpath_context = doc.xpathNewContext()
# Register namespaces
- for key, val in nsmap.iteritems():
+ for key, val in nsmap.items():
xpath_context.xpathRegisterNs(key, val)
if hasattr(opf, 'xpathEval') and xpath_context:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvi.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvi.py
index cc3c8ca63fc..41d16b74b17 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvi.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvi.py
@@ -5,7 +5,7 @@ Common DVI Builder definition for various other Tool modules that use it.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ Common DVI Builder definition for various other Tool modules that use it.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/dvi.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/dvi.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Builder
import SCons.Tool
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvipdf.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvipdf.py
index d6a5dbbe6a3..33c74e28b93 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvipdf.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvipdf.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ 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.
-__revision__ = "src/engine/SCons/Tool/dvipdf.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/dvipdf.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Defaults
@@ -87,7 +87,7 @@ def PDFEmitter(target, source, env):
"""
def strip_suffixes(n):
return not SCons.Util.splitext(str(n))[1] in ['.aux', '.log']
- source = list(filter(strip_suffixes, source))
+ source = [src for src in source if strip_suffixes(src)]
return (target, source)
def generate(env):
@@ -100,7 +100,7 @@ def generate(env):
if DVIPDFAction is None:
DVIPDFAction = SCons.Action.Action(DviPdfFunction, strfunction = DviPdfStrFunction)
- import pdf
+ from . import pdf
pdf.generate(env)
bld = env['BUILDERS']['PDF']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvips.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvips.py
index dcffa48c12f..a2175312039 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvips.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/dvips.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/dvips.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/dvips.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Builder
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f03.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f03.py
index 9e804d21e89..902994c5e54 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f03.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f03.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,12 +31,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/f03.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f03.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
import SCons.Util
-import fortran
+from . import fortran
from SCons.Tool.FortranCommon import add_all_to_env, add_f03_to_env
compilers = ['f03']
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f08.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f08.py
new file mode 100644
index 00000000000..f127deaf5ec
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f08.py
@@ -0,0 +1,65 @@
+"""engine.SCons.Tool.f08
+
+Tool-specific initialization for the generic Posix f08 Fortran compiler.
+
+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 __future__ import absolute_import
+
+#
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/f08.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+import SCons.Defaults
+import SCons.Tool
+import SCons.Util
+from . import fortran
+from SCons.Tool.FortranCommon import add_all_to_env, add_f08_to_env
+
+compilers = ['f08']
+
+def generate(env):
+ add_all_to_env(env)
+ add_f08_to_env(env)
+
+ fcomp = env.Detect(compilers) or 'f08'
+ env['F08'] = fcomp
+ env['SHF08'] = fcomp
+
+ env['FORTRAN'] = fcomp
+ env['SHFORTRAN'] = fcomp
+
+
+def exists(env):
+ return env.Detect(compilers)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f77.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f77.py
index 14cfc952dfc..bceb7852ec5 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f77.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f77.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/f77.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f77.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Scanner.Fortran
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f90.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f90.py
index 04ea509fc2a..4c8cdeed0e0 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f90.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f90.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/f90.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f90.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Scanner.Fortran
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f95.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f95.py
index 7398064a22e..5f7c74bf82b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/f95.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/f95.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,12 +31,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/f95.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f95.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
import SCons.Util
-import fortran
+from . import fortran
from SCons.Tool.FortranCommon import add_all_to_env, add_f95_to_env
compilers = ['f95']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/filesystem.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/filesystem.py
index 8d11a4f933c..c99bdfae737 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/filesystem.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/filesystem.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/filesystem.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/filesystem.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons
from SCons.Tool.install import copyFunc
@@ -66,7 +66,7 @@ def generate(env):
try:
env['BUILDERS']['CopyTo']
env['BUILDERS']['CopyAs']
- except KeyError, e:
+ except KeyError as e:
global copyToBuilder
if copyToBuilder is None:
copyToBuilder = SCons.Builder.Builder(
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/fortran.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/fortran.py
index e536a84d597..a82d42f1267 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/fortran.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/fortran.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/fortran.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/fortran.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import re
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/g++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/g++.py
new file mode 100644
index 00000000000..6ab9eab4e8c
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/g++.py
@@ -0,0 +1,45 @@
+"""SCons.Tool.g++
+
+Tool-specific initialization for g++.
+
+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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/g++.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+
+#forward proxy to the preffered cxx version
+from SCons.Tool.gxx import *
+
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/g77.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/g77.py
index f685b01e4e5..3e81048f6ec 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/g77.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/g77.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/g77.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/g77.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gas.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gas.py
index acebe5d1a25..8706d14d4ac 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gas.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gas.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,9 +31,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/gas.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gas.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-as_module = __import__('as', globals(), locals(), [])
+try:
+ as_module = __import__('as', globals(), locals(), [])
+except:
+ as_module = __import__(__package__+'.as', globals(), locals(), ['*'])
assemblers = ['as', 'gas']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gcc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gcc.py
index e4032eaf447..ace6d9f6ed3 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gcc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gcc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,9 +31,9 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/gcc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gcc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import cc
+from . import cc
import os
import re
import subprocess
@@ -42,6 +42,7 @@ import SCons.Util
compilers = ['gcc', 'cc']
+
def generate(env):
"""Add Builders and construction variables for gcc to an Environment."""
@@ -59,34 +60,36 @@ def generate(env):
if version:
env['CCVERSION'] = version
+
def exists(env):
# is executable, and is a GNU compiler (or accepts '--version' at least)
return detect_version(env, env.Detect(env.get('CC', compilers)))
+
def detect_version(env, cc):
"""Return the version of the GNU compiler, or None if it is not a GNU compiler."""
cc = env.subst(cc)
if not cc:
return None
version = None
- #pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'],
+ # pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'],
pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'],
- stdin = 'devnull',
- stderr = 'devnull',
- stdout = subprocess.PIPE)
+ stdin='devnull',
+ stderr='devnull',
+ stdout=subprocess.PIPE)
# -dumpversion was added in GCC 3.0. As long as we're supporting
# GCC versions older than that, we should use --version and a
# regular expression.
- #line = pipe.stdout.read().strip()
- #if line:
+ # line = pipe.stdout.read().strip()
+ # if line:
# version = line
- line = pipe.stdout.readline()
+ line = SCons.Util.to_str(pipe.stdout.readline())
match = re.search(r'[0-9]+(\.[0-9]+)+', line)
if match:
version = match.group(0)
# Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer:
# So continue with reading to let the child process actually terminate.
- while pipe.stdout.readline():
+ while SCons.Util.to_str(pipe.stdout.readline()):
pass
ret = pipe.wait()
if ret != 0:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gdc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gdc.py
index 1c41858c96b..eb516aa88d9 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gdc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gdc.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
"""SCons.Tool.gdc
Tool-specific initialization for the GDC compiler.
@@ -24,7 +26,7 @@ Lib tool variables:
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -46,13 +48,13 @@ Lib tool variables:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/gdc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gdc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Defaults
import SCons.Tool
-import SCons.Tool.DCommon
+import SCons.Tool.DCommon as DCommon
def generate(env):
@@ -63,7 +65,7 @@ def generate(env):
static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter)
shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter)
- env['DC'] = env.Detect('gdc')
+ env['DC'] = env.Detect('gdc') or 'gdc'
env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -o $TARGET $SOURCES'
env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}'
@@ -79,7 +81,7 @@ def generate(env):
env['DDEBUG'] = []
if env['DC']:
- SCons.Tool.DCommon.addDPATHToEnv(env, env['DC'])
+ DCommon.addDPATHToEnv(env, env['DC'])
env['DINCPREFIX'] = '-I'
env['DINCSUFFIX'] = ''
@@ -95,9 +97,9 @@ def generate(env):
env['DLINKFLAGS'] = SCons.Util.CLVar('')
env['DLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
- env['DSHLINK'] = '$DC'
- env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared')
- env['SHDLINKCOM'] = '$DLINK -o $TARGET $DSHLINKFLAGS $__DSHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+ env['SHDLINK'] = '$DC'
+ env['SHDLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -shared-libphobos')
+ env['SHDLINKCOM'] = '$DLINK -o $TARGET $SHDLINKFLAGS $__SHDLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
@@ -116,22 +118,26 @@ def generate(env):
env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
# Support for versioned libraries
- env['_DSHLIBVERSIONFLAGS'] = '$DSHLIBVERSIONFLAGS -Wl,-soname=$_DSHLIBSONAME'
- env['_DSHLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}'
+ env['_SHDLIBVERSIONFLAGS'] = '$SHDLIBVERSIONFLAGS -Wl,-soname=$_SHDLIBSONAME'
+ env['_SHDLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}'
# NOTE: this is a quick hack, the soname will only work if there is
# c/c++ linker loaded which provides callback for the ShLibSonameGenerator
env['DShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator
- # NOTE: this is only for further reference, currently $DSHLIBVERSION does
+ # NOTE: this is only for further reference, currently $SHDLIBVERSION does
# not work, the user must use $SHLIBVERSION
- env['DSHLIBVERSION'] = '$SHLIBVERSION'
- env['DSHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS'
+ env['SHDLIBVERSION'] = '$SHLIBVERSION'
+ env['SHDLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS'
- SCons.Tool.createStaticLibBuilder(env)
+ env['BUILDERS']['ProgramAllAtOnce'] = SCons.Builder.Builder(
+ action='$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -o $TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS',
+ emitter=DCommon.allAtOnceEmitter,
+ )
def exists(env):
return env.Detect('gdc')
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gettext.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gettext_tool.py
index 99fbd323773..0d9a28b6533 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gettext.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gettext_tool.py
@@ -2,7 +2,7 @@
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -23,14 +23,26 @@
# 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__ = "src/engine/SCons/Tool/gettext.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gettext_tool.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
#############################################################################
def generate(env,**kw):
+ import sys
+ import os
import SCons.Tool
+ from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
+ from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
+
from SCons.Tool.GettextCommon \
import _translate, tool_list
for t in tool_list(env['PLATFORM'], env):
+ if sys.platform == 'win32':
+ tool = SCons.Tool.find_program_path(env, t, default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
+ if tool:
+ tool_bin_dir = os.path.dirname(tool)
+ env.AppendENVPath('PATH', tool_bin_dir)
+ else:
+ SCons.Warnings.Warning(t + ' tool requested, but binary not found in ENV PATH')
env.Tool(t)
env.AddMethod(_translate, 'Translate')
#############################################################################
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gfortran.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gfortran.py
index 62f434ea9ca..b41f2157877 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gfortran.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gfortran.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,11 +32,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/gfortran.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gfortran.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
-import fortran
+from . import fortran
def generate(env):
"""Add Builders and construction variables for gfortran to an
@@ -54,6 +54,8 @@ def generate(env):
env['INC%sPREFIX' % dialect] = "-I"
env['INC%sSUFFIX' % dialect] = ""
+ env['FORTRANMODDIRPREFIX'] = "-J"
+
def exists(env):
return env.Detect('gfortran')
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gnulink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gnulink.py
index 3df077ba3c9..5c86d5ac6a8 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gnulink.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gnulink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/gnulink.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gnulink.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
import SCons.Tool
@@ -39,7 +39,7 @@ import os
import sys
import re
-import link
+from . import link
def generate(env):
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gs.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gs.py
index b0874fda481..cf7fd1c202c 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/gs.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gs.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/gs.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gs.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Builder
@@ -62,12 +62,12 @@ def generate(env):
if GhostscriptAction is None:
GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR')
- import pdf
+ from SCons.Tool import pdf
pdf.generate(env)
bld = env['BUILDERS']['PDF']
bld.add_action('.ps', GhostscriptAction)
- except ImportError, e:
+ except ImportError as e:
pass
gsbuilder = SCons.Builder.Builder(action = SCons.Action.Action('$GSCOM', '$GSCOMSTR'))
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/g++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gxx.py
index f66adc1c491..2f05518a03c 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/g++.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/gxx.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/g++.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gxx.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import re
@@ -40,20 +40,20 @@ import subprocess
import SCons.Tool
import SCons.Util
-import gcc
-
-cplusplus = __import__('c++', globals(), locals(), [])
+from . import gcc
+from . import cxx
compilers = ['g++']
+
def generate(env):
"""Add Builders and construction variables for g++ to an Environment."""
static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
if 'CXX' not in env:
- env['CXX'] = env.Detect(compilers) or compilers[0]
+ env['CXX'] = env.Detect(compilers) or compilers[0]
- cplusplus.generate(env)
+ cxx.generate(env)
# platform specific settings
if env['PLATFORM'] == 'aix':
@@ -69,6 +69,7 @@ def generate(env):
if version:
env['CXXVERSION'] = version
+
def exists(env):
# is executable, and is a GNU compiler (or accepts '--version' at least)
return gcc.detect_version(env, env.Detect(env.get('CXX', compilers)))
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpc++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpc++.py
new file mode 100644
index 00000000000..7e07a52f64d
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpc++.py
@@ -0,0 +1,45 @@
+"""SCons.Tool.hpc++
+
+Tool-specific initialization for c++ on HP/UX.
+
+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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/hpc++.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+
+#forward proxy to the preffered cxx version
+from SCons.Tool.hpcxx import *
+
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hpcc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpcc.py
index 25835942e5f..67b28f70cfa 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hpcc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpcc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,11 +30,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/hpcc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/hpcc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
-import cc
+from . import cc
def generate(env):
"""Add Builders and construction variables for aCC & cc to an Environment."""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hpc++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpcxx.py
index 8e79af4e2f3..8a5dfaa4dab 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hpc++.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hpcxx.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,13 +31,16 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/hpc++.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/hpcxx.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import SCons.Util
-cplusplus = __import__('c++', globals(), locals(), [])
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('cxx', globals(), locals(), [])
+
acc = None
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hplink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hplink.py
index 0b7777a412c..e6aa8d49408 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/hplink.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/hplink.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,14 +30,14 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/hplink.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/hplink.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
import SCons.Util
-import link
+from . import link
ccLinker = None
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/icc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/icc.py
index f6f07116854..ce46133da45 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/icc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/icc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,9 +31,9 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/icc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/icc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import cc
+from . import cc
def generate(env):
"""Add Builders and construction variables for the OS/2 to an Environment."""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/icl.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/icl.py
index b14adf6dca8..0232bf481e2 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/icl.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/icl.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/icl.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/icl.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Tool.intelc
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ifl.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ifl.py
index e8b30910811..d6675284f30 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ifl.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ifl.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,11 +31,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/ifl.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ifl.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
from SCons.Scanner.Fortran import FortranScan
-from FortranCommon import add_all_to_env
+from .FortranCommon import add_all_to_env
def generate(env):
"""Add Builders and construction variables for ifl to an Environment."""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ifort.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ifort.py
index a00e2491d95..24f591edaa5 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ifort.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ifort.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,11 +32,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/ifort.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ifort.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
from SCons.Scanner.Fortran import FortranScan
-from FortranCommon import add_all_to_env
+from .FortranCommon import add_all_to_env
def generate(env):
"""Add Builders and construction variables for ifort to an Environment."""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ilink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ilink.py
index 4532d9b12b0..b6a9a3e6a27 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ilink.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ilink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/ilink.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ilink.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ilink32.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ilink32.py
index a4ccff0115c..25e29f96f95 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ilink32.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ilink32.py
@@ -5,7 +5,7 @@ XXX
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ XXX
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/ilink32.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ilink32.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Tool
import SCons.Tool.bcc32
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/install.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/install.py
index f3e4227eb79..ec552bdbf8c 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/install.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/install.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,8 +29,9 @@ 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.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Tool/install.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/install.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import re
@@ -48,7 +49,7 @@ _UNIQUE_INSTALLED_FILES = None
class CopytreeError(EnvironmentError):
pass
-
+
# This is a patched version of shutil.copytree from python 2.5. It
# doesn't fail if the dir exists, which regular copytree does
# (annoyingly). Note the XXX comment in the docstring.
@@ -83,21 +84,21 @@ def scons_copytree(src, dst, symlinks=False):
else:
shutil.copy2(srcname, dstname)
# XXX What about devices, sockets etc.?
- except (IOError, os.error), why:
+ except (IOError, os.error) as why:
errors.append((srcname, dstname, str(why)))
# catch the CopytreeError from the recursive copytree so that we can
# continue with other files
- except CopytreeError, err:
+ except CopytreeError as err:
errors.extend(err.args[0])
try:
shutil.copystat(src, dst)
except SCons.Util.WinError:
# can't copy file access times on Windows
pass
- except OSError, why:
+ except OSError as why:
errors.extend((src, dst, str(why)))
if errors:
- raise CopytreeError, errors
+ raise CopytreeError(errors)
#
@@ -165,10 +166,9 @@ def listShlibLinksToInstall(dest, source, env):
def installShlibLinks(dest, source, env):
"""If we are installing a versioned shared library create the required links."""
Verbose = False
-
symlinks = listShlibLinksToInstall(dest, source, env)
if Verbose:
- print 'installShlibLinks: symlinks=%r' % SCons.Tool.StringizeLibSymlinks(symlinks)
+ print('installShlibLinks: symlinks={:r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks)))
if symlinks:
SCons.Tool.CreateLibSymlinks(env, symlinks)
return
@@ -244,12 +244,10 @@ def add_versioned_targets_to_INSTALLED_FILES(target, source, env):
Verbose = False
_INSTALLED_FILES.extend(target)
if Verbose:
- print "add_versioned_targets_to_INSTALLED_FILES: target=%r" % map(str, target)
-
+ print("add_versioned_targets_to_INSTALLED_FILES: target={:r}".format(list(map(str, target))))
symlinks = listShlibLinksToInstall(target[0], source, env)
if symlinks:
SCons.Tool.EmitLibSymlinks(env, symlinks, target[0])
-
_UNIQUE_INSTALLED_FILES = None
return (target, source)
@@ -307,6 +305,7 @@ def InstallBuilderWrapper(env, target=None, source=None, dir=None, **kw):
tgt.extend(BaseInstallBuilder(env, target, src, **kw))
return tgt
+
def InstallAsBuilderWrapper(env, target=None, source=None, **kw):
result = []
for src, tgt in map(lambda x, y: (x, y), source, target):
@@ -315,6 +314,7 @@ def InstallAsBuilderWrapper(env, target=None, source=None, **kw):
BaseVersionedInstallBuilder = None
+
def InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw):
if target and dir:
import SCons.Errors
@@ -346,6 +346,7 @@ def InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw
added = None
+
def generate(env):
from SCons.Script import AddOption, GetOption
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/intelc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/intelc.py
index 24b1dc527e9..08359e1de1d 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/intelc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/intelc.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,9 +30,9 @@ 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.
-from __future__ import division
+from __future__ import division, print_function
-__revision__ = "src/engine/SCons/Tool/intelc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/intelc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import math, sys, os.path, glob, string, re
@@ -73,7 +73,7 @@ def linux_ver_normalize(vstr):
m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)', vstr)
if m:
vmaj,vmin,build = m.groups()
- return float(vmaj) * 10. + float(vmin) + float(build) / 1000.;
+ return float(vmaj) * 10. + float(vmin) + float(build) / 1000.
else:
f = float(vstr)
if is_windows:
@@ -245,17 +245,16 @@ def get_all_compiler_versions():
# Registry points to nonexistent dir. Ignore this
# version.
value = get_intel_registry_value('ProductDir', subkey, 'IA32')
- except MissingRegistryError, e:
+ except MissingRegistryError as e:
# Registry key is left dangling (potentially
# after uninstalling).
- print \
- "scons: *** Ignoring the registry key for the Intel compiler version %s.\n" \
+ print("scons: *** Ignoring the registry key for the Intel compiler version %s.\n" \
"scons: *** It seems that the compiler was uninstalled and that the registry\n" \
- "scons: *** was not cleaned up properly.\n" % subkey
+ "scons: *** was not cleaned up properly.\n" % subkey)
else:
- print "scons: *** Ignoring "+str(value)
+ print("scons: *** Ignoring "+str(value))
i = i + 1
except EnvironmentError:
@@ -293,7 +292,7 @@ def get_all_compiler_versions():
# JPA: For the new version of Intel compiler 2016.1.
m = re.search(r'([0-9]{0,4})(?:_sp\d*)?\.([0-9][0-9.]*)$', d)
if m:
- versions.append("%s.%s"%(m.group(1), m,group(2)))
+ versions.append("%s.%s"%(m.group(1), m.group(2)))
def keyfunc(str):
"""Given a dot-separated version string, return a tuple of ints representing it."""
@@ -486,8 +485,8 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0):
bindir="bin"
libdir="lib"
if verbose:
- print "Intel C compiler: using version %s (%g), abi %s, in '%s/%s'"%\
- (repr(version), linux_ver_normalize(version),abi,topdir,bindir)
+ print("Intel C compiler: using version %s (%g), abi %s, in '%s/%s'"%\
+ (repr(version), linux_ver_normalize(version),abi,topdir,bindir))
if is_linux:
# Show the actual compiler version by running the compiler.
os.system('%s/%s/icc --version'%(topdir,bindir))
@@ -501,14 +500,14 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0):
'LIB' : libdir,
'PATH' : bindir,
'LD_LIBRARY_PATH' : libdir}
- for p in paths.keys():
+ for p in list(paths.keys()):
env.PrependENVPath(p, os.path.join(topdir, paths[p]))
if is_mac:
paths={'INCLUDE' : 'include',
'LIB' : libdir,
'PATH' : bindir,
'LD_LIBRARY_PATH' : libdir}
- for p in paths.keys():
+ for p in list(paths.keys()):
env.PrependENVPath(p, os.path.join(topdir, paths[p]))
if is_windows:
# env key reg valname default subdir of top
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ipkg.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ipkg.py
index 474f762d9bd..2c7ec42b43e 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ipkg.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ipkg.py
@@ -11,7 +11,7 @@ packages fake_root.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -33,7 +33,7 @@ packages fake_root.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/ipkg.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ipkg.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
@@ -44,20 +44,26 @@ def generate(env):
try:
bld = env['BUILDERS']['Ipkg']
except KeyError:
- bld = SCons.Builder.Builder( action = '$IPKGCOM',
- suffix = '$IPKGSUFFIX',
- source_scanner = None,
- target_scanner = None)
+ bld = SCons.Builder.Builder(action='$IPKGCOM',
+ suffix='$IPKGSUFFIX',
+ source_scanner=None,
+ target_scanner=None)
env['BUILDERS']['Ipkg'] = bld
- env['IPKG'] = 'ipkg-build'
- env['IPKGCOM'] = '$IPKG $IPKGFLAGS ${SOURCE}'
- env['IPKGUSER'] = os.popen('id -un').read().strip()
- env['IPKGGROUP'] = os.popen('id -gn').read().strip()
- env['IPKGFLAGS'] = SCons.Util.CLVar('-o $IPKGUSER -g $IPKGGROUP')
+
+ env['IPKG'] = 'ipkg-build'
+ env['IPKGCOM'] = '$IPKG $IPKGFLAGS ${SOURCE}'
+
+ if env.WhereIs('id'):
+ env['IPKGUSER'] = os.popen('id -un').read().strip()
+ env['IPKGGROUP'] = os.popen('id -gn').read().strip()
+ env['IPKGFLAGS'] = SCons.Util.CLVar('-o $IPKGUSER -g $IPKGGROUP')
env['IPKGSUFFIX'] = '.ipk'
def exists(env):
+ """
+ Can we find the tool
+ """
return env.Detect('ipkg-build')
# Local Variables:
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/jar.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/jar.py
new file mode 100644
index 00000000000..f7f0e26c66a
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/jar.py
@@ -0,0 +1,241 @@
+"""SCons.Tool.jar
+
+Tool-specific initialization for jar.
+
+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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/jar.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+import os
+
+import SCons.Subst
+import SCons.Util
+from SCons.Node.FS import _my_normcase
+from SCons.Tool.JavaCommon import get_java_install_dirs
+
+
+def jarSources(target, source, env, for_signature):
+ """Only include sources that are not a manifest file."""
+ try:
+ env['JARCHDIR']
+ except KeyError:
+ jarchdir_set = False
+ else:
+ jarchdir_set = True
+ jarchdir = env.subst('$JARCHDIR', target=target, source=source)
+ if jarchdir:
+ jarchdir = env.fs.Dir(jarchdir)
+ result = []
+ for src in source:
+ contents = src.get_text_contents()
+ if not contents.startswith("Manifest-Version"):
+ if jarchdir_set:
+ _chdir = jarchdir
+ else:
+ try:
+ _chdir = src.attributes.java_classdir
+ except AttributeError:
+ _chdir = None
+ if _chdir:
+ # If we are changing the dir with -C, then sources should
+ # be relative to that directory.
+ src = SCons.Subst.Literal(src.get_path(_chdir))
+ result.append('-C')
+ result.append(_chdir)
+ result.append(src)
+ return result
+
+def jarManifest(target, source, env, for_signature):
+ """Look in sources for a manifest file, if any."""
+ for src in source:
+ contents = src.get_text_contents()
+ if contents.startswith("Manifest-Version"):
+ return src
+ return ''
+
+def jarFlags(target, source, env, for_signature):
+ """If we have a manifest, make sure that the 'm'
+ flag is specified."""
+ jarflags = env.subst('$JARFLAGS', target=target, source=source)
+ for src in source:
+ contents = src.get_text_contents()
+ if contents.startswith("Manifest-Version"):
+ if not 'm' in jarflags:
+ return jarflags + 'm'
+ break
+ return jarflags
+
+def Jar(env, target = None, source = [], *args, **kw):
+ """
+ A pseudo-Builder wrapper around the separate Jar sources{File,Dir}
+ Builders.
+ """
+
+ # jar target should not be a list so assume they passed
+ # no target and want implicit target to be made and the arg
+ # was actaully the list of sources
+ if SCons.Util.is_List(target) and source == []:
+ SCons.Warnings.Warning("Making implicit target jar file, " +
+ "and treating the list as sources")
+ source = target
+ target = None
+
+ # mutiple targets pass so build each target the same from the
+ # same source
+ #TODO Maybe this should only be done once, and the result copied
+ # for each target since it should result in the same?
+ if SCons.Util.is_List(target) and SCons.Util.is_List(source):
+ jars = []
+ for single_target in target:
+ jars += env.Jar( target = single_target, source = source, *args, **kw)
+ return jars
+
+ # they passed no target so make a target implicitly
+ if target is None:
+ try:
+ # make target from the first source file
+ target = os.path.splitext(str(source[0]))[0] + env.subst('$JARSUFFIX')
+ except:
+ # something strange is happening but attempt anyways
+ SCons.Warnings.Warning("Could not make implicit target from sources, using directory")
+ target = os.path.basename(str(env.Dir('.'))) + env.subst('$JARSUFFIX')
+
+ # make lists out of our target and sources
+ if not SCons.Util.is_List(target):
+ target = [target]
+ if not SCons.Util.is_List(source):
+ source = [source]
+
+ # setup for checking through all the sources and handle accordingly
+ java_class_suffix = env.subst('$JAVACLASSSUFFIX')
+ java_suffix = env.subst('$JAVASUFFIX')
+ target_nodes = []
+
+ # function for determining what to do with a file and not a directory
+ # if its already a class file then it can be used as a
+ # source for jar, otherwise turn it into a class file then
+ # return the source
+ def file_to_class(s):
+ if _my_normcase(str(s)).endswith(java_suffix):
+ return env.JavaClassFile(source = s, *args, **kw)
+ else:
+ return [env.fs.File(s)]
+
+ # function for calling the JavaClassDir builder if a directory is
+ # passed as a source to Jar builder. The JavaClassDir builder will
+ # return an empty list if there were not target classes built from
+ # the directory, in this case assume the user wanted the directory
+ # copied into the jar as is (it contains other files such as
+ # resources or class files compiled from proir commands)
+ # TODO: investigate the expexcted behavior for directories that
+ # have mixed content, such as Java files along side other files
+ # files.
+ def dir_to_class(s):
+ dir_targets = env.JavaClassDir(source = s, *args, **kw)
+ if(dir_targets == []):
+ # no classes files could be built from the source dir
+ # so pass the dir as is.
+ return [env.fs.Dir(s)]
+ else:
+ return dir_targets
+
+ # loop through the sources and handle each accordingly
+ # the goal here is to get all the source files into a class
+ # file or a directory that contains class files
+ for s in SCons.Util.flatten(source):
+ s = env.subst(s)
+ if isinstance(s, SCons.Node.FS.Base):
+ if isinstance(s, SCons.Node.FS.File):
+ # found a file so make sure its a class file
+ target_nodes.extend(file_to_class(s))
+ else:
+ # found a dir so get the class files out of it
+ target_nodes.extend(dir_to_class(s))
+ else:
+ try:
+ # source is string try to convert it to file
+ target_nodes.extend(file_to_class(env.fs.File(s)))
+ continue
+ except:
+ pass
+
+ try:
+ # source is string try to covnert it to dir
+ target_nodes.extend(dir_to_class(env.fs.Dir(s)))
+ continue
+ except:
+ pass
+
+ SCons.Warnings.Warning("File: " + str(s) + " could not be identified as File or Directory, skipping.")
+
+ # at this point all our sources have been converted to classes or directories of class
+ # so pass it to the Jar builder
+ return env.JarFile(target = target, source = target_nodes, *args, **kw)
+
+def generate(env):
+ """Add Builders and construction variables for jar to an Environment."""
+ SCons.Tool.CreateJarBuilder(env)
+
+ SCons.Tool.CreateJavaFileBuilder(env)
+ SCons.Tool.CreateJavaClassFileBuilder(env)
+ SCons.Tool.CreateJavaClassDirBuilder(env)
+
+ env.AddMethod(Jar)
+
+ if env['PLATFORM'] == 'win32':
+ # Ensure that we have a proper path for clang
+ jar = SCons.Tool.find_program_path(env, 'jar',
+ default_paths=get_java_install_dirs(env['PLATFORM']))
+ if jar:
+ jar_bin_dir = os.path.dirname(jar)
+ env.AppendENVPath('PATH', jar_bin_dir)
+
+ env['JAR'] = 'jar'
+ env['JARFLAGS'] = SCons.Util.CLVar('cf')
+ env['_JARFLAGS'] = jarFlags
+ env['_JARMANIFEST'] = jarManifest
+ env['_JARSOURCES'] = jarSources
+ env['_JARCOM'] = '$JAR $_JARFLAGS $TARGET $_JARMANIFEST $_JARSOURCES'
+ env['JARCOM'] = "${TEMPFILE('$_JARCOM','$JARCOMSTR')}"
+ env['JARSUFFIX'] = '.jar'
+
+def exists(env):
+ # As reported by Jan Nijtmans in issue #2730, the simple
+ # return env.Detect('jar')
+ # doesn't always work during initialization. For now, we
+ # stop trying to detect an executable (analogous to the
+ # javac Builder).
+ # TODO: Come up with a proper detect() routine...and enable it.
+ return 1
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/javac.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/javac.py
index 51dd199bdce..5ac544ae30e 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/javac.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/javac.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,15 +30,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.
-__revision__ = "src/engine/SCons/Tool/javac.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/javac.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
+from collections import OrderedDict
import SCons.Action
import SCons.Builder
from SCons.Node.FS import _my_normcase
-from SCons.Tool.JavaCommon import parse_java_file
+from SCons.Tool.JavaCommon import parse_java_file, get_java_install_dirs, get_java_include_paths
import SCons.Util
def classname(path):
@@ -70,7 +71,7 @@ def emit_java_classes(target, source, env):
if isinstance(entry, SCons.Node.FS.File):
slist.append(entry)
elif isinstance(entry, SCons.Node.FS.Dir):
- result = SCons.Util.OrderedDict()
+ result = OrderedDict()
dirnode = entry.rdir()
def find_java_files(arg, dirpath, filenames):
java_files = sorted([n for n in filenames
@@ -207,6 +208,21 @@ def generate(env):
env.AddMethod(Java)
+ version = env.get('JAVAVERSION', None)
+
+ javac = SCons.Tool.find_program_path(env, 'javac')
+ if env['PLATFORM'] == 'win32':
+ # Ensure that we have a proper path for javac
+ paths=get_java_install_dirs(env['PLATFORM'], version=version)
+ javac = SCons.Tool.find_program_path(env, 'javac',
+ default_paths=paths)
+ if javac:
+ javac_bin_dir = os.path.dirname(javac)
+ env.AppendENVPath('PATH', javac_bin_dir)
+
+ env['JAVAINCLUDES'] = get_java_include_paths(env, javac, version)
+
+
env['JAVAC'] = 'javac'
env['JAVACFLAGS'] = SCons.Util.CLVar('')
env['JAVABOOTCLASSPATH'] = []
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/javah.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/javah.py
index c1607728817..c25952d5737 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/javah.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/javah.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/javah.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/javah.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
@@ -40,6 +40,8 @@ import SCons.Builder
import SCons.Node.FS
import SCons.Tool.javac
import SCons.Util
+from SCons.Tool.JavaCommon import get_java_install_dirs
+
def emit_java_headers(target, source, env):
"""Create and return lists of Java stub header files that will
@@ -120,6 +122,14 @@ def generate(env):
java_javah = SCons.Tool.CreateJavaHBuilder(env)
java_javah.emitter = emit_java_headers
+ if env['PLATFORM'] == 'win32':
+ # Ensure that we have a proper path for clang
+ javah = SCons.Tool.find_program_path(env, 'javah',
+ default_paths=get_java_install_dirs(env['PLATFORM']))
+ if javah:
+ javah_bin_dir = os.path.dirname(javah)
+ env.AppendENVPath('PATH', javah_bin_dir)
+
env['_JAVAHOUTFLAG'] = JavaHOutFlagGenerator
env['JAVAH'] = 'javah'
env['JAVAHFLAGS'] = SCons.Util.CLVar('')
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/latex.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/latex.py
index 6ed84c6eddc..09d0ece1402 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/latex.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/latex.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +32,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/latex.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/latex.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Defaults
@@ -55,10 +55,10 @@ def generate(env):
env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)
- import dvi
+ from . import dvi
dvi.generate(env)
- import pdf
+ from . import pdf
pdf.generate(env)
bld = env['BUILDERS']['DVI']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ldc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ldc.py
index 663df3836ae..46c07b25c30 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/ldc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/ldc.py
@@ -1,7 +1,9 @@
+from __future__ import print_function
+
"""SCons.Tool.ldc
Tool-specific initialization for the LDC compiler.
-(http://www.dsource.org/projects/ldc)
+(https://github.com/ldc-developers/ldc)
Developed by Russel Winder (russel@winder.org.uk)
2012-05-09 onwards
@@ -24,7 +26,7 @@ Lib tool variables:
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -46,7 +48,7 @@ Lib tool variables:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/ldc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ldc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import subprocess
@@ -57,7 +59,7 @@ import SCons.Defaults
import SCons.Scanner.D
import SCons.Tool
-import SCons.Tool.DCommon
+import SCons.Tool.DCommon as DCommon
def generate(env):
@@ -68,7 +70,7 @@ def generate(env):
static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter)
shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter)
- env['DC'] = env.Detect('ldc2')
+ env['DC'] = env.Detect('ldc2') or 'ldc2'
env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -of=$TARGET $SOURCES'
env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}'
@@ -84,7 +86,7 @@ def generate(env):
env['DDEBUG'] = []
if env['DC']:
- SCons.Tool.DCommon.addDPATHToEnv(env, env['DC'])
+ DCommon.addDPATHToEnv(env, env['DC'])
env['DINCPREFIX'] = '-I='
env['DINCSUFFIX'] = ''
@@ -100,54 +102,55 @@ def generate(env):
env['DLINKFLAGS'] = SCons.Util.CLVar('')
env['DLINKCOM'] = '$DLINK -of=$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
- env['DSHLINK'] = '$DC'
- env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos2-ldc')
- # Hack for Fedora the packages of which use the wrong name :-(
- if os.path.exists('/usr/lib64/libphobos-ldc.so') or os.path.exists('/usr/lib32/libphobos-ldc.so') or os.path.exists('/usr/lib/libphobos-ldc.so') :
- env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos-ldc')
- env['SHDLINKCOM'] = '$DLINK -of=$TARGET $DSHLINKFLAGS $__DSHLIBVERSIONFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
+ env['SHDLINK'] = '$DC'
+ env['SHDLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos2-ldc')
+
+ env['SHDLINKCOM'] = '$DLINK -of=$TARGET $SHDLINKFLAGS $__SHDLIBVERSIONFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS -L-ldruntime-ldc'
env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l'
env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else ''
- #env['_DLIBFLAGS'] = '${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
+ # env['_DLIBFLAGS'] = '${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
env['_DLIBFLAGS'] = '${_stripixes(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'
env['DLIBDIRPREFIX'] = '-L-L'
env['DLIBDIRSUFFIX'] = ''
env['_DLIBDIRFLAGS'] = '${_concat(DLIBDIRPREFIX, LIBPATH, DLIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
-
env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
- #env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}'
+ # env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}'
env['DLIBFLAGPREFIX'] = '-'
env['DLIBFLAGSUFFIX'] = ''
# __RPATH is set to $_RPATH in the platform specification if that
# platform supports it.
- env['DRPATHPREFIX'] = '-L-rpath='
+ env['DRPATHPREFIX'] = '-L-Wl,-rpath,' if env['PLATFORM'] == 'darwin' else '-L-rpath='
env['DRPATHSUFFIX'] = ''
env['_DRPATH'] = '${_concat(DRPATHPREFIX, RPATH, DRPATHSUFFIX, __env__)}'
# Support for versioned libraries
- env['_DSHLIBVERSIONFLAGS'] = '$DSHLIBVERSIONFLAGS -L-soname=$_DSHLIBSONAME'
- env['_DSHLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}'
+ env['_SHDLIBVERSIONFLAGS'] = '$SHDLIBVERSIONFLAGS -L-soname=$_SHDLIBSONAME'
+ env['_SHDLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}'
# NOTE: this is a quick hack, the soname will only work if there is
# c/c++ linker loaded which provides callback for the ShLibSonameGenerator
env['DShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator
- # NOTE: this is only for further reference, currently $DSHLIBVERSION does
+ # NOTE: this is only for further reference, currently $SHDLIBVERSION does
# not work, the user must use $SHLIBVERSION
- env['DSHLIBVERSION'] = '$SHLIBVERSION'
- env['DSHLIBVERSIONFLAGS'] = []
+ env['SHDLIBVERSION'] = '$SHLIBVERSION'
+ env['SHDLIBVERSIONFLAGS'] = []
- SCons.Tool.createStaticLibBuilder(env)
+ env['BUILDERS']['ProgramAllAtOnce'] = SCons.Builder.Builder(
+ action='$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -of=$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS',
+ emitter=DCommon.allAtOnceEmitter,
+ )
def exists(env):
return env.Detect('ldc2')
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/lex.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/lex.py
index d0ac82db0d3..e7009d8b7fd 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/lex.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/lex.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/lex.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/lex.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/link.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/link.py
index 7a883a5746d..fd8e46075de 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/link.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/link.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,8 +30,9 @@ 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.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Tool/link.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/link.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import sys
import re
@@ -45,20 +46,21 @@ from SCons.Tool.FortranCommon import isfortran
from SCons.Tool.DCommon import isD
-cplusplus = __import__('c++', globals(), locals(), [])
+from SCons.Tool.cxx import iscplusplus
issued_mixed_link_warning = False
+
def smart_link(source, target, env, for_signature):
- has_cplusplus = cplusplus.iscplusplus(source)
+ has_cplusplus = iscplusplus(source)
has_fortran = isfortran(env, source)
has_d = isD(env, source)
if has_cplusplus and has_fortran and not has_d:
global issued_mixed_link_warning
if not issued_mixed_link_warning:
msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \
- "This may generate a buggy executable if the '%s'\n\t" + \
- "compiler does not know how to deal with Fortran runtimes."
+ "This may generate a buggy executable if the '%s'\n\t" + \
+ "compiler does not know how to deal with Fortran runtimes."
SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,
msg % env.subst('$CXX'))
issued_mixed_link_warning = True
@@ -73,34 +75,38 @@ def smart_link(source, target, env, for_signature):
return '$CXX'
return '$CC'
+
def _lib_emitter(target, source, env, **kw):
Verbose = False
if Verbose:
- print "_lib_emitter: target[0]=%r" % target[0].get_path()
+ print("_lib_emitter: target[0]={!r}".format(target[0].get_path()))
for tgt in target:
tgt.attributes.shared = 1
-
+
try:
symlink_generator = kw['symlink_generator']
except KeyError:
pass
else:
if Verbose:
- print "_lib_emitter: symlink_generator=%r" % symlink_generator
+ print("_lib_emitter: symlink_generator={!r}".format(symlink_generator))
symlinks = symlink_generator(env, target[0])
if Verbose:
- print "_lib_emitter: symlinks=%r" % symlinks
+ print("_lib_emitter: symlinks={!r}".format(symlinks))
if symlinks:
SCons.Tool.EmitLibSymlinks(env, symlinks, target[0])
target[0].attributes.shliblinks = symlinks
return (target, source)
+
def shlib_emitter(target, source, env):
- return _lib_emitter(target, source, env, symlink_generator = SCons.Tool.ShLibSymlinkGenerator)
+ return _lib_emitter(target, source, env, symlink_generator=SCons.Tool.ShLibSymlinkGenerator)
+
def ldmod_emitter(target, source, env):
- return _lib_emitter(target, source, env, symlink_generator = SCons.Tool.LdModSymlinkGenerator)
+ return _lib_emitter(target, source, env, symlink_generator=SCons.Tool.LdModSymlinkGenerator)
+
# This is generic enough to be included here...
def _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw):
@@ -108,98 +114,107 @@ def _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator,
Verbose = False
if Verbose:
- print "_versioned_lib_name: libnode=%r" % libnode.get_path()
- print "_versioned_lib_name: version=%r" % version
- print "_versioned_lib_name: prefix=%r" % prefix
- print "_versioned_lib_name: suffix=%r" % suffix
- print "_versioned_lib_name: suffix_generator=%r" % suffix_generator
+ print("_versioned_lib_name: libnode={!r}".format(libnode.get_path()))
+ print("_versioned_lib_name: version={!r}".format(version))
+ print("_versioned_lib_name: prefix={!r}".format(prefix))
+ print("_versioned_lib_name: suffix={!r}".format(suffix))
+ print("_versioned_lib_name: suffix_generator={!r}".format(suffix_generator))
versioned_name = os.path.basename(libnode.get_path())
if Verbose:
- print "_versioned_lib_name: versioned_name=%r" % versioned_name
+ print("_versioned_lib_name: versioned_name={!r}".format(versioned_name))
versioned_prefix = prefix_generator(env, **kw)
versioned_suffix = suffix_generator(env, **kw)
if Verbose:
- print "_versioned_lib_name: versioned_prefix=%r" % versioned_prefix
- print "_versioned_lib_name: versioned_suffix=%r" % versioned_suffix
+ print("_versioned_lib_name: versioned_prefix={!r}".format(versioned_prefix))
+ print("_versioned_lib_name: versioned_suffix={!r}".format(versioned_suffix))
versioned_prefix_re = '^' + re.escape(versioned_prefix)
versioned_suffix_re = re.escape(versioned_suffix) + '$'
name = re.sub(versioned_prefix_re, prefix, versioned_name)
name = re.sub(versioned_suffix_re, suffix, name)
if Verbose:
- print "_versioned_lib_name: name=%r" % name
+ print("_versioned_lib_name: name={!r}".format(name))
return name
+
def _versioned_shlib_name(env, libnode, version, prefix, suffix, **kw):
- pg = SCons.Tool.ShLibPrefixGenerator
- sg = SCons.Tool.ShLibSuffixGenerator
- return _versioned_lib_name(env, libnode, version, prefix, suffix, pg, sg, **kw)
+ prefix_generator = SCons.Tool.ShLibPrefixGenerator
+ suffix_generator = SCons.Tool.ShLibSuffixGenerator
+ return _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw)
+
def _versioned_ldmod_name(env, libnode, version, prefix, suffix, **kw):
- pg = SCons.Tool.LdModPrefixGenerator
- sg = SCons.Tool.LdModSuffixGenerator
- return _versioned_lib_name(env, libnode, version, prefix, suffix, pg, sg, **kw)
+ prefix_generator = SCons.Tool.LdModPrefixGenerator
+ suffix_generator = SCons.Tool.LdModSuffixGenerator
+ return _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw)
+
def _versioned_lib_suffix(env, suffix, version):
"""For suffix='.so' and version='0.1.2' it returns '.so.0.1.2'"""
Verbose = False
if Verbose:
- print "_versioned_lib_suffix: suffix=%r" % suffix
- print "_versioned_lib_suffix: version=%r" % version
+ print("_versioned_lib_suffix: suffix={!r}".format(suffix))
+ print("_versioned_lib_suffix: version={!r}".format(version))
if not suffix.endswith(version):
suffix = suffix + '.' + version
if Verbose:
- print "_versioned_lib_suffix: return suffix=%r" % suffix
+ print("_versioned_lib_suffix: return suffix={!r}".format(suffix))
return suffix
+
def _versioned_lib_soname(env, libnode, version, prefix, suffix, name_func):
"""For libnode='/optional/dir/libfoo.so.X.Y.Z' it returns 'libfoo.so.X'"""
Verbose = False
if Verbose:
- print "_versioned_lib_soname: version=%r" % version
+ print("_versioned_lib_soname: version={!r}".format(version))
name = name_func(env, libnode, version, prefix, suffix)
if Verbose:
- print "_versioned_lib_soname: name=%r" % name
+ print("_versioned_lib_soname: name={!r}".format(name))
major = version.split('.')[0]
soname = name + '.' + major
if Verbose:
- print "_versioned_lib_soname: soname=%r" % soname
+ print("_versioned_lib_soname: soname={!r}".format(soname))
return soname
+
def _versioned_shlib_soname(env, libnode, version, prefix, suffix):
- return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_shlib_name)
+ return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_shlib_name)
+
def _versioned_ldmod_soname(env, libnode, version, prefix, suffix):
- return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_ldmod_name)
+ return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_ldmod_name)
+
def _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func):
- """Generate link names that should be created for a versioned shared lirbrary.
+ """Generate link names that should be created for a versioned shared library.
Returns a dictionary in the form { linkname : linktarget }
"""
Verbose = False
if Verbose:
- print "_versioned_lib_symlinks: libnode=%r" % libnode.get_path()
- print "_versioned_lib_symlinks: version=%r" % version
+ print("_versioned_lib_symlinks: libnode={!r}".format(libnode.get_path()))
+ print("_versioned_lib_symlinks: version={!r}".format(version))
if sys.platform.startswith('openbsd'):
# OpenBSD uses x.y shared library versioning numbering convention
# and doesn't use symlinks to backwards-compatible libraries
if Verbose:
- print "_versioned_lib_symlinks: return symlinks=%r" % None
+ print("_versioned_lib_symlinks: return symlinks={!r}".format(None))
return None
linkdir = libnode.get_dir()
if Verbose:
- print "_versioned_lib_symlinks: linkdir=%r" % linkdir.get_path()
+ print("_versioned_lib_symlinks: linkdir={!r}".format(linkdir.get_path()))
name = name_func(env, libnode, version, prefix, suffix)
if Verbose:
- print "_versioned_lib_symlinks: name=%r" % name
+ print("_versioned_lib_symlinks: name={!r}".format(name))
soname = soname_func(env, libnode, version, prefix, suffix)
+ if Verbose:
+ print("_versioned_lib_symlinks: soname={!r}".format(soname))
link0 = env.fs.File(soname, linkdir)
link1 = env.fs.File(name, linkdir)
@@ -207,48 +222,63 @@ def _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, so
# We create direct symlinks, not daisy-chained.
if link0 == libnode:
# This enables SHLIBVERSION without periods (e.g. SHLIBVERSION=1)
- symlinks = [ (link1, libnode) ]
+ symlinks = [(link1, libnode)]
else:
# This handles usual SHLIBVERSION, i.e. '1.2', '1.2.3', etc.
- symlinks = [ (link0, libnode), (link1, libnode) ]
+ symlinks = [(link0, libnode), (link1, libnode)]
if Verbose:
- print "_versioned_lib_symlinks: return symlinks=%r" % SCons.Tool.StringizeLibSymlinks(symlinks)
+ print("_versioned_lib_symlinks: return symlinks={!r}".format(SCons.Tool.StringizeLibSymlinks(symlinks)))
return symlinks
+
def _versioned_shlib_symlinks(env, libnode, version, prefix, suffix):
- nf = _versioned_shlib_name
- sf = _versioned_shlib_soname
- return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, nf, sf)
+ name_func = env['LINKCALLBACKS']['VersionedShLibName']
+ soname_func = env['LINKCALLBACKS']['VersionedShLibSoname']
+
+ return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func)
+
def _versioned_ldmod_symlinks(env, libnode, version, prefix, suffix):
- nf = _versioned_ldmod_name
- sf = _versioned_ldmod_soname
- return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, nf, sf)
+ name_func = _versioned_ldmod_name
+ soname_func = _versioned_ldmod_soname
+
+ name_func = env['LINKCALLBACKS']['VersionedLdModName']
+ soname_func = env['LINKCALLBACKS']['VersionedLdModSoname']
+
+ return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func)
+
def _versioned_lib_callbacks():
return {
- 'VersionedShLibSuffix' : _versioned_lib_suffix,
- 'VersionedLdModSuffix' : _versioned_lib_suffix,
- 'VersionedShLibSymlinks' : _versioned_shlib_symlinks,
- 'VersionedLdModSymlinks' : _versioned_ldmod_symlinks,
- 'VersionedShLibName' : _versioned_shlib_name,
- 'VersionedLdModName' : _versioned_ldmod_name,
- 'VersionedShLibSoname' : _versioned_shlib_soname,
- 'VersionedLdModSoname' : _versioned_ldmod_soname,
+ 'VersionedShLibSuffix': _versioned_lib_suffix,
+ 'VersionedLdModSuffix': _versioned_lib_suffix,
+ 'VersionedShLibSymlinks': _versioned_shlib_symlinks,
+ 'VersionedLdModSymlinks': _versioned_ldmod_symlinks,
+ 'VersionedShLibName': _versioned_shlib_name,
+ 'VersionedLdModName': _versioned_ldmod_name,
+ 'VersionedShLibSoname': _versioned_shlib_soname,
+ 'VersionedLdModSoname': _versioned_ldmod_soname,
}.copy()
-# Setup all variables required by the versioning machinery
+
def _setup_versioned_lib_variables(env, **kw):
+ """
+ Setup all variables required by the versioning machinery
+ """
tool = None
- try: tool = kw['tool']
- except KeyError: pass
+ try:
+ tool = kw['tool']
+ except KeyError:
+ pass
use_soname = False
- try: use_soname = kw['use_soname']
- except KeyError: pass
+ try:
+ use_soname = kw['use_soname']
+ except KeyError:
+ pass
# The $_SHLIBVERSIONFLAGS define extra commandline flags used when
# building VERSIONED shared libraries. It's always set, but used only
@@ -278,22 +308,25 @@ def generate(env):
SCons.Tool.createSharedLibBuilder(env)
SCons.Tool.createProgBuilder(env)
- env['SHLINK'] = '$LINK'
+ env['SHLINK'] = '$LINK'
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
- env['SHLINKCOM'] = '$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
- # don't set up the emitter, cause AppendUnique will generate a list
+ env['SHLINKCOM'] = '$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+
+ # don't set up the emitter, because AppendUnique will generate a list
# starting with None :-(
- env.Append(SHLIBEMITTER = [shlib_emitter])
- env['SMARTLINK'] = smart_link
- env['LINK'] = "$SMARTLINK"
- env['LINKFLAGS'] = SCons.Util.CLVar('')
+ env.Append(SHLIBEMITTER=[shlib_emitter])
+
+ env['SMARTLINK'] = smart_link
+ env['LINK'] = "$SMARTLINK"
+ env['LINKFLAGS'] = SCons.Util.CLVar('')
+
# __RPATH is only set to something ($_RPATH typically) on platforms that support it.
- env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
- env['LIBDIRPREFIX']='-L'
- env['LIBDIRSUFFIX']=''
- env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'
- env['LIBLINKPREFIX']='-l'
- env['LIBLINKSUFFIX']=''
+ env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+ env['LIBDIRPREFIX'] = '-L'
+ env['LIBDIRSUFFIX'] = ''
+ env['_LIBFLAGS'] = '${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'
+ env['LIBLINKPREFIX'] = '-l'
+ env['LIBLINKSUFFIX'] = ''
if env['PLATFORM'] == 'hpux':
env['SHLIBSUFFIX'] = '.sl'
@@ -305,14 +338,16 @@ def generate(env):
# setting them the same means that LoadableModule works everywhere.
SCons.Tool.createLoadableModuleBuilder(env)
env['LDMODULE'] = '$SHLINK'
- env.Append(LDMODULEEMITTER = [ldmod_emitter])
+ env.Append(LDMODULEEMITTER=[ldmod_emitter])
env['LDMODULEPREFIX'] = '$SHLIBPREFIX'
env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'
env['LDMODULEFLAGS'] = '$SHLINKFLAGS'
- env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__LDMODULEVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+ env[
+ 'LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__LDMODULEVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
env['LDMODULEVERSION'] = '$SHLIBVERSION'
env['LDMODULENOVERSIONSYMLINKS'] = '$SHLIBNOVERSIONSYMLINKS'
+
def exists(env):
# This module isn't really a Tool on its own, it's common logic for
# other linkers.
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/linkloc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/linkloc.py
index 9fbc59935ea..021d647baaf 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/linkloc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/linkloc.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +32,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/linkloc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/linkloc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import re
@@ -52,8 +52,8 @@ def repl_linker_command(m):
# Replaces any linker command file directives (e.g. "@foo.lnk") with
# the actual contents of the file.
try:
- f=open(m.group(2), "r")
- return m.group(1) + f.read()
+ with open(m.group(2), "r") as f:
+ return m.group(1) + f.read()
except IOError:
# the linker should return an error if it can't
# find the linker command file so we will remain quiet.
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/m4.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/m4.py
index 7fd4a2fa794..597b6a56489 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/m4.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/m4.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/m4.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/m4.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Builder
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/masm.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/masm.py
index bc1f83e31d1..b1bd0eea5bb 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/masm.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/masm.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/masm.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/masm.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/midl.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/midl.py
index 27ab01aeed6..8310a82fd8e 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/midl.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/midl.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/midl.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/midl.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Builder
@@ -39,26 +39,26 @@ import SCons.Defaults
import SCons.Scanner.IDL
import SCons.Util
-from MSCommon import msvc_exists
+from .MSCommon import msvc_exists
def midl_emitter(target, source, env):
"""Produces a list of outputs from the MIDL compiler"""
- base, ext = SCons.Util.splitext(str(target[0]))
+ base, _ = SCons.Util.splitext(str(target[0]))
tlb = target[0]
incl = base + '.h'
interface = base + '_i.c'
- t = [tlb, incl, interface]
+ targets = [tlb, incl, interface]
midlcom = env['MIDLCOM']
if midlcom.find('/proxy') != -1:
proxy = base + '_p.c'
- t.append(proxy)
+ targets.append(proxy)
if midlcom.find('/dlldata') != -1:
dlldata = base + '_data.c'
- t.append(dlldata)
-
- return (t,source)
+ targets.append(dlldata)
+
+ return (targets, source)
idl_scanner = SCons.Scanner.IDL.IDLScan()
@@ -79,7 +79,7 @@ def generate(env):
env['BUILDERS']['TypeLibrary'] = midl_builder
def exists(env):
- return msvc_exists()
+ return msvc_exists(env)
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mingw.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mingw.py
index 182fd74471f..1ea39425101 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mingw.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mingw.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,10 +31,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/mingw.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mingw.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
+import glob
import SCons.Action
import SCons.Builder
@@ -42,26 +43,14 @@ import SCons.Defaults
import SCons.Tool
import SCons.Util
-# This is what we search for to find mingw:
-key_program = 'mingw32-gcc'
-
-def find(env):
- # First search in the SCons path
- path=env.WhereIs(key_program)
- if (path):
- return path
- # then the OS path:
- path=SCons.Util.WhereIs(key_program)
- if (path):
- return path
-
- # If that doesn't work try default location for mingw
- save_path=env['ENV']['PATH']
- env.AppendENVPath('PATH',r'c:\MinGW\bin')
- path =env.WhereIs(key_program)
- if not path:
- env['ENV']['PATH']=save_path
- return path
+
+mingw_paths = [
+ r'c:\MinGW\bin',
+ r'C:\cygwin64\bin',
+ r'C:\msys64',
+ r'C:\cygwin\bin',
+ r'C:\msys',
+]
def shlib_generator(target, source, env, for_signature):
cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS'])
@@ -86,7 +75,8 @@ def shlib_emitter(target, source, env):
no_import_lib = env.get('no_import_lib', 0)
if not dll:
- raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX"))
+ raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s Target(s) are:%s" % \
+ (env.subst("$SHLIBSUFFIX"), ",".join([str(t) for t in target])))
if not no_import_lib and \
not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):
@@ -125,12 +115,33 @@ res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
source_scanner=SCons.Tool.SourceFileScanner)
SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
+# This is what we search for to find mingw:
+# key_program = 'mingw32-gcc'
+key_program = 'mingw32-make'
+
+
+
+def find_version_specific_mingw_paths():
+ """
+ One example of default mingw install paths is:
+ C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin
+
+ Use glob'ing to find such and add to mingw_paths
+ """
+ new_paths = glob.glob(r"C:\mingw-w64\*\mingw64\bin")
+
+ return new_paths
+
+
def generate(env):
- mingw = find(env)
+ global mingw_paths
+ # Check for reasoanble mingw default paths
+ mingw_paths +=find_version_specific_mingw_paths()
+
+ mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths)
if mingw:
- dir = os.path.dirname(mingw)
- env.PrependENVPath('PATH', dir )
-
+ mingw_bin_dir = os.path.dirname(mingw)
+ env.AppendENVPath('PATH', mingw_bin_dir)
# Most of mingw is the same as gcc and friends...
gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'gfortran', 'm4']
@@ -172,7 +183,12 @@ def generate(env):
env['PROGSUFFIX'] = '.exe'
def exists(env):
- return find(env)
+ mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths)
+ if mingw:
+ mingw_bin_dir = os.path.dirname(mingw)
+ env.AppendENVPath('PATH', mingw_bin_dir)
+
+ return mingw
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msgfmt.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msgfmt.py
index 12b75040570..16dc3afb627 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msgfmt.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msgfmt.py
@@ -1,6 +1,6 @@
""" msgfmt tool """
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# 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__ = "src/engine/SCons/Tool/msgfmt.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msgfmt.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Builder import BuilderBase
#############################################################################
@@ -41,7 +41,7 @@ class _MOFileBuilder(BuilderBase):
import SCons.Util
from SCons.Tool.GettextCommon import _read_linguas_from_files
linguas_files = None
- if env.has_key('LINGUAS_FILE') and env['LINGUAS_FILE'] is not None:
+ if 'LINGUAS_FILE' in env and env['LINGUAS_FILE'] is not None:
linguas_files = env['LINGUAS_FILE']
# This should prevent from endless recursion.
env['LINGUAS_FILE'] = None
@@ -75,8 +75,22 @@ def _create_mo_file_builder(env, **kw):
#############################################################################
def generate(env,**kw):
""" Generate `msgfmt` tool """
+ import sys
+ import os
import SCons.Util
+ import SCons.Tool
from SCons.Tool.GettextCommon import _detect_msgfmt
+ from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
+ from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
+
+ if sys.platform == 'win32':
+ msgfmt = SCons.Tool.find_program_path(env, 'msgfmt', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
+ if msgfmt:
+ msgfmt_bin_dir = os.path.dirname(msgfmt)
+ env.AppendENVPath('PATH', msgfmt_bin_dir)
+ else:
+ SCons.Warnings.Warning('msgfmt tool requested, but binary not found in ENV PATH')
+
try:
env['MSGFMT'] = _detect_msgfmt(env)
except:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msginit.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msginit.py
index 0f5950b1575..45af4101742 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msginit.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msginit.py
@@ -3,7 +3,7 @@
Tool specific initialization of msginit tool.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +24,7 @@ Tool specific initialization of msginit tool.
# 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__ = "src/engine/SCons/Tool/msginit.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msginit.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Warnings
import SCons.Builder
@@ -35,7 +35,7 @@ def _optional_no_translator_flag(env):
""" Return '--no-translator' flag if we run *msginit(1)* in non-interactive
mode."""
import SCons.Util
- if env.has_key('POAUTOINIT'):
+ if 'POAUTOINIT' in env:
autoinit = env['POAUTOINIT']
else:
autoinit = False
@@ -66,7 +66,7 @@ def _POInitBuilderWrapper(env, target=None, source=_null, **kw):
if source is _null:
if 'POTDOMAIN' in kw:
domain = kw['POTDOMAIN']
- elif env.has_key('POTDOMAIN'):
+ elif 'POTDOMAIN' in env:
domain = env['POTDOMAIN']
else:
domain = 'messages'
@@ -77,8 +77,22 @@ def _POInitBuilderWrapper(env, target=None, source=_null, **kw):
#############################################################################
def generate(env,**kw):
""" Generate the `msginit` tool """
+ import sys
+ import os
import SCons.Util
+ import SCons.Tool
from SCons.Tool.GettextCommon import _detect_msginit
+ from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
+ from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
+
+ if sys.platform == 'win32':
+ msginit = SCons.Tool.find_program_path(env, 'msginit', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
+ if msginit:
+ msginit_bin_dir = os.path.dirname(msginit)
+ env.AppendENVPath('PATH', msginit_bin_dir)
+ else:
+ SCons.Warnings.Warning('msginit tool requested, but binary not found in ENV PATH')
+
try:
env['MSGINIT'] = _detect_msginit(env)
except:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msgmerge.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msgmerge.py
index 3473597da67..e1bfec6b2da 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msgmerge.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msgmerge.py
@@ -3,7 +3,7 @@
Tool specific initialization for `msgmerge` tool.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +24,7 @@ Tool specific initialization for `msgmerge` tool.
# 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__ = "src/engine/SCons/Tool/msgmerge.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msgmerge.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
#############################################################################
def _update_or_init_po_files(target, source, env):
@@ -58,7 +58,7 @@ def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):
if source is _null:
if 'POTDOMAIN' in kw:
domain = kw['POTDOMAIN']
- elif env.has_key('POTDOMAIN') and env['POTDOMAIN']:
+ elif 'POTDOMAIN' in env and env['POTDOMAIN']:
domain = env['POTDOMAIN']
else:
domain = 'messages'
@@ -68,8 +68,21 @@ def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):
#############################################################################
def generate(env,**kw):
- """ Generate the `xgettext` tool """
+ """ Generate the `msgmerge` tool """
+ import sys
+ import os
+ import SCons.Tool
from SCons.Tool.GettextCommon import _detect_msgmerge
+ from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
+ from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
+
+ if sys.platform == 'win32':
+ msgmerge = SCons.Tool.find_program_path(env, 'msgmerge', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
+ if msgmerge:
+ msgmerge_bin_dir = os.path.dirname(msgmerge)
+ env.AppendENVPath('PATH', msgmerge_bin_dir)
+ else:
+ SCons.Warnings.Warning('msgmerge tool requested, but binary not found in ENV PATH')
try:
env['MSGMERGE'] = _detect_msgmerge(env)
except:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mslib.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mslib.py
index 70c16433489..7bb3f91ccf2 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mslib.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mslib.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/mslib.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mslib.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
@@ -39,7 +39,7 @@ import SCons.Tool.msvs
import SCons.Tool.msvc
import SCons.Util
-from MSCommon import msvc_exists, msvc_setup_env_once
+from .MSCommon import msvc_exists, msvc_setup_env_once
def generate(env):
"""Add Builders and construction variables for lib to an Environment."""
@@ -55,7 +55,7 @@ def generate(env):
env['LIBSUFFIX'] = '.lib'
def exists(env):
- return msvc_exists()
+ return msvc_exists(env)
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mslink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mslink.py
index 27745d16a25..985b7c432e9 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mslink.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mslink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,8 +30,9 @@ 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.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Tool/mslink.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mslink.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
@@ -44,7 +45,7 @@ import SCons.Tool.msvc
import SCons.Tool.msvs
import SCons.Util
-from MSCommon import msvc_setup_env_once, msvc_exists
+from .MSCommon import msvc_setup_env_once, msvc_exists
def pdbGenerator(env, target, source, for_signature):
try:
@@ -191,7 +192,7 @@ def prog_emitter(target, source, env):
# MSVC 11 and above need the PCH object file to be added to the link line,
# otherwise you get link error LNK2011.
pchobj = SCons.Util.splitext(str(env['PCH']))[0] + '.obj'
- # print "prog_emitter, version %s, appending pchobj %s"%(version_num, pchobj)
+ # print("prog_emitter, version %s, appending pchobj %s"%(version_num, pchobj))
if pchobj not in extrasources:
extrasources.append(pchobj)
@@ -203,7 +204,7 @@ def RegServerFunc(target, source, env):
if ret:
raise SCons.Errors.UserError("Unable to register %s" % target[0])
else:
- print "Registered %s sucessfully" % target[0]
+ print("Registered %s sucessfully" % target[0])
return ret
return 0
@@ -220,10 +221,10 @@ def embedManifestDllCheck(target, source, env):
if os.path.exists(manifestSrc):
ret = (embedManifestDllAction) ([target[0]],None,env)
if ret:
- raise SCons.Errors.UserError, "Unable to embed manifest into %s" % (target[0])
+ raise SCons.Errors.UserError("Unable to embed manifest into %s" % (target[0]))
return ret
else:
- print '(embed: no %s.manifest found; not embedding.)'%str(target[0])
+ print('(embed: no %s.manifest found; not embedding.)'%str(target[0]))
return 0
def embedManifestExeCheck(target, source, env):
@@ -234,10 +235,10 @@ def embedManifestExeCheck(target, source, env):
if os.path.exists(manifestSrc):
ret = (embedManifestExeAction) ([target[0]],None,env)
if ret:
- raise SCons.Errors.UserError, "Unable to embed manifest into %s" % (target[0])
+ raise SCons.Errors.UserError("Unable to embed manifest into %s" % (target[0]))
return ret
else:
- print '(embed: no %s.manifest found; not embedding.)'%str(target[0])
+ print('(embed: no %s.manifest found; not embedding.)'%str(target[0]))
return 0
embedManifestDllCheckAction = SCons.Action.Action(embedManifestDllCheck, None)
@@ -327,7 +328,7 @@ def generate(env):
env['LDMODULECOM'] = compositeLdmodAction
def exists(env):
- return msvc_exists()
+ return msvc_exists(env)
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mssdk.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mssdk.py
index 1dddbe77053..542b3df4819 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mssdk.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mssdk.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/mssdk.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mssdk.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
"""engine.SCons.Tool.mssdk
@@ -33,7 +33,7 @@ It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
-from MSCommon import mssdk_exists, \
+from .MSCommon import mssdk_exists, \
mssdk_setup_env
def generate(env):
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msvc.py
index f60bf340479..e921f63e31c 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msvc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/msvc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msvc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import re
@@ -47,7 +47,7 @@ import SCons.Util
import SCons.Warnings
import SCons.Scanner.RC
-from MSCommon import msvc_exists, msvc_setup_env_once
+from .MSCommon import msvc_exists, msvc_setup_env_once, msvc_version_to_maj_min
CSuffixes = ['.c', '.C']
CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
@@ -60,6 +60,21 @@ def validate_vars(env):
if not SCons.Util.is_String(env['PCHSTOP']):
raise SCons.Errors.UserError("The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP'])
+def msvc_set_PCHPDBFLAGS(env):
+ """
+ Set appropriate PCHPDBFLAGS for the MSVC version being used.
+ """
+ if env.get('MSVC_VERSION',False):
+ maj, min = msvc_version_to_maj_min(env['MSVC_VERSION'])
+ if maj < 8:
+ env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}'])
+ else:
+ env['PCHPDBFLAGS'] = ''
+ else:
+ # Default if we can't determine which version of MSVC we're using
+ env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}'])
+
+
def pch_emitter(target, source, env):
"""Adds the object file target."""
@@ -97,7 +112,7 @@ def object_emitter(target, source, env, parent_emitter):
#
# See issue #2505 for a discussion of what to do if it turns
# out this assumption causes trouble in the wild:
- # http://scons.tigris.org/issues/show_bug.cgi?id=2505
+ # https://github.com/SCons/scons/issues/2505
if 'PCH' in env:
pch = env['PCH']
if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj':
@@ -180,7 +195,10 @@ def msvc_output_flag(target, source, env, for_signature):
# that the test(s) for this can be run on non-Windows systems
# without having a hard-coded backslash mess up command-line
# argument parsing.
- return '/Fo${TARGET.dir}' + os.sep
+ # Adding double os.sep's as if the TARGET.dir has a space or otherwise
+ # needs to be quoted they are needed per MSVC's odd behavior
+ # See: https://github.com/SCons/scons/issues/3106
+ return '/Fo${TARGET.dir}' + os.sep*2
CAction = SCons.Action.Action("$CCCOM", "$CCCOMSTR",
batch_key=msvc_batch_key,
@@ -259,7 +277,9 @@ def generate(env):
env['CFILESUFFIX'] = '.c'
env['CXXFILESUFFIX'] = '.cc'
- env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}'])
+ msvc_set_PCHPDBFLAGS(env)
+
+
env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
env['BUILDERS']['PCH'] = pch_builder
@@ -269,7 +289,7 @@ def generate(env):
env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root()
def exists(env):
- return msvc_exists()
+ return msvc_exists(env)
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvs.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msvs.py
index df80edf3493..1dcbf7ef7c6 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvs.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/msvs.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,9 @@ 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.
-__revision__ = "src/engine/SCons/Tool/msvs.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+from __future__ import print_function
+
+__revision__ = "src/engine/SCons/Tool/msvs.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.compat
@@ -38,7 +40,6 @@ import base64
import hashlib
import ntpath
import os
-# compat layer imports "cPickle" for us if it's available.
import pickle
import re
import sys
@@ -51,8 +52,9 @@ import SCons.PathList
import SCons.Util
import SCons.Warnings
-from MSCommon import msvc_exists, msvc_setup_env_once
+from .MSCommon import msvc_exists, msvc_setup_env_once
from SCons.Defaults import processDefines
+from SCons.compat import PICKLE_PROTOCOL
##############################################################################
# Below here are the classes and functions for generation of
@@ -63,6 +65,8 @@ def xmlify(s):
s = s.replace("&", "&amp;") # do this first
s = s.replace("'", "&apos;")
s = s.replace('"', "&quot;")
+ s = s.replace('<', "&lt;")
+ s = s.replace('>', "&gt;")
s = s.replace('\n', '&#x0A;')
return s
@@ -70,7 +74,7 @@ def xmlify(s):
# Returns a tuple of nodes.
def processIncludes(includes, env, target, source):
return SCons.PathList.PathList(includes).subst_path(env, target, source)
-
+
external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'
@@ -83,7 +87,7 @@ def _generateGUID(slnfile, name):
# Normalize the slnfile path to a Windows path (\ separators) so
# the generated file has a consistent GUID even if we generate
# it on a non-Windows platform.
- m.update(ntpath.normpath(str(slnfile)) + str(name))
+ m.update(bytearray(ntpath.normpath(str(slnfile)) + str(name),'utf-8'))
solution = m.hexdigest().upper()
# convert most of the signature to GUID form (discard the rest)
solution = "{" + solution[:8] + "-" + solution[8:12] + "-" + solution[12:16] + "-" + solution[16:20] + "-" + solution[20:32] + "}"
@@ -145,9 +149,9 @@ def splitFully(path):
return [base]
def makeHierarchy(sources):
- '''Break a list of files into a hierarchy; for each value, if it is a string,
+ """Break a list of files into a hierarchy; for each value, if it is a string,
then it is a file. If it is a dictionary, it is a folder. The string is
- the original path of the file.'''
+ the original path of the file."""
hierarchy = {}
for file in sources:
@@ -168,15 +172,15 @@ class _UserGenerator(object):
Base class for .dsp.user file generator
'''
# Default instance values.
- # Ok ... a bit defensive, but it does not seem reasonable to crash the
+ # Ok ... a bit defensive, but it does not seem reasonable to crash the
# build for a workspace user file. :-)
usrhead = None
- usrdebg = None
+ usrdebg = None
usrconf = None
- createfile = False
+ createfile = False
def __init__(self, dspfile, source, env):
# DebugSettings should be a list of debug dictionary sorted in the same order
- # as the target list and variants
+ # as the target list and variants
if 'variant' not in env:
raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\
"'Release') to create an MSVSProject.")
@@ -184,8 +188,8 @@ class _UserGenerator(object):
variants = [env['variant']]
elif SCons.Util.is_List(env['variant']):
variants = env['variant']
-
- if 'DebugSettings' not in env or env['DebugSettings'] == None:
+
+ if 'DebugSettings' not in env or env['DebugSettings'] is None:
dbg_settings = []
elif SCons.Util.is_Dict(env['DebugSettings']):
dbg_settings = [env['DebugSettings']]
@@ -200,37 +204,37 @@ class _UserGenerator(object):
dbg_settings.append({})
else:
dbg_settings = []
-
+
if len(dbg_settings) == 1:
dbg_settings = dbg_settings * len(variants)
-
+
self.createfile = self.usrhead and self.usrdebg and self.usrconf and \
- dbg_settings and bool([ds for ds in dbg_settings if ds])
+ dbg_settings and bool([ds for ds in dbg_settings if ds])
if self.createfile:
- dbg_settings = dict(zip(variants, dbg_settings))
+ dbg_settings = dict(list(zip(variants, dbg_settings)))
for var, src in dbg_settings.items():
# Update only expected keys
trg = {}
- for key in [k for k in self.usrdebg.keys() if k in src]:
+ for key in [k for k in list(self.usrdebg.keys()) if k in src]:
trg[key] = str(src[key])
self.configs[var].debug = trg
-
+
def UserHeader(self):
encoding = self.env.subst('$MSVSENCODING')
versionstr = self.versionstr
self.usrfile.write(self.usrhead % locals())
-
+
def UserProject(self):
pass
-
+
def Build(self):
if not self.createfile:
return
try:
filename = self.dspabs +'.user'
self.usrfile = open(filename, 'w')
- except IOError, detail:
+ except IOError as detail:
raise SCons.Errors.InternalError('Unable to open "' + filename + '" for writing:' + str(detail))
else:
self.UserHeader()
@@ -290,7 +294,7 @@ class _GenerateV7User(_UserGenerator):
self.usrconf = V9UserConfiguration
self.usrdebg = V9DebugSettings
_UserGenerator.__init__(self, dspfile, source, env)
-
+
def UserProject(self):
confkeys = sorted(self.configs.keys())
for kind in confkeys:
@@ -298,8 +302,8 @@ class _GenerateV7User(_UserGenerator):
platform = self.configs[kind].platform
debug = self.configs[kind].debug
if debug:
- debug_settings = '\n'.join(['\t\t\t\t%s="%s"' % (key, xmlify(value))
- for key, value in debug.items()
+ debug_settings = '\n'.join(['\t\t\t\t%s="%s"' % (key, xmlify(value))
+ for key, value in debug.items()
if value is not None])
self.usrfile.write(self.usrconf % locals())
self.usrfile.write('\t</Configurations>\n</VisualStudioUserFile>')
@@ -345,7 +349,7 @@ V10DebugSettings = {
class _GenerateV10User(_UserGenerator):
"""Generates a Project'user file for MSVS 2010"""
-
+
def __init__(self, dspfile, source, env):
self.versionstr = '4.0'
self.usrhead = V10UserHeader
@@ -360,8 +364,8 @@ class _GenerateV10User(_UserGenerator):
platform = self.configs[kind].platform
debug = self.configs[kind].debug
if debug:
- debug_settings = '\n'.join(['\t\t<%s>%s</%s>' % (key, xmlify(value), key)
- for key, value in debug.items()
+ debug_settings = '\n'.join(['\t\t<%s>%s</%s>' % (key, xmlify(value), key)
+ for key, value in debug.items()
if value is not None])
self.usrfile.write(self.usrconf % locals())
self.usrfile.write('</Project>')
@@ -457,7 +461,7 @@ class _DSPGenerator(object):
runfile.append(s)
self.sconscript = env['MSVSSCONSCRIPT']
-
+
if 'cmdargs' not in env or env['cmdargs'] == None:
cmdargs = [''] * len(variants)
elif SCons.Util.is_String(env['cmdargs']):
@@ -467,7 +471,7 @@ class _DSPGenerator(object):
raise SCons.Errors.InternalError("Sizes of 'cmdargs' and 'variant' lists must be the same.")
else:
cmdargs = env['cmdargs']
-
+
self.env = env
if 'name' in self.env:
@@ -525,13 +529,13 @@ class _DSPGenerator(object):
config.platform = 'Win32'
self.configs[variant] = config
- print "Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'"
+ print("Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'")
for i in range(len(variants)):
AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i])
self.platforms = []
- for key in self.configs.keys():
+ for key in list(self.configs.keys()):
platform = self.configs[key].platform
if not platform in self.platforms:
self.platforms.append(platform)
@@ -640,11 +644,11 @@ class _GenerateV6DSP(_DSPGenerator):
if self.nokeep == 0:
# now we pickle some data and add it to the file -- MSDEV will ignore it.
- pdata = pickle.dumps(self.configs,1)
- pdata = base64.encodestring(pdata)
+ pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)
+ pdata = base64.encodestring(pdata).decode()
self.file.write(pdata + '\n')
- pdata = pickle.dumps(self.sources,1)
- pdata = base64.encodestring(pdata)
+ pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)
+ pdata = base64.encodestring(pdata).decode()
self.file.write(pdata + '\n')
def PrintSourceFiles(self):
@@ -654,7 +658,7 @@ class _GenerateV6DSP(_DSPGenerator):
'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe',
'Other Files': ''}
- for kind in sorted(categories.keys(), key=lambda a: a.lower()):
+ for kind in sorted(list(categories.keys()), key=lambda a: a.lower()):
if not self.sources[kind]:
continue # skip empty groups
@@ -725,7 +729,7 @@ class _GenerateV6DSP(_DSPGenerator):
def Build(self):
try:
self.file = open(self.dspabs,'w')
- except IOError, detail:
+ except IOError as detail:
raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
else:
self.PrintHeader()
@@ -817,7 +821,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User):
self.dspheader = V7DSPHeader
self.dspconfiguration = V7DSPConfiguration
self.file = None
-
+
_GenerateV7User.__init__(self, dspfile, source, env)
def PrintHeader(self):
@@ -894,7 +898,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User):
preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', []))))
includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None)
includepath = xmlify(';'.join([str(x) for x in includepath_Dirs]))
-
+
if not env_has_buildtarget:
del self.env['MSVSBUILDTARGET']
@@ -912,11 +916,11 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User):
if self.nokeep == 0:
# now we pickle some data and add it to the file -- MSDEV will ignore it.
- pdata = pickle.dumps(self.configs,1)
- pdata = base64.encodestring(pdata)
+ pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)
+ pdata = base64.encodestring(pdata).decode()
self.file.write('<!-- SCons Data:\n' + pdata + '\n')
- pdata = pickle.dumps(self.sources,1)
- pdata = base64.encodestring(pdata)
+ pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)
+ pdata = base64.encodestring(pdata).decode()
self.file.write(pdata + '-->\n')
def printSources(self, hierarchy, commonprefix):
@@ -950,7 +954,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User):
self.file.write('\t<Files>\n')
- cats = sorted([k for k in categories.keys() if self.sources[k]],
+ cats = sorted([k for k in list(categories.keys()) if self.sources[k]],
key=lambda a: a.lower())
for kind in cats:
if len(cats) > 1:
@@ -1037,13 +1041,13 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User):
def Build(self):
try:
self.file = open(self.dspabs,'w')
- except IOError, detail:
+ except IOError as detail:
raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
else:
self.PrintHeader()
self.PrintProject()
self.file.close()
-
+
_GenerateV7User.Build(self)
V10DSPHeader = """\
@@ -1092,15 +1096,20 @@ V10DSPCommandLine = """\
\t\t<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
"""
+V15DSPHeader = """\
+<?xml version="1.0" encoding="%(encoding)s"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+"""
+
class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
"""Generates a Project file for MSVS 2010"""
- def __init__(self, dspfile, source, env):
+ def __init__(self, dspfile, header, source, env):
_DSPGenerator.__init__(self, dspfile, source, env)
- self.dspheader = V10DSPHeader
+ self.dspheader = header
self.dspconfiguration = V10DSPProjectConfiguration
self.dspglobals = V10DSPGlobals
-
+
_GenerateV10User.__init__(self, dspfile, source, env)
def PrintHeader(self):
@@ -1131,27 +1140,27 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
'\t\t<SccLocalPath>%s</SccLocalPath>\n' % (scc_project_name, scc_local_path_legacy))
else:
self.dspglobals = self.dspglobals.replace('%(scc_attrs)s', '')
-
+
self.file.write(self.dspheader % locals())
-
+
self.file.write('\t<ItemGroup Label="ProjectConfigurations">\n')
-
+
confkeys = sorted(self.configs.keys())
for kind in confkeys:
variant = self.configs[kind].variant
platform = self.configs[kind].platform
self.file.write(self.dspconfiguration % locals())
-
+
self.file.write('\t</ItemGroup>\n')
-
+
self.file.write(self.dspglobals % locals())
-
+
def PrintProject(self):
name = self.name
confkeys = sorted(self.configs.keys())
-
+
self.file.write('\t<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\n')
-
+
toolset = ''
if 'MSVC_VERSION' in self.env:
version_num, suite = msvs_parse_version(self.env['MSVC_VERSION'])
@@ -1164,16 +1173,16 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
self.file.write('\t<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\n')
self.file.write('\t<ImportGroup Label="ExtensionSettings">\n')
self.file.write('\t</ImportGroup>\n')
-
+
for kind in confkeys:
variant = self.configs[kind].variant
platform = self.configs[kind].platform
self.file.write(V10DSPImportGroupCondition % locals())
-
+
self.file.write('\t<PropertyGroup Label="UserMacros" />\n')
self.file.write('\t<PropertyGroup>\n')
self.file.write('\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n')
-
+
for kind in confkeys:
variant = self.configs[kind].variant
platform = self.configs[kind].platform
@@ -1181,7 +1190,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
buildtarget = self.configs[kind].buildtarget
runfile = self.configs[kind].runfile
cmdargs = self.configs[kind].cmdargs
-
+
env_has_buildtarget = 'MSVSBUILDTARGET' in self.env
if not env_has_buildtarget:
self.env['MSVSBUILDTARGET'] = buildtarget
@@ -1206,41 +1215,41 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
del self.env['MSVSBUILDTARGET']
self.file.write(V10DSPCommandLine % locals())
-
+
self.file.write('\t</PropertyGroup>\n')
-
+
#filter settings in MSVS 2010 are stored in separate file
self.filtersabs = self.dspabs + '.filters'
try:
self.filters_file = open(self.filtersabs, 'w')
- except IOError, detail:
+ except IOError as detail:
raise SCons.Errors.InternalError('Unable to open "' + self.filtersabs + '" for writing:' + str(detail))
-
+
self.filters_file.write('<?xml version="1.0" encoding="utf-8"?>\n'
'<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\n')
-
+
self.PrintSourceFiles()
-
+
self.filters_file.write('</Project>')
self.filters_file.close()
-
+
self.file.write('\t<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\n'
'\t<ImportGroup Label="ExtensionTargets">\n'
'\t</ImportGroup>\n'
'</Project>\n')
-
+
if self.nokeep == 0:
# now we pickle some data and add it to the file -- MSDEV will ignore it.
- pdata = pickle.dumps(self.configs,1)
- pdata = base64.encodestring(pdata)
+ pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)
+ pdata = base64.encodestring(pdata).decode()
self.file.write('<!-- SCons Data:\n' + pdata + '\n')
- pdata = pickle.dumps(self.sources,1)
- pdata = base64.encodestring(pdata)
+ pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL)
+ pdata = base64.encodestring(pdata).decode()
self.file.write(pdata + '-->\n')
def printFilters(self, hierarchy, name):
sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())
-
+
for key, value in sorteditems:
if SCons.Util.is_Dict(value):
filter_name = name + '\\' + key
@@ -1248,14 +1257,14 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
'\t\t\t<UniqueIdentifier>%s</UniqueIdentifier>\n'
'\t\t</Filter>\n' % (filter_name, _generateGUID(self.dspabs, filter_name)))
self.printFilters(value, filter_name)
-
+
def printSources(self, hierarchy, kind, commonprefix, filter_name):
keywords = {'Source Files': 'ClCompile',
'Header Files': 'ClInclude',
'Local Headers': 'ClInclude',
'Resource Files': 'None',
'Other Files': 'None'}
-
+
sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower())
# First folders, then files
@@ -1269,7 +1278,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
if commonprefix:
file = os.path.join(commonprefix, value)
file = os.path.normpath(file)
-
+
self.file.write('\t\t<%s Include="%s" />\n' % (keywords[kind], file))
self.filters_file.write('\t\t<%s Include="%s">\n'
'\t\t\t<Filter>%s</Filter>\n'
@@ -1281,10 +1290,10 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
'Local Headers': 'h;hpp;hxx;hm;inl',
'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',
'Other Files': ''}
-
- cats = sorted([k for k in categories.keys() if self.sources[k]],
- key = lambda a: a.lower())
-
+
+ cats = sorted([k for k in list(categories.keys()) if self.sources[k]],
+ key = lambda a: a.lower())
+
# print vcxproj.filters file first
self.filters_file.write('\t<ItemGroup>\n')
for kind in cats:
@@ -1292,7 +1301,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
'\t\t\t<UniqueIdentifier>{7b42d31d-d53c-4868-8b92-ca2bc9fc052f}</UniqueIdentifier>\n'
'\t\t\t<Extensions>%s</Extensions>\n'
'\t\t</Filter>\n' % (kind, categories[kind]))
-
+
# First remove any common prefix
sources = self.sources[kind]
commonprefix = None
@@ -1305,17 +1314,17 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
# +1 because the filename starts after the separator
sources = [s[len(cp)+1:] for s in sources]
commonprefix = cp
-
+
hierarchy = makeHierarchy(sources)
self.printFilters(hierarchy, kind)
-
+
self.filters_file.write('\t</ItemGroup>\n')
-
+
# then print files and filters
for kind in cats:
self.file.write('\t<ItemGroup>\n')
self.filters_file.write('\t<ItemGroup>\n')
-
+
# First remove any common prefix
sources = self.sources[kind]
commonprefix = None
@@ -1328,13 +1337,13 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
# +1 because the filename starts after the separator
sources = [s[len(cp)+1:] for s in sources]
commonprefix = cp
-
+
hierarchy = makeHierarchy(sources)
self.printSources(hierarchy, kind, commonprefix, kind)
-
+
self.file.write('\t</ItemGroup>\n')
self.filters_file.write('\t</ItemGroup>\n')
-
+
# add the SConscript file outside of the groups
self.file.write('\t<ItemGroup>\n'
'\t\t<None Include="%s" />\n'
@@ -1342,18 +1351,18 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
'\t</ItemGroup>\n' % str(self.sconscript))
def Parse(self):
- print "_GenerateV10DSP.Parse()"
+ print("_GenerateV10DSP.Parse()")
def Build(self):
try:
self.file = open(self.dspabs, 'w')
- except IOError, detail:
+ except IOError as detail:
raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
else:
self.PrintHeader()
self.PrintProject()
self.file.close()
-
+
_GenerateV10User.Build(self)
class _DSWGenerator(object):
@@ -1428,7 +1437,7 @@ class _GenerateV7DSW(_DSWGenerator):
config.platform = 'Win32'
self.configs[variant] = config
- print "Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dswfile) + "'"
+ print("Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dswfile) + "'")
if 'variant' not in env:
raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\
@@ -1440,7 +1449,7 @@ class _GenerateV7DSW(_DSWGenerator):
AddConfig(self, variant)
self.platforms = []
- for key in self.configs.keys():
+ for key in list(self.configs.keys()):
platform = self.configs[key].platform
if not platform in self.platforms:
self.platforms.append(platform)
@@ -1461,7 +1470,7 @@ class _GenerateV7DSW(_DSWGenerator):
'SLN_RELATIVE_FOLDER_PATH': dsp_relative_folder_path,
'SLN_RELATIVE_FILE_PATH': dsp_relative_file_path}
self.dspfiles_info.append(dspfile_info)
-
+
self.dspfiles_info = []
GenerateProjectFilesInfo(self)
@@ -1497,7 +1506,9 @@ class _GenerateV7DSW(_DSWGenerator):
def PrintSolution(self):
"""Writes a solution file"""
self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr)
- if self.version_num >= 12.0:
+ if self.version_num > 14.0:
+ self.file.write('# Visual Studio 15\n')
+ elif self.version_num >= 12.0:
self.file.write('# Visual Studio 14\n')
elif self.version_num >= 11.0:
self.file.write('# Visual Studio 11\n')
@@ -1507,7 +1518,7 @@ class _GenerateV7DSW(_DSWGenerator):
self.file.write('# Visual Studio 2008\n')
elif self.version_num >= 8.0:
self.file.write('# Visual Studio 2005\n')
-
+
for dspinfo in self.dspfiles_info:
name = dspinfo['NAME']
base, suffix = SCons.Util.splitext(name)
@@ -1515,7 +1526,7 @@ class _GenerateV7DSW(_DSWGenerator):
name = base
self.file.write('Project("%s") = "%s", "%s", "%s"\n'
% (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID']))
- if self.version_num >= 7.1 and self.version_num < 8.0:
+ if 7.1 <= self.version_num < 8.0:
self.file.write('\tProjectSection(ProjectDependencies) = postProject\n'
'\tEndProjectSection\n')
self.file.write('EndProject\n')
@@ -1605,14 +1616,15 @@ class _GenerateV7DSW(_DSWGenerator):
'\tEndGlobalSection\n')
self.file.write('EndGlobal\n')
if self.nokeep == 0:
- pdata = pickle.dumps(self.configs,1)
- pdata = base64.encodestring(pdata)
- self.file.write(pdata + '\n')
+ pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL)
+ pdata = base64.encodestring(pdata).decode()
+ self.file.write(pdata)
+ self.file.write('\n')
def Build(self):
try:
self.file = open(self.dswfile,'w')
- except IOError, detail:
+ except IOError as detail:
raise SCons.Errors.InternalError('Unable to open "' + self.dswfile + '" for writing:' + str(detail))
else:
self.PrintSolution()
@@ -1661,7 +1673,7 @@ class _GenerateV6DSW(_DSWGenerator):
def Build(self):
try:
self.file = open(self.dswfile,'w')
- except IOError, detail:
+ except IOError as detail:
raise SCons.Errors.InternalError('Unable to open "' + self.dswfile + '" for writing:' + str(detail))
else:
self.PrintWorkspace()
@@ -1674,8 +1686,11 @@ def GenerateDSP(dspfile, source, env):
version_num = 6.0
if 'MSVS_VERSION' in env:
version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
- if version_num >= 10.0:
- g = _GenerateV10DSP(dspfile, source, env)
+ if version_num > 14.0:
+ g = _GenerateV10DSP(dspfile, V15DSPHeader, source, env)
+ g.Build()
+ elif version_num >= 10.0:
+ g = _GenerateV10DSP(dspfile, V10DSPHeader, source, env)
g.Build()
elif version_num >= 7.0:
g = _GenerateV7DSP(dspfile, source, env)
@@ -1718,8 +1733,8 @@ def GenerateProject(target, source, env):
if not dspfile is builddspfile:
try:
bdsp = open(str(builddspfile), "w+")
- except IOError, detail:
- print 'Unable to open "' + str(dspfile) + '" for writing:',detail,'\n'
+ except IOError as detail:
+ print('Unable to open "' + str(dspfile) + '" for writing:',detail,'\n')
raise
bdsp.write("This is just a placeholder file.\nThe real project file is here:\n%s\n" % dspfile.get_abspath())
@@ -1734,8 +1749,8 @@ def GenerateProject(target, source, env):
try:
bdsw = open(str(builddswfile), "w+")
- except IOError, detail:
- print 'Unable to open "' + str(dspfile) + '" for writing:',detail,'\n'
+ except IOError as detail:
+ print('Unable to open "' + str(dspfile) + '" for writing:',detail,'\n')
raise
bdsw.write("This is just a placeholder file.\nThe real workspace file is here:\n%s\n" % dswfile.get_abspath())
@@ -1843,7 +1858,10 @@ def projectEmitter(target, source, env):
targetlist = targetlist + t
# Beginning with Visual Studio 2010 for each project file (.vcxproj) we have additional file (.vcxproj.filters)
- if float(env['MSVS_VERSION']) >= 10.0:
+ version_num = 6.0
+ if 'MSVS_VERSION' in env:
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
+ if version_num >= 10.0:
targetlist.append(targetlist[0] + '.filters')
return (targetlist, sourcelist)
@@ -1969,7 +1987,7 @@ def generate(env):
else:
env['MSVS']['PROJECTSUFFIX'] = '.vcxproj'
env['MSVS']['SOLUTIONSUFFIX'] = '.sln'
-
+
if (version_num >= 10.0):
env['MSVSENCODING'] = 'utf-8'
else:
@@ -1982,7 +2000,7 @@ def generate(env):
env['SCONS_HOME'] = os.environ.get('SCONS_HOME')
def exists(env):
- return msvc_exists()
+ return msvc_exists(env)
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mwcc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mwcc.py
index 2694a46d978..393775cd472 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mwcc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mwcc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/mwcc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mwcc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mwld.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mwld.py
index e187273f4fe..ca7b856e513 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/mwld.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/mwld.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/mwld.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mwld.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Tool
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/nasm.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/nasm.py
index 5c8ff4ca24f..18dff0d7488 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/nasm.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/nasm.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/nasm.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/nasm.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/__init__.py
index 78bc679f575..d5f197e29de 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/__init__.py
@@ -4,7 +4,7 @@ SCons Packaging Tool.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -25,18 +25,23 @@ SCons Packaging Tool.
# 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__ = "src/engine/SCons/Tool/packaging/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+import SCons.Defaults
import SCons.Environment
from SCons.Variables import *
from SCons.Errors import *
from SCons.Util import is_List, make_path_relative
from SCons.Warnings import warn, Warning
-import os, imp
-import SCons.Defaults
+import os
+import imp
-__all__ = [ 'src_targz', 'src_tarbz2', 'src_zip', 'tarbz2', 'targz', 'zip', 'rpm', 'msi', 'ipk' ]
+__all__ = [
+ 'src_targz', 'src_tarbz2', 'src_xz', 'src_zip',
+ 'targz', 'tarbz2', 'xz', 'zip',
+ 'rpm', 'msi', 'ipk',
+]
#
# Utility and Builder function
@@ -102,7 +107,7 @@ def Package(env, target=None, source=None, **kw):
from SCons.Script import GetOption
kw['PACKAGETYPE'] = GetOption('package_type')
- if kw['PACKAGETYPE'] == None:
+ if kw['PACKAGETYPE'] is None:
if 'Tar' in env['BUILDERS']:
kw['PACKAGETYPE']='targz'
elif 'Zip' in env['BUILDERS']:
@@ -119,7 +124,7 @@ def Package(env, target=None, source=None, **kw):
try:
file,path,desc=imp.find_module(type, __path__)
return imp.load_module(type, file, path, desc)
- except ImportError, e:
+ except ImportError as e:
raise EnvironmentError("packager %s not available: %s"%(type,str(e)))
packagers=list(map(load_packager, PACKAGETYPE))
@@ -140,7 +145,7 @@ def Package(env, target=None, source=None, **kw):
if 'PACKAGEROOT' not in kw:
kw['PACKAGEROOT'] = default_name%kw
- except KeyError, e:
+ except KeyError as e:
raise SCons.Errors.UserError( "Missing Packagetag '%s'"%e.args[0] )
# setup the source files
@@ -156,22 +161,29 @@ def Package(env, target=None, source=None, **kw):
assert( len(target) == 0 )
- except KeyError, e:
+ except KeyError as e:
raise SCons.Errors.UserError( "Missing Packagetag '%s' for %s packager"\
% (e.args[0],packager.__name__) )
- except TypeError, e:
+ except TypeError as e:
# this exception means that a needed argument for the packager is
# missing. As our packagers get their "tags" as named function
# arguments we need to find out which one is missing.
- from inspect import getargspec
- args,varargs,varkw,defaults=getargspec(packager.package)
- if defaults!=None:
- args=args[:-len(defaults)] # throw away arguments with default values
+ #TODO: getargspec deprecated in Py3. cleanup when Py2.7 dropped.
+ try:
+ from inspect import getfullargspec
+ argspec = getfullargspec(packager.package)
+ except ImportError:
+ from inspect import getargspec
+ argspec = getargspec(packager.package)
+ args = argspec.args
+ if argspec.defaults:
+ # throw away arguments with default values
+ args = args[:-len(argspec.defaults)]
args.remove('env')
args.remove('target')
args.remove('source')
# now remove any args for which we have a value in kw.
- args=[x for x in args if x not in kw]
+ args = [x for x in args if x not in kw]
if len(args)==0:
raise # must be a different error, so re-raise
@@ -233,7 +245,7 @@ def copy_attr(f1, f2):
"""
copyit = lambda x: not hasattr(f2, x) and x[:10] == 'PACKAGING_'
if f1._tags:
- pattrs = list(filter(copyit, f1._tags))
+ pattrs = [tag for tag in f1._tags if copyit(tag)]
for attr in pattrs:
f2.Tag(attr, f1.GetTag(attr))
@@ -283,12 +295,11 @@ def stripinstallbuilder(target, source, env):
It also warns about files which have no install builder attached.
"""
def has_no_install_location(file):
- return not (file.has_builder() and\
- hasattr(file.builder, 'name') and\
- (file.builder.name=="InstallBuilder" or\
- file.builder.name=="InstallAsBuilder"))
+ return not (file.has_builder() and hasattr(file.builder, 'name')
+ and file.builder.name in ["InstallBuilder", "InstallAsBuilder"])
+
- if len(list(filter(has_no_install_location, source))):
+ if len([src for src in source if has_no_install_location(src)]):
warn(Warning, "there are files to package which have no\
InstallBuilder attached, this might lead to irreproducible packages")
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/ipk.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/ipk.py
index fbf3c2b1eac..9d3f45d272d 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/ipk.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/ipk.py
@@ -2,7 +2,7 @@
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,11 +24,13 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/packaging/ipk.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/ipk.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+import os
import SCons.Builder
import SCons.Node.FS
-import os
+import SCons.Util
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
@@ -119,7 +121,9 @@ def build_specfiles(source, target, env):
try:
return opened_files[needle]
except KeyError:
- file=filter(lambda x: x.get_path().rfind(needle)!=-1, haystack)[0]
+ files = filter(lambda x: x.get_path().rfind(needle) != -1, haystack)
+ # Py3: filter returns an iterable, not a list
+ file = list(files)[0]
opened_files[needle]=open(file.get_abspath(), 'w')
return opened_files[needle]
@@ -169,7 +173,7 @@ Description: $X_IPK_DESCRIPTION
#
# close all opened files
- for f in opened_files.values():
+ for f in list(opened_files.values()):
f.close()
# call a user specified function
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/msi.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/msi.py
index 29095e81191..1226c70c556 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/msi.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/msi.py
@@ -4,7 +4,7 @@ The msi packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -25,7 +25,7 @@ The msi packager.
# 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__ = "src/engine/SCons/Tool/packaging/msi.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/msi.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import SCons
@@ -63,8 +63,8 @@ def convert_to_id(s, id_set):
"""
charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz0123456789_.'
if s[0] in '0123456789.':
- s += '_'+s
- id = [c for c in s if c in charset]
+ s = '_' + s
+ id = ''.join([c for c in s if c in charset])
# did we already generate an id for this file?
try:
@@ -108,14 +108,13 @@ def gen_dos_short_file_name(file, filename_set):
# strip forbidden characters.
forbidden = '."/[]:;=, '
- fname = [c for c in fname if c not in forbidden]
+ fname = ''.join([c for c in fname if c not in forbidden])
# check if we already generated a filename with the same number:
# thisis1.txt, thisis2.txt etc.
duplicate, num = not None, 1
while duplicate:
- shortname = "%s%s" % (fname[:8-len(str(num))].upper(),\
- str(num))
+ shortname = "%s%s" % (fname[:8-len(str(num))].upper(), str(num))
if len(ext) >= 2:
shortname = "%s%s" % (shortname, ext[:4].upper())
@@ -216,7 +215,7 @@ def build_wxsfile(target, source, env):
if 'CHANGE_SPECFILE' in env:
env['CHANGE_SPECFILE'](target, source)
- except KeyError, e:
+ except KeyError as e:
raise SCons.Errors.UserError( '"%s" package field for MSI is missing.' % e.args[0] )
#
@@ -301,7 +300,7 @@ def build_wxsfile_file_section(root, files, NAME, VERSION, VENDOR, filename_set,
if c.nodeName == 'Directory'
and c.attributes['LongName'].value == escape(d)]
- if already_created != []:
+ if already_created:
Directory = already_created[0]
dir_parts.remove(d)
upper_dir += d
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/rpm.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/rpm.py
index 6c00e8c5dfe..a03eab86f61 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/rpm.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/rpm.py
@@ -4,7 +4,7 @@ The rpm packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -25,7 +25,7 @@ The rpm packager.
# 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__ = "src/engine/SCons/Tool/packaging/rpm.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/rpm.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
@@ -51,10 +51,9 @@ def package(env, target, source, PACKAGEROOT, NAME, VERSION,
if str(target[0])!="%s-%s"%(NAME, VERSION):
raise UserError( "Setting target is not supported for rpm." )
else:
- # This should be overridable from the construction environment,
- # which it is by using ARCHITECTURE=.
+ # Deduce the build architecture, but allow it to be overridden
+ # by setting ARCHITECTURE in the construction env.
buildarchitecture = SCons.Tool.rpmutils.defaultMachine()
-
if 'ARCHITECTURE' in kw:
buildarchitecture = kw['ARCHITECTURE']
@@ -95,13 +94,15 @@ def collectintargz(target, source, env):
# find the .spec file for rpm and add it since it is not necessarily found
# by the FindSourceFiles function.
sources.extend( [s for s in source if str(s).rfind('.spec')!=-1] )
+ # sort to keep sources from changing order across builds
+ sources.sort()
# as the source contains the url of the source package this rpm package
# is built from, we extract the target name
tarball = (str(target[0])+".tar.gz").replace('.rpm', '')
try:
tarball = env['SOURCE_URL'].split('/')[-1]
- except KeyError, e:
+ except KeyError as e:
raise SCons.Errors.UserError( "Missing PackageTag '%s' for RPM packager" % e.args[0] )
tarball = src_targz.package(env, source=sources, target=tarball,
@@ -124,20 +125,18 @@ def build_specfile(target, source, env):
""" Builds a RPM specfile from a dictionary with string metadata and
by analyzing a tree of nodes.
"""
- file = open(target[0].get_abspath(), 'w')
-
- try:
- file.write( build_specfile_header(env) )
- file.write( build_specfile_sections(env) )
- file.write( build_specfile_filesection(env, source) )
- file.close()
+ with open(target[0].get_abspath(), 'w') as file:
+ try:
+ file.write(build_specfile_header(env))
+ file.write(build_specfile_sections(env))
+ file.write(build_specfile_filesection(env, source))
- # call a user specified function
- if 'CHANGE_SPECFILE' in env:
- env['CHANGE_SPECFILE'](target, source)
+ # call a user specified function
+ if 'CHANGE_SPECFILE' in env:
+ env['CHANGE_SPECFILE'](target, source)
- except KeyError, e:
- raise SCons.Errors.UserError( '"%s" package field for RPM is missing.' % e.args[0] )
+ except KeyError as e:
+ raise SCons.Errors.UserError('"%s" package field for RPM is missing.' % e.args[0])
#
@@ -199,7 +198,8 @@ def build_specfile_header(spec):
'PACKAGEVERSION' : '%%define release %s\nRelease: %%{release}\n',
'X_RPM_GROUP' : 'Group: %s\n',
'SUMMARY' : 'Summary: %s\n',
- 'LICENSE' : 'License: %s\n', }
+ 'LICENSE' : 'License: %s\n',
+ }
str = str + SimpleTagCompiler(mandatory_header_fields).compile( spec )
@@ -209,6 +209,7 @@ def build_specfile_header(spec):
'X_RPM_URL' : 'Url: %s\n',
'SOURCE_URL' : 'Source: %s\n',
'SUMMARY_' : 'Summary(%s): %s\n',
+ 'ARCHITECTURE' : 'BuildArch: %s\n',
'X_RPM_DISTRIBUTION' : 'Distribution: %s\n',
'X_RPM_ICON' : 'Icon: %s\n',
'X_RPM_PACKAGER' : 'Packager: %s\n',
@@ -225,22 +226,35 @@ def build_specfile_header(spec):
'X_RPM_EXCLUDEARCH' : 'ExcludeArch: %s\n',
'X_RPM_EXCLUSIVEARCH' : 'ExclusiveArch: %s\n',
'X_RPM_PREFIX' : 'Prefix: %s\n',
- 'X_RPM_CONFLICTS' : 'Conflicts: %s\n',
# internal use
- 'X_RPM_BUILDROOT' : 'BuildRoot: %s\n', }
+ 'X_RPM_BUILDROOT' : 'BuildRoot: %s\n',
+ }
# fill in default values:
- # Adding a BuildRequires renders the .rpm unbuildable under System, which
+ # Adding a BuildRequires renders the .rpm unbuildable under systems which
# are not managed by rpm, since the database to resolve this dependency is
# missing (take Gentoo as an example)
-# if not s.has_key('x_rpm_BuildRequires'):
-# s['x_rpm_BuildRequires'] = 'scons'
+ #if 'X_RPM_BUILDREQUIRES' not in spec:
+ # spec['X_RPM_BUILDREQUIRES'] = 'scons'
if 'X_RPM_BUILDROOT' not in spec:
spec['X_RPM_BUILDROOT'] = '%{_tmppath}/%{name}-%{version}-%{release}'
str = str + SimpleTagCompiler(optional_header_fields, mandatory=0).compile( spec )
+
+ # Add any extra specfile definitions the user may have supplied.
+ # These flags get no processing, they are just added.
+ # github #3164: if we don't turn off debug package generation
+ # the tests which build packages all fail. If there are no
+ # extra flags, default to adding this one. If the user wants
+ # to turn this back on, supply the flag set to None.
+
+ if 'X_RPM_EXTRADEFS' not in spec:
+ spec['X_RPM_EXTRADEFS'] = ['%global debug_package %{nil}']
+ for extra in spec['X_RPM_EXTRADEFS']:
+ str += extra + '\n'
+
return str
#
@@ -270,7 +284,7 @@ def build_specfile_filesection(spec, files):
for file in files:
# build the tagset
tags = {}
- for k in supported_tags.keys():
+ for k in list(supported_tags.keys()):
try:
v = file.GetTag(k)
if v:
@@ -324,7 +338,7 @@ class SimpleTagCompiler(object):
for key, replacement in domestic:
try:
str = str + replacement % values[key]
- except KeyError, e:
+ except KeyError as e:
if self.mandatory:
raise e
@@ -335,7 +349,7 @@ class SimpleTagCompiler(object):
int_values_for_key = [(get_country_code(t[0]),t[1]) for t in x]
for v in int_values_for_key:
str = str + replacement % v
- except KeyError, e:
+ except KeyError as e:
if self.mandatory:
raise e
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_tarbz2.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_tarbz2.py
index b72f42e5d65..0787750d335 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_tarbz2.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_tarbz2.py
@@ -1,10 +1,10 @@
-"""SCons.Tool.Packaging.tarbz2
+"""SCons.Tool.Packaging.src_tarbz2
The tarbz2 SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The tarbz2 SRC packager.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Tool.packaging import putintopackageroot
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_targz.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_targz.py
index c8e91ec89a8..7ff2279768a 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_targz.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_targz.py
@@ -1,10 +1,10 @@
-"""SCons.Tool.Packaging.targz
+"""SCons.Tool.Packaging.src_targz
The targz SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The targz SRC packager.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Tool.packaging import putintopackageroot
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_tarxz.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_tarxz.py
new file mode 100644
index 00000000000..e2d65615da6
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_tarxz.py
@@ -0,0 +1,43 @@
+"""SCons.Tool.Packaging.src_tarxz
+
+The tarxz SRC packager.
+"""
+
+#
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/packaging/src_tarxz.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+from SCons.Tool.packaging import putintopackageroot
+
+def package(env, target, source, PACKAGEROOT, **kw):
+ bld = env['BUILDERS']['Tar']
+ bld.set_suffix('.tar.xz')
+ target, source = putintopackageroot(target, source, env, PACKAGEROOT, honor_install_location=0)
+ return bld(env, target, source, TARFLAGS='-Jc')
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_zip.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_zip.py
index 41d5e45b198..d18aa3fdfe7 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/src_zip.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/src_zip.py
@@ -4,7 +4,7 @@ The zip SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The zip SRC packager.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Tool.packaging import putintopackageroot
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/tarbz2.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/tarbz2.py
index a98c6e81133..613120308f9 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/tarbz2.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/tarbz2.py
@@ -1,10 +1,10 @@
"""SCons.Tool.Packaging.tarbz2
-The tarbz2 SRC packager.
+The tarbz2 packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,13 +26,13 @@ The tarbz2 SRC packager.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
def package(env, target, source, PACKAGEROOT, **kw):
bld = env['BUILDERS']['Tar']
- bld.set_suffix('.tar.gz')
+ bld.set_suffix('.tar.bz2')
target, source = putintopackageroot(target, source, env, PACKAGEROOT)
target, source = stripinstallbuilder(target, source, env)
return bld(env, target, source, TARFLAGS='-jc')
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/targz.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/targz.py
index d0c80dbfeb4..8ce2465adcf 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/targz.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/targz.py
@@ -1,10 +1,10 @@
"""SCons.Tool.Packaging.targz
-The targz SRC packager.
+The targz packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The targz SRC packager.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/packaging/targz.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/targz.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/tarxz.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/tarxz.py
new file mode 100644
index 00000000000..bfddb6d18de
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/tarxz.py
@@ -0,0 +1,44 @@
+"""SCons.Tool.Packaging.tarxz
+
+The tarxz packager.
+"""
+
+#
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/packaging/tarxz.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
+
+def package(env, target, source, PACKAGEROOT, **kw):
+ bld = env['BUILDERS']['Tar']
+ bld.set_suffix('.tar.xz')
+ target, source = putintopackageroot(target, source, env, PACKAGEROOT)
+ target, source = stripinstallbuilder(target, source, env)
+ return bld(env, target, source, TARFLAGS='-Jc')
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/zip.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/zip.py
index 0709ff162ed..cb116f0b1ca 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/zip.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/packaging/zip.py
@@ -4,7 +4,7 @@ The zip SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The zip SRC packager.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/packaging/zip.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/zip.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdf.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdf.py
index 9475bda15d0..5b8d97148a7 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdf.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdf.py
@@ -6,7 +6,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/pdf.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/pdf.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Builder
import SCons.Tool
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdflatex.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdflatex.py
index 9f897369193..603dd29f7ac 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdflatex.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdflatex.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +32,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/pdflatex.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/pdflatex.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Util
@@ -62,7 +62,7 @@ def generate(env):
env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)
- import pdf
+ from . import pdf
pdf.generate(env)
bld = env['BUILDERS']['PDF']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdftex.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdftex.py
index 815dc83bdca..85b45d23aec 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/pdftex.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/pdftex.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +32,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/pdftex.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/pdftex.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import SCons.Action
@@ -85,7 +85,7 @@ def generate(env):
env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)
- import pdf
+ from . import pdf
pdf.generate(env)
bld = env['BUILDERS']['PDF']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/qt.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/qt.py
index 4feb38eaa27..57175d0fb4c 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/qt.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/qt.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,11 +31,13 @@ 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.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Tool/qt.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/qt.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import re
+import glob
import SCons.Action
import SCons.Builder
@@ -43,6 +45,8 @@ import SCons.Defaults
import SCons.Scanner
import SCons.Tool
import SCons.Util
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
class ToolQtWarning(SCons.Warnings.Warning):
pass
@@ -58,9 +62,34 @@ SCons.Warnings.enableWarningClass(ToolQtWarning)
header_extensions = [".h", ".hxx", ".hpp", ".hh"]
if SCons.Util.case_sensitive_suffixes('.h', '.H'):
header_extensions.append('.H')
-cplusplus = __import__('c++', globals(), locals(), [])
+
cxx_suffixes = cplusplus.CXXSuffixes
+
+#
+def find_platform_specific_qt_paths():
+ """
+ If the platform has non-standard paths which it installs QT in,return the likely default path
+ :return:
+ """
+
+ # qt_bin_dirs = []
+ qt_bin_dir = None
+ if os.path.isfile('/etc/redhat-release'):
+ with open('/etc/redhat-release','r') as rr:
+ lines = rr.readlines()
+ distro = lines[0].split()[0]
+ if distro == 'CentOS':
+ # Centos installs QT under /usr/{lib,lib64}/qt{4,5,-3.3}/bin
+ # so we need to handle this differently
+ # qt_bin_dirs = glob.glob('/usr/lib64/qt*/bin')
+ qt_bin_dir = '/usr/lib64/qt-3.3/bin'
+
+ return qt_bin_dir
+
+
+QT_BIN_DIR = find_platform_specific_qt_paths()
+
def checkMocIncluded(target, source, env):
moc = target[0]
cpp = source[0]
@@ -130,15 +159,17 @@ class _Automoc(object):
if not obj.has_builder():
# binary obj file provided
if debug:
- print "scons: qt: '%s' seems to be a binary. Discarded." % str(obj)
+ print("scons: qt: '%s' seems to be a binary. Discarded." % str(obj))
continue
cpp = obj.sources[0]
if not splitext(str(cpp))[1] in cxx_suffixes:
if debug:
- print "scons: qt: '%s' is no cxx file. Discarded." % str(cpp)
+ print("scons: qt: '%s' is no cxx file. Discarded." % str(cpp))
# c or fortran source
continue
#cpp_contents = comment.sub('', cpp.get_text_contents())
+ if debug:
+ print("scons: qt: Getting contents of %s" % cpp)
cpp_contents = cpp.get_text_contents()
h=None
for h_ext in header_extensions:
@@ -148,12 +179,12 @@ class _Automoc(object):
h = find_file(hname, (cpp.get_dir(),), env.File)
if h:
if debug:
- print "scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp))
+ print("scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp)))
#h_contents = comment.sub('', h.get_text_contents())
h_contents = h.get_text_contents()
break
if not h and debug:
- print "scons: qt: no header for '%s'." % (str(cpp))
+ print("scons: qt: no header for '%s'." % (str(cpp)))
if h and q_object_search.search(h_contents):
# h file with the Q_OBJECT macro found -> add moc_cpp
moc_cpp = env.Moc(h)
@@ -161,14 +192,14 @@ class _Automoc(object):
out_sources.append(moc_o)
#moc_cpp.target_scanner = SCons.Defaults.CScan
if debug:
- print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp))
+ print("scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp)))
if cpp and q_object_search.search(cpp_contents):
# cpp file with Q_OBJECT macro found -> add moc
# (to be included in cpp)
moc = env.Moc(cpp)
env.Ignore(moc, moc)
if debug:
- print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc))
+ print("scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc)))
#moc.source_scanner = SCons.Defaults.CScan
# restore the original env attributes (FIXME)
objBuilder.env = objBuilderEnv
@@ -181,13 +212,12 @@ AutomocStatic = _Automoc('StaticObject')
def _detect(env):
"""Not really safe, but fast method to detect the QT library"""
- QTDIR = None
- if not QTDIR:
- QTDIR = env.get('QTDIR',None)
+
+ QTDIR = env.get('QTDIR',None)
if not QTDIR:
QTDIR = os.environ.get('QTDIR',None)
if not QTDIR:
- moc = env.WhereIs('moc')
+ moc = env.WhereIs('moc') or env.WhereIs('moc',QT_BIN_DIR)
if moc:
QTDIR = os.path.dirname(os.path.dirname(moc))
SCons.Warnings.warn(
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rmic.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rmic.py
index c05286db867..ab26e379176 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rmic.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rmic.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/rmic.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/rmic.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
@@ -40,6 +40,9 @@ import SCons.Builder
import SCons.Node.FS
import SCons.Util
+from SCons.Tool.JavaCommon import get_java_install_dirs
+
+
def emit_rmic_classes(target, source, env):
"""Create and return lists of Java RMI stub and skeleton
class files to be created from a set of class files.
@@ -105,6 +108,18 @@ def generate(env):
"""Add Builders and construction variables for rmic to an Environment."""
env['BUILDERS']['RMIC'] = RMICBuilder
+ if env['PLATFORM'] == 'win32':
+ version = env.get('JAVAVERSION', None)
+ default_paths=get_java_install_dirs(env['PLATFORM'], version=version)
+
+ # Ensure that we have a proper path for rmic
+ rmic = SCons.Tool.find_program_path(env, 'rmic', default_paths=default_paths)
+
+ # print("RMIC: %s"%rmic)
+ if rmic:
+ rmic_bin_dir = os.path.dirname(rmic)
+ env.AppendENVPath('PATH', rmic_bin_dir)
+
env['RMIC'] = 'rmic'
env['RMICFLAGS'] = SCons.Util.CLVar('')
env['RMICCOM'] = '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir} -classpath ${SOURCE.attributes.java_classdir} ${SOURCES.attributes.java_classname}'
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpcgen.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpcgen.py
index 6c4116f5b0a..69b275c766d 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpcgen.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpcgen.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/rpcgen.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/rpcgen.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
from SCons.Builder import Builder
import SCons.Util
@@ -43,7 +43,7 @@ rpcgen_service = cmd % ('m', '$RPCGENSERVICEFLAGS')
rpcgen_xdr = cmd % ('c', '$RPCGENXDRFLAGS')
def generate(env):
- "Add RPCGEN Builders and construction variables for an Environment."
+ """Add RPCGEN Builders and construction variables for an Environment."""
client = Builder(action=rpcgen_client, suffix='_clnt.c', src_suffix='.x')
header = Builder(action=rpcgen_header, suffix='.h', src_suffix='.x')
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpm.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpm.py
index fe63e2941a1..e91c7e92f81 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpm.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpm.py
@@ -11,7 +11,7 @@ tar.gz consisting of the source file and a specfile.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -33,7 +33,7 @@ tar.gz consisting of the source file and a specfile.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/rpm.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/rpm.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import re
@@ -71,7 +71,7 @@ def build_rpm(target, source, env):
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True)
- output = handle.stdout.read()
+ output = SCons.Util.to_str(handle.stdout.read())
status = handle.wait()
if status:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpmutils.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpmutils.py
index aa6c6804b1d..b2c5a1aa151 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/rpmutils.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/rpmutils.py
@@ -14,7 +14,7 @@ exact syntax.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,13 +34,16 @@ exact syntax.
# 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.
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Tool/rpmutils.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/rpmutils.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import platform
import subprocess
+import SCons.Util
+
# Start of rpmrc dictionaries (Marker, don't change or remove!)
os_canon = {
'AIX' : ['AIX','5'],
@@ -443,6 +446,7 @@ def defaultMachine(use_rpm_default=True):
try:
# This should be the most reliable way to get the default arch
rmachine = subprocess.check_output(['rpm', '--eval=%_target_cpu'], shell=False).rstrip()
+ rmachine = SCons.Util.to_str(rmachine)
except Exception as e:
# Something went wrong, try again by looking up platform.machine()
return defaultMachine(False)
@@ -501,7 +505,7 @@ def updateRpmDicts(rpmrc, pyfile):
key = tokens[0]
if key in sections:
# Have we met this section before?
- if not data.has_key(tokens[0]):
+ if tokens[0] not in data:
# No, so insert it
data[key] = {}
# Insert data
@@ -519,7 +523,7 @@ def updateRpmDicts(rpmrc, pyfile):
if l.startswith('# Start of rpmrc dictionaries'):
pm = 1
# Write data sections to single dictionaries
- for key, entries in data.iteritems():
+ for key, entries in data.items():
out.write("%s = {\n" % key)
for arch in sorted(entries.keys()):
out.write(" '%s' : ['%s'],\n" % (arch, "','".join(entries[arch])))
@@ -529,7 +533,7 @@ def updateRpmDicts(rpmrc, pyfile):
pass
def usage():
- print "rpmutils.py rpmrc.in rpmutils.py"
+ print("rpmutils.py rpmrc.in rpmutils.py")
def main():
import sys
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgiar.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgiar.py
index 849520c9bd0..356e430c1f4 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgiar.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgiar.py
@@ -11,7 +11,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -33,7 +33,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sgiar.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgiar.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgic++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgic++.py
new file mode 100644
index 00000000000..73326b3a969
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgic++.py
@@ -0,0 +1,43 @@
+"""SCons.Tool.sgic++
+
+Tool-specific initialization for MIPSpro C++ on SGI.
+
+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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/sgic++.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+#forward proxy to the preffered cxx version
+from SCons.Tool.sgicxx import *
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgicc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgicc.py
index 474e6cdcae8..5ecd05f0967 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgicc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgicc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,9 +31,9 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sgicc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgicc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-import cc
+from . import cc
def generate(env):
"""Add Builders and construction variables for gcc to an Environment."""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgic++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgicxx.py
index ec1954ec782..97a93c89575 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgic++.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgicxx.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,11 +31,14 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sgic++.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgicxx.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
-cplusplus = __import__('c++', globals(), locals(), [])
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('cxx', globals(), locals(), [])
+
def generate(env):
"""Add Builders and construction variables for SGI MIPS C++ to an Environment."""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgilink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgilink.py
index 491d293ff4a..9e131d21719 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sgilink.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sgilink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,11 +31,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sgilink.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgilink.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
-import link
+from . import link
linkers = ['CC', 'cc']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunar.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunar.py
index e453a7bbcaf..a619ea662de 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunar.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunar.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,7 +32,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sunar.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunar.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Defaults
import SCons.Tool
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunc++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunc++.py
new file mode 100644
index 00000000000..373ca6b8ecd
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunc++.py
@@ -0,0 +1,45 @@
+"""SCons.Tool.sunc++
+
+Tool-specific initialization for C++ on SunOS / Solaris.
+
+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 (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/sunc++.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+
+#forward proxy to the preffered cxx version
+from SCons.Tool.suncxx import *
+
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/suncc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/suncc.py
index 0110174e4be..a232cd163c5 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/suncc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/suncc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,11 +30,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/suncc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/suncc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
-import cc
+from . import cc
def generate(env):
"""
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunc++.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/suncxx.py
index cf0c95dc501..24e0c185c27 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunc++.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/suncxx.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sunc++.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/suncxx.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons
@@ -39,7 +39,9 @@ import os
import re
import subprocess
-cplusplus = __import__('c++', globals(), locals(), [])
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('c++', globals(), locals(), [])
package_info = {}
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf77.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf77.py
index e3260c9e664..8f24a1581e1 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf77.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf77.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,11 +31,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sunf77.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunf77.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
-from FortranCommon import add_all_to_env
+from .FortranCommon import add_all_to_env
compilers = ['sunf77', 'f77']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf90.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf90.py
index 63465e2f5fc..303eac29759 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf90.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf90.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,11 +31,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sunf90.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunf90.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
-from FortranCommon import add_all_to_env
+from .FortranCommon import add_all_to_env
compilers = ['sunf90', 'f90']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf95.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf95.py
index 61bdf3742d8..621fdfaf730 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunf95.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunf95.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,11 +31,11 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sunf95.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunf95.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Util
-from FortranCommon import add_all_to_env
+from .FortranCommon import add_all_to_env
compilers = ['sunf95', 'f95']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunlink.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunlink.py
index 49deaf1637c..ae1b5dbf4cd 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunlink.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/sunlink.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,14 +30,14 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sunlink.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunlink.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import os.path
import SCons.Util
-import link
+from . import link
ccLinker = None
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/swig.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/swig.py
index 1d806ae6f58..830e82ea228 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/swig.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/swig.py
@@ -7,9 +7,10 @@ It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
+from __future__ import print_function
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,9 +32,10 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/swig.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/swig.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
+import sys
import re
import subprocess
@@ -140,13 +142,14 @@ def _get_swig_version(env, swig):
stdout = subprocess.PIPE)
if pipe.wait() != 0: return
- out = pipe.stdout.read()
- match = re.search(r'SWIG Version\s+(\S+).*', out, re.MULTILINE)
+ # MAYBE: out = SCons.Util.to_str (pipe.stdout.read())
+ out = SCons.Util.to_str(pipe.stdout.read())
+ match = re.search('SWIG Version\s+(\S+).*', out, re.MULTILINE)
if match:
- if verbose: print "Version is:%s"%match.group(1)
+ if verbose: print("Version is:%s"%match.group(1))
return match.group(1)
else:
- if verbose: print "Unable to detect version: [%s]"%out
+ if verbose: print("Unable to detect version: [%s]"%out)
def generate(env):
"""Add Builders and construction variables for swig to an Environment."""
@@ -167,6 +170,17 @@ def generate(env):
java_file.add_action('.i', SwigAction)
java_file.add_emitter('.i', _swigEmitter)
+ from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
+ from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
+
+ if sys.platform == 'win32':
+ swig = SCons.Tool.find_program_path(env, 'swig', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS + [r'C:\ProgramData\chocolatey\bin'] )
+ if swig:
+ swig_bin_dir = os.path.dirname(swig)
+ env.AppendENVPath('PATH', swig_bin_dir)
+ else:
+ SCons.Warnings.Warning('swig tool requested, but binary not found in ENV PATH')
+
if 'SWIG' not in env:
env['SWIG'] = env.Detect(swigs) or swigs[0]
env['SWIGVERSION'] = _get_swig_version(env, env['SWIG'])
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tar.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tar.py
index c19d4916a7b..edaaa4639cb 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tar.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tar.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/tar.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/tar.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Action
import SCons.Builder
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tex.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tex.py
index b4e457f6460..1632f8b2880 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tex.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tex.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,8 +31,9 @@ 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.
#
+from __future__ import print_function
-__revision__ = "src/engine/SCons/Tool/tex.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/tex.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import re
@@ -164,15 +165,15 @@ def FindFile(name,suffixes,paths,env,requireExt=False):
if ext:
name = name + ext
if Verbose:
- print " searching for '%s' with extensions: " % name,suffixes
+ print(" searching for '%s' with extensions: " % name,suffixes)
for path in paths:
testName = os.path.join(path,name)
if Verbose:
- print " look for '%s'" % testName
+ print(" look for '%s'" % testName)
if os.path.isfile(testName):
if Verbose:
- print " found '%s'" % testName
+ print(" found '%s'" % testName)
return env.fs.File(testName)
else:
name_ext = SCons.Util.splitext(testName)[1]
@@ -183,14 +184,14 @@ def FindFile(name,suffixes,paths,env,requireExt=False):
for suffix in suffixes:
testNameExt = testName + suffix
if Verbose:
- print " look for '%s'" % testNameExt
+ print(" look for '%s'" % testNameExt)
if os.path.isfile(testNameExt):
if Verbose:
- print " found '%s'" % testNameExt
+ print(" found '%s'" % testNameExt)
return env.fs.File(testNameExt)
if Verbose:
- print " did not find '%s'" % name
+ print(" did not find '%s'" % name)
return None
def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None):
@@ -250,7 +251,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
saved_hashes[suffix] = theNode.get_csig()
if Verbose:
- print "hashes: ",saved_hashes
+ print("hashes: ",saved_hashes)
must_rerun_latex = True
@@ -269,12 +270,12 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
if saved_hashes[suffix] == new_md5:
if Verbose:
- print "file %s not changed" % (targetbase+suffix)
+ print("file %s not changed" % (targetbase+suffix))
return False # unchanged
saved_hashes[suffix] = new_md5
must_rerun_latex = True
if Verbose:
- print "file %s changed, rerunning Latex, new hash = " % (targetbase+suffix), new_md5
+ print("file %s changed, rerunning Latex, new hash = " % (targetbase+suffix), new_md5)
return True # changed
# generate the file name that latex will generate
@@ -296,7 +297,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
logfilename = targetbase + '.log'
logContent = ''
if os.path.isfile(logfilename):
- logContent = open(logfilename, "rb").read()
+ logContent = open(logfilename, "r").read()
# Read the fls file to find all .aux files
@@ -304,7 +305,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
flsContent = ''
auxfiles = []
if os.path.isfile(flsfilename):
- flsContent = open(flsfilename, "rb").read()
+ flsContent = open(flsfilename, "r").read()
auxfiles = openout_aux_re.findall(flsContent)
# remove duplicates
dups = {}
@@ -314,7 +315,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
bcffiles = []
if os.path.isfile(flsfilename):
- flsContent = open(flsfilename, "rb").read()
+ flsContent = open(flsfilename, "r").read()
bcffiles = openout_bcf_re.findall(flsContent)
# remove duplicates
dups = {}
@@ -323,8 +324,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
bcffiles = list(dups.keys())
if Verbose:
- print "auxfiles ",auxfiles
- print "bcffiles ",bcffiles
+ print("auxfiles ",auxfiles)
+ print("bcffiles ",bcffiles)
# Now decide if bibtex will need to be run.
# The information that bibtex reads from the .aux file is
@@ -337,10 +338,10 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
already_bibtexed.append(auxfilename)
target_aux = os.path.join(targetdir, auxfilename)
if os.path.isfile(target_aux):
- content = open(target_aux, "rb").read()
+ content = open(target_aux, "r").read()
if content.find("bibdata") != -1:
if Verbose:
- print "Need to run bibtex on ",auxfilename
+ print("Need to run bibtex on ",auxfilename)
bibfile = env.fs.File(SCons.Util.splitext(target_aux)[0])
result = BibTeXAction(bibfile, bibfile, env)
if result != 0:
@@ -360,10 +361,10 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
already_bibtexed.append(bcffilename)
target_bcf = os.path.join(targetdir, bcffilename)
if os.path.isfile(target_bcf):
- content = open(target_bcf, "rb").read()
+ content = open(target_bcf, "r").read()
if content.find("bibdata") != -1:
if Verbose:
- print "Need to run biber on ",bcffilename
+ print("Need to run biber on ",bcffilename)
bibfile = env.fs.File(SCons.Util.splitext(target_bcf)[0])
result = BiberAction(bibfile, bibfile, env)
if result != 0:
@@ -374,7 +375,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
if check_MD5(suffix_nodes['.idx'],'.idx') or (count == 1 and run_makeindex):
# We must run makeindex
if Verbose:
- print "Need to run makeindex"
+ print("Need to run makeindex")
idxfile = suffix_nodes['.idx']
result = MakeIndexAction(idxfile, idxfile, env)
if result != 0:
@@ -392,7 +393,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
if check_MD5(suffix_nodes['.nlo'],'.nlo') or (count == 1 and run_nomenclature):
# We must run makeindex
if Verbose:
- print "Need to run makeindex for nomenclature"
+ print("Need to run makeindex for nomenclature")
nclfile = suffix_nodes['.nlo']
result = MakeNclAction(nclfile, nclfile, env)
if result != 0:
@@ -404,7 +405,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
if check_MD5(suffix_nodes['.glo'],'.glo') or (count == 1 and run_glossaries) or (count == 1 and run_glossary):
# We must run makeindex
if Verbose:
- print "Need to run makeindex for glossary"
+ print("Need to run makeindex for glossary")
glofile = suffix_nodes['.glo']
result = MakeGlossaryAction(glofile, glofile, env)
if result != 0:
@@ -416,7 +417,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
if check_MD5(suffix_nodes['.acn'],'.acn') or (count == 1 and run_acronyms):
# We must run makeindex
if Verbose:
- print "Need to run makeindex for acronyms"
+ print("Need to run makeindex for acronyms")
acrfile = suffix_nodes['.acn']
result = MakeAcronymsAction(acrfile, acrfile, env)
if result != 0:
@@ -429,7 +430,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
if check_MD5(suffix_nodes[newglossary_suffix[ig][2]],newglossary_suffix[ig][2]) or (count == 1):
# We must run makeindex
if Verbose:
- print "Need to run makeindex for newglossary"
+ print("Need to run makeindex for newglossary")
newglfile = suffix_nodes[newglossary_suffix[ig][2]]
MakeNewGlossaryAction = SCons.Action.Action("$MAKENEWGLOSSARYCOM ${SOURCE.filebase}%s -s ${SOURCE.filebase}.ist -t ${SOURCE.filebase}%s -o ${SOURCE.filebase}%s" % (newglossary_suffix[ig][2],newglossary_suffix[ig][0],newglossary_suffix[ig][1]), "$MAKENEWGLOSSARYCOMSTR")
@@ -443,26 +444,26 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
if warning_rerun_re.search(logContent):
must_rerun_latex = True
if Verbose:
- print "rerun Latex due to latex or package rerun warning"
+ print("rerun Latex due to latex or package rerun warning")
if rerun_citations_re.search(logContent):
must_rerun_latex = True
if Verbose:
- print "rerun Latex due to 'Rerun to get citations correct' warning"
+ print("rerun Latex due to 'Rerun to get citations correct' warning")
if undefined_references_re.search(logContent):
must_rerun_latex = True
if Verbose:
- print "rerun Latex due to undefined references or citations"
+ print("rerun Latex due to undefined references or citations")
if (count >= int(env.subst('$LATEXRETRIES')) and must_rerun_latex):
- print "reached max number of retries on Latex ,",int(env.subst('$LATEXRETRIES'))
+ print("reached max number of retries on Latex ,",int(env.subst('$LATEXRETRIES')))
# end of while loop
# rename Latex's output to what the target name is
if not (str(target[0]) == resultfilename and os.path.isfile(resultfilename)):
if os.path.isfile(resultfilename):
- print "move %s to %s" % (resultfilename, str(target[0]), )
+ print("move %s to %s" % (resultfilename, str(target[0]), ))
shutil.move(resultfilename,str(target[0]))
# Original comment (when TEXPICTS was not restored):
@@ -516,27 +517,27 @@ def is_LaTeX(flist,env,abspath):
else:
env['ENV']['TEXINPUTS'] = savedpath
if Verbose:
- print "is_LaTeX search path ",paths
- print "files to search :",flist
+ print("is_LaTeX search path ",paths)
+ print("files to search :",flist)
# Now that we have the search path and file list, check each one
for f in flist:
if Verbose:
- print " checking for Latex source ",str(f)
+ print(" checking for Latex source ",str(f))
content = f.get_text_contents()
if LaTeX_re.search(content):
if Verbose:
- print "file %s is a LaTeX file" % str(f)
+ print("file %s is a LaTeX file" % str(f))
return 1
if Verbose:
- print "file %s is not a LaTeX file" % str(f)
+ print("file %s is not a LaTeX file" % str(f))
# now find included files
inc_files = [ ]
inc_files.extend( include_re.findall(content) )
if Verbose:
- print "files included by '%s': "%str(f),inc_files
+ print("files included by '%s': "%str(f),inc_files)
# inc_files is list of file names as given. need to find them
# using TEXINPUTS paths.
@@ -546,7 +547,7 @@ def is_LaTeX(flist,env,abspath):
# make this a list since is_LaTeX takes a list.
fileList = [srcNode,]
if Verbose:
- print "FindFile found ",srcNode
+ print("FindFile found ",srcNode)
if srcNode is not None:
file_test = is_LaTeX(fileList, env, abspath)
@@ -555,7 +556,7 @@ def is_LaTeX(flist,env,abspath):
return file_test
if Verbose:
- print " done scanning ",str(f)
+ print(" done scanning ",str(f))
return 0
@@ -620,15 +621,15 @@ def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphi
content = theFile.get_text_contents()
if Verbose:
- print " scanning ",str(theFile)
+ print(" scanning ",str(theFile))
for i in range(len(file_tests_search)):
if file_tests[i][0] is None:
if Verbose:
- print "scan i ",i," files_tests[i] ",file_tests[i], file_tests[i][1]
+ print("scan i ",i," files_tests[i] ",file_tests[i], file_tests[i][1])
file_tests[i][0] = file_tests_search[i].search(content)
if Verbose and file_tests[i][0]:
- print " found match for ",file_tests[i][1][-1]
+ print(" found match for ",file_tests[i][1][-1])
# for newglossary insert the suffixes in file_tests[i]
if file_tests[i][0] and file_tests[i][1][-1] == 'newglossary':
findresult = file_tests_search[i].findall(content)
@@ -639,19 +640,19 @@ def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphi
suffix_list = ['.'+findresult[l][0],'.'+findresult[l][2],'.'+findresult[l][3] ]
newglossary_suffix.append(suffix_list)
if Verbose:
- print " new suffixes for newglossary ",newglossary_suffix
-
+ print(" new suffixes for newglossary ",newglossary_suffix)
+
incResult = includeOnly_re.search(content)
if incResult:
aux_files.append(os.path.join(targetdir, incResult.group(1)))
if Verbose:
- print "\include file names : ", aux_files
+ print("\include file names : ", aux_files)
# recursively call this on each of the included files
inc_files = [ ]
inc_files.extend( include_re.findall(content) )
if Verbose:
- print "files included by '%s': "%str(theFile),inc_files
+ print("files included by '%s': "%str(theFile),inc_files)
# inc_files is list of file names as given. need to find them
# using TEXINPUTS paths.
@@ -660,7 +661,7 @@ def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphi
if srcNode is not None:
file_tests = ScanFiles(srcNode, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files)
if Verbose:
- print " done scanning ",str(theFile)
+ print(" done scanning ",str(theFile))
return file_tests
def tex_emitter_core(target, source, env, graphics_extensions):
@@ -692,7 +693,7 @@ def tex_emitter_core(target, source, env, graphics_extensions):
env.SideEffect(flsfilename,target[0])
env.SideEffect(syncfilename,target[0])
if Verbose:
- print "side effect :",auxfilename,logfilename,flsfilename,syncfilename
+ print("side effect :",auxfilename,logfilename,flsfilename,syncfilename)
env.Clean(target[0],auxfilename)
env.Clean(target[0],logfilename)
env.Clean(target[0],flsfilename)
@@ -765,7 +766,7 @@ def tex_emitter_core(target, source, env, graphics_extensions):
else:
env['ENV']['TEXINPUTS'] = savedpath
if Verbose:
- print "search path ",paths
+ print("search path ",paths)
# scan all sources for side effect files
aux_files = []
@@ -774,7 +775,7 @@ def tex_emitter_core(target, source, env, graphics_extensions):
for (theSearch,suffix_list) in file_tests:
# add side effects if feature is present.If file is to be generated,add all side effects
if Verbose and theSearch:
- print "check side effects for ",suffix_list[-1]
+ print("check side effects for ",suffix_list[-1])
if (theSearch != None) or (not source[0].exists() ):
file_list = [targetbase,]
# for bibunit we need a list of files
@@ -788,11 +789,11 @@ def tex_emitter_core(target, source, env, graphics_extensions):
if suffix_list[-1] == 'multibib':
for multibibmatch in multibib_re.finditer(content):
if Verbose:
- print "multibib match ",multibibmatch.group(1)
- if multibibmatch != None:
+ print("multibib match ",multibibmatch.group(1))
+ if multibibmatch is not None:
baselist = multibibmatch.group(1).split(',')
if Verbose:
- print "multibib list ", baselist
+ print("multibib list ", baselist)
for i in range(len(baselist)):
file_list.append(os.path.join(targetdir, baselist[i]))
# now define the side effects
@@ -800,19 +801,19 @@ def tex_emitter_core(target, source, env, graphics_extensions):
for suffix in suffix_list[:-1]:
env.SideEffect(file_name + suffix,target[0])
if Verbose:
- print "side effect tst :",file_name + suffix, " target is ",str(target[0])
+ print("side effect tst :",file_name + suffix, " target is ",str(target[0]))
env.Clean(target[0],file_name + suffix)
for aFile in aux_files:
aFile_base = SCons.Util.splitext(aFile)[0]
env.SideEffect(aFile_base + '.aux',target[0])
if Verbose:
- print "side effect aux :",aFile_base + '.aux'
+ print("side effect aux :",aFile_base + '.aux')
env.Clean(target[0],aFile_base + '.aux')
# read fls file to get all other files that latex creates and will read on the next pass
# remove files from list that we explicitly dealt with above
if os.path.isfile(flsfilename):
- content = open(flsfilename, "rb").read()
+ content = open(flsfilename, "r").read()
out_files = openout_re.findall(content)
myfiles = [auxfilename, logfilename, flsfilename, targetbase+'.dvi',targetbase+'.pdf']
for filename in out_files[:]:
@@ -820,7 +821,7 @@ def tex_emitter_core(target, source, env, graphics_extensions):
out_files.remove(filename)
env.SideEffect(out_files,target[0])
if Verbose:
- print "side effect fls :",out_files
+ print("side effect fls :",out_files)
env.Clean(target[0],out_files)
return (target, source)
@@ -840,7 +841,7 @@ def generate(env):
generate_common(env)
- import dvi
+ from . import dvi
dvi.generate(env)
bld = env['BUILDERS']['DVI']
@@ -853,7 +854,7 @@ def generate_darwin(env):
except KeyError:
environ = {}
env['ENV'] = environ
-
+
if (platform.system() == 'Darwin'):
try:
ospath = env['ENV']['PATHOSX']
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/textfile.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/textfile.py
index f0d028f925f..7521a1bf549 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/textfile.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/textfile.py
@@ -1,6 +1,6 @@
# -*- python -*-
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -44,7 +44,7 @@ Textfile/Substfile builder for SCons.
is unpredictable whether the expansion will occur.
"""
-__revision__ = "src/engine/SCons/Tool/textfile.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/textfile.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons
@@ -53,7 +53,15 @@ import re
from SCons.Node import Node
from SCons.Node.Python import Value
-from SCons.Util import is_String, is_Sequence, is_Dict
+from SCons.Util import is_String, is_Sequence, is_Dict, to_bytes, PY3
+
+
+if PY3:
+ TEXTFILE_FILE_WRITE_MODE = 'w'
+else:
+ TEXTFILE_FILE_WRITE_MODE = 'wb'
+
+LINESEP = '\n'
def _do_subst(node, subs):
"""
@@ -64,62 +72,82 @@ def _do_subst(node, subs):
1.2345 and so forth.
"""
contents = node.get_text_contents()
- if not subs: return contents
- for (k,v) in subs:
- contents = re.sub(k, v, contents)
+ if subs:
+ for (k, val) in subs:
+ contents = re.sub(k, val, contents)
+
+ if 'b' in TEXTFILE_FILE_WRITE_MODE:
+ try:
+ contents = bytearray(contents, 'utf-8')
+ except UnicodeDecodeError:
+ # contents is already utf-8 encoded python 2 str i.e. a byte array
+ contents = bytearray(contents)
+
return contents
+
def _action(target, source, env):
+
# prepare the line separator
linesep = env['LINESEPARATOR']
if linesep is None:
- linesep = os.linesep
+ linesep = LINESEP # os.linesep
elif is_String(linesep):
pass
elif isinstance(linesep, Value):
linesep = linesep.get_text_contents()
else:
- raise SCons.Errors.UserError(
- 'unexpected type/class for LINESEPARATOR: %s'
- % repr(linesep), None)
+ raise SCons.Errors.UserError('unexpected type/class for LINESEPARATOR: %s'
+ % repr(linesep), None)
+
+ if 'b' in TEXTFILE_FILE_WRITE_MODE:
+ linesep = to_bytes(linesep)
# create a dictionary to use for the substitutions
if 'SUBST_DICT' not in env:
subs = None # no substitutions
else:
- d = env['SUBST_DICT']
- if is_Dict(d):
- d = list(d.items())
- elif is_Sequence(d):
+ subst_dict = env['SUBST_DICT']
+ if is_Dict(subst_dict):
+ subst_dict = list(subst_dict.items())
+ elif is_Sequence(subst_dict):
pass
else:
raise SCons.Errors.UserError('SUBST_DICT must be dict or sequence')
subs = []
- for (k,v) in d:
- if callable(v):
- v = v()
- if is_String(v):
- v = env.subst(v)
+ for (k, value) in subst_dict:
+ if callable(value):
+ value = value()
+ if is_String(value):
+ value = env.subst(value)
else:
- v = str(v)
- subs.append((k,v))
+ value = str(value)
+ subs.append((k, value))
# write the file
try:
- fd = open(target[0].get_path(), "wb")
- except (OSError,IOError), e:
+ if SCons.Util.PY3:
+ target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='')
+ else:
+ target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE)
+ except (OSError, IOError):
raise SCons.Errors.UserError("Can't write target file %s" % target[0])
+
# separate lines by 'linesep' only if linesep is not empty
lsep = None
- for s in source:
- if lsep: fd.write(lsep)
- fd.write(_do_subst(s, subs))
+ for line in source:
+ if lsep:
+ target_file.write(lsep)
+
+ target_file.write(_do_subst(line, subs))
lsep = linesep
- fd.close()
+ target_file.close()
+
def _strfunc(target, source, env):
return "Creating '%s'" % target[0]
+
def _convert_list_R(newlist, sources):
for elem in sources:
if is_Sequence(elem):
@@ -128,6 +156,8 @@ def _convert_list_R(newlist, sources):
newlist.append(elem)
else:
newlist.append(Value(elem))
+
+
def _convert_list(target, source, env):
if len(target) != 1:
raise SCons.Errors.UserError("Only one target file allowed")
@@ -135,29 +165,31 @@ def _convert_list(target, source, env):
_convert_list_R(newlist, source)
return target, newlist
+
_common_varlist = ['SUBST_DICT', 'LINESEPARATOR']
_text_varlist = _common_varlist + ['TEXTFILEPREFIX', 'TEXTFILESUFFIX']
_text_builder = SCons.Builder.Builder(
- action = SCons.Action.Action(_action, _strfunc, varlist = _text_varlist),
- source_factory = Value,
- emitter = _convert_list,
- prefix = '$TEXTFILEPREFIX',
- suffix = '$TEXTFILESUFFIX',
- )
+ action=SCons.Action.Action(_action, _strfunc, varlist=_text_varlist),
+ source_factory=Value,
+ emitter=_convert_list,
+ prefix='$TEXTFILEPREFIX',
+ suffix='$TEXTFILESUFFIX',
+)
_subst_varlist = _common_varlist + ['SUBSTFILEPREFIX', 'TEXTFILESUFFIX']
_subst_builder = SCons.Builder.Builder(
- action = SCons.Action.Action(_action, _strfunc, varlist = _subst_varlist),
- source_factory = SCons.Node.FS.File,
- emitter = _convert_list,
- prefix = '$SUBSTFILEPREFIX',
- suffix = '$SUBSTFILESUFFIX',
- src_suffix = ['.in'],
- )
+ action=SCons.Action.Action(_action, _strfunc, varlist=_subst_varlist),
+ source_factory=SCons.Node.FS.File,
+ emitter=_convert_list,
+ prefix='$SUBSTFILEPREFIX',
+ suffix='$SUBSTFILESUFFIX',
+ src_suffix=['.in'],
+)
+
def generate(env):
- env['LINESEPARATOR'] = os.linesep
+ env['LINESEPARATOR'] = LINESEP # os.linesep
env['BUILDERS']['Textfile'] = _text_builder
env['TEXTFILEPREFIX'] = ''
env['TEXTFILESUFFIX'] = '.txt'
@@ -165,6 +197,7 @@ def generate(env):
env['SUBSTFILEPREFIX'] = ''
env['SUBSTFILESUFFIX'] = ''
+
def exists(env):
return 1
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tlib.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tlib.py
index 406697f3cce..69d891405a1 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tlib.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/tlib.py
@@ -5,7 +5,7 @@ XXX
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ XXX
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/tlib.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/tlib.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Tool
import SCons.Tool.bcc32
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/wix.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/wix.py
index cc259edc181..8c5f6032f76 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/wix.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/wix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/wix.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/wix.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import SCons.Builder
import SCons.Action
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/xgettext.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/xgettext.py
new file mode 100644
index 00000000000..5b33ff50139
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/xgettext.py
@@ -0,0 +1,374 @@
+""" xgettext tool
+
+Tool specific initialization of `xgettext` tool.
+"""
+
+# Copyright (c) 2001 - 2019 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# 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__ = "src/engine/SCons/Tool/xgettext.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
+
+
+#############################################################################
+class _CmdRunner(object):
+ """ Callable object, which runs shell command storing its stdout and stderr to
+ variables. It also provides `strfunction()` method, which shall be used by
+ scons Action objects to print command string. """
+
+ def __init__(self, command, commandstr=None):
+ self.out = None
+ self.err = None
+ self.status = None
+ self.command = command
+ self.commandstr = commandstr
+
+ def __call__(self, target, source, env):
+ import SCons.Action
+ import subprocess
+ import os
+ import sys
+ kw = {
+ 'stdin': 'devnull',
+ 'stdout': subprocess.PIPE,
+ 'stderr': subprocess.PIPE,
+ 'universal_newlines': True,
+ 'shell': True
+ }
+ command = env.subst(self.command, target=target, source=source)
+ proc = SCons.Action._subproc(env, command, **kw)
+ self.out, self.err = proc.communicate()
+ self.status = proc.wait()
+ if self.err:
+ sys.stderr.write(unicode(self.err))
+ return self.status
+
+ def strfunction(self, target, source, env):
+ import os
+ comstr = self.commandstr
+ if env.subst(comstr, target=target, source=source) == "":
+ comstr = self.command
+ s = env.subst(comstr, target=target, source=source)
+ return s
+
+
+#############################################################################
+
+#############################################################################
+def _update_pot_file(target, source, env):
+ """ Action function for `POTUpdate` builder """
+ import re
+ import os
+ import SCons.Action
+ nop = lambda target, source, env: 0
+
+ # Save scons cwd and os cwd (NOTE: they may be different. After the job, we
+ # revert each one to its original state).
+ save_cwd = env.fs.getcwd()
+ save_os_cwd = os.getcwd()
+ chdir = target[0].dir
+ chdir_str = repr(chdir.get_abspath())
+ # Print chdir message (employ SCons.Action.Action for that. It knows better
+ # than me how to to this correctly).
+ env.Execute(SCons.Action.Action(nop, "Entering " + chdir_str))
+ # Go to target's directory and do our job
+ env.fs.chdir(chdir, 1) # Go into target's directory
+ try:
+ cmd = _CmdRunner('$XGETTEXTCOM', '$XGETTEXTCOMSTR')
+ action = SCons.Action.Action(cmd, strfunction=cmd.strfunction)
+ status = action([target[0]], source, env)
+ except:
+ # Something went wrong.
+ env.Execute(SCons.Action.Action(nop, "Leaving " + chdir_str))
+ # Revert working dirs to previous state and re-throw exception.
+ env.fs.chdir(save_cwd, 0)
+ os.chdir(save_os_cwd)
+ raise
+ # Print chdir message.
+ env.Execute(SCons.Action.Action(nop, "Leaving " + chdir_str))
+ # Revert working dirs to previous state.
+ env.fs.chdir(save_cwd, 0)
+ os.chdir(save_os_cwd)
+ # If the command was not successfull, return error code.
+ if status: return status
+
+ new_content = cmd.out
+
+ if not new_content:
+ # When xgettext finds no internationalized messages, no *.pot is created
+ # (because we don't want to bother translators with empty POT files).
+ needs_update = False
+ explain = "no internationalized messages encountered"
+ else:
+ if target[0].exists():
+ # If the file already exists, it's left unaltered unless its messages
+ # are outdated (w.r.t. to these recovered by xgettext from sources).
+ old_content = target[0].get_text_contents()
+ re_cdate = re.compile(r'^"POT-Creation-Date: .*"$[\r\n]?', re.M)
+ old_content_nocdate = re.sub(re_cdate, "", old_content)
+ new_content_nocdate = re.sub(re_cdate, "", new_content)
+ if (old_content_nocdate == new_content_nocdate):
+ # Messages are up-to-date
+ needs_update = False
+ explain = "messages in file found to be up-to-date"
+ else:
+ # Messages are outdated
+ needs_update = True
+ explain = "messages in file were outdated"
+ else:
+ # No POT file found, create new one
+ needs_update = True
+ explain = "new file"
+ if needs_update:
+ # Print message employing SCons.Action.Action for that.
+ msg = "Writing " + repr(str(target[0])) + " (" + explain + ")"
+ env.Execute(SCons.Action.Action(nop, msg))
+ f = open(str(target[0]), "w")
+ f.write(new_content)
+ f.close()
+ return 0
+ else:
+ # Print message employing SCons.Action.Action for that.
+ msg = "Not writing " + repr(str(target[0])) + " (" + explain + ")"
+ env.Execute(SCons.Action.Action(nop, msg))
+ return 0
+
+
+#############################################################################
+
+#############################################################################
+from SCons.Builder import BuilderBase
+
+
+#############################################################################
+class _POTBuilder(BuilderBase):
+ def _execute(self, env, target, source, *args):
+ if not target:
+ if 'POTDOMAIN' in env and env['POTDOMAIN']:
+ domain = env['POTDOMAIN']
+ else:
+ domain = 'messages'
+ target = [domain]
+ return BuilderBase._execute(self, env, target, source, *args)
+
+
+#############################################################################
+
+#############################################################################
+def _scan_xgettext_from_files(target, source, env, files=None, path=None):
+ """ Parses `POTFILES.in`-like file and returns list of extracted file names.
+ """
+ import re
+ import SCons.Util
+ import SCons.Node.FS
+
+ if files is None:
+ return 0
+ if not SCons.Util.is_List(files):
+ files = [files]
+
+ if path is None:
+ if 'XGETTEXTPATH' in env:
+ path = env['XGETTEXTPATH']
+ else:
+ path = []
+ if not SCons.Util.is_List(path):
+ path = [path]
+
+ path = SCons.Util.flatten(path)
+
+ dirs = ()
+ for p in path:
+ if not isinstance(p, SCons.Node.FS.Base):
+ if SCons.Util.is_String(p):
+ p = env.subst(p, source=source, target=target)
+ p = env.arg2nodes(p, env.fs.Dir)
+ dirs += tuple(p)
+ # cwd is the default search path (when no path is defined by user)
+ if not dirs:
+ dirs = (env.fs.getcwd(),)
+
+ # Parse 'POTFILE.in' files.
+ re_comment = re.compile(r'^#[^\n\r]*$\r?\n?', re.M)
+ re_emptyln = re.compile(r'^[ \t\r]*$\r?\n?', re.M)
+ re_trailws = re.compile(r'[ \t\r]+$')
+ for f in files:
+ # Find files in search path $XGETTEXTPATH
+ if isinstance(f, SCons.Node.FS.Base) and f.rexists():
+ contents = f.get_text_contents()
+ contents = re_comment.sub("", contents)
+ contents = re_emptyln.sub("", contents)
+ contents = re_trailws.sub("", contents)
+ depnames = contents.splitlines()
+ for depname in depnames:
+ depfile = SCons.Node.FS.find_file(depname, dirs)
+ if not depfile:
+ depfile = env.arg2nodes(depname, dirs[0].File)
+ env.Depends(target, depfile)
+ return 0
+
+
+#############################################################################
+
+#############################################################################
+def _pot_update_emitter(target, source, env):
+ """ Emitter function for `POTUpdate` builder """
+ from SCons.Tool.GettextCommon import _POTargetFactory
+ import SCons.Util
+ import SCons.Node.FS
+
+ if 'XGETTEXTFROM' in env:
+ xfrom = env['XGETTEXTFROM']
+ else:
+ return target, source
+ if not SCons.Util.is_List(xfrom):
+ xfrom = [xfrom]
+
+ xfrom = SCons.Util.flatten(xfrom)
+
+ # Prepare list of 'POTFILE.in' files.
+ files = []
+ for xf in xfrom:
+ if not isinstance(xf, SCons.Node.FS.Base):
+ if SCons.Util.is_String(xf):
+ # Interpolate variables in strings
+ xf = env.subst(xf, source=source, target=target)
+ xf = env.arg2nodes(xf)
+ files.extend(xf)
+ if files:
+ env.Depends(target, files)
+ _scan_xgettext_from_files(target, source, env, files)
+ return target, source
+
+
+#############################################################################
+
+#############################################################################
+from SCons.Environment import _null
+
+
+#############################################################################
+def _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw):
+ return env._POTUpdateBuilder(target, source, **kw)
+
+
+#############################################################################
+
+#############################################################################
+def _POTUpdateBuilder(env, **kw):
+ """ Creates `POTUpdate` builder object """
+ import SCons.Action
+ from SCons.Tool.GettextCommon import _POTargetFactory
+ kw['action'] = SCons.Action.Action(_update_pot_file, None)
+ kw['suffix'] = '$POTSUFFIX'
+ kw['target_factory'] = _POTargetFactory(env, alias='$POTUPDATE_ALIAS').File
+ kw['emitter'] = _pot_update_emitter
+ return _POTBuilder(**kw)
+
+
+#############################################################################
+
+#############################################################################
+def generate(env, **kw):
+ """ Generate `xgettext` tool """
+ import sys
+ import os
+ import SCons.Util
+ import SCons.Tool
+ from SCons.Tool.GettextCommon import RPaths, _detect_xgettext
+ from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
+ from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
+
+ if sys.platform == 'win32':
+ xgettext = SCons.Tool.find_program_path(env, 'xgettext', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
+ if xgettext:
+ xgettext_bin_dir = os.path.dirname(xgettext)
+ env.AppendENVPath('PATH', xgettext_bin_dir)
+ else:
+ SCons.Warnings.Warning('xgettext tool requested, but binary not found in ENV PATH')
+ try:
+ env['XGETTEXT'] = _detect_xgettext(env)
+ except:
+ env['XGETTEXT'] = 'xgettext'
+ # NOTE: sources="$SOURCES" would work as well. However, we use following
+ # construction to convert absolute paths provided by scons onto paths
+ # relative to current working dir. Note, that scons expands $SOURCE(S) to
+ # absolute paths for sources $SOURCE(s) outside of current subtree (e.g. in
+ # "../"). With source=$SOURCE these absolute paths would be written to the
+ # resultant *.pot file (and its derived *.po files) as references to lines in
+ # source code (e.g. referring lines in *.c files). Such references would be
+ # correct (e.g. in poedit) only on machine on which *.pot was generated and
+ # would be of no use on other hosts (having a copy of source code located
+ # in different place in filesystem).
+ sources = '$( ${_concat( "", SOURCES, "", __env__, XgettextRPaths, TARGET' \
+ + ', SOURCES)} $)'
+
+ # NOTE: the output from $XGETTEXTCOM command must go to stdout, not to a file.
+ # This is required by the POTUpdate builder's action.
+ xgettextcom = '$XGETTEXT $XGETTEXTFLAGS $_XGETTEXTPATHFLAGS' \
+ + ' $_XGETTEXTFROMFLAGS -o - ' + sources
+
+ xgettextpathflags = '$( ${_concat( XGETTEXTPATHPREFIX, XGETTEXTPATH' \
+ + ', XGETTEXTPATHSUFFIX, __env__, RDirs, TARGET, SOURCES)} $)'
+ xgettextfromflags = '$( ${_concat( XGETTEXTFROMPREFIX, XGETTEXTFROM' \
+ + ', XGETTEXTFROMSUFFIX, __env__, target=TARGET, source=SOURCES)} $)'
+
+ env.SetDefault(
+ _XGETTEXTDOMAIN='${TARGET.filebase}',
+ XGETTEXTFLAGS=[],
+ XGETTEXTCOM=xgettextcom,
+ XGETTEXTCOMSTR='',
+ XGETTEXTPATH=[],
+ XGETTEXTPATHPREFIX='-D',
+ XGETTEXTPATHSUFFIX='',
+ XGETTEXTFROM=None,
+ XGETTEXTFROMPREFIX='-f',
+ XGETTEXTFROMSUFFIX='',
+ _XGETTEXTPATHFLAGS=xgettextpathflags,
+ _XGETTEXTFROMFLAGS=xgettextfromflags,
+ POTSUFFIX=['.pot'],
+ POTUPDATE_ALIAS='pot-update',
+ XgettextRPaths=RPaths(env)
+ )
+ env.Append(BUILDERS={
+ '_POTUpdateBuilder': _POTUpdateBuilder(env)
+ })
+ env.AddMethod(_POTUpdateBuilderWrapper, 'POTUpdate')
+ env.AlwaysBuild(env.Alias('$POTUPDATE_ALIAS'))
+
+
+#############################################################################
+
+#############################################################################
+def exists(env):
+ """ Check, whether the tool exists """
+ from SCons.Tool.GettextCommon import _xgettext_exists
+ try:
+ return _xgettext_exists(env)
+ except:
+ return False
+
+#############################################################################
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/yacc.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/yacc.py
index 6a089a1476d..00e6ef7402b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/yacc.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/yacc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,13 +31,16 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/yacc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/yacc.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
+import sys
import SCons.Defaults
import SCons.Tool
import SCons.Util
+from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
+from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
YaccAction = SCons.Action.Action("$YACCCOM", "$YACCCOMSTR")
@@ -113,6 +116,14 @@ def generate(env):
cxx_file.add_action('.yy', YaccAction)
cxx_file.add_emitter('.yy', yyEmitter)
+ if sys.platform == 'win32':
+ bison = SCons.Tool.find_program_path(env, 'bison', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
+ if bison:
+ bison_bin_dir = os.path.dirname(bison)
+ env.AppendENVPath('PATH', bison_bin_dir)
+ else:
+ SCons.Warnings.Warning('yacc tool requested, but bison binary not found in ENV PATH')
+
env['YACC'] = env.Detect('bison') or 'yacc'
env['YACCFLAGS'] = SCons.Util.CLVar('')
env['YACCCOM'] = '$YACC $YACCFLAGS -o $TARGET $SOURCES'
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/zip.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/zip.py
index 5349cba335c..ddc1377321b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/zip.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Tool/zip.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/zip.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/zip.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
@@ -40,31 +40,23 @@ import SCons.Defaults
import SCons.Node.FS
import SCons.Util
-try:
- import zipfile
- internal_zip = 1
-except ImportError:
- internal_zip = 0
-
-if internal_zip:
- zipcompression = zipfile.ZIP_DEFLATED
- def zip(target, source, env):
- compression = env.get('ZIPCOMPRESSION', 0)
- zf = zipfile.ZipFile(str(target[0]), 'w', compression)
- for s in source:
- if s.isdir():
- for dirpath, dirnames, filenames in os.walk(str(s)):
- for fname in filenames:
- path = os.path.join(dirpath, fname)
- if os.path.isfile(path):
- zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))))
- else:
- zf.write(str(s), os.path.relpath(str(s), str(env.get('ZIPROOT', ''))))
- zf.close()
-else:
- zipcompression = 0
- zip = "$ZIP $ZIPFLAGS ${TARGET.abspath} $SOURCES"
+import zipfile
+zipcompression = zipfile.ZIP_DEFLATED
+def zip(target, source, env):
+ compression = env.get('ZIPCOMPRESSION', 0)
+ zf = zipfile.ZipFile(str(target[0]), 'w', compression)
+ for s in source:
+ if s.isdir():
+ for dirpath, dirnames, filenames in os.walk(str(s)):
+ for fname in filenames:
+ path = os.path.join(dirpath, fname)
+ if os.path.isfile(path):
+
+ zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))))
+ else:
+ zf.write(str(s), os.path.relpath(str(s), str(env.get('ZIPROOT', ''))))
+ zf.close()
zipAction = SCons.Action.Action(zip, varlist=['ZIPCOMPRESSION'])
@@ -91,7 +83,7 @@ def generate(env):
env['ZIPROOT'] = SCons.Util.CLVar('')
def exists(env):
- return internal_zip or env.Detect('zip')
+ return True
# Local Variables:
# tab-width:4
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Util.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Util.py
index 21ef53feda0..0a1ebdc61a9 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Util.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Util.py
@@ -3,7 +3,7 @@
Various utility functions go here.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,24 +24,47 @@ Various utility functions go here.
# 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__ = "src/engine/SCons/Util.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Util.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import sys
import copy
import re
import types
+import codecs
+import pprint
-from collections import UserDict, UserList, UserString
+PY3 = sys.version_info[0] == 3
+
+try:
+ from collections import UserDict, UserList, UserString
+except ImportError:
+ from UserDict import UserDict
+ from UserList import UserList
+ from UserString import UserString
+
+try:
+ from collections.abc import Iterable, MappingView
+except ImportError:
+ from collections import Iterable
+
+from collections import OrderedDict
# Don't "from types import ..." these because we need to get at the
# types module later to look for UnicodeType.
-InstanceType = types.InstanceType
+
+# Below not used?
+# InstanceType = types.InstanceType
+
MethodType = types.MethodType
FunctionType = types.FunctionType
-try: unicode
-except NameError: UnicodeType = None
-else: UnicodeType = unicode
+
+try:
+ _ = type(unicode)
+except NameError:
+ UnicodeType = str
+else:
+ UnicodeType = unicode
def dictify(keys, values, result={}):
for k, v in zip(keys, values):
@@ -80,7 +103,7 @@ def containsOnly(str, set):
return 1
def splitext(path):
- "Same as os.path.splitext() but faster."
+ """Same as os.path.splitext() but faster."""
sep = rightmost_separator(path, os.sep)
dot = path.rfind('.')
# An ext is only real if it has at least one non-digit char
@@ -111,9 +134,28 @@ class NodeList(UserList):
>>> someList.strip()
[ 'foo', 'bar' ]
"""
+
+# def __init__(self, initlist=None):
+# self.data = []
+# # print("TYPE:%s"%type(initlist))
+# if initlist is not None:
+# # XXX should this accept an arbitrary sequence?
+# if type(initlist) == type(self.data):
+# self.data[:] = initlist
+# elif isinstance(initlist, (UserList, NodeList)):
+# self.data[:] = initlist.data[:]
+# elif isinstance(initlist, Iterable):
+# self.data = list(initlist)
+# else:
+# self.data = [ initlist,]
+
+
def __nonzero__(self):
return len(self.data) != 0
+ def __bool__(self):
+ return self.__nonzero__()
+
def __str__(self):
return ' '.join(map(str, self.data))
@@ -128,6 +170,25 @@ class NodeList(UserList):
result = [getattr(x, name) for x in self.data]
return self.__class__(result)
+ def __getitem__(self, index):
+ """
+ This comes for free on py2,
+ but py3 slices of NodeList are returning a list
+ breaking slicing nodelist and refering to
+ properties and methods on contained object
+ """
+# return self.__class__(self.data[index])
+
+ if isinstance(index, slice):
+ # Expand the slice object using range()
+ # limited by number of items in self.data
+ indices = index.indices(len(self.data))
+ return self.__class__([self[x] for x in
+ range(*indices)])
+ else:
+ # Return one item of the tart
+ return self.data[index]
+
_get_env_var = re.compile(r'^\$([_a-zA-Z]\w*|{[_a-zA-Z]\w*})$')
@@ -153,7 +214,7 @@ class DisplayEngine(object):
return
if append_newline: text = text + '\n'
try:
- sys.stdout.write(unicode(text))
+ sys.stdout.write(UnicodeType(text))
except IOError:
# Stdout might be connected to a pipe that has been closed
# by now. The most likely reason for the pipe being closed
@@ -167,16 +228,17 @@ class DisplayEngine(object):
def set_mode(self, mode):
self.print_it = mode
+
def render_tree(root, child_func, prune=0, margin=[0], visited=None):
"""
Render a tree of nodes into an ASCII tree view.
- root - the root node of the tree
- child_func - the function called to get the children of a node
- prune - don't visit the same node twice
- margin - the format of the left margin to use for children of root.
- 1 results in a pipe, and 0 results in no pipe.
- visited - a dictionary of visited nodes in the current branch if not prune,
- or in the whole tree if prune.
+
+ :Parameters:
+ - `root`: the root node of the tree
+ - `child_func`: the function called to get the children of a node
+ - `prune`: don't visit the same node twice
+ - `margin`: the format of the left margin to use for children of root. 1 results in a pipe, and 0 results in no pipe.
+ - `visited`: a dictionary of visited nodes in the current branch if not prune, or in the whole tree if prune.
"""
rname = str(root)
@@ -202,33 +264,33 @@ def render_tree(root, child_func, prune=0, margin=[0], visited=None):
visited[rname] = 1
for i in range(len(children)):
- margin.append(i<len(children)-1)
- retval = retval + render_tree(children[i], child_func, prune, margin, visited
-)
+ margin.append(i < len(children)-1)
+ retval = retval + render_tree(children[i], child_func, prune, margin, visited)
margin.pop()
return retval
IDX = lambda N: N and 1 or 0
+
def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None):
"""
Print a tree of nodes. This is like render_tree, except it prints
lines directly instead of creating a string representation in memory,
so that huge trees can be printed.
- root - the root node of the tree
- child_func - the function called to get the children of a node
- prune - don't visit the same node twice
- showtags - print status information to the left of each node line
- margin - the format of the left margin to use for children of root.
- 1 results in a pipe, and 0 results in no pipe.
- visited - a dictionary of visited nodes in the current branch if not prune,
- or in the whole tree if prune.
+ :Parameters:
+ - `root` - the root node of the tree
+ - `child_func` - the function called to get the children of a node
+ - `prune` - don't visit the same node twice
+ - `showtags` - print status information to the left of each node line
+ - `margin` - the format of the left margin to use for children of root. 1 results in a pipe, and 0 results in no pipe.
+ - `visited` - a dictionary of visited nodes in the current branch if not prune, or in the whole tree if prune.
"""
rname = str(root)
-
+
+
# Initialize 'visited' dict, if required
if visited is None:
visited = {}
@@ -247,7 +309,7 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None):
' N = no clean\n' +
' H = no cache\n' +
'\n')
- sys.stdout.write(unicode(legend))
+ sys.stdout.write(legend)
tags = ['[']
tags.append(' E'[IDX(root.exists())])
@@ -272,10 +334,10 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None):
children = child_func(root)
if prune and rname in visited and children:
- sys.stdout.write(''.join(tags + margins + ['+-[', rname, ']']) + u'\n')
+ sys.stdout.write(''.join(tags + margins + ['+-[', rname, ']']) + '\n')
return
- sys.stdout.write(''.join(tags + margins + ['+-', rname]) + u'\n')
+ sys.stdout.write(''.join(tags + margins + ['+-', rname]) + '\n')
visited[rname] = 1
@@ -306,16 +368,28 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None):
DictTypes = (dict, UserDict)
ListTypes = (list, UserList)
-SequenceTypes = (list, tuple, UserList)
+
+try:
+ # Handle getting dictionary views.
+ SequenceTypes = (list, tuple, UserList, MappingView)
+except NameError:
+ SequenceTypes = (list, tuple, UserList)
+
# Note that profiling data shows a speed-up when comparing
# explicitly with str and unicode instead of simply comparing
# with basestring. (at least on Python 2.5.1)
-StringTypes = (str, unicode, UserString)
+try:
+ StringTypes = (str, unicode, UserString)
+except NameError:
+ StringTypes = (str, UserString)
# Empirically, it is faster to check explicitly for str and
# unicode than for basestring.
-BaseStringTypes = (str, unicode)
+try:
+ BaseStringTypes = (str, unicode)
+except NameError:
+ BaseStringTypes = (str)
def is_Dict(obj, isinstance=isinstance, DictTypes=DictTypes):
return isinstance(obj, DictTypes)
@@ -341,7 +415,7 @@ def is_Scalar(obj, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes
# assumes that the obj argument is a string most of the time.
return isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes)
-def do_flatten(sequence, result, isinstance=isinstance,
+def do_flatten(sequence, result, isinstance=isinstance,
StringTypes=StringTypes, SequenceTypes=SequenceTypes):
for item in sequence:
if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes):
@@ -349,7 +423,7 @@ def do_flatten(sequence, result, isinstance=isinstance,
else:
do_flatten(item, result)
-def flatten(obj, isinstance=isinstance, StringTypes=StringTypes,
+def flatten(obj, isinstance=isinstance, StringTypes=StringTypes,
SequenceTypes=SequenceTypes, do_flatten=do_flatten):
"""Flatten a sequence to a non-nested list.
@@ -367,7 +441,7 @@ def flatten(obj, isinstance=isinstance, StringTypes=StringTypes,
do_flatten(item, result)
return result
-def flatten_sequence(sequence, isinstance=isinstance, StringTypes=StringTypes,
+def flatten_sequence(sequence, isinstance=isinstance, StringTypes=StringTypes,
SequenceTypes=SequenceTypes, do_flatten=do_flatten):
"""Flatten a sequence to a non-nested list.
@@ -388,7 +462,7 @@ def flatten_sequence(sequence, isinstance=isinstance, StringTypes=StringTypes,
# to_String_for_signature() will use a for_signature() method if the
# specified object has one.
#
-def to_String(s,
+def to_String(s,
isinstance=isinstance, str=str,
UserString=UserString, BaseStringTypes=BaseStringTypes):
if isinstance(s,BaseStringTypes):
@@ -401,19 +475,16 @@ def to_String(s,
else:
return str(s)
-def to_String_for_subst(s,
+def to_String_for_subst(s,
isinstance=isinstance, str=str, to_String=to_String,
BaseStringTypes=BaseStringTypes, SequenceTypes=SequenceTypes,
UserString=UserString):
-
+
# Note that the test cases are sorted by order of probability.
if isinstance(s, BaseStringTypes):
return s
elif isinstance(s, SequenceTypes):
- l = []
- for e in s:
- l.append(to_String_for_subst(e))
- return ' '.join( s )
+ return ' '.join([to_String_for_subst(e) for e in s])
elif isinstance(s, UserString):
# s.data can only be either a unicode or a regular
# string. Please see the UserString initializer.
@@ -421,12 +492,18 @@ def to_String_for_subst(s,
else:
return str(s)
-def to_String_for_signature(obj, to_String_for_subst=to_String_for_subst,
+def to_String_for_signature(obj, to_String_for_subst=to_String_for_subst,
AttributeError=AttributeError):
try:
f = obj.for_signature
except AttributeError:
- return to_String_for_subst(obj)
+ if isinstance(obj, dict):
+ # pprint will output dictionary in key sorted order
+ # with py3.5 the order was randomized. In general depending on dictionary order
+ # which was undefined until py3.6 (where it's by insertion order) was not wise.
+ return pprint.pformat(obj, width=1000000)
+ else:
+ return to_String_for_subst(obj)
else:
return f()
@@ -479,7 +556,7 @@ def semi_deepcopy(x):
return x.__class__(semi_deepcopy_dict(x))
elif isinstance(x, UserList):
return x.__class__(_semi_deepcopy_list(x))
-
+
return x
@@ -527,10 +604,10 @@ class Proxy(object):
"""Retrieve the entire wrapped object"""
return self._subject
- def __cmp__(self, other):
+ def __eq__(self, other):
if issubclass(other.__class__, self._subject.__class__):
- return cmp(self._subject, other)
- return cmp(self.__dict__, other.__dict__)
+ return self._subject == other
+ return self.__dict__ == other.__dict__
class Delegate(object):
"""A Python Descriptor class that delegates attribute fetches
@@ -725,7 +802,7 @@ else:
# raised so as to not mask possibly serious disk or
# network issues.
continue
- if stat.S_IMODE(st[stat.ST_MODE]) & 0111:
+ if stat.S_IMODE(st[stat.ST_MODE]) & 0o111:
try:
reject.index(f)
except ValueError:
@@ -733,7 +810,7 @@ else:
continue
return None
-def PrependPath(oldpath, newpath, sep = os.pathsep,
+def PrependPath(oldpath, newpath, sep = os.pathsep,
delete_existing=1, canonicalize=None):
"""This prepends newpath elements to the given oldpath. Will only
add any particular path once (leaving the first one it encounters
@@ -752,7 +829,7 @@ def PrependPath(oldpath, newpath, sep = os.pathsep,
not move it to the beginning; it will stay where it is in the
list.
- If canonicalize is not None, it is applied to each element of
+ If canonicalize is not None, it is applied to each element of
newpath before use.
"""
@@ -774,7 +851,7 @@ def PrependPath(oldpath, newpath, sep = os.pathsep,
newpaths=list(map(canonicalize, newpaths))
if not delete_existing:
- # First uniquify the old paths, making sure to
+ # First uniquify the old paths, making sure to
# preserve the first instance (in Unix/Linux,
# the first one wins), and remembering them in normpaths.
# Then insert the new paths at the head of the list
@@ -815,7 +892,7 @@ def PrependPath(oldpath, newpath, sep = os.pathsep,
else:
return sep.join(paths)
-def AppendPath(oldpath, newpath, sep = os.pathsep,
+def AppendPath(oldpath, newpath, sep = os.pathsep,
delete_existing=1, canonicalize=None):
"""This appends new path elements to the given old path. Will
only add any particular path once (leaving the last one it
@@ -833,7 +910,7 @@ def AppendPath(oldpath, newpath, sep = os.pathsep,
If delete_existing is 0, then adding a path that exists
will not move it to the end; it will stay where it is in the list.
- If canonicalize is not None, it is applied to each element of
+ If canonicalize is not None, it is applied to each element of
newpath before use.
"""
@@ -955,64 +1032,9 @@ class CLVar(UserList):
return UserList.__add__(self, CLVar(other))
def __radd__(self, other):
return UserList.__radd__(self, CLVar(other))
- def __coerce__(self, other):
- return (self, CLVar(other))
def __str__(self):
return ' '.join(self.data)
-# A dictionary that preserves the order in which items are added.
-# Submitted by David Benjamin to ActiveState's Python Cookbook web site:
-# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747
-# Including fixes/enhancements from the follow-on discussions.
-class OrderedDict(UserDict):
- def __init__(self, dict = None):
- self._keys = []
- UserDict.__init__(self, dict)
-
- def __delitem__(self, key):
- UserDict.__delitem__(self, key)
- self._keys.remove(key)
-
- def __setitem__(self, key, item):
- UserDict.__setitem__(self, key, item)
- if key not in self._keys: self._keys.append(key)
-
- def clear(self):
- UserDict.clear(self)
- self._keys = []
-
- def copy(self):
- dict = OrderedDict()
- dict.update(self)
- return dict
-
- def items(self):
- return list(zip(self._keys, list(self.values())))
-
- def keys(self):
- return self._keys[:]
-
- def popitem(self):
- try:
- key = self._keys[-1]
- except IndexError:
- raise KeyError('dictionary is empty')
-
- val = self[key]
- del self[key]
-
- return (key, val)
-
- def setdefault(self, key, failobj = None):
- UserDict.setdefault(self, key, failobj)
- if key not in self._keys: self._keys.append(key)
-
- def update(self, dict):
- for (key, val) in dict.items():
- self.__setitem__(key, val)
-
- def values(self):
- return list(map(self.get, self._keys))
class Selector(OrderedDict):
"""A callable ordered dictionary that maps file suffixes to
@@ -1206,11 +1228,11 @@ def logical_lines(physical_lines, joiner=''.join):
class LogicalLines(object):
""" Wrapper class for the logical_lines method.
-
+
Allows us to read all "logical" lines at once from a
given file object.
"""
-
+
def __init__(self, fileobj):
self.fileobj = fileobj
@@ -1354,8 +1376,8 @@ def make_path_relative(path):
# The original idea for AddMethod() and RenameFunction() come from the
# following post to the ActiveState Python Cookbook:
#
-# ASPN: Python Cookbook : Install bound methods in an instance
-# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223613
+# ASPN: Python Cookbook : Install bound methods in an instance
+# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223613
#
# That code was a little fragile, though, so the following changes
# have been wrung on it:
@@ -1372,55 +1394,66 @@ def make_path_relative(path):
# the "new" module, as alluded to in Alex Martelli's response to the
# following Cookbook post:
#
-# ASPN: Python Cookbook : Dynamically added methods to a class
-# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732
+# ASPN: Python Cookbook : Dynamically added methods to a class
+# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732
def AddMethod(obj, function, name=None):
"""
- Adds either a bound method to an instance or an unbound method to
- a class. If name is ommited the name of the specified function
+ Adds either a bound method to an instance or the function itself (or an unbound method in Python 2) to a class.
+ If name is ommited the name of the specified function
is used by default.
- Example:
- a = A()
- def f(self, x, y):
+
+ Example::
+
+ a = A()
+ def f(self, x, y):
self.z = x + y
- AddMethod(f, A, "add")
- a.add(2, 4)
- print a.z
- AddMethod(lambda self, i: self.l[i], a, "listIndex")
- print a.listIndex(5)
+ AddMethod(f, A, "add")
+ a.add(2, 4)
+ print(a.z)
+ AddMethod(lambda self, i: self.l[i], a, "listIndex")
+ print(a.listIndex(5))
"""
if name is None:
- name = function.func_name
+ name = function.__name__
else:
function = RenameFunction(function, name)
+ # Note the Python version checks - WLB
+ # Python 3.3 dropped the 3rd parameter from types.MethodType
if hasattr(obj, '__class__') and obj.__class__ is not type:
# "obj" is an instance, so it gets a bound method.
- setattr(obj, name, MethodType(function, obj, obj.__class__))
+ if sys.version_info[:2] > (3, 2):
+ method = MethodType(function, obj)
+ else:
+ method = MethodType(function, obj, obj.__class__)
else:
- # "obj" is a class, so it gets an unbound method.
- setattr(obj, name, MethodType(function, None, obj))
+ # Handle classes
+ method = function
+
+ setattr(obj, name, method)
def RenameFunction(function, name):
"""
Returns a function identical to the specified function, but with
the specified name.
"""
- return FunctionType(function.func_code,
- function.func_globals,
+ return FunctionType(function.__code__,
+ function.__globals__,
name,
- function.func_defaults)
+ function.__defaults__)
md5 = False
+
+
def MD5signature(s):
return str(s)
+
def MD5filesignature(fname, chunksize=65536):
- f = open(fname, "rb")
- result = f.read()
- f.close()
+ with open(fname, "rb") as f:
+ result = f.read()
return result
try:
@@ -1430,22 +1463,39 @@ except ImportError:
else:
if hasattr(hashlib, 'md5'):
md5 = True
+
def MD5signature(s):
+ """
+ Generate a String of Hex digits representing the md5 signature of the string
+ :param s: either string or bytes. Normally should be bytes
+ :return: String of hex digits
+ """
m = hashlib.md5()
- m.update(str(s))
+
+ try:
+ m.update(to_bytes(s))
+ except TypeError as e:
+ m.update(to_bytes(str(s)))
+
return m.hexdigest()
def MD5filesignature(fname, chunksize=65536):
+ """
+ :param fname:
+ :param chunksize:
+ :return: String of Hex digits
+ """
m = hashlib.md5()
f = open(fname, "rb")
while True:
blck = f.read(chunksize)
if not blck:
break
- m.update(str(blck))
+ m.update(to_bytes(blck))
f.close()
return m.hexdigest()
-
+
+
def MD5collect(signatures):
"""
Collects a list of signatures into an aggregate signature.
@@ -1494,6 +1544,8 @@ class Null(object):
return "Null(0x%08X)" % id(self)
def __nonzero__(self):
return False
+ def __bool__(self):
+ return False
def __getattr__(self, name):
return self
def __setattr__(self, name, value):
@@ -1516,6 +1568,66 @@ class NullSeq(Null):
del __revision__
+
+def to_bytes(s):
+ if s is None:
+ return b'None'
+ if not PY3 and isinstance(s, UnicodeType):
+ # PY2, must encode unicode
+ return bytearray(s, 'utf-8')
+ if isinstance (s, (bytes, bytearray)) or bytes is str:
+ # Above case not covered here as py2 bytes and strings are the same
+ return s
+ return bytes(s, 'utf-8')
+
+
+def to_str(s):
+ if s is None:
+ return 'None'
+ if bytes is str or is_String(s):
+ return s
+ return str (s, 'utf-8')
+
+
+def cmp(a, b):
+ """
+ Define cmp because it's no longer available in python3
+ Works under python 2 as well
+ """
+ return (a > b) - (a < b)
+
+
+def get_env_bool(env, name, default=False):
+ """Get a value of env[name] converted to boolean. The value of env[name] is
+ interpreted as follows: 'true', 'yes', 'y', 'on' (case insensitive) and
+ anything convertible to int that yields non-zero integer are True values;
+ '0', 'false', 'no', 'n' and 'off' (case insensitive) are False values. For
+ all other cases, default value is returned.
+
+ :Parameters:
+ - `env` - dict or dict-like object, a convainer with variables
+ - `name` - name of the variable in env to be returned
+ - `default` - returned when env[name] does not exist or can't be converted to bool
+ """
+ try:
+ var = env[name]
+ except KeyError:
+ return default
+ try:
+ return bool(int(var))
+ except ValueError:
+ if str(var).lower() in ('true', 'yes', 'y', 'on'):
+ return True
+ elif str(var).lower() in ('false', 'no', 'n', 'off'):
+ return False
+ else:
+ return default
+
+
+def get_os_env_bool(name, default=False):
+ """Same as get_env_bool(os.environ, name, default)."""
+ return get_env_bool(os.environ, name, default)
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/BoolVariable.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/BoolVariable.py
index e6ad86bf89b..174d3e58142 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/BoolVariable.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/BoolVariable.py
@@ -2,17 +2,17 @@
This file defines the option type for SCons implementing true/false values.
-Usage example:
+Usage example::
- opts = Variables()
- opts.Add(BoolVariable('embedded', 'build for an embedded system', 0))
- ...
- if env['embedded'] == 1:
+ opts = Variables()
+ opts.Add(BoolVariable('embedded', 'build for an embedded system', 0))
+ ...
+ if env['embedded'] == 1:
...
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,7 +34,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/BoolVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/BoolVariable.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__all__ = ['BoolVariable',]
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/EnumVariable.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/EnumVariable.py
index 5fd41013df2..f0a8bdb826b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/EnumVariable.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/EnumVariable.py
@@ -3,19 +3,19 @@
This file defines the option type for SCons allowing only specified
input-values.
-Usage example:
+Usage example::
- opts = Variables()
- opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',
+ opts = Variables()
+ opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',
allowed_values=('yes', 'no', 'full'),
map={}, ignorecase=2))
- ...
- if env['debug'] == 'full':
+ ...
+ if env['debug'] == 'full':
...
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -37,7 +37,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/EnumVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/EnumVariable.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__all__ = ['EnumVariable',]
@@ -69,16 +69,14 @@ def EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0):
'ignorecase' defines the behaviour of the validator:
- If ignorecase == 0, the validator/converter are case-sensitive.
- If ignorecase == 1, the validator/converter are case-insensitive.
- If ignorecase == 2, the validator/converter is case-insensitive and
- the converted value will always be lower-case.
+ If ignorecase == 0, the validator/converter are case-sensitive.
+ If ignorecase == 1, the validator/converter are case-insensitive.
+ If ignorecase == 2, the validator/converter is case-insensitive and the converted value will always be lower-case.
- The 'validator' tests whether the value is in the list of allowed
- values. The 'converter' converts input values according to the
- given 'map'-dictionary (unmapped input values are returned
- unchanged).
+ The 'validator' tests whether the value is in the list of allowed values. The 'converter' converts input values
+ according to the given 'map'-dictionary (unmapped input values are returned unchanged).
"""
+
help = '%s (%s)' % (help, '|'.join(allowed_values))
# define validator
if ignorecase >= 1:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/ListVariable.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/ListVariable.py
index 8e31d88e82b..797a9b4ae98 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/ListVariable.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/ListVariable.py
@@ -7,17 +7,17 @@ separated by comma. After the option has been processed, the option
value holds either the named list elements, all list elements or no
list elements at all.
-Usage example:
+Usage example::
- list_of_libs = Split('x11 gl qt ical')
+ list_of_libs = Split('x11 gl qt ical')
- opts = Variables()
- opts.Add(ListVariable('shared',
+ opts = Variables()
+ opts.Add(ListVariable('shared',
'libraries to build as shared libraries',
'all',
elems = list_of_libs))
- ...
- for lib in list_of_libs:
+ ...
+ for lib in list_of_libs:
if lib in env['shared']:
env.SharedObject(...)
else:
@@ -25,7 +25,7 @@ Usage example:
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -46,7 +46,7 @@ Usage example:
# 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__ = "src/engine/SCons/Variables/ListVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/ListVariable.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
# Known Bug: This should behave like a Set-Type, but does not really,
# since elements can occur twice.
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/PackageVariable.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/PackageVariable.py
index 44d87ccbbbe..08ae43bbb23 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/PackageVariable.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/PackageVariable.py
@@ -13,22 +13,22 @@ Usage example:
x11=yes (will search for the package installation dir)
x11=/usr/local/X11 (will check this path for existence)
- To replace autoconf's --with-xxx=yyy
-
- opts = Variables()
- opts.Add(PackageVariable('x11',
- 'use X11 installed here (yes = search some places',
- 'yes'))
- ...
- if env['x11'] == True:
- dir = ... search X11 in some standard places ...
- env['x11'] = dir
- if env['x11']:
- ... build with x11 ...
+ To replace autoconf's --with-xxx=yyy ::
+
+ opts = Variables()
+ opts.Add(PackageVariable('x11',
+ 'use X11 installed here (yes = search some places',
+ 'yes'))
+ ...
+ if env['x11'] == True:
+ dir = ... search X11 in some standard places ...
+ env['x11'] = dir
+ if env['x11']:
+ ... build with x11 ...
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -50,7 +50,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/PackageVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PackageVariable.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__all__ = ['PackageVariable',]
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/PathVariable.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/PathVariable.py
index 081fee598bd..ed4a078267b 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/PathVariable.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/PathVariable.py
@@ -8,8 +8,7 @@ Arguments to PathVariable are:
option-name = name of this option on the command line (e.g. "prefix")
option-help = help string for option
option-dflt = default value for this option
- validator = [optional] validator for option value. Predefined
- validators are:
+ validator = [optional] validator for option value. Predefined validators are:
PathAccept -- accepts any path setting; no validation
PathIsDir -- path must be an existing directory
@@ -25,7 +24,7 @@ Arguments to PathVariable are:
and the env is the env to which the Options have been
added.
-Usage example:
+Usage example::
Examples:
prefix=/usr/local
@@ -34,8 +33,8 @@ Usage example:
opts = Variables()
opts.Add(PathVariable('qtdir',
- 'where the root of Qt is installed',
- qtdir, PathIsDir))
+ 'where the root of Qt is installed',
+ qtdir, PathIsDir))
opts.Add(PathVariable('qt_includes',
'where the Qt includes are installed',
'$qtdir/includes', PathIsDirCreate))
@@ -46,7 +45,7 @@ Usage example:
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -68,7 +67,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/PathVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PathVariable.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__all__ = ['PathVariable',]
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/__init__.py
index 83ec1b2671b..028244069ac 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Variables/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Variables/__init__.py
@@ -5,7 +5,7 @@ customizable variables to an SCons build.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,21 +26,22 @@ customizable variables to an SCons build.
# 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__ = "src/engine/SCons/Variables/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os.path
import sys
+from functools import cmp_to_key
import SCons.Environment
import SCons.Errors
import SCons.Util
import SCons.Warnings
-from BoolVariable import BoolVariable # okay
-from EnumVariable import EnumVariable # okay
-from ListVariable import ListVariable # naja
-from PackageVariable import PackageVariable # naja
-from PathVariable import PathVariable # okay
+from .BoolVariable import BoolVariable # okay
+from .EnumVariable import EnumVariable # okay
+from .ListVariable import ListVariable # naja
+from .PackageVariable import PackageVariable # naja
+from .PathVariable import PathVariable # okay
class Variables(object):
@@ -115,13 +116,13 @@ class Variables(object):
"""
Add an option.
- key - the name of the variable, or a list or tuple of arguments
- help - optional help text for the options
- default - optional default value
- validator - optional function that is called to validate the option's value
- Called with (key, value, environment)
- converter - optional function that is called to convert the option's value before
- putting it in the environment.
+
+ @param key: the name of the variable, or a list or tuple of arguments
+ @param help: optional help text for the options
+ @param default: optional default value
+ @param validator: optional function that is called to validate the option's value
+ @type validator: Called with (key, value, environment)
+ @param converter: optional function that is called to convert the option's value before putting it in the environment.
"""
if SCons.Util.is_List(key) or isinstance(key, tuple):
@@ -141,14 +142,17 @@ class Variables(object):
Each list element is a tuple/list of arguments to be passed on
to the underlying method for adding options.
- Example:
- opt.AddVariables(
+ Example::
+
+ opt.AddVariables(
('debug', '', 0),
('CC', 'The C compiler'),
('VALIDATE', 'An option for testing validation', 'notset',
validator, None),
)
+
"""
+
for o in optlist:
self._do_add(*o)
@@ -175,7 +179,9 @@ class Variables(object):
sys.path.insert(0, dir)
try:
values['__name__'] = filename
- exec open(filename, 'rU').read() in {}, values
+ with open(filename, 'r') as f:
+ contents = f.read()
+ exec(contents, {}, values)
finally:
if dir:
del sys.path[0]
@@ -211,7 +217,7 @@ class Variables(object):
env[option.key] = option.converter(value)
except TypeError:
env[option.key] = option.converter(value, env)
- except ValueError, x:
+ except ValueError as x:
raise SCons.Errors.UserError('Error converting option: %s\n%s'%(option.key, x))
@@ -273,7 +279,7 @@ class Variables(object):
finally:
fh.close()
- except IOError, x:
+ except IOError as x:
raise SCons.Errors.UserError('Error writing options to file: %s\n%s' % (filename, x))
def GenerateHelpText(self, env, sort=None):
@@ -282,9 +288,13 @@ class Variables(object):
env - an environment that is used to get the current values
of the options.
+ cmp - Either a function as follows: The specific sort function should take two arguments and return -1, 0 or 1
+ or a boolean to indicate if it should be sorted.
"""
- if sort:
+ if callable(sort):
+ options = sorted(self.options, key=cmp_to_key(lambda x,y: sort(x.key,y.key)))
+ elif sort is True:
options = sorted(self.options, key=lambda x: x.key)
else:
options = self.options
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Warnings.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Warnings.py
index adf1eabd152..88db806d40f 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Warnings.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Warnings.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ This file implements the warnings framework for SCons.
"""
-__revision__ = "src/engine/SCons/Warnings.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/Warnings.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import sys
@@ -74,12 +74,6 @@ class MisleadingKeywordsWarning(WarningOnByDefault):
class MissingSConscriptWarning(WarningOnByDefault):
pass
-class NoMD5ModuleWarning(WarningOnByDefault):
- pass
-
-class NoMetaclassSupportWarning(WarningOnByDefault):
- pass
-
class NoObjectCountWarning(WarningOnByDefault):
pass
@@ -153,6 +147,9 @@ class DeprecatedSigModuleWarning(MandatoryDeprecatedWarning):
class DeprecatedBuilderKeywordsWarning(MandatoryDeprecatedWarning):
pass
+class DeprecatedMissingSConscriptWarning(DeprecatedWarning):
+ pass
+
# The below is a list of 2-tuples. The first element is a class object.
# The second element is true if that class is enabled, false if it is disabled.
@@ -185,8 +182,8 @@ def warn(clazz, *args):
global _enabled, _warningAsException, _warningOut
warning = clazz(args)
- for clazz, flag in _enabled:
- if isinstance(warning, clazz):
+ for cls, flag in _enabled:
+ if isinstance(warning, cls):
if flag:
if _warningAsException:
raise warning
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/__init__.py
index bc557bf50ea..ea8f271c3b7 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/__init__.py
@@ -5,7 +5,7 @@ The main package for the SCons software construction utility.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,17 +27,17 @@ The main package for the SCons software construction utility.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/__init__.py rel_2.5.0:3544:95d356f188a3 2016/04/09 14:38:50 bdbaddog"
+__revision__ = "src/engine/SCons/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-__version__ = "2.5.0"
+__version__ = "3.0.4"
-__build__ = "rel_2.5.0:3544:95d356f188a3[MODIFIED]"
+__build__ = "3a41ed6b288cee8d085373ad7fa02894e1903864"
-__buildsys__ = "ubuntu1404-32bit"
+__buildsys__ = "kufra"
-__date__ = "2016/04/09 14:38:50"
+__date__ = "2019-01-20 22:51:36"
-__developer__ = "bdbaddog"
+__developer__ = "bdeegan"
# make sure compatibility is always in place
import SCons.compat
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/__init__.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/compat/__init__.py
index 000b81faf42..990ebd1ad09 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/__init__.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/compat/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -57,11 +57,14 @@ function defined below loads the module as the "real" name (without the
rest of our code will find our pre-loaded compatibility module.
"""
-__revision__ = "src/engine/SCons/compat/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/compat/__init__.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import os
import sys
-import imp # Use the "imp" module to protect imports from fixers.
+import imp # Use the "imp" module to protect imports from fixers.
+
+PYPY = hasattr(sys, 'pypy_translation_info')
+
def import_as(module, name):
"""
@@ -71,6 +74,7 @@ def import_as(module, name):
dir = os.path.split(__file__)[0]
return imp.load_module(name, *imp.find_module(module, [dir]))
+
def rename_module(new, old):
"""
Attempts to import the old module and load it under the new name.
@@ -82,21 +86,32 @@ def rename_module(new, old):
except ImportError:
return False
+
+# TODO: FIXME
# In 3.x, 'pickle' automatically loads the fast version if available.
rename_module('pickle', 'cPickle')
+# Default pickle protocol. Higher protocols are more efficient/featureful
+# but incompatible with older Python versions. On Python 2.7 this is 2.
+# Negative numbers choose the highest available protocol.
+import pickle
+
+# Was pickle.HIGHEST_PROTOCOL
+# Changed to 2 so py3.5+'s pickle will be compatible with py2.7.
+PICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL
+
+# TODO: FIXME
# In 3.x, 'profile' automatically loads the fast version if available.
rename_module('profile', 'cProfile')
-
+# TODO: FIXME
# Before Python 3.0, the 'queue' module was named 'Queue'.
rename_module('queue', 'Queue')
-
+# TODO: FIXME
# Before Python 3.0, the 'winreg' module was named '_winreg'
rename_module('winreg', '_winreg')
-
# Python 3 moved builtin intern() to sys package
# To make porting easier, make intern always live
# in sys package (for python 2.7.x)
@@ -107,32 +122,89 @@ except AttributeError:
# intern into the sys package
sys.intern = intern
-
# Preparing for 3.x. UserDict, UserList, UserString are in
# collections for 3.x, but standalone in 2.7.x
import collections
+
try:
collections.UserDict
except AttributeError:
- exec('from UserDict import UserDict as _UserDict')
+ exec ('from UserDict import UserDict as _UserDict')
collections.UserDict = _UserDict
del _UserDict
try:
collections.UserList
except AttributeError:
- exec('from UserList import UserList as _UserList')
+ exec ('from UserList import UserList as _UserList')
collections.UserList = _UserList
del _UserList
try:
collections.UserString
except AttributeError:
- exec('from UserString import UserString as _UserString')
+ exec ('from UserString import UserString as _UserString')
collections.UserString = _UserString
del _UserString
+import shutil
+try:
+ shutil.SameFileError
+except AttributeError:
+ class SameFileError(Exception):
+ pass
+
+ shutil.SameFileError = SameFileError
+
+def with_metaclass(meta, *bases):
+ """
+ Function from jinja2/_compat.py. License: BSD.
+
+ Use it like this::
+
+ class BaseForm(object):
+ pass
+
+ class FormType(type):
+ pass
+
+ class Form(with_metaclass(FormType, BaseForm)):
+ pass
+
+ This requires a bit of explanation: the basic idea is to make a
+ dummy metaclass for one level of class instantiation that replaces
+ itself with the actual metaclass. Because of internal type checks
+ we also need to make sure that we downgrade the custom metaclass
+ for one level to something closer to type (that's why __call__ and
+ __init__ comes back from type etc.).
+
+ This has the advantage over six.with_metaclass of not introducing
+ dummy classes into the final MRO.
+ """
+
+ class metaclass(meta):
+ __call__ = type.__call__
+ __init__ = type.__init__
+
+ def __new__(cls, name, this_bases, d):
+ if this_bases is None:
+ return type.__new__(cls, name, (), d)
+ return meta(name, bases, d)
+
+ return metaclass('temporary_class', None, {})
+
+
+class NoSlotsPyPy(type):
+ """
+ Workaround for PyPy not working well with __slots__ and __class__ assignment.
+ """
+
+ def __new__(meta, name, bases, dct):
+ if PYPY and '__slots__' in dct:
+ dct.pop('__slots__')
+ return super(NoSlotsPyPy, meta).__new__(meta, name, bases, dct)
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_dbm.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/compat/_scons_dbm.py
index 0720956fbb3..71b62ff24bf 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/compat/_scons_dbm.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/compat/_scons_dbm.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ that the whichdb.whichdb() implementstation in the various 2.X versions of
Python won't blow up even if dbm wasn't compiled in.
"""
-__revision__ = "src/engine/SCons/compat/_scons_dbm.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/compat/_scons_dbm.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
class error(Exception):
pass
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/cpp.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/cpp.py
index 46671afdbb4..c7ae65e4334 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/cpp.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/cpp.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,12 +21,11 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/cpp.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/cpp.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
__doc__ = """
SCons C Pre-Processor module
"""
-#TODO 2.3 and before has no sorted()
import SCons.compat
import os
@@ -44,10 +43,13 @@ import re
# that we want to fetch, using the regular expressions to which the lists
# of preprocessor directives map.
cpp_lines_dict = {
- # Fetch the rest of a #if/#elif/#ifdef/#ifndef as one argument,
+ # Fetch the rest of a #if/#elif as one argument,
+ # with white space optional.
+ ('if', 'elif') : '\s*(.+)',
+
+ # Fetch the rest of a #ifdef/#ifndef as one argument,
# separated from the keyword by white space.
- ('if', 'elif', 'ifdef', 'ifndef',)
- : '\s+(.+)',
+ ('ifdef', 'ifndef',): '\s+(.+)',
# Fetch the rest of a #import/#include/#include_next line as one
# argument, with white space optional.
@@ -83,11 +85,11 @@ del op_list
# Create a list of the expressions we'll use to match all of the
# preprocessor directives. These are the same as the directives
# themselves *except* that we must use a negative lookahead assertion
-# when matching "if" so it doesn't match the "if" in "ifdef."
+# when matching "if" so it doesn't match the "if" in "ifdef" or "ifndef".
override = {
- 'if' : 'if(?!def)',
+ 'if' : 'if(?!n?def)',
}
-l = [override.get(x, x) for x in Table.keys()]
+l = [override.get(x, x) for x in list(Table.keys())]
# Turn the list of expressions into one big honkin' regular expression
@@ -130,7 +132,7 @@ CPP_to_Python_Ops_Sub = lambda m: CPP_to_Python_Ops_Dict[m.group(0)]
# re module, as late as version 2.2.2, empirically matches the
# "!" in "!=" first, instead of finding the longest match.
# What's up with that?
-l = sorted(CPP_to_Python_Ops_Dict.keys(), key=lambda a: len(a), reverse=True)
+l = sorted(list(CPP_to_Python_Ops_Dict.keys()), key=lambda a: len(a), reverse=True)
# Turn the list of keys into one regular expression that will allow us
# to substitute all of the operators at once.
@@ -266,7 +268,7 @@ class PreProcessor(object):
d = {
'scons_current_file' : self.scons_current_file
}
- for op in Table.keys():
+ for op in list(Table.keys()):
d[op] = getattr(self, 'do_' + op)
self.default_table = d
@@ -312,7 +314,7 @@ class PreProcessor(object):
t = self.tuples.pop(0)
# Uncomment to see the list of tuples being processed (e.g.,
# to validate the CPP lines are being translated correctly).
- #print t
+ #print(t)
self.dispatch_table[t[0]](t)
return self.finalize_result(fname)
@@ -379,7 +381,8 @@ class PreProcessor(object):
return None
def read_file(self, file):
- return open(file).read()
+ with open(file) as f:
+ return f.read()
# Start and stop processing include lines.
@@ -510,7 +513,7 @@ class PreProcessor(object):
t = self.resolve_include(t)
include_file = self.find_include_file(t)
if include_file:
- #print "include_file =", include_file
+ #print("include_file =", include_file)
self.result.append(include_file)
contents = self.read_file(include_file)
new_tuples = [('scons_current_file', include_file)] + \
@@ -542,12 +545,14 @@ class PreProcessor(object):
This handles recursive expansion of values without "" or <>
surrounding the name until an initial " or < is found, to handle
+
#include FILE
- where FILE is a #define somewhere else.
- """
+
+ where FILE is a #define somewhere else."""
+
s = t[1]
while not s[0] in '<"':
- #print "s =", s
+ #print("s =", s)
try:
s = self.cpp_namespace[s]
except KeyError:
diff --git a/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/dblite.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/dblite.py
new file mode 100644
index 00000000000..628182b6cfa
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/dblite.py
@@ -0,0 +1,287 @@
+# dblite.py module contributed by Ralf W. Grosse-Kunstleve.
+# Extended for Unicode by Steven Knight.
+from __future__ import print_function
+
+import os
+import pickle
+import shutil
+import time
+
+from SCons.compat import PICKLE_PROTOCOL
+
+keep_all_files = 00000
+ignore_corrupt_dbfiles = 0
+
+
+def corruption_warning(filename):
+ print("Warning: Discarding corrupt database:", filename)
+
+
+try:
+ unicode
+except NameError:
+ def is_string(s):
+ return isinstance(s, str)
+else:
+ def is_string(s):
+ return type(s) in (str, unicode)
+
+
+def is_bytes(s):
+ return isinstance(s, bytes)
+
+
+try:
+ unicode('a')
+except NameError:
+ def unicode(s):
+ return s
+
+dblite_suffix = '.dblite'
+
+# TODO: Does commenting this out break switching from py2/3?
+# if bytes is not str:
+# dblite_suffix += '.p3'
+tmp_suffix = '.tmp'
+
+
+class dblite(object):
+ """
+ Squirrel away references to the functions in various modules
+ that we'll use when our __del__() method calls our sync() method
+ during shutdown. We might get destroyed when Python is in the midst
+ of tearing down the different modules we import in an essentially
+ arbitrary order, and some of the various modules's global attributes
+ may already be wiped out from under us.
+
+ See the discussion at:
+ http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html
+ """
+
+ _open = open
+ _pickle_dump = staticmethod(pickle.dump)
+ _pickle_protocol = PICKLE_PROTOCOL
+ _os_chmod = os.chmod
+
+ try:
+ _os_chown = os.chown
+ except AttributeError:
+ _os_chown = None
+
+ _os_rename = os.rename
+ _os_unlink = os.unlink
+ _shutil_copyfile = shutil.copyfile
+ _time_time = time.time
+
+ def __init__(self, file_base_name, flag, mode):
+ assert flag in (None, "r", "w", "c", "n")
+ if flag is None:
+ flag = "r"
+
+ base, ext = os.path.splitext(file_base_name)
+ if ext == dblite_suffix:
+ # There's already a suffix on the file name, don't add one.
+ self._file_name = file_base_name
+ self._tmp_name = base + tmp_suffix
+ else:
+ self._file_name = file_base_name + dblite_suffix
+ self._tmp_name = file_base_name + tmp_suffix
+
+ self._flag = flag
+ self._mode = mode
+ self._dict = {}
+ self._needs_sync = 00000
+
+ if self._os_chown is not None and (os.geteuid() == 0 or os.getuid() == 0):
+ # running as root; chown back to current owner/group when done
+ try:
+ statinfo = os.stat(self._file_name)
+ self._chown_to = statinfo.st_uid
+ self._chgrp_to = statinfo.st_gid
+ except OSError as e:
+ # db file doesn't exist yet.
+ # Check os.environ for SUDO_UID, use if set
+ self._chown_to = int(os.environ.get('SUDO_UID', -1))
+ self._chgrp_to = int(os.environ.get('SUDO_GID', -1))
+ else:
+ self._chown_to = -1 # don't chown
+ self._chgrp_to = -1 # don't chgrp
+
+ if self._flag == "n":
+ self._open(self._file_name, "wb", self._mode)
+ else:
+ try:
+ f = self._open(self._file_name, "rb")
+ except IOError as e:
+ if self._flag != "c":
+ raise e
+ self._open(self._file_name, "wb", self._mode)
+ else:
+ p = f.read()
+ if len(p) > 0:
+ try:
+ if bytes is not str:
+ self._dict = pickle.loads(p, encoding='bytes')
+ else:
+ self._dict = pickle.loads(p)
+ except (pickle.UnpicklingError, EOFError, KeyError):
+ # Note how we catch KeyErrors too here, which might happen
+ # when we don't have cPickle available (default pickle
+ # throws it).
+ if (ignore_corrupt_dbfiles == 0): raise
+ if (ignore_corrupt_dbfiles == 1):
+ corruption_warning(self._file_name)
+
+ def close(self):
+ if self._needs_sync:
+ self.sync()
+
+ def __del__(self):
+ self.close()
+
+ def sync(self):
+ self._check_writable()
+ f = self._open(self._tmp_name, "wb", self._mode)
+ self._pickle_dump(self._dict, f, self._pickle_protocol)
+ f.close()
+
+ # Windows doesn't allow renaming if the file exists, so unlink
+ # it first, chmod'ing it to make sure we can do so. On UNIX, we
+ # may not be able to chmod the file if it's owned by someone else
+ # (e.g. from a previous run as root). We should still be able to
+ # unlink() the file if the directory's writable, though, so ignore
+ # any OSError exception thrown by the chmod() call.
+ try:
+ self._os_chmod(self._file_name, 0o777)
+ except OSError:
+ pass
+ self._os_unlink(self._file_name)
+ self._os_rename(self._tmp_name, self._file_name)
+ if self._os_chown is not None and self._chown_to > 0: # don't chown to root or -1
+ try:
+ self._os_chown(self._file_name, self._chown_to, self._chgrp_to)
+ except OSError:
+ pass
+ self._needs_sync = 00000
+ if (keep_all_files):
+ self._shutil_copyfile(
+ self._file_name,
+ self._file_name + "_" + str(int(self._time_time())))
+
+ def _check_writable(self):
+ if (self._flag == "r"):
+ raise IOError("Read-only database: %s" % self._file_name)
+
+ def __getitem__(self, key):
+ return self._dict[key]
+
+ def __setitem__(self, key, value):
+ self._check_writable()
+ if (not is_string(key)):
+ raise TypeError("key `%s' must be a string but is %s" % (key, type(key)))
+ if (not is_bytes(value)):
+ raise TypeError("value `%s' must be a bytes but is %s" % (value, type(value)))
+ self._dict[key] = value
+ self._needs_sync = 0o001
+
+ def keys(self):
+ return list(self._dict.keys())
+
+ def has_key(self, key):
+ return key in self._dict
+
+ def __contains__(self, key):
+ return key in self._dict
+
+ def iterkeys(self):
+ # Wrapping name in () prevents fixer from "fixing" this
+ return (self._dict.iterkeys)()
+
+ __iter__ = iterkeys
+
+ def __len__(self):
+ return len(self._dict)
+
+
+def open(file, flag=None, mode=0o666):
+ return dblite(file, flag, mode)
+
+
+def _exercise():
+ db = open("tmp", "n")
+ assert len(db) == 0
+ db["foo"] = "bar"
+ assert db["foo"] == "bar"
+ db[unicode("ufoo")] = unicode("ubar")
+ assert db[unicode("ufoo")] == unicode("ubar")
+ db.sync()
+ db = open("tmp", "c")
+ assert len(db) == 2, len(db)
+ assert db["foo"] == "bar"
+ db["bar"] = "foo"
+ assert db["bar"] == "foo"
+ db[unicode("ubar")] = unicode("ufoo")
+ assert db[unicode("ubar")] == unicode("ufoo")
+ db.sync()
+ db = open("tmp", "r")
+ assert len(db) == 4, len(db)
+ assert db["foo"] == "bar"
+ assert db["bar"] == "foo"
+ assert db[unicode("ufoo")] == unicode("ubar")
+ assert db[unicode("ubar")] == unicode("ufoo")
+ try:
+ db.sync()
+ except IOError as e:
+ assert str(e) == "Read-only database: tmp.dblite"
+ else:
+ raise RuntimeError("IOError expected.")
+ db = open("tmp", "w")
+ assert len(db) == 4
+ db["ping"] = "pong"
+ db.sync()
+ try:
+ db[(1, 2)] = "tuple"
+ except TypeError as e:
+ assert str(e) == "key `(1, 2)' must be a string but is <type 'tuple'>", str(e)
+ else:
+ raise RuntimeError("TypeError exception expected")
+ try:
+ db["list"] = [1, 2]
+ except TypeError as e:
+ assert str(e) == "value `[1, 2]' must be a string but is <type 'list'>", str(e)
+ else:
+ raise RuntimeError("TypeError exception expected")
+ db = open("tmp", "r")
+ assert len(db) == 5
+ db = open("tmp", "n")
+ assert len(db) == 0
+ dblite._open("tmp.dblite", "w")
+ db = open("tmp", "r")
+ dblite._open("tmp.dblite", "w").write("x")
+ try:
+ db = open("tmp", "r")
+ except pickle.UnpicklingError:
+ pass
+ else:
+ raise RuntimeError("pickle exception expected.")
+ global ignore_corrupt_dbfiles
+ ignore_corrupt_dbfiles = 2
+ db = open("tmp", "r")
+ assert len(db) == 0
+ os.unlink("tmp.dblite")
+ try:
+ db = open("tmp", "w")
+ except IOError as e:
+ assert str(e) == "[Errno 2] No such file or directory: 'tmp.dblite'", str(e)
+ else:
+ raise RuntimeError("IOError expected.")
+
+
+if (__name__ == "__main__"):
+ _exercise()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/exitfuncs.py b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/exitfuncs.py
index a20f049b3b0..cf484c57eaa 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/exitfuncs.py
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/exitfuncs.py
@@ -5,7 +5,7 @@ Register functions which are executed when SCons exits for any reason.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ Register functions which are executed when SCons exits for any reason.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/exitfuncs.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/engine/SCons/exitfuncs.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import atexit
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/scons-2.5.0-py2.7.egg-info b/src/third_party/scons-3.0.4/scons-local-3.0.4/scons-3.0.4.egg-info
index 1742cf89d4a..b3fcd7b8781 100644
--- a/src/third_party/scons-2.5.0/scons-local-2.5.0/scons-2.5.0-py2.7.egg-info
+++ b/src/third_party/scons-3.0.4/scons-local-3.0.4/scons-3.0.4.egg-info
@@ -1,10 +1,10 @@
Metadata-Version: 1.0
Name: scons
-Version: 2.5.0
+Version: 3.0.4
Summary: Open Source next-generation build tool.
Home-page: http://www.scons.org/
-Author: Steven Knight
-Author-email: knight@baldmt.com
+Author: William Deegan
+Author-email: bill@baddogconsulting.com
License: UNKNOWN
Description: Open Source next-generation build tool.
Improved, cross-platform substitute for the classic Make
diff --git a/src/third_party/scons-2.5.0/scons-time.py b/src/third_party/scons-3.0.4/scons-time.py
index 2e63ef2119b..bef45579453 100755..100644
--- a/src/third_party/scons-2.5.0/scons-time.py
+++ b/src/third_party/scons-3.0.4/scons-time.py
@@ -9,7 +9,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 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,10 +29,9 @@
# 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.
-from __future__ import division
-from __future__ import nested_scopes
+from __future__ import division, print_function
-__revision__ = "src/script/scons-time.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
+__revision__ = "src/script/scons-time.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
import getopt
import glob
@@ -59,15 +58,15 @@ def make_temp_file(**kw):
return result
def HACK_for_exec(cmd, *args):
- '''
+ """
For some reason, Python won't allow an exec() within a function
that also declares an internal function (including lambda functions).
This function is a hack that calls exec() in a function with no
internal functions.
- '''
+ """
if not args: exec(cmd)
- elif len(args) == 1: exec cmd in args[0]
- else: exec cmd in args[0], args[1]
+ elif len(args) == 1: exec(cmd, args[0])
+ else: exec(cmd, args[0], args[1])
class Plotter(object):
def increment_size(self, largest):
@@ -103,7 +102,7 @@ class Line(object):
def print_label(self, inx, x, y):
if self.label:
- print 'set label %s "%s" at %s,%s right' % (inx, self.label, x, y)
+ print('set label %s "%s" at %0.1f,%0.1f right' % (inx, self.label, x, y))
def plot_string(self):
if self.title:
@@ -116,15 +115,15 @@ class Line(object):
if fmt is None:
fmt = self.fmt
if self.comment:
- print '# %s' % self.comment
+ print('# %s' % self.comment)
for x, y in self.points:
# If y is None, it usually represents some kind of break
# in the line's index number. We might want to represent
# this some way rather than just drawing the line straight
# between the two points on either side.
if not y is None:
- print fmt % (x, y)
- print 'e'
+ print(fmt % (x, y))
+ print('e')
def get_x_values(self):
return [ p[0] for p in self.points ]
@@ -148,7 +147,7 @@ class Gnuplotter(Plotter):
return line.plot_string()
def vertical_bar(self, x, type, label, comment):
- if self.get_min_x() <= x and x <= self.get_max_x():
+ if self.get_min_x() <= x <= self.get_max_x():
points = [(x, 0), (x, self.max_graph_value(self.get_max_y()))]
self.line(points, type, label, comment)
@@ -210,8 +209,8 @@ class Gnuplotter(Plotter):
return
if self.title:
- print 'set title "%s"' % self.title
- print 'set key %s' % self.key_location
+ print('set title "%s"' % self.title)
+ print('set key %s' % self.key_location)
min_y = self.get_min_y()
max_y = self.max_graph_value(self.get_max_y())
@@ -226,7 +225,7 @@ class Gnuplotter(Plotter):
inx += 1
plot_strings = [ self.plot_string(l) for l in self.lines ]
- print 'plot ' + ', \\\n '.join(plot_strings)
+ print('plot ' + ', \\\n '.join(plot_strings))
for line in self.lines:
line.print_points()
@@ -249,7 +248,7 @@ def unzip(fname):
os.makedirs(dir)
except:
pass
- open(name, 'w').write(zf.read(name))
+ open(name, 'wb').write(zf.read(name))
def read_tree(dir):
for dirpath, dirnames, filenames in os.walk(dir):
@@ -460,7 +459,9 @@ class SConsTimer(object):
output = os.popen(command).read()
if self.verbose:
sys.stdout.write(output)
- open(log, 'wb').write(output)
+ # TODO: Figure out
+ # Not sure we need to write binary here
+ open(log, 'w').write(output)
#
@@ -497,7 +498,7 @@ class SConsTimer(object):
header_fmt = ' '.join(['%12s'] * len(columns))
line_fmt = header_fmt + ' %s'
- print header_fmt % columns
+ print(header_fmt % columns)
for file in files:
t = line_function(file, *args, **kw)
@@ -507,7 +508,7 @@ class SConsTimer(object):
if diff > 0:
t += [''] * diff
t.append(file_function(file))
- print line_fmt % tuple(t)
+ print(line_fmt % tuple(t))
def collect_results(self, files, function, *args, **kw):
results = {}
@@ -647,7 +648,7 @@ class SConsTimer(object):
"""
try:
import pstats
- except ImportError, e:
+ except ImportError as e:
sys.stderr.write('%s: func: %s\n' % (self.name, e))
sys.stderr.write('%s This version of Python is missing the profiler.\n' % self.name_spaces)
sys.stderr.write('%s Cannot use the "func" subcommand.\n' % self.name_spaces)
@@ -708,7 +709,7 @@ class SConsTimer(object):
return self.default(argv)
try:
return func(argv)
- except TypeError, e:
+ except TypeError as e:
sys.stderr.write("%s %s: %s\n" % (self.name, cmdName, e))
import traceback
traceback.print_exc(file=sys.stderr)
@@ -813,7 +814,7 @@ class SConsTimer(object):
self.title = a
if self.config_file:
- exec open(self.config_file, 'rU').read() in self.__dict__
+ exec(open(self.config_file, 'r').read(), self.__dict__)
if self.chdir:
os.chdir(self.chdir)
@@ -846,13 +847,13 @@ class SConsTimer(object):
try:
f, line, func, time = \
self.get_function_profile(file, function_name)
- except ValueError, e:
+ except ValueError as e:
sys.stderr.write("%s: func: %s: %s\n" %
(self.name, file, e))
else:
if f.startswith(cwd_):
f = f[len(cwd_):]
- print "%.3f %s:%d(%s)" % (time, f, line, func)
+ print("%.3f %s:%d(%s)" % (time, f, line, func))
elif format == 'gnuplot':
@@ -932,7 +933,7 @@ class SConsTimer(object):
self.title = a
if self.config_file:
- HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
+ HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__)
if self.chdir:
os.chdir(self.chdir)
@@ -1052,7 +1053,7 @@ class SConsTimer(object):
object_name = args.pop(0)
if self.config_file:
- HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
+ HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__)
if self.chdir:
os.chdir(self.chdir)
@@ -1190,7 +1191,7 @@ class SConsTimer(object):
sys.exit(1)
if self.config_file:
- exec open(self.config_file, 'rU').read() in self.__dict__
+ exec(open(self.config_file, 'r').read(), self.__dict__)
if args:
self.archive_list = args
@@ -1423,14 +1424,14 @@ class SConsTimer(object):
elif o in ('--title',):
self.title = a
elif o in ('--which',):
- if not a in self.time_strings.keys():
+ if not a in list(self.time_strings.keys()):
sys.stderr.write('%s: time: Unrecognized timer "%s".\n' % (self.name, a))
sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name))
sys.exit(1)
which = a
if self.config_file:
- HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
+ HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__)
if self.chdir:
os.chdir(self.chdir)
diff --git a/src/third_party/scons-3.0.4/scons.bat b/src/third_party/scons-3.0.4/scons.bat
new file mode 100644
index 00000000000..21ed3a876a2
--- /dev/null
+++ b/src/third_party/scons-3.0.4/scons.bat
@@ -0,0 +1,38 @@
+@REM Copyright (c) 2001 - 2019 The SCons Foundation
+@REM src/script/scons.bat 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan
+@echo off
+set SCONS_ERRORLEVEL=
+if "%OS%" == "Windows_NT" goto WinNT
+
+@REM for 9x/Me you better not have more than 9 args
+python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.0.4'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.0.4'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
+@REM no way to set exit status of this script for 9x/Me
+goto endscons
+
+@REM Credit where credit is due: we return the exit code despite our
+@REM use of setlocal+endlocal using a technique from Bear's Journal:
+@REM http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/
+
+:WinNT
+setlocal
+@REM ensure the script will be executed with the Python it was installed for
+pushd %~dp0..
+set path=%~dp0;%CD%;%path%
+popd
+@REM try the script named as the .bat file in current dir, then in Scripts subdir
+set scriptname=%~dp0%~n0.py
+if not exist "%scriptname%" set scriptname=%~dp0Scripts\%~n0.py
+@REM Handle when running from wheel where the script has no .py extension
+if not exist "%scriptname%" set scriptname=%~dp0%~n0
+python "%scriptname%" %*
+endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL%
+
+if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode
+if errorlevel 9009 echo you do not have python in your PATH
+goto endscons
+
+:returncode
+exit /B %SCONS_ERRORLEVEL%
+
+:endscons
+call :returncode %SCONS_ERRORLEVEL%
diff --git a/src/third_party/scons-2.5.0/scons.py b/src/third_party/scons-3.0.4/scons.py
index 2cae192afd8..66031d52b95 100755..100644
--- a/src/third_party/scons-2.5.0/scons.py
+++ b/src/third_party/scons-3.0.4/scons.py
@@ -2,7 +2,7 @@
#
# SCons - a Software Constructor
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -23,22 +23,32 @@
# 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__ = "src/script/scons.py rel_2.5.0:3544:95d356f188a3 2016/04/09 14:38:50 bdbaddog"
+from __future__ import print_function
-__version__ = "2.5.0"
+__revision__ = "src/script/scons.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-__build__ = "rel_2.5.0:3544:95d356f188a3[MODIFIED]"
+__version__ = "3.0.4"
-__buildsys__ = "ubuntu1404-32bit"
+__build__ = "3a41ed6b288cee8d085373ad7fa02894e1903864"
-__date__ = "2016/04/09 14:38:50"
+__buildsys__ = "kufra"
-__developer__ = "bdbaddog"
+__date__ = "2019-01-20 22:51:36"
+
+__developer__ = "bdeegan"
+
+# This is the entry point to the SCons program.
+# The only job of this script is to work out where the guts of the program
+# could be and import them, where the real work begins.
+# SCons can be invoked several different ways
+# - from an installed location
+# - from a "local install" copy
+# - from a source tree, which has a different dir struture than the other two
+# Try to account for all those possibilities.
import os
import sys
-
##############################################################################
# BEGIN STANDARD SCons SCRIPT HEADER
#
@@ -48,57 +58,53 @@ import sys
# should also change other scripts that use this same header.
##############################################################################
-# Strip the script directory from sys.path() so on case-insensitive
-# (WIN32) systems Python doesn't think that the "scons" script is the
-# "SCons" package. Replace it with our own library directories
-# (version-specific first, in case they installed by hand there,
-# followed by generic) so we pick up the right version of the build
-# engine modules if they're in either directory.
-
-
-if sys.version_info >= (3,0,0):
+# compatibility check
+if (3,0,0) < sys.version_info < (3,5,0) or sys.version_info < (2,7,0):
msg = "scons: *** SCons version %s does not run under Python version %s.\n\
-Python 3 is not yet supported.\n"
+Python 2.7 or >= 3.5 is required.\n"
sys.stderr.write(msg % (__version__, sys.version.split()[0]))
sys.exit(1)
-
-script_dir = sys.path[0]
-
-if script_dir in sys.path:
- sys.path.remove(script_dir)
+# Strip the script directory from sys.path so on case-insensitive
+# (WIN32) systems Python doesn't think that the "scons" script is the
+# "SCons" package.
+script_dir = os.path.dirname(__file__)
+script_path = os.path.realpath(os.path.dirname(__file__))
+if script_path in sys.path:
+ sys.path.remove(script_path)
libs = []
if "SCONS_LIB_DIR" in os.environ:
libs.append(os.environ["SCONS_LIB_DIR"])
-# - running from source takes priority (since 2.3.2), excluding SCONS_LIB_DIR settings
-script_path = os.path.abspath(os.path.dirname(__file__))
-source_path = os.path.join(script_path, '..', 'engine')
-libs.append(source_path)
+# running from source takes 2nd priority (since 2.3.2), following SCONS_LIB_DIR
+source_path = os.path.join(script_path, os.pardir, 'engine')
+if os.path.isdir(source_path):
+ libs.append(source_path)
+# add local-install locations
local_version = 'scons-local-' + __version__
local = 'scons-local'
if script_dir:
local_version = os.path.join(script_dir, local_version)
local = os.path.join(script_dir, local)
-libs.append(os.path.abspath(local_version))
-libs.append(os.path.abspath(local))
+if os.path.isdir(local_version):
+ libs.append(os.path.abspath(local_version))
+if os.path.isdir(local):
+ libs.append(os.path.abspath(local))
scons_version = 'scons-%s' % __version__
# preferred order of scons lookup paths
prefs = []
-
-# - running from egg check
+# if we can find package information, use it
try:
import pkg_resources
except ImportError:
pass
else:
- # when running from an egg add the egg's directory
try:
d = pkg_resources.get_distribution('scons')
except pkg_resources.DistributionNotFound:
@@ -107,18 +113,18 @@ else:
prefs.append(d.location)
if sys.platform == 'win32':
- # sys.prefix is (likely) C:\Python*;
- # check only C:\Python*.
+ # Use only sys.prefix on Windows
prefs.append(sys.prefix)
prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages'))
else:
# On other (POSIX) platforms, things are more complicated due to
- # the variety of path names and library locations. Try to be smart
- # about it.
+ # the variety of path names and library locations.
+ # Build up some possibilities, then transform them into candidates
+ temp = []
if script_dir == 'bin':
# script_dir is `pwd`/bin;
# check `pwd`/lib/scons*.
- prefs.append(os.getcwd())
+ temp.append(os.getcwd())
else:
if script_dir == '.' or script_dir == '':
script_dir = os.getcwd()
@@ -126,42 +132,41 @@ else:
if tail == "bin":
# script_dir is /foo/bin;
# check /foo/lib/scons*.
- prefs.append(head)
+ temp.append(head)
head, tail = os.path.split(sys.prefix)
if tail == "usr":
# sys.prefix is /foo/usr;
# check /foo/usr/lib/scons* first,
# then /foo/usr/local/lib/scons*.
- prefs.append(sys.prefix)
- prefs.append(os.path.join(sys.prefix, "local"))
+ temp.append(sys.prefix)
+ temp.append(os.path.join(sys.prefix, "local"))
elif tail == "local":
h, t = os.path.split(head)
if t == "usr":
# sys.prefix is /foo/usr/local;
# check /foo/usr/local/lib/scons* first,
# then /foo/usr/lib/scons*.
- prefs.append(sys.prefix)
- prefs.append(head)
+ temp.append(sys.prefix)
+ temp.append(head)
else:
# sys.prefix is /foo/local;
# check only /foo/local/lib/scons*.
- prefs.append(sys.prefix)
+ temp.append(sys.prefix)
else:
# sys.prefix is /foo (ends in neither /usr or /local);
# check only /foo/lib/scons*.
- prefs.append(sys.prefix)
+ temp.append(sys.prefix)
+
+ # suffix these to add to our original prefs:
+ prefs.extend([os.path.join(x, 'lib') for x in temp])
+ prefs.extend([os.path.join(x, 'lib', 'python' + sys.version[:3],
+ 'site-packages') for x in temp])
- temp = [os.path.join(x, 'lib') for x in prefs]
- temp.extend([os.path.join(x,
- 'lib',
- 'python' + sys.version[:3],
- 'site-packages') for x in prefs])
- prefs = temp
# Add the parent directory of the current python's library to the
- # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64,
- # not /usr/lib.
+ # preferences. This picks up differences between, e.g., lib and lib64,
+ # and finds the base location in case of a non-copying virtualenv.
try:
libpath = os.__file__
except AttributeError:
@@ -175,9 +180,9 @@ else:
prefs.append(libpath)
# Look first for 'scons-__version__' in all of our preference libs,
-# then for 'scons'.
-libs.extend([os.path.join(x, scons_version) for x in prefs])
-libs.extend([os.path.join(x, 'scons') for x in prefs])
+# then for 'scons'. Skip paths that do not exist.
+libs.extend([os.path.join(x, scons_version) for x in prefs if os.path.isdir(x)])
+libs.extend([os.path.join(x, 'scons') for x in prefs if os.path.isdir(x)])
sys.path = libs + sys.path
@@ -189,9 +194,9 @@ if __name__ == "__main__":
try:
import SCons.Script
except ImportError:
- print("SCons import failed. Unable to find engine files in:")
+ sys.stderr.write("SCons import failed. Unable to find engine files in:\n")
for path in libs:
- print(" %s" % path)
+ sys.stderr.write(" {}\n".format(path))
raise
# this does all the work, and calls sys.exit
diff --git a/src/third_party/scons-2.5.0/sconsign.py b/src/third_party/scons-3.0.4/sconsign.py
index 38a217a54f8..5a714384689 100755..100644
--- a/src/third_party/scons-2.5.0/sconsign.py
+++ b/src/third_party/scons-3.0.4/sconsign.py
@@ -2,7 +2,7 @@
#
# SCons - a Software Constructor
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -23,17 +23,19 @@
# 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__ = "src/script/sconsign.py rel_2.5.0:3544:95d356f188a3 2016/04/09 14:38:50 bdbaddog"
+from __future__ import print_function
-__version__ = "2.5.0"
+__revision__ = "src/script/sconsign.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-20 22:51:36 bdeegan"
-__build__ = "rel_2.5.0:3544:95d356f188a3[MODIFIED]"
+__version__ = "3.0.4"
-__buildsys__ = "ubuntu1404-32bit"
+__build__ = "3a41ed6b288cee8d085373ad7fa02894e1903864"
-__date__ = "2016/04/09 14:38:50"
+__buildsys__ = "kufra"
-__developer__ = "bdbaddog"
+__date__ = "2019-01-20 22:51:36"
+
+__developer__ = "bdeegan"
import os
import sys
@@ -47,55 +49,53 @@ import sys
# should also change other scripts that use this same header.
##############################################################################
-# Strip the script directory from sys.path() so on case-insensitive
-# (WIN32) systems Python doesn't think that the "scons" script is the
-# "SCons" package. Replace it with our own library directories
-# (version-specific first, in case they installed by hand there,
-# followed by generic) so we pick up the right version of the build
-# engine modules if they're in either directory.
-
-
-if sys.version_info >= (3,0,0):
- msg = "sconsign: *** Version %s does not run under Python version %s.\n\
-Python 3 is not yet supported.\n"
+# compatibility check
+if (3,0,0) < sys.version_info < (3,5,0) or sys.version_info < (2,7,0):
+ msg = "scons: *** SCons version %s does not run under Python version %s.\n\
+Python 2.7 or >= 3.5 is required.\n"
sys.stderr.write(msg % (__version__, sys.version.split()[0]))
sys.exit(1)
-
-script_dir = sys.path[0]
-
-if script_dir in sys.path:
- sys.path.remove(script_dir)
+# Strip the script directory from sys.path so on case-insensitive
+# (WIN32) systems Python doesn't think that the "scons" script is the
+# "SCons" package.
+script_dir = os.path.dirname(__file__)
+script_path = os.path.realpath(os.path.dirname(__file__))
+if script_path in sys.path:
+ sys.path.remove(script_path)
libs = []
if "SCONS_LIB_DIR" in os.environ:
libs.append(os.environ["SCONS_LIB_DIR"])
-# - running from source takes priority (since 2.3.2), excluding SCONS_LIB_DIR settings
-script_path = os.path.abspath(os.path.dirname(__file__))
-source_path = os.path.join(script_path, '..', 'engine')
-libs.append(source_path)
+# running from source takes 2nd priority (since 2.3.2), following SCONS_LIB_DIR
+source_path = os.path.join(script_path, os.pardir, 'engine')
+if os.path.isdir(source_path):
+ libs.append(source_path)
+# add local-install locations
local_version = 'scons-local-' + __version__
local = 'scons-local'
if script_dir:
local_version = os.path.join(script_dir, local_version)
local = os.path.join(script_dir, local)
-libs.append(os.path.abspath(local_version))
-libs.append(os.path.abspath(local))
+if os.path.isdir(local_version):
+ libs.append(os.path.abspath(local_version))
+if os.path.isdir(local):
+ libs.append(os.path.abspath(local))
scons_version = 'scons-%s' % __version__
# preferred order of scons lookup paths
prefs = []
+# if we can find package information, use it
try:
import pkg_resources
except ImportError:
pass
else:
- # when running from an egg add the egg's directory
try:
d = pkg_resources.get_distribution('scons')
except pkg_resources.DistributionNotFound:
@@ -104,18 +104,18 @@ else:
prefs.append(d.location)
if sys.platform == 'win32':
- # sys.prefix is (likely) C:\Python*;
- # check only C:\Python*.
+ # Use only sys.prefix on Windows
prefs.append(sys.prefix)
prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages'))
else:
# On other (POSIX) platforms, things are more complicated due to
- # the variety of path names and library locations. Try to be smart
- # about it.
+ # the variety of path names and library locations.
+ # Build up some possibilities, then transform them into candidates
+ temp = []
if script_dir == 'bin':
# script_dir is `pwd`/bin;
# check `pwd`/lib/scons*.
- prefs.append(os.getcwd())
+ temp.append(os.getcwd())
else:
if script_dir == '.' or script_dir == '':
script_dir = os.getcwd()
@@ -123,58 +123,57 @@ else:
if tail == "bin":
# script_dir is /foo/bin;
# check /foo/lib/scons*.
- prefs.append(head)
+ temp.append(head)
head, tail = os.path.split(sys.prefix)
if tail == "usr":
# sys.prefix is /foo/usr;
# check /foo/usr/lib/scons* first,
# then /foo/usr/local/lib/scons*.
- prefs.append(sys.prefix)
- prefs.append(os.path.join(sys.prefix, "local"))
+ temp.append(sys.prefix)
+ temp.append(os.path.join(sys.prefix, "local"))
elif tail == "local":
h, t = os.path.split(head)
if t == "usr":
# sys.prefix is /foo/usr/local;
# check /foo/usr/local/lib/scons* first,
# then /foo/usr/lib/scons*.
- prefs.append(sys.prefix)
- prefs.append(head)
+ temp.append(sys.prefix)
+ temp.append(head)
else:
# sys.prefix is /foo/local;
# check only /foo/local/lib/scons*.
- prefs.append(sys.prefix)
+ temp.append(sys.prefix)
else:
# sys.prefix is /foo (ends in neither /usr or /local);
# check only /foo/lib/scons*.
- prefs.append(sys.prefix)
+ temp.append(sys.prefix)
+
+ # suffix these to add to our original prefs:
+ prefs.extend([os.path.join(x, 'lib') for x in temp])
+ prefs.extend([os.path.join(x, 'lib', 'python' + sys.version[:3],
+ 'site-packages') for x in temp])
- temp = [os.path.join(x, 'lib') for x in prefs]
- temp.extend([os.path.join(x,
- 'lib',
- 'python' + sys.version[:3],
- 'site-packages') for x in prefs])
- prefs = temp
# Add the parent directory of the current python's library to the
- # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64,
- # not /usr/lib.
+ # preferences. This picks up differences between, e.g., lib and lib64,
+ # and finds the base location in case of a non-copying virtualenv.
try:
libpath = os.__file__
except AttributeError:
pass
else:
# Split /usr/libfoo/python*/os.py to /usr/libfoo/python*.
- libpath, tail = os.path.split(libpath)
+ libpath, _ = os.path.split(libpath)
# Split /usr/libfoo/python* to /usr/libfoo
libpath, tail = os.path.split(libpath)
# Check /usr/libfoo/scons*.
prefs.append(libpath)
# Look first for 'scons-__version__' in all of our preference libs,
-# then for 'scons'.
-libs.extend([os.path.join(x, scons_version) for x in prefs])
-libs.extend([os.path.join(x, 'scons') for x in prefs])
+# then for 'scons'. Skip paths that do not exist.
+libs.extend([os.path.join(x, scons_version) for x in prefs if os.path.isdir(x)])
+libs.extend([os.path.join(x, 'scons') for x in prefs if os.path.isdir(x)])
sys.path = libs + sys.path
@@ -182,15 +181,21 @@ sys.path = libs + sys.path
# END STANDARD SCons SCRIPT HEADER
##############################################################################
-import SCons.compat # so pickle will import cPickle instead
+import SCons.compat
+
+try:
+ import whichdb
+ whichdb = whichdb.whichdb
+except ImportError as e:
+ from dbm import whichdb
-import whichdb
import time
import pickle
import imp
import SCons.SConsign
+
def my_whichdb(filename):
if filename[-7:] == ".dblite":
return "SCons.dblite"
@@ -202,8 +207,14 @@ def my_whichdb(filename):
pass
return _orig_whichdb(filename)
-_orig_whichdb = whichdb.whichdb
-whichdb.whichdb = my_whichdb
+
+# Should work on python2
+_orig_whichdb = whichdb
+whichdb = my_whichdb
+
+# was changed for python3
+#_orig_whichdb = whichdb.whichdb
+#dbm.whichdb = my_whichdb
def my_import(mname):
if '.' in mname:
@@ -215,29 +226,62 @@ def my_import(mname):
fp, pathname, description = imp.find_module(mname)
return imp.load_module(mname, fp, pathname, description)
+
class Flagger(object):
default_value = 1
+
def __setitem__(self, item, value):
self.__dict__[item] = value
self.default_value = 0
+
def __getitem__(self, item):
return self.__dict__.get(item, self.default_value)
+
Do_Call = None
Print_Directories = []
Print_Entries = []
Print_Flags = Flagger()
Verbose = 0
Readable = 0
+Warns = 0
+
+
def default_mapper(entry, name):
+ '''
+ Stringify an entry that doesn't have an explicit mapping.
+
+ Args:
+ entry: entry
+ name: field name
+
+ Returns: str
+
+ '''
try:
- val = eval("entry."+name)
+ val = eval("entry." + name)
except:
val = None
+ if sys.version_info.major >= 3 and isinstance(val, bytes):
+ # This is a dirty hack for py 2/3 compatibility. csig is a bytes object
+ # in Python3 while Python2 bytes are str. Hence, we decode the csig to a
+ # Python3 string
+ val = val.decode()
return str(val)
-def map_action(entry, name):
+
+def map_action(entry, _):
+ '''
+ Stringify an action entry and signature.
+
+ Args:
+ entry: action entry
+ second argument is not used
+
+ Returns: str
+
+ '''
try:
bact = entry.bact
bactsig = entry.bactsig
@@ -245,7 +289,17 @@ def map_action(entry, name):
return None
return '%s [%s]' % (bactsig, bact)
-def map_timestamp(entry, name):
+def map_timestamp(entry, _):
+ '''
+ Stringify a timestamp entry.
+
+ Args:
+ entry: timestamp entry
+ second argument is not used
+
+ Returns: str
+
+ '''
try:
timestamp = entry.timestamp
except AttributeError:
@@ -255,19 +309,38 @@ def map_timestamp(entry, name):
else:
return str(timestamp)
-def map_bkids(entry, name):
+def map_bkids(entry, _):
+ '''
+ Stringify an implicit entry.
+
+ Args:
+ entry:
+ second argument is not used
+
+ Returns: str
+
+ '''
try:
bkids = entry.bsources + entry.bdepends + entry.bimplicit
bkidsigs = entry.bsourcesigs + entry.bdependsigs + entry.bimplicitsigs
except AttributeError:
return None
- result = []
- for i in range(len(bkids)):
- result.append(nodeinfo_string(bkids[i], bkidsigs[i], " "))
- if result == []:
+
+ if len(bkids) != len(bkidsigs):
+ global Warns
+ Warns += 1
+ # add warning to result rather than direct print so it will line up
+ msg = "Warning: missing information, {} ids but {} sigs"
+ result = [msg.format(len(bkids), len(bkidsigs))]
+ else:
+ result = []
+ result += [nodeinfo_string(bkid, bkidsig, " ")
+ for bkid, bkidsig in zip(bkids, bkidsigs)]
+ if not result:
return None
return "\n ".join(result)
+
map_field = {
'action' : map_action,
'timestamp' : map_timestamp,
@@ -278,6 +351,7 @@ map_name = {
'implicit' : 'bkids',
}
+
def field(name, entry, verbose=Verbose):
if not Print_Flags[name]:
return None
@@ -288,6 +362,7 @@ def field(name, entry, verbose=Verbose):
val = name + ": " + val
return val
+
def nodeinfo_raw(name, ninfo, prefix=""):
# This just formats the dictionary, which we would normally use str()
# to do, except that we want the keys sorted for deterministic output.
@@ -303,6 +378,7 @@ def nodeinfo_raw(name, ninfo, prefix=""):
name = repr(name)
return name + ': {' + ', '.join(l) + '}'
+
def nodeinfo_cooked(name, ninfo, prefix=""):
try:
field_list = ninfo.field_list
@@ -310,27 +386,32 @@ def nodeinfo_cooked(name, ninfo, prefix=""):
field_list = []
if '\n' in name:
name = repr(name)
- outlist = [name+':'] + [_f for _f in [field(x, ninfo, Verbose) for x in field_list] if _f]
+ outlist = [name + ':'] + [
+ f for f in [field(x, ninfo, Verbose) for x in field_list] if f
+ ]
if Verbose:
sep = '\n ' + prefix
else:
sep = ' '
return sep.join(outlist)
+
nodeinfo_string = nodeinfo_cooked
+
def printfield(name, entry, prefix=""):
outlist = field("implicit", entry, 0)
if outlist:
if Verbose:
- print " implicit:"
- print " " + outlist
+ print(" implicit:")
+ print(" " + outlist)
outact = field("action", entry, 0)
if outact:
if Verbose:
- print " action: " + outact
+ print(" action: " + outact)
else:
- print " " + outact
+ print(" " + outact)
+
def printentries(entries, location):
if Print_Entries:
@@ -338,14 +419,15 @@ def printentries(entries, location):
try:
entry = entries[name]
except KeyError:
- sys.stderr.write("sconsign: no entry `%s' in `%s'\n" % (name, location))
+ err = "sconsign: no entry `%s' in `%s'\n" % (name, location)
+ sys.stderr.write(err)
else:
try:
ninfo = entry.ninfo
except AttributeError:
- print name + ":"
+ print(name + ":")
else:
- print nodeinfo_string(name, entry.ninfo)
+ print(nodeinfo_string(name, entry.ninfo))
printfield(name, entry.binfo)
else:
for name in sorted(entries.keys()):
@@ -353,11 +435,12 @@ def printentries(entries, location):
try:
ninfo = entry.ninfo
except AttributeError:
- print name + ":"
+ print(name + ":")
else:
- print nodeinfo_string(name, entry.ninfo)
+ print(nodeinfo_string(name, entry.ninfo))
printfield(name, entry.binfo)
+
class Do_SConsignDB(object):
def __init__(self, dbm_name, dbm):
self.dbm_name = dbm_name
@@ -374,7 +457,7 @@ class Do_SConsignDB(object):
# .sconsign => .sconsign.dblite
# .sconsign.dblite => .sconsign.dblite.dblite
db = self.dbm.open(fname, "r")
- except (IOError, OSError), e:
+ except (IOError, OSError) as e:
print_e = e
try:
# That didn't work, so try opening the base name,
@@ -388,19 +471,21 @@ class Do_SConsignDB(object):
# suffix-mangling).
try:
open(fname, "r")
- except (IOError, OSError), e:
+ except (IOError, OSError) as e:
# Nope, that file doesn't even exist, so report that
# fact back.
print_e = e
- sys.stderr.write("sconsign: %s\n" % (print_e))
+ sys.stderr.write("sconsign: %s\n" % print_e)
return
except KeyboardInterrupt:
raise
except pickle.UnpicklingError:
- sys.stderr.write("sconsign: ignoring invalid `%s' file `%s'\n" % (self.dbm_name, fname))
+ sys.stderr.write("sconsign: ignoring invalid `%s' file `%s'\n"
+ % (self.dbm_name, fname))
return
- except Exception, e:
- sys.stderr.write("sconsign: ignoring invalid `%s' file `%s': %s\n" % (self.dbm_name, fname, e))
+ except Exception as e:
+ sys.stderr.write("sconsign: ignoring invalid `%s' file `%s': %s\n"
+ % (self.dbm_name, fname, e))
return
if Print_Directories:
@@ -408,35 +493,44 @@ class Do_SConsignDB(object):
try:
val = db[dir]
except KeyError:
- sys.stderr.write("sconsign: no dir `%s' in `%s'\n" % (dir, args[0]))
+ err = "sconsign: no dir `%s' in `%s'\n" % (dir, args[0])
+ sys.stderr.write(err)
else:
self.printentries(dir, val)
else:
for dir in sorted(db.keys()):
self.printentries(dir, db[dir])
- def printentries(self, dir, val):
- print '=== ' + dir + ':'
+ @staticmethod
+ def printentries(dir, val):
+ try:
+ print('=== ' + dir + ':')
+ except TypeError:
+ print('=== ' + dir.decode() + ':')
printentries(pickle.loads(val), dir)
+
def Do_SConsignDir(name):
try:
fp = open(name, 'rb')
- except (IOError, OSError), e:
- sys.stderr.write("sconsign: %s\n" % (e))
+ except (IOError, OSError) as e:
+ sys.stderr.write("sconsign: %s\n" % e)
return
try:
sconsign = SCons.SConsign.Dir(fp)
except KeyboardInterrupt:
raise
except pickle.UnpicklingError:
- sys.stderr.write("sconsign: ignoring invalid .sconsign file `%s'\n" % (name))
+ err = "sconsign: ignoring invalid .sconsign file `%s'\n" % (name)
+ sys.stderr.write(err)
return
- except Exception, e:
- sys.stderr.write("sconsign: ignoring invalid .sconsign file `%s': %s\n" % (name, e))
+ except Exception as e:
+ err = "sconsign: ignoring invalid .sconsign file `%s': %s\n" % (name, e)
+ sys.stderr.write(err)
return
printentries(sconsign.entries, args[0])
+
##############################################################################
import getopt
@@ -478,8 +572,7 @@ for o, a in opts:
elif o in ('-f', '--format'):
# Try to map the given DB format to a known module
# name, that we can then try to import...
- Module_Map = {'dblite' : 'SCons.dblite',
- 'sconsign' : None}
+ Module_Map = {'dblite': 'SCons.dblite', 'sconsign': None}
dbm_name = Module_Map.get(a, a)
if dbm_name:
try:
@@ -487,6 +580,7 @@ for o, a in opts:
dbm = my_import(dbm_name)
else:
import SCons.dblite
+
dbm = SCons.dblite
# Ensure that we don't ignore corrupt DB files,
# this was handled by calling my_import('SCons.dblite')
@@ -494,13 +588,13 @@ for o, a in opts:
SCons.dblite.ignore_corrupt_dbfiles = 0
except:
sys.stderr.write("sconsign: illegal file format `%s'\n" % a)
- print helpstr
+ print(helpstr)
sys.exit(2)
Do_Call = Do_SConsignDB(a, dbm)
else:
Do_Call = Do_SConsignDir
elif o in ('-h', '--help'):
- print helpstr
+ print(helpstr)
sys.exit(0)
elif o in ('-i', '--implicit'):
Print_Flags['implicit'] = 1
@@ -520,13 +614,14 @@ if Do_Call:
Do_Call(a)
else:
for a in args:
- dbm_name = whichdb.whichdb(a)
+ dbm_name = whichdb(a)
if dbm_name:
- Map_Module = {'SCons.dblite' : 'dblite'}
+ Map_Module = {'SCons.dblite': 'dblite'}
if dbm_name != "SCons.dblite":
dbm = my_import(dbm_name)
else:
import SCons.dblite
+
dbm = SCons.dblite
# Ensure that we don't ignore corrupt DB files,
# this was handled by calling my_import('SCons.dblite')
@@ -536,6 +631,8 @@ else:
else:
Do_SConsignDir(a)
+ if Warns:
+ print("NOTE: there were %d warnings, please check output" % Warns)
sys.exit(0)
# Local Variables: