summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--LICENSE2
-rw-r--r--QMTest/README.txt4
-rw-r--r--QMTest/SConscript6
-rw-r--r--QMTest/TestCmd.py481
-rw-r--r--QMTest/TestCmdTests.py266
-rw-r--r--QMTest/TestCommon.py84
-rw-r--r--QMTest/TestCommonTests.py13
-rw-r--r--QMTest/TestRuntest.py4
-rw-r--r--QMTest/TestSCons.py363
-rw-r--r--QMTest/TestSConsMSVS.py26
-rw-r--r--QMTest/TestSCons_time.py21
-rw-r--r--QMTest/TestSConsign.py7
-rw-r--r--QMTest/scons_tdb.py20
-rw-r--r--README.rst44
-rw-r--r--SConstruct208
-rw-r--r--bin/Command.py7
-rw-r--r--bin/SConsDoc.py45
-rw-r--r--bin/SConsExamples.py164
-rw-r--r--bin/calibrate.py8
-rw-r--r--bin/caller-tree.py11
-rw-r--r--bin/docs-create-example-outputs.py9
-rw-r--r--bin/docs-update-generated.py3
-rw-r--r--bin/docs-validate.py9
-rw-r--r--bin/import-test.py4
-rw-r--r--bin/install_python.py7
-rw-r--r--bin/install_scons.py12
-rw-r--r--bin/linecount.py34
-rw-r--r--bin/memlogs.py10
-rw-r--r--bin/memoicmp.py30
-rw-r--r--bin/objcounts.py14
-rw-r--r--bin/restore.sh28
-rw-r--r--bin/scons-diff.py15
-rw-r--r--bin/scons-proc.py25
-rw-r--r--bin/scons-test.py65
-rw-r--r--bin/scons-unzip.py3
-rw-r--r--bin/scons_dev_master.py26
-rw-r--r--bin/sfsum11
-rwxr-xr-xbin/svn-bisect.py14
-rw-r--r--bin/update-release-info.py35
-rwxr-xr-xbin/xmlagenda.py3
-rwxr-xr-xbootstrap.py14
-rw-r--r--doc/SConscript109
-rw-r--r--doc/design/SConstruct2
-rw-r--r--doc/design/acks.xml2
-rw-r--r--doc/design/bground.xml2
-rw-r--r--doc/design/chtml.xsl2
-rw-r--r--doc/design/copyright.xml2
-rw-r--r--doc/design/engine.xml2
-rw-r--r--doc/design/goals.xml2
-rw-r--r--doc/design/html.xsl2
-rw-r--r--doc/design/install.xml2
-rw-r--r--doc/design/intro.xml2
-rw-r--r--doc/design/issues.xml2
-rw-r--r--doc/design/main.xml2
-rw-r--r--doc/design/native.xml2
-rw-r--r--doc/design/overview.xml2
-rw-r--r--doc/design/pdf.xsl2
-rw-r--r--doc/design/scons_title.xsl2
-rw-r--r--doc/design/summary.xml2
-rw-r--r--doc/developer/SConstruct2
-rw-r--r--doc/developer/architecture.xml2
-rw-r--r--doc/developer/branches.xml2
-rw-r--r--doc/developer/copyright.xml2
-rw-r--r--doc/developer/cycle.xml2
-rw-r--r--doc/developer/main.xml2
-rw-r--r--doc/developer/packaging.xml2
-rw-r--r--doc/developer/preface.xml2
-rw-r--r--doc/developer/sourcetree.xml2
-rw-r--r--doc/developer/testing.xml2
-rw-r--r--doc/generated/builders.gen87
-rw-r--r--doc/generated/builders.mod4
-rw-r--r--doc/generated/examples/caching_ex-random_1.xml6
-rw-r--r--doc/generated/examples/environments_ex3_1.xml22
-rw-r--r--doc/generated/examples/environments_missing2_1.xml2
-rw-r--r--doc/generated/examples/java_jar1_1.xml2
-rw-r--r--doc/generated/examples/mergeflags_MergeFlags1_1.xml9
-rw-r--r--doc/generated/examples/mergeflags_MergeFlags2_1.xml9
-rw-r--r--doc/generated/examples/mergeflags_MergeFlags3_1.xml10
-rw-r--r--doc/generated/examples/misc_Flatten2_1.xml2
-rw-r--r--doc/generated/examples/parseflags_ex1_1.xml12
-rw-r--r--doc/generated/examples/parseflags_ex1_2.xml13
-rw-r--r--doc/generated/examples/parseflags_ex2_1.xml10
-rw-r--r--doc/generated/examples/parseflags_ex3_1.xml12
-rw-r--r--doc/generated/examples/parseflags_ex4_1.xml12
-rw-r--r--doc/generated/examples/sourcecode_bitkeeper_1.xml6
-rw-r--r--doc/generated/examples/sourcecode_cvs_1.xml6
-rw-r--r--doc/generated/examples/sourcecode_rcs_1.xml6
-rw-r--r--doc/generated/examples/sourcecode_sccs_1.xml6
-rw-r--r--doc/generated/examples/tasks_ex1_1.xml2
-rw-r--r--doc/generated/examples/troubleshoot_Dump_1.xml78
-rw-r--r--doc/generated/examples/troubleshoot_Dump_2.xml110
-rw-r--r--doc/generated/examples/troubleshoot_Dump_ENV_1.xml12
-rw-r--r--doc/generated/examples/troubleshoot_Dump_ENV_2.xml14
-rw-r--r--doc/generated/examples/troubleshoot_explain1_3.xml2
-rw-r--r--doc/generated/examples/troubleshoot_stacktrace_2.xml6
-rw-r--r--doc/generated/functions.gen251
-rw-r--r--doc/generated/functions.mod24
-rw-r--r--doc/generated/tools.gen79
-rw-r--r--doc/generated/tools.mod18
-rw-r--r--doc/generated/variables.gen805
-rw-r--r--doc/generated/variables.mod78
-rw-r--r--doc/man/SConstruct2
-rw-r--r--doc/man/epub.xsl2
-rw-r--r--doc/man/html.xsl2
-rw-r--r--doc/man/pdf.xsl2
-rw-r--r--doc/man/scons-time.xml6
-rw-r--r--doc/man/scons.xml58
-rw-r--r--doc/man/scons_title.xsl2
-rw-r--r--doc/man/sconsign.xml6
-rw-r--r--doc/python10/SConstruct2
-rw-r--r--doc/python10/abstract.xml2
-rw-r--r--doc/python10/acks.xml2
-rw-r--r--doc/python10/copyright.xml2
-rw-r--r--doc/python10/design.xml2
-rw-r--r--doc/python10/future.xml2
-rw-r--r--doc/python10/install.xml2
-rw-r--r--doc/python10/intro.xml2
-rw-r--r--doc/python10/main.xml2
-rw-r--r--doc/python10/process.xml2
-rw-r--r--doc/python10/summary.xml2
-rw-r--r--doc/reference/Alias.xml2
-rw-r--r--doc/reference/CFile.xml2
-rw-r--r--doc/reference/CXXFile.xml2
-rw-r--r--doc/reference/Command.xml2
-rw-r--r--doc/reference/Install.xml2
-rw-r--r--doc/reference/InstallAs.xml2
-rw-r--r--doc/reference/Library.xml2
-rw-r--r--doc/reference/Object.xml2
-rw-r--r--doc/reference/PCH.xml2
-rw-r--r--doc/reference/PDF.xml2
-rw-r--r--doc/reference/PostScript.xml2
-rw-r--r--doc/reference/Program.xml2
-rw-r--r--doc/reference/RES.xml2
-rw-r--r--doc/reference/SConstruct2
-rw-r--r--doc/reference/SharedLibrary.xml2
-rw-r--r--doc/reference/SharedObject.xml2
-rw-r--r--doc/reference/StaticLibrary.xml2
-rw-r--r--doc/reference/StaticObject.xml2
-rw-r--r--doc/reference/chtml.xsl2
-rw-r--r--doc/reference/copyright.xml2
-rw-r--r--doc/reference/errors.xml2
-rw-r--r--doc/reference/html.xsl2
-rw-r--r--doc/reference/main.xml2
-rw-r--r--doc/reference/pdf.xsl2
-rw-r--r--doc/reference/preface.xml2
-rw-r--r--doc/reference/scons_title.xsl2
-rw-r--r--doc/scons.mod3
-rw-r--r--doc/user/README2
-rw-r--r--doc/user/SConstruct2
-rw-r--r--doc/user/actions.xml2
-rw-r--r--doc/user/add-method.xml2
-rw-r--r--doc/user/alias.xml2
-rw-r--r--doc/user/ant.xml2
-rw-r--r--doc/user/build-install.xml4
-rw-r--r--doc/user/builders-built-in.xml2
-rw-r--r--doc/user/builders-commands.xml2
-rw-r--r--doc/user/builders-writing.xml6
-rw-r--r--doc/user/builders.xml2
-rw-r--r--doc/user/caching.xml2
-rw-r--r--doc/user/chtml.xsl2
-rw-r--r--doc/user/command-line.xml16
-rw-r--r--doc/user/copyright.xml2
-rw-r--r--doc/user/depends.xml2
-rw-r--r--doc/user/environments.xml201
-rw-r--r--doc/user/epub.xsl2
-rw-r--r--doc/user/errors.xml2
-rw-r--r--doc/user/example.xml2
-rw-r--r--doc/user/factories.xml2
-rw-r--r--doc/user/file-removal.xml2
-rw-r--r--doc/user/functions.xml2
-rw-r--r--doc/user/gettext.xml2
-rw-r--r--doc/user/hierarchy.xml2
-rw-r--r--doc/user/html.xsl2
-rw-r--r--doc/user/install.xml2
-rw-r--r--doc/user/java.xml2
-rw-r--r--doc/user/less-simple.xml2
-rw-r--r--doc/user/libraries.xml2
-rw-r--r--doc/user/main.xml6
-rw-r--r--doc/user/make.xml2
-rw-r--r--doc/user/mergeflags.xml2
-rw-r--r--doc/user/misc.xml32
-rw-r--r--doc/user/nodes.xml14
-rw-r--r--doc/user/output.xml10
-rw-r--r--doc/user/parseconfig.xml2
-rw-r--r--doc/user/parseflags.xml2
-rw-r--r--doc/user/pdf.xsl2
-rw-r--r--doc/user/preface.xml2
-rw-r--r--doc/user/python.xml2
-rw-r--r--doc/user/repositories.xml2
-rw-r--r--doc/user/run.xml2
-rw-r--r--doc/user/scanners.xml2
-rw-r--r--doc/user/sconf.xml12
-rw-r--r--doc/user/scons_title.xsl2
-rw-r--r--doc/user/separate.xml2
-rw-r--r--doc/user/sideeffect.xml2
-rw-r--r--doc/user/simple.xml8
-rw-r--r--doc/user/sourcecode.xml2
-rw-r--r--doc/user/tasks.xml2
-rw-r--r--doc/user/tools.xml2
-rw-r--r--doc/user/troubleshoot.xml2
-rw-r--r--doc/user/variables.xml2
-rw-r--r--doc/user/variants.xml2
-rw-r--r--shippable.yml7
-rw-r--r--src/Announce.txt44
-rw-r--r--src/CHANGES.txt168
-rw-r--r--src/LICENSE.txt2
-rw-r--r--src/README.txt14
-rw-r--r--src/RELEASE.txt35
-rw-r--r--src/engine/MANIFEST-xml.in1
-rw-r--r--src/engine/MANIFEST.in20
-rw-r--r--src/engine/SCons/Action.py378
-rw-r--r--src/engine/SCons/Action.xml2
-rw-r--r--src/engine/SCons/ActionTests.py280
-rw-r--r--src/engine/SCons/Builder.py49
-rw-r--r--src/engine/SCons/BuilderTests.py47
-rw-r--r--src/engine/SCons/CacheDir.py4
-rw-r--r--src/engine/SCons/CacheDirTests.py8
-rw-r--r--src/engine/SCons/Conftest.py45
-rw-r--r--src/engine/SCons/Debug.py8
-rw-r--r--src/engine/SCons/Defaults.py23
-rw-r--r--src/engine/SCons/Defaults.xml2
-rw-r--r--src/engine/SCons/DefaultsTests.py6
-rw-r--r--src/engine/SCons/Environment.py80
-rw-r--r--src/engine/SCons/Environment.xml31
-rw-r--r--src/engine/SCons/EnvironmentTests.py74
-rw-r--r--src/engine/SCons/EnvironmentValues.py97
-rw-r--r--src/engine/SCons/EnvironmentValuesTest.py16
-rw-r--r--src/engine/SCons/Errors.py128
-rw-r--r--src/engine/SCons/ErrorsTests.py16
-rw-r--r--src/engine/SCons/Executor.py25
-rw-r--r--src/engine/SCons/ExecutorTests.py41
-rw-r--r--src/engine/SCons/Job.py8
-rw-r--r--src/engine/SCons/JobTests.py4
-rw-r--r--src/engine/SCons/Memoize.py20
-rw-r--r--src/engine/SCons/MemoizeTests.py5
-rw-r--r--src/engine/SCons/Node/Alias.py4
-rw-r--r--src/engine/SCons/Node/AliasTests.py4
-rw-r--r--src/engine/SCons/Node/FS.py321
-rw-r--r--src/engine/SCons/Node/FSTests.py113
-rw-r--r--src/engine/SCons/Node/NodeTests.py4
-rw-r--r--src/engine/SCons/Node/Python.py21
-rw-r--r--src/engine/SCons/Node/PythonTests.py10
-rw-r--r--src/engine/SCons/Node/__init__.py118
-rw-r--r--src/engine/SCons/Options/BoolOption.py4
-rw-r--r--src/engine/SCons/Options/EnumOption.py4
-rw-r--r--src/engine/SCons/Options/ListOption.py4
-rw-r--r--src/engine/SCons/Options/PackageOption.py4
-rw-r--r--src/engine/SCons/Options/PathOption.py4
-rw-r--r--src/engine/SCons/Options/__init__.py14
-rw-r--r--src/engine/SCons/PathList.py8
-rw-r--r--src/engine/SCons/PathListTests.py4
-rw-r--r--src/engine/SCons/Platform/PlatformTests.py4
-rw-r--r--src/engine/SCons/Platform/__init__.py25
-rw-r--r--src/engine/SCons/Platform/__init__.xml2
-rw-r--r--src/engine/SCons/Platform/aix.py6
-rw-r--r--src/engine/SCons/Platform/cygwin.py6
-rw-r--r--src/engine/SCons/Platform/darwin.py10
-rw-r--r--src/engine/SCons/Platform/hpux.py6
-rw-r--r--src/engine/SCons/Platform/irix.py6
-rw-r--r--src/engine/SCons/Platform/os2.py6
-rw-r--r--src/engine/SCons/Platform/posix.py6
-rw-r--r--src/engine/SCons/Platform/posix.xml2
-rw-r--r--src/engine/SCons/Platform/sunos.py6
-rw-r--r--src/engine/SCons/Platform/sunos.xml2
-rw-r--r--src/engine/SCons/Platform/win32.py113
-rw-r--r--src/engine/SCons/Platform/win32.xml2
-rw-r--r--src/engine/SCons/SConf.py51
-rw-r--r--src/engine/SCons/SConfTests.py61
-rw-r--r--src/engine/SCons/SConsign.py39
-rw-r--r--src/engine/SCons/SConsignTests.py4
-rw-r--r--src/engine/SCons/Scanner/C.py11
-rw-r--r--src/engine/SCons/Scanner/CTests.py4
-rw-r--r--src/engine/SCons/Scanner/D.py20
-rw-r--r--src/engine/SCons/Scanner/DTests.py282
-rw-r--r--src/engine/SCons/Scanner/Dir.py6
-rw-r--r--src/engine/SCons/Scanner/DirTests.py4
-rw-r--r--src/engine/SCons/Scanner/Fortran.py4
-rw-r--r--src/engine/SCons/Scanner/FortranTests.py4
-rw-r--r--src/engine/SCons/Scanner/IDL.py4
-rw-r--r--src/engine/SCons/Scanner/IDLTests.py4
-rw-r--r--src/engine/SCons/Scanner/LaTeX.py129
-rw-r--r--src/engine/SCons/Scanner/LaTeXTests.py19
-rw-r--r--src/engine/SCons/Scanner/Prog.py4
-rw-r--r--src/engine/SCons/Scanner/ProgTests.py6
-rw-r--r--src/engine/SCons/Scanner/RC.py27
-rw-r--r--src/engine/SCons/Scanner/RCTests.py4
-rw-r--r--src/engine/SCons/Scanner/SWIG.py4
-rw-r--r--src/engine/SCons/Scanner/ScannerTests.py38
-rw-r--r--src/engine/SCons/Scanner/__init__.py42
-rw-r--r--src/engine/SCons/Scanner/__init__.xml2
-rw-r--r--src/engine/SCons/Script/Interactive.py36
-rw-r--r--src/engine/SCons/Script/Main.py91
-rw-r--r--src/engine/SCons/Script/Main.xml14
-rw-r--r--src/engine/SCons/Script/MainTests.py4
-rw-r--r--src/engine/SCons/Script/SConsOptions.py28
-rw-r--r--src/engine/SCons/Script/SConscript.py35
-rw-r--r--src/engine/SCons/Script/SConscript.xml2
-rw-r--r--src/engine/SCons/Script/SConscriptTests.py4
-rw-r--r--src/engine/SCons/Script/__init__.py23
-rw-r--r--src/engine/SCons/Sig.py63
-rw-r--r--src/engine/SCons/Subst.py39
-rw-r--r--src/engine/SCons/Subst.xml2
-rw-r--r--src/engine/SCons/SubstTests.py83
-rw-r--r--src/engine/SCons/Taskmaster.py96
-rw-r--r--src/engine/SCons/TaskmasterTests.py43
-rw-r--r--src/engine/SCons/Tool/386asm.py6
-rw-r--r--src/engine/SCons/Tool/386asm.xml2
-rw-r--r--src/engine/SCons/Tool/BitKeeper.xml123
-rw-r--r--src/engine/SCons/Tool/CVS.py72
-rw-r--r--src/engine/SCons/Tool/CVS.xml159
-rw-r--r--src/engine/SCons/Tool/DCommon.py17
-rw-r--r--src/engine/SCons/Tool/DCommon.xml71
-rw-r--r--src/engine/SCons/Tool/FortranCommon.py17
-rw-r--r--src/engine/SCons/Tool/GettextCommon.py654
-rw-r--r--src/engine/SCons/Tool/JavaCommon.py4
-rw-r--r--src/engine/SCons/Tool/JavaCommonTests.py4
-rw-r--r--src/engine/SCons/Tool/MSCommon/__init__.py7
-rw-r--r--src/engine/SCons/Tool/MSCommon/arch.py4
-rw-r--r--src/engine/SCons/Tool/MSCommon/common.py100
-rw-r--r--src/engine/SCons/Tool/MSCommon/netframework.py14
-rw-r--r--src/engine/SCons/Tool/MSCommon/sdk.py51
-rw-r--r--src/engine/SCons/Tool/MSCommon/vc.py162
-rw-r--r--src/engine/SCons/Tool/MSCommon/vs.py31
-rw-r--r--src/engine/SCons/Tool/Perforce.py99
-rw-r--r--src/engine/SCons/Tool/Perforce.xml129
-rw-r--r--src/engine/SCons/Tool/PharLapCommon.py4
-rw-r--r--src/engine/SCons/Tool/RCS.xml142
-rw-r--r--src/engine/SCons/Tool/SCCS.xml133
-rw-r--r--src/engine/SCons/Tool/Subversion.xml135
-rw-r--r--src/engine/SCons/Tool/ToolTests.py4
-rw-r--r--src/engine/SCons/Tool/__init__.py286
-rw-r--r--src/engine/SCons/Tool/__init__.xml2
-rw-r--r--src/engine/SCons/Tool/aixc++.py40
-rw-r--r--src/engine/SCons/Tool/aixc++.xml2
-rw-r--r--src/engine/SCons/Tool/aixcc.py6
-rw-r--r--src/engine/SCons/Tool/aixcc.xml2
-rw-r--r--src/engine/SCons/Tool/aixcxx.py (renamed from src/engine/SCons/Tool/BitKeeper.py)57
-rw-r--r--src/engine/SCons/Tool/aixf77.py6
-rw-r--r--src/engine/SCons/Tool/aixf77.xml2
-rw-r--r--src/engine/SCons/Tool/aixlink.py12
-rw-r--r--src/engine/SCons/Tool/aixlink.xml2
-rw-r--r--src/engine/SCons/Tool/applelink.py14
-rw-r--r--src/engine/SCons/Tool/applelink.xml2
-rw-r--r--src/engine/SCons/Tool/ar.py8
-rw-r--r--src/engine/SCons/Tool/ar.xml2
-rw-r--r--src/engine/SCons/Tool/as.py4
-rw-r--r--src/engine/SCons/Tool/as.xml2
-rw-r--r--src/engine/SCons/Tool/bcc32.py4
-rw-r--r--src/engine/SCons/Tool/bcc32.xml2
-rw-r--r--src/engine/SCons/Tool/c++.py64
-rw-r--r--src/engine/SCons/Tool/c++.xml2
-rw-r--r--src/engine/SCons/Tool/cc.py4
-rw-r--r--src/engine/SCons/Tool/cc.xml2
-rw-r--r--src/engine/SCons/Tool/clang.py83
-rw-r--r--src/engine/SCons/Tool/clang.xml39
-rw-r--r--src/engine/SCons/Tool/clangxx.py91
-rw-r--r--src/engine/SCons/Tool/clangxx.xml41
-rw-r--r--src/engine/SCons/Tool/cvf.py6
-rw-r--r--src/engine/SCons/Tool/cvf.xml2
-rw-r--r--src/engine/SCons/Tool/cxx.py100
-rw-r--r--src/engine/SCons/Tool/cyglink.py50
-rw-r--r--src/engine/SCons/Tool/cyglink.xml2
-rw-r--r--src/engine/SCons/Tool/default.py4
-rw-r--r--src/engine/SCons/Tool/default.xml2
-rw-r--r--src/engine/SCons/Tool/dmd.py48
-rw-r--r--src/engine/SCons/Tool/dmd.xml314
-rw-r--r--src/engine/SCons/Tool/docbook/__init__.py29
-rw-r--r--src/engine/SCons/Tool/docbook/__init__.xml2
-rw-r--r--src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py11
-rw-r--r--src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py13
-rw-r--r--src/engine/SCons/Tool/dvi.py4
-rw-r--r--src/engine/SCons/Tool/dvi.xml2
-rw-r--r--src/engine/SCons/Tool/dvipdf.py8
-rw-r--r--src/engine/SCons/Tool/dvipdf.xml2
-rw-r--r--src/engine/SCons/Tool/dvips.py4
-rw-r--r--src/engine/SCons/Tool/dvips.xml2
-rw-r--r--src/engine/SCons/Tool/f03.py6
-rw-r--r--src/engine/SCons/Tool/f03.xml2
-rw-r--r--src/engine/SCons/Tool/f08.py8
-rw-r--r--src/engine/SCons/Tool/f08.xml2
-rw-r--r--src/engine/SCons/Tool/f77.py4
-rw-r--r--src/engine/SCons/Tool/f77.xml2
-rw-r--r--src/engine/SCons/Tool/f90.py4
-rw-r--r--src/engine/SCons/Tool/f90.xml2
-rw-r--r--src/engine/SCons/Tool/f95.py6
-rw-r--r--src/engine/SCons/Tool/f95.xml2
-rw-r--r--src/engine/SCons/Tool/filesystem.py6
-rw-r--r--src/engine/SCons/Tool/fortran.py4
-rw-r--r--src/engine/SCons/Tool/fortran.xml2
-rw-r--r--src/engine/SCons/Tool/g++.py43
-rw-r--r--src/engine/SCons/Tool/g++.xml2
-rw-r--r--src/engine/SCons/Tool/g77.py4
-rw-r--r--src/engine/SCons/Tool/g77.xml2
-rw-r--r--src/engine/SCons/Tool/gas.py9
-rw-r--r--src/engine/SCons/Tool/gas.xml2
-rw-r--r--src/engine/SCons/Tool/gcc.py10
-rw-r--r--src/engine/SCons/Tool/gcc.xml2
-rw-r--r--src/engine/SCons/Tool/gdc.py34
-rw-r--r--src/engine/SCons/Tool/gdc.xml356
-rw-r--r--src/engine/SCons/Tool/gettext.xml2
-rw-r--r--src/engine/SCons/Tool/gettext_tool.py (renamed from src/engine/SCons/Tool/gettext.py)4
-rw-r--r--src/engine/SCons/Tool/gfortran.py6
-rw-r--r--src/engine/SCons/Tool/gfortran.xml2
-rw-r--r--src/engine/SCons/Tool/gnulink.py6
-rw-r--r--src/engine/SCons/Tool/gnulink.xml2
-rw-r--r--src/engine/SCons/Tool/gs.py8
-rw-r--r--src/engine/SCons/Tool/gs.xml2
-rw-r--r--src/engine/SCons/Tool/gxx.py (renamed from src/engine/SCons/Tool/Subversion.py)59
-rw-r--r--src/engine/SCons/Tool/hpc++.py47
-rw-r--r--src/engine/SCons/Tool/hpc++.xml2
-rw-r--r--src/engine/SCons/Tool/hpcc.py6
-rw-r--r--src/engine/SCons/Tool/hpcc.xml2
-rw-r--r--src/engine/SCons/Tool/hpcxx.py (renamed from src/engine/SCons/Tool/SCCS.py)66
-rw-r--r--src/engine/SCons/Tool/hplink.py6
-rw-r--r--src/engine/SCons/Tool/hplink.xml2
-rw-r--r--src/engine/SCons/Tool/icc.py6
-rw-r--r--src/engine/SCons/Tool/icc.xml2
-rw-r--r--src/engine/SCons/Tool/icl.py4
-rw-r--r--src/engine/SCons/Tool/icl.xml2
-rw-r--r--src/engine/SCons/Tool/ifl.py6
-rw-r--r--src/engine/SCons/Tool/ifl.xml2
-rw-r--r--src/engine/SCons/Tool/ifort.py6
-rw-r--r--src/engine/SCons/Tool/ifort.xml2
-rw-r--r--src/engine/SCons/Tool/ilink.py4
-rw-r--r--src/engine/SCons/Tool/ilink.xml2
-rw-r--r--src/engine/SCons/Tool/ilink32.py4
-rw-r--r--src/engine/SCons/Tool/ilink32.xml2
-rw-r--r--src/engine/SCons/Tool/install.py25
-rw-r--r--src/engine/SCons/Tool/install.xml2
-rw-r--r--src/engine/SCons/Tool/intelc.py25
-rw-r--r--src/engine/SCons/Tool/intelc.xml2
-rw-r--r--src/engine/SCons/Tool/ipkg.py28
-rw-r--r--src/engine/SCons/Tool/jar.py4
-rw-r--r--src/engine/SCons/Tool/jar.xml2
-rw-r--r--src/engine/SCons/Tool/javac.py4
-rw-r--r--src/engine/SCons/Tool/javac.xml2
-rw-r--r--src/engine/SCons/Tool/javacTests.py2
-rw-r--r--src/engine/SCons/Tool/javah.py4
-rw-r--r--src/engine/SCons/Tool/javah.xml2
-rw-r--r--src/engine/SCons/Tool/latex.py8
-rw-r--r--src/engine/SCons/Tool/latex.xml2
-rw-r--r--src/engine/SCons/Tool/ldc.py47
-rw-r--r--src/engine/SCons/Tool/ldc.xml312
-rw-r--r--src/engine/SCons/Tool/lex.py4
-rw-r--r--src/engine/SCons/Tool/lex.xml2
-rw-r--r--src/engine/SCons/Tool/link.py70
-rw-r--r--src/engine/SCons/Tool/link.xml2
-rw-r--r--src/engine/SCons/Tool/linkloc.py8
-rw-r--r--src/engine/SCons/Tool/linkloc.xml2
-rw-r--r--src/engine/SCons/Tool/m4.py4
-rw-r--r--src/engine/SCons/Tool/m4.xml2
-rw-r--r--src/engine/SCons/Tool/masm.py4
-rw-r--r--src/engine/SCons/Tool/masm.xml2
-rw-r--r--src/engine/SCons/Tool/midl.py18
-rw-r--r--src/engine/SCons/Tool/midl.xml2
-rw-r--r--src/engine/SCons/Tool/mingw.py7
-rw-r--r--src/engine/SCons/Tool/mingw.xml2
-rw-r--r--src/engine/SCons/Tool/msgfmt.py6
-rw-r--r--src/engine/SCons/Tool/msgfmt.xml2
-rw-r--r--src/engine/SCons/Tool/msginit.py8
-rw-r--r--src/engine/SCons/Tool/msginit.xml2
-rw-r--r--src/engine/SCons/Tool/msgmerge.py6
-rw-r--r--src/engine/SCons/Tool/msgmerge.xml2
-rw-r--r--src/engine/SCons/Tool/mslib.py6
-rw-r--r--src/engine/SCons/Tool/mslib.xml2
-rw-r--r--src/engine/SCons/Tool/mslink.py19
-rw-r--r--src/engine/SCons/Tool/mslink.xml2
-rw-r--r--src/engine/SCons/Tool/mssdk.py6
-rw-r--r--src/engine/SCons/Tool/mssdk.xml2
-rw-r--r--src/engine/SCons/Tool/msvc.py25
-rw-r--r--src/engine/SCons/Tool/msvc.xml27
-rw-r--r--src/engine/SCons/Tool/msvs.py214
-rw-r--r--src/engine/SCons/Tool/msvs.xml12
-rw-r--r--src/engine/SCons/Tool/msvsTests.py17
-rw-r--r--src/engine/SCons/Tool/mwcc.py4
-rw-r--r--src/engine/SCons/Tool/mwcc.xml2
-rw-r--r--src/engine/SCons/Tool/mwld.py4
-rw-r--r--src/engine/SCons/Tool/mwld.xml2
-rw-r--r--src/engine/SCons/Tool/nasm.py4
-rw-r--r--src/engine/SCons/Tool/nasm.xml2
-rw-r--r--src/engine/SCons/Tool/packaging.xml2
-rw-r--r--src/engine/SCons/Tool/packaging/__init__.py16
-rw-r--r--src/engine/SCons/Tool/packaging/__init__.xml2
-rw-r--r--src/engine/SCons/Tool/packaging/ipk.py6
-rw-r--r--src/engine/SCons/Tool/packaging/msi.py6
-rw-r--r--src/engine/SCons/Tool/packaging/rpm.py17
-rw-r--r--src/engine/SCons/Tool/packaging/src_tarbz2.py4
-rw-r--r--src/engine/SCons/Tool/packaging/src_targz.py4
-rw-r--r--src/engine/SCons/Tool/packaging/src_zip.py4
-rw-r--r--src/engine/SCons/Tool/packaging/tarbz2.py4
-rw-r--r--src/engine/SCons/Tool/packaging/targz.py4
-rw-r--r--src/engine/SCons/Tool/packaging/zip.py4
-rw-r--r--src/engine/SCons/Tool/pdf.py4
-rw-r--r--src/engine/SCons/Tool/pdf.xml2
-rw-r--r--src/engine/SCons/Tool/pdflatex.py6
-rw-r--r--src/engine/SCons/Tool/pdflatex.xml2
-rw-r--r--src/engine/SCons/Tool/pdftex.py6
-rw-r--r--src/engine/SCons/Tool/pdftex.xml2
-rw-r--r--src/engine/SCons/Tool/qt.py25
-rw-r--r--src/engine/SCons/Tool/qt.xml2
-rw-r--r--src/engine/SCons/Tool/rmic.py4
-rw-r--r--src/engine/SCons/Tool/rmic.xml2
-rw-r--r--src/engine/SCons/Tool/rpcgen.py4
-rw-r--r--src/engine/SCons/Tool/rpcgen.xml2
-rw-r--r--src/engine/SCons/Tool/rpm.py6
-rw-r--r--src/engine/SCons/Tool/rpmutils.py14
-rw-r--r--src/engine/SCons/Tool/sgiar.py4
-rw-r--r--src/engine/SCons/Tool/sgiar.xml2
-rw-r--r--src/engine/SCons/Tool/sgic++.py23
-rw-r--r--src/engine/SCons/Tool/sgic++.xml2
-rw-r--r--src/engine/SCons/Tool/sgicc.py6
-rw-r--r--src/engine/SCons/Tool/sgicc.xml2
-rw-r--r--src/engine/SCons/Tool/sgicxx.py (renamed from src/engine/SCons/Tool/RCS.py)40
-rw-r--r--src/engine/SCons/Tool/sgilink.py6
-rw-r--r--src/engine/SCons/Tool/sgilink.xml2
-rw-r--r--src/engine/SCons/Tool/sunar.py4
-rw-r--r--src/engine/SCons/Tool/sunar.xml2
-rw-r--r--src/engine/SCons/Tool/sunc++.py105
-rw-r--r--src/engine/SCons/Tool/sunc++.xml2
-rw-r--r--src/engine/SCons/Tool/suncc.py6
-rw-r--r--src/engine/SCons/Tool/suncc.xml2
-rw-r--r--src/engine/SCons/Tool/suncxx.py144
-rw-r--r--src/engine/SCons/Tool/sunf77.py6
-rw-r--r--src/engine/SCons/Tool/sunf77.xml2
-rw-r--r--src/engine/SCons/Tool/sunf90.py6
-rw-r--r--src/engine/SCons/Tool/sunf90.xml2
-rw-r--r--src/engine/SCons/Tool/sunf95.py6
-rw-r--r--src/engine/SCons/Tool/sunf95.xml2
-rw-r--r--src/engine/SCons/Tool/sunlink.py6
-rw-r--r--src/engine/SCons/Tool/sunlink.xml2
-rw-r--r--src/engine/SCons/Tool/swig.py14
-rw-r--r--src/engine/SCons/Tool/swig.xml2
-rw-r--r--src/engine/SCons/Tool/tar.py4
-rw-r--r--src/engine/SCons/Tool/tar.xml2
-rw-r--r--src/engine/SCons/Tool/tex.py115
-rw-r--r--src/engine/SCons/Tool/tex.xml2
-rw-r--r--src/engine/SCons/Tool/textfile.py115
-rw-r--r--src/engine/SCons/Tool/textfile.xml4
-rw-r--r--src/engine/SCons/Tool/tlib.py4
-rw-r--r--src/engine/SCons/Tool/tlib.xml2
-rw-r--r--src/engine/SCons/Tool/wix.py4
-rw-r--r--src/engine/SCons/Tool/wixTests.py4
-rw-r--r--src/engine/SCons/Tool/xgettext.py555
-rw-r--r--src/engine/SCons/Tool/xgettext.xml2
-rw-r--r--src/engine/SCons/Tool/yacc.py4
-rw-r--r--src/engine/SCons/Tool/yacc.xml2
-rw-r--r--src/engine/SCons/Tool/zip.py46
-rw-r--r--src/engine/SCons/Tool/zip.xml2
-rw-r--r--src/engine/SCons/Util.py256
-rw-r--r--src/engine/SCons/UtilTests.py59
-rw-r--r--src/engine/SCons/Variables/BoolVariable.py14
-rw-r--r--src/engine/SCons/Variables/BoolVariableTests.py4
-rw-r--r--src/engine/SCons/Variables/EnumVariable.py28
-rw-r--r--src/engine/SCons/Variables/EnumVariableTests.py4
-rw-r--r--src/engine/SCons/Variables/ListVariable.py16
-rw-r--r--src/engine/SCons/Variables/ListVariableTests.py4
-rw-r--r--src/engine/SCons/Variables/PackageVariable.py28
-rw-r--r--src/engine/SCons/Variables/PackageVariableTests.py4
-rw-r--r--src/engine/SCons/Variables/PathVariable.py13
-rw-r--r--src/engine/SCons/Variables/PathVariableTests.py20
-rw-r--r--src/engine/SCons/Variables/VariablesTests.py14
-rw-r--r--src/engine/SCons/Variables/__init__.py43
-rw-r--r--src/engine/SCons/Warnings.py4
-rw-r--r--src/engine/SCons/WarningsTests.py4
-rw-r--r--src/engine/SCons/__init__.py12
-rw-r--r--src/engine/SCons/__main__.py4
-rw-r--r--src/engine/SCons/compat/__init__.py92
-rw-r--r--src/engine/SCons/compat/_scons_dbm.py4
-rw-r--r--src/engine/SCons/cpp.py26
-rw-r--r--src/engine/SCons/cppTests.py6
-rw-r--r--src/engine/SCons/dblite.py438
-rw-r--r--src/engine/SCons/exitfuncs.py4
-rw-r--r--src/script/scons-configure-cache.py280
-rw-r--r--src/script/scons-time.py55
-rw-r--r--src/script/scons.bat6
-rw-r--r--src/script/scons.py22
-rw-r--r--src/script/sconsign.py82
-rw-r--r--src/setup.cfg3
-rw-r--r--src/setup.py320
-rw-r--r--src/test_aegistests.py81
-rw-r--r--src/test_files.py13
-rw-r--r--src/test_interrupts.py12
-rw-r--r--src/test_pychecker.py7
-rw-r--r--src/test_setup.py11
-rw-r--r--src/test_strings.py17
586 files changed, 9557 insertions, 7617 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 6c270cd..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.bzr
-.bzrignore
-.pc \ No newline at end of file
diff --git a/LICENSE b/LICENSE
index c730cc2..ff04f2e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 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/QMTest/README.txt b/QMTest/README.txt
index 4c7f413..c644565 100644
--- a/QMTest/README.txt
+++ b/QMTest/README.txt
@@ -54,5 +54,5 @@ the pieces here are local to SCons.
from this infrastructure, in no small part because we're not
really using it as originally envisioned.
-Copyright (c) 2001 - 2016 The SCons Foundation
-QMTest/README.txt rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog
+Copyright (c) 2001 - 2017 The SCons Foundation
+QMTest/README.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog
diff --git a/QMTest/SConscript b/QMTest/SConscript
index e4c9108..4107862 100644
--- a/QMTest/SConscript
+++ b/QMTest/SConscript
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,12 +44,12 @@ files = [
def copy(target, source, env):
t = str(target[0])
s = str(source[0])
- c = open(s, 'rb').read()
+ c = open(s, 'r').read()
# Note: We construct the __ VERSION __ substitution string at
# run-time so it doesn't get replaced when this file gets copied
# into the tree for packaging.
c = c.replace('__' + 'VERSION' + '__', env['VERSION'])
- open(t, 'wb').write(c)
+ open(t, 'w').write(c)
for file in files:
# Guarantee that real copies of these files always exist in
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index cd559b7..0aab9a8 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -285,7 +285,7 @@ version.
# PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
# AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-from __future__ import division
+from __future__ import division, print_function
__author__ = "Steven Knight <knight at baldmt dot com>"
__revision__ = "TestCmd.py 1.3.D001 2010/06/03 12:58:27 knight"
@@ -306,8 +306,15 @@ import time
import traceback
import types
+
+IS_PY3 = sys.version_info[0] == 3
+IS_WINDOWS = sys.platform == 'win32'
+
+
class null(object):
pass
+
+
_Null = null()
try:
@@ -328,12 +335,28 @@ __all__ = [
'match_re_dotall',
'python',
'_python_',
- 'TestCmd'
+ 'TestCmd',
+ 'to_bytes',
+ 'to_str',
]
+
def is_List(e):
return isinstance(e, (list, UserList))
+
+def to_bytes(s):
+ if isinstance(s, bytes) or bytes is str:
+ return s
+ return bytes(s, 'utf-8')
+
+
+def to_str(s):
+ if bytes is str or is_String(s):
+ return s
+ return str(s, 'utf-8')
+
+
try:
eval('unicode')
except NameError:
@@ -351,12 +374,13 @@ else:
re_space = re.compile('\s')
+
def _caller(tblist, skip):
string = ""
arr = []
for file, line, name, text in tblist:
if file[-10:] == "TestCmd.py":
- break
+ break
arr = [(file, line, name, text)] + arr
atfrom = "at"
for file, line, name, text in arr[skip:]:
@@ -368,7 +392,8 @@ def _caller(tblist, skip):
atfrom = "\tfrom"
return string
-def fail_test(self = None, condition = 1, function = None, skip = 0, message=None):
+
+def fail_test(self=None, condition=1, function=None, skip=0, message=None):
"""Cause the test to fail.
By default, the fail_test() method reports that the test FAILED
@@ -392,14 +417,15 @@ def fail_test(self = None, condition = 1, function = None, skip = 0, message=Non
at = _caller(traceback.extract_stack(), skip)
if message:
- msg = "\t%s\n"%message
+ msg = "\t%s\n" % message
else:
msg = ""
sys.stderr.write("FAILED test" + of + desc + sep + at + msg)
sys.exit(1)
-def no_result(self = None, condition = 1, function = None, skip = 0):
+
+def no_result(self=None, condition=1, function=None, skip=0):
"""Causes a test to exit with no valid result.
By default, the no_result() method reports NO RESULT for the test
@@ -426,7 +452,8 @@ def no_result(self = None, condition = 1, function = None, skip = 0):
sys.exit(2)
-def pass_test(self = None, condition = 1, function = None):
+
+def pass_test(self=None, condition=1, function=None):
"""Causes a test to pass.
By default, the pass_test() method reports PASSED for the test
@@ -440,13 +467,18 @@ def pass_test(self = None, condition = 1, function = None):
sys.stderr.write("PASSED\n")
sys.exit(0)
-def match_exact(lines = None, matches = None):
+
+def match_exact(lines=None, matches=None, newline=os.sep):
"""
"""
+
+ if isinstance(lines, bytes) or bytes is str:
+ newline = to_bytes(newline)
+
if not is_List(lines):
- lines = lines.split("\n")
+ lines = lines.split(newline)
if not is_List(matches):
- matches = matches.split("\n")
+ matches = matches.split(newline)
if len(lines) != len(matches):
return
for i in range(len(lines)):
@@ -454,7 +486,8 @@ def match_exact(lines = None, matches = None):
return
return 1
-def match_caseinsensitive(lines = None, matches = None):
+
+def match_caseinsensitive(lines=None, matches=None):
"""
"""
if not is_List(lines):
@@ -468,7 +501,8 @@ def match_caseinsensitive(lines = None, matches = None):
return
return 1
-def match_re(lines = None, res = None):
+
+def match_re(lines=None, res=None):
"""
"""
if not is_List(lines):
@@ -477,21 +511,23 @@ def match_re(lines = None, res = None):
if not is_List(res):
res = res.split("\n")
if len(lines) != len(res):
- print "match_re: expected %d lines, found %d"%(len(res), len(lines))
+ print("match_re: expected %d lines, found %d" % (len(res), len(lines)))
return
for i in range(len(lines)):
s = "^" + res[i] + "$"
try:
expr = re.compile(s)
- except re.error, e:
+ except re.error as e:
msg = "Regular expression error in %s: %s"
raise re.error(msg % (repr(s), e.args[0]))
if not expr.search(lines[i]):
- print "match_re: mismatch at line %d:\n search re='%s'\n line='%s'"%(i,s,lines[i])
+ print("match_re: mismatch at line %d:\n search re='%s'\n line='%s'" % (
+ i, s, lines[i]))
return
return 1
-def match_re_dotall(lines = None, res = None):
+
+def match_re_dotall(lines=None, res=None):
"""
"""
if not isinstance(lines, str):
@@ -501,11 +537,12 @@ def match_re_dotall(lines = None, res = None):
s = "^" + res + "$"
try:
expr = re.compile(s, re.DOTALL)
- except re.error, e:
+ except re.error as e:
msg = "Regular expression error in %s: %s"
raise re.error(msg % (repr(s), e.args[0]))
return expr.match(lines)
+
def simple_diff(a, b, fromfile='', tofile='',
fromfiledate='', tofiledate='', n=3, lineterm='\n'):
"""
@@ -513,26 +550,30 @@ def simple_diff(a, b, fromfile='', tofile='',
(diff -c) and difflib.unified_diff (diff -u) but which prints
output like the simple, unadorned 'diff" command.
"""
+ a = [to_str(q) for q in a]
+ b = [to_str(q) for q in b]
sm = difflib.SequenceMatcher(None, a, b)
+
def comma(x1, x2):
- return x1+1 == x2 and str(x2) or '%s,%s' % (x1+1, x2)
+ return x1 + 1 == x2 and str(x2) or '%s,%s' % (x1 + 1, x2)
result = []
for op, a1, a2, b1, b2 in sm.get_opcodes():
if op == 'delete':
result.append("%sd%d" % (comma(a1, a2), b1))
- result.extend([ '< ' + l for l in a[a1:a2] ])
+ result.extend(['< ' + l for l in a[a1:a2]])
elif op == 'insert':
result.append("%da%s" % (a1, comma(b1, b2)))
- result.extend([ '> ' + l for l in b[b1:b2] ])
+ result.extend(['> ' + l for l in b[b1:b2]])
elif op == 'replace':
result.append("%sc%s" % (comma(a1, a2), comma(b1, b2)))
- result.extend([ '< ' + l for l in a[a1:a2] ])
+ result.extend(['< ' + l for l in a[a1:a2]])
result.append('---')
- result.extend([ '> ' + l for l in b[b1:b2] ])
+ result.extend(['> ' + l for l in b[b1:b2]])
return result
+
def diff_re(a, b, fromfile='', tofile='',
- fromfiledate='', tofiledate='', n=3, lineterm='\n'):
+ fromfiledate='', tofiledate='', n=3, lineterm='\n'):
"""
A simple "diff" of two sets of lines when the expected lines
are regular expressions. This is a really dumb thing that
@@ -543,33 +584,34 @@ def diff_re(a, b, fromfile='', tofile='',
result = []
diff = len(a) - len(b)
if diff < 0:
- a = a + ['']*(-diff)
+ a = a + [''] * (-diff)
elif diff > 0:
- b = b + ['']*diff
+ b = b + [''] * diff
i = 0
for aline, bline in zip(a, b):
s = "^" + aline + "$"
try:
expr = re.compile(s)
- except re.error, e:
+ except re.error as e:
msg = "Regular expression error in %s: %s"
raise re.error(msg % (repr(s), e.args[0]))
if not expr.search(bline):
- result.append("%sc%s" % (i+1, i+1))
+ result.append("%sc%s" % (i + 1, i + 1))
result.append('< ' + repr(a[i]))
result.append('---')
result.append('> ' + repr(b[i]))
- i = i+1
+ i = i + 1
return result
+
if os.name == 'posix':
def escape(arg):
"escape shell special characters"
slash = '\\'
special = '"$'
- arg = arg.replace(slash, slash+slash)
+ arg = arg.replace(slash, slash + slash)
for c in special:
- arg = arg.replace(c, slash+c)
+ arg = arg.replace(c, slash + c)
if re_space.search(arg):
arg = '"' + arg + '"'
return arg
@@ -627,14 +669,13 @@ else:
st = os.stat(f)
except OSError:
continue
- if stat.S_IMODE(st[stat.ST_MODE]) & 0111:
+ if stat.S_IMODE(st[stat.ST_MODE]) & 0o111:
return f
return None
default_sleep_seconds = 1
-
import subprocess
try:
@@ -642,6 +683,7 @@ try:
except AttributeError:
if sys.platform == 'win32':
import win32process
+
def terminate(self):
win32process.TerminateProcess(self._handle, 1)
else:
@@ -651,53 +693,64 @@ except AttributeError:
setattr(subprocess.Popen, 'terminate', method)
-
# From Josiah Carlson,
# ASPN : Python Cookbook : Module to allow Asynchronous subprocess use on Windows and Posix platforms
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
PIPE = subprocess.PIPE
-if subprocess.mswindows:
+if sys.platform == 'win32': # and subprocess.mswindows:
try:
from win32file import ReadFile, WriteFile
from win32pipe import PeekNamedPipe
except ImportError:
# If PyWin32 is not available, try ctypes instead
# XXX These replicate _just_enough_ PyWin32 behaviour for our purposes
- import ctypes; from ctypes.wintypes import DWORD
+ import ctypes
+ from ctypes.wintypes import DWORD
+
def ReadFile(hFile, bufSize, ol=None):
assert ol is None
lpBuffer = ctypes.create_string_buffer(bufSize)
bytesRead = DWORD()
bErr = ctypes.windll.kernel32.ReadFile(
- hFile, lpBuffer, bufSize, ctypes.byref(bytesRead), ol)
- if not bErr: raise ctypes.WinError()
+ hFile, lpBuffer, bufSize, ctypes.byref(bytesRead), ol)
+ if not bErr:
+ raise ctypes.WinError()
return (0, ctypes.string_at(lpBuffer, bytesRead.value))
+
def WriteFile(hFile, data, ol=None):
assert ol is None
bytesWritten = DWORD()
bErr = ctypes.windll.kernel32.WriteFile(
- hFile, data, len(data), ctypes.byref(bytesWritten), ol)
- if not bErr: raise ctypes.WinError()
+ hFile, data, len(data), ctypes.byref(bytesWritten), ol)
+ if not bErr:
+ raise ctypes.WinError()
return (0, bytesWritten.value)
+
def PeekNamedPipe(hPipe, size):
assert size == 0
bytesAvail = DWORD()
bErr = ctypes.windll.kernel32.PeekNamedPipe(
- hPipe, None, size, None, ctypes.byref(bytesAvail), None)
- if not bErr: raise ctypes.WinError()
+ hPipe, None, size, None, ctypes.byref(bytesAvail), None)
+ if not bErr:
+ raise ctypes.WinError()
return ("", bytesAvail.value, None)
import msvcrt
else:
import select
import fcntl
- try: fcntl.F_GETFL
- except AttributeError: fcntl.F_GETFL = 3
+ try:
+ fcntl.F_GETFL
+ except AttributeError:
+ fcntl.F_GETFL = 3
+
+ try:
+ fcntl.F_SETFL
+ except AttributeError:
+ fcntl.F_SETFL = 4
- try: fcntl.F_SETFL
- except AttributeError: fcntl.F_SETFL = 4
class Popen(subprocess.Popen):
def recv(self, maxsize=None):
@@ -720,8 +773,9 @@ class Popen(subprocess.Popen):
getattr(self, which).close()
setattr(self, which, None)
- if subprocess.mswindows:
+ if sys.platform == 'win32': # and subprocess.mswindows:
def send(self, input):
+ input = to_bytes(input)
if not self.stdin:
return None
@@ -730,7 +784,7 @@ class Popen(subprocess.Popen):
(errCode, written) = WriteFile(x, input)
except ValueError:
return self._close('stdin')
- except (subprocess.pywintypes.error, Exception), why:
+ except (subprocess.pywintypes.error, Exception) as why:
if why.args[0] in (109, errno.ESHUTDOWN):
return self._close('stdin')
raise
@@ -751,12 +805,12 @@ class Popen(subprocess.Popen):
(errCode, read) = ReadFile(x, nAvail, None)
except ValueError:
return self._close(which)
- except (subprocess.pywintypes.error, Exception), why:
+ except (subprocess.pywintypes.error, Exception) as why:
if why.args[0] in (109, errno.ESHUTDOWN):
return self._close(which)
raise
- #if self.universal_newlines:
+ # if self.universal_newlines:
# read = self._translate_newlines(read)
return read
@@ -769,9 +823,10 @@ class Popen(subprocess.Popen):
return 0
try:
- written = os.write(self.stdin.fileno(), input)
- except OSError, why:
- if why.args[0] == errno.EPIPE: #broken pipe
+ written = os.write(self.stdin.fileno(),
+ bytearray(input, 'utf-8'))
+ except OSError as why:
+ if why.args[0] == errno.EPIPE: # broken pipe
return self._close('stdin')
raise
@@ -788,7 +843,7 @@ class Popen(subprocess.Popen):
flags = None
else:
if not conn.closed:
- fcntl.fcntl(conn, fcntl.F_SETFL, flags| os.O_NONBLOCK)
+ fcntl.fcntl(conn, fcntl.F_SETFL, flags | os.O_NONBLOCK)
try:
if not select.select([conn], [], [], 0)[0]:
@@ -798,19 +853,21 @@ class Popen(subprocess.Popen):
if not r:
return self._close(which)
- #if self.universal_newlines:
+ # if self.universal_newlines:
# r = self._translate_newlines(r)
return r
finally:
if not conn.closed and not flags is None:
fcntl.fcntl(conn, fcntl.F_SETFL, flags)
+
disconnect_message = "Other end disconnected!"
+
def recv_some(p, t=.1, e=1, tr=5, stderr=0):
if tr < 1:
tr = 1
- x = time.time()+t
+ x = time.time() + t
y = []
r = ''
pr = p.recv
@@ -826,9 +883,10 @@ def recv_some(p, t=.1, e=1, tr=5, stderr=0):
elif r:
y.append(r)
else:
- time.sleep(max((x-time.time())/tr, 0))
+ time.sleep(max((x - time.time()) / tr, 0))
return ''.join(y)
+
def send_all(p, data):
while len(data):
sent = p.send(data)
@@ -836,16 +894,19 @@ def send_all(p, data):
raise Exception(disconnect_message)
data = memoryview(data)[sent:]
+
_Cleanup = []
+
def _clean():
global _Cleanup
- cleanlist = [ c for c in _Cleanup if c ]
+ cleanlist = [c for c in _Cleanup if c]
del _Cleanup[:]
cleanlist.reverse()
for test in cleanlist:
test.cleanup()
+
atexit.register(_clean)
@@ -853,21 +914,21 @@ class TestCmd(object):
"""Class TestCmd
"""
- def __init__(self, description = None,
- program = None,
- interpreter = None,
- workdir = None,
- subdir = None,
- verbose = None,
- match = None,
- match_stdout = None,
- match_stderr = None,
- diff = None,
- diff_stdout = None,
- diff_stderr = None,
- combine = 0,
- universal_newlines = 1,
- timeout = None):
+ def __init__(self, description=None,
+ program=None,
+ interpreter=None,
+ workdir=None,
+ subdir=None,
+ verbose=None,
+ match=None,
+ match_stdout=None,
+ match_stderr=None,
+ diff=None,
+ diff_stdout=None,
+ diff_stderr=None,
+ combine=0,
+ universal_newlines=True,
+ timeout=None):
self.external = os.environ.get('SCONS_EXTERNAL_TEST', 0)
self._cwd = os.getcwd()
self.description_set(description)
@@ -875,7 +936,7 @@ class TestCmd(object):
self.interpreter_set(interpreter)
if verbose is None:
try:
- verbose = max( 0, int(os.environ.get('TESTCMD_VERBOSE', 0)) )
+ verbose = max(0, int(os.environ.get('TESTCMD_VERBOSE', 0)))
except ValueError:
verbose = 0
self.verbose_set(verbose)
@@ -887,7 +948,8 @@ class TestCmd(object):
self.set_diff_function(diff, diff_stdout, diff_stderr)
self._dirlist = []
self._preserve = {'pass_test': 0, 'fail_test': 0, 'no_result': 0}
- if 'PRESERVE' in os.environ and not os.environ['PRESERVE'] is '':
+ preserve_value = os.environ.get('PRESERVE', False)
+ if preserve_value not in [0, '0', 'False']:
self._preserve['pass_test'] = os.environ['PRESERVE']
self._preserve['fail_test'] = os.environ['PRESERVE']
self._preserve['no_result'] = os.environ['PRESERVE']
@@ -910,7 +972,7 @@ class TestCmd(object):
self.condition = 'no_result'
self.workdir_set(workdir)
self.subdir(subdir)
- self.script_srcdir = None
+ self.fixture_dirs = []
def __del__(self):
self.cleanup()
@@ -941,7 +1003,7 @@ class TestCmd(object):
path = self.canonicalize(path)
os.chmod(path, mode)
- def cleanup(self, condition = None):
+ def cleanup(self, condition=None):
"""Removes any temporary working directories for the specified
TestCmd environment. If the environment variable PRESERVE was
set when the TestCmd environment was created, temporary working
@@ -964,22 +1026,22 @@ class TestCmd(object):
condition = self.condition
if self._preserve[condition]:
for dir in self._dirlist:
- print unicode("Preserved directory " + dir + "\n"),
+ print(u"Preserved directory " + dir + "\n")
else:
list = self._dirlist[:]
list.reverse()
for dir in list:
self.writable(dir, 1)
- shutil.rmtree(dir, ignore_errors = 1)
+ shutil.rmtree(dir, ignore_errors=1)
self._dirlist = []
global _Cleanup
if self in _Cleanup:
_Cleanup.remove(self)
- def command_args(self, program = None,
- interpreter = None,
- arguments = None):
+ def command_args(self, program=None,
+ interpreter=None,
+ arguments=None):
if not self.external:
if program:
if isinstance(program, str) and not os.path.isabs(program):
@@ -1030,10 +1092,10 @@ class TestCmd(object):
if diff_function is None:
diff_function = self.simple_diff
if name is not None:
- print self.banner(name)
+ print(self.banner(name))
args = (a.splitlines(), b.splitlines()) + args
for line in diff_function(*args, **kw):
- print line
+ print(line)
def diff_stderr(self, a, b, *args, **kw):
"""Compare actual and expected file contents.
@@ -1061,17 +1123,17 @@ class TestCmd(object):
unified_diff = staticmethod(difflib.unified_diff)
- def fail_test(self, condition = 1, function = None, skip = 0, message = None):
+ def fail_test(self, condition=1, function=None, skip=0, message=None):
"""Cause the test to fail.
"""
if not condition:
return
self.condition = 'fail_test'
- fail_test(self = self,
- condition = condition,
- function = function,
- skip = skip,
- message = message)
+ fail_test(self=self,
+ condition=condition,
+ function=function,
+ skip=skip,
+ message=message)
def interpreter_set(self, interpreter):
"""Set the program to be used to interpret the program
@@ -1133,24 +1195,24 @@ class TestCmd(object):
match_re_dotall = staticmethod(match_re_dotall)
- def no_result(self, condition = 1, function = None, skip = 0):
+ def no_result(self, condition=1, function=None, skip=0):
"""Report that the test could not be run.
"""
if not condition:
return
self.condition = 'no_result'
- no_result(self = self,
- condition = condition,
- function = function,
- skip = skip)
+ no_result(self=self,
+ condition=condition,
+ function=function,
+ skip=skip)
- def pass_test(self, condition = 1, function = None):
+ def pass_test(self, condition=1, function=None):
"""Cause the test to pass.
"""
if not condition:
return
self.condition = 'pass_test'
- pass_test(self = self, condition = condition, function = function)
+ pass_test(self=self, condition=condition, function=function)
def preserve(self, *conditions):
"""Arrange for the temporary working directories for the
@@ -1172,7 +1234,7 @@ class TestCmd(object):
program = os.path.join(self._cwd, program)
self.program = program
- def read(self, file, mode = 'rb'):
+ def read(self, file, mode='rb', newline=None):
"""Reads and returns the contents of the specified file name.
The file name may be a list, in which case the elements are
concatenated with the os.path.join() method. The file is
@@ -1184,7 +1246,10 @@ class TestCmd(object):
file = self.canonicalize(file)
if mode[0] != 'r':
raise ValueError("mode must begin with 'r'")
- return open(file, mode).read()
+ if IS_PY3 and 'b' not in mode:
+ return open(file, mode, newline=newline).read()
+ else:
+ return open(file, mode).read()
def rmdir(self, dir):
"""Removes the specified dir name.
@@ -1234,10 +1299,15 @@ class TestCmd(object):
assumed to be under the temporary working directory, it gets
created automatically, if it does not already exist.
"""
- if srcdir and self.script_srcdir and not os.path.isabs(srcdir):
- spath = os.path.join(self.script_srcdir, srcdir)
+
+ if srcdir and self.fixture_dirs and not os.path.isabs(srcdir):
+ for dir in self.fixture_dirs:
+ spath = os.path.join(dir, srcdir)
+ if os.path.isdir(spath):
+ break
else:
spath = srcdir
+
if dstdir:
dstdir = self.canonicalize(dstdir)
else:
@@ -1248,7 +1318,7 @@ class TestCmd(object):
if len(dstlist) > 0 and dstlist[0] == ".":
dstlist = dstlist[1:]
for idx in range(len(dstlist)):
- self.subdir(dstlist[:idx+1])
+ self.subdir(dstlist[:idx + 1])
if dstdir and self.workdir:
dstdir = os.path.join(self.workdir, dstdir)
@@ -1271,13 +1341,15 @@ class TestCmd(object):
automatically, if it does not already exist.
"""
srcpath, srctail = os.path.split(srcfile)
- if srcpath:
- if self.script_srcdir and not os.path.isabs(srcpath):
- spath = os.path.join(self.script_srcdir, srcfile)
- else:
- spath = srcfile
+
+ if srcpath and (not self.fixture_dirs or os.path.isabs(srcpath)):
+ spath = srcfile
else:
- spath = os.path.join(self.script_srcdir, srcfile)
+ for dir in self.fixture_dirs:
+ spath = os.path.join(dir, srcfile)
+ if os.path.isfile(spath):
+ break
+
if not dstfile:
if srctail:
dpath = os.path.join(self.workdir, srctail)
@@ -1291,17 +1363,17 @@ class TestCmd(object):
if len(dstlist) > 0 and dstlist[0] == ".":
dstlist = dstlist[1:]
for idx in range(len(dstlist)):
- self.subdir(dstlist[:idx+1])
+ self.subdir(dstlist[:idx + 1])
dpath = os.path.join(self.workdir, dstfile)
shutil.copy(spath, dpath)
- def start(self, program = None,
- interpreter = None,
- arguments = None,
- universal_newlines = None,
- timeout = _Null,
- **kw):
+ def start(self, program=None,
+ interpreter=None,
+ arguments=None,
+ universal_newlines=None,
+ timeout=_Null,
+ **kw):
"""
Starts a program or script for the test environment.
@@ -1310,7 +1382,7 @@ class TestCmd(object):
"""
cmd = self.command_args(program, interpreter, arguments)
if self.verbose:
- cmd_string = ' '.join([ self.escape(c) for c in cmd ])
+ cmd_string = ' '.join([self.escape(c) for c in cmd])
sys.stderr.write(cmd_string + "\n")
if universal_newlines is None:
universal_newlines = self.universal_newlines
@@ -1334,14 +1406,56 @@ class TestCmd(object):
if timeout:
self.timer = threading.Timer(float(timeout), self._timeout)
self.timer.start()
+
+ if IS_PY3 and sys.platform == 'win32':
+ # Set this otherwist stdout/stderr pipes default to
+ # windows default locale cp1252 which will throw exception
+ # if using non-ascii characters.
+ # For example test/Install/non-ascii-name.py
+ os.environ['PYTHONIOENCODING'] = 'utf-8'
+
+ # It seems that all pythons up to py3.6 still set text mode if you set encoding.
+ # TODO: File enhancement request on python to propagate universal_newlines even
+ # if encoding is set.hg c
p = Popen(cmd,
stdin=stdin,
stdout=subprocess.PIPE,
stderr=stderr_value,
- universal_newlines=universal_newlines)
+ env=os.environ,
+ universal_newlines=False)
+
self.process = p
return p
+ @staticmethod
+ def fix_binary_stream(stream):
+ """
+ Handle stdout/stderr from popen when we specify universal_newlines = False.
+ This will read from the pipes in binary mode, not decode the output,
+ and not convert line endings to \n.
+ We do this because in py3 (3.5) with universal_newlines=True, it will
+ choose the default system locale to decode the output, and this breaks unicode
+ output. Specifically breaking test/option--tree.py which outputs a unicode char.
+
+ py 3.6 allows us to pass an encoding param to popen thus not requiring the decode
+ nor end of line handling, because we propagate universal_newlines as specified.
+
+ TODO: Do we need to pass universal newlines into this function?
+ """
+
+ if not stream:
+ return stream
+ # TODO: Run full tests on both platforms and see if this fixes failures
+ # It seems that py3.6 still sets text mode if you set encoding.
+ elif sys.version_info[0] == 3:# TODO and sys.version_info[1] < 6:
+ stream = stream.decode('utf-8')
+ stream = stream.replace('\r\n', '\n')
+ elif sys.version_info[0] == 2:
+ stream = stream.replace('\r\n', '\n')
+
+ return stream
+
+
def finish(self, popen=None, **kw):
"""
Finishes and waits for the process being run under control of
@@ -1351,6 +1465,10 @@ class TestCmd(object):
if popen is None:
popen = self.process
stdout, stderr = popen.communicate()
+
+ stdout = self.fix_binary_stream(stdout)
+ stderr = self.fix_binary_stream(stderr)
+
if self.timer:
self.timer.cancel()
self.timer = None
@@ -1359,13 +1477,13 @@ class TestCmd(object):
self._stdout.append(stdout or '')
self._stderr.append(stderr or '')
- def run(self, program = None,
- interpreter = None,
- arguments = None,
- chdir = None,
- stdin = None,
- universal_newlines = None,
- timeout = _Null):
+ def run(self, program=None,
+ interpreter=None,
+ arguments=None,
+ chdir=None,
+ stdin=None,
+ universal_newlines=None,
+ timeout=_Null):
"""Runs a test of the program or script for the test
environment. Standard output and error output are saved for
future retrieval via the stdout() and stderr() methods.
@@ -1379,6 +1497,9 @@ class TestCmd(object):
if not interpreter:
interpreter = self.interpreter
+ if universal_newlines is None:
+ universal_newlines = self.universal_newlines
+
if chdir:
oldcwd = os.getcwd()
if not os.path.isabs(chdir):
@@ -1386,14 +1507,18 @@ class TestCmd(object):
if self.verbose:
sys.stderr.write("chdir(" + chdir + ")\n")
os.chdir(chdir)
- p = self.start(program = program,
- interpreter = interpreter,
- arguments = arguments,
- universal_newlines = universal_newlines,
- timeout = timeout,
- stdin = stdin)
+ p = self.start(program=program,
+ interpreter=interpreter,
+ arguments=arguments,
+ universal_newlines=universal_newlines,
+ timeout=timeout,
+ stdin=stdin)
if is_List(stdin):
stdin = ''.join(stdin)
+
+ if stdin and IS_PY3:# and sys.version_info[1] < 6:
+ stdin = to_bytes(stdin)
+
# TODO(sgk): figure out how to re-use the logic in the .finish()
# method above. Just calling it from here causes problems with
# subclasses that redefine .finish(). We could abstract this
@@ -1405,6 +1530,11 @@ class TestCmd(object):
self.timer = None
self.status = p.returncode
self.process = None
+
+ stdout = self.fix_binary_stream(stdout)
+ stderr = self.fix_binary_stream(stderr)
+
+
self._stdout.append(stdout or '')
self._stderr.append(stderr or '')
@@ -1424,7 +1554,7 @@ class TestCmd(object):
write(err)
write('============ END STDERR\n')
- def sleep(self, seconds = default_sleep_seconds):
+ def sleep(self, seconds=default_sleep_seconds):
"""Sleeps at least the specified number of seconds. If no
number is specified, sleeps at least the minimum number of
seconds necessary to advance file time stamps on the current
@@ -1432,7 +1562,7 @@ class TestCmd(object):
"""
time.sleep(seconds)
- def stderr(self, run = None):
+ def stderr(self, run=None):
"""Returns the error output from the specified run number.
If there is no specified run number, then returns the error
output of the last run. If the run number is less than zero,
@@ -1446,7 +1576,7 @@ class TestCmd(object):
run = run - 1
return self._stderr[run]
- def stdout(self, run = None):
+ def stdout(self, run=None):
"""Returns the standard output from the specified run number.
If there is no specified run number, then returns the standard
output of the last run. If the run number is less than zero,
@@ -1494,6 +1624,11 @@ class TestCmd(object):
is an absolute path name. The target is *not* assumed to be
under the temporary working directory.
"""
+ if sys.platform == 'win32':
+ # Skip this on windows as we're not enabling it due to
+ # it requiring user permissions which aren't always present
+ # and we don't have a good way to detect those permissions yet.
+ return
link = self.canonicalize(link)
try:
os.symlink(target, link)
@@ -1525,7 +1660,7 @@ class TestCmd(object):
# Uppercase the drive letter since the case of drive
# letters is pretty much random on win32:
- drive,rest = os.path.splitdrive(path)
+ drive, rest = os.path.splitdrive(path)
if drive:
path = drive.upper() + rest
@@ -1605,14 +1740,22 @@ class TestCmd(object):
if read:
def do_chmod(fname):
- try: st = os.stat(fname)
- except OSError: pass
- else: os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]|stat.S_IREAD))
+ try:
+ st = os.stat(fname)
+ except OSError:
+ pass
+ else:
+ os.chmod(fname, stat.S_IMODE(
+ st[stat.ST_MODE] | stat.S_IREAD))
else:
def do_chmod(fname):
- try: st = os.stat(fname)
- except OSError: pass
- else: os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]&~stat.S_IREAD))
+ try:
+ st = os.stat(fname)
+ except OSError:
+ pass
+ else:
+ os.chmod(fname, stat.S_IMODE(
+ st[stat.ST_MODE] & ~stat.S_IREAD))
if os.path.isfile(top):
# If it's a file, that's easy, just chmod it.
@@ -1646,25 +1789,36 @@ class TestCmd(object):
if write:
def do_chmod(fname):
- try: os.chmod(fname, stat.S_IWRITE)
- except OSError: pass
+ try:
+ os.chmod(fname, stat.S_IWRITE)
+ except OSError:
+ pass
else:
def do_chmod(fname):
- try: os.chmod(fname, stat.S_IREAD)
- except OSError: pass
+ try:
+ os.chmod(fname, stat.S_IREAD)
+ except OSError:
+ pass
else:
if write:
def do_chmod(fname):
- try: st = os.stat(fname)
- except OSError: pass
- else: os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]|0200))
+ try:
+ st = os.stat(fname)
+ except OSError:
+ pass
+ else:
+ os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE] | 0o200))
else:
def do_chmod(fname):
- try: st = os.stat(fname)
- except OSError: pass
- else: os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]&~0200))
+ try:
+ st = os.stat(fname)
+ except OSError:
+ pass
+ else:
+ os.chmod(fname, stat.S_IMODE(
+ st[stat.ST_MODE] & ~0o200))
if os.path.isfile(top):
do_chmod(top)
@@ -1687,14 +1841,22 @@ class TestCmd(object):
if execute:
def do_chmod(fname):
- try: st = os.stat(fname)
- except OSError: pass
- else: os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]|stat.S_IEXEC))
+ try:
+ st = os.stat(fname)
+ except OSError:
+ pass
+ else:
+ os.chmod(fname, stat.S_IMODE(
+ st[stat.ST_MODE] | stat.S_IEXEC))
else:
def do_chmod(fname):
- try: st = os.stat(fname)
- except OSError: pass
- else: os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]&~stat.S_IEXEC))
+ try:
+ st = os.stat(fname)
+ except OSError:
+ pass
+ else:
+ os.chmod(fname, stat.S_IMODE(
+ st[stat.ST_MODE] & ~stat.S_IEXEC))
if os.path.isfile(top):
# If it's a file, that's easy, just chmod it.
@@ -1719,7 +1881,7 @@ class TestCmd(object):
do_chmod(os.path.join(dirpath, name))
do_chmod(top)
- def write(self, file, content, mode = 'wb'):
+ def write(self, file, content, mode='wb'):
"""Writes the specified content text (second argument) to the
specified file name (first argument). The file name may be
a list, in which case the elements are concatenated with the
@@ -1731,7 +1893,12 @@ class TestCmd(object):
file = self.canonicalize(file)
if mode[0] != 'w':
raise ValueError("mode must begin with 'w'")
- open(file, mode).write(content)
+ with open(file, mode) as f:
+ try:
+ f.write(content)
+ except TypeError as e:
+ # python 3 default strings are not bytes, but unicode
+ f.write(bytes(content, 'utf-8'))
# Local Variables:
# tab-width:4
diff --git a/QMTest/TestCmdTests.py b/QMTest/TestCmdTests.py
index 1044ed1..b9226fd 100644
--- a/QMTest/TestCmdTests.py
+++ b/QMTest/TestCmdTests.py
@@ -26,13 +26,14 @@ import os
import shutil
import signal
import stat
-import StringIO
+from StringIO import StringIO
import sys
import tempfile
import time
import types
import unittest
-import UserList
+from UserList import UserList
+
# Strip the current directory so we get the right TestCmd.py module.
sys.path = sys.path[1:]
@@ -131,11 +132,11 @@ class TestCmdTestCase(unittest.TestCase):
run_env.write(t.scriptout_path, textout)
run_env.write(t.scripterr_path, texterr)
- os.chmod(t.script_path, 0644) # XXX UNIX-specific
- os.chmod(t.scriptx_path, 0755) # XXX UNIX-specific
- os.chmod(t.script1_path, 0644) # XXX UNIX-specific
- os.chmod(t.scriptout_path, 0644) # XXX UNIX-specific
- os.chmod(t.scripterr_path, 0644) # XXX UNIX-specific
+ os.chmod(t.script_path, 0o644) # XXX UNIX-specific
+ os.chmod(t.scriptx_path, 0o755) # XXX UNIX-specific
+ os.chmod(t.script1_path, 0o644) # XXX UNIX-specific
+ os.chmod(t.scriptout_path, 0o644) # XXX UNIX-specific
+ os.chmod(t.scripterr_path, 0o644) # XXX UNIX-specific
t.orig_cwd = os.getcwd()
@@ -220,8 +221,8 @@ class cleanup_TestCase(TestCmdTestCase):
test = TestCmd.TestCmd(workdir = '')
wdir = test.workdir
test.write('file2', "Test file #2\n")
- os.chmod(test.workpath('file2'), 0400)
- os.chmod(wdir, 0500)
+ os.chmod(test.workpath('file2'), 0o400)
+ os.chmod(wdir, 0o500)
test.cleanup()
assert not os.path.exists(wdir)
@@ -244,11 +245,12 @@ class cleanup_TestCase(TestCmdTestCase):
def test_atexit(self):
"""Test cleanup() when atexit is used"""
- self.popen_python("""import sys
+ self.popen_python("""from __future__ import print_function
+import sys
sys.path = ['%s'] + sys.path
import atexit
def my_exitfunc():
- print "my_exitfunc()"
+ print("my_exitfunc()")
atexit.register(my_exitfunc)
import TestCmd
result = TestCmd.TestCmd(workdir = '')
@@ -257,10 +259,11 @@ sys.exit(0)
def test_exitfunc(self):
"""Test cleanup() when sys.exitfunc is set"""
- self.popen_python("""import sys
+ self.popen_python("""from __future__ import print_function
+import sys
sys.path = ['%s'] + sys.path
def my_exitfunc():
- print "my_exitfunc()"
+ print("my_exitfunc()")
sys.exitfunc = my_exitfunc
import TestCmd
result = TestCmd.TestCmd(workdir = '')
@@ -286,35 +289,35 @@ class chmod_TestCase(TestCmdTestCase):
test.chmod(['sub', 'file2'], stat.S_IWRITE)
file1_mode = stat.S_IMODE(os.stat(wdir_file1)[stat.ST_MODE])
- assert file1_mode == 0444, '0%o' % file1_mode
+ assert file1_mode == 0o444, '0%o' % file1_mode
file2_mode = stat.S_IMODE(os.stat(wdir_sub_file2)[stat.ST_MODE])
- assert file2_mode == 0666, '0%o' % file2_mode
+ assert file2_mode == 0o666, '0%o' % file2_mode
test.chmod('file1', stat.S_IWRITE)
test.chmod(wdir_sub_file2, stat.S_IREAD)
file1_mode = stat.S_IMODE(os.stat(wdir_file1)[stat.ST_MODE])
- assert file1_mode == 0666, '0%o' % file1_mode
+ assert file1_mode == 0o666, '0%o' % file1_mode
file2_mode = stat.S_IMODE(os.stat(wdir_sub_file2)[stat.ST_MODE])
- assert file2_mode == 0444, '0%o' % file2_mode
+ assert file2_mode == 0o444, '0%o' % file2_mode
else:
- test.chmod(wdir_file1, 0700)
- test.chmod(['sub', 'file2'], 0760)
+ test.chmod(wdir_file1, 0o700)
+ test.chmod(['sub', 'file2'], 0o760)
file1_mode = stat.S_IMODE(os.stat(wdir_file1)[stat.ST_MODE])
- assert file1_mode == 0700, '0%o' % file1_mode
+ assert file1_mode == 0o700, '0%o' % file1_mode
file2_mode = stat.S_IMODE(os.stat(wdir_sub_file2)[stat.ST_MODE])
- assert file2_mode == 0760, '0%o' % file2_mode
+ assert file2_mode == 0o760, '0%o' % file2_mode
- test.chmod('file1', 0765)
- test.chmod(wdir_sub_file2, 0567)
+ test.chmod('file1', 0o765)
+ test.chmod(wdir_sub_file2, 0o567)
file1_mode = stat.S_IMODE(os.stat(wdir_file1)[stat.ST_MODE])
- assert file1_mode == 0765, '0%o' % file1_mode
+ assert file1_mode == 0o765, '0%o' % file1_mode
file2_mode = stat.S_IMODE(os.stat(wdir_sub_file2)[stat.ST_MODE])
- assert file2_mode == 0567, '0%o' % file2_mode
+ assert file2_mode == 0o567, '0%o' % file2_mode
@@ -593,13 +596,14 @@ sys.exit(0)
def test_diff_stderr_not_affecting_diff_stdout(self):
"""Test diff_stderr() not affecting diff_stdout() behavior"""
- self.popen_python(r"""import sys
+ self.popen_python(r"""from __future__ import print_function
+import sys
sys.path = ['%s'] + sys.path
import TestCmd
test = TestCmd.TestCmd(diff_stderr='diff_re')
-print "diff_stderr:"
+print("diff_stderr:")
test.diff_stderr('a\nb.\nc\n', 'a\nbb\nc\n')
-print "diff_stdout:"
+print("diff_stdout:")
test.diff_stdout('a\nb.\nc\n', 'a\nbb\nc\n')
sys.exit(0)
""" % self.orig_cwd,
@@ -699,13 +703,14 @@ sys.exit(0)
def test_diff_stdout_not_affecting_diff_stderr(self):
"""Test diff_stdout() not affecting diff_stderr() behavior"""
- self.popen_python(r"""import sys
+ self.popen_python(r"""from __future__ import print_function
+import sys
sys.path = ['%s'] + sys.path
import TestCmd
test = TestCmd.TestCmd(diff_stdout='diff_re')
-print "diff_stdout:"
+print("diff_stdout:")
test.diff_stdout('a\nb.\nc\n', 'a\nbb\nc\n')
-print "diff_stderr:"
+print("diff_stderr:")
test.diff_stderr('a\nb.\nc\n', 'a\nbb\nc\n')
sys.exit(0)
""" % self.orig_cwd,
@@ -1032,14 +1037,14 @@ class match_exact_TestCase(TestCmdTestCase):
assert test.match_exact("abcde\n", "abcde\n")
assert not test.match_exact(["12345\n", "abcde\n"], ["1[0-9]*5\n", "a.*e\n"])
assert test.match_exact(["12345\n", "abcde\n"], ["12345\n", "abcde\n"])
- assert not test.match_exact(UserList.UserList(["12345\n", "abcde\n"]),
+ assert not test.match_exact(UserList(["12345\n", "abcde\n"]),
["1[0-9]*5\n", "a.*e\n"])
- assert test.match_exact(UserList.UserList(["12345\n", "abcde\n"]),
+ assert test.match_exact(UserList(["12345\n", "abcde\n"]),
["12345\n", "abcde\n"])
assert not test.match_exact(["12345\n", "abcde\n"],
- UserList.UserList(["1[0-9]*5\n", "a.*e\n"]))
+ UserList(["1[0-9]*5\n", "a.*e\n"]))
assert test.match_exact(["12345\n", "abcde\n"],
- UserList.UserList(["12345\n", "abcde\n"]))
+ UserList(["12345\n", "abcde\n"]))
assert not test.match_exact("12345\nabcde\n", "1[0-9]*5\na.*e\n")
assert test.match_exact("12345\nabcde\n", "12345\nabcde\n")
lines = ["vwxyz\n", "67890\n"]
@@ -1098,28 +1103,28 @@ sys.exit(0)
["1.*j\n"])
assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"],
["12345\n", "abcde\n", "fghij\n"])
- assert test.match_re_dotall(UserList.UserList(["12345\n",
- "abcde\n",
- "fghij\n"]),
+ assert test.match_re_dotall(UserList(["12345\n",
+ "abcde\n",
+ "fghij\n"]),
["1[0-9]*5\n", "a.*e\n", "f.*j\n"])
- assert test.match_re_dotall(UserList.UserList(["12345\n",
- "abcde\n",
- "fghij\n"]),
+ assert test.match_re_dotall(UserList(["12345\n",
+ "abcde\n",
+ "fghij\n"]),
["1.*j\n"])
- assert test.match_re_dotall(UserList.UserList(["12345\n",
- "abcde\n",
- "fghij\n"]),
+ assert test.match_re_dotall(UserList(["12345\n",
+ "abcde\n",
+ "fghij\n"]),
["12345\n", "abcde\n", "fghij\n"])
assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"],
- UserList.UserList(["1[0-9]*5\n",
- "a.*e\n",
- "f.*j\n"]))
+ UserList(["1[0-9]*5\n",
+ "a.*e\n",
+ "f.*j\n"]))
assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"],
- UserList.UserList(["1.*j\n"]))
+ UserList(["1.*j\n"]))
assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"],
- UserList.UserList(["12345\n",
- "abcde\n",
- "fghij\n"]))
+ UserList(["12345\n",
+ "abcde\n",
+ "fghij\n"]))
assert test.match_re_dotall("12345\nabcde\nfghij\n",
"1[0-9]*5\na.*e\nf.*j\n")
assert test.match_re_dotall("12345\nabcde\nfghij\n", "1.*j\n")
@@ -1176,14 +1181,14 @@ sys.exit(0)
assert test.match_re("abcde\n", "abcde\n")
assert test.match_re(["12345\n", "abcde\n"], ["1[0-9]*5\n", "a.*e\n"])
assert test.match_re(["12345\n", "abcde\n"], ["12345\n", "abcde\n"])
- assert test.match_re(UserList.UserList(["12345\n", "abcde\n"]),
+ assert test.match_re(UserList(["12345\n", "abcde\n"]),
["1[0-9]*5\n", "a.*e\n"])
- assert test.match_re(UserList.UserList(["12345\n", "abcde\n"]),
+ assert test.match_re(UserList(["12345\n", "abcde\n"]),
["12345\n", "abcde\n"])
assert test.match_re(["12345\n", "abcde\n"],
- UserList.UserList(["1[0-9]*5\n", "a.*e\n"]))
+ UserList(["1[0-9]*5\n", "a.*e\n"]))
assert test.match_re(["12345\n", "abcde\n"],
- UserList.UserList(["12345\n", "abcde\n"]))
+ UserList(["12345\n", "abcde\n"]))
assert test.match_re("12345\nabcde\n", "1[0-9]*5\na.*e\n")
assert test.match_re("12345\nabcde\n", "12345\nabcde\n")
lines = ["vwxyz\n", "67890\n"]
@@ -1463,7 +1468,7 @@ class preserve_TestCase(TestCmdTestCase):
def test_preserve(self):
"""Test preserve()"""
def cleanup_test(test, cond=None, stdout=""):
- io = StringIO.StringIO()
+ io = StringIO()
save = sys.stdout
sys.stdout = io
try:
@@ -1603,7 +1608,7 @@ class read_TestCase(TestCmdTestCase):
_file_matches(wdir_foo_file3, test.read(['foo', 'file3']),
"Test\nfile\n#3.\n")
_file_matches(wdir_foo_file3,
- test.read(UserList.UserList(['foo', 'file3'])),
+ test.read(UserList(['foo', 'file3'])),
"Test\nfile\n#3.\n")
_file_matches(wdir_file4, test.read('file4', mode = 'r'),
"Test\nfile\n#4.\n")
@@ -1861,24 +1866,24 @@ class run_verbose_TestCase(TestCmdTestCase):
interpreter = 'python',
workdir = '',
verbose = 1)
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
test.run(arguments = ['arg1 arg2'])
o = sys.stdout.getvalue()
assert o == '', o
e = sys.stderr.getvalue()
expect = 'python "%s" "arg1 arg2"\n' % t.script_path
assert expect == e, (expect, e)
-
+
testx = TestCmd.TestCmd(program = t.scriptx,
workdir = '',
verbose = 1)
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
testx.run(arguments = ['arg1 arg2'])
expect = '"%s" "arg1 arg2"\n' % t.scriptx_path
o = sys.stdout.getvalue()
@@ -1912,10 +1917,10 @@ class run_verbose_TestCase(TestCmdTestCase):
interpreter = 'python',
workdir = '',
verbose = 2)
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
test.run(arguments = ['arg1 arg2'])
line_fmt = "script: %s: %s: ['arg1 arg2']\n"
@@ -1929,14 +1934,14 @@ class run_verbose_TestCase(TestCmdTestCase):
expect = 'python "%s" "arg1 arg2"\n' % t.script_path
e = sys.stderr.getvalue()
assert e == expect, (e, expect)
-
+
testx = TestCmd.TestCmd(program = t.scriptx,
workdir = '',
verbose = 2)
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
testx.run(arguments = ['arg1 arg2'])
line_fmt = "scriptx.bat: %s: %s: ['arg1 arg2']\n"
@@ -1957,10 +1962,10 @@ class run_verbose_TestCase(TestCmdTestCase):
interpreter = 'python',
workdir = '',
verbose = 2)
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
test.run(arguments = ['arg1 arg2'])
line_fmt = "scriptout: %s: %s: ['arg1 arg2']\n"
@@ -1977,10 +1982,10 @@ class run_verbose_TestCase(TestCmdTestCase):
interpreter = 'python',
workdir = '',
verbose = 3)
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
test.run(arguments = ['arg1 arg2'])
line_fmt = "scriptout: %s: %s: ['arg1 arg2']\n"
@@ -2001,10 +2006,10 @@ class run_verbose_TestCase(TestCmdTestCase):
test = TestCmd.TestCmd(program = t.script,
interpreter = 'python',
workdir = '')
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
test.run(arguments = ['arg1 arg2'])
line_fmt = "script: %s: %s: ['arg1 arg2']\n"
@@ -2018,13 +2023,13 @@ class run_verbose_TestCase(TestCmdTestCase):
expect = 'python "%s" "arg1 arg2"\n' % t.script_path
e = sys.stderr.getvalue()
assert e == expect, (e, expect)
-
+
testx = TestCmd.TestCmd(program = t.scriptx,
workdir = '')
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
testx.run(arguments = ['arg1 arg2'])
line_fmt = "scriptx.bat: %s: %s: ['arg1 arg2']\n"
@@ -2047,24 +2052,24 @@ class run_verbose_TestCase(TestCmdTestCase):
interpreter = 'python',
workdir = '',
verbose = 1)
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
test.run(arguments = ['arg1 arg2'])
o = sys.stdout.getvalue()
assert o == '', o
e = sys.stderr.getvalue()
expect = 'python "%s" "arg1 arg2"\n' % t.script_path
assert expect == e, (expect, e)
-
+
testx = TestCmd.TestCmd(program = t.scriptx,
workdir = '',
verbose = 1)
-
- sys.stdout = StringIO.StringIO()
- sys.stderr = StringIO.StringIO()
-
+
+ sys.stdout = StringIO()
+ sys.stderr = StringIO()
+
testx.run(arguments = ['arg1 arg2'])
expect = '"%s" "arg1 arg2"\n' % t.scriptx_path
o = sys.stdout.getvalue()
@@ -2095,18 +2100,19 @@ sys.exit(0)
def test_set_diff_function_stdout(self):
"""Test set_diff_function(): stdout"""
- self.popen_python("""import sys
+ self.popen_python("""from __future__ import print_function
+import sys
sys.path = ['%s'] + sys.path
import TestCmd
test = TestCmd.TestCmd()
-print "diff:"
+print("diff:")
test.diff("a\\n", "a\\n")
-print "diff_stdout:"
+print("diff_stdout:")
test.diff_stdout("a\\n", "a\\n")
test.set_diff_function(stdout='diff_re')
-print "diff:"
+print("diff:")
test.diff(".\\n", "a\\n")
-print "diff_stdout:"
+print("diff_stdout:")
test.diff_stdout(".\\n", "a\\n")
sys.exit(0)
""" % self.orig_cwd,
@@ -2123,18 +2129,19 @@ diff_stdout:
def test_set_diff_function_stderr(self):
"""Test set_diff_function(): stderr """
- self.popen_python("""import sys
+ self.popen_python("""from __future__ import print_function
+import sys
sys.path = ['%s'] + sys.path
import TestCmd
test = TestCmd.TestCmd()
-print "diff:"
+print("diff:")
test.diff("a\\n", "a\\n")
-print "diff_stderr:"
+print("diff_stderr:")
test.diff_stderr("a\\n", "a\\n")
test.set_diff_function(stderr='diff_re')
-print "diff:"
+print("diff:")
test.diff(".\\n", "a\\n")
-print "diff_stderr:"
+print("diff_stderr:")
test.diff_stderr(".\\n", "a\\n")
sys.exit(0)
""" % self.orig_cwd,
@@ -2347,7 +2354,7 @@ while 1:
logfp.close()
""" % t.recv_out_path
t.run_env.write(t.recv_script_path, text)
- os.chmod(t.recv_script_path, 0644) # XXX UNIX-specific
+ os.chmod(t.recv_script_path, 0o644) # XXX UNIX-specific
return t
def test_start(self):
@@ -2695,9 +2702,10 @@ class stdin_TestCase(TestCmdTestCase):
def test_stdin(self):
"""Test stdin()"""
run_env = TestCmd.TestCmd(workdir = '')
- run_env.write('run', """import fileinput
+ run_env.write('run', """from __future__ import print_function
+import fileinput
for line in fileinput.input():
- print 'Y'.join(line[:-1].split('X'))
+ print('Y'.join(line[:-1].split('X')))
""")
run_env.write('input', "X on X this X line X\n")
os.chdir(run_env.workdir)
@@ -2765,11 +2773,11 @@ class subdir_TestCase(TestCmdTestCase):
assert test.subdir('bar') == 1
assert test.subdir(['foo', 'succeed']) == 1
if os.name != "nt":
- os.chmod(test.workpath('foo'), 0500)
+ os.chmod(test.workpath('foo'), 0o500)
assert test.subdir(['foo', 'fail']) == 0
assert test.subdir(['sub', 'dir', 'ectory'], 'sub') == 1
assert test.subdir('one',
- UserList.UserList(['one', 'two']),
+ UserList(['one', 'two']),
['one', 'two', 'three']) == 3
assert os.path.isdir(test.workpath('foo'))
assert os.path.isdir(test.workpath('bar'))
@@ -2962,7 +2970,7 @@ class unlink_TestCase(TestCmdTestCase):
test.unlink(['foo', 'file3a'])
assert not os.path.exists(wdir_foo_file3a)
- test.unlink(UserList.UserList(['foo', 'file3b']))
+ test.unlink(UserList(['foo', 'file3b']))
assert not os.path.exists(wdir_foo_file3b)
test.unlink([test.workdir, 'foo', 'file4'])
@@ -2971,8 +2979,8 @@ class unlink_TestCase(TestCmdTestCase):
# Make it so we can't unlink file5.
# For UNIX, remove write permission from the dir and the file.
# For Windows, open the file.
- os.chmod(test.workdir, 0500)
- os.chmod(wdir_file5, 0400)
+ os.chmod(test.workdir, 0o500)
+ os.chmod(wdir_file5, 0o400)
f = open(wdir_file5, 'r')
try:
@@ -2983,8 +2991,8 @@ class unlink_TestCase(TestCmdTestCase):
except:
raise
finally:
- os.chmod(test.workdir, 0700)
- os.chmod(wdir_file5, 0600)
+ os.chmod(test.workdir, 0o700)
+ os.chmod(wdir_file5, 0o600)
f.close()
@@ -3208,11 +3216,11 @@ class executable_TestCase(TestCmdTestCase):
def make_executable(fname):
st = os.stat(fname)
- os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]|0100))
+ os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]|0o100))
def make_non_executable(fname):
st = os.stat(fname)
- os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]&~0100))
+ os.chmod(fname, stat.S_IMODE(st[stat.ST_MODE]&~0o100))
test.executable(test.workdir, 0)
# XXX skip these tests if euid == 0?
@@ -3282,7 +3290,7 @@ class write_TestCase(TestCmdTestCase):
test.write('file9', "Test file #9.\r\n", mode = 'wb')
if os.name != "nt":
- os.chmod(test.workdir, 0500)
+ os.chmod(test.workdir, 0o500)
try:
test.write('file10', "Test file #10 (should not get created).\n")
except IOError: # expect "Permission denied"
@@ -3326,14 +3334,16 @@ class variables_TestCase(TestCmdTestCase):
'TestCmd',
]
- script = "import TestCmd\n" + \
- '\n'.join([ "print TestCmd.%s\n" % v for v in variables ])
+ script = "from __future__ import print_function\n" + \
+ "import TestCmd\n" + \
+ '\n'.join([ "print(TestCmd.%s\n)" % v for v in variables ])
run_env.run(program=sys.executable, stdin=script)
stderr = run_env.stderr()
assert stderr == "", stderr
- script = "from TestCmd import *\n" + \
- '\n'.join([ "print %s" % v for v in variables ])
+ script = "from __future__ import print_function\n" + \
+ "from TestCmd import *\n" + \
+ '\n'.join([ "print(%s)" % v for v in variables ])
run_env.run(program=sys.executable, stdin=script)
stderr = run_env.stderr()
assert stderr == "", stderr
diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py
index dc4c97c..a475ddc 100644
--- a/QMTest/TestCommon.py
+++ b/QMTest/TestCommon.py
@@ -93,6 +93,8 @@ The TestCommon module also provides the following variables
# AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+from __future__ import print_function
+
__author__ = "Steven Knight <knight at baldmt dot com>"
__revision__ = "TestCommon.py 1.3.D001 2010/06/03 12:58:27 knight"
__version__ = "1.3"
@@ -258,9 +260,9 @@ class TestCommon(TestCmd):
existing, missing = separate_files(files)
unwritable = [x for x in existing if not is_writable(x)]
if missing:
- print "Missing files: `%s'" % "', `".join(missing)
+ print("Missing files: `%s'" % "', `".join(missing))
if unwritable:
- print "Unwritable files: `%s'" % "', `".join(unwritable)
+ print("Unwritable files: `%s'" % "', `".join(unwritable))
self.fail_test(missing + unwritable)
def must_contain(self, file, required, mode = 'rb', find = None):
@@ -275,11 +277,11 @@ class TestCommon(TestCmd):
return None
contains = find(file_contents, required)
if not contains:
- print "File `%s' does not contain required string." % file
- print self.banner('Required string ')
- print required
- print self.banner('%s contents ' % file)
- print file_contents
+ print("File `%s' does not contain required string." % file)
+ print(self.banner('Required string '))
+ print(required)
+ print(self.banner('%s contents ' % file))
+ print(file_contents)
self.fail_test(not contains)
def must_contain_all(self, output, input, title=None, find=None):
@@ -306,10 +308,10 @@ class TestCommon(TestCmd):
if find(output, input) is None:
if title is None:
title = 'output'
- print 'Missing expected input from %s:' % title
- print input
- print self.banner(title + ' ')
- print output
+ print('Missing expected input from {}:'.format(title))
+ print(input)
+ print(self.banner(title + ' '))
+ print(output)
self.fail_test()
def must_contain_all_lines(self, output, lines, title=None, find=None):
@@ -444,7 +446,7 @@ class TestCommon(TestCmd):
files = [is_List(x) and os.path.join(*x) or x for x in files]
missing = [x for x in files if not os.path.exists(x) and not os.path.islink(x) ]
if missing:
- print "Missing files: `%s'" % "', `".join(missing)
+ print("Missing files: `%s'" % "', `".join(missing))
self.fail_test(missing)
def must_exist_one_of(self, files):
@@ -464,24 +466,24 @@ class TestCommon(TestCmd):
if glob.glob(xpath):
return
missing.append(xpath)
- print "Missing one of: `%s'" % "', `".join(missing)
+ print("Missing one of: `%s'" % "', `".join(missing))
self.fail_test(missing)
- def must_match(self, file, expect, mode = 'rb', match=None):
+ def must_match(self, file, expect, mode = 'rb', match=None, message=None, newline=None):
"""Matches the contents of the specified file (first argument)
against the expected contents (second argument). The expected
contents are a list of lines or a string which will be split
on newlines.
"""
- file_contents = self.read(file, mode)
+ file_contents = self.read(file, mode, newline)
if not match:
match = self.match
try:
- self.fail_test(not match(file_contents, expect))
+ self.fail_test(not match(to_str(file_contents), to_str(expect)), message=message)
except KeyboardInterrupt:
raise
except:
- print "Unexpected contents of `%s'" % file
+ print("Unexpected contents of `%s'" % file)
self.diff(expect, file_contents, 'contents ')
raise
@@ -497,11 +499,11 @@ class TestCommon(TestCmd):
return None
contains = find(file_contents, banned)
if contains:
- print "File `%s' contains banned string." % file
- print self.banner('Banned string ')
- print banned
- print self.banner('%s contents ' % file)
- print file_contents
+ print("File `%s' contains banned string." % file)
+ print(self.banner('Banned string '))
+ print(banned)
+ print(self.banner('%s contents ' % file))
+ print(file_contents)
self.fail_test(contains)
def must_not_contain_any_line(self, output, lines, title=None, find=None):
@@ -548,7 +550,7 @@ class TestCommon(TestCmd):
files = [is_List(x) and os.path.join(*x) or x for x in files]
existing = [x for x in files if os.path.exists(x) or os.path.islink(x)]
if existing:
- print "Unexpected files exist: `%s'" % "', `".join(existing)
+ print("Unexpected files exist: `%s'" % "', `".join(existing))
self.fail_test(existing)
def must_not_exist_any_of(self, files):
@@ -568,7 +570,7 @@ class TestCommon(TestCmd):
if glob.glob(xpath):
existing.append(xpath)
if existing:
- print "Unexpected files exist: `%s'" % "', `".join(existing)
+ print("Unexpected files exist: `%s'" % "', `".join(existing))
self.fail_test(existing)
def must_not_be_writable(self, *files):
@@ -580,11 +582,11 @@ class TestCommon(TestCmd):
"""
files = [is_List(x) and os.path.join(*x) or x for x in files]
existing, missing = separate_files(files)
- writable = list(filter(is_writable, existing))
+ writable = [file for file in existing if is_writable(file)]
if missing:
- print "Missing files: `%s'" % "', `".join(missing)
+ print("Missing files: `%s'" % "', `".join(missing))
if writable:
- print "Writable files: `%s'" % "', `".join(writable)
+ print("Writable files: `%s'" % "', `".join(writable))
self.fail_test(missing + writable)
def _complete(self, actual_stdout, expected_stdout,
@@ -597,23 +599,23 @@ class TestCommon(TestCmd):
expect = ''
if status != 0:
expect = " (expected %s)" % str(status)
- print "%s returned %s%s" % (self.program, _status(self), expect)
- print self.banner('STDOUT ')
- print actual_stdout
- print self.banner('STDERR ')
- print actual_stderr
+ print("%s returned %s%s" % (self.program, _status(self), expect))
+ print(self.banner('STDOUT '))
+ print(actual_stdout)
+ print(self.banner('STDERR '))
+ print(actual_stderr)
self.fail_test()
if (expected_stdout is not None
and not match(actual_stdout, expected_stdout)):
self.diff(expected_stdout, actual_stdout, 'STDOUT ')
if actual_stderr:
- print self.banner('STDERR ')
- print actual_stderr
+ print(self.banner('STDERR '))
+ print(actual_stderr)
self.fail_test()
if (expected_stderr is not None
and not match(actual_stderr, expected_stderr)):
- print self.banner('STDOUT ')
- print actual_stdout
+ print(self.banner('STDOUT '))
+ print(actual_stdout)
self.diff(expected_stderr, actual_stderr, 'STDERR ')
self.fail_test()
@@ -633,15 +635,15 @@ class TestCommon(TestCmd):
universal_newlines, **kw)
except KeyboardInterrupt:
raise
- except Exception, e:
- print self.banner('STDOUT ')
+ except Exception as e:
+ print(self.banner('STDOUT '))
try:
- print self.stdout()
+ print(self.stdout())
except IndexError:
pass
- print self.banner('STDERR ')
+ print(self.banner('STDERR '))
try:
- print self.stderr()
+ print(self.stderr())
except IndexError:
pass
cmd_args = self.command_args(program, interpreter, arguments)
diff --git a/QMTest/TestCommonTests.py b/QMTest/TestCommonTests.py
index 30b7d6a..7949cb8 100644
--- a/QMTest/TestCommonTests.py
+++ b/QMTest/TestCommonTests.py
@@ -168,10 +168,11 @@ class __init__TestCase(TestCommonTestCase):
os.chdir(run_env.workdir)
script = lstrip("""\
+ from __future__ import print_function
from TestCommon import TestCommon
tc = TestCommon(workdir='')
import os
- print os.getcwd()
+ print(os.getcwd())
""")
run_env.run(program=sys.executable, stdin=script)
stdout = run_env.stdout()[:-1]
@@ -2285,14 +2286,16 @@ class variables_TestCase(TestCommonTestCase):
'dll_suffix',
]
- script = "import TestCommon\n" + \
- '\n'.join([ "print TestCommon.%s\n" % v for v in variables ])
+ script = "from __future__ import print_function" + \
+ "import TestCommon\n" + \
+ '\n'.join([ "print(TestCommon.%s)\n" % v for v in variables ])
run_env.run(program=sys.executable, stdin=script)
stderr = run_env.stderr()
assert stderr == "", stderr
- script = "from TestCommon import *\n" + \
- '\n'.join([ "print %s" % v for v in variables ])
+ script = "from __future__ import print_function" + \
+ "from TestCommon import *\n" + \
+ '\n'.join([ "print(%s)" % v for v in variables ])
run_env.run(program=sys.executable, stdin=script)
stderr = run_env.stderr()
assert stderr == "", stderr
diff --git a/QMTest/TestRuntest.py b/QMTest/TestRuntest.py
index 4ba11ea..f2256de 100644
--- a/QMTest/TestRuntest.py
+++ b/QMTest/TestRuntest.py
@@ -12,9 +12,9 @@ from those classes, as well as any overridden or additional methods or
attributes defined in this subclass.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
-__revision__ = "QMTest/TestRuntest.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "QMTest/TestRuntest.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index 1161d50..c0b4ebc 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -12,16 +12,17 @@ from those classes, as well as any overridden or additional methods or
attributes defined in this subclass.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
-from __future__ import division
+# Copyright (c) 2001 - 2017 The SCons Foundation
+from __future__ import division, print_function
-__revision__ = "QMTest/TestSCons.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "QMTest/TestSCons.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import re
import shutil
import sys
import time
+import subprocess
from TestCommon import *
from TestCommon import __all__
@@ -34,7 +35,7 @@ from TestCmd import PIPE
# here provides some independent verification that what we packaged
# conforms to what we expect.
-default_version = '2.5.1'
+default_version = '3.0.0'
python_version_unsupported = (2, 6, 0)
python_version_deprecated = (2, 7, 0)
@@ -43,21 +44,22 @@ python_version_deprecated = (2, 7, 0)
# line must remain "__ VERSION __" (without the spaces) so the built
# version in build/QMTest/TestSCons.py contains the actual version
# string of the packages that have been built.
-SConsVersion = '2.5.1'
+SConsVersion = '3.0.0'
if SConsVersion == '__' + 'VERSION' + '__':
SConsVersion = default_version
-__all__.extend([ 'TestSCons',
- 'machine',
- 'python',
- '_exe',
- '_obj',
- '_shobj',
- 'shobj_',
- 'lib_',
- '_lib',
- 'dll_',
- '_dll'
+__all__.extend([
+ 'TestSCons',
+ 'machine',
+ 'python',
+ '_exe',
+ '_obj',
+ '_shobj',
+ 'shobj_',
+ 'lib_',
+ '_lib',
+ 'dll_',
+ '_dll'
])
machine_map = {
@@ -256,7 +258,7 @@ class TestSCons(TestCommon):
# TERM can cause test failures due to control chars in prompts etc.
os.environ['TERM'] = 'dumb'
- self.ignore_python_version = kw.get('ignore_python_version',1)
+ self.ignore_python_version = kw.get('ignore_python_version', 1)
if kw.get('ignore_python_version', -1) != -1:
del kw['ignore_python_version']
@@ -268,7 +270,7 @@ class TestSCons(TestCommon):
SCons.Node.FS.default_fs = SCons.Node.FS.FS()
try:
- self.script_srcdir = os.environ['PYTHON_SCRIPT_DIR']
+ self.fixture_dirs = (os.environ['FIXTURE_DIRS']).split(os.pathsep)
except KeyError:
pass
@@ -355,7 +357,7 @@ class TestSCons(TestCommon):
# 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:
return os.path.normpath(f)
else:
import SCons.Environment
@@ -502,9 +504,9 @@ class TestSCons(TestCommon):
self.pass_test()
else:
# test failed; have to do this by hand...
- print self.banner('STDOUT ')
- print self.stdout()
- print self.diff(warning, stderr, 'STDERR ')
+ print(self.banner('STDOUT '))
+ print(self.stdout())
+ print(self.diff(warning, stderr, 'STDERR '))
self.fail_test()
return warning
@@ -562,21 +564,26 @@ class TestSCons(TestCommon):
Returns a Python error line for output comparisons.
The exec of the traceback line gives us the correct format for
- this version of Python. Before 2.5, this yielded:
-
- File "<string>", line 1, ?
-
- Python 2.5 changed this to:
+ this version of Python.
File "<string>", line 1, <module>
We stick the requested file name and line number in the right
places, abstracting out the version difference.
"""
- exec 'import traceback; x = traceback.format_stack()[-1]'
- x = x.lstrip()
- x = x.replace('<string>', file)
- x = x.replace('line 1,', 'line %s,' % line)
+ # This routine used to use traceback to get the proper format
+ # that doesn't work well with py3. And the format of the
+ # traceback seems to be stable, so let's just format
+ # an appropriate string
+ #
+ #exec('import traceback; x = traceback.format_stack()[-1]')
+ # import traceback
+ # x = traceback.format_stack()
+ # x = # XXX: .lstrip()
+ # x = x.replace('<string>', file)
+ # x = x.replace('line 1,', 'line %s,' % line)
+ # x="\n".join(x)
+ x='File "%s", line %s, in <module>\n'%(file,line)
return x
def normalize_ps(self, s):
@@ -591,23 +598,33 @@ class TestSCons(TestCommon):
return s
+ @staticmethod
+ def to_bytes_re_sub(pattern, repl, str, count=0, flags=0):
+ """
+ Wrapper around re.sub to change pattern and repl to bytes to work with
+ both python 2 & 3
+ """
+ pattern = to_bytes(pattern)
+ repl = to_bytes(repl)
+ return re.sub(pattern, repl, str, count, flags)
+
def normalize_pdf(self, s):
- s = re.sub(r'/(Creation|Mod)Date \(D:[^)]*\)',
- r'/\1Date (D:XXXX)', s)
- s = re.sub(r'/ID \[<[0-9a-fA-F]*> <[0-9a-fA-F]*>\]',
- r'/ID [<XXXX> <XXXX>]', s)
- s = re.sub(r'/(BaseFont|FontName) /[A-Z]{6}',
- r'/\1 /XXXXXX', s)
- s = re.sub(r'/Length \d+ *\n/Filter /FlateDecode\n',
- r'/Length XXXX\n/Filter /FlateDecode\n', s)
+ s = self.to_bytes_re_sub(r'/(Creation|Mod)Date \(D:[^)]*\)',
+ r'/\1Date (D:XXXX)', s)
+ s = self.to_bytes_re_sub(r'/ID \[<[0-9a-fA-F]*> <[0-9a-fA-F]*>\]',
+ r'/ID [<XXXX> <XXXX>]', s)
+ s = self.to_bytes_re_sub(r'/(BaseFont|FontName) /[A-Z]{6}',
+ r'/\1 /XXXXXX', s)
+ s = self.to_bytes_re_sub(r'/Length \d+ *\n/Filter /FlateDecode\n',
+ r'/Length XXXX\n/Filter /FlateDecode\n', s)
try:
import zlib
except ImportError:
pass
else:
- begin_marker = '/FlateDecode\n>>\nstream\n'
- end_marker = 'endstream\nendobj'
+ begin_marker = to_bytes('/FlateDecode\n>>\nstream\n')
+ end_marker = to_bytes('endstream\nendobj')
encoded = []
b = s.find(begin_marker, 0)
@@ -622,16 +639,16 @@ class TestSCons(TestCommon):
for b, e in encoded:
r.append(s[x:b])
d = zlib.decompress(s[b:e])
- d = re.sub(r'%%CreationDate: [^\n]*\n',
- r'%%CreationDate: 1970 Jan 01 00:00:00\n', d)
- d = re.sub(r'%DVIPSSource: TeX output \d\d\d\d\.\d\d\.\d\d:\d\d\d\d',
- r'%DVIPSSource: TeX output 1970.01.01:0000', d)
- d = re.sub(r'/(BaseFont|FontName) /[A-Z]{6}',
- r'/\1 /XXXXXX', d)
+ d = self.to_bytes_re_sub(r'%%CreationDate: [^\n]*\n',
+ r'%%CreationDate: 1970 Jan 01 00:00:00\n', d)
+ d = self.to_bytes_re_sub(r'%DVIPSSource: TeX output \d\d\d\d\.\d\d\.\d\d:\d\d\d\d',
+ r'%DVIPSSource: TeX output 1970.01.01:0000', d)
+ d = self.to_bytes_re_sub(r'/(BaseFont|FontName) /[A-Z]{6}',
+ r'/\1 /XXXXXX', d)
r.append(d)
x = e
r.append(s[x:])
- s = ''.join(r)
+ s = to_bytes('').join(r)
return s
@@ -642,6 +659,21 @@ class TestSCons(TestCommon):
result.extend(sorted(glob.glob(p)))
return result
+ def unlink_sconsignfile(self,name='.sconsign.dblite'):
+ """
+ Delete sconsign file.
+ Note on python it seems to append .p3 to the file name so we take care of that
+ Parameters
+ ----------
+ name - expected name of sconsign file
+
+ Returns
+ -------
+ None
+ """
+ if sys.version_info[0] == 3:
+ name += '.p3'
+ self.unlink(name)
def java_ENV(self, version=None):
"""
@@ -685,12 +717,20 @@ class TestSCons(TestCommon):
"""
Return java include paths compiling java jni code
"""
- import glob
import sys
+
+ result = []
+ if sys.platform[:6] == 'darwin':
+ java_home = self.java_where_java_home(version)
+ jni_path = os.path.join(java_home,'include','jni.h')
+ if os.path.exists(jni_path):
+ result.append(os.path.dirname(jni_path))
+
if not version:
version=''
jni_dirs = ['/System/Library/Frameworks/JavaVM.framework/Headers/jni.h',
- '/usr/lib/jvm/default-java/include/jni.h']
+ '/usr/lib/jvm/default-java/include/jni.h',
+ '/usr/lib/jvm/java-*-oracle/include/jni.h']
else:
jni_dirs = ['/System/Library/Frameworks/JavaVM.framework/Versions/%s*/Headers/jni.h'%version]
jni_dirs.extend(['/usr/lib/jvm/java-*-sun-%s*/include/jni.h'%version,
@@ -700,7 +740,7 @@ class TestSCons(TestCommon):
if not dirs:
return None
d=os.path.dirname(self.paths(jni_dirs)[0])
- result=[d]
+ result.append(d)
if sys.platform == 'win32':
result.append(os.path.join(d,'win32'))
@@ -708,16 +748,34 @@ class TestSCons(TestCommon):
result.append(os.path.join(d,'linux'))
return result
-
- def java_where_java_home(self,version=None):
+ def java_where_java_home(self, version=None):
if sys.platform[:6] == 'darwin':
+ # osx 10.11, 10.12
+ home_tool = '/usr/libexec/java_home'
+ java_home = False
+ if os.path.exists(home_tool):
+ java_home = subprocess.check_output(home_tool).strip()
+ java_home = java_home.decode()
+
if version is None:
- home = '/System/Library/Frameworks/JavaVM.framework/Home'
+ if java_home:
+ return java_home
+ else:
+ homes = ['/System/Library/Frameworks/JavaVM.framework/Home',
+ # osx 10.10
+ '/System/Library/Frameworks/JavaVM.framework/Versions/Current/Home']
+ for home in homes:
+ if os.path.exists(home):
+ return home
+
else:
- home = '/System/Library/Frameworks/JavaVM.framework/Versions/%s/Home' % version
- if not os.path.exists(home):
- # This works on OSX 10.10
- home = '/System/Library/Frameworks/JavaVM.framework/Versions/Current/'
+ if java_home.find('jdk%s'%version) != -1:
+ return java_home
+ else:
+ home = '/System/Library/Frameworks/JavaVM.framework/Versions/%s/Home' % version
+ if not os.path.exists(home):
+ # This works on OSX 10.10
+ home = '/System/Library/Frameworks/JavaVM.framework/Versions/Current/'
else:
jar = self.java_where_jar(version)
home = os.path.normpath('%s/..'%jar)
@@ -823,12 +881,12 @@ output = None
impl = 0
opt_string = ''
for opt, arg in cmd_opts:
- if opt == '-o': output = open(arg, 'wb')
+ if opt == '-o': output = open(arg, 'w')
elif opt == '-i': impl = 1
else: opt_string = opt_string + ' ' + opt
output.write("/* mymoc.py%s */\\n" % opt_string)
for a in args:
- contents = open(a, 'rb').read()
+ contents = open(a, 'r').read()
a = a.replace('\\\\', '\\\\\\\\')
subst = r'{ my_qt_symbol( "' + a + '\\\\n" ); }'
if impl:
@@ -849,7 +907,7 @@ source = None
opt_string = ''
for arg in sys.argv[1:]:
if output_arg:
- output = open(arg, 'wb')
+ output = open(arg, 'w')
output_arg = 0
elif impl_arg:
impl = arg
@@ -863,7 +921,7 @@ for arg in sys.argv[1:]:
else:
if source:
sys.exit(1)
- source = open(arg, 'rb')
+ source = open(arg, 'r')
sourceFile = arg
output.write("/* myuic.py%s */\\n" % opt_string)
if impl:
@@ -936,7 +994,7 @@ if ARGUMENTS.get('variant_dir', 0):
else:
builddir = 'build'
VariantDir(builddir, '.', duplicate=dup)
- print builddir, dup
+ print(builddir, dup)
sconscript = Dir(builddir).File('SConscript')
else:
sconscript = File('SConscript')
@@ -958,32 +1016,6 @@ SConscript( sconscript )
# to use cygwin compilers on cmd.exe -> uncomment following line
#Configure_lib = 'm'
- def gccFortranLibs(self):
- """Test which gcc Fortran startup libraries are required.
- This should probably move into SCons itself, but is kind of hacky.
- """
- if sys.platform.find('irix') != -1:
- return ['ftn']
-
- libs = ['g2c']
- cmd = ['gcc','-v']
-
- try:
- p = Popen(cmd, stdout=PIPE, stderr=PIPE)
- stdout, stderr = p.communicate()
- except:
- return libs
-
- m = re.search('(gcc\s+version|gcc-Version)\s+(\d\.\d)', stderr)
- if m:
- gcc_version = m.group(2)
- if re.match('4.[^0]', gcc_version):
- libs = ['gfortranbegin']
- elif gcc_version in ('3.1', '4.0'):
- libs = ['frtbegin'] + libs
-
- return libs
-
def skip_if_not_msvc(self, check_platform=True):
""" Check whether we are on a Windows platform and skip the
test if not. This check can be omitted by setting
@@ -1009,53 +1041,113 @@ SConscript( sconscript )
def checkLogAndStdout(self, checks, results, cached,
logfile, sconf_dir, sconstruct,
- doCheckLog=1, doCheckStdout=1):
+ doCheckLog=True, doCheckStdout=True):
+ """
+ Used to verify the expected output from using Configure()
+ via the contents of one or both of stdout or config.log file.
+ The checks, results, cached parameters all are zipped together
+ for use in comparing results.
+
+ TODO: Perhaps a better API makes sense?
+
+ Parameters
+ ----------
+ checks : The Configure checks being run
+
+ results : The expected results for each check
+
+ cached : If the corresponding check is expected to be cached
+
+ logfile : Name of the config log
+
+ sconf_dir : Name of the sconf dir
+
+ sconstruct : SConstruct file name
+
+ doCheckLog : check specified log file, defaults to true
+
+ doCheckStdout : Check stdout, defaults to true
+
+ Returns
+ -------
+
+ """
class NoMatch(Exception):
def __init__(self, p):
self.pos = p
def matchPart(log, logfile, lastEnd, NoMatch=NoMatch):
+ """
+ Match part of the logfile
+ """
m = re.match(log, logfile[lastEnd:])
if not m:
raise NoMatch(lastEnd)
return m.end() + lastEnd
+
try:
- #print len(os.linesep)
- ls = os.linesep
- nols = "("
- for i in range(len(ls)):
- nols = nols + "("
- for j in range(i):
- nols = nols + ls[j]
- nols = nols + "[^" + ls[i] + "])"
- if i < len(ls)-1:
- nols = nols + "|"
- nols = nols + ")"
+
+ # Build regexp for a character which is not
+ # a linesep, and in the case of CR/LF
+ # build it with both CR and CR/LF
+ # TODO: Not sure why this is a good idea. A static string
+ # could do the same since we only have two variations
+ # to do with?
+ # ls = os.linesep
+ # nols = "("
+ # for i in range(len(ls)):
+ # nols = nols + "("
+ # for j in range(i):
+ # nols = nols + ls[j]
+ # nols = nols + "[^" + ls[i] + "])"
+ # if i < len(ls)-1:
+ # nols = nols + "|"
+ # nols = nols + ")"
+ #
+ # Replaced above logic with \n as we're reading the file
+ # using non-binary read. Python will translate \r\n -> \n
+ # For us.
+ ls = '\n'
+ nols = '([^\n])'
lastEnd = 0
- logfile = self.read(self.workpath(logfile))
+
+ # Read the whole logfile
+ logfile = self.read(self.workpath(logfile), mode='r')
+
+ # Some debug code to keep around..
+ # sys.stderr.write("LOGFILE[%s]:%s"%(type(logfile),logfile))
+
if (doCheckLog and
- logfile.find( "scons: warning: The stored build "
- "information has an unexpected class." ) >= 0):
+ logfile.find("scons: warning: The stored build information has an unexpected class.") >= 0):
self.fail_test()
+
sconf_dir = sconf_dir
sconstruct = sconstruct
log = r'file\ \S*%s\,line \d+:' % re.escape(sconstruct) + ls
- if doCheckLog: lastEnd = matchPart(log, logfile, lastEnd)
+ if doCheckLog:
+ lastEnd = matchPart(log, logfile, lastEnd)
+
log = "\t" + re.escape("Configure(confdir = %s)" % sconf_dir) + ls
- if doCheckLog: lastEnd = matchPart(log, logfile, lastEnd)
+ if doCheckLog:
+ lastEnd = matchPart(log, logfile, lastEnd)
+
rdstr = ""
cnt = 0
for check,result,cache_desc in zip(checks, results, cached):
log = re.escape("scons: Configure: " + check) + ls
- if doCheckLog: lastEnd = matchPart(log, logfile, lastEnd)
+
+ if doCheckLog:
+ lastEnd = matchPart(log, logfile, lastEnd)
+
log = ""
result_cached = 1
for bld_desc in cache_desc: # each TryXXX
for ext, flag in bld_desc: # each file in TryBuild
file = os.path.join(sconf_dir,"conftest_%d%s" % (cnt, ext))
if flag == self.NCR:
+ # NCR = Non Cached Rebuild
# rebuild will pass
if ext in ['.c', '.cpp']:
log=log + re.escape(file + " <-") + ls
@@ -1064,6 +1156,7 @@ SConscript( sconscript )
log=log + "(" + nols + "*" + ls +")*?"
result_cached = 0
if flag == self.CR:
+ # CR = cached rebuild (up to date)s
# up to date
log=log + \
re.escape("scons: Configure: \"%s\" is up to date."
@@ -1089,33 +1182,36 @@ SConscript( sconscript )
result = "(cached) " + result
rdstr = rdstr + re.escape(check) + re.escape(result) + "\n"
log=log + re.escape("scons: Configure: " + result) + ls + ls
- if doCheckLog: lastEnd = matchPart(log, logfile, lastEnd)
+
+ if doCheckLog:
+ lastEnd = matchPart(log, logfile, lastEnd)
+
log = ""
if doCheckLog: lastEnd = matchPart(ls, logfile, lastEnd)
if doCheckLog and lastEnd != len(logfile):
raise NoMatch(lastEnd)
- except NoMatch, m:
- print "Cannot match log file against log regexp."
- print "log file: "
- print "------------------------------------------------------"
- print logfile[m.pos:]
- print "------------------------------------------------------"
- print "log regexp: "
- print "------------------------------------------------------"
- print log
- print "------------------------------------------------------"
+ except NoMatch as m:
+ print("Cannot match log file against log regexp.")
+ print("log file: ")
+ print("------------------------------------------------------")
+ print(logfile[m.pos:])
+ print("------------------------------------------------------")
+ print("log regexp: ")
+ print("------------------------------------------------------")
+ print(log)
+ print("------------------------------------------------------")
self.fail_test()
if doCheckStdout:
exp_stdout = self.wrap_stdout(".*", rdstr)
if not self.match_re_dotall(self.stdout(), exp_stdout):
- print "Unexpected stdout: "
- print "-----------------------------------------------------"
- print repr(self.stdout())
- print "-----------------------------------------------------"
- print repr(exp_stdout)
- print "-----------------------------------------------------"
+ print("Unexpected stdout: ")
+ print("-----------------------------------------------------")
+ print(repr(self.stdout()))
+ print("-----------------------------------------------------")
+ print(repr(exp_stdout))
+ print("-----------------------------------------------------")
self.fail_test()
def get_python_version(self):
@@ -1149,12 +1245,15 @@ except AttributeError:
try:
import distutils.sysconfig
exec_prefix = distutils.sysconfig.EXEC_PREFIX
- print distutils.sysconfig.get_python_inc()
- print os.path.join(exec_prefix, 'libs')
+ print(distutils.sysconfig.get_python_inc())
+ lib_path = os.path.join(exec_prefix, 'libs')
+ if not os.path.exists(lib_path):
+ lib_path = os.path.join(exec_prefix, 'lib')
+ print(lib_path)
except:
- print os.path.join(sys.prefix, 'include', py_ver)
- print os.path.join(sys.prefix, 'lib', py_ver, 'config')
-print py_ver
+ print(os.path.join(sys.prefix, 'include', py_ver))
+ print(os.path.join(sys.prefix, 'lib', py_ver, 'config'))
+print(py_ver)
""")
return [python] + self.stdout().strip().split('\n')
@@ -1214,6 +1313,12 @@ print py_ver
alt_cpp_suffix = '.C'
return alt_cpp_suffix
+ def platform_has_symlink(self):
+ if not hasattr(os, 'symlink') or sys.platform == 'win32':
+ return False
+ else:
+ return True
+
class Stat:
def __init__(self, name, units, expression, convert=None):
diff --git a/QMTest/TestSConsMSVS.py b/QMTest/TestSConsMSVS.py
index 537ba17..30eea76 100644
--- a/QMTest/TestSConsMSVS.py
+++ b/QMTest/TestSConsMSVS.py
@@ -13,13 +13,15 @@ as well as any overridden or additional methods or attributes defined
in this subclass.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
-__revision__ = "QMTest/TestSConsMSVS.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "QMTest/TestSConsMSVS.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import sys
import platform
+import traceback
+from xml.etree import ElementTree
from TestSCons import *
from TestSCons import __all__
@@ -1037,8 +1039,8 @@ class TestSConsMSVS(TestSCons):
input = """\
import SCons
import SCons.Tool.MSCommon
-print "self.scons_version =", repr(SCons.__%s__)
-print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
+print("self.scons_version =", repr(SCons.__%s__))
+print("self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions()))
""" % 'version'
self.run(arguments = '-n -q -Q -f -', stdin = input)
@@ -1054,7 +1056,7 @@ print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
enginepath = repr(os.path.join(self._cwd, '..', 'engine'))
replace = 'sys.path = [ %s, join(sys' % enginepath
- contents = self.read(fname)
+ contents = self.read(fname, mode='r')
contents = contents.replace(orig, replace)
self.write(fname, contents)
@@ -1149,13 +1151,25 @@ print "self._msvs_versions =", str(SCons.Tool.MSCommon.query_versions())
try:
host = _ARCH_TO_CANONICAL[host_platform]
- except KeyError, e:
+ except KeyError as e:
# Default to x86 for all other platforms
host = 'x86'
return host
+ def validate_msvs_file(self, file):
+ try:
+ x = ElementTree.parse(file)
+ except:
+ print("--------------------------------------------------------------")
+ print("--------------------------------------------------------------")
+ print(traceback.format_exc())
+ print("Failed to validate xml in MSVS file: ")
+ print(file)
+ print("--------------------------------------------------------------")
+ print("--------------------------------------------------------------")
+ self.fail_test()
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/QMTest/TestSCons_time.py b/QMTest/TestSCons_time.py
index e84f7dc..f74906a 100644
--- a/QMTest/TestSCons_time.py
+++ b/QMTest/TestSCons_time.py
@@ -11,9 +11,9 @@ from those classes, as well as any overridden or additional methods or
attributes defined in this subclass.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
-__revision__ = "QMTest/TestSCons_time.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "QMTest/TestSCons_time.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
@@ -28,8 +28,9 @@ __all__.extend([ 'TestSCons_time',
])
SConstruct = """\
+from __future__ import print_function
import os
-print "SConstruct file directory:", os.getcwd()
+print("SConstruct file directory:", os.getcwd())
"""
scons_py = """\
@@ -43,12 +44,12 @@ def write_args(fp, args):
write_args(sys.stdout, sys.argv)
for arg in sys.argv[1:]:
if arg[:10] == '--profile=':
- profile = open(arg[10:], 'wb')
+ profile = open(arg[10:], 'w')
profile.write('--profile\\n')
write_args(profile, sys.argv)
break
sys.stdout.write('SCONS_LIB_DIR = ' + os.environ['SCONS_LIB_DIR'] + '\\n')
-exec(open('SConstruct', 'rU').read())
+exec(open('SConstruct', 'r').read())
"""
aegis_py = """\
@@ -225,7 +226,7 @@ class TestSCons_time(TestCommon):
def write_fake_aegis_py(self, name):
name = self.workpath(name)
self.write(name, aegis_py)
- os.chmod(name, 0755)
+ os.chmod(name, 0o755)
return name
def write_fake_scons_py(self):
@@ -235,7 +236,7 @@ class TestSCons_time(TestCommon):
def write_fake_svn_py(self, name):
name = self.workpath(name)
self.write(name, svn_py)
- os.chmod(name, 0755)
+ os.chmod(name, 0o755)
return name
def write_sample_directory(self, archive, dir, files):
@@ -245,7 +246,7 @@ class TestSCons_time(TestCommon):
d, f = os.path.split(path)
if not os.path.isdir(d):
os.makedirs(d)
- open(path, 'wb').write(content)
+ open(path, 'w').write(content)
return dir
def write_sample_tarfile(self, archive, dir, files):
@@ -270,7 +271,7 @@ class TestSCons_time(TestCommon):
tar = tarfile.open(archive, mode[suffix])
for name, content in files:
path = os.path.join(dir, name)
- open(path, 'wb').write(content)
+ open(path, 'wb').write(bytearray(content,'utf-8'))
tarinfo = tar.gettarinfo(path, path)
tarinfo.uid = 111
tarinfo.gid = 111
@@ -295,7 +296,7 @@ class TestSCons_time(TestCommon):
zip = zipfile.ZipFile(archive, 'w')
for name, content in files:
path = os.path.join(dir, name)
- open(path, 'wb').write(content)
+ open(path, 'w').write(content)
zip.write(path)
zip.close()
shutil.rmtree(dir)
diff --git a/QMTest/TestSConsign.py b/QMTest/TestSConsign.py
index 2016afc..df34aa8 100644
--- a/QMTest/TestSConsign.py
+++ b/QMTest/TestSConsign.py
@@ -1,6 +1,7 @@
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
+from __future__ import print_function
-__revision__ = "QMTest/TestSConsign.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "QMTest/TestSConsign.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """
TestSConsign.py: a testing framework for the "sconsign" script
@@ -68,7 +69,7 @@ class TestSConsign(TestSCons):
elif os.path.exists(self.script_path('sconsign')):
sconsign = 'sconsign'
else:
- print "Can find neither 'sconsign.py' nor 'sconsign' scripts."
+ print("Can find neither 'sconsign.py' nor 'sconsign' scripts.")
self.no_result()
self.set_sconsign(sconsign)
diff --git a/QMTest/scons_tdb.py b/QMTest/scons_tdb.py
index 18e6a59..c3b082f 100644
--- a/QMTest/scons_tdb.py
+++ b/QMTest/scons_tdb.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 @@
# 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
"""
QMTest classes to support SCons' testing and Aegis-inspired workflow.
@@ -28,7 +28,7 @@ QMTest classes to support SCons' testing and Aegis-inspired workflow.
Thanks to Stefan Seefeld for the initial code.
"""
-__revision__ = "QMTest/scons_tdb.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "QMTest/scons_tdb.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
########################################################################
# Imports
@@ -337,14 +337,14 @@ class AegisChangeStream(AegisStream):
# We'd like to use the _FormatStatistics() method to do
# this, but it's wrapped around the list in Result.outcomes,
# so it's simpler to just do it ourselves.
- print " %6d tests total\n" % self._num_tests
+ print(" %6d tests total\n" % self._num_tests)
for outcome in AegisTest.aegis_outcomes:
if self._outcome_counts[outcome] != 0:
- print " %6d (%3.0f%%) tests %s" % (
+ print(" %6d (%3.0f%%) tests %s" % (
self._outcome_counts[outcome],
self._percent(outcome),
outcome
- )
+ ))
class AegisBaselineStream(AegisStream):
def WriteResult(self, result):
@@ -368,19 +368,19 @@ class AegisBaselineStream(AegisStream):
# this, but it's wrapped around the list in Result.outcomes,
# so it's simpler to just do it ourselves.
if self._outcome_counts[AegisTest.FAIL]:
- print " %6d (%3.0f%%) tests as expected" % (
+ print(" %6d (%3.0f%%) tests as expected" % (
self._outcome_counts[AegisTest.FAIL],
self._percent(AegisTest.FAIL),
- )
+ ))
non_fail_outcomes = list(AegisTest.aegis_outcomes[:])
non_fail_outcomes.remove(AegisTest.FAIL)
for outcome in non_fail_outcomes:
if self._outcome_counts[outcome] != 0:
- print " %6d (%3.0f%%) tests unexpected %s" % (
+ print(" %6d (%3.0f%%) tests unexpected %s" % (
self._outcome_counts[outcome],
self._percent(outcome),
outcome,
- )
+ ))
class AegisBatchStream(FileResultStream):
def __init__(self, arguments):
diff --git a/README.rst b/README.rst
index ca1b081..258d6a1 100644
--- a/README.rst
+++ b/README.rst
@@ -168,7 +168,7 @@ Or on Windows::
By default, the above commands will do the following:
-- Install the version-numbered "scons-2.5.1" and "sconsign-2.5.1" scripts in
+- Install the version-numbered "scons-3.0.0" and "sconsign-3.0.0" scripts in
the default system script directory (/usr/bin or C:\\Python\*\\Scripts, for
example). This can be disabled by specifying the "--no-version-script"
option on the command line.
@@ -180,23 +180,23 @@ By default, the above commands will do the following:
before making it the default on your system.
On UNIX or Linux systems, you can have the "scons" and "sconsign" scripts be
- hard links or symbolic links to the "scons-2.5.1" and "sconsign-2.5.1"
+ hard links or symbolic links to the "scons-3.0.0" and "sconsign-3.0.0"
scripts by specifying the "--hardlink-scons" or "--symlink-scons" options on
the command line.
-- Install "scons-2.5.1.bat" and "scons.bat" wrapper scripts in the Python
+- Install "scons-3.0.0.bat" and "scons.bat" wrapper scripts in the Python
prefix directory on Windows (C:\\Python\*, for example). This can be disabled
by specifying the "--no-install-bat" option on the command line.
On UNIX or Linux systems, the "--install-bat" option may be specified to
- have "scons-2.5.1.bat" and "scons.bat" files installed in the default system
+ have "scons-3.0.0.bat" and "scons.bat" files installed in the default system
script directory, which is useful if you want to install SCons in a shared
file system directory that can be used to execute SCons from both UNIX/Linux
and Windows systems.
- Install the SCons build engine (a Python module) in an appropriate
- version-numbered SCons library directory (/usr/lib/scons-2.5.1 or
- C:\\Python\*\\scons-2.5.1, for example). See below for more options related to
+ version-numbered SCons library directory (/usr/lib/scons-3.0.0 or
+ C:\\Python\*\\scons-3.0.0, for example). See below for more options related to
installing the build engine library.
- Install the troff-format man pages in an appropriate directory on UNIX or
@@ -474,7 +474,7 @@ running all of "runtest.py -a".
Building Packages
=================
-We use SCons (version 2.5.1 or later) to build its own packages. If you
+We use SCons (version 3.0.0 or later) to build its own packages. If you
already have an appropriate version of SCons installed on your system, you can
build everything by simply running it::
@@ -489,18 +489,18 @@ about `Executing SCons Without Installing`_)::
Depending on the utilities installed on your system, any or all of the
following packages will be built::
- build/dist/scons-2.5.1-1.noarch.rpm
- build/dist/scons-2.5.1-1.src.rpm
- build/dist/scons-2.5.1.linux-i686.tar.gz
- build/dist/scons-2.5.1.tar.gz
- build/dist/scons-2.5.1.win32.exe
- build/dist/scons-2.5.1.zip
- build/dist/scons-doc-2.5.1.tar.gz
- build/dist/scons-local-2.5.1.tar.gz
- build/dist/scons-local-2.5.1.zip
- build/dist/scons-src-2.5.1.tar.gz
- build/dist/scons-src-2.5.1.zip
- build/dist/scons_2.5.1-1_all.deb
+ build/dist/scons-3.0.0-1.noarch.rpm
+ build/dist/scons-3.0.0-1.src.rpm
+ build/dist/scons-3.0.0.linux-i686.tar.gz
+ build/dist/scons-3.0.0.tar.gz
+ build/dist/scons-3.0.0.win32.exe
+ build/dist/scons-3.0.0.zip
+ build/dist/scons-doc-3.0.0.tar.gz
+ build/dist/scons-local-3.0.0.tar.gz
+ build/dist/scons-local-3.0.0.zip
+ build/dist/scons-src-3.0.0.tar.gz
+ build/dist/scons-src-3.0.0.zip
+ build/dist/scons_3.0.0-1_all.deb
The SConstruct file is supposed to be smart enough to avoid trying to build
packages for which you don't have the proper utilities installed. For
@@ -664,7 +664,7 @@ section of small examples for getting started using SCons.
Additional documentation for SCons is available at:
- http://www.scons.org/documentation.php
+ http://www.scons.org/documentation
Licensing
@@ -724,7 +724,7 @@ If you find SCons helpful, please consider making a donation (of cash,
software, or hardware) to support continued work on the project. Information
is available at:
- http://www.scons.org/donate.php
+ http://www.scons.org/donate.html
For More Information
@@ -760,5 +760,5 @@ many contributors, including but not at all limited to:
\... and many others.
-Copyright (c) 2001 - 2015 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
diff --git a/SConstruct b/SConstruct
index 16d01d2..68f9e3f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -3,13 +3,15 @@
#
# See the README.rst file for an overview of how SCons is built and tested.
-copyright_years = '2001 - 2016'
+from __future__ import print_function
+
+copyright_years = '2001 - 2017'
# This gets inserted into the man pages to reflect the month of release.
-month_year = 'November 2016'
+month_year = 'September 2017'
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -39,11 +41,12 @@ import re
import stat
import sys
import tempfile
+import time
import bootstrap
project = 'scons'
-default_version = '2.5.1'
+default_version = '3.0.0'
copyright = "Copyright (c) %s The SCons Foundation" % copyright_years
platform = distutils.util.get_platform()
@@ -53,7 +56,7 @@ def is_windows():
return True
else:
return False
-
+
SConsignFile()
#
@@ -73,7 +76,7 @@ def whereis(file):
st = os.stat(f_ext)
except:
continue
- if stat.S_IMODE(st[stat.ST_MODE]) & 0111:
+ if stat.S_IMODE(st[stat.ST_MODE]) & 0o111:
return f_ext
return None
@@ -96,9 +99,13 @@ zip = whereis('zip')
#
date = ARGUMENTS.get('DATE')
if not date:
- import time
date = time.strftime("%Y/%m/%d %H:%M:%S", time.localtime(time.time()))
+# Datestring for debian
+# Should look like: Mon, 03 Nov 2016 13:37:42 -0700
+deb_date = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime())
+
+
developer = ARGUMENTS.get('DEVELOPER')
if not developer:
for variable in ['USERNAME', 'LOGNAME', 'USER']:
@@ -160,8 +167,17 @@ import distutils.command
no_winpack_templates = not os.path.exists(os.path.join(os.path.split(distutils.command.__file__)[0],'wininst-9.0.exe'))
skip_win_packages = ARGUMENTS.get('SKIP_WIN_PACKAGES',False) or no_winpack_templates
+
+if sys.version_info[0] > 2:
+ # TODO: Resolve this issue. Currently fails when run on windows with
+ # File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/bdist_wininst.py", line 262, in create_exe
+ # cfgdata = cfgdata.encode("mbcs")
+ # LookupError: unknown encoding: mbcs
+ print("Temporary PY3: Skipping windows package builds")
+ skip_win_packages = True
+
if skip_win_packages:
- print "Skipping the build of Windows packages..."
+ print("Skipping the build of Windows packages...")
python_ver = sys.version[0:3]
@@ -324,22 +340,25 @@ try:
import zipfile
def zipit(env, target, source):
- print "Zipping %s:" % str(target[0])
- def visit(arg, dirname, names):
- for name in names:
- path = os.path.join(dirname, name)
+ print("Zipping %s:" % str(target[0]))
+ def visit(arg, dirname, filenames):
+ for filename in filenames:
+ path = os.path.join(dirname, filename)
if os.path.isfile(path):
arg.write(path)
# default ZipFile compression is ZIP_STORED
zf = zipfile.ZipFile(str(target[0]), 'w', compression=zipfile.ZIP_DEFLATED)
olddir = os.getcwd()
os.chdir(env['CD'])
- try: os.path.walk(env['PSV'], visit, zf)
- finally: os.chdir(olddir)
+ try:
+ for dirname, dirnames, filenames in os.walk(env['PSV']):
+ visit(zf, dirname, filenames)
+ finally:
+ os.chdir(olddir)
zf.close()
def unzipit(env, target, source):
- print "Unzipping %s:" % str(source[0])
+ print("Unzipping %s:" % str(source[0]))
zf = zipfile.ZipFile(str(source[0]), 'r')
for name in zf.namelist():
dest = os.path.join(env['UNPACK_ZIP_DIR'], name)
@@ -348,19 +367,21 @@ try:
os.makedirs(dir)
except:
pass
- print dest,name
+ print(dest,name)
# if the file exists, then delete it before writing
# to it so that we don't end up trying to write to a symlink:
if os.path.isfile(dest) or os.path.islink(dest):
os.unlink(dest)
if not os.path.isdir(dest):
- open(dest, 'wb').write(zf.read(name))
+ with open(dest, 'wb') as fp:
+ fp.write(zf.read(name))
except ImportError:
if unzip and zip:
zipit = "cd $CD && $ZIP $ZIPFLAGS $( ${TARGET.abspath} $) $PSV"
unzipit = "$UNZIP $UNZIPFLAGS $SOURCES"
+
def SCons_revision(target, source, env):
"""Interpolate specific values from the environment into a file.
@@ -369,23 +390,38 @@ def SCons_revision(target, source, env):
"""
t = str(target[0])
s = source[0].rstr()
- contents = open(s, 'rb').read()
- # Note: We construct the __*__ substitution strings here
- # so that they don't get replaced when this file gets
- # copied into the tree for packaging.
- contents = contents.replace('__BUILD' + '__', env['BUILD'])
- contents = contents.replace('__BUILDSYS' + '__', env['BUILDSYS'])
- contents = contents.replace('__COPYRIGHT' + '__', env['COPYRIGHT'])
- contents = contents.replace('__DATE' + '__', env['DATE'])
- contents = contents.replace('__DEVELOPER' + '__', env['DEVELOPER'])
- contents = contents.replace('__FILE' + '__', str(source[0]).replace('\\', '/'))
- contents = contents.replace('__MONTH_YEAR'+ '__', env['MONTH_YEAR'])
- contents = contents.replace('__REVISION' + '__', env['REVISION'])
- contents = contents.replace('__VERSION' + '__', env['VERSION'])
- contents = contents.replace('__NULL' + '__', '')
- open(t, 'wb').write(contents)
+
+ try:
+ with open(s, 'r') as fp:
+ contents = fp.read()
+
+
+ # Note: We construct the __*__ substitution strings here
+ # so that they don't get replaced when this file gets
+ # copied into the tree for packaging.
+ contents = contents.replace('__BUILD' + '__', env['BUILD'])
+ contents = contents.replace('__BUILDSYS' + '__', env['BUILDSYS'])
+ contents = contents.replace('__COPYRIGHT' + '__', env['COPYRIGHT'])
+ contents = contents.replace('__DATE' + '__', env['DATE'])
+ contents = contents.replace('__DEB_DATE' + '__', env['DEB_DATE'])
+
+ contents = contents.replace('__DEVELOPER' + '__', env['DEVELOPER'])
+ contents = contents.replace('__FILE' + '__', str(source[0]).replace('\\', '/'))
+ contents = contents.replace('__MONTH_YEAR'+ '__', env['MONTH_YEAR'])
+ contents = contents.replace('__REVISION' + '__', env['REVISION'])
+ contents = contents.replace('__VERSION' + '__', env['VERSION'])
+ contents = contents.replace('__NULL' + '__', '')
+ open(t, 'w').write(contents)
+ except UnicodeDecodeError as e:
+ print("Error decoding file:%s just copying no revision edit")
+ with open(s, 'rb') as fp:
+ contents = fp.read()
+ open(t, 'wb').write(contents)
+
+
os.chmod(t, os.stat(s)[0])
+
revaction = SCons_revision
revbuilder = Builder(action = Action(SCons_revision,
varlist=['COPYRIGHT', 'VERSION']))
@@ -434,12 +470,12 @@ env = Environment(
BUILDSYS = build_system,
COPYRIGHT = copyright,
DATE = date,
+ DEB_DATE = deb_date,
DEVELOPER = developer,
DISTDIR = os.path.join(build_dir, 'dist'),
MONTH_YEAR = month_year,
REVISION = revision,
VERSION = version,
- DH_COMPAT = 2,
TAR_HFLAG = tar_hflag,
@@ -499,7 +535,8 @@ python_scons = {
'debian_deps' : [
'debian/changelog',
- 'debian/control',
+ 'debian/compat',
+ 'debian/control',
'debian/copyright',
'debian/dirs',
'debian/docs',
@@ -559,7 +596,7 @@ else:
i = install_egg_info(dist)
i.finalize_options()
import os.path
- print os.path.split(i.outputs[0])[1]
+ print(os.path.split(i.outputs[0])[1])
""" % version
try:
@@ -576,43 +613,6 @@ finally:
except EnvironmentError:
pass
-#
-# The original packaging scheme would have have required us to push
-# the Python version number into the package name (python1.5-scons,
-# python2.0-scons, etc.), which would have required a definition
-# like the following. Leave this here in case we ever decide to do
-# this in the future, but note that this would require some modification
-# to src/engine/setup.py before it would really work.
-#
-#python2_scons = {
-# 'pkg' : 'python2-' + project,
-# 'src_subdir' : 'engine',
-# 'inst_subdir' : os.path.join('lib', 'python2.2', 'site-packages'),
-#
-# 'debian_deps' : [
-# 'debian/changelog',
-# 'debian/control',
-# 'debian/copyright',
-# 'debian/dirs',
-# 'debian/docs',
-# 'debian/postinst',
-# 'debian/prerm',
-# 'debian/rules',
-# ],
-#
-# 'files' : [
-# 'LICENSE.txt',
-# 'README.txt',
-# 'setup.cfg',
-# 'setup.py',
-# ],
-# 'filemap' : {
-# 'LICENSE.txt' : '../LICENSE.txt',
-# },
-# 'buildermap' : {},
-#}
-#
-
scons_script = {
'pkg' : project + '-script',
'src_subdir' : 'script',
@@ -621,6 +621,7 @@ scons_script = {
'debian_deps' : [
'debian/changelog',
+ 'debian/compat',
'debian/control',
'debian/copyright',
'debian/dirs',
@@ -665,6 +666,7 @@ scons = {
'debian_deps' : [
'debian/changelog',
+ 'debian/compat',
'debian/control',
'debian/copyright',
'debian/dirs',
@@ -734,7 +736,7 @@ for p in [ scons ]:
platform_zip = os.path.join(build,
'dist',
"%s.%s.zip" % (pkg_version, platform))
-
+
#
# Update the environment with the relevant information
@@ -774,11 +776,16 @@ for p in [ scons ]:
for sp in p['subpkgs']:
ssubdir = sp['src_subdir']
isubdir = p['subinst_dirs'][sp['pkg']]
+
+
MANIFEST_in = File(os.path.join(src, ssubdir, 'MANIFEST.in')).rstr()
MANIFEST_in_list.append(MANIFEST_in)
files = bootstrap.parseManifestLines(os.path.join(src, ssubdir), open(MANIFEST_in).readlines())
+
raw_files.extend(files)
src_files.extend([os.path.join(ssubdir, x) for x in files])
+
+
for f in files:
r = os.path.join(sp['rpm_dir'], f)
rpm_files.append(r)
@@ -807,14 +814,16 @@ for p in [ scons ]:
#
# Now run everything in src_file through the sed command we
- # concocted to expand SConstruct, 2.5.1, etc.
+ # concocted to expand SConstruct, 3.0.0, etc.
#
for b in src_files:
s = p['filemap'].get(b, b)
if not s[0] == '$' and not os.path.isabs(s):
s = os.path.join(src, s)
+
builder = p['buildermap'].get(b, env.SCons_revision)
x = builder(os.path.join(build, b), s)
+
Local(x)
#
@@ -829,7 +838,7 @@ for p in [ scons ]:
def write_src_files(target, source, **kw):
global src_files
src_files.sort()
- f = open(str(target[0]), 'wb')
+ f = open(str(target[0]), 'w')
for file in src_files:
f.write(file + "\n")
f.close()
@@ -856,11 +865,11 @@ for p in [ scons ]:
for target in distutils_targets:
dist_target = env.Install('$DISTDIR', target)
- AddPostAction(dist_target, Chmod(dist_target, 0644))
+ AddPostAction(dist_target, Chmod(dist_target, 0o644))
dist_distutils_targets += dist_target
if not gzip:
- print "gzip not found in %s; skipping .tar.gz package for %s." % (os.environ['PATH'], pkg)
+ print("gzip not found in %s; skipping .tar.gz package for %s." % (os.environ['PATH'], pkg))
else:
distutils_formats.append('gztar')
@@ -872,8 +881,8 @@ for p in [ scons ]:
dist_tar_gz = env.Install('$DISTDIR', tar_gz)
dist_platform_tar_gz = env.Install('$DISTDIR', platform_tar_gz)
Local(dist_tar_gz, dist_platform_tar_gz)
- AddPostAction(dist_tar_gz, Chmod(dist_tar_gz, 0644))
- AddPostAction(dist_platform_tar_gz, Chmod(dist_platform_tar_gz, 0644))
+ AddPostAction(dist_tar_gz, Chmod(dist_tar_gz, 0o644))
+ AddPostAction(dist_platform_tar_gz, Chmod(dist_platform_tar_gz, 0o644))
#
# Unpack the tar.gz archive created by the distutils into
@@ -923,11 +932,14 @@ for p in [ scons ]:
ebuild = os.path.join(gentoo, 'scons-%s.ebuild' % version)
digest = os.path.join(gentoo, 'files', 'digest-scons-%s' % version)
env.Command(ebuild, os.path.join('gentoo', 'scons.ebuild.in'), SCons_revision)
+
def Digestify(target, source, env):
- import md5
+ import hashlib
src = source[0].rfile()
- contents = open(str(src)).read()
- sig = md5.new(contents).hexdigest()
+ contents = open(str(src),'rb').read()
+ m = hashlib.md5()
+ m.update(contents)
+ sig = m.hexdigest()
bytes = os.stat(str(src))[6]
open(str(target[0]), 'w').write("MD5 %s %s %d\n" % (sig,
src.name,
@@ -935,7 +947,7 @@ for p in [ scons ]:
env.Command(digest, tar_gz, Digestify)
if not zipit:
- print "zip not found; skipping .zip package for %s." % pkg
+ print("zip not found; skipping .zip package for %s." % pkg)
else:
distutils_formats.append('zip')
@@ -947,8 +959,8 @@ for p in [ scons ]:
dist_zip = env.Install('$DISTDIR', zip)
dist_platform_zip = env.Install('$DISTDIR', platform_zip)
Local(dist_zip, dist_platform_zip)
- AddPostAction(dist_zip, Chmod(dist_zip, 0644))
- AddPostAction(dist_platform_zip, Chmod(dist_platform_zip, 0644))
+ AddPostAction(dist_zip, Chmod(dist_zip, 0o644))
+ AddPostAction(dist_platform_zip, Chmod(dist_platform_zip, 0o644))
#
# Unpack the zip archive created by the distutils into
@@ -1011,10 +1023,10 @@ for p in [ scons ]:
list generated from our MANIFEST(s), so we don't have to
maintain multiple lists.
"""
- c = open(str(source[0]), 'rb').read()
+ c = open(str(source[0]), 'r').read()
c = c.replace('__VERSION' + '__', env['VERSION'])
c = c.replace('__RPM_FILES' + '__', env['RPM_FILES'])
- open(str(target[0]), 'wb').write(c)
+ open(str(target[0]), 'w').write(c)
rpm_files.sort()
rpm_files_str = "\n".join(rpm_files) + "\n"
@@ -1035,8 +1047,8 @@ for p in [ scons ]:
dist_noarch_rpm = env.Install('$DISTDIR', noarch_rpm)
dist_src_rpm = env.Install('$DISTDIR', src_rpm)
Local(dist_noarch_rpm, dist_src_rpm)
- AddPostAction(dist_noarch_rpm, Chmod(dist_noarch_rpm, 0644))
- AddPostAction(dist_src_rpm, Chmod(dist_src_rpm, 0644))
+ AddPostAction(dist_noarch_rpm, Chmod(dist_noarch_rpm, 0o644))
+ AddPostAction(dist_src_rpm, Chmod(dist_src_rpm, 0o644))
dfiles = [os.path.join(test_rpm_dir, 'usr', x) for x in dst_files]
env.Command(dfiles,
@@ -1047,9 +1059,9 @@ for p in [ scons ]:
# Our Debian packaging builds directly into build/dist,
# so we don't need to Install() the .debs.
# The built deb is called just x.y.z, not x.y.z.final.0 so strip those off:
- deb_version = '.'.join(version.split('.')[0:3])
+ deb_version = version #'.'.join(version.split('.')[0:3])
deb = os.path.join(build_dir, 'dist', "%s_%s_all.deb" % (pkg, deb_version))
- # print "Building deb into %s (version=%s)"%(deb, deb_version)
+ print("Building deb into %s (version=%s)"%(deb, deb_version))
for d in p['debian_deps']:
b = env.SCons_revision(os.path.join(build, d), d)
env.Depends(deb, b)
@@ -1109,8 +1121,8 @@ for p in [ scons ]:
dist_local_tar_gz = os.path.join("$DISTDIR/%s.tar.gz" % s_l_v)
dist_local_zip = os.path.join("$DISTDIR/%s.zip" % s_l_v)
- AddPostAction(dist_local_tar_gz, Chmod(dist_local_tar_gz, 0644))
- AddPostAction(dist_local_zip, Chmod(dist_local_zip, 0644))
+ AddPostAction(dist_local_tar_gz, Chmod(dist_local_tar_gz, 0o644))
+ AddPostAction(dist_local_zip, Chmod(dist_local_zip, 0o644))
commands = [
Delete(build_dir_local),
@@ -1220,7 +1232,7 @@ if hg_status_lines:
slines = [l for l in hg_status_lines if l[0] in 'ACM']
sfiles = [l.split()[-1] for l in slines]
else:
- print "Not building in a Mercurial tree; skipping building src package."
+ print("Not building in a Mercurial tree; skipping building src package.")
if sfiles:
remove_patterns = [
@@ -1247,7 +1259,11 @@ if sfiles:
Local(src_tar_gz, src_zip)
for file in sfiles:
- env.SCons_revision(os.path.join(b_ps, file), file)
+ if file.endswith('jpg') or file.endswith('png'):
+ # don't revision binary files.
+ env.Install(os.path.dirname(os.path.join(b_ps,file)), file)
+ else:
+ env.SCons_revision(os.path.join(b_ps, file), file)
b_ps_files = [os.path.join(b_ps, x) for x in sfiles]
cmds = [
@@ -1384,3 +1400,5 @@ for pf, help_text in packaging_flavors:
os.path.join(build_dir, 'QMTest'),
os.path.join(build_dir, 'runtest.py'),
])
+
+
diff --git a/bin/Command.py b/bin/Command.py
index 8702f51..dadd7a9 100644
--- a/bin/Command.py
+++ b/bin/Command.py
@@ -4,6 +4,7 @@
#
# XXX Describe what the script does here.
#
+from __future__ import print_function
import getopt
import os
@@ -109,18 +110,18 @@ Usage: script-template.py [-hnq]
try:
try:
opts, args = getopt.getopt(argv[1:], short_options, long_options)
- except getopt.error, msg:
+ except getopt.error as msg:
raise Usage(msg)
for o, a in opts:
if o in ('-h', '--help'):
- print helpstr
+ print(helpstr)
sys.exit(0)
elif o in ('-n', '--no-exec'):
Command.execute = Command.do_not_execute
elif o in ('-q', '--quiet'):
Command.display = Command.do_not_display
- except Usage, err:
+ except Usage as err:
sys.stderr.write(err.msg)
sys.stderr.write('use -h to get help')
return 2
diff --git a/bin/SConsDoc.py b/bin/SConsDoc.py
index ff8a312..cfb4e54 100644
--- a/bin/SConsDoc.py
+++ b/bin/SConsDoc.py
@@ -24,6 +24,7 @@
#
# Module for handling SCons documentation processing.
#
+from __future__ import print_function
__doc__ = """
This module parses home-brew XML files that document various things
@@ -51,7 +52,7 @@ Builder example:
to indicate a new paragraph.
<example>
- print "this is example code, it will be offset and indented"
+ print("this is example code, it will be offset and indented")
</example>
</summary>
</builder>
@@ -71,7 +72,7 @@ Function example:
&f-FUNCTION; element. It need not be on a line by itself.</para>
<example>
- print "this is example code, it will be offset and indented"
+ print("this is example code, it will be offset and indented")
</example>
</summary>
</scons_function>
@@ -88,7 +89,7 @@ Construction variable example:
&t-VARIABLE; element. It need not be on a line by itself.</para>
<example>
- print "this is example code, it will be offset and indented"
+ print("this is example code, it will be offset and indented")
</example>
</summary>
</cvar>
@@ -105,7 +106,7 @@ Tool example:
&t-TOOL; element. It need not be on a line by itself.</para>
<example>
- print "this is example code, it will be offset and indented"
+ print("this is example code, it will be offset and indented")
</example>
</summary>
</tool>
@@ -167,7 +168,7 @@ xsi = "http://www.w3.org/2001/XMLSchema-instance"
# Header comment with copyright
copyright_comment = """
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -208,12 +209,12 @@ class Libxml2ValidityHandler:
def error(self, msg, data):
if data != ARG:
- raise Exception, "Error handler did not receive correct argument"
+ raise Exception("Error handler did not receive correct argument")
self.errors.append(msg)
def warning(self, msg, data):
if data != ARG:
- raise Exception, "Warning handler did not receive correct argument"
+ raise Exception("Warning handler did not receive correct argument")
self.warnings.append(msg)
@@ -330,16 +331,16 @@ if not has_libxml2:
xmlschema = etree.XMLSchema(xmlschema_context)
try:
doc = etree.parse(fpath)
- except Exception, e:
- print "ERROR: %s fails to parse:"%fpath
- print e
+ except Exception as e:
+ print("ERROR: %s fails to parse:"%fpath)
+ print(e)
return False
doc.xinclude()
try:
xmlschema.assertValid(doc)
- except Exception, e:
- print "ERROR: %s fails to validate:" % fpath
- print e
+ except Exception as e:
+ print("ERROR: %s fails to validate:" % fpath)
+ print(e)
return False
return True
@@ -475,8 +476,8 @@ else:
if err or eh.errors:
for e in eh.errors:
- print e.rstrip("\n")
- print "%s fails to validate" % fpath
+ print(e.rstrip("\n"))
+ print("%s fails to validate" % fpath)
return False
return True
@@ -597,7 +598,7 @@ class SConsDocTree:
# Create xpath context
self.xpath_context = self.doc.xpathNewContext()
# Register namespaces
- for key, val in self.nsmap.iteritems():
+ for key, val in self.nsmap.items():
self.xpath_context.xpathRegisterNs(key, val)
def __del__(self):
@@ -635,8 +636,8 @@ def validate_all_xml(dpaths, xsdfile=default_xsd):
fails = []
for idx, fp in enumerate(fpaths):
fpath = os.path.join(path, fp)
- print "%.2f%s (%d/%d) %s" % (float(idx+1)*100.0/float(len(fpaths)),
- perc, idx+1, len(fpaths),fp)
+ print("%.2f%s (%d/%d) %s" % (float(idx+1)*100.0/float(len(fpaths)),
+ perc, idx+1, len(fpaths),fp))
if not tf.validateXml(fp, xmlschema_context):
fails.append(fp)
@@ -665,8 +666,10 @@ class Item(object):
if name[0] == '_':
name = name[1:]
return name.lower()
- def __cmp__(self, other):
- return cmp(self.sort_name, other.sort_name)
+ def __eq__(self, other):
+ return self.sort_name == other.sort_name
+ def __lt__(self, other):
+ return self.sort_name < other.sort_name
class Builder(Item):
pass
@@ -808,7 +811,7 @@ def importfile(path):
file = open(path, 'r')
try:
module = imp.load_module(name, file, path, (ext, 'r', kind))
- except ImportError, e:
+ except ImportError as e:
sys.stderr.write("Could not import %s: %s\n" % (path, e))
return None
file.close()
diff --git a/bin/SConsExamples.py b/bin/SConsExamples.py
index 9823a05..50c4c1a 100644
--- a/bin/SConsExamples.py
+++ b/bin/SConsExamples.py
@@ -1,7 +1,7 @@
# !/usr/bin/env python
-#
+#
# Copyright (c) 2010 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
@@ -9,10 +9,10 @@
# 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
@@ -21,18 +21,18 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-#
+#
+#
# This script looks for some XML tags that describe SCons example
# configurations and commands to execute in those configurations, and
# uses TestCmd.py to execute the commands and insert the output from
# those commands into the XML that we output. This way, we can run a
# script and update all of our example documentation output without
# a lot of laborious by-hand checking.
-#
+#
# An "SCons example" looks like this, and essentially describes a set of
# input files (program source files as well as SConscript files):
-#
+#
# <scons_example name="ex1">
# <file name="SConstruct" printme="1">
# env = Environment()
@@ -42,7 +42,7 @@
# int main() { printf("foo.c\n"); }
# </file>
# </scons_example>
-#
+#
# The <file> contents within the <scons_example> tag will get written
# into a temporary directory whenever example output needs to be
# generated. By default, the <file> contents are not inserted into text
@@ -50,41 +50,43 @@
# in which case they will get inserted within a <programlisting> tag.
# This makes it easy to define the example at the appropriate
# point in the text where you intend to show the SConstruct file.
-#
+#
# Note that you should usually give the <scons_example> a "name"
# attribute so that you can refer to the example configuration later to
# run SCons and generate output.
-#
+#
# If you just want to show a file's contents without worry about running
# SCons, there's a shorter <sconstruct> tag:
-#
+#
# <sconstruct>
# env = Environment()
# env.Program('foo')
# </sconstruct>
-#
+#
# This is essentially equivalent to <scons_example><file printme="1">,
# but it's more straightforward.
-#
+#
# SCons output is generated from the following sort of tag:
-#
+#
# <scons_output example="ex1" os="posix">
# <scons_output_command suffix="1">scons -Q foo</scons_output_command>
# <scons_output_command suffix="2">scons -Q foo</scons_output_command>
# </scons_output>
-#
+#
# You tell it which example to use with the "example" attribute, and then
# give it a list of <scons_output_command> tags to execute. You can also
# supply an "os" tag, which specifies the type of operating system this
# example is intended to show; if you omit this, default value is "posix".
-#
+#
# The generated XML will show the command line (with the appropriate
# command-line prompt for the operating system), execute the command in
# a temporary directory with the example files, capture the standard
# output from SCons, and insert it into the text as appropriate.
# Error output gets passed through to your error output so you
# can see if there are any problems executing the command.
-#
+#
+
+from __future__ import print_function
import os
import re
@@ -94,9 +96,9 @@ import time
import SConsDoc
from SConsDoc import tf as stf
-#
+#
# The available types for ExampleFile entries
-#
+#
FT_FILE = 0 # a physical file (=<file>)
FT_FILEREF = 1 # a reference (=<scons_example_file>)
@@ -106,7 +108,7 @@ class ExampleFile:
self.name = ''
self.content = ''
self.chmod = ''
-
+
def isFileRef(self):
return self.type == FT_FILEREF
@@ -130,19 +132,19 @@ class ExampleOutput:
self.preserve = None
self.suffix = ''
self.commands = []
-
+
class ExampleInfo:
def __init__(self):
self.name = ''
self.files = []
self.folders = []
self.outputs = []
-
+
def getFileContents(self, fname):
for f in self.files:
if fname == f.name and not f.isFileRef():
return f.content
-
+
return ''
def readExampleInfos(fpath, examples):
@@ -150,10 +152,10 @@ def readExampleInfos(fpath, examples):
global dictionary examples.
"""
- # Create doctree
+ # Create doctree
t = SConsDoc.SConsDocTree()
t.parseXmlFile(fpath)
-
+
# Parse scons_examples
for e in stf.findAll(t.root, "scons_example", SConsDoc.dbxid,
t.xpath_context, t.nsmap):
@@ -164,7 +166,7 @@ def readExampleInfos(fpath, examples):
i = ExampleInfo()
i.name = n
examples[n] = i
-
+
# Parse file and directory entries
for f in stf.findAll(e, "file", SConsDoc.dbxid,
t.xpath_context, t.nsmap):
@@ -199,8 +201,8 @@ def readExampleInfos(fpath, examples):
fi.chmod = stf.getAttribute(f, 'chmod')
fi.content = stf.getText(f)
examples[e].files.append(fi)
-
-
+
+
# Parse scons_output
for o in stf.findAll(t.root, "scons_output", SConsDoc.dbxid,
t.xpath_context, t.nsmap):
@@ -238,7 +240,7 @@ def readExampleInfos(fpath, examples):
examples[n].outputs.append(eout)
def readAllExampleInfos(dpath):
- """ Scan for XML files in the given directory and
+ """ Scan for XML files in the given directory and
collect together all relevant infos (files/folders,
output commands) in a map, which gets returned.
"""
@@ -249,13 +251,13 @@ def readAllExampleInfos(dpath):
fpath = os.path.join(path, f)
if SConsDoc.isSConsXml(fpath):
readExampleInfos(fpath, examples)
-
+
return examples
generated_examples = os.path.join('doc', 'generated', 'examples')
def ensureExampleOutputsExist(dpath):
- """ Scan for XML files in the given directory and
+ """ Scan for XML files in the given directory and
ensure that for every example output we have a
corresponding output file in the 'generated/examples'
folder.
@@ -263,9 +265,9 @@ def ensureExampleOutputsExist(dpath):
# Ensure that the output folder exists
if not os.path.isdir(generated_examples):
os.mkdir(generated_examples)
-
+
examples = readAllExampleInfos(dpath)
- for key, value in examples.iteritems():
+ for key, value in examples.items():
# Process all scons_output tags
for o in value.outputs:
cpath = os.path.join(generated_examples,
@@ -276,7 +278,7 @@ def ensureExampleOutputsExist(dpath):
stf.setText(s, "NO OUTPUT YET! Run the script to generate/update all examples.")
# Write file
stf.writeTree(s, cpath)
-
+
# Process all scons_example_file tags
for r in value.files:
if r.isFileRef():
@@ -292,22 +294,22 @@ def ensureExampleOutputsExist(dpath):
perc = "%"
def createAllExampleOutputs(dpath):
- """ Scan for XML files in the given directory and
+ """ Scan for XML files in the given directory and
creates all output files for every example in
the 'generated/examples' folder.
"""
# Ensure that the output folder exists
if not os.path.isdir(generated_examples):
os.mkdir(generated_examples)
-
+
examples = readAllExampleInfos(dpath)
total = len(examples)
idx = 0
- for key, value in examples.iteritems():
+ for key, value in examples.items():
# Process all scons_output tags
- print "%.2f%s (%d/%d) %s" % (float(idx + 1) * 100.0 / float(total),
- perc, idx + 1, total, key)
-
+ print("%.2f%s (%d/%d) %s" % (float(idx + 1) * 100.0 / float(total),
+ perc, idx + 1, total, key))
+
create_scons_output(value)
# Process all scons_example_file tags
for r in value.files:
@@ -329,10 +331,10 @@ def collectSConsExampleNames(fpath):
suffixes = {}
failed_suffixes = False
- # Create doctree
+ # Create doctree
t = SConsDoc.SConsDocTree()
t.parseXmlFile(fpath)
-
+
# Parse it
for e in stf.findAll(t.root, "scons_example", SConsDoc.dbxid,
t.xpath_context, t.nsmap):
@@ -344,40 +346,40 @@ def collectSConsExampleNames(fpath):
if n not in suffixes:
suffixes[n] = []
else:
- print "Error: Example in file '%s' is missing a name!" % fpath
+ print("Error: Example in file '%s' is missing a name!" % fpath)
failed_suffixes = True
-
+
for o in stf.findAll(t.root, "scons_output", SConsDoc.dbxid,
t.xpath_context, t.nsmap):
n = ''
if stf.hasAttribute(o, 'example'):
n = stf.getAttribute(o, 'example')
else:
- print "Error: scons_output in file '%s' is missing an example name!" % fpath
+ print("Error: scons_output in file '%s' is missing an example name!" % fpath)
failed_suffixes = True
-
+
if n not in suffixes:
- print "Error: scons_output in file '%s' is referencing non-existent example '%s'!" % (fpath, n)
+ print("Error: scons_output in file '%s' is referencing non-existent example '%s'!" % (fpath, n))
failed_suffixes = True
continue
-
+
s = ''
if stf.hasAttribute(o, 'suffix'):
s = stf.getAttribute(o, 'suffix')
else:
- print "Error: scons_output in file '%s' (example '%s') is missing a suffix!" % (fpath, n)
+ print("Error: scons_output in file '%s' (example '%s') is missing a suffix!" % (fpath, n))
failed_suffixes = True
-
+
if s not in suffixes[n]:
suffixes[n].append(s)
else:
- print "Error: scons_output in file '%s' (example '%s') is using a duplicate suffix '%s'!" % (fpath, n, s)
+ print("Error: scons_output in file '%s' (example '%s') is using a duplicate suffix '%s'!" % (fpath, n, s))
failed_suffixes = True
-
+
return names, failed_suffixes
def exampleNamesAreUnique(dpath):
- """ Scan for XML files in the given directory and
+ """ Scan for XML files in the given directory and
check whether the scons_example names are unique.
"""
unique = True
@@ -392,21 +394,21 @@ def exampleNamesAreUnique(dpath):
unique = False
i = allnames.intersection(names)
if i:
- print "Not unique in %s are: %s" % (fpath, ', '.join(i))
+ print("Not unique in %s are: %s" % (fpath, ', '.join(i)))
unique = False
-
+
allnames |= names
-
+
return unique
# ###############################################################
-#
+#
# In the second half of this module (starting here)
# we define the variables and functions that are required
# to actually run the examples, collect their output and
# write it into the files in doc/generated/examples...
# which then get included by our UserGuide.
-#
+#
# ###############################################################
sys.path.append(os.path.join(os.getcwd(), 'QMTest'))
@@ -416,6 +418,8 @@ scons_py = os.path.join('bootstrap', 'src', 'script', 'scons.py')
if not os.path.exists(scons_py):
scons_py = os.path.join('src', 'script', 'scons.py')
+scons_py = os.path.join(os.getcwd(), scons_py)
+
scons_lib_dir = os.path.join(os.getcwd(), 'bootstrap', 'src', 'engine')
if not os.path.exists(scons_lib_dir):
scons_lib_dir = os.path.join(os.getcwd(), 'src', 'engine')
@@ -430,7 +434,7 @@ Prompt = {
}
# The magick SCons hackery that makes this work.
-#
+#
# So that our examples can still use the default SConstruct file, we
# actually feed the following into SCons via stdin and then have it
# SConscript() the SConstruct file. This stdin wrapper creates a set
@@ -438,7 +442,7 @@ Prompt = {
# Surrogates print output like the real tools and behave like them
# without actually having to be on the right platform or have the right
# tool installed.
-#
+#
# The upshot: The wrapper transparently changes the world out from
# under the top-level SConstruct file in an example just so we can get
# the command output.
@@ -610,10 +614,6 @@ ToolList = {
('ar', ['ARCOM', 'RANLIBCOM'], Cat, []),
('tar', 'TARCOM', Null, []),
('zip', 'ZIPCOM', Null, []),
- ('BitKeeper', 'BITKEEPERCOM', Cat, []),
- ('CVS', 'CVSCOM', Cat, []),
- ('RCS', 'RCS_COCOM', Cat, []),
- ('SCCS', 'SCCSCOM', Cat, []),
('javac', 'JAVACCOM', JavaCCom, []),
('javah', 'JAVAHCOM', JavaHCom, []),
('jar', 'JARCOM', JarCom, []),
@@ -624,10 +624,6 @@ ToolList = {
('mslib', 'ARCOM', Cat, []),
('tar', 'TARCOM', Null, []),
('zip', 'ZIPCOM', Null, []),
- ('BitKeeper', 'BITKEEPERCOM', Cat, []),
- ('CVS', 'CVSCOM', Cat, []),
- ('RCS', 'RCS_COCOM', Cat, []),
- ('SCCS', 'SCCSCOM', Cat, []),
('javac', 'JAVACCOM', JavaCCom, []),
('javah', 'JAVAHCOM', JavaHCom, []),
('jar', 'JARCOM', JarCom, []),
@@ -734,7 +730,11 @@ def command_edit(args, c, test, dict):
def command_ls(args, c, test, dict):
def ls(a):
- return [' '.join(sorted([x for x in os.listdir(a) if x[0] != '.']))]
+ try:
+ return [' '.join(sorted([x for x in os.listdir(a) if x[0] != '.']))]
+ except OSError as e:
+ # This should never happen. Pop into debugger
+ import pdb; pdb.set_trace()
if args:
l = []
for a in args:
@@ -765,7 +765,7 @@ def ExecuteCommand(args, c, t, dict):
def create_scons_output(e):
# The real raison d'etre for this script, this is where we
# actually execute SCons to fetch the output.
-
+
# Loop over all outputs for the example
for o in e.outputs:
# Create new test directory
@@ -774,19 +774,19 @@ def create_scons_output(e):
t.preserve()
t.subdir('ROOT', 'WORK')
t.rootpath = t.workpath('ROOT').replace('\\', '\\\\')
-
+
for d in e.folders:
dir = t.workpath('WORK', d.name)
if not os.path.exists(dir):
os.makedirs(dir)
-
+
for f in e.files:
if f.isFileRef():
continue
- #
+ #
# Left-align file's contents, starting on the first
# non-empty line
- #
+ #
data = f.content.split('\n')
i = 0
# Skip empty lines
@@ -813,26 +813,26 @@ def create_scons_output(e):
if hasattr(f, 'chmod'):
if len(f.chmod):
os.chmod(path, int(f.chmod, 0))
-
+
# Regular expressions for making the doc output consistent,
# regardless of reported addresses or Python version.
-
+
# Massage addresses in object repr strings to a constant.
address_re = re.compile(r' at 0x[0-9a-fA-F]*\>')
-
+
# Massage file names in stack traces (sometimes reported as absolute
# paths) to a consistent relative path.
engine_re = re.compile(r' File ".*/src/engine/SCons/')
-
+
# Python 2.5 changed the stack trace when the module is read
# from standard input from read "... line 7, in ?" to
# "... line 7, in <module>".
file_re = re.compile(r'^( *File ".*", line \d+, in) \?$', re.M)
-
+
# Python 2.6 made UserList a new-style class, which changes the
# AttributeError message generated by our NodeList subclass.
nodelist_re = re.compile(r'(AttributeError:) NodeList instance (has no attribute \S+)')
-
+
# Root element for our subtree
sroot = stf.newEtreeNode("screen", True)
curchild = None
@@ -881,7 +881,7 @@ def create_scons_output(e):
curchild.tail = content
else:
sroot.text = content
-
+
# Construct filename
fpath = os.path.join(generated_examples,
e.name + '_' + o.suffix + '.xml')
diff --git a/bin/calibrate.py b/bin/calibrate.py
index 8ed2ece..3f9104e 100644
--- a/bin/calibrate.py
+++ b/bin/calibrate.py
@@ -20,7 +20,7 @@
# 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
import optparse
import os
@@ -48,7 +48,7 @@ def main(argv=None):
for arg in args:
if len(args) > 1:
- print arg + ':'
+ print(arg + ':')
command = [sys.executable, 'runtest.py']
if opts.package:
@@ -67,9 +67,9 @@ def main(argv=None):
try:
elapsed = float(em.group(1))
except AttributeError:
- print output
+ print(output)
raise
- print "run %3d: %7.3f: %s" % (run, elapsed, ' '.join(vm.groups()))
+ print("run %3d: %7.3f: %s" % (run, elapsed, ' '.join(vm.groups())))
if opts.min < elapsed and elapsed < opts.max:
good += 1
else:
diff --git a/bin/caller-tree.py b/bin/caller-tree.py
index 03c1616..18cd9e1 100644
--- a/bin/caller-tree.py
+++ b/bin/caller-tree.py
@@ -39,6 +39,7 @@
# function at the same time, for example, their counts will intermix.
# So use this to get a *general* idea of who's calling what, not for
# fine-grained performance tuning.
+from __future__ import print_function
import sys
@@ -74,19 +75,19 @@ for line in sys.stdin.readlines():
stack = []
def print_entry(e, level, calls):
- print '%-72s%6s' % ((' '*2*level) + e.file_line_func, calls)
+ print('%-72s%6s' % ((' '*2*level) + e.file_line_func, calls))
if e in stack:
- print (' '*2*(level+1))+'RECURSION'
- print
+ print((' '*2*(level+1))+'RECURSION')
+ print()
elif e.called_by:
stack.append(e)
for c in e.called_by:
print_entry(c[0], level+1, c[1])
stack.pop()
else:
- print
+ print()
-for e in [ e for e in AllCalls.values() if not e.calls ]:
+for e in [ e for e in list(AllCalls.values()) if not e.calls ]:
print_entry(e, 0, '')
# Local Variables:
diff --git a/bin/docs-create-example-outputs.py b/bin/docs-create-example-outputs.py
index 6e59d9f..73aa31a 100644
--- a/bin/docs-create-example-outputs.py
+++ b/bin/docs-create-example-outputs.py
@@ -3,17 +3,18 @@
# Searches through the whole doc/user tree and creates
# all output files for the single examples.
#
+from __future__ import print_function
import os
import sys
import SConsExamples
if __name__ == "__main__":
- print "Checking whether all example names are unique..."
+ print("Checking whether all example names are unique...")
if SConsExamples.exampleNamesAreUnique(os.path.join('doc','user')):
- print "OK"
+ print("OK")
else:
- print "Not all example names and suffixes are unique! Please correct the errors listed above and try again."
+ print("Not all example names and suffixes are unique! Please correct the errors listed above and try again.")
sys.exit(1)
-
+
SConsExamples.createAllExampleOutputs(os.path.join('doc','user'))
diff --git a/bin/docs-update-generated.py b/bin/docs-update-generated.py
index 55f0035..c164baf 100644
--- a/bin/docs-update-generated.py
+++ b/bin/docs-update-generated.py
@@ -6,6 +6,7 @@
# as well as the entity declarations for them.
# Uses scons-proc.py under the hood...
#
+from __future__ import print_function
import os
import sys
@@ -39,7 +40,7 @@ def generate_all():
try:
os.makedirs(gen_folder)
except:
- print "Couldn't create destination folder %s! Exiting..." % gen_folder
+ print("Couldn't create destination folder %s! Exiting..." % gen_folder)
return
# Call scons-proc.py
os.system('%s %s -b %s -f %s -t %s -v %s %s' %
diff --git a/bin/docs-validate.py b/bin/docs-validate.py
index f888c21..342ed43 100644
--- a/bin/docs-validate.py
+++ b/bin/docs-validate.py
@@ -3,6 +3,7 @@
# Searches through the whole source tree and validates all
# documentation files against our own XSD in docs/xsd.
#
+from __future__ import print_function
import sys,os
import SConsDoc
@@ -10,9 +11,9 @@ import SConsDoc
if __name__ == "__main__":
if len(sys.argv)>1:
if SConsDoc.validate_all_xml((sys.argv[1],)):
- print "OK"
+ print("OK")
else:
- print "Validation failed! Please correct the errors above and try again."
+ print("Validation failed! Please correct the errors above and try again.")
else:
if SConsDoc.validate_all_xml(['src',
os.path.join('doc','design'),
@@ -22,7 +23,7 @@ if __name__ == "__main__":
os.path.join('doc','reference'),
os.path.join('doc','user')
]):
- print "OK"
+ print("OK")
else:
- print "Validation failed! Please correct the errors above and try again."
+ print("Validation failed! Please correct the errors above and try again.")
sys.exit(1)
diff --git a/bin/import-test.py b/bin/import-test.py
index eb93828..168208f 100644
--- a/bin/import-test.py
+++ b/bin/import-test.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
#
# tree2test.py - turn a directory tree into TestSCons code
#
@@ -25,7 +25,7 @@
# """ triple-quotes will need to have their contents edited by hand.
#
-__revision__ = "bin/import-test.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "bin/import-test.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import sys
diff --git a/bin/install_python.py b/bin/install_python.py
index 86807af..5c947ac 100644
--- a/bin/install_python.py
+++ b/bin/install_python.py
@@ -6,6 +6,7 @@
# This was written for a Linux system (specifically Ubuntu) but should
# be reasonably generic to any POSIX-style system with a /usr/local
# hierarchy.
+from __future__ import print_function
import getopt
import os
@@ -48,7 +49,7 @@ Usage: install_python.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
try:
try:
opts, args = getopt.getopt(argv[1:], short_options, long_options)
- except getopt.error, msg:
+ except getopt.error as msg:
raise Usage(msg)
for o, a in opts:
@@ -57,7 +58,7 @@ Usage: install_python.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
elif o in ('-d', '--downloads'):
downloads_dir = a
elif o in ('-h', '--help'):
- print helpstr
+ print(helpstr)
sys.exit(0)
elif o in ('-n', '--no-exec'):
CommandRunner.execute = CommandRunner.do_not_execute
@@ -65,7 +66,7 @@ Usage: install_python.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
prefix = a
elif o in ('-q', '--quiet'):
CommandRunner.display = CommandRunner.do_not_display
- except Usage, err:
+ except Usage as err:
sys.stderr.write(str(err.msg) + '\n')
sys.stderr.write('use -h to get help\n')
return 2
diff --git a/bin/install_scons.py b/bin/install_scons.py
index 00129f6..ac79fd3 100644
--- a/bin/install_scons.py
+++ b/bin/install_scons.py
@@ -18,12 +18,14 @@
# be reasonably generic to any POSIX-style system with a /usr/local
# hierarchy.
+from __future__ import print_function
+
import getopt
import os
import shutil
import sys
import tarfile
-import urllib
+from urllib import urlretrieve
from Command import CommandRunner, Usage
@@ -129,7 +131,7 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
try:
try:
opts, args = getopt.getopt(argv[1:], short_options, long_options)
- except getopt.error, msg:
+ except getopt.error as msg:
raise Usage(msg)
for o, a in opts:
@@ -138,7 +140,7 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
elif o in ('-d', '--downloads'):
downloads_dir = a
elif o in ('-h', '--help'):
- print helpstr
+ print(helpstr)
sys.exit(0)
elif o in ('-n', '--no-exec'):
CommandRunner.execute = CommandRunner.do_not_execute
@@ -146,7 +148,7 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
prefix = a
elif o in ('-q', '--quiet'):
CommandRunner.display = CommandRunner.do_not_display
- except Usage, err:
+ except Usage as err:
sys.stderr.write(str(err.msg) + '\n')
sys.stderr.write('use -h to get help\n')
return 2
@@ -171,7 +173,7 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
if not os.path.exists(tar_gz):
if not os.path.exists(downloads_dir):
cmd.run('mkdir %(downloads_dir)s')
- cmd.run((urllib.urlretrieve, tar_gz_url, tar_gz),
+ cmd.run((urlretrieve, tar_gz_url, tar_gz),
'wget -O %(tar_gz)s %(tar_gz_url)s')
def extract(tar_gz):
diff --git a/bin/linecount.py b/bin/linecount.py
index 147089a..75723d0 100644
--- a/bin/linecount.py
+++ b/bin/linecount.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Count statistics about SCons test and source files. This must be run
# against a fully-populated tree (for example, one that's been freshly
@@ -21,9 +21,9 @@
# in each category, the number of non-blank lines, and the number of
# non-comment lines. The last figure (non-comment) lines is the most
# interesting one for most purposes.
-from __future__ import division
+from __future__ import division, print_function
-__revision__ = "bin/linecount.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "bin/linecount.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
@@ -98,23 +98,23 @@ all_tests = Collection('all tests', src_tests.files + test_tests.files)
def ratio(over, under):
return "%.2f" % (float(len(over)) / float(len(under)))
-print fmt % ('', '', '', '', '', 'non-blank')
-print fmt % ('', 'files', 'lines', 'non-blank', 'non-comment', 'non-comment')
-print
-print fmt % src_Tests_py_tests.printables()
-print fmt % src_test_tests.printables()
-print
-print fmt % src_tests.printables()
-print fmt % test_tests.printables()
-print
-print fmt % all_tests.printables()
-print fmt % sources.printables()
-print
-print fmt % ('ratio:',
+print(fmt % ('', '', '', '', '', 'non-blank'))
+print(fmt % ('', 'files', 'lines', 'non-blank', 'non-comment', 'non-comment'))
+print()
+print(fmt % src_Tests_py_tests.printables())
+print(fmt % src_test_tests.printables())
+print()
+print(fmt % src_tests.printables())
+print(fmt % test_tests.printables())
+print()
+print(fmt % all_tests.printables())
+print(fmt % sources.printables())
+print()
+print(fmt % ('ratio:',
ratio(all_tests, sources),
ratio(all_tests.lines(), sources.lines()),
ratio(all_tests.non_blank(), sources.non_blank()),
ratio(all_tests.non_comment(), sources.non_comment()),
ratio(all_tests.non_blank_non_comment(),
sources.non_blank_non_comment())
- )
+ ))
diff --git a/bin/memlogs.py b/bin/memlogs.py
index 9d957c9..b450939 100644
--- a/bin/memlogs.py
+++ b/bin/memlogs.py
@@ -21,26 +21,28 @@
# 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
+
import getopt
import sys
filenames = sys.argv[1:]
if not filenames:
- print """Usage: memlogs.py file [...]
+ print("""Usage: memlogs.py file [...]
Summarizes the --debug=memory numbers from one or more build logs.
-"""
+""")
sys.exit(0)
fmt = "%12s %12s %12s %12s %s"
-print fmt % ("pre-read", "post-read", "pre-build", "post-build", "")
+print(fmt % ("pre-read", "post-read", "pre-build", "post-build", ""))
for fname in sys.argv[1:]:
lines = [l for l in open(fname).readlines() if l[:7] == 'Memory ']
t = tuple([l.split()[-1] for l in lines]) + (fname,)
- print fmt % t
+ print(fmt % t)
# Local Variables:
# tab-width:4
diff --git a/bin/memoicmp.py b/bin/memoicmp.py
index 812af66..63f6538 100644
--- a/bin/memoicmp.py
+++ b/bin/memoicmp.py
@@ -3,6 +3,8 @@
# A script to compare the --debug=memoizer output found in
# two different files.
+from __future__ import print_function
+
import sys
def memoize_output(fname):
@@ -23,20 +25,20 @@ def memoize_cmp(filea, fileb):
ma = memoize_output(filea)
mb = memoize_output(fileb)
- print 'All output: %s / %s [delta]'%(filea, fileb)
- print '----------HITS---------- ---------MISSES---------'
+ print('All output: %s / %s [delta]'%(filea, fileb))
+ print('----------HITS---------- ---------MISSES---------')
cfmt='%7d/%-7d [%d]'
ma_o = []
mb_o = []
mab = []
- for k in ma.keys():
- if k in mb.keys():
+ for k in list(ma.keys()):
+ if k in list(mb.keys()):
if k not in mab:
mab.append(k)
else:
ma_o.append(k)
- for k in mb.keys():
- if k in ma.keys():
+ for k in list(mb.keys()):
+ if k in list(ma.keys()):
if k not in mab:
mab.append(k)
else:
@@ -45,30 +47,30 @@ def memoize_cmp(filea, fileb):
mab.sort()
ma_o.sort()
mb_o.sort()
-
+
for k in mab:
hits = cfmt%(ma[k][0], mb[k][0], mb[k][0]-ma[k][0])
miss = cfmt%(ma[k][1], mb[k][1], mb[k][1]-ma[k][1])
- print '%-24s %-24s %s'%(hits, miss, k)
+ print('%-24s %-24s %s'%(hits, miss, k))
for k in ma_o:
hits = '%7d/ --'%(ma[k][0])
miss = '%7d/ --'%(ma[k][1])
- print '%-24s %-24s %s'%(hits, miss, k)
+ print('%-24s %-24s %s'%(hits, miss, k))
for k in mb_o:
hits = ' -- /%-7d'%(mb[k][0])
miss = ' -- /%-7d'%(mb[k][1])
- print '%-24s %-24s %s'%(hits, miss, k)
+ print('%-24s %-24s %s'%(hits, miss, k))
+
+ print('-'*(24+24+1+20))
- print '-'*(24+24+1+20)
-
if __name__ == "__main__":
if len(sys.argv) != 3:
- print """Usage: %s file1 file2
+ print("""Usage: %s file1 file2
-Compares --debug=memomize output from file1 against file2."""%sys.argv[0]
+Compares --debug=memomize output from file1 against file2."""%sys.argv[0])
sys.exit(1)
memoize_cmp(sys.argv[1], sys.argv[2])
diff --git a/bin/objcounts.py b/bin/objcounts.py
index 0662012..8b550d1 100644
--- a/bin/objcounts.py
+++ b/bin/objcounts.py
@@ -20,6 +20,7 @@
# 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
import re
import sys
@@ -27,10 +28,10 @@ import sys
filenames = sys.argv[1:]
if len(sys.argv) != 3:
- print """Usage: objcounts.py file1 file2
+ print("""Usage: objcounts.py file1 file2
Compare the --debug=object counts from two build logs.
-"""
+""")
sys.exit(0)
def fetch_counts(fname):
@@ -47,7 +48,7 @@ c1 = fetch_counts(sys.argv[1])
c2 = fetch_counts(sys.argv[2])
common = {}
-for k in c1.keys():
+for k in list(c1.keys()):
try:
common[k] = (c1[k], c2[k])
except KeyError:
@@ -58,7 +59,7 @@ for k in c1.keys():
if not '.' in k:
s = '.'+k
l = len(s)
- for k2 in c2.keys():
+ for k2 in list(c2.keys()):
if k2[-l:] == s:
common[k2] = (c1[k], c2[k2])
del c1[k]
@@ -81,10 +82,9 @@ def diffstr(c1, c2):
return " %5s/%-5s %-8s" % (c1, c2, d)
def printline(c1, c2, classname):
- print \
- diffstr(c1[2], c2[2]) + \
+ print(diffstr(c1[2], c2[2]) + \
diffstr(c1[3], c2[3]) + \
- ' ' + classname
+ ' ' + classname)
for k in sorted(common.keys()):
c = common[k]
diff --git a/bin/restore.sh b/bin/restore.sh
index 4b96852..49c95bc 100644
--- a/bin/restore.sh
+++ b/bin/restore.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
#
-# Simple hack script to restore __revision__, __COPYRIGHT_, 2.5.1
+# Simple hack script to restore __revision__, __COPYRIGHT_, 3.0.0
# and other similar variables to what gets checked in to source. This
# comes in handy when people send in diffs based on the released source.
#
@@ -22,9 +22,9 @@ header() {
for i in `find $DIRS -name '*.py'`; do
header $i
ed $i <<EOF
-g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2016 The SCons Foundation/p
+g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2017 The SCons Foundation/p
w
-/^__revision__ = /s/= .*/= "bin/restore.sh rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"/p
+/^__revision__ = /s/= .*/= "bin/restore.sh rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"/p
w
q
EOF
@@ -33,9 +33,9 @@ done
for i in `find $DIRS -name 'scons.bat'`; do
header $i
ed $i <<EOF
-g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2016 The SCons Foundation/p
+g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2017 The SCons Foundation/p
w
-/^@REM src\/script\/scons.bat/s/@REM .* knight/@REM bin/restore.sh rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog/p
+/^@REM src\/script\/scons.bat/s/@REM .* knight/@REM bin/restore.sh rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog/p
w
q
EOF
@@ -44,13 +44,13 @@ done
for i in `find $DIRS -name '__init__.py' -o -name 'scons.py' -o -name 'sconsign.py'`; do
header $i
ed $i <<EOF
-/^__version__ = /s/= .*/= "2.5.1"/p
+/^__version__ = /s/= .*/= "3.0.0"/p
w
-/^__build__ = /s/= .*/= "rel_2.5.1:3735:9dc6cee5c168[MODIFIED]"/p
+/^__build__ = /s/= .*/= "rel_3.0.0:4395:8972f6a2f699"/p
w
-/^__buildsys__ = /s/= .*/= "mongodog"/p
+/^__buildsys__ = /s/= .*/= "ubuntu-16"/p
w
-/^__date__ = /s/= .*/= "2016/11/03 14:02:02"/p
+/^__date__ = /s/= .*/= "2017/09/18 12:59:24"/p
w
/^__developer__ = /s/= .*/= "bdbaddog"/p
w
@@ -61,7 +61,7 @@ done
for i in `find $DIRS -name 'setup.py'`; do
header $i
ed $i <<EOF
-/^ *version = /s/= .*/= "2.5.1",/p
+/^ *version = /s/= .*/= "3.0.0",/p
w
q
EOF
@@ -70,11 +70,11 @@ done
for i in `find $DIRS -name '*.txt'`; do
header $i
ed $i <<EOF
-g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2016 The SCons Foundation/p
+g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2017 The SCons Foundation/p
w
-/# [^ ]* 0.96.[CD][0-9]* [0-9\/]* [0-9:]* knight$/s/.*/# bin/restore.sh rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog/p
+/# [^ ]* 0.96.[CD][0-9]* [0-9\/]* [0-9:]* knight$/s/.*/# bin/restore.sh rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog/p
w
-/Version [0-9][0-9]*\.[0-9][0-9]*/s//Version 2.5.1/p
+/Version [0-9][0-9]*\.[0-9][0-9]*/s//Version 3.0.0/p
w
q
EOF
@@ -83,7 +83,7 @@ done
for i in `find $DIRS -name '*.xml'`; do
header $i
ed $i <<EOF
-g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2016 The SCons Foundation/p
+g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2017 The SCons Foundation/p
w
q
EOF
diff --git a/bin/scons-diff.py b/bin/scons-diff.py
index 1e4bca0..182b726 100644
--- a/bin/scons-diff.py
+++ b/bin/scons-diff.py
@@ -8,6 +8,7 @@
# etc. so that you can diff trees without having to ignore changes in
# version lines.
#
+from __future__ import print_function
import difflib
import getopt
@@ -43,7 +44,7 @@ def diff_line(left, right):
opts = ' ' + ' '.join(diff_options)
else:
opts = ''
- print 'diff%s %s %s' % (opts, left, right)
+ print('diff%s %s %s' % (opts, left, right))
for o, a in opts:
if o in ('-c', '-u'):
@@ -51,7 +52,7 @@ for o, a in opts:
context = int(a)
diff_options.append(o)
elif o in ('-h', '--help'):
- print Usage
+ print(Usage)
sys.exit(0)
elif o in ('-n'):
diff_options.append(o)
@@ -161,9 +162,9 @@ def diff_file(left, right):
else:
if text:
diff_line(left, right)
- print text,
+ print(text)
elif report_same:
- print 'Files %s and %s are identical' % (left, right)
+ print('Files %s and %s are identical' % (left, right))
def diff_dir(left, right):
llist = os.listdir(left)
@@ -173,16 +174,16 @@ def diff_dir(left, right):
u[l] = 1
for r in rlist:
u[r] = 1
- for x in sorted([ x for x in u.keys() if x[-4:] != '.pyc' ]):
+ for x in sorted([ x for x in list(u.keys()) if x[-4:] != '.pyc' ]):
if x in llist:
if x in rlist:
do_diff(os.path.join(left, x),
os.path.join(right, x),
recursive)
else:
- print 'Only in %s: %s' % (left, x)
+ print('Only in %s: %s' % (left, x))
else:
- print 'Only in %s: %s' % (right, x)
+ print('Only in %s: %s' % (right, x))
do_diff(left, right, True)
diff --git a/bin/scons-proc.py b/bin/scons-proc.py
index d6a770b..e09c853 100644
--- a/bin/scons-proc.py
+++ b/bin/scons-proc.py
@@ -9,6 +9,8 @@
# DocBook-formatted generated XML files containing the summary text
# and/or .mod files containing the ENTITY definitions for each item.
#
+from __future__ import print_function
+
import getopt
import os
import re
@@ -225,10 +227,15 @@ 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__
+
+ ## def __lt__(self, other):
+ ## if issubclass(other.__class__, self.__subject.__class__):
+ ## return self.__subject < other
+ ## return self.__dict__ < other.__dict__
class SConsThing(Proxy):
def idfunc(self):
@@ -340,25 +347,25 @@ def write_output_files(h, buildersfiles, functionsfiles,
processor_class = SCons_XML
# Step 1: Creating entity files for builders, functions,...
-print "Generating entity files..."
+print("Generating entity files...")
h = parse_docs(args, False)
write_output_files(h, buildersfiles, functionsfiles, toolsfiles,
variablesfiles, SCons_XML.write_mod)
# Step 2: Validating all input files
-print "Validating files against SCons XSD..."
+print("Validating files against SCons XSD...")
if SConsDoc.validate_all_xml(['src']):
- print "OK"
+ print("OK")
else:
- print "Validation failed! Please correct the errors above and try again."
+ print("Validation failed! Please correct the errors above and try again.")
# Step 3: Creating actual documentation snippets, using the
# fully resolved and updated entities from the *.mod files.
-print "Updating documentation for builders, tools and functions..."
+print("Updating documentation for builders, tools and functions...")
h = parse_docs(args, True)
write_output_files(h, buildersfiles, functionsfiles, toolsfiles,
variablesfiles, SCons_XML.write)
-print "Done"
+print("Done")
# Local Variables:
# tab-width:4
diff --git a/bin/scons-test.py b/bin/scons-test.py
index 046cf4b..dd54dd1 100644
--- a/bin/scons-test.py
+++ b/bin/scons-test.py
@@ -14,6 +14,7 @@
# relevant information about the system, the Python version, etc.,
# so that problems on different platforms can be identified sooner.
#
+from __future__ import print_function
import atexit
import getopt
@@ -60,7 +61,7 @@ for o, a in opts:
outdir = a
elif o == '-v' or o == '--verbose':
def printname(x):
- print x
+ print(x)
elif o == '--xml':
format = o
@@ -148,34 +149,34 @@ else:
if format == '--xml':
- print "<scons_test_run>"
- print " <sys>"
+ print("<scons_test_run>")
+ print(" <sys>")
sys_keys = ['byteorder', 'exec_prefix', 'executable', 'maxint', 'maxunicode', 'platform', 'prefix', 'version', 'version_info']
for k in sys_keys:
- print " <%s>%s</%s>" % (k, sys.__dict__[k], k)
- print " </sys>"
+ print(" <%s>%s</%s>" % (k, sys.__dict__[k], k))
+ print(" </sys>")
fmt = '%a %b %d %H:%M:%S %Y'
- print " <time>"
- print " <gmtime>%s</gmtime>" % time.strftime(fmt, time.gmtime())
- print " <localtime>%s</localtime>" % time.strftime(fmt, time.localtime())
- print " </time>"
+ print(" <time>")
+ print(" <gmtime>%s</gmtime>" % time.strftime(fmt, time.gmtime()))
+ print(" <localtime>%s</localtime>" % time.strftime(fmt, time.localtime()))
+ print(" </time>")
- print " <tempdir>%s</tempdir>" % tempdir
+ print(" <tempdir>%s</tempdir>" % tempdir)
def print_version_info(tag, module):
- print " <%s>" % tag
- print " <version>%s</version>" % module.__version__
- print " <build>%s</build>" % module.__build__
- print " <buildsys>%s</buildsys>" % module.__buildsys__
- print " <date>%s</date>" % module.__date__
- print " <developer>%s</developer>" % module.__developer__
- print " </%s>" % tag
-
- print " <scons>"
+ print(" <%s>" % tag)
+ print(" <version>%s</version>" % module.__version__)
+ print(" <build>%s</build>" % module.__build__)
+ print(" <buildsys>%s</buildsys>" % module.__buildsys__)
+ print(" <date>%s</date>" % module.__date__)
+ print(" <developer>%s</developer>" % module.__developer__)
+ print(" </%s>" % tag)
+
+ print(" <scons>")
print_version_info("script", scons)
print_version_info("engine", SCons)
- print " </scons>"
+ print(" </scons>")
environ_keys = [
'PATH',
@@ -213,37 +214,37 @@ if format == '--xml':
'USER',
]
- print " <environment>"
+ print(" <environment>")
for key in sorted(environ_keys):
value = os.environ.get(key)
if value:
- print " <variable>"
- print " <name>%s</name>" % key
- print " <value>%s</value>" % value
- print " </variable>"
- print " </environment>"
+ print(" <variable>")
+ print(" <name>%s</name>" % key)
+ print(" <value>%s</value>" % value)
+ print(" </variable>")
+ print(" </environment>")
command = '"%s" runtest.py -q -o - --xml %s' % (sys.executable, runtest_args)
- #print command
+ #print(command)
os.system(command)
- print "</scons_test_run>"
+ print("</scons_test_run>")
else:
def print_version_info(tag, module):
- print "\t%s: v%s.%s, %s, by %s on %s" % (tag,
+ print("\t%s: v%s.%s, %s, by %s on %s" % (tag,
module.__version__,
module.__build__,
module.__date__,
module.__developer__,
- module.__buildsys__)
+ module.__buildsys__))
- print "SCons by Steven Knight et al.:"
+ print("SCons by Steven Knight et al.:")
print_version_info("script", scons)
print_version_info("engine", SCons)
command = '"%s" runtest.py %s' % (sys.executable, runtest_args)
- #print command
+ #print(command)
os.system(command)
# Local Variables:
diff --git a/bin/scons-unzip.py b/bin/scons-unzip.py
index d4ec4bf..a64179f 100644
--- a/bin/scons-unzip.py
+++ b/bin/scons-unzip.py
@@ -7,6 +7,7 @@
# I'm using this to make it more convenient to manage working on multiple
# changes on Windows, where I don't have access to my Aegis tools.
#
+from __future__ import print_function
import getopt
import os.path
@@ -32,7 +33,7 @@ for o, a in opts:
outdir = a
elif o == '-v' or o == '--verbose':
def printname(x):
- print x
+ print(x)
if len(args) != 1:
sys.stderr.write("scons-unzip.py: \n")
diff --git a/bin/scons_dev_master.py b/bin/scons_dev_master.py
index 3c41ac0..3d67cb5 100644
--- a/bin/scons_dev_master.py
+++ b/bin/scons_dev_master.py
@@ -3,6 +3,7 @@
# A script for turning a generic Ubuntu system into a master for
# SCons development.
+from __future__ import print_function
import getopt
import sys
@@ -10,7 +11,7 @@ import sys
from Command import CommandRunner, Usage
INITIAL_PACKAGES = [
- 'subversion',
+ 'mercurial',
]
INSTALL_PACKAGES = [
@@ -22,6 +23,14 @@ PYTHON_PACKAGES = [
'gcc',
'make',
'zlib1g-dev',
+ 'libreadline-gplv2-dev',
+ 'libncursesw5-dev',
+ 'libssl-dev',
+ 'libsqlite3-dev',
+ 'tk-dev',
+ 'libgdbm-dev',
+ 'libc6-dev',
+ 'libbz2-dev'
]
BUILDING_PACKAGES = [
@@ -85,7 +94,7 @@ TESTING_PACKAGES = [
]
BUILDBOT_PACKAGES = [
- 'buildbot',
+ 'buildbot-worker',
'cron',
]
@@ -122,7 +131,7 @@ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER]
buildbot Install packages for running BuildBot
"""
- scons_url = 'http://scons.tigris.org/svn/scons/trunk'
+ scons_url = 'https://bdbaddog@bitbucket.org/scons/scons'
sudo = 'sudo'
password = '""'
username = 'guest'
@@ -131,12 +140,12 @@ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER]
try:
try:
opts, args = getopt.getopt(argv[1:], short_options, long_options)
- except getopt.error, msg:
+ except getopt.error as msg:
raise Usage(msg)
for o, a in opts:
if o in ('-h', '--help'):
- print helpstr
+ print(helpstr)
sys.exit(0)
elif o in ('-n', '--no-exec'):
CommandRunner.execute = CommandRunner.do_not_execute
@@ -148,7 +157,7 @@ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER]
username = a
elif o in ('-y', '--yes', '--assume-yes'):
yesflag = o
- except Usage, err:
+ except Usage as err:
sys.stderr.write(str(err.msg) + '\n')
sys.stderr.write('use -h to get help\n')
return 2
@@ -162,6 +171,7 @@ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER]
testing_packages = ' '.join(TESTING_PACKAGES)
buildbot_packages = ' '.join(BUILDBOT_PACKAGES)
python_packages = ' '.join(PYTHON_PACKAGES)
+ doc_packages = ' '.join(DOCUMENTATION_PACKAGES)
cmd = CommandRunner(locals())
@@ -170,9 +180,11 @@ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER]
cmd.run('%(sudo)s apt-get %(yesflag)s upgrade')
elif arg == 'checkout':
cmd.run('%(sudo)s apt-get %(yesflag)s install %(initial_packages)s')
- cmd.run('svn co --username guest --password "" %(scons_url)s')
+ cmd.run('hg clone" %(scons_url)s')
elif arg == 'building':
cmd.run('%(sudo)s apt-get %(yesflag)s install %(building_packages)s')
+ elif arg == 'docs':
+ cmd.run('%(sudo)s apt-get %(yesflag)s install %(doc_packages)s')
elif arg == 'testing':
cmd.run('%(sudo)s apt-get %(yesflag)s install %(testing_packages)s')
elif arg == 'buildbot':
diff --git a/bin/sfsum b/bin/sfsum
index 2dfa422..142793a 100644
--- a/bin/sfsum
+++ b/bin/sfsum
@@ -22,6 +22,7 @@
#
# https://sourceforge.net/projects/sitedocs/
#
+from __future__ import print_function
import xml.sax
import xml.sax.saxutils
@@ -121,9 +122,9 @@ if __name__ == '__main__':
# generalized once we figure out other things for this script to do.
bugs = [x for x in Artifacts['Bugs'] if x.status == 'Open']
- print list(Artifacts.keys())
+ print(list(Artifacts.keys()))
- print "%d open bugs" % len(bugs)
+ print("%d open bugs" % len(bugs))
# Sort them into a separate list for each assignee.
Assigned = {}
@@ -141,7 +142,7 @@ if __name__ == '__main__':
except KeyError:
pass
else:
- print " %s" % a
- b.sort(lambda x, y: cmp(x.artifact_id, y.artifact_id))
+ print(" %s" % a)
+ b.sort(key=lambda x, y: (x.artifact_id, y.artifact_id))
for bug in b:
- print " %-6s %s" % (bug.artifact_id, bug.summary)
+ print(" %-6s %s" % (bug.artifact_id, bug.summary))
diff --git a/bin/svn-bisect.py b/bin/svn-bisect.py
index 77bda58..dbf8dd9 100755
--- a/bin/svn-bisect.py
+++ b/bin/svn-bisect.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- Python -*-
-from __future__ import division
+from __future__ import division, print_function
import sys
from math import log, ceil
@@ -28,22 +28,22 @@ script = script_args[2:]
# print an error message and quit
def error(s):
- print >>sys.stderr, "******", s, "******"
+ print("******", s, "******", file=sys.stderr)
sys.exit(1)
# update to the specified version and run test
def testfail(revision):
"Return true if test fails"
- print "Updating to revision", revision
+ print("Updating to revision", revision)
if subprocess.call(["svn","up","-qr",str(revision)]) != 0:
m = "SVN did not update properly to revision %d"
raise RuntimeError(m % revision)
return subprocess.call(script,shell=False) != 0
# confirm that the endpoints are different
-print "****** Checking upper bracket", upper
+print("****** Checking upper bracket", upper)
upperfails = testfail(upper)
-print "****** Checking lower bracket", lower
+print("****** Checking lower bracket", lower)
lowerfails = testfail(lower)
if upperfails == lowerfails:
error("Upper and lower revisions must bracket the failure")
@@ -51,7 +51,7 @@ if upperfails == lowerfails:
# binary search for transition
msg = "****** max %d revisions to test (bug bracketed by [%d,%d])"
while upper-lower > 1:
- print msg % (ceil(log(upper-lower,2)), lower, upper)
+ print(msg % (ceil(log(upper-lower,2)), lower, upper))
mid = (lower + upper)//2
midfails = testfail(mid)
@@ -64,7 +64,7 @@ while upper-lower > 1:
# show which revision was first to fail
if upperfails != lowerfails: lower = upper
-print "The error was caused by revision", lower
+print("The error was caused by revision", lower)
# Local Variables:
# tab-width:4
diff --git a/bin/update-release-info.py b/bin/update-release-info.py
index aee481e..a4096d1 100644
--- a/bin/update-release-info.py
+++ b/bin/update-release-info.py
@@ -36,7 +36,7 @@ In 'post' mode, files are prepared for the next release cycle:
src/Announce.txt.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -56,8 +56,9 @@ In 'post' mode, files are prepared for the next release cycle:
# 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__ = "bin/update-release-info.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "bin/update-release-info.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import sys
@@ -73,14 +74,14 @@ if len(sys.argv) < 2:
else:
mode = sys.argv[1]
if mode not in ['develop', 'release', 'post']:
- print("""ERROR: `%s' as a parameter is invalid; it must be one of
-\tdevelop, release, or post. The default is develop.""" % mode)
+ print(("""ERROR: `%s' as a parameter is invalid; it must be one of
+\tdevelop, release, or post. The default is develop.""" % mode))
sys.exit(1)
# Get configuration information
config = dict()
-exec open('ReleaseConfig').read() in globals(), config
+exec(open('ReleaseConfig').read(), globals(), config)
try:
version_tuple = config['version_tuple']
@@ -90,9 +91,9 @@ except KeyError:
print('''ERROR: Config file must contain at least version_tuple,
\tunsupported_python_version, and deprecated_python_version.''')
sys.exit(1)
-if DEBUG: print 'version tuple', version_tuple
-if DEBUG: print 'unsupported Python version', unsupported_version
-if DEBUG: print 'deprecated Python version', deprecated_version
+if DEBUG: print('version tuple', version_tuple)
+if DEBUG: print('unsupported Python version', unsupported_version)
+if DEBUG: print('deprecated Python version', deprecated_version)
try:
release_date = config['release_date']
@@ -102,9 +103,9 @@ else:
if len(release_date) == 3:
release_date = release_date + time.localtime()[3:6]
if len(release_date) != 6:
- print '''ERROR: Invalid release date''', release_date
+ print('''ERROR: Invalid release date''', release_date)
sys.exit(1)
-if DEBUG: print 'release date', release_date
+if DEBUG: print('release date', release_date)
if mode == 'develop' and version_tuple[3] != 'alpha':
version_tuple == version_tuple[:3] + ('alpha', 0)
@@ -119,11 +120,11 @@ if len(version_tuple) > 3:
version_type = version_tuple[3]
else:
version_type = 'final'
-if DEBUG: print 'version string', version_string
+if DEBUG: print('version string', version_string)
if version_type not in ['alpha', 'beta', 'candidate', 'final']:
- print("""ERROR: `%s' is not a valid release type in version tuple;
-\tit must be one of alpha, beta, candidate, or final""" % version_type)
+ print(("""ERROR: `%s' is not a valid release type in version tuple;
+\tit must be one of alpha, beta, candidate, or final""" % version_type))
sys.exit(1)
try:
@@ -133,13 +134,13 @@ except KeyError:
month_year = 'MONTH YEAR'
else:
month_year = time.strftime('%B %Y', release_date + (0,0,0))
-if DEBUG: print 'month year', month_year
+if DEBUG: print('month year', month_year)
try:
copyright_years = config['copyright_years']
except KeyError:
copyright_years = '2001 - %d'%(release_date[0] + 1)
-if DEBUG: print 'copyright years', copyright_years
+if DEBUG: print('copyright years', copyright_years)
class UpdateFile(object):
"""
@@ -151,7 +152,7 @@ class UpdateFile(object):
'''
if orig is None: orig = file
try:
- self.content = open(orig, 'rU').read()
+ self.content = open(orig, 'r').read()
except IOError:
# Couldn't open file; don't try to write anything in __del__
self.file = None
@@ -218,7 +219,7 @@ class UpdateFile(object):
XXX
'''
if self.file is not None and self.content != self.orig:
- print 'Updating ' + self.file + '...'
+ print('Updating ' + self.file + '...')
open(self.file, 'w').write(self.content)
if mode == 'post':
diff --git a/bin/xmlagenda.py b/bin/xmlagenda.py
index b3cd520..fcfe53e 100755
--- a/bin/xmlagenda.py
+++ b/bin/xmlagenda.py
@@ -18,6 +18,7 @@
# Grab the sort bar on the far left (just above the "1" for row one)
# and move it down one row. (Row one becomes a floating header)
# Voila!
+from __future__ import print_function
# The team members
# FIXME: These names really should be external to this script
@@ -89,7 +90,7 @@ for issue in issues:
writer.writerow(['','','','','','',''])
for member in team: writer.writerow(['','',member,'','','',''])
-print "Exported %d issues to editlist.csv. Ready to upload to Google."%len(issues)
+print("Exported %d issues to editlist.csv. Ready to upload to Google."%len(issues))
# Local Variables:
# tab-width:4
diff --git a/bootstrap.py b/bootstrap.py
index 26ef90e..58fde15 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -184,9 +184,15 @@ def main():
scons_py = os.path.join('src', 'script', 'scons.py')
src_engine = os.path.join('src', 'engine')
MANIFEST_in = find(os.path.join(src_engine, 'MANIFEST.in'))
-
- files = [ scons_py ] + [os.path.join(src_engine, x)
- for x in parseManifestLines(os.path.join(script_dir, src_engine), open(MANIFEST_in).readlines())]
+ MANIFEST_xml_in = find(os.path.join(src_engine, 'MANIFEST-xml.in'))
+ manifest_files = [os.path.join(src_engine, x)
+ for x in parseManifestLines(os.path.join(script_dir, src_engine),
+ open(MANIFEST_in).readlines())]
+
+ manifest_xml_files = [os.path.join(src_engine, x)
+ for x in parseManifestLines(os.path.join(script_dir, src_engine),
+ open(MANIFEST_xml_in).readlines())]
+ files = [ scons_py ] + manifest_files + manifest_xml_files
for file in files:
src = find(file)
diff --git a/doc/SConscript b/doc/SConscript
index d49b88c..46d4533 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,6 +24,8 @@
# 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
+
import os.path
import re
import sys
@@ -51,7 +53,7 @@ fop = whereis('fop')
xep = whereis('xep')
if not fop and not xep:
- print "doc: No PDF renderer found (fop|xep)!"
+ print("doc: No PDF renderer found (fop|xep)!")
skip_doc = True
#
@@ -109,16 +111,17 @@ man_replace_tpl = """.TH "%(uctitle)s" "1" "%(today)s" "SCons %(version)s" "SCon
.ad l
.SH "NOTE"
%(title)s \- This is a replacement file, stemming from an incomplete
-packaging process without the required doc modules installed. Please
+packaging process without the required doc modules installed. Please
update the system and try running bootstrap.py again.
"""
#
# --- Processing ---
#
+
if skip_doc:
- print "doc: ...skipping building User Guide."
- print " ...creating fake MAN pages."
+ print("doc: ...skipping building User Guide.")
+ print(" ...creating fake MAN pages.")
# Since the top-level SConstruct requires the MAN
# pages to exist for the basic packaging, we create simple
@@ -126,7 +129,7 @@ if skip_doc:
scdir = os.path.join(build, 'man')
if not os.path.isdir(scdir):
os.makedirs(scdir)
-
+
import datetime
today = datetime.date.today().strftime("%m/%d/%Y")
version = env.subst('$VERSION')
@@ -140,8 +143,8 @@ if skip_doc:
fman.close()
else:
if not lynx:
- print "doc: Warning, lynx is not installed...created release packages won't be complete!"
-
+ print("doc: Warning, lynx is not installed...created release packages won't be complete!")
+
#
# Always create a version.xml file containing the version information
# for this run. Ignore it for dependency purposes so we don't
@@ -157,7 +160,7 @@ else:
#
# Builder for copying files to an Install dir, based
# on their extension (better: glob matching pattern)...
- #
+ #
def _glob_install_action(target, source, env):
if not SCons.Util.is_List(target):
target = [target]
@@ -170,7 +173,7 @@ else:
target = [target]
if not SCons.Util.is_List(source):
source = [source]
-
+
res = []
res_src = []
tdir = env.Dir(target[0])
@@ -185,7 +188,7 @@ else:
#
# Builder for copying ChunkedHTML files to an Install dir...
- #
+ #
def _chunked_install_action(target, source, env):
if not SCons.Util.is_List(target):
target = [target]
@@ -195,13 +198,13 @@ else:
spattern = os.path.join(os.path.split(str(source[0]))[0], '*.html')
for g in glob.glob(spattern):
shutil.copy(g, tdir)
-
+
def _chunked_install_emitter(target, source, env):
if not SCons.Util.is_List(target):
target = [target]
if not SCons.Util.is_List(source):
source = [source]
-
+
tdir = env.Dir(target[0])
head, tail = os.path.split(str(source[0]))
return os.path.join(str(tdir), tail), source
@@ -214,23 +217,23 @@ else:
# Ensure that all XML files are valid against our XSD, and
# that all example names and example output suffixes are unique
#
- print "Validating files against SCons XSD..."
+ print("Validating files against SCons XSD...")
if SConsDoc.validate_all_xml(['src'], xsdfile='xsd/scons.xsd'):
- print "OK"
+ print("OK")
else:
- print "Validation failed! Please correct the errors above and try again."
- sys.exit(0)
-
- print "Checking whether all example names are unique..."
+ print("Validation failed! Please correct the errors above and try again.")
+ sys.exit(1)
+
+ print("Checking whether all example names are unique...")
if SConsExamples.exampleNamesAreUnique(os.path.join('doc','user')):
- print "OK"
+ print("OK")
else:
- print "Not all example names and suffixes are unique! Please correct the errors listed above and try again."
- sys.exit(0)
-
+ print("Not all example names and suffixes are unique! Please correct the errors listed above and try again.")
+ sys.exit(1)
+
# List of prerequisite files in the build/doc folder
buildsuite = []
-
+
def copy_dbfiles(env, toolpath, paths, fpattern, use_builddir=True):
""" Helper function, copies a bunch of files matching
the given fpattern to a target directory.
@@ -251,7 +254,7 @@ else:
target_dir = env.Dir(os.path.join(*(toolpath+paths)))
buildsuite.extend(env.GlobInstall(target_dir,
os.path.join(*(paths + fpattern))))
-
+
#
# Copy generated files (.gen/.mod/.xml) to the build folder
#
@@ -300,7 +303,7 @@ else:
# installing/copying them to the build directory. It basically
# links the original sources to the respective build folder,
# such that a simple 'python bootstrap.py' rebuilds the
- # documentation when a file, like 'doc/user/depends.xml'
+ # documentation when a file, like 'doc/user/depends.xml'
# for example, changes.
# Finally, in DOCNODES we store the created PDF and HTML files,
# such that we can then install them in the proper places for
@@ -315,7 +318,7 @@ else:
'user' : (['chunked','html','pdf','epub','text'], [], []),
'man' : (['man','epub','text'], [], [])
}
-
+
#
# We have to tell SCons to scan the top-level XML files which
# get included by the document XML files in the subdirectories.
@@ -327,15 +330,15 @@ else:
continue
base, ext = os.path.splitext(s)
if ext in ['.fig', '.jpg']:
- buildsuite.extend(env.Command(os.path.join(build, s),
- s,
+ buildsuite.extend(env.Command(os.path.join(build, s),
+ s,
Copy("$TARGET", "$SOURCE")))
else:
revaction([env.File(os.path.join(build, s))],
[env.File(s)], env)
for doc in docs:
-
+
#
# Read MANIFEST file and copy the listed files to the
# build directory, while branding them with the
@@ -359,7 +362,7 @@ else:
else:
target_dir = os.path.join(build, doc)
if ext in ['.fig', '.jpg', '.svg']:
- docs[doc][DOCDEPENDS].extend(env.Command(build_s, doc_s,
+ docs[doc][DOCDEPENDS].extend(env.Command(build_s, doc_s,
Copy("$TARGET", "$SOURCE")))
else:
btarget = env.File(build_s)
@@ -389,18 +392,18 @@ else:
sctargets.append(env.File(os.path.join(scdir, 'scons-%s.pdf' % doc)))
if 'epub' in docs[doc][DOCTARGETS]:
sctargets.append(env.File(os.path.join(scdir, 'scons-%s.epub' % doc)))
-
+
if 'man' in docs[doc][DOCTARGETS]:
for m in man_page_list:
sctargets.append(os.path.join(scdir, m))
man, _1 = os.path.splitext(m)
-
+
sctargets.append(os.path.join(scdir, 'scons-%s.pdf' % man))
sctargets.append(os.path.join(scdir, 'scons-%s.html' % man))
-
- docs[doc][DOCNODES].extend(env.Command(sctargets, buildsuite + docs[doc][DOCDEPENDS],
+
+ docs[doc][DOCNODES].extend(env.Command(sctargets, buildsuite + docs[doc][DOCDEPENDS],
"cd %s && $PYTHON ${SCONS_PY.abspath}%s" % (scdir, cleanopt)))
-
+
install_css = False
for doc in docs:
@@ -412,13 +415,13 @@ else:
epub = os.path.join(build, 'EPUB', 'scons-%s.epub' % doc)
text = os.path.join(build, 'TEXT', 'scons-%s.txt' % doc)
if 'chunked' in docs[doc][DOCTARGETS]:
- installed_chtml = env.ChunkedInstall(env.Dir(htmldir),
+ installed_chtml = env.ChunkedInstall(env.Dir(htmldir),
os.path.join(build, doc,'scons-%s' % doc, 'index.html'))
installed_chtml_css = env.Install(env.Dir(htmldir),
os.path.join(build, doc, 'scons.css'))
env.Depends(installed_chtml, docs[doc][DOCNODES])
env.Depends(installed_chtml_css, docs[doc][DOCNODES])
-
+
tar_deps.extend([htmlindex, installed_chtml_css])
tar_list.extend([htmldir])
Local(htmlindex)
@@ -431,7 +434,7 @@ else:
Local(html)
env.Ignore(html, version_xml)
install_css = True
-
+
if 'pdf' in docs[doc][DOCTARGETS]:
env.InstallAs(env.File(pdf), env.File(os.path.join(build, doc,'scons-%s.pdf' % doc)))
Local(pdf)
@@ -447,14 +450,14 @@ else:
tar_deps.append(epub)
tar_list.append(epub)
-
- if ('text' in docs[doc][DOCTARGETS] and lynx and
+
+ if ('text' in docs[doc][DOCTARGETS] and lynx and
(('html' in docs[doc][DOCTARGETS]) or (doc == 'man'))):
texthtml = os.path.join(build, doc,'index.html')
if doc == 'man':
# Special handling for single MAN file
texthtml = os.path.join(build, doc, 'scons-scons.html')
-
+
env.Command(text, env.File(texthtml), "lynx -dump ${SOURCE.abspath} > $TARGET")
Local(text)
@@ -462,21 +465,21 @@ else:
tar_deps.append(text)
tar_list.append(text)
-
-
+
+
if 'man' in docs[doc][DOCTARGETS]:
#
# Man page(s)
#
for m in man_page_list:
man, _1 = os.path.splitext(m)
-
+
pdf = os.path.join(build, 'PDF', '%s-man.pdf' % man)
html = os.path.join(build, 'HTML' , '%s-man.html' % man)
-
+
env.InstallAs(env.File(pdf), env.File(os.path.join(build, 'man','scons-%s.pdf' % man)))
env.InstallAs(env.File(html), env.File(os.path.join(build, 'man','scons-%s.html' % man)))
-
+
tar_deps.extend([pdf, html])
tar_list.extend([pdf, html])
@@ -484,7 +487,7 @@ else:
# Install CSS file, common to all single HTMLs
if install_css:
css_file = os.path.join(build, 'HTML', 'scons.css')
- env.InstallAs(env.File(css_file),
+ env.InstallAs(env.File(css_file),
env.File(os.path.join(build, 'user','scons.css')))
tar_deps.extend([css_file])
tar_list.extend([css_file])
@@ -540,7 +543,7 @@ if not epydoc_cli:
# http://epydoc.svn.sourceforge.net/viewvc/epydoc/trunk/epydoc/src/epydoc/cli.py
elif env['EPYDOCFLAGS'] == '--pdf':
- pdf_writer = LatexWriter(docindex,
+ pdf_writer = LatexWriter(docindex,
docformat='restructuredText',
prj_name='SCons',
prj_url='http://www.scons.org/')
@@ -560,9 +563,9 @@ else: # epydoc_cli is found
Touch('$TARGET'),
]
-
+
if not epydoc_cli and not epydoc:
- print "doc: epydoc not found, skipping building API documentation."
+ print("doc: epydoc not found, skipping building API documentation.")
else:
# XXX Should be in common with reading the same thing in
# the SConstruct file.
@@ -584,7 +587,7 @@ else:
tar_list.append(htmldir)
if not epydoc_cli:
- print "doc: command line epydoc is not found, skipping PDF/PS/Tex output"
+ print("doc: command line epydoc is not found, skipping PDF/PS/Tex output")
else:
# PDF and PostScript and TeX are built from the
# same invocation.
@@ -617,7 +620,7 @@ if tar_deps:
tar_list = ' '.join([x.replace(build+'/', '') for x in tar_list])
t = env.Command(dist_doc_tar_gz, tar_deps,
"tar cf${TAR_HFLAG} - -C %s %s | gzip > $TARGET" % (build, tar_list))
- AddPostAction(dist_doc_tar_gz, Chmod(dist_doc_tar_gz, 0644))
+ AddPostAction(dist_doc_tar_gz, Chmod(dist_doc_tar_gz, 0o644))
Local(t)
Alias('doc', t)
else:
diff --git a/doc/design/SConstruct b/doc/design/SConstruct
index d90dcfd..2bec66f 100644
--- a/doc/design/SConstruct
+++ b/doc/design/SConstruct
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/doc/design/acks.xml b/doc/design/acks.xml
index 875daf7..f9969f4 100644
--- a/doc/design/acks.xml
+++ b/doc/design/acks.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/bground.xml b/doc/design/bground.xml
index a690c44..d3864ad 100644
--- a/doc/design/bground.xml
+++ b/doc/design/bground.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/chtml.xsl b/doc/design/chtml.xsl
index b2fe344..6db92c7 100644
--- a/doc/design/chtml.xsl
+++ b/doc/design/chtml.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/copyright.xml b/doc/design/copyright.xml
index 34ac801..262f894 100644
--- a/doc/design/copyright.xml
+++ b/doc/design/copyright.xml
@@ -10,7 +10,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/engine.xml b/doc/design/engine.xml
index befc458..594625e 100644
--- a/doc/design/engine.xml
+++ b/doc/design/engine.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/goals.xml b/doc/design/goals.xml
index aea9679..dec4bad 100644
--- a/doc/design/goals.xml
+++ b/doc/design/goals.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/html.xsl b/doc/design/html.xsl
index 8ff534c..3f0760b 100644
--- a/doc/design/html.xsl
+++ b/doc/design/html.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/install.xml b/doc/design/install.xml
index f0b96db..c45ea2b 100644
--- a/doc/design/install.xml
+++ b/doc/design/install.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/intro.xml b/doc/design/intro.xml
index b85e446..38b94ae 100644
--- a/doc/design/intro.xml
+++ b/doc/design/intro.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/issues.xml b/doc/design/issues.xml
index faf692b..48673de 100644
--- a/doc/design/issues.xml
+++ b/doc/design/issues.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/main.xml b/doc/design/main.xml
index 02d0e9f..3c7b30d 100644
--- a/doc/design/main.xml
+++ b/doc/design/main.xml
@@ -2,7 +2,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/native.xml b/doc/design/native.xml
index 1635b8b..787f4dd 100644
--- a/doc/design/native.xml
+++ b/doc/design/native.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/overview.xml b/doc/design/overview.xml
index 1bc822f..793a0a4 100644
--- a/doc/design/overview.xml
+++ b/doc/design/overview.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/pdf.xsl b/doc/design/pdf.xsl
index bc42506..a6d0054 100644
--- a/doc/design/pdf.xsl
+++ b/doc/design/pdf.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/scons_title.xsl b/doc/design/scons_title.xsl
index 2ff38af..130c6a5 100644
--- a/doc/design/scons_title.xsl
+++ b/doc/design/scons_title.xsl
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/design/summary.xml b/doc/design/summary.xml
index ec30a90..5dfa585 100644
--- a/doc/design/summary.xml
+++ b/doc/design/summary.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/SConstruct b/doc/developer/SConstruct
index 85275af..b40bc6b 100644
--- a/doc/developer/SConstruct
+++ b/doc/developer/SConstruct
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/doc/developer/architecture.xml b/doc/developer/architecture.xml
index 032c548..0f18cea 100644
--- a/doc/developer/architecture.xml
+++ b/doc/developer/architecture.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/branches.xml b/doc/developer/branches.xml
index 843bd62..91ab768 100644
--- a/doc/developer/branches.xml
+++ b/doc/developer/branches.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/copyright.xml b/doc/developer/copyright.xml
index e835a76..50e0a42 100644
--- a/doc/developer/copyright.xml
+++ b/doc/developer/copyright.xml
@@ -10,7 +10,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/cycle.xml b/doc/developer/cycle.xml
index e889c4e..3406f76 100644
--- a/doc/developer/cycle.xml
+++ b/doc/developer/cycle.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/main.xml b/doc/developer/main.xml
index a19a09b..1920794 100644
--- a/doc/developer/main.xml
+++ b/doc/developer/main.xml
@@ -2,7 +2,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/packaging.xml b/doc/developer/packaging.xml
index c44093d..4222299 100644
--- a/doc/developer/packaging.xml
+++ b/doc/developer/packaging.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/preface.xml b/doc/developer/preface.xml
index 539c5d6..bd3962d 100644
--- a/doc/developer/preface.xml
+++ b/doc/developer/preface.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/sourcetree.xml b/doc/developer/sourcetree.xml
index f0ed4a1..c9657d1 100644
--- a/doc/developer/sourcetree.xml
+++ b/doc/developer/sourcetree.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/developer/testing.xml b/doc/developer/testing.xml
index 9269c77..779eb7d 100644
--- a/doc/developer/testing.xml
+++ b/doc/developer/testing.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/generated/builders.gen b/doc/generated/builders.gen
index d49156f..d851c93 100644
--- a/doc/generated/builders.gen
+++ b/doc/generated/builders.gen
@@ -934,22 +934,24 @@ compilation error messages displayed in the Visual Studio console output
window. This can be remedied by adding the Visual C/C++ <literal>/FC</literal>
compiler option to the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-CCFLAGS"><envar>$CCFLAGS</envar></link> variable so that the compiler will
print the full path name of any files that cause compilation errors. </para>
-<para xmlns="http://www.scons.org/dbxsd/v1.0"> Example usage: </para> <example_commands xmlns="http://www.scons.org/dbxsd/v1.0">barsrcs = ['bar.cpp'],
-barincs = ['bar.h'],
+<para xmlns="http://www.scons.org/dbxsd/v1.0"> Example usage: </para>
+ <example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
+barsrcs = ['bar.cpp']
+barincs = ['bar.h']
barlocalincs = ['StdAfx.h']
barresources = ['bar.rc','resource.h']
barmisc = ['bar_readme.txt']
dll = env.SharedLibrary(target = 'bar.dll',
source = barsrcs)
-
+buildtarget = [s for s in dll if str(s).endswith('dll')]
env.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'],
srcs = barsrcs,
incs = barincs,
localincs = barlocalincs,
resources = barresources,
misc = barmisc,
- buildtarget = dll,
+ buildtarget = buildtarget,
variant = 'Release')
</example_commands>
<para xmlns="http://www.scons.org/dbxsd/v1.0">Starting with version 2.4 of
@@ -1744,6 +1746,81 @@ env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f'])
</example_commands>
</listitem>
</varlistentry>
+ <varlistentry id="b-ProgramAllAtOnce">
+ <term>
+ <function>ProgramAllAtOnce()</function>
+ </term>
+ <term>
+ <function>env.ProgramAllAtOnce()</function>
+ </term>
+ <listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ Builds an executable from D sources without first creating individual
+ objects for each file.
+ </para>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ D sources can be compiled file-by-file as C and C++ source are, and
+ D is integrated into the <filename xmlns="http://www.scons.org/dbxsd/v1.0">scons</filename> Object and Program builders for
+ this model of build. D codes can though do whole source
+ meta-programming (some of the testing frameworks do this). For this
+ it is imperative that all sources are compiled and linked in a single call of
+ the D compiler. This builder serves that purpose.
+ </para>
+ <example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
+ env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d'])
+ </example_commands>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ This command will compile the modules mod_a, mod_b, and mod_c in a
+ single compilation process without first creating object files for
+ the modules. Some of the D compilers will create executable.o others
+ will not.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ Builds an executable from D sources without first creating individual
+ objects for each file.
+ </para>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ D sources can be compiled file-by-file as C and C++ source are, and
+ D is integrated into the <filename xmlns="http://www.scons.org/dbxsd/v1.0">scons</filename> Object and Program builders for
+ this model of build. D codes can though do whole source
+ meta-programming (some of the testing frameworks do this). For this
+ it is imperative that all sources are compiled and linked in a single call of
+ the D compiler. This builder serves that purpose.
+ </para>
+ <example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
+ env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d'])
+ </example_commands>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ This command will compile the modules mod_a, mod_b, and mod_c in a
+ single compilation process without first creating object files for
+ the modules. Some of the D compilers will create executable.o others
+ will not.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ Builds an executable from D sources without first creating individual
+ objects for each file.
+ </para>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ D sources can be compiled file-by-file as C and C++ source are, and
+ D is integrated into the <filename xmlns="http://www.scons.org/dbxsd/v1.0">scons</filename> Object and Program builders for
+ this model of build. D codes can though do whole source
+ meta-programming (some of the testing frameworks do this). For this
+ it is imperative that all sources are compiled and linked in a single call of
+ the D compiler. This builder serves that purpose.
+ </para>
+ <example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
+ env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d'])
+ </example_commands>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ This command will compile the modules mod_a, mod_b, and mod_c in a
+ single compilation process without first creating object files for
+ the modules. Some of the D compilers will create executable.o others
+ will not.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry id="b-RES">
<term>
<function>RES()</function>
@@ -2248,7 +2325,7 @@ and the result replaces the key.
env = Environment(tools = ['default', 'textfile'])
env['prefix'] = '/usr/bin'
-script_dict = {'@prefix@': '/bin', @exec_prefix@: '$prefix'}
+script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix'}
env.Substfile('script.in', SUBST_DICT = script_dict)
conf_dict = {'%VERSION%': '1.2.3', '%BASE%': 'MyProg'}
diff --git a/doc/generated/builders.mod b/doc/generated/builders.mod
index 50591b4..ae60653 100644
--- a/doc/generated/builders.mod
+++ b/doc/generated/builders.mod
@@ -45,6 +45,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-POTUpdate "<function xmlns='http://www.scons.org/dbxsd/v1.0'>POTUpdate</function>">
<!ENTITY b-POUpdate "<function xmlns='http://www.scons.org/dbxsd/v1.0'>POUpdate</function>">
<!ENTITY b-Program "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Program</function>">
+<!ENTITY b-ProgramAllAtOnce "<function xmlns='http://www.scons.org/dbxsd/v1.0'>ProgramAllAtOnce</function>">
<!ENTITY b-RES "<function xmlns='http://www.scons.org/dbxsd/v1.0'>RES</function>">
<!ENTITY b-RMIC "<function xmlns='http://www.scons.org/dbxsd/v1.0'>RMIC</function>">
<!ENTITY b-RPCGenClient "<function xmlns='http://www.scons.org/dbxsd/v1.0'>RPCGenClient</function>">
@@ -100,6 +101,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-env-POTUpdate "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.POTUpdate</function>">
<!ENTITY b-env-POUpdate "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.POUpdate</function>">
<!ENTITY b-env-Program "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Program</function>">
+<!ENTITY b-env-ProgramAllAtOnce "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.ProgramAllAtOnce</function>">
<!ENTITY b-env-RES "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.RES</function>">
<!ENTITY b-env-RMIC "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.RMIC</function>">
<!ENTITY b-env-RPCGenClient "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.RPCGenClient</function>">
@@ -165,6 +167,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-link-POTUpdate "<link linkend='b-POTUpdate' xmlns='http://www.scons.org/dbxsd/v1.0'><function>POTUpdate</function></link>">
<!ENTITY b-link-POUpdate "<link linkend='b-POUpdate' xmlns='http://www.scons.org/dbxsd/v1.0'><function>POUpdate</function></link>">
<!ENTITY b-link-Program "<link linkend='b-Program' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Program</function></link>">
+<!ENTITY b-link-ProgramAllAtOnce "<link linkend='b-ProgramAllAtOnce' xmlns='http://www.scons.org/dbxsd/v1.0'><function>ProgramAllAtOnce</function></link>">
<!ENTITY b-link-RES "<link linkend='b-RES' xmlns='http://www.scons.org/dbxsd/v1.0'><function>RES</function></link>">
<!ENTITY b-link-RMIC "<link linkend='b-RMIC' xmlns='http://www.scons.org/dbxsd/v1.0'><function>RMIC</function></link>">
<!ENTITY b-link-RPCGenClient "<link linkend='b-RPCGenClient' xmlns='http://www.scons.org/dbxsd/v1.0'><function>RPCGenClient</function></link>">
@@ -220,6 +223,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-link-env-POTUpdate "<link linkend='b-POTUpdate' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.POTUpdate</function></link>">
<!ENTITY b-link-env-POUpdate "<link linkend='b-POUpdate' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.POUpdate</function></link>">
<!ENTITY b-link-env-Program "<link linkend='b-Program' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Program</function></link>">
+<!ENTITY b-link-env-ProgramAllAtOnce "<link linkend='b-ProgramAllAtOnce' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.ProgramAllAtOnce</function></link>">
<!ENTITY b-link-env-RES "<link linkend='b-RES' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.RES</function></link>">
<!ENTITY b-link-env-RMIC "<link linkend='b-RMIC' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.RMIC</function></link>">
<!ENTITY b-link-env-RPCGenClient "<link linkend='b-RPCGenClient' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.RPCGenClient</function></link>">
diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml
index 01d92e6..6f64f8f 100644
--- a/doc/generated/examples/caching_ex-random_1.xml
+++ b/doc/generated/examples/caching_ex-random_1.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-cc -o f1.o -c f1.c
-cc -o f5.o -c f5.c
-cc -o f3.o -c f3.c
cc -o f2.o -c f2.c
cc -o f4.o -c f4.c
+cc -o f3.o -c f3.c
+cc -o f5.o -c f5.c
+cc -o f1.o -c f1.c
cc -o prog f1.o f2.o f3.o f4.o f5.o
</screen>
diff --git a/doc/generated/examples/environments_ex3_1.xml b/doc/generated/examples/environments_ex3_1.xml
index 3262302..5071c6e 100644
--- a/doc/generated/examples/environments_ex3_1.xml
+++ b/doc/generated/examples/environments_ex3_1.xml
@@ -1,6 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-
-scons: *** Two environments with different actions were specified for the same target: foo.o
-File "/home/my/project/SConstruct", line 6, in &lt;module&gt;
+UnicodeDecodeError: 'utf8' codec can't decode byte 0xc2 in position 547: invalid continuation byte:
+ File "/home/my/project/SConstruct", line 6:
+ dbg.Program('foo', 'foo.c')
+ File "bootstrap/src/engine/SCons/Environment.py", line 260:
+ return MethodWrapper.__call__(self, target, source, *args, **kw)
+ File "bootstrap/src/engine/SCons/Environment.py", line 224:
+ return self.method(*nargs, **kwargs)
+ File "bootstrap/src/engine/SCons/Builder.py", line 635:
+ return self._execute(env, target, source, OverrideWarner(kw), ekw)
+ File "bootstrap/src/engine/SCons/Builder.py", line 541:
+ source = self.src_builder_sources(env, source, overwarn)
+ File "bootstrap/src/engine/SCons/Builder.py", line 748:
+ tlist = bld._execute(env, None, [s], overwarn)
+ File "bootstrap/src/engine/SCons/Builder.py", line 557:
+ _node_errors(self, env, tlist, slist)
+ File "bootstrap/src/engine/SCons/Builder.py", line 303:
+ 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'))
+ File "/usr/lib/python2.7/encodings/utf_8.py", line 16:
+ return codecs.utf_8_decode(input, errors, True)
</screen>
diff --git a/doc/generated/examples/environments_missing2_1.xml b/doc/generated/examples/environments_missing2_1.xml
index 019099f..ffb308c 100644
--- a/doc/generated/examples/environments_missing2_1.xml
+++ b/doc/generated/examples/environments_missing2_1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-value is:
+
scons: *** NameError `MISSING' trying to evaluate `$MISSING'
File "/home/my/project/SConstruct", line 3, in &lt;module&gt;
</screen>
diff --git a/doc/generated/examples/java_jar1_1.xml b/doc/generated/examples/java_jar1_1.xml
index de93227..daa3d1a 100644
--- a/doc/generated/examples/java_jar1_1.xml
+++ b/doc/generated/examples/java_jar1_1.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java
-jar cf test.jar classes
+scons: *** [test.jar] Source `classes.class' not found, needed by target `test.jar'.
</screen>
diff --git a/doc/generated/examples/mergeflags_MergeFlags1_1.xml b/doc/generated/examples/mergeflags_MergeFlags1_1.xml
index 8f18fd8..8a0c336 100644
--- a/doc/generated/examples/mergeflags_MergeFlags1_1.xml
+++ b/doc/generated/examples/mergeflags_MergeFlags1_1.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-['-option', '-O1', '-whatever', '-O3']
-scons: `.' is up to date.
+ File "/home/my/project/SConstruct", line 5
+
+ print env['CCFLAGS']
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/mergeflags_MergeFlags2_1.xml b/doc/generated/examples/mergeflags_MergeFlags2_1.xml
index 8cae827..1312c47 100644
--- a/doc/generated/examples/mergeflags_MergeFlags2_1.xml
+++ b/doc/generated/examples/mergeflags_MergeFlags2_1.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-['/include', '/usr/local/include', '/usr/include', '/usr/opt/include']
-scons: `.' is up to date.
+ File "/home/my/project/SConstruct", line 5
+
+ print env['CPPPATH']
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/mergeflags_MergeFlags3_1.xml b/doc/generated/examples/mergeflags_MergeFlags3_1.xml
index d4f23d4..8a0c336 100644
--- a/doc/generated/examples/mergeflags_MergeFlags3_1.xml
+++ b/doc/generated/examples/mergeflags_MergeFlags3_1.xml
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-['-option', '-O1', '-whatever', '-O3']
-['/include', '/usr/local/include', '/usr/include', '/usr/opt/include']
-scons: `.' is up to date.
+ File "/home/my/project/SConstruct", line 5
+
+ print env['CCFLAGS']
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/misc_Flatten2_1.xml b/doc/generated/examples/misc_Flatten2_1.xml
index 58ffe6b..66161ec 100644
--- a/doc/generated/examples/misc_Flatten2_1.xml
+++ b/doc/generated/examples/misc_Flatten2_1.xml
@@ -2,5 +2,5 @@
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
AttributeError: 'NodeList' object has no attribute 'abspath':
File "/home/my/project/SConstruct", line 8:
- print object_file.abspath
+ print(object_file.abspath)
</screen>
diff --git a/doc/generated/examples/parseflags_ex1_1.xml b/doc/generated/examples/parseflags_ex1_1.xml
index d6e4d96..79cdad6 100644
--- a/doc/generated/examples/parseflags_ex1_1.xml
+++ b/doc/generated/examples/parseflags_ex1_1.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-CPPPATH ['/opt/include']
-LIBPATH ['/opt/lib']
-LIBS ['foo']
-cc -o f1.o -c -I/opt/include f1.c
-cc -o f1 f1.o -L/opt/lib -lfoo
+ File "/home/my/project/SConstruct", line 5
+
+ print k, v
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/parseflags_ex1_2.xml b/doc/generated/examples/parseflags_ex1_2.xml
index 4c115d0..b9c9cd2 100644
--- a/doc/generated/examples/parseflags_ex1_2.xml
+++ b/doc/generated/examples/parseflags_ex1_2.xml
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">C:\&gt;<userinput>scons -Q</userinput>
-CPPPATH ['/opt/include']
-LIBPATH ['/opt/lib']
-LIBS ['foo']
-cl /Fof1.obj /c f1.c /nologo /I\opt\include
-link /nologo /OUT:f1.exe /LIBPATH:\opt\lib foo.lib f1.obj
-embedManifestExeCheck(target, source, env)
+ File "/home/my/project/SConstruct", line 5
+
+ print k, v
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/parseflags_ex2_1.xml b/doc/generated/examples/parseflags_ex2_1.xml
index da84ee3..79cdad6 100644
--- a/doc/generated/examples/parseflags_ex2_1.xml
+++ b/doc/generated/examples/parseflags_ex2_1.xml
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-CCFLAGS -whatever
-cc -o f1.o -c -whatever f1.c
-cc -o f1 f1.o
+ File "/home/my/project/SConstruct", line 5
+
+ print k, v
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/parseflags_ex3_1.xml b/doc/generated/examples/parseflags_ex3_1.xml
index d6e4d96..79cdad6 100644
--- a/doc/generated/examples/parseflags_ex3_1.xml
+++ b/doc/generated/examples/parseflags_ex3_1.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-CPPPATH ['/opt/include']
-LIBPATH ['/opt/lib']
-LIBS ['foo']
-cc -o f1.o -c -I/opt/include f1.c
-cc -o f1 f1.o -L/opt/lib -lfoo
+ File "/home/my/project/SConstruct", line 5
+
+ print k, v
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/parseflags_ex4_1.xml b/doc/generated/examples/parseflags_ex4_1.xml
index d6e4d96..79cdad6 100644
--- a/doc/generated/examples/parseflags_ex4_1.xml
+++ b/doc/generated/examples/parseflags_ex4_1.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-CPPPATH ['/opt/include']
-LIBPATH ['/opt/lib']
-LIBS ['foo']
-cc -o f1.o -c -I/opt/include f1.c
-cc -o f1 f1.o -L/opt/lib -lfoo
+ File "/home/my/project/SConstruct", line 5
+
+ print k, v
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/sourcecode_bitkeeper_1.xml b/doc/generated/examples/sourcecode_bitkeeper_1.xml
index a070ada..41af3a2 100644
--- a/doc/generated/examples/sourcecode_bitkeeper_1.xml
+++ b/doc/generated/examples/sourcecode_bitkeeper_1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-bk get hello.c
-cc -o hello.o -c hello.c
-cc -o hello hello.o
+AttributeError: 'SConsEnvironment' object has no attribute 'BitKeeper':
+ File "/home/my/project/SConstruct", line 2:
+ env.SourceCode('.', env.BitKeeper())
</screen>
diff --git a/doc/generated/examples/sourcecode_cvs_1.xml b/doc/generated/examples/sourcecode_cvs_1.xml
index 9ec7cd4..01ddb6b 100644
--- a/doc/generated/examples/sourcecode_cvs_1.xml
+++ b/doc/generated/examples/sourcecode_cvs_1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-cvs -d /usr/local/CVS co hello.c
-cc -o hello.o -c hello.c
-cc -o hello hello.o
+AttributeError: 'SConsEnvironment' object has no attribute 'CVS':
+ File "/home/my/project/SConstruct", line 2:
+ env.SourceCode('.', env.CVS('/usr/local/CVS'))
</screen>
diff --git a/doc/generated/examples/sourcecode_rcs_1.xml b/doc/generated/examples/sourcecode_rcs_1.xml
index 5e120eb..e6b36dd 100644
--- a/doc/generated/examples/sourcecode_rcs_1.xml
+++ b/doc/generated/examples/sourcecode_rcs_1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-co hello.c
-cc -o hello.o -c hello.c
-cc -o hello hello.o
+AttributeError: 'SConsEnvironment' object has no attribute 'RCS':
+ File "/home/my/project/SConstruct", line 2:
+ env.SourceCode('.', env.RCS())
</screen>
diff --git a/doc/generated/examples/sourcecode_sccs_1.xml b/doc/generated/examples/sourcecode_sccs_1.xml
index 354b680..e0699d1 100644
--- a/doc/generated/examples/sourcecode_sccs_1.xml
+++ b/doc/generated/examples/sourcecode_sccs_1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-sccs get hello.c
-cc -o hello.o -c hello.c
-cc -o hello hello.o
+AttributeError: 'SConsEnvironment' object has no attribute 'SCCS':
+ File "/home/my/project/SConstruct", line 2:
+ env.SourceCode('.', env.SCCS())
</screen>
diff --git a/doc/generated/examples/tasks_ex1_1.xml b/doc/generated/examples/tasks_ex1_1.xml
index 5760a45..4885fde 100644
--- a/doc/generated/examples/tasks_ex1_1.xml
+++ b/doc/generated/examples/tasks_ex1_1.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
+cat &lt; test.bar &gt; test.h
cc -o app main.cpp
cat &lt; foo.bar2 &gt; foo.cpp
cc -o app2 main2.cpp foo.cpp
-cat &lt; test.bar &gt; test.h
</screen>
diff --git a/doc/generated/examples/troubleshoot_Dump_1.xml b/doc/generated/examples/troubleshoot_Dump_1.xml
index 248e85c..281fed7 100644
--- a/doc/generated/examples/troubleshoot_Dump_1.xml
+++ b/doc/generated/examples/troubleshoot_Dump_1.xml
@@ -1,75 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons</userinput>
scons: Reading SConscript files ...
-{ 'BUILDERS': {'_InternalInstall': &lt;function InstallBuilderWrapper at 0x700000&amp;gt;, '_InternalInstallVersionedLib': &lt;function InstallVersionedBuilderWrapper at 0x700000&amp;gt;, '_InternalInstallAs': &lt;function InstallAsBuilderWrapper at 0x700000&amp;gt;},
- 'CONFIGUREDIR': '#/.sconf_temp',
- 'CONFIGURELOG': '#/config.log',
- 'CPPSUFFIXES': [ '.c',
- '.C',
- '.cxx',
- '.cpp',
- '.c++',
- '.cc',
- '.h',
- '.H',
- '.hxx',
- '.hpp',
- '.hh',
- '.F',
- '.fpp',
- '.FPP',
- '.m',
- '.mm',
- '.S',
- '.spp',
- '.SPP',
- '.sx'],
- 'DSUFFIXES': ['.d'],
- 'Dir': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'Dirs': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'ENV': { 'PATH': '/usr/local/bin:/opt/bin:/bin:/usr/bin'},
- 'ESCAPE': &lt;function escape at 0x700000&amp;gt;,
- 'File': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'HOST_ARCH': None,
- 'HOST_OS': None,
- 'IDLSUFFIXES': ['.idl', '.IDL'],
- 'INSTALL': &lt;function copyFunc at 0x700000&amp;gt;,
- 'INSTALLVERSIONEDLIB': &lt;function copyFuncVersionedLib at 0x700000&amp;gt;,
- 'LIBPREFIX': 'lib',
- 'LIBPREFIXES': ['$LIBPREFIX'],
- 'LIBSUFFIX': '.a',
- 'LIBSUFFIXES': ['$LIBSUFFIX', '$SHLIBSUFFIX'],
- 'MAXLINELENGTH': 128072,
- 'OBJPREFIX': '',
- 'OBJSUFFIX': '.o',
- 'PLATFORM': 'posix',
- 'PROGPREFIX': '',
- 'PROGSUFFIX': '',
- 'PSPAWN': &lt;function piped_env_spawn at 0x700000&amp;gt;,
- 'RDirs': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'SCANNERS': [],
- 'SHELL': 'sh',
- 'SHLIBPREFIX': '$LIBPREFIX',
- 'SHLIBSUFFIX': '.so',
- 'SHOBJPREFIX': '$OBJPREFIX',
- 'SHOBJSUFFIX': '$OBJSUFFIX',
- 'SPAWN': &lt;function subprocess_spawn at 0x700000&amp;gt;,
- 'TARGET_ARCH': None,
- 'TARGET_OS': None,
- 'TEMPFILE': &lt;class 'SCons.Platform.TempFileMunge'&gt;,
- 'TEMPFILEPREFIX': '@',
- 'TOOLS': ['install', 'install'],
- '_CPPDEFFLAGS': '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}',
- '_CPPINCFLAGS': '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
- '_LIBDIRFLAGS': '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
- '_LIBFLAGS': '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}',
- '__DRPATH': '$_DRPATH',
- '__RPATH': '$_RPATH',
- '_concat': &lt;function _concat at 0x700000&amp;gt;,
- '_defines': &lt;function _defines at 0x700000&amp;gt;,
- '_stripixes': &lt;function _stripixes at 0x700000&amp;gt;}
-scons: done reading SConscript files.
-scons: Building targets ...
-scons: `.' is up to date.
-scons: done building targets.
+ File "/home/my/project/SConstruct", line 2
+
+ print env.Dump()
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/troubleshoot_Dump_2.xml b/doc/generated/examples/troubleshoot_Dump_2.xml
index d6fa404..78cd84b 100644
--- a/doc/generated/examples/troubleshoot_Dump_2.xml
+++ b/doc/generated/examples/troubleshoot_Dump_2.xml
@@ -1,107 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">C:\&gt;<userinput>scons</userinput>
scons: Reading SConscript files ...
-{ 'BUILDERS': {'_InternalInstallVersionedLib': &lt;function InstallVersionedBuilderWrapper at 0x700000&amp;gt;, '_InternalInstall': &lt;function InstallBuilderWrapper at 0x700000&amp;gt;, 'Object': &lt;SCons.Builder.CompositeBuilder object at 0x700000&amp;gt;, 'PCH': &lt;SCons.Builder.BuilderBase object at 0x700000&amp;gt;, 'RES': &lt;SCons.Builder.BuilderBase object at 0x700000&amp;gt;, 'SharedObject': &lt;SCons.Builder.CompositeBuilder object at 0x700000&amp;gt;, 'StaticObject': &lt;SCons.Builder.CompositeBuilder object at 0x700000&amp;gt;, '_InternalInstallAs': &lt;function InstallAsBuilderWrapper at 0x700000&amp;gt;},
- 'CC': 'cl',
- 'CCCOM': &lt;SCons.Action.FunctionAction object at 0x700000&amp;gt;,
- 'CCFLAGS': ['/nologo'],
- 'CCPCHFLAGS': ['${(PCH and "/Yu%s \\"/Fp%s\\""%(PCHSTOP or "",File(PCH))) or ""}'],
- 'CCPDBFLAGS': ['${(PDB and "/Z7") or ""}'],
- 'CFILESUFFIX': '.c',
- 'CFLAGS': [],
- 'CONFIGUREDIR': '#/.sconf_temp',
- 'CONFIGURELOG': '#/config.log',
- 'CPPDEFPREFIX': '/D',
- 'CPPDEFSUFFIX': '',
- 'CPPSUFFIXES': [ '.c',
- '.C',
- '.cxx',
- '.cpp',
- '.c++',
- '.cc',
- '.h',
- '.H',
- '.hxx',
- '.hpp',
- '.hh',
- '.F',
- '.fpp',
- '.FPP',
- '.m',
- '.mm',
- '.S',
- '.spp',
- '.SPP',
- '.sx'],
- 'CXX': '$CC',
- 'CXXCOM': '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM","$CXXCOMSTR")}',
- 'CXXFILESUFFIX': '.cc',
- 'CXXFLAGS': ['$(', '/TP', '$)'],
- 'DSUFFIXES': ['.d'],
- 'Dir': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'Dirs': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'ENV': { 'PATH': 'C:\\WINDOWS\\System32',
- 'PATHEXT': '.COM;.EXE;.BAT;.CMD',
- 'SystemRoot': 'C:\\WINDOWS'},
- 'ESCAPE': &lt;function escape at 0x700000&amp;gt;,
- 'File': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'HOST_ARCH': '',
- 'HOST_OS': 'win32',
- 'IDLSUFFIXES': ['.idl', '.IDL'],
- 'INCPREFIX': '/I',
- 'INCSUFFIX': '',
- 'INSTALL': &lt;function copyFunc at 0x700000&amp;gt;,
- 'INSTALLVERSIONEDLIB': &lt;function copyFuncVersionedLib at 0x700000&amp;gt;,
- 'LIBPREFIX': '',
- 'LIBPREFIXES': ['$LIBPREFIX'],
- 'LIBSUFFIX': '.lib',
- 'LIBSUFFIXES': ['$LIBSUFFIX'],
- 'MAXLINELENGTH': 2048,
- 'MSVC_SETUP_RUN': True,
- 'OBJPREFIX': '',
- 'OBJSUFFIX': '.obj',
- 'PCHCOM': '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS',
- 'PCHPDBFLAGS': ['${(PDB and "/Yd") or ""}'],
- 'PLATFORM': 'win32',
- 'PROGPREFIX': '',
- 'PROGSUFFIX': '.exe',
- 'PSPAWN': &lt;function piped_spawn at 0x700000&amp;gt;,
- 'RC': 'rc',
- 'RCCOM': &lt;SCons.Action.FunctionAction object at 0x700000&amp;gt;,
- 'RCFLAGS': [],
- 'RCSUFFIXES': ['.rc', '.rc2'],
- 'RDirs': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'SCANNERS': [],
- 'SHCC': '$CC',
- 'SHCCCOM': &lt;SCons.Action.FunctionAction object at 0x700000&amp;gt;,
- 'SHCCFLAGS': ['$CCFLAGS'],
- 'SHCFLAGS': ['$CFLAGS'],
- 'SHCXX': '$CXX',
- 'SHCXXCOM': '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}',
- 'SHCXXFLAGS': ['$CXXFLAGS'],
- 'SHELL': None,
- 'SHLIBPREFIX': '',
- 'SHLIBSUFFIX': '.dll',
- 'SHOBJPREFIX': '$OBJPREFIX',
- 'SHOBJSUFFIX': '$OBJSUFFIX',
- 'SPAWN': &lt;function spawn at 0x700000&amp;gt;,
- 'STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME': 1,
- 'TARGET_ARCH': None,
- 'TARGET_OS': None,
- 'TEMPFILE': &lt;class 'SCons.Platform.TempFileMunge'&gt;,
- 'TEMPFILEPREFIX': '@',
- 'TOOLS': ['msvc', 'install', 'install'],
- '_CCCOMCOM': '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS',
- '_CPPDEFFLAGS': '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}',
- '_CPPINCFLAGS': '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
- '_LIBDIRFLAGS': '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
- '_LIBFLAGS': '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}',
- '_MSVC_OUTPUT_FLAG': &lt;function msvc_output_flag at 0x700000&amp;gt;,
- '_concat': &lt;function _concat at 0x700000&amp;gt;,
- '_defines': &lt;function _defines at 0x700000&amp;gt;,
- '_stripixes': &lt;function _stripixes at 0x700000&amp;gt;}
-scons: done reading SConscript files.
-scons: Building targets ...
-scons: `.' is up to date.
-scons: done building targets.
+ File "/home/my/project/SConstruct", line 2
+
+ print env.Dump()
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/troubleshoot_Dump_ENV_1.xml b/doc/generated/examples/troubleshoot_Dump_ENV_1.xml
index 786491f..bd674a6 100644
--- a/doc/generated/examples/troubleshoot_Dump_ENV_1.xml
+++ b/doc/generated/examples/troubleshoot_Dump_ENV_1.xml
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons</userinput>
scons: Reading SConscript files ...
-{ 'PATH': '/usr/local/bin:/opt/bin:/bin:/usr/bin'}
-scons: done reading SConscript files.
-scons: Building targets ...
-scons: `.' is up to date.
-scons: done building targets.
+ File "/home/my/project/SConstruct", line 2
+
+ print env.Dump('ENV')
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/troubleshoot_Dump_ENV_2.xml b/doc/generated/examples/troubleshoot_Dump_ENV_2.xml
index eb6b735..c9f9258 100644
--- a/doc/generated/examples/troubleshoot_Dump_ENV_2.xml
+++ b/doc/generated/examples/troubleshoot_Dump_ENV_2.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">C:\&gt;<userinput>scons</userinput>
scons: Reading SConscript files ...
-{ 'PATH': 'C:\\WINDOWS\\System32',
- 'PATHEXT': '.COM;.EXE;.BAT;.CMD',
- 'SystemRoot': 'C:\\WINDOWS'}
-scons: done reading SConscript files.
-scons: Building targets ...
-scons: `.' is up to date.
-scons: done building targets.
+ File "/home/my/project/SConstruct", line 2
+
+ print env.Dump('ENV')
+
+ ^
+
+SyntaxError: invalid syntax
</screen>
diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml
index cc7ee2a..0ee52a9 100644
--- a/doc/generated/examples/troubleshoot_explain1_3.xml
+++ b/doc/generated/examples/troubleshoot_explain1_3.xml
@@ -3,5 +3,5 @@
cp file.in file.oout
scons: warning: Cannot find target file.out after building
-File "/home/bdbaddog/devel/scons/bootstrap/src/script/scons.py", line 199, in &lt;module&gt;
+File "/home/bdbaddog/devel/scons/as_scons/src/script/scons.py", line 201, in &lt;module&gt;
</screen>
diff --git a/doc/generated/examples/troubleshoot_stacktrace_2.xml b/doc/generated/examples/troubleshoot_stacktrace_2.xml
index 1ab65ee..4b55f0d 100644
--- a/doc/generated/examples/troubleshoot_stacktrace_2.xml
+++ b/doc/generated/examples/troubleshoot_stacktrace_2.xml
@@ -4,10 +4,10 @@ scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'.
scons: internal stack trace:
File "bootstrap/src/engine/SCons/Job.py", line 199, in start
task.prepare()
- File "bootstrap/src/engine/SCons/Script/Main.py", line 173, in prepare
+ File "bootstrap/src/engine/SCons/Script/Main.py", line 175, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
- File "bootstrap/src/engine/SCons/Taskmaster.py", line 191, in prepare
+ File "bootstrap/src/engine/SCons/Taskmaster.py", line 198, in prepare
executor.prepare()
- File "bootstrap/src/engine/SCons/Executor.py", line 396, in prepare
+ File "bootstrap/src/engine/SCons/Executor.py", line 430, in prepare
raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0]))
</screen>
diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen
index e80c1c9..79a83c6 100644
--- a/doc/generated/functions.gen
+++ b/doc/generated/functions.gen
@@ -96,7 +96,7 @@ Examples:
# which the method will be called; the Python
# convention is to call it 'self'.
def my_method(self, arg):
- print "my_method() got", arg
+ print("my_method() got", arg)
# Use the global AddMethod() function to add a method
# to the Environment class. This
@@ -532,37 +532,6 @@ env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy'])
</example_commands>
</listitem>
</varlistentry>
- <varlistentry id="f-BitKeeper">
- <term>
- <literal>env.BitKeeper()</literal>
- </term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A factory function that
-returns a Builder object
-to be used to fetch source files
-using BitKeeper.
-The returned Builder
-is intended to be passed to the
-<function xmlns="http://www.scons.org/dbxsd/v1.0">SourceCode</function>
-function.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-This function is deprecated. For details, see the entry for the
-<function xmlns="http://www.scons.org/dbxsd/v1.0">SourceCode</function>
-function.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Example:
-</para>
-
-<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
-env.SourceCode('.', env.BitKeeper())
-</example_commands>
-</listitem>
- </varlistentry>
<varlistentry id="f-BuildDir">
<term>
<literal>BuildDir(build_dir, src_dir, [duplicate])</literal>
@@ -999,63 +968,6 @@ A now-deprecated synonym for
</para>
</listitem>
</varlistentry>
- <varlistentry id="f-CVS">
- <term>
- <literal>env.CVS(repository, module)</literal>
- </term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from the specified
-CVS
-<varname>repository</varname>.
-The returned Builder
-is intended to be passed to the
-<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="f-SourceCode"><function>SourceCode</function></link>
-function.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-This function is deprecated. For details, see the entry for the
-<function xmlns="http://www.scons.org/dbxsd/v1.0">SourceCode</function>
-function.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The optional specified
-<varname>module</varname>
-will be added to the beginning
-of all repository path names;
-this can be used, in essence,
-to strip initial directory names
-from the repository path names,
-so that you only have to
-replicate part of the repository
-directory hierarchy in your
-local build directory.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Examples:
-</para>
-
-<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
-# Will fetch foo/bar/src.c
-# from /usr/local/CVSROOT/foo/bar/src.c.
-env.SourceCode('.', env.CVS('/usr/local/CVSROOT'))
-
-# Will fetch bar/src.c
-# from /usr/local/CVSROOT/foo/bar/src.c.
-env.SourceCode('.', env.CVS('/usr/local/CVSROOT', 'foo'))
-
-# Will fetch src.c
-# from /usr/local/CVSROOT/foo/bar/src.c.
-env.SourceCode('.', env.CVS('/usr/local/CVSROOT', 'foo/bar'))
-</example_commands>
-</listitem>
- </varlistentry>
<varlistentry id="f-Decider">
<term>
<literal>Decider(function)</literal>
@@ -1114,7 +1026,7 @@ timestamp, such as can happen when restoring files from backup archives.
<listitem>
<para>
Specifies that a target shall be considered out of date and rebuilt
-if the dependency's content has changed sine the last time
+if the dependency's content has changed since the last time
the target was built,
as determined be performing an MD5 checksum
on the dependency's contents
@@ -1131,7 +1043,7 @@ can be used as a synonym for
<listitem>
<para>
Specifies that a target shall be considered out of date and rebuilt
-if the dependency's content has changed sine the last time
+if the dependency's content has changed since the last time
the target was built,
except that dependencies with a timestamp that matches
the last time the target was rebuilt will be
@@ -2102,7 +2014,7 @@ import atexit
def print_build_failures():
from SCons.Script import GetBuildFailures
for bf in GetBuildFailures():
- print "%s failed: %s" % (bf.node, bf.errstr)
+ print("%s failed: %s" % (bf.node, bf.errstr))
atexit.register(print_build_failures)
</example_commands>
@@ -3062,56 +2974,6 @@ dict = env.ParseFlags('-O2', '!echo -Dfoo -Dbar=1')
</example_commands>
</listitem>
</varlistentry>
- <varlistentry id="f-Perforce">
- <term>
- <literal>env.Perforce()</literal>
- </term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from the Perforce source code management system.
-The returned Builder
-is intended to be passed to the
-<function xmlns="http://www.scons.org/dbxsd/v1.0">SourceCode</function>
-function.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-This function is deprecated. For details, see the entry for the
-<function xmlns="http://www.scons.org/dbxsd/v1.0">SourceCode</function>
-function.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Example:
-</para>
-
-<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
-env.SourceCode('.', env.Perforce())
-</example_commands>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Perforce uses a number of external
-environment variables for its operation.
-Consequently, this function adds the
-following variables from the user's external environment
-to the construction environment's
-ENV dictionary:
-P4CHARSET,
-P4CLIENT,
-P4LANGUAGE,
-P4PASSWD,
-P4PORT,
-P4USER,
-SystemRoot,
-USER,
-and
-USERNAME.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="f-Platform">
<term>
<literal>Platform(string)</literal>
@@ -3346,7 +3208,7 @@ every 10 Nodes:
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
def my_progress_function(node, *args, **kw):
- print 'Evaluating node %s!' % node
+ print('Evaluating node %s!' % node)
Progress(my_progress_function, interval=10)
</example_commands>
@@ -3458,50 +3320,28 @@ Multiple targets can be passed in to a single call to
</para>
</listitem>
</varlistentry>
- <varlistentry id="f-RCS">
+ <varlistentry id="f-PyPackageDir">
<term>
- <literal>env.RCS()</literal>
+ <literal>PyPackageDir(modulename)</literal>
+ </term>
+ <term>
+ <literal>env.PyPackageDir(modulename)</literal>
</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from RCS.
-The returned Builder
-is intended to be passed to the
-<function xmlns="http://www.scons.org/dbxsd/v1.0">SourceCode</function>
-function:
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-This function is deprecated. For details, see the entry for the
-<function xmlns="http://www.scons.org/dbxsd/v1.0">SourceCode</function>
-function.
+This returns a Directory Node similar to Dir.
+The python module / package is looked up and if located
+the directory is returned for the location.
+<varname>modulename</varname>
+Is a named python package / module to
+lookup the directory for it's location.
</para>
-
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Examples:
-</para>
-
-<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
-env.SourceCode('.', env.RCS())
-</example_commands>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Note that
-<filename xmlns="http://www.scons.org/dbxsd/v1.0">scons</filename>
-will fetch source files
-from RCS subdirectories automatically,
-so configuring RCS
-as demonstrated in the above example
-should only be necessary if
-you are fetching from
-RCS,v
-files in the same
-directory as the source files,
-or if you need to explicitly specify RCS
-for a specific subdirectory.
+If
+<varname>modulename</varname>
+is a list, SCons returns a list of Dir nodes.
+Construction variables are expanded in
+<varname>modulename</varname>.
</para>
</listitem>
</varlistentry>
@@ -3681,47 +3521,6 @@ below, for a complete explanation of the arguments and behavior.
</para>
</listitem>
</varlistentry>
- <varlistentry id="f-SCCS">
- <term>
- <literal>env.SCCS()</literal>
- </term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from SCCS.
-The returned Builder
-is intended to be passed to the
-<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="f-SourceCode"><function>SourceCode</function></link>
-function.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Example:
-</para>
-
-<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
-env.SourceCode('.', env.SCCS())
-</example_commands>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Note that
-<filename xmlns="http://www.scons.org/dbxsd/v1.0">scons</filename>
-will fetch source files
-from SCCS subdirectories automatically,
-so configuring SCCS
-as demonstrated in the above example
-should only be necessary if
-you are fetching from
-<filename>s.SCCS</filename>
-files in the same
-directory as the source files,
-or if you need to explicitly specify SCCS
-for a specific subdirectory.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="f-SConscript">
<term>
<literal>SConscript(scripts, [exports, variant_dir, duplicate])</literal>
@@ -4199,6 +3998,14 @@ which corresponds to --random; and
</listitem>
</varlistentry>
<varlistentry>
+<term><literal>silent</literal></term>
+<listitem>
+<para>
+which corresponds to --silent.
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
<term><literal>stack_size</literal></term>
<listitem>
<para>
diff --git a/doc/generated/functions.mod b/doc/generated/functions.mod
index 99aaa48..e460aaf 100644
--- a/doc/generated/functions.mod
+++ b/doc/generated/functions.mod
@@ -19,7 +19,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-Append "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Append</function>">
<!ENTITY f-AppendENVPath "<function xmlns='http://www.scons.org/dbxsd/v1.0'>AppendENVPath</function>">
<!ENTITY f-AppendUnique "<function xmlns='http://www.scons.org/dbxsd/v1.0'>AppendUnique</function>">
-<!ENTITY f-BitKeeper "<function xmlns='http://www.scons.org/dbxsd/v1.0'>BitKeeper</function>">
<!ENTITY f-BuildDir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>BuildDir</function>">
<!ENTITY f-Builder "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Builder</function>">
<!ENTITY f-CacheDir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>CacheDir</function>">
@@ -28,7 +27,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-Command "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Command</function>">
<!ENTITY f-Configure "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Configure</function>">
<!ENTITY f-Copy "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Copy</function>">
-<!ENTITY f-CVS "<function xmlns='http://www.scons.org/dbxsd/v1.0'>CVS</function>">
<!ENTITY f-Decider "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Decider</function>">
<!ENTITY f-Default "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Default</function>">
<!ENTITY f-DefaultEnvironment "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DefaultEnvironment</function>">
@@ -64,7 +62,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-ParseConfig "<function xmlns='http://www.scons.org/dbxsd/v1.0'>ParseConfig</function>">
<!ENTITY f-ParseDepends "<function xmlns='http://www.scons.org/dbxsd/v1.0'>ParseDepends</function>">
<!ENTITY f-ParseFlags "<function xmlns='http://www.scons.org/dbxsd/v1.0'>ParseFlags</function>">
-<!ENTITY f-Perforce "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Perforce</function>">
<!ENTITY f-Platform "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Platform</function>">
<!ENTITY f-Precious "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Precious</function>">
<!ENTITY f-Prepend "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Prepend</function>">
@@ -72,13 +69,12 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-PrependUnique "<function xmlns='http://www.scons.org/dbxsd/v1.0'>PrependUnique</function>">
<!ENTITY f-Progress "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Progress</function>">
<!ENTITY f-Pseudo "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Pseudo</function>">
-<!ENTITY f-RCS "<function xmlns='http://www.scons.org/dbxsd/v1.0'>RCS</function>">
+<!ENTITY f-PyPackageDir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>PyPackageDir</function>">
<!ENTITY f-Replace "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Replace</function>">
<!ENTITY f-Repository "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Repository</function>">
<!ENTITY f-Requires "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Requires</function>">
<!ENTITY f-Return "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Return</function>">
<!ENTITY f-Scanner "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Scanner</function>">
-<!ENTITY f-SCCS "<function xmlns='http://www.scons.org/dbxsd/v1.0'>SCCS</function>">
<!ENTITY f-SConscript "<function xmlns='http://www.scons.org/dbxsd/v1.0'>SConscript</function>">
<!ENTITY f-SConscriptChdir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>SConscriptChdir</function>">
<!ENTITY f-SConsignFile "<function xmlns='http://www.scons.org/dbxsd/v1.0'>SConsignFile</function>">
@@ -107,7 +103,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-env-Append "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Append</function>">
<!ENTITY f-env-AppendENVPath "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.AppendENVPath</function>">
<!ENTITY f-env-AppendUnique "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.AppendUnique</function>">
-<!ENTITY f-env-BitKeeper "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.BitKeeper</function>">
<!ENTITY f-env-BuildDir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.BuildDir</function>">
<!ENTITY f-env-Builder "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Builder</function>">
<!ENTITY f-env-CacheDir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.CacheDir</function>">
@@ -116,7 +111,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-env-Command "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Command</function>">
<!ENTITY f-env-Configure "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Configure</function>">
<!ENTITY f-env-Copy "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Copy</function>">
-<!ENTITY f-env-CVS "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.CVS</function>">
<!ENTITY f-env-Decider "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Decider</function>">
<!ENTITY f-env-Default "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Default</function>">
<!ENTITY f-env-DefaultEnvironment "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DefaultEnvironment</function>">
@@ -152,7 +146,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-env-ParseConfig "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.ParseConfig</function>">
<!ENTITY f-env-ParseDepends "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.ParseDepends</function>">
<!ENTITY f-env-ParseFlags "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.ParseFlags</function>">
-<!ENTITY f-env-Perforce "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Perforce</function>">
<!ENTITY f-env-Platform "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Platform</function>">
<!ENTITY f-env-Precious "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Precious</function>">
<!ENTITY f-env-Prepend "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Prepend</function>">
@@ -160,13 +153,12 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-env-PrependUnique "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.PrependUnique</function>">
<!ENTITY f-env-Progress "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Progress</function>">
<!ENTITY f-env-Pseudo "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Pseudo</function>">
-<!ENTITY f-env-RCS "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.RCS</function>">
+<!ENTITY f-env-PyPackageDir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.PyPackageDir</function>">
<!ENTITY f-env-Replace "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Replace</function>">
<!ENTITY f-env-Repository "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Repository</function>">
<!ENTITY f-env-Requires "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Requires</function>">
<!ENTITY f-env-Return "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Return</function>">
<!ENTITY f-env-Scanner "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Scanner</function>">
-<!ENTITY f-env-SCCS "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.SCCS</function>">
<!ENTITY f-env-SConscript "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.SConscript</function>">
<!ENTITY f-env-SConscriptChdir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.SConscriptChdir</function>">
<!ENTITY f-env-SConsignFile "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.SConsignFile</function>">
@@ -205,7 +197,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-Append "<link linkend='f-Append' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Append</function></link>">
<!ENTITY f-link-AppendENVPath "<link linkend='f-AppendENVPath' xmlns='http://www.scons.org/dbxsd/v1.0'><function>AppendENVPath</function></link>">
<!ENTITY f-link-AppendUnique "<link linkend='f-AppendUnique' xmlns='http://www.scons.org/dbxsd/v1.0'><function>AppendUnique</function></link>">
-<!ENTITY f-link-BitKeeper "<link linkend='f-BitKeeper' xmlns='http://www.scons.org/dbxsd/v1.0'><function>BitKeeper</function></link>">
<!ENTITY f-link-BuildDir "<link linkend='f-BuildDir' xmlns='http://www.scons.org/dbxsd/v1.0'><function>BuildDir</function></link>">
<!ENTITY f-link-Builder "<link linkend='f-Builder' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Builder</function></link>">
<!ENTITY f-link-CacheDir "<link linkend='f-CacheDir' xmlns='http://www.scons.org/dbxsd/v1.0'><function>CacheDir</function></link>">
@@ -214,7 +205,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-Command "<link linkend='f-Command' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Command</function></link>">
<!ENTITY f-link-Configure "<link linkend='f-Configure' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Configure</function></link>">
<!ENTITY f-link-Copy "<link linkend='f-Copy' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Copy</function></link>">
-<!ENTITY f-link-CVS "<link linkend='f-CVS' xmlns='http://www.scons.org/dbxsd/v1.0'><function>CVS</function></link>">
<!ENTITY f-link-Decider "<link linkend='f-Decider' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Decider</function></link>">
<!ENTITY f-link-Default "<link linkend='f-Default' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Default</function></link>">
<!ENTITY f-link-DefaultEnvironment "<link linkend='f-DefaultEnvironment' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DefaultEnvironment</function></link>">
@@ -250,7 +240,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-ParseConfig "<link linkend='f-ParseConfig' xmlns='http://www.scons.org/dbxsd/v1.0'><function>ParseConfig</function></link>">
<!ENTITY f-link-ParseDepends "<link linkend='f-ParseDepends' xmlns='http://www.scons.org/dbxsd/v1.0'><function>ParseDepends</function></link>">
<!ENTITY f-link-ParseFlags "<link linkend='f-ParseFlags' xmlns='http://www.scons.org/dbxsd/v1.0'><function>ParseFlags</function></link>">
-<!ENTITY f-link-Perforce "<link linkend='f-Perforce' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Perforce</function></link>">
<!ENTITY f-link-Platform "<link linkend='f-Platform' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Platform</function></link>">
<!ENTITY f-link-Precious "<link linkend='f-Precious' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Precious</function></link>">
<!ENTITY f-link-Prepend "<link linkend='f-Prepend' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Prepend</function></link>">
@@ -258,13 +247,12 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-PrependUnique "<link linkend='f-PrependUnique' xmlns='http://www.scons.org/dbxsd/v1.0'><function>PrependUnique</function></link>">
<!ENTITY f-link-Progress "<link linkend='f-Progress' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Progress</function></link>">
<!ENTITY f-link-Pseudo "<link linkend='f-Pseudo' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Pseudo</function></link>">
-<!ENTITY f-link-RCS "<link linkend='f-RCS' xmlns='http://www.scons.org/dbxsd/v1.0'><function>RCS</function></link>">
+<!ENTITY f-link-PyPackageDir "<link linkend='f-PyPackageDir' xmlns='http://www.scons.org/dbxsd/v1.0'><function>PyPackageDir</function></link>">
<!ENTITY f-link-Replace "<link linkend='f-Replace' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Replace</function></link>">
<!ENTITY f-link-Repository "<link linkend='f-Repository' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Repository</function></link>">
<!ENTITY f-link-Requires "<link linkend='f-Requires' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Requires</function></link>">
<!ENTITY f-link-Return "<link linkend='f-Return' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Return</function></link>">
<!ENTITY f-link-Scanner "<link linkend='f-Scanner' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Scanner</function></link>">
-<!ENTITY f-link-SCCS "<link linkend='f-SCCS' xmlns='http://www.scons.org/dbxsd/v1.0'><function>SCCS</function></link>">
<!ENTITY f-link-SConscript "<link linkend='f-SConscript' xmlns='http://www.scons.org/dbxsd/v1.0'><function>SConscript</function></link>">
<!ENTITY f-link-SConscriptChdir "<link linkend='f-SConscriptChdir' xmlns='http://www.scons.org/dbxsd/v1.0'><function>SConscriptChdir</function></link>">
<!ENTITY f-link-SConsignFile "<link linkend='f-SConsignFile' xmlns='http://www.scons.org/dbxsd/v1.0'><function>SConsignFile</function></link>">
@@ -293,7 +281,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-env-Append "<link linkend='f-Append' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Append</function></link>">
<!ENTITY f-link-env-AppendENVPath "<link linkend='f-AppendENVPath' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.AppendENVPath</function></link>">
<!ENTITY f-link-env-AppendUnique "<link linkend='f-AppendUnique' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.AppendUnique</function></link>">
-<!ENTITY f-link-env-BitKeeper "<link linkend='f-BitKeeper' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.BitKeeper</function></link>">
<!ENTITY f-link-env-BuildDir "<link linkend='f-BuildDir' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.BuildDir</function></link>">
<!ENTITY f-link-env-Builder "<link linkend='f-Builder' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Builder</function></link>">
<!ENTITY f-link-env-CacheDir "<link linkend='f-CacheDir' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.CacheDir</function></link>">
@@ -302,7 +289,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-env-Command "<link linkend='f-Command' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Command</function></link>">
<!ENTITY f-link-env-Configure "<link linkend='f-Configure' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Configure</function></link>">
<!ENTITY f-link-env-Copy "<link linkend='f-Copy' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Copy</function></link>">
-<!ENTITY f-link-env-CVS "<link linkend='f-CVS' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.CVS</function></link>">
<!ENTITY f-link-env-Decider "<link linkend='f-Decider' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Decider</function></link>">
<!ENTITY f-link-env-Default "<link linkend='f-Default' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Default</function></link>">
<!ENTITY f-link-env-DefaultEnvironment "<link linkend='f-DefaultEnvironment' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DefaultEnvironment</function></link>">
@@ -338,7 +324,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-env-ParseConfig "<link linkend='f-ParseConfig' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.ParseConfig</function></link>">
<!ENTITY f-link-env-ParseDepends "<link linkend='f-ParseDepends' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.ParseDepends</function></link>">
<!ENTITY f-link-env-ParseFlags "<link linkend='f-ParseFlags' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.ParseFlags</function></link>">
-<!ENTITY f-link-env-Perforce "<link linkend='f-Perforce' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Perforce</function></link>">
<!ENTITY f-link-env-Platform "<link linkend='f-Platform' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Platform</function></link>">
<!ENTITY f-link-env-Precious "<link linkend='f-Precious' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Precious</function></link>">
<!ENTITY f-link-env-Prepend "<link linkend='f-Prepend' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Prepend</function></link>">
@@ -346,13 +331,12 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-env-PrependUnique "<link linkend='f-PrependUnique' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.PrependUnique</function></link>">
<!ENTITY f-link-env-Progress "<link linkend='f-Progress' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Progress</function></link>">
<!ENTITY f-link-env-Pseudo "<link linkend='f-Pseudo' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Pseudo</function></link>">
-<!ENTITY f-link-env-RCS "<link linkend='f-RCS' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.RCS</function></link>">
+<!ENTITY f-link-env-PyPackageDir "<link linkend='f-PyPackageDir' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.PyPackageDir</function></link>">
<!ENTITY f-link-env-Replace "<link linkend='f-Replace' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Replace</function></link>">
<!ENTITY f-link-env-Repository "<link linkend='f-Repository' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Repository</function></link>">
<!ENTITY f-link-env-Requires "<link linkend='f-Requires' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Requires</function></link>">
<!ENTITY f-link-env-Return "<link linkend='f-Return' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Return</function></link>">
<!ENTITY f-link-env-Scanner "<link linkend='f-Scanner' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Scanner</function></link>">
-<!ENTITY f-link-env-SCCS "<link linkend='f-SCCS' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.SCCS</function></link>">
<!ENTITY f-link-env-SConscript "<link linkend='f-SConscript' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.SConscript</function></link>">
<!ENTITY f-link-env-SConscriptChdir "<link linkend='f-SConscriptChdir' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.SConscriptChdir</function></link>">
<!ENTITY f-link-env-SConsignFile "<link linkend='f-SConsignFile' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.SConsignFile</function></link>">
diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen
index fcb7587..f858aa4 100644
--- a/doc/generated/tools.gen
+++ b/doc/generated/tools.gen
@@ -87,15 +87,6 @@ Sets construction variables for the bcc32 compiler.
</para>
<para>Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.</para><para>Uses: &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;.</para></listitem>
</varlistentry>
- <varlistentry id="t-BitKeeper">
- <term>BitKeeper</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for the BitKeeper
-source code control system.
-</para>
-<para>Sets: &cv-link-BITKEEPER;, &cv-link-BITKEEPERCOM;, &cv-link-BITKEEPERGET;, &cv-link-BITKEEPERGETFLAGS;.</para><para>Uses: &cv-link-BITKEEPERCOMSTR;.</para></listitem>
- </varlistentry>
<varlistentry id="t-cc">
<term>cc</term>
<listitem>
@@ -104,22 +95,29 @@ Sets construction variables for generic POSIX C copmilers.
</para>
<para>Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.</para><para>Uses: &cv-link-PLATFORM;.</para></listitem>
</varlistentry>
- <varlistentry id="t-cvf">
- <term>cvf</term>
+ <varlistentry id="t-clang">
+ <term>clang</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for the Compaq Visual Fortran compiler.
+Set construction variables for the Clang C compiler.
</para>
-<para>Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANMODDIR;, &cv-link-FORTRANMODDIRPREFIX;, &cv-link-FORTRANMODDIRSUFFIX;, &cv-link-FORTRANPPCOM;, &cv-link-OBJSUFFIX;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.</para><para>Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;, &cv-link-_FORTRANMODFLAG;.</para></listitem>
+<para>Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;.</para></listitem>
</varlistentry>
- <varlistentry id="t-CVS">
- <term>CVS</term>
+ <varlistentry id="t-clangxx">
+ <term>clangxx</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for the CVS source code
-management system.
+Set construction variables for the Clang C++ compiler.
</para>
-<para>Sets: &cv-link-CVS;, &cv-link-CVSCOFLAGS;, &cv-link-CVSCOM;, &cv-link-CVSFLAGS;.</para><para>Uses: &cv-link-CVSCOMSTR;.</para></listitem>
+<para>Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME;.</para></listitem>
+ </varlistentry>
+ <varlistentry id="t-cvf">
+ <term>cvf</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+Sets construction variables for the Compaq Visual Fortran compiler.
+</para>
+<para>Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANMODDIR;, &cv-link-FORTRANMODDIRPREFIX;, &cv-link-FORTRANMODDIRSUFFIX;, &cv-link-FORTRANPPCOM;, &cv-link-OBJSUFFIX;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.</para><para>Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;, &cv-link-_FORTRANMODFLAG;.</para></listitem>
</varlistentry>
<varlistentry id="t-cXX">
<term>cXX</term>
@@ -152,7 +150,7 @@ for the platform on which SCons is running.
<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets construction variables for D language compiler DMD.
</para>
-<para>Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGS;, &cv-link-DPATH;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;, &cv-link-_DDEBUGFLAGS;, &cv-link-_DFLAGS;, &cv-link-_DINCFLAGS;, &cv-link-_DLIBDIRFLAGS;, &cv-link-_DLIBFLAGS;, &cv-link-_DLIBFLAGS;, &cv-link-_DVERFLAGS;, &cv-link-_RPATH;.</para></listitem>
+<para>Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;.</para></listitem>
</varlistentry>
<varlistentry id="t-docbook">
<term>docbook</term>
@@ -396,7 +394,7 @@ Set construction variables for the <application xmlns="http://www.scons.org/dbxs
<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets construction variables for the D language compiler GDC.
</para>
-<para>Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;, &cv-link-_DDEBUGFLAGS;, &cv-link-_DFLAGS;, &cv-link-_DINCFLAGS;, &cv-link-_DLIBFLAGS;, &cv-link-_DVERFLAGS;, &cv-link-_RPATH;.</para></listitem>
+<para>Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;.</para></listitem>
</varlistentry>
<varlistentry id="t-gettext">
<term>gettext</term>
@@ -615,7 +613,7 @@ Sets construction variables for the <application xmlns="http://www.scons.org/dbx
<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets construction variables for the D language compiler LDC2.
</para>
-<para>Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;, &cv-link-_DDEBUGFLAGS;, &cv-link-_DFLAGS;, &cv-link-_DINCFLAGS;, &cv-link-_DLIBDIRFLAGS;, &cv-link-_DLIBFLAGS;, &cv-link-_DLIBFLAGS;, &cv-link-_DVERFLAGS;, &cv-link-_RPATH;.</para></listitem>
+<para>Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;.</para></listitem>
</varlistentry>
<varlistentry id="t-lex">
<term>lex</term>
@@ -780,19 +778,19 @@ Sets construction variables for the
</para>
<para>Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.</para><para>Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;.</para></listitem>
</varlistentry>
- <varlistentry id="t-packaging">
- <term>packaging</term>
+ <varlistentry id="t-Packaging">
+ <term>Packaging</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A framework for building binary and source packages.
+Sets construction variables for the <function xmlns="http://www.scons.org/dbxsd/v1.0">Package</function> Builder.
</para>
</listitem>
</varlistentry>
- <varlistentry id="t-Packaging">
- <term>Packaging</term>
+ <varlistentry id="t-packaging">
+ <term>packaging</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for the <function xmlns="http://www.scons.org/dbxsd/v1.0">Package</function> Builder.
+A framework for building binary and source packages.
</para>
</listitem>
</varlistentry>
@@ -820,15 +818,6 @@ Sets construction variables for the <application xmlns="http://www.scons.org/dbx
</para>
<para>Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;, &cv-link-PDFTEX;, &cv-link-PDFTEXCOM;, &cv-link-PDFTEXFLAGS;.</para><para>Uses: &cv-link-PDFLATEXCOMSTR;, &cv-link-PDFTEXCOMSTR;.</para></listitem>
</varlistentry>
- <varlistentry id="t-Perforce">
- <term>Perforce</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for interacting with the
-Perforce source code management system.
-</para>
-<para>Sets: &cv-link-P4;, &cv-link-P4COM;, &cv-link-P4FLAGS;.</para><para>Uses: &cv-link-P4COMSTR;.</para></listitem>
- </varlistentry>
<varlistentry id="t-qt">
<term>qt</term>
<listitem>
@@ -837,15 +826,6 @@ Sets construction variables for building Qt applications.
</para>
<para>Sets: &cv-link-QTDIR;, &cv-link-QT_AUTOSCAN;, &cv-link-QT_BINPATH;, &cv-link-QT_CPPPATH;, &cv-link-QT_LIB;, &cv-link-QT_LIBPATH;, &cv-link-QT_MOC;, &cv-link-QT_MOCCXXPREFIX;, &cv-link-QT_MOCCXXSUFFIX;, &cv-link-QT_MOCFROMCXXCOM;, &cv-link-QT_MOCFROMCXXFLAGS;, &cv-link-QT_MOCFROMHCOM;, &cv-link-QT_MOCFROMHFLAGS;, &cv-link-QT_MOCHPREFIX;, &cv-link-QT_MOCHSUFFIX;, &cv-link-QT_UIC;, &cv-link-QT_UICCOM;, &cv-link-QT_UICDECLFLAGS;, &cv-link-QT_UICDECLPREFIX;, &cv-link-QT_UICDECLSUFFIX;, &cv-link-QT_UICIMPLFLAGS;, &cv-link-QT_UICIMPLPREFIX;, &cv-link-QT_UICIMPLSUFFIX;, &cv-link-QT_UISUFFIX;.</para></listitem>
</varlistentry>
- <varlistentry id="t-RCS">
- <term>RCS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for the interaction
-with the Revision Control System.
-</para>
-<para>Sets: &cv-link-RCS;, &cv-link-RCS_CO;, &cv-link-RCS_COCOM;, &cv-link-RCS_COFLAGS;.</para><para>Uses: &cv-link-RCS_COCOMSTR;.</para></listitem>
- </varlistentry>
<varlistentry id="t-rmic">
<term>rmic</term>
<listitem>
@@ -862,15 +842,6 @@ Sets construction variables for building with RPCGEN.
</para>
<para>Sets: &cv-link-RPCGEN;, &cv-link-RPCGENCLIENTFLAGS;, &cv-link-RPCGENFLAGS;, &cv-link-RPCGENHEADERFLAGS;, &cv-link-RPCGENSERVICEFLAGS;, &cv-link-RPCGENXDRFLAGS;.</para></listitem>
</varlistentry>
- <varlistentry id="t-SCCS">
- <term>SCCS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for interacting with the
-Source Code Control System.
-</para>
-<para>Sets: &cv-link-SCCS;, &cv-link-SCCSCOM;, &cv-link-SCCSFLAGS;, &cv-link-SCCSGETFLAGS;.</para><para>Uses: &cv-link-SCCSCOMSTR;.</para></listitem>
- </varlistentry>
<varlistentry id="t-sgiar">
<term>sgiar</term>
<listitem>
diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod
index 1191e6a..1209d74 100644
--- a/doc/generated/tools.mod
+++ b/doc/generated/tools.mod
@@ -17,10 +17,10 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-ar "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>ar</literal>">
<!ENTITY t-as "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>as</literal>">
<!ENTITY t-bcc32 "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>bcc32</literal>">
-<!ENTITY t-BitKeeper "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>BitKeeper</literal>">
<!ENTITY t-cc "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>cc</literal>">
+<!ENTITY t-clang "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>clang</literal>">
+<!ENTITY t-clangxx "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>clangxx</literal>">
<!ENTITY t-cvf "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>cvf</literal>">
-<!ENTITY t-CVS "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>CVS</literal>">
<!ENTITY t-cXX "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>cXX</literal>">
<!ENTITY t-cyglink "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>cyglink</literal>">
<!ENTITY t-default "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>default</literal>">
@@ -78,17 +78,14 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-mwcc "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>mwcc</literal>">
<!ENTITY t-mwld "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>mwld</literal>">
<!ENTITY t-nasm "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>nasm</literal>">
-<!ENTITY t-packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>packaging</literal>">
<!ENTITY t-Packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>Packaging</literal>">
+<!ENTITY t-packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>packaging</literal>">
<!ENTITY t-pdf "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdf</literal>">
<!ENTITY t-pdflatex "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdflatex</literal>">
<!ENTITY t-pdftex "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdftex</literal>">
-<!ENTITY t-Perforce "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>Perforce</literal>">
<!ENTITY t-qt "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>qt</literal>">
-<!ENTITY t-RCS "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>RCS</literal>">
<!ENTITY t-rmic "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>rmic</literal>">
<!ENTITY t-rpcgen "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>rpcgen</literal>">
-<!ENTITY t-SCCS "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>SCCS</literal>">
<!ENTITY t-sgiar "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>sgiar</literal>">
<!ENTITY t-sgicXX "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>sgic++</literal>">
<!ENTITY t-sgicc "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>sgicc</literal>">
@@ -128,10 +125,10 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-link-ar "<link linkend='t-ar' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>ar</literal></link>">
<!ENTITY t-link-as "<link linkend='t-as' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>as</literal></link>">
<!ENTITY t-link-bcc32 "<link linkend='t-bcc32' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>bcc32</literal></link>">
-<!ENTITY t-link-BitKeeper "<link linkend='t-BitKeeper' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>BitKeeper</literal></link>">
<!ENTITY t-link-cc "<link linkend='t-cc' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>cc</literal></link>">
+<!ENTITY t-link-clang "<link linkend='t-clang' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>clang</literal></link>">
+<!ENTITY t-link-clangxx "<link linkend='t-clangxx' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>clangxx</literal></link>">
<!ENTITY t-link-cvf "<link linkend='t-cvf' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>cvf</literal></link>">
-<!ENTITY t-link-CVS "<link linkend='t-CVS' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>CVS</literal></link>">
<!ENTITY t-link-cXX "<link linkend='t-cXX' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>cXX</literal></link>">
<!ENTITY t-link-cyglink "<link linkend='t-cyglink' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>cyglink</literal></link>">
<!ENTITY t-link-default "<link linkend='t-default' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>default</literal></link>">
@@ -189,17 +186,14 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-link-mwcc "<link linkend='t-mwcc' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>mwcc</literal></link>">
<!ENTITY t-link-mwld "<link linkend='t-mwld' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>mwld</literal></link>">
<!ENTITY t-link-nasm "<link linkend='t-nasm' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>nasm</literal></link>">
-<!ENTITY t-link-packaging "<link linkend='t-packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>packaging</literal></link>">
<!ENTITY t-link-Packaging "<link linkend='t-Packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>Packaging</literal></link>">
+<!ENTITY t-link-packaging "<link linkend='t-packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>packaging</literal></link>">
<!ENTITY t-link-pdf "<link linkend='t-pdf' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdf</literal></link>">
<!ENTITY t-link-pdflatex "<link linkend='t-pdflatex' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdflatex</literal></link>">
<!ENTITY t-link-pdftex "<link linkend='t-pdftex' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdftex</literal></link>">
-<!ENTITY t-link-Perforce "<link linkend='t-Perforce' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>Perforce</literal></link>">
<!ENTITY t-link-qt "<link linkend='t-qt' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>qt</literal></link>">
-<!ENTITY t-link-RCS "<link linkend='t-RCS' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>RCS</literal></link>">
<!ENTITY t-link-rmic "<link linkend='t-rmic' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>rmic</literal></link>">
<!ENTITY t-link-rpcgen "<link linkend='t-rpcgen' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>rpcgen</literal></link>">
-<!ENTITY t-link-SCCS "<link linkend='t-SCCS' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>SCCS</literal></link>">
<!ENTITY t-link-sgiar "<link linkend='t-sgiar' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>sgiar</literal></link>">
<!ENTITY t-link-sgicXX "<link linkend='t-sgicXX' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>sgic++</literal></link>">
<!ENTITY t-link-sgicc "<link linkend='t-sgicc' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>sgicc</literal></link>">
diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen
index 064ddef..8a8dc99 100644
--- a/doc/generated/variables.gen
+++ b/doc/generated/variables.gen
@@ -205,53 +205,6 @@ and typesetter and the LaTeX structured formatter and typesetter.
</para>
</listitem>
</varlistentry>
- <varlistentry id="cv-BITKEEPER">
- <term>BITKEEPER</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The BitKeeper executable.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-BITKEEPERCOM">
- <term>BITKEEPERCOM</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The command line for
-fetching source files using BitKeeper.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-BITKEEPERCOMSTR">
- <term>BITKEEPERCOMSTR</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The string displayed when fetching
-a source file using BitKeeper.
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-BITKEEPERCOM"><envar>$BITKEEPERCOM</envar></link>
-(the command line) is displayed.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-BITKEEPERGET">
- <term>BITKEEPERGET</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The command (<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-BITKEEPER"><envar>$BITKEEPER</envar></link>) and subcommand
-for fetching source files using BitKeeper.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-BITKEEPERGETFLAGS">
- <term>BITKEEPERGETFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Options that are passed to the BitKeeper
-<command>get</command>
-subcommand.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="cv-BUILDERS">
<term>BUILDERS</term>
<listitem>
@@ -742,63 +695,6 @@ The default list is:
</example_commands>
</listitem>
</varlistentry>
- <varlistentry id="cv-CVS">
- <term>CVS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The CVS executable.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-CVSCOFLAGS">
- <term>CVSCOFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Options that are passed to the CVS checkout subcommand.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-CVSCOM">
- <term>CVSCOM</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The command line used to
-fetch source files from a CVS repository.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-CVSCOMSTR">
- <term>CVSCOMSTR</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The string displayed when fetching
-a source file from a CVS repository.
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-CVSCOM"><envar>$CVSCOM</envar></link>
-(the command line) is displayed.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-CVSFLAGS">
- <term>CVSFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-General options that are passed to CVS.
-By default, this is set to
-<literal>-d $CVSREPOSITORY</literal>
-to specify from where the files must be fetched.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-CVSREPOSITORY">
- <term>CVSREPOSITORY</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The path to the CVS repository.
-This is referenced in the default
-<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-CVSFLAGS"><envar>$CVSFLAGS</envar></link> value.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="cv-CXX">
<term>CXX</term>
<listitem>
@@ -885,7 +781,15 @@ depending on the specific C++ compiler being used.
<term>DC</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DC.
+The D compiler to use.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The D compiler to use.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The D compiler to use.
</para>
</listitem>
</varlistentry>
@@ -893,7 +797,21 @@ DC.
<term>DCOM</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DCOM.
+ The command line used to compile a D file to an object file.
+ Any options specified in the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-DFLAGS"><envar>$DFLAGS</envar></link> construction variable
+ is included on this command line.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line used to compile a D file to an object file.
+ Any options specified in the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-DFLAGS"><envar>$DFLAGS</envar></link> construction variable
+ is included on this command line.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line used to compile a D file to an object file.
+ Any options specified in the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-DFLAGS"><envar>$DFLAGS</envar></link> construction variable
+ is included on this command line.
</para>
</listitem>
</varlistentry>
@@ -901,33 +819,49 @@ DCOM.
<term>DDEBUG</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DDEBUG.
+ List of debug tags to enable when compiling.
</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-_DDEBUGFLAGS">
- <term>_DDEBUGFLAGS</term>
- <listitem>
+
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-_DDEBUGFLAGS.
+ List of debug tags to enable when compiling.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ List of debug tags to enable when compiling.
</para>
</listitem>
</varlistentry>
<varlistentry id="cv-DDEBUGPREFIX">
<term>DDEBUGPREFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DDEBUGPREFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DDEBUGPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DDEBUGPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DDEBUGPREFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DDEBUGSUFFIX">
<term>DDEBUGSUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DDEBUGSUFFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DDEBUGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DDEBUGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DDEBUGSUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DESCRIPTION">
<term>DESCRIPTION</term>
@@ -955,66 +889,98 @@ section of an RPM
<varlistentry id="cv-DFILESUFFIX">
<term>DFILESUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DFILESUFFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFILESUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFILESUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFILESUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DFLAGPREFIX">
<term>DFLAGPREFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DFLAGPREFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFLAGPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFLAGPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFLAGPREFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DFLAGS">
<term>DFLAGS</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DFLAGS.
+ General options that are passed to the D compiler.
</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-_DFLAGS">
- <term>_DFLAGS</term>
- <listitem>
+
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-_DFLAGS.
+ General options that are passed to the D compiler.
</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-DFLAGSUFFIX">
- <term>DFLAGSUFFIX</term>
- <listitem>
+
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DFLAGSUFFIX.
+ General options that are passed to the D compiler.
</para>
</listitem>
</varlistentry>
- <varlistentry id="cv-_DINCFLAGS">
- <term>_DINCFLAGS</term>
+ <varlistentry id="cv-DFLAGSUFFIX">
+ <term>DFLAGSUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-_DINCFLAGS.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFLAGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFLAGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DFLAGSUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DINCPREFIX">
<term>DINCPREFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DINCPREFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DINCPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DINCPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DINCPREFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DINCSUFFIX">
<term>DINCSUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DINCSUFFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGSUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-Dir">
<term>Dir</term>
@@ -1043,7 +1009,15 @@ into a list of Dir instances relative to the target being built.
<term>DLIB</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLIB.
+ Name of the lib tool to use for D codes.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ Name of the lib tool to use for D codes.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ Name of the lib tool to use for D codes.
</para>
</listitem>
</varlistentry>
@@ -1051,79 +1025,127 @@ DLIB.
<term>DLIBCOM</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLIBCOM.
+ The command line to use when creating libraries.
</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-_DLIBDIRFLAGS">
- <term>_DLIBDIRFLAGS</term>
- <listitem>
+
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-_DLIBDIRFLAGS.
+ The command line to use when creating libraries.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line to use when creating libraries.
</para>
</listitem>
</varlistentry>
<varlistentry id="cv-DLIBDIRPREFIX">
<term>DLIBDIRPREFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLIBDIRPREFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKPREFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DLIBDIRSUFFIX">
<term>DLIBDIRSUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLIBDIRSUFFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKSUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DLIBFLAGPREFIX">
<term>DLIBFLAGPREFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLIBFLAGPREFIX.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-_DLIBFLAGS">
- <term>_DLIBFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-_DLIBFLAGS.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGPREFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DLIBFLAGSUFFIX">
<term>DLIBFLAGSUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLIBFLAGSUFFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBFLAGSUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DLIBLINKPREFIX">
<term>DLIBLINKPREFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLIBLINKPREFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKPREFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DLIBLINKSUFFIX">
<term>DLIBLINKSUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLIBLINKSUFFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLIBLINKSUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DLINK">
<term>DLINK</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLINK.
+ Name of the linker to use for linking systems including D sources.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ Name of the linker to use for linking systems including D sources.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ Name of the linker to use for linking systems including D sources.
</para>
</listitem>
</varlistentry>
@@ -1131,33 +1153,65 @@ DLINK.
<term>DLINKCOM</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLINKCOM.
+ The command line to use when linking systems including D sources.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line to use when linking systems including D sources.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line to use when linking systems including D sources.
</para>
</listitem>
</varlistentry>
<varlistentry id="cv-DLINKFLAGPREFIX">
<term>DLINKFLAGPREFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLINKFLAGPREFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLINKFLAGPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLINKFLAGPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLINKFLAGPREFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DLINKFLAGS">
<term>DLINKFLAGS</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLINKFLAGS.
+List of linker flags.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+List of linker flags.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+List of linker flags.
</para>
</listitem>
</varlistentry>
<varlistentry id="cv-DLINKFLAGSUFFIX">
<term>DLINKFLAGSUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DLINKFLAGSUFFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLINKFLAGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLINKFLAGSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DLINKFLAGSUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DOCBOOK_DEFAULT_XSL_EPUB">
<term>DOCBOOK_DEFAULT_XSL_EPUB</term>
@@ -1360,10 +1414,42 @@ for <literal>saxon</literal> and <literal>saxon-xslt</literal>, respectively.
<term>DPATH</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DPATH.
+ List of paths to search for import modules.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ List of paths to search for import modules.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ List of paths to search for import modules.
</para>
</listitem>
</varlistentry>
+ <varlistentry id="cv-DRPATHPREFIX">
+ <term>DRPATHPREFIX</term>
+ <listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DRPATHPREFIX.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="cv-DRPATHSUFFIX">
+ <term>DRPATHSUFFIX</term>
+ <listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DRPATHSUFFIX.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="cv-DShLibSonameGenerator">
+ <term>DShLibSonameGenerator</term>
+ <listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DShLibSonameGenerator.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry id="cv-DSUFFIXES">
<term>DSUFFIXES</term>
<listitem>
@@ -1378,37 +1464,53 @@ The default list is:
</example_commands>
</listitem>
</varlistentry>
- <varlistentry id="cv-_DVERFLAGS">
- <term>_DVERFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-_DVERFLAGS.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="cv-DVERPREFIX">
<term>DVERPREFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DVERPREFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DVERPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DVERPREFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DVERPREFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DVERSIONS">
<term>DVERSIONS</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DVERSIONS.
+ List of version tags to enable when compiling.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ List of version tags to enable when compiling.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ List of version tags to enable when compiling.
</para>
</listitem>
</varlistentry>
<varlistentry id="cv-DVERSUFFIX">
<term>DVERSUFFIX</term>
<listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DVERSUFFIX.
-</para>
-</listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DVERSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DVERSUFFIX.
+ </para>
+
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ DVERSUFFIX.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-DVIPDF">
<term>DVIPDF</term>
@@ -3104,7 +3206,7 @@ The command line used to call the Java archive tool.
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when the Java archive tool
is called
-If this is not set, then <envar xmlns="http://www.scons.org/dbxsd/v1.0">$JARCOM</envar> (the command line) is displayed.
+If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-JARCOM"><envar>$JARCOM</envar></link> (the command line) is displayed.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
@@ -3114,7 +3216,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET")
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when the Java archive tool
is called
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-JARCOM"><envar>$JARCOM</envar></link> (the command line) is displayed.
+If this is not set, then <envar xmlns="http://www.scons.org/dbxsd/v1.0">$JARCOM</envar> (the command line) is displayed.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
@@ -4237,6 +4339,29 @@ window and importing the shell's environment variables.
</para>
</listitem>
</varlistentry>
+ <varlistentry id="cv-MSVC_UWP_APP">
+ <term>MSVC_UWP_APP</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+Build libraries for a Universal Windows Platform (UWP) Application.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+If <envar xmlns="http://www.scons.org/dbxsd/v1.0">$MSVC_UWP_APP</envar> is set, the Visual Studio environment will be set up to point
+to the Windows Store compatible libraries and Visual Studio runtimes. In doing so,
+any libraries that are built will be able to be used in a UWP App and published
+to the Windows Store.
+This flag will only have an effect with Visual Studio 2015+.
+This variable must be passed as an argument to the Environment()
+constructor; setting it later has no effect.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+Valid values are '1' or '0'
+</para>
+
+</listitem>
+ </varlistentry>
<varlistentry id="cv-MSVC_VERSION">
<term>MSVC_VERSION</term>
<listitem>
@@ -4254,6 +4379,8 @@ constructor; setting it later has no effect.
<para xmlns="http://www.scons.org/dbxsd/v1.0">
Valid values for Windows are
+<literal>14.0</literal>,
+<literal>14.0Exp</literal>,
<literal>12.0</literal>,
<literal>12.0Exp</literal>,
<literal>11.0</literal>,
@@ -4616,41 +4743,6 @@ The suffix used for (static) object file names.
</para>
</listitem>
</varlistentry>
- <varlistentry id="cv-P4">
- <term>P4</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The Perforce executable.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-P4COM">
- <term>P4COM</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The command line used to
-fetch source files from Perforce.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-P4COMSTR">
- <term>P4COMSTR</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The string displayed when
-fetching a source file from Perforce.
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-P4COM"><envar>$P4COM</envar></link> (the command line) is displayed.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-P4FLAGS">
- <term>P4FLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-General options that are passed to Perforce.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="cv-PACKAGEROOT">
<term>PACKAGEROOT</term>
<listitem>
@@ -5539,56 +5631,6 @@ when the <envar xmlns="http://www.scons.org/dbxsd/v1.0">$RCINCFLAGS</envar> vari
</para>
</listitem>
</varlistentry>
- <varlistentry id="cv-RCS">
- <term>RCS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The RCS executable.
-Note that this variable is not actually used
-for the command to fetch source files from RCS;
-see the
-<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-RCS_CO"><envar>$RCS_CO</envar></link>
-construction variable, below.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-RCS_CO">
- <term>RCS_CO</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The RCS "checkout" executable,
-used to fetch source files from RCS.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-RCS_COCOM">
- <term>RCS_COCOM</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The command line used to
-fetch (checkout) source files from RCS.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-RCS_COCOMSTR">
- <term>RCS_COCOMSTR</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The string displayed when fetching
-a source file from RCS.
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-RCS_COCOM"><envar>$RCS_COCOM</envar></link>
-(the command line) is displayed.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-RCS_COFLAGS">
- <term>RCS_COFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Options that are passed to the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-RCS_CO"><envar>$RCS_CO</envar></link> command.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="cv-RDirs">
<term>RDirs</term>
<listitem>
@@ -5819,53 +5861,6 @@ below, for more information.
</para>
</listitem>
</varlistentry>
- <varlistentry id="cv-SCCS">
- <term>SCCS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The SCCS executable.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-SCCSCOM">
- <term>SCCSCOM</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The command line used to
-fetch source files from SCCS.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-SCCSCOMSTR">
- <term>SCCSCOMSTR</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The string displayed when fetching
-a source file from a CVS repository.
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SCCSCOM"><envar>$SCCSCOM</envar></link>
-(the command line) is displayed.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-SCCSFLAGS">
- <term>SCCSFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-General options that are passed to SCCS.
-</para>
-</listitem>
- </varlistentry>
- <varlistentry id="cv-SCCSGETFLAGS">
- <term>SCCSGETFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Options that are passed specifically to the SCCS "get" subcommand.
-This can be set, for example, to
-<option>-e</option>
-to check out editable files from SCCS.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="cv-SCONS_HOME">
<term>SCONS_HOME</term>
<listitem> <para xmlns="http://www.scons.org/dbxsd/v1.0">The
@@ -5974,7 +5969,18 @@ to generate shared-library objects.
<term>SHDC</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-SHDC.
+ The name of the compiler to use when compiling D source
+ destined to be in a shared objects.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The name of the compiler to use when compiling D source
+ destined to be in a shared objects.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The name of the compiler to use when compiling D source
+ destined to be in a shared objects.
</para>
</listitem>
</varlistentry>
@@ -5982,15 +5988,50 @@ SHDC.
<term>SHDCOM</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-SHDCOM.
+ The command line to use when compiling code to be part of shared objects.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line to use when compiling code to be part of shared objects.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line to use when compiling code to be part of shared objects.
</para>
</listitem>
</varlistentry>
+ <varlistentry id="cv-SHDLIBVERSION">
+ <term>SHDLIBVERSION</term>
+ <listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ SHDLIBVERSION.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="cv-SHDLIBVERSIONFLAGS">
+ <term>SHDLIBVERSIONFLAGS</term>
+ <listitem>
+ <para xmlns="http://www.scons.org/dbxsd/v1.0">
+ SHDLIBVERSIONFLAGS.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry id="cv-SHDLINK">
<term>SHDLINK</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-SHDLINK.
+ The linker to use when creating shared objects for code bases
+ include D sources.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The linker to use when creating shared objects for code bases
+ include D sources.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The linker to use when creating shared objects for code bases
+ include D sources.
</para>
</listitem>
</varlistentry>
@@ -5998,7 +6039,15 @@ SHDLINK.
<term>SHDLINKCOM</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-SHDLINKCOM.
+ The command line to use when generating shared objects.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line to use when generating shared objects.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The command line to use when generating shared objects.
</para>
</listitem>
</varlistentry>
@@ -6006,7 +6055,15 @@ SHDLINKCOM.
<term>SHDLINKFLAGS</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-SHDLINKFLAGS.
+ The list of flags to use when generating a shared object.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The list of flags to use when generating a shared object.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The list of flags to use when generating a shared object.
</para>
</listitem>
</varlistentry>
@@ -6553,6 +6610,16 @@ Example <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHLIBVERSION">
</para>
</listitem>
</varlistentry>
+ <varlistentry id="cv-SHLIBVERSIONFLAGS">
+ <term>SHLIBVERSIONFLAGS</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+Extra flags added to <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHLINKCOM"><envar>$SHLINKCOM</envar></link> when building versioned
+<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-SharedLibrary"><function>SharedLibrary</function></link>. These flags are only used when <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHLIBVERSION"><envar>$SHLIBVERSION</envar></link> is
+set.
+</para>
+</listitem>
+ </varlistentry>
<varlistentry id="cv-_SHLIBVERSIONFLAGS">
<term>_SHLIBVERSIONFLAGS</term>
<listitem>
@@ -6566,16 +6633,6 @@ and some extra dynamically generated options (such as
</para>
</listitem>
</varlistentry>
- <varlistentry id="cv-SHLIBVERSIONFLAGS">
- <term>SHLIBVERSIONFLAGS</term>
- <listitem>
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Extra flags added to <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHLINKCOM"><envar>$SHLINKCOM</envar></link> when building versioned
-<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-SharedLibrary"><function>SharedLibrary</function></link>. These flags are only used when <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHLIBVERSION"><envar>$SHLIBVERSION</envar></link> is
-set.
-</para>
-</listitem>
- </varlistentry>
<varlistentry id="cv-SHLINK">
<term>SHLINK</term>
<listitem>
diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod
index b8815f5..6ecf6c9 100644
--- a/doc/generated/variables.mod
+++ b/doc/generated/variables.mod
@@ -26,11 +26,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-BIBTEXCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BIBTEXCOM</envar>">
<!ENTITY cv-BIBTEXCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BIBTEXCOMSTR</envar>">
<!ENTITY cv-BIBTEXFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BIBTEXFLAGS</envar>">
-<!ENTITY cv-BITKEEPER "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BITKEEPER</envar>">
-<!ENTITY cv-BITKEEPERCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BITKEEPERCOM</envar>">
-<!ENTITY cv-BITKEEPERCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BITKEEPERCOMSTR</envar>">
-<!ENTITY cv-BITKEEPERGET "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BITKEEPERGET</envar>">
-<!ENTITY cv-BITKEEPERGETFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BITKEEPERGETFLAGS</envar>">
<!ENTITY cv-BUILDERS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$BUILDERS</envar>">
<!ENTITY cv-CC "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CC</envar>">
<!ENTITY cv-CCCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CCCOM</envar>">
@@ -56,12 +51,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-_CPPINCFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_CPPINCFLAGS</envar>">
<!ENTITY cv-CPPPATH "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CPPPATH</envar>">
<!ENTITY cv-CPPSUFFIXES "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CPPSUFFIXES</envar>">
-<!ENTITY cv-CVS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CVS</envar>">
-<!ENTITY cv-CVSCOFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CVSCOFLAGS</envar>">
-<!ENTITY cv-CVSCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CVSCOM</envar>">
-<!ENTITY cv-CVSCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CVSCOMSTR</envar>">
-<!ENTITY cv-CVSFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CVSFLAGS</envar>">
-<!ENTITY cv-CVSREPOSITORY "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CVSREPOSITORY</envar>">
<!ENTITY cv-CXX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CXX</envar>">
<!ENTITY cv-CXXCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CXXCOM</envar>">
<!ENTITY cv-CXXCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$CXXCOMSTR</envar>">
@@ -71,7 +60,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-DC "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DC</envar>">
<!ENTITY cv-DCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DCOM</envar>">
<!ENTITY cv-DDEBUG "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DDEBUG</envar>">
-<!ENTITY cv-_DDEBUGFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DDEBUGFLAGS</envar>">
<!ENTITY cv-DDEBUGPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DDEBUGPREFIX</envar>">
<!ENTITY cv-DDEBUGSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DDEBUGSUFFIX</envar>">
<!ENTITY cv-DESCRIPTION "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DESCRIPTION</envar>">
@@ -79,20 +67,16 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-DFILESUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DFILESUFFIX</envar>">
<!ENTITY cv-DFLAGPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DFLAGPREFIX</envar>">
<!ENTITY cv-DFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DFLAGS</envar>">
-<!ENTITY cv-_DFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DFLAGS</envar>">
<!ENTITY cv-DFLAGSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DFLAGSUFFIX</envar>">
-<!ENTITY cv-_DINCFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DINCFLAGS</envar>">
<!ENTITY cv-DINCPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DINCPREFIX</envar>">
<!ENTITY cv-DINCSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DINCSUFFIX</envar>">
<!ENTITY cv-Dir "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$Dir</envar>">
<!ENTITY cv-Dirs "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$Dirs</envar>">
<!ENTITY cv-DLIB "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DLIB</envar>">
<!ENTITY cv-DLIBCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DLIBCOM</envar>">
-<!ENTITY cv-_DLIBDIRFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DLIBDIRFLAGS</envar>">
<!ENTITY cv-DLIBDIRPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DLIBDIRPREFIX</envar>">
<!ENTITY cv-DLIBDIRSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DLIBDIRSUFFIX</envar>">
<!ENTITY cv-DLIBFLAGPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DLIBFLAGPREFIX</envar>">
-<!ENTITY cv-_DLIBFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DLIBFLAGS</envar>">
<!ENTITY cv-DLIBFLAGSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DLIBFLAGSUFFIX</envar>">
<!ENTITY cv-DLIBLINKPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DLIBLINKPREFIX</envar>">
<!ENTITY cv-DLIBLINKSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DLIBLINKSUFFIX</envar>">
@@ -123,8 +107,10 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-DOCBOOK_XSLTPROCFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DOCBOOK_XSLTPROCFLAGS</envar>">
<!ENTITY cv-DOCBOOK_XSLTPROCPARAMS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DOCBOOK_XSLTPROCPARAMS</envar>">
<!ENTITY cv-DPATH "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DPATH</envar>">
+<!ENTITY cv-DRPATHPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DRPATHPREFIX</envar>">
+<!ENTITY cv-DRPATHSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DRPATHSUFFIX</envar>">
+<!ENTITY cv-DShLibSonameGenerator "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DShLibSonameGenerator</envar>">
<!ENTITY cv-DSUFFIXES "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DSUFFIXES</envar>">
-<!ENTITY cv-_DVERFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DVERFLAGS</envar>">
<!ENTITY cv-DVERPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DVERPREFIX</envar>">
<!ENTITY cv-DVERSIONS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DVERSIONS</envar>">
<!ENTITY cv-DVERSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DVERSUFFIX</envar>">
@@ -321,6 +307,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-MSSDK_VERSION "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$MSSDK_VERSION</envar>">
<!ENTITY cv-MSVC_BATCH "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$MSVC_BATCH</envar>">
<!ENTITY cv-MSVC_USE_SCRIPT "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$MSVC_USE_SCRIPT</envar>">
+<!ENTITY cv-MSVC_UWP_APP "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$MSVC_UWP_APP</envar>">
<!ENTITY cv-MSVC_VERSION "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$MSVC_VERSION</envar>">
<!ENTITY cv-MSVS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$MSVS</envar>">
<!ENTITY cv-MSVS_ARCH "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$MSVS_ARCH</envar>">
@@ -352,10 +339,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-no_import_lib "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$no_import_lib</envar>">
<!ENTITY cv-OBJPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$OBJPREFIX</envar>">
<!ENTITY cv-OBJSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$OBJSUFFIX</envar>">
-<!ENTITY cv-P4 "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$P4</envar>">
-<!ENTITY cv-P4COM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$P4COM</envar>">
-<!ENTITY cv-P4COMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$P4COMSTR</envar>">
-<!ENTITY cv-P4FLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$P4FLAGS</envar>">
<!ENTITY cv-PACKAGEROOT "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$PACKAGEROOT</envar>">
<!ENTITY cv-PACKAGETYPE "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$PACKAGETYPE</envar>">
<!ENTITY cv-PACKAGEVERSION "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$PACKAGEVERSION</envar>">
@@ -433,11 +416,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-RCINCFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RCINCFLAGS</envar>">
<!ENTITY cv-RCINCPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RCINCPREFIX</envar>">
<!ENTITY cv-RCINCSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RCINCSUFFIX</envar>">
-<!ENTITY cv-RCS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RCS</envar>">
-<!ENTITY cv-RCS_CO "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RCS_CO</envar>">
-<!ENTITY cv-RCS_COCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RCS_COCOM</envar>">
-<!ENTITY cv-RCS_COCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RCS_COCOMSTR</envar>">
-<!ENTITY cv-RCS_COFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RCS_COFLAGS</envar>">
<!ENTITY cv-RDirs "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RDirs</envar>">
<!ENTITY cv-REGSVR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$REGSVR</envar>">
<!ENTITY cv-REGSVRCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$REGSVRCOM</envar>">
@@ -458,11 +436,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-RPCGENSERVICEFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RPCGENSERVICEFLAGS</envar>">
<!ENTITY cv-RPCGENXDRFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$RPCGENXDRFLAGS</envar>">
<!ENTITY cv-SCANNERS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SCANNERS</envar>">
-<!ENTITY cv-SCCS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SCCS</envar>">
-<!ENTITY cv-SCCSCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SCCSCOM</envar>">
-<!ENTITY cv-SCCSCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SCCSCOMSTR</envar>">
-<!ENTITY cv-SCCSFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SCCSFLAGS</envar>">
-<!ENTITY cv-SCCSGETFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SCCSGETFLAGS</envar>">
<!ENTITY cv-SCONS_HOME "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SCONS_HOME</envar>">
<!ENTITY cv-SHCC "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHCC</envar>">
<!ENTITY cv-SHCCCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHCCCOM</envar>">
@@ -475,6 +448,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-SHCXXFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHCXXFLAGS</envar>">
<!ENTITY cv-SHDC "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHDC</envar>">
<!ENTITY cv-SHDCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHDCOM</envar>">
+<!ENTITY cv-SHDLIBVERSION "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHDLIBVERSION</envar>">
+<!ENTITY cv-SHDLIBVERSIONFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHDLIBVERSIONFLAGS</envar>">
<!ENTITY cv-SHDLINK "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHDLINK</envar>">
<!ENTITY cv-SHDLINKCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHDLINKCOM</envar>">
<!ENTITY cv-SHDLINKFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHDLINKFLAGS</envar>">
@@ -521,8 +496,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-_SHLIBSONAME "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_SHLIBSONAME</envar>">
<!ENTITY cv-SHLIBSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHLIBSUFFIX</envar>">
<!ENTITY cv-SHLIBVERSION "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHLIBVERSION</envar>">
-<!ENTITY cv-_SHLIBVERSIONFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_SHLIBVERSIONFLAGS</envar>">
<!ENTITY cv-SHLIBVERSIONFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHLIBVERSIONFLAGS</envar>">
+<!ENTITY cv-_SHLIBVERSIONFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_SHLIBVERSIONFLAGS</envar>">
<!ENTITY cv-SHLINK "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHLINK</envar>">
<!ENTITY cv-SHLINKCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHLINKCOM</envar>">
<!ENTITY cv-SHLINKCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHLINKCOMSTR</envar>">
@@ -680,11 +655,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-BIBTEXCOM "<link linkend='cv-BIBTEXCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BIBTEXCOM</envar></link>">
<!ENTITY cv-link-BIBTEXCOMSTR "<link linkend='cv-BIBTEXCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BIBTEXCOMSTR</envar></link>">
<!ENTITY cv-link-BIBTEXFLAGS "<link linkend='cv-BIBTEXFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BIBTEXFLAGS</envar></link>">
-<!ENTITY cv-link-BITKEEPER "<link linkend='cv-BITKEEPER' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BITKEEPER</envar></link>">
-<!ENTITY cv-link-BITKEEPERCOM "<link linkend='cv-BITKEEPERCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BITKEEPERCOM</envar></link>">
-<!ENTITY cv-link-BITKEEPERCOMSTR "<link linkend='cv-BITKEEPERCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BITKEEPERCOMSTR</envar></link>">
-<!ENTITY cv-link-BITKEEPERGET "<link linkend='cv-BITKEEPERGET' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BITKEEPERGET</envar></link>">
-<!ENTITY cv-link-BITKEEPERGETFLAGS "<link linkend='cv-BITKEEPERGETFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BITKEEPERGETFLAGS</envar></link>">
<!ENTITY cv-link-BUILDERS "<link linkend='cv-BUILDERS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$BUILDERS</envar></link>">
<!ENTITY cv-link-CC "<link linkend='cv-CC' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CC</envar></link>">
<!ENTITY cv-link-CCCOM "<link linkend='cv-CCCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CCCOM</envar></link>">
@@ -710,12 +680,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-_CPPINCFLAGS "<link linkend='cv-_CPPINCFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_CPPINCFLAGS</envar></link>">
<!ENTITY cv-link-CPPPATH "<link linkend='cv-CPPPATH' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CPPPATH</envar></link>">
<!ENTITY cv-link-CPPSUFFIXES "<link linkend='cv-CPPSUFFIXES' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CPPSUFFIXES</envar></link>">
-<!ENTITY cv-link-CVS "<link linkend='cv-CVS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CVS</envar></link>">
-<!ENTITY cv-link-CVSCOFLAGS "<link linkend='cv-CVSCOFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CVSCOFLAGS</envar></link>">
-<!ENTITY cv-link-CVSCOM "<link linkend='cv-CVSCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CVSCOM</envar></link>">
-<!ENTITY cv-link-CVSCOMSTR "<link linkend='cv-CVSCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CVSCOMSTR</envar></link>">
-<!ENTITY cv-link-CVSFLAGS "<link linkend='cv-CVSFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CVSFLAGS</envar></link>">
-<!ENTITY cv-link-CVSREPOSITORY "<link linkend='cv-CVSREPOSITORY' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CVSREPOSITORY</envar></link>">
<!ENTITY cv-link-CXX "<link linkend='cv-CXX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CXX</envar></link>">
<!ENTITY cv-link-CXXCOM "<link linkend='cv-CXXCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CXXCOM</envar></link>">
<!ENTITY cv-link-CXXCOMSTR "<link linkend='cv-CXXCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$CXXCOMSTR</envar></link>">
@@ -725,7 +689,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-DC "<link linkend='cv-DC' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DC</envar></link>">
<!ENTITY cv-link-DCOM "<link linkend='cv-DCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DCOM</envar></link>">
<!ENTITY cv-link-DDEBUG "<link linkend='cv-DDEBUG' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DDEBUG</envar></link>">
-<!ENTITY cv-link-_DDEBUGFLAGS "<link linkend='cv-_DDEBUGFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DDEBUGFLAGS</envar></link>">
<!ENTITY cv-link-DDEBUGPREFIX "<link linkend='cv-DDEBUGPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DDEBUGPREFIX</envar></link>">
<!ENTITY cv-link-DDEBUGSUFFIX "<link linkend='cv-DDEBUGSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DDEBUGSUFFIX</envar></link>">
<!ENTITY cv-link-DESCRIPTION "<link linkend='cv-DESCRIPTION' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DESCRIPTION</envar></link>">
@@ -733,20 +696,16 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-DFILESUFFIX "<link linkend='cv-DFILESUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DFILESUFFIX</envar></link>">
<!ENTITY cv-link-DFLAGPREFIX "<link linkend='cv-DFLAGPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DFLAGPREFIX</envar></link>">
<!ENTITY cv-link-DFLAGS "<link linkend='cv-DFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DFLAGS</envar></link>">
-<!ENTITY cv-link-_DFLAGS "<link linkend='cv-_DFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DFLAGS</envar></link>">
<!ENTITY cv-link-DFLAGSUFFIX "<link linkend='cv-DFLAGSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DFLAGSUFFIX</envar></link>">
-<!ENTITY cv-link-_DINCFLAGS "<link linkend='cv-_DINCFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DINCFLAGS</envar></link>">
<!ENTITY cv-link-DINCPREFIX "<link linkend='cv-DINCPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DINCPREFIX</envar></link>">
<!ENTITY cv-link-DINCSUFFIX "<link linkend='cv-DINCSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DINCSUFFIX</envar></link>">
<!ENTITY cv-link-Dir "<link linkend='cv-Dir' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$Dir</envar></link>">
<!ENTITY cv-link-Dirs "<link linkend='cv-Dirs' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$Dirs</envar></link>">
<!ENTITY cv-link-DLIB "<link linkend='cv-DLIB' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DLIB</envar></link>">
<!ENTITY cv-link-DLIBCOM "<link linkend='cv-DLIBCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DLIBCOM</envar></link>">
-<!ENTITY cv-link-_DLIBDIRFLAGS "<link linkend='cv-_DLIBDIRFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DLIBDIRFLAGS</envar></link>">
<!ENTITY cv-link-DLIBDIRPREFIX "<link linkend='cv-DLIBDIRPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DLIBDIRPREFIX</envar></link>">
<!ENTITY cv-link-DLIBDIRSUFFIX "<link linkend='cv-DLIBDIRSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DLIBDIRSUFFIX</envar></link>">
<!ENTITY cv-link-DLIBFLAGPREFIX "<link linkend='cv-DLIBFLAGPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DLIBFLAGPREFIX</envar></link>">
-<!ENTITY cv-link-_DLIBFLAGS "<link linkend='cv-_DLIBFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DLIBFLAGS</envar></link>">
<!ENTITY cv-link-DLIBFLAGSUFFIX "<link linkend='cv-DLIBFLAGSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DLIBFLAGSUFFIX</envar></link>">
<!ENTITY cv-link-DLIBLINKPREFIX "<link linkend='cv-DLIBLINKPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DLIBLINKPREFIX</envar></link>">
<!ENTITY cv-link-DLIBLINKSUFFIX "<link linkend='cv-DLIBLINKSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DLIBLINKSUFFIX</envar></link>">
@@ -777,8 +736,10 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-DOCBOOK_XSLTPROCFLAGS "<link linkend='cv-DOCBOOK_XSLTPROCFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DOCBOOK_XSLTPROCFLAGS</envar></link>">
<!ENTITY cv-link-DOCBOOK_XSLTPROCPARAMS "<link linkend='cv-DOCBOOK_XSLTPROCPARAMS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DOCBOOK_XSLTPROCPARAMS</envar></link>">
<!ENTITY cv-link-DPATH "<link linkend='cv-DPATH' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DPATH</envar></link>">
+<!ENTITY cv-link-DRPATHPREFIX "<link linkend='cv-DRPATHPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DRPATHPREFIX</envar></link>">
+<!ENTITY cv-link-DRPATHSUFFIX "<link linkend='cv-DRPATHSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DRPATHSUFFIX</envar></link>">
+<!ENTITY cv-link-DShLibSonameGenerator "<link linkend='cv-DShLibSonameGenerator' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DShLibSonameGenerator</envar></link>">
<!ENTITY cv-link-DSUFFIXES "<link linkend='cv-DSUFFIXES' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DSUFFIXES</envar></link>">
-<!ENTITY cv-link-_DVERFLAGS "<link linkend='cv-_DVERFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DVERFLAGS</envar></link>">
<!ENTITY cv-link-DVERPREFIX "<link linkend='cv-DVERPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DVERPREFIX</envar></link>">
<!ENTITY cv-link-DVERSIONS "<link linkend='cv-DVERSIONS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DVERSIONS</envar></link>">
<!ENTITY cv-link-DVERSUFFIX "<link linkend='cv-DVERSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DVERSUFFIX</envar></link>">
@@ -975,6 +936,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-MSSDK_VERSION "<link linkend='cv-MSSDK_VERSION' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$MSSDK_VERSION</envar></link>">
<!ENTITY cv-link-MSVC_BATCH "<link linkend='cv-MSVC_BATCH' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$MSVC_BATCH</envar></link>">
<!ENTITY cv-link-MSVC_USE_SCRIPT "<link linkend='cv-MSVC_USE_SCRIPT' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$MSVC_USE_SCRIPT</envar></link>">
+<!ENTITY cv-link-MSVC_UWP_APP "<link linkend='cv-MSVC_UWP_APP' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$MSVC_UWP_APP</envar></link>">
<!ENTITY cv-link-MSVC_VERSION "<link linkend='cv-MSVC_VERSION' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$MSVC_VERSION</envar></link>">
<!ENTITY cv-link-MSVS "<link linkend='cv-MSVS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$MSVS</envar></link>">
<!ENTITY cv-link-MSVS_ARCH "<link linkend='cv-MSVS_ARCH' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$MSVS_ARCH</envar></link>">
@@ -1006,10 +968,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-no_import_lib "<link linkend='cv-no_import_lib' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$no_import_lib</envar></link>">
<!ENTITY cv-link-OBJPREFIX "<link linkend='cv-OBJPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$OBJPREFIX</envar></link>">
<!ENTITY cv-link-OBJSUFFIX "<link linkend='cv-OBJSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$OBJSUFFIX</envar></link>">
-<!ENTITY cv-link-P4 "<link linkend='cv-P4' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$P4</envar></link>">
-<!ENTITY cv-link-P4COM "<link linkend='cv-P4COM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$P4COM</envar></link>">
-<!ENTITY cv-link-P4COMSTR "<link linkend='cv-P4COMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$P4COMSTR</envar></link>">
-<!ENTITY cv-link-P4FLAGS "<link linkend='cv-P4FLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$P4FLAGS</envar></link>">
<!ENTITY cv-link-PACKAGEROOT "<link linkend='cv-PACKAGEROOT' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$PACKAGEROOT</envar></link>">
<!ENTITY cv-link-PACKAGETYPE "<link linkend='cv-PACKAGETYPE' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$PACKAGETYPE</envar></link>">
<!ENTITY cv-link-PACKAGEVERSION "<link linkend='cv-PACKAGEVERSION' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$PACKAGEVERSION</envar></link>">
@@ -1087,11 +1045,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-RCINCFLAGS "<link linkend='cv-RCINCFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RCINCFLAGS</envar></link>">
<!ENTITY cv-link-RCINCPREFIX "<link linkend='cv-RCINCPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RCINCPREFIX</envar></link>">
<!ENTITY cv-link-RCINCSUFFIX "<link linkend='cv-RCINCSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RCINCSUFFIX</envar></link>">
-<!ENTITY cv-link-RCS "<link linkend='cv-RCS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RCS</envar></link>">
-<!ENTITY cv-link-RCS_CO "<link linkend='cv-RCS_CO' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RCS_CO</envar></link>">
-<!ENTITY cv-link-RCS_COCOM "<link linkend='cv-RCS_COCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RCS_COCOM</envar></link>">
-<!ENTITY cv-link-RCS_COCOMSTR "<link linkend='cv-RCS_COCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RCS_COCOMSTR</envar></link>">
-<!ENTITY cv-link-RCS_COFLAGS "<link linkend='cv-RCS_COFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RCS_COFLAGS</envar></link>">
<!ENTITY cv-link-RDirs "<link linkend='cv-RDirs' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RDirs</envar></link>">
<!ENTITY cv-link-REGSVR "<link linkend='cv-REGSVR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$REGSVR</envar></link>">
<!ENTITY cv-link-REGSVRCOM "<link linkend='cv-REGSVRCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$REGSVRCOM</envar></link>">
@@ -1112,11 +1065,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-RPCGENSERVICEFLAGS "<link linkend='cv-RPCGENSERVICEFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RPCGENSERVICEFLAGS</envar></link>">
<!ENTITY cv-link-RPCGENXDRFLAGS "<link linkend='cv-RPCGENXDRFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$RPCGENXDRFLAGS</envar></link>">
<!ENTITY cv-link-SCANNERS "<link linkend='cv-SCANNERS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SCANNERS</envar></link>">
-<!ENTITY cv-link-SCCS "<link linkend='cv-SCCS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SCCS</envar></link>">
-<!ENTITY cv-link-SCCSCOM "<link linkend='cv-SCCSCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SCCSCOM</envar></link>">
-<!ENTITY cv-link-SCCSCOMSTR "<link linkend='cv-SCCSCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SCCSCOMSTR</envar></link>">
-<!ENTITY cv-link-SCCSFLAGS "<link linkend='cv-SCCSFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SCCSFLAGS</envar></link>">
-<!ENTITY cv-link-SCCSGETFLAGS "<link linkend='cv-SCCSGETFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SCCSGETFLAGS</envar></link>">
<!ENTITY cv-link-SCONS_HOME "<link linkend='cv-SCONS_HOME' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SCONS_HOME</envar></link>">
<!ENTITY cv-link-SHCC "<link linkend='cv-SHCC' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHCC</envar></link>">
<!ENTITY cv-link-SHCCCOM "<link linkend='cv-SHCCCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHCCCOM</envar></link>">
@@ -1129,6 +1077,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-SHCXXFLAGS "<link linkend='cv-SHCXXFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHCXXFLAGS</envar></link>">
<!ENTITY cv-link-SHDC "<link linkend='cv-SHDC' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHDC</envar></link>">
<!ENTITY cv-link-SHDCOM "<link linkend='cv-SHDCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHDCOM</envar></link>">
+<!ENTITY cv-link-SHDLIBVERSION "<link linkend='cv-SHDLIBVERSION' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHDLIBVERSION</envar></link>">
+<!ENTITY cv-link-SHDLIBVERSIONFLAGS "<link linkend='cv-SHDLIBVERSIONFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHDLIBVERSIONFLAGS</envar></link>">
<!ENTITY cv-link-SHDLINK "<link linkend='cv-SHDLINK' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHDLINK</envar></link>">
<!ENTITY cv-link-SHDLINKCOM "<link linkend='cv-SHDLINKCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHDLINKCOM</envar></link>">
<!ENTITY cv-link-SHDLINKFLAGS "<link linkend='cv-SHDLINKFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHDLINKFLAGS</envar></link>">
@@ -1175,8 +1125,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-_SHLIBSONAME "<link linkend='cv-_SHLIBSONAME' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_SHLIBSONAME</envar></link>">
<!ENTITY cv-link-SHLIBSUFFIX "<link linkend='cv-SHLIBSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHLIBSUFFIX</envar></link>">
<!ENTITY cv-link-SHLIBVERSION "<link linkend='cv-SHLIBVERSION' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHLIBVERSION</envar></link>">
-<!ENTITY cv-link-_SHLIBVERSIONFLAGS "<link linkend='cv-_SHLIBVERSIONFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_SHLIBVERSIONFLAGS</envar></link>">
<!ENTITY cv-link-SHLIBVERSIONFLAGS "<link linkend='cv-SHLIBVERSIONFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHLIBVERSIONFLAGS</envar></link>">
+<!ENTITY cv-link-_SHLIBVERSIONFLAGS "<link linkend='cv-_SHLIBVERSIONFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_SHLIBVERSIONFLAGS</envar></link>">
<!ENTITY cv-link-SHLINK "<link linkend='cv-SHLINK' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHLINK</envar></link>">
<!ENTITY cv-link-SHLINKCOM "<link linkend='cv-SHLINKCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHLINKCOM</envar></link>">
<!ENTITY cv-link-SHLINKCOMSTR "<link linkend='cv-SHLINKCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHLINKCOMSTR</envar></link>">
diff --git a/doc/man/SConstruct b/doc/man/SConstruct
index 11443cf..dedf83e 100644
--- a/doc/man/SConstruct
+++ b/doc/man/SConstruct
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/doc/man/epub.xsl b/doc/man/epub.xsl
index 2621e52..d8d7f13 100644
--- a/doc/man/epub.xsl
+++ b/doc/man/epub.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/man/html.xsl b/doc/man/html.xsl
index da72d52..ac92faf 100644
--- a/doc/man/html.xsl
+++ b/doc/man/html.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/man/pdf.xsl b/doc/man/pdf.xsl
index a55e29c..b066e34 100644
--- a/doc/man/pdf.xsl
+++ b/doc/man/pdf.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/man/scons-time.xml b/doc/man/scons-time.xml
index 2f1ab25..9dd4e73 100644
--- a/doc/man/scons-time.xml
+++ b/doc/man/scons-time.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -32,8 +32,8 @@
<refmeta>
<refentrytitle>SCONS-TIME</refentrytitle>
<manvolnum>1</manvolnum>
-<refmiscinfo class='source'>SCons 2.5.1</refmiscinfo>
-<refmiscinfo class='manual'>SCons 2.5.1</refmiscinfo>
+<refmiscinfo class='source'>SCons 3.0.0</refmiscinfo>
+<refmiscinfo class='manual'>SCons 3.0.0</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>scons-time</refname>
diff --git a/doc/man/scons.xml b/doc/man/scons.xml
index 57d413f..aabd957 100644
--- a/doc/man/scons.xml
+++ b/doc/man/scons.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -75,8 +75,8 @@
<refmeta>
<refentrytitle>SCONS</refentrytitle>
<manvolnum>1</manvolnum>
-<refmiscinfo class='source'>SCons 2.5.1</refmiscinfo>
-<refmiscinfo class='manual'>SCons 2.5.1</refmiscinfo>
+<refmiscinfo class='source'>SCons 3.0.0</refmiscinfo>
+<refmiscinfo class='manual'>SCons 3.0.0</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>scons</refname>
@@ -2187,6 +2187,22 @@ platform name when the Environment is constructed. Changing the PATH
variable after the Environment is constructed will not cause the tools to
be redetected.</para>
+<para> One feature now present within Scons is the ability to have nested tools.
+Tools which can be located within a subdirectory in the toolpath.
+With a nested tool name the dot represents a directory seperator</para>
+
+<programlisting>
+# namespaced builder
+env = Environment(ENV = os.environ, tools = ['SubDir1.SubDir2.SomeTool'])
+env.SomeTool(targets, sources)
+
+# Search Paths
+# SCons\Tool\SubDir1\SubDir2\SomeTool.py
+# SCons\Tool\SubDir1\SubDir2\SomeTool\__init__.py
+# .\site_scons\site_tools\SubDir1\SubDir2\SomeTool.py
+# .\site_scons\site_tools\SubDir1\SubDir2\SomeTool\__init__.py
+</programlisting>
+
<para>SCons supports the following tool specifications out of the box:</para>
<!-- '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -->
@@ -2483,7 +2499,7 @@ foo = Object('foo.c')
bar = Object('bar.c')
objects = ['begin.o'] + foo + ['middle.o'] + bar + ['end.o']
for object in objects:
- print str(object)
+ print(str(object))
</literallayout>
<para>Or you can use the
@@ -2497,7 +2513,7 @@ foo = Object('foo.c')
bar = Object('bar.c')
objects = Flatten(['begin.o', foo, 'middle.o', bar, 'end.o'])
for object in objects:
- print str(object)
+ print(str(object))
</literallayout>
<para>Note also that because Builder calls return
@@ -2541,7 +2557,7 @@ function:</para>
<literallayout class="monospaced">
bar_obj_list = env.StaticObject('bar.c', CPPDEFINES='-DBAR')
-print "The path to bar_obj is:", str(bar_obj_list[0])
+print("The path to bar_obj is:", str(bar_obj_list[0]))
</literallayout>
<para>Note again that because the Builder call returns a list,
@@ -2842,10 +2858,10 @@ of the tuple, respectively.</para>
<para>Example:</para>
<literallayout class="monospaced">
-print "first keyword, value =", ARGLIST[0][0], ARGLIST[0][1]
-print "second keyword, value =", ARGLIST[1][0], ARGLIST[1][1]
+print("first keyword, value =", ARGLIST[0][0], ARGLIST[0][1])
+print("second keyword, value =", ARGLIST[1][0], ARGLIST[1][1])
third_tuple = ARGLIST[2]
-print "third keyword, value =", third_tuple[0], third_tuple[1]
+print("third keyword, value =", third_tuple[0], third_tuple[1])
for key, value in ARGLIST:
# process key and value
</literallayout>
@@ -2913,7 +2929,7 @@ for additional information.</para>
<literallayout class="monospaced">
if 'foo' in BUILD_TARGETS:
- print "Don't forget to test the `foo' program!"
+ print("Don't forget to test the `foo' program!")
if 'special/program' in BUILD_TARGETS:
SConscript('special')
</literallayout>
@@ -2951,7 +2967,7 @@ is explicitly being built.</para>
<literallayout class="monospaced">
if 'foo' in COMMAND_LINE_TARGETS:
- print "Don't forget to test the `foo' program!"
+ print("Don't forget to test the `foo' program!")
if 'special/program' in COMMAND_LINE_TARGETS:
SConscript('special')
</literallayout>
@@ -2975,9 +2991,9 @@ function to get at the path name for each Node.</para>
<para>Example:</para>
<literallayout class="monospaced">
-print str(DEFAULT_TARGETS[0])
+print(str(DEFAULT_TARGETS[0]))
if 'foo' in map(str, DEFAULT_TARGETS):
- print "Don't forget to test the `foo' program!"
+ print("Don't forget to test the `foo' program!")
</literallayout>
</listitem>
</varlistentry>
@@ -2990,13 +3006,13 @@ list change on on each successive call to the
function:</para>
<literallayout class="monospaced">
-print map(str, DEFAULT_TARGETS) # originally []
+print(map(str, DEFAULT_TARGETS)) # originally []
Default('foo')
-print map(str, DEFAULT_TARGETS) # now a node ['foo']
+print(map(str, DEFAULT_TARGETS)) # now a node ['foo']
Default('bar')
-print map(str, DEFAULT_TARGETS) # now a node ['foo', 'bar']
+print(map(str, DEFAULT_TARGETS)) # now a node ['foo', 'bar']
Default(None)
-print map(str, DEFAULT_TARGETS) # back to []
+print(map(str, DEFAULT_TARGETS)) # back to []
</literallayout>
<para>Consequently, be sure to use
@@ -3525,7 +3541,7 @@ a shared library, only that the compilation (not link) succeeds.</para>
env = Environment()
conf = Configure( env )
if not conf.CheckCHeader( 'math.h' ):
- print 'We really need math.h!'
+ print('We really need math.h!')
Exit(1)
if conf.CheckLibWithHeader( 'qt', 'qapp.h', 'c++',
'QApplication qapp(0,0);' ):
@@ -3815,7 +3831,7 @@ int main(int argc, char **argv) {
env = Environment()
conf = Configure( env, custom_tests = { 'CheckQt' : CheckQt } )
if not conf.CheckQt('/usr/lib/qt'):
- print 'We really need qt!'
+ print('We really need qt!')
Exit(1)
env = conf.Finish()
</programlisting>
@@ -3995,7 +4011,7 @@ not configured.</para>
<literallayout class="monospaced">
env = Environment(variables=vars)
for key, value in vars.UnknownVariables():
- print "unknown variable: %s=%s" % (key, value)
+ print("unknown variable: %s=%s" % (key, value))
</literallayout>
</listitem>
@@ -4400,7 +4416,7 @@ File('foo.c').srcnode().path # source path of the given source file.
# Builders also return File objects:
foo = env.Program('foo.c')
-print "foo will be built in %s"%foo.path
+print("foo will be built in %s"%foo.path)
</literallayout>
<para>A
diff --git a/doc/man/scons_title.xsl b/doc/man/scons_title.xsl
index 11de773..cc5ae5e 100644
--- a/doc/man/scons_title.xsl
+++ b/doc/man/scons_title.xsl
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/man/sconsign.xml b/doc/man/sconsign.xml
index e52be43..baa15e1 100644
--- a/doc/man/sconsign.xml
+++ b/doc/man/sconsign.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -32,8 +32,8 @@
<refmeta>
<refentrytitle>SCONSIGN</refentrytitle>
<manvolnum>1</manvolnum>
-<refmiscinfo class='source'>SCons 2.5.1</refmiscinfo>
-<refmiscinfo class='manual'>SCons 2.5.1</refmiscinfo>
+<refmiscinfo class='source'>SCons 3.0.0</refmiscinfo>
+<refmiscinfo class='manual'>SCons 3.0.0</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>sconsign</refname>
diff --git a/doc/python10/SConstruct b/doc/python10/SConstruct
index 816bbda..3603298 100644
--- a/doc/python10/SConstruct
+++ b/doc/python10/SConstruct
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/doc/python10/abstract.xml b/doc/python10/abstract.xml
index a481a93..c1715e8 100644
--- a/doc/python10/abstract.xml
+++ b/doc/python10/abstract.xml
@@ -10,7 +10,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/acks.xml b/doc/python10/acks.xml
index b1c99a7..d2e7796 100644
--- a/doc/python10/acks.xml
+++ b/doc/python10/acks.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/copyright.xml b/doc/python10/copyright.xml
index 015dd76..bedd89f 100644
--- a/doc/python10/copyright.xml
+++ b/doc/python10/copyright.xml
@@ -10,7 +10,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/design.xml b/doc/python10/design.xml
index d79329a..7c48cf0 100644
--- a/doc/python10/design.xml
+++ b/doc/python10/design.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/future.xml b/doc/python10/future.xml
index ac97e09..35926e1 100644
--- a/doc/python10/future.xml
+++ b/doc/python10/future.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/install.xml b/doc/python10/install.xml
index b63b6d3..d1db496 100644
--- a/doc/python10/install.xml
+++ b/doc/python10/install.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/intro.xml b/doc/python10/intro.xml
index e1cfa87..016ce78 100644
--- a/doc/python10/intro.xml
+++ b/doc/python10/intro.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/main.xml b/doc/python10/main.xml
index a8ede24..e03d815 100644
--- a/doc/python10/main.xml
+++ b/doc/python10/main.xml
@@ -13,7 +13,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/process.xml b/doc/python10/process.xml
index c2c3efa..78c88d9 100644
--- a/doc/python10/process.xml
+++ b/doc/python10/process.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/python10/summary.xml b/doc/python10/summary.xml
index ab7939c..8437591 100644
--- a/doc/python10/summary.xml
+++ b/doc/python10/summary.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/Alias.xml b/doc/reference/Alias.xml
index 210eaa2..9656c95 100644
--- a/doc/reference/Alias.xml
+++ b/doc/reference/Alias.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/CFile.xml b/doc/reference/CFile.xml
index e5187d8..533ac16 100644
--- a/doc/reference/CFile.xml
+++ b/doc/reference/CFile.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/CXXFile.xml b/doc/reference/CXXFile.xml
index 74c527d..b428494 100644
--- a/doc/reference/CXXFile.xml
+++ b/doc/reference/CXXFile.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/Command.xml b/doc/reference/Command.xml
index fba7013..513ab5d 100644
--- a/doc/reference/Command.xml
+++ b/doc/reference/Command.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/Install.xml b/doc/reference/Install.xml
index 90ba378..63d3bd0 100644
--- a/doc/reference/Install.xml
+++ b/doc/reference/Install.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/InstallAs.xml b/doc/reference/InstallAs.xml
index 488a3ae..30e4e76 100644
--- a/doc/reference/InstallAs.xml
+++ b/doc/reference/InstallAs.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/Library.xml b/doc/reference/Library.xml
index 3508c86..dd55a9f 100644
--- a/doc/reference/Library.xml
+++ b/doc/reference/Library.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/Object.xml b/doc/reference/Object.xml
index cf183e8..ff5a8c2 100644
--- a/doc/reference/Object.xml
+++ b/doc/reference/Object.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/PCH.xml b/doc/reference/PCH.xml
index 085a33d..42e27dc 100644
--- a/doc/reference/PCH.xml
+++ b/doc/reference/PCH.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/PDF.xml b/doc/reference/PDF.xml
index d1541ce..0d63f0a 100644
--- a/doc/reference/PDF.xml
+++ b/doc/reference/PDF.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/PostScript.xml b/doc/reference/PostScript.xml
index 292ca5f..a1d351c 100644
--- a/doc/reference/PostScript.xml
+++ b/doc/reference/PostScript.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/Program.xml b/doc/reference/Program.xml
index 3c3cef9..2160317 100644
--- a/doc/reference/Program.xml
+++ b/doc/reference/Program.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/RES.xml b/doc/reference/RES.xml
index dc509e2..a720bfe 100644
--- a/doc/reference/RES.xml
+++ b/doc/reference/RES.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/SConstruct b/doc/reference/SConstruct
index f032ef4..1134516 100644
--- a/doc/reference/SConstruct
+++ b/doc/reference/SConstruct
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/doc/reference/SharedLibrary.xml b/doc/reference/SharedLibrary.xml
index c0bf35f..57bd55f 100644
--- a/doc/reference/SharedLibrary.xml
+++ b/doc/reference/SharedLibrary.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/SharedObject.xml b/doc/reference/SharedObject.xml
index d022b8e..c109fea 100644
--- a/doc/reference/SharedObject.xml
+++ b/doc/reference/SharedObject.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/StaticLibrary.xml b/doc/reference/StaticLibrary.xml
index 9fff033..b188664 100644
--- a/doc/reference/StaticLibrary.xml
+++ b/doc/reference/StaticLibrary.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/StaticObject.xml b/doc/reference/StaticObject.xml
index c227915..0486960 100644
--- a/doc/reference/StaticObject.xml
+++ b/doc/reference/StaticObject.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/chtml.xsl b/doc/reference/chtml.xsl
index 9a90e9f..707f4d2 100644
--- a/doc/reference/chtml.xsl
+++ b/doc/reference/chtml.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/copyright.xml b/doc/reference/copyright.xml
index f12c4db..e27a1ff 100644
--- a/doc/reference/copyright.xml
+++ b/doc/reference/copyright.xml
@@ -10,7 +10,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/errors.xml b/doc/reference/errors.xml
index 47f5539..97dbd2b 100644
--- a/doc/reference/errors.xml
+++ b/doc/reference/errors.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/html.xsl b/doc/reference/html.xsl
index 8ff534c..3f0760b 100644
--- a/doc/reference/html.xsl
+++ b/doc/reference/html.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/main.xml b/doc/reference/main.xml
index 21b42b3..788c967 100644
--- a/doc/reference/main.xml
+++ b/doc/reference/main.xml
@@ -16,7 +16,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/pdf.xsl b/doc/reference/pdf.xsl
index bc42506..a6d0054 100644
--- a/doc/reference/pdf.xsl
+++ b/doc/reference/pdf.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/preface.xml b/doc/reference/preface.xml
index 3101e42..05d5ca4 100644
--- a/doc/reference/preface.xml
+++ b/doc/reference/preface.xml
@@ -12,7 +12,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/reference/scons_title.xsl b/doc/reference/scons_title.xsl
index 2ff38af..130c6a5 100644
--- a/doc/reference/scons_title.xsl
+++ b/doc/reference/scons_title.xsl
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/scons.mod b/doc/scons.mod
index 6ba4367..eb45a30 100644
--- a/doc/scons.mod
+++ b/doc/scons.mod
@@ -1,6 +1,6 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
An SCons-specific DTD module, for use with SCons DocBook
documentation, that contains names, phrases, acronyms, etc. used
@@ -243,6 +243,7 @@
<!ENTITY PrependENVPath "<function xmlns='http://www.scons.org/dbxsd/v1.0'>PrependENVPath</function>">
<!ENTITY PrependUnique "<function xmlns='http://www.scons.org/dbxsd/v1.0'>PrependUnique</function>">
<!ENTITY Progress "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Progress</function>">
+<!ENTITY PyPackageDir "<function xmlns='http://www.scons.org/dbxsd/v1.0'>PyPackageDir</function>">
<!ENTITY Replace "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Replace</function>">
<!ENTITY Repository "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Repository</function>">
<!ENTITY Requires "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Requires</function>">
diff --git a/doc/user/README b/doc/user/README
index 71b73f9..1718f0e 100644
--- a/doc/user/README
+++ b/doc/user/README
@@ -1,4 +1,4 @@
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
When adding a new file, add it to main.xml and MANIFEST.
diff --git a/doc/user/SConstruct b/doc/user/SConstruct
index f84e487..96d6677 100644
--- a/doc/user/SConstruct
+++ b/doc/user/SConstruct
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/doc/user/actions.xml b/doc/user/actions.xml
index 884b1bf..3e60a9f 100644
--- a/doc/user/actions.xml
+++ b/doc/user/actions.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/add-method.xml b/doc/user/add-method.xml
index 35c412b..0d30a48 100644
--- a/doc/user/add-method.xml
+++ b/doc/user/add-method.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/alias.xml b/doc/user/alias.xml
index d19ba45..fee9dd1 100644
--- a/doc/user/alias.xml
+++ b/doc/user/alias.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/ant.xml b/doc/user/ant.xml
index 1bf5658..bd35671 100644
--- a/doc/user/ant.xml
+++ b/doc/user/ant.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/build-install.xml b/doc/user/build-install.xml
index a69dedf..845b9e6 100644
--- a/doc/user/build-install.xml
+++ b/doc/user/build-install.xml
@@ -26,7 +26,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -289,7 +289,7 @@ Python 2.5.1
that makes installation extremely easy.
Download the <filename>scons-&buildversion;.win32.exe</filename>
file from the &SCons; download page at
- <ulink url="http://www.scons.org/download.php">http://www.scons.org/download.php</ulink>.
+ <ulink url="http://scons.org/pages/download.html">http://scons.org/pages/download.html</ulink>.
Then all you need to do is execute the file
(usually by clicking on its icon in Windows Explorer).
These will take you through a small
diff --git a/doc/user/builders-built-in.xml b/doc/user/builders-built-in.xml
index 19a4a93..d64b63d 100644
--- a/doc/user/builders-built-in.xml
+++ b/doc/user/builders-built-in.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/builders-commands.xml b/doc/user/builders-commands.xml
index 1d18db7..8fa26f6 100644
--- a/doc/user/builders-commands.xml
+++ b/doc/user/builders-commands.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/builders-writing.xml b/doc/user/builders-writing.xml
index a11bc6d..d26c4c6 100644
--- a/doc/user/builders-writing.xml
+++ b/doc/user/builders-writing.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -1047,7 +1047,7 @@ def MakeWorkDir(workdir):
<file name="SConscript">
import my_utils
MakeWorkDir('/tmp/work')
-print "build_id=" + my_utils.build_id()
+print("build_id=" + my_utils.build_id())
</file>
</scons_example>
@@ -1060,7 +1060,7 @@ print "build_id=" + my_utils.build_id()
<sconstruct>
import my_utils
-print "build_id=" + my_utils.build_id()
+print("build_id=" + my_utils.build_id())
my_utils.MakeWorkDir('/tmp/work')
</sconstruct>
diff --git a/doc/user/builders.xml b/doc/user/builders.xml
index 3045548..c1af202 100644
--- a/doc/user/builders.xml
+++ b/doc/user/builders.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/caching.xml b/doc/user/caching.xml
index cc68fb4..db2a469 100644
--- a/doc/user/caching.xml
+++ b/doc/user/caching.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/chtml.xsl b/doc/user/chtml.xsl
index 73b524e..dafc044 100644
--- a/doc/user/chtml.xsl
+++ b/doc/user/chtml.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/command-line.xml b/doc/user/command-line.xml
index b3f8e3e..21c17c1 100644
--- a/doc/user/command-line.xml
+++ b/doc/user/command-line.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -317,7 +317,7 @@ if not GetOption('help'):
import os
num_cpu = int(os.environ.get('NUM_CPU', 2))
SetOption('num_jobs', num_cpu)
-print "running with -j", GetOption('num_jobs')
+print("running with -j", GetOption('num_jobs'))
</file>
<file name="foo.in">
foo.in
@@ -1863,7 +1863,7 @@ env = Environment(variables = vars,
CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
unknown = vars.UnknownVariables()
if unknown:
- print "Unknown variables:", unknown.keys()
+ print("Unknown variables:", unknown.keys())
Exit(1)
env.Program('foo.c')
</file>
@@ -1945,7 +1945,7 @@ foo.c
<scons_example name="commandline_COMMAND_LINE_TARGETS">
<file name="SConstruct" printme="1">
if 'bar' in COMMAND_LINE_TARGETS:
- print "Don't forget to copy `bar' to the archive!"
+ print("Don't forget to copy `bar' to the archive!")
Default(Program('foo.c'))
Program('bar.c')
</file>
@@ -2210,7 +2210,7 @@ prog2.c
<file name="SConstruct" printme="1">
prog1 = Program('prog1.c')
Default(prog1)
-print "DEFAULT_TARGETS is", map(str, DEFAULT_TARGETS)
+print("DEFAULT_TARGETS is", map(str, DEFAULT_TARGETS))
</file>
<file name="prog1.c">
prog1.c
@@ -2244,10 +2244,10 @@ prog1.c
<file name="SConstruct" printme="1">
prog1 = Program('prog1.c')
Default(prog1)
-print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS)
+print("DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS))
prog2 = Program('prog2.c')
Default(prog2)
-print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS)
+print("DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS))
</file>
<file name="prog1.c">
prog1.c
@@ -2338,7 +2338,7 @@ else:
prog1 = Program('prog1.c')
Program('prog2.c')
Default(prog1)
-print "BUILD_TARGETS is", map(str, BUILD_TARGETS)
+print("BUILD_TARGETS is", map(str, BUILD_TARGETS))
</file>
<file name="prog1.c">
prog1.c
diff --git a/doc/user/copyright.xml b/doc/user/copyright.xml
index 604c5df..6971581 100644
--- a/doc/user/copyright.xml
+++ b/doc/user/copyright.xml
@@ -10,7 +10,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/depends.xml b/doc/user/depends.xml
index 1b48156..29a79a5 100644
--- a/doc/user/depends.xml
+++ b/doc/user/depends.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/environments.xml b/doc/user/environments.xml
index bbe8b07..ea5d472 100644
--- a/doc/user/environments.xml
+++ b/doc/user/environments.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -627,7 +627,7 @@ int main() { }
<scons_example name="environments_ex6">
<file name="SConstruct" printme="1">
env = Environment()
-print "CC is:", env['CC']
+print("CC is:", env['CC'])
</file>
</scons_example>
@@ -658,7 +658,7 @@ print "CC is:", env['CC']
env = Environment(FOO = 'foo', BAR = 'bar')
dict = env.Dictionary()
for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']:
- print "key = %s, value = %s" % (key, dict[key])
+ print("key = %s, value = %s" % (key, dict[key]))
</file>
</scons_example>
@@ -695,7 +695,7 @@ for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']:
<sconstruct>
env = Environment()
for item in sorted(env.Dictionary().items()):
- print "construction variable = '%s', value = '%s'" % item
+ print("construction variable = '%s', value = '%s'" % item)
</sconstruct>
</section>
@@ -721,7 +721,7 @@ for item in sorted(env.Dictionary().items()):
<sconstruct>
env = Environment()
-print "CC is:", env.subst('$CC')
+print("CC is:", env.subst('$CC'))
</sconstruct>
<para>
@@ -738,7 +738,7 @@ print "CC is:", env.subst('$CC')
<sconstruct>
env = Environment(CCFLAGS = '-DFOO')
-print "CCCOM is:", env['CCCOM']
+print("CCCOM is:", env['CCCOM'])
</sconstruct>
<para>
@@ -764,7 +764,7 @@ scons: `.' is up to date.
<sconstruct>
env = Environment(CCFLAGS = '-DFOO')
-print "CCCOM is:", env.subst('$CCCOM')
+print("CCCOM is:", env.subst('$CCCOM'))
</sconstruct>
<para>
@@ -806,7 +806,7 @@ scons: `.' is up to date.
<scons_example name="environments_missing1">
<file name="SConstruct" printme="1">
env = Environment()
-print "value is:", env.subst( '->$MISSING&lt;-' )
+print("value is:", env.subst( '->$MISSING&lt;-' ))
</file>
</scons_example>
@@ -834,7 +834,7 @@ print "value is:", env.subst( '->$MISSING&lt;-' )
<file name="SConstruct" printme="1">
AllowSubstExceptions()
env = Environment()
-print "value is:", env.subst( '->$MISSING&lt;-' )
+print("value is:", env.subst( '->$MISSING&lt;-' ))
</file>
</scons_example>
@@ -854,7 +854,7 @@ print "value is:", env.subst( '->$MISSING&lt;-' )
<file name="SConstruct" printme="1">
AllowSubstExceptions(IndexError, NameError, ZeroDivisionError)
env = Environment()
-print "value is:", env.subst( '->${1 / 0}&lt;-' )
+print("value is:", env.subst( '->${1 / 0}&lt;-' ))
</file>
</scons_example>
@@ -1216,7 +1216,7 @@ int main() { }
<file name="SConstruct" printme="1">
env = Environment()
env.Replace(NEW_VARIABLE = 'xyzzy')
-print "NEW_VARIABLE =", env['NEW_VARIABLE']
+print("NEW_VARIABLE =", env['NEW_VARIABLE'])
</file>
</scons_example>
@@ -1251,11 +1251,11 @@ print "NEW_VARIABLE =", env['NEW_VARIABLE']
<scons_example name="environments_Replace2">
<file name="SConstruct" printme="1">
env = Environment(CCFLAGS = '-DDEFINE1')
-print "CCFLAGS =", env['CCFLAGS']
+print("CCFLAGS =", env['CCFLAGS'])
env.Program('foo.c')
env.Replace(CCFLAGS = '-DDEFINE2')
-print "CCFLAGS =", env['CCFLAGS']
+print("CCFLAGS =", env['CCFLAGS'])
env.Program('bar.c')
</file>
<file name="foo.c">
@@ -1375,7 +1375,7 @@ int main() { }
<file name="SConstruct" printme="1">
env = Environment()
env.Append(NEW_VARIABLE = 'added')
-print "NEW_VARIABLE =", env['NEW_VARIABLE']
+print("NEW_VARIABLE =", env['NEW_VARIABLE'])
</file>
</scons_example>
@@ -1475,7 +1475,7 @@ int main() { }
<file name="SConstruct" printme="1">
env = Environment()
env.Prepend(NEW_VARIABLE = 'added')
-print "NEW_VARIABLE =", env['NEW_VARIABLE']
+print("NEW_VARIABLE =", env['NEW_VARIABLE'])
</file>
</scons_example>
@@ -1650,7 +1650,7 @@ if len(sys.argv) &gt; 1:
else:
keys = sorted(os.environ.keys())
for key in keys:
- print " " + key + "=" + os.environ[key]
+ print(" " + key + "=" + os.environ[key])
</file>
</scons_example>
@@ -1765,4 +1765,173 @@ env.AppendENVPath('LIB', '/usr/local/lib')
</section>
+
+ <section id="sect-environment-toolpath">
+ <title>Using the toolpath for external Tools</title>
+
+ <section>
+ <title>The default tool search path</title>
+
+ <para>
+ Normally when using a tool from the construction environment,
+ several different search locations are checked by default.
+ This includes the <literal>Scons/Tools/</literal> directory
+ inbuilt to scons and the directory <literal>site_scons/site_tools</literal>
+ relative to the root SConstruct file.
+ </para>
+
+ <sconstruct>
+# Builtin tool or tool located within site_tools
+env = Environment(tools = ['SomeTool'])
+env.SomeTool(targets, sources)
+
+# The search locations would include by default
+SCons/Tool/SomeTool.py
+SCons/Tool/SomeTool/__init__.py
+./site_scons/site_tools/SomeTool.py
+./site_scons/site_tools/SomeTool/__init__.py
+ </sconstruct>
+
+ </section>
+
+ <section>
+ <title>Providing an external directory to toolpath</title>
+
+ <para>
+ In some cases you may want to specify a different location to search for tools.
+ The Environment constructor contains an option for this called toolpath
+ This can be used to add additional search directories.
+ </para>
+
+ <sconstruct>
+# Tool located within the toolpath directory option
+env = Environment(tools = ['SomeTool'], toolpath = ['/opt/SomeToolPath', '/opt/SomeToolPath2'])
+env.SomeTool(targets, sources)
+
+# The search locations in this example would include:
+/opt/SomeToolPath/SomeTool.py
+/opt/SomeToolPath/SomeTool/__init__.py
+/opt/SomeToolPath2/SomeTool.py
+/opt/SomeToolPath2/SomeTool/__init__.py
+SCons/Tool/SomeTool.py
+SCons/Tool/SomeTool/__init__.py
+./site_scons/site_tools/SomeTool.py
+./site_scons/site_tools/SomeTool/__init__.py
+ </sconstruct>
+
+ </section>
+
+ <section>
+ <title>Nested Tools within a toolpath</title>
+
+ <para>
+ &SCons; 3.0 now supports the ability for a Builder to be located
+ within a sub-directory / sub-package of the toolpath.
+ This is similar to namespacing within python.
+ With nested or namespaced tools we can use the dot notation
+ to specify a sub-directory that the tool is located under.
+ </para>
+
+ <sconstruct>
+# namespaced target
+env = Environment(tools = ['SubDir1.SubDir2.SomeTool'], toolpath = ['/opt/SomeToolPath'])
+env.SomeTool(targets, sources)
+
+# With this example the search locations would include
+/opt/SomeToolPath/SubDir1/SubDir2/SomeTool.py
+/opt/SomeToolPath/SubDir1/SubDir2/SomeTool/__init__.py
+SCons/Tool/SubDir1/SubDir2/SomeTool.py
+SCons/Tool/SubDir1/SubDir2/SomeTool/__init__.py
+./site_scons/site_tools/SubDir1/SubDir2/SomeTool.py
+./site_scons/site_tools/SubDir1/SubDir2/SomeTool/__init__.py
+ </sconstruct>
+
+ <para>
+ For python2 It's important to note when creating tools within sub-directories,
+ there needs to be a __init__.py file within each directory.
+ This file can just be empty.
+ This is the same constraint used by python when loading modules
+ from within sub-directories (packages).
+ For python3 this appears to be no longer a requirement.
+ </para>
+ </section>
+
+ <section>
+ <title>Using sys.path within the toolpath</title>
+
+ <para>
+ If we want to access tools externally to scons on the sys.path
+ (one example would be tools installed via the pip package manager)
+ One way to do this is to use sys.path with the toolpath.
+
+ One thing to watch out for with this approach is that sys.path
+ can sometimes contains paths to .egg files instead of directories.
+ So we need to filter those out with this approach.
+ </para>
+
+ <sconstruct>
+# namespaced target using sys.path within toolpath
+
+searchpaths = []
+for item in sys.path:
+ if os.path.isdir(item): searchpaths.append(item)
+
+env = Environment(tools = ['someinstalledpackage.SomeTool'], toolpath = searchpaths)
+env.SomeTool(targets, sources)
+ </sconstruct>
+
+ <para>
+ By using sys.path with the toolpath argument
+ and by using the nested syntax we can have scons search
+ packages installed via pip for Tools.
+ </para>
+
+<sconstruct>
+# For Windows based on the python version and install directory, this may be something like
+C:\Python35\Lib\site-packages\someinstalledpackage\SomeTool.py
+C:\Python35\Lib\site-packages\someinstalledpackage\SomeTool\__init__.py
+
+# For Linux this could be something like:
+/usr/lib/python3/dist-packages/someinstalledpackage/SomeTool.py
+/usr/lib/python3/dist-packages/someinstalledpackage/SomeTool/__init__.py
+</sconstruct>
+
+ </section>
+
+ <section>
+ <title>Using the &PyPackageDir; function to add to the toolpath</title>
+
+ <para>
+ In some cases you may want to use a tool
+ located within a installed external pip package.
+ This is possible by the use of sys.path with the toolpath.
+ However in that situation you need to provide a prefix to the toolname
+ to indicate where it is located within sys.path
+ </para>
+
+ <sconstruct>
+searchpaths = []
+for item in sys.path:
+ if os.path.isdir(item): searchpaths.append(item)
+env = Environment(tools = ['tools_example.subdir1.subdir2.SomeTool'], toolpath = searchpaths)
+env.SomeTool(targets, sources)
+ </sconstruct>
+
+ <para>
+ To avoid the use of a prefix within the name of the tool or filtering sys.path for directories,
+ we can use the <function>PyPackageDir(modulename)</function> function to locate the directory of the python package.
+ <function>PyPackageDir</function> returns a Dir object which represents the path of the directory
+ for the python package / module specified as a parameter.
+ </para>
+
+ <sconstruct>
+# namespaced target using sys.path
+env = Environment(tools = ['SomeTool'], toolpath = [PyPackageDir('tools_example.subdir1.subdir2')])
+env.SomeTool(targets, sources)
+ </sconstruct>
+
+ </section>
+
+ </section>
+
</chapter>
diff --git a/doc/user/epub.xsl b/doc/user/epub.xsl
index 9b352de..fc95c60 100644
--- a/doc/user/epub.xsl
+++ b/doc/user/epub.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/errors.xml b/doc/user/errors.xml
index 8028664..78b4f39 100644
--- a/doc/user/errors.xml
+++ b/doc/user/errors.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/example.xml b/doc/user/example.xml
index 451f8fc..b1453ab 100644
--- a/doc/user/example.xml
+++ b/doc/user/example.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/factories.xml b/doc/user/factories.xml
index e3c47b5..916c269 100644
--- a/doc/user/factories.xml
+++ b/doc/user/factories.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/file-removal.xml b/doc/user/file-removal.xml
index 19af914..bc2d89b 100644
--- a/doc/user/file-removal.xml
+++ b/doc/user/file-removal.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/functions.xml b/doc/user/functions.xml
index 83a6614..6093395 100644
--- a/doc/user/functions.xml
+++ b/doc/user/functions.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/gettext.xml b/doc/user/gettext.xml
index f8143cc..8daf5f9 100644
--- a/doc/user/gettext.xml
+++ b/doc/user/gettext.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/hierarchy.xml b/doc/user/hierarchy.xml
index 007b4ec..f65a128 100644
--- a/doc/user/hierarchy.xml
+++ b/doc/user/hierarchy.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/html.xsl b/doc/user/html.xsl
index a0bc9fc..2df2fee 100644
--- a/doc/user/html.xsl
+++ b/doc/user/html.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/install.xml b/doc/user/install.xml
index c5b9967..7024320 100644
--- a/doc/user/install.xml
+++ b/doc/user/install.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/java.xml b/doc/user/java.xml
index e0beafe..73afbc7 100644
--- a/doc/user/java.xml
+++ b/doc/user/java.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/less-simple.xml b/doc/user/less-simple.xml
index 80d9104..c17bdae 100644
--- a/doc/user/less-simple.xml
+++ b/doc/user/less-simple.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/libraries.xml b/doc/user/libraries.xml
index b5f9cba..b905923 100644
--- a/doc/user/libraries.xml
+++ b/doc/user/libraries.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/main.xml b/doc/user/main.xml
index a0eff36..ad2ffe8 100644
--- a/doc/user/main.xml
+++ b/doc/user/main.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -74,10 +74,10 @@
<corpauthor>Steven Knight and the SCons Development Team</corpauthor>
- <pubdate>2004 - 2016</pubdate>
+ <pubdate>2004 - 2017</pubdate>
<copyright>
- <year>2004 - 2016</year>
+ <year>2004 - 2017</year>
<holder>The SCons Foundation</holder>
</copyright>
diff --git a/doc/user/make.xml b/doc/user/make.xml
index 74fe9e8..4f1199d 100644
--- a/doc/user/make.xml
+++ b/doc/user/make.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/mergeflags.xml b/doc/user/mergeflags.xml
index 3fc215b..36bb061 100644
--- a/doc/user/mergeflags.xml
+++ b/doc/user/mergeflags.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/misc.xml b/doc/user/misc.xml
index 886536f..ed96625 100644
--- a/doc/user/misc.xml
+++ b/doc/user/misc.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -212,7 +212,7 @@ SCons 1.0 or greater required, but you have SCons 0.98.5
<scons_example name="misc_Exit">
<file name="SConstruct" printme="1">
if ARGUMENTS.get('FUTURE'):
- print "The FUTURE option is not supported yet!"
+ print("The FUTURE option is not supported yet!")
Exit(2)
env = Environment()
env.Program('hello.c')
@@ -268,9 +268,9 @@ hello.c
<scons_example name="misc_FindFile1a">
<file name="SConstruct" printme="1">
# one directory
-print FindFile('missing', '.')
+print(FindFile('missing', '.'))
t = FindFile('exists', '.')
-print t.__class__, t
+print(t.__class__, t)
</file>
<file name="exists">
exists
@@ -287,7 +287,7 @@ print t.__class__, t
includes = [ '.', 'include', 'src/include']
headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h']
for hdr in headers:
- print '%-12s' % ('%s:' % hdr), FindFile(hdr, includes)
+ print('%-12s' % ('%s:' % hdr), FindFile(hdr, includes))
</file>
<file name="config.h">
exists
@@ -320,7 +320,7 @@ exists
# several directories
includes = [ '.', 'include', 'src/include']
headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h']
-print FindFile(headers, includes)
+print(FindFile(headers, includes))
</file>
<file name="config.h">
exists
@@ -350,9 +350,9 @@ exists
<scons_example name="misc_FindFile1d">
<file name="SConstruct" printme="1">
-print FindFile('multiple', ['sub1', 'sub2', 'sub3'])
-print FindFile('multiple', ['sub2', 'sub3', 'sub1'])
-print FindFile('multiple', ['sub3', 'sub1', 'sub2'])
+print(FindFile('multiple', ['sub1', 'sub2', 'sub3']))
+print(FindFile('multiple', ['sub2', 'sub3', 'sub1']))
+print(FindFile('multiple', ['sub3', 'sub1', 'sub2']))
</file>
<directory name="sub1"></directory>
<file name="sub1/multiple">
@@ -386,8 +386,8 @@ exists
<file name="SConstruct" printme="1">
# Neither file exists, so build will fail
Command('derived', 'leaf', 'cat >$TARGET $SOURCE')
-print FindFile('leaf', '.')
-print FindFile('derived', '.')
+print(FindFile('leaf', '.'))
+print(FindFile('derived', '.'))
</file>
</scons_example>
@@ -399,8 +399,8 @@ print FindFile('derived', '.')
<file name="SConstruct" printme="1">
# Only 'leaf' exists
Command('derived', 'leaf', 'cat >$TARGET $SOURCE')
-print FindFile('leaf', '.')
-print FindFile('derived', '.')
+print(FindFile('leaf', '.'))
+print(FindFile('derived', '.'))
</file>
<file name="leaf">
leaf
@@ -422,7 +422,7 @@ leaf
<file name="SConstruct" printme="1">
# Only 'src/leaf' exists
VariantDir('build', 'src')
-print FindFile('leaf', 'build')
+print(FindFile('leaf', 'build'))
</file>
<directory name="src"></directory>
<file name="src/leaf">
@@ -507,7 +507,7 @@ objects = [
Program(objects)
for object_file in objects:
- print object_file.abspath
+ print(object_file.abspath)
</file>
<file name="prog1.c">
prog1.c
@@ -548,7 +548,7 @@ objects = [
Program(objects)
for object_file in Flatten(objects):
- print object_file.abspath
+ print(object_file.abspath)
</file>
<file name="prog1.c">
prog1.c
diff --git a/doc/user/nodes.xml b/doc/user/nodes.xml
index 20e8eec..e627bba 100644
--- a/doc/user/nodes.xml
+++ b/doc/user/nodes.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -265,8 +265,8 @@ xyzzy = Entry('xyzzy')
<file name="SConstruct" printme="1">
object_list = Object('hello.c')
program_list = Program(object_list)
-print "The object file is:", object_list[0]
-print "The program file is:", program_list[0]
+print("The object file is:", object_list[0])
+print("The program file is:", program_list[0])
</file>
<file name="hello.c">
int main() { printf("Hello, world!\n"); }
@@ -334,7 +334,7 @@ import os.path
program_list = Program('hello.c')
program_name = str(program_list[0])
if not os.path.exists(program_name):
- print program_name, "does not exist!"
+ print(program_name, "does not exist!")
</file>
<file name="hello.c">
int main() { printf("Hello, world!\n"); }
@@ -374,7 +374,7 @@ int main() { printf("Hello, world!\n"); }
<file name="SConstruct" printme="1">
env=Environment(VAR="value")
n=File("foo.c")
-print env.GetBuildPath([n, "sub/dir/$VAR"])
+print(env.GetBuildPath([n, "sub/dir/$VAR"]))
</file>
</scons_example>
@@ -414,8 +414,8 @@ print env.GetBuildPath([n, "sub/dir/$VAR"])
<file name="SConstruct" printme="1">
hello_c = File('hello.c')
contents = hello_c.read()
-print "contents are:"
-print contents
+print("contents are:")
+print(contents)
</file>
<file name="hello.c">
int main() { printf("Hello, world!\n"); }
diff --git a/doc/user/output.xml b/doc/user/output.xml
index 2e7df55..cf5776d 100644
--- a/doc/user/output.xml
+++ b/doc/user/output.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -622,7 +622,7 @@ import atexit
def print_build_failures():
from SCons.Script import GetBuildFailures
for bf in GetBuildFailures():
- print "%s failed: %s" % (bf.node, bf.errstr)
+ print("%s failed: %s" % (bf.node, bf.errstr))
atexit.register(print_build_failures)
</file>
</scons_example>
@@ -701,10 +701,10 @@ def display_build_status():
Here you could do all kinds of complicated things."""
status, failures_message = build_status()
if status == 'failed':
- print "FAILED!!!!" # could display alert, ring bell, etc.
+ print("FAILED!!!!") # could display alert, ring bell, etc.
elif status == 'ok':
- print "Build succeeded."
- print failures_message
+ print("Build succeeded.")
+ print(failures_message)
atexit.register(display_build_status)
</file>
diff --git a/doc/user/parseconfig.xml b/doc/user/parseconfig.xml
index f7fb5cb..2367857 100644
--- a/doc/user/parseconfig.xml
+++ b/doc/user/parseconfig.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/parseflags.xml b/doc/user/parseflags.xml
index e766b3a..52cbdd7 100644
--- a/doc/user/parseflags.xml
+++ b/doc/user/parseflags.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/pdf.xsl b/doc/user/pdf.xsl
index d5e1849..4a81d56 100644
--- a/doc/user/pdf.xsl
+++ b/doc/user/pdf.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/preface.xml b/doc/user/preface.xml
index 50a9e3f..443bf38 100644
--- a/doc/user/preface.xml
+++ b/doc/user/preface.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/python.xml b/doc/user/python.xml
index 9adbf02..82443f9 100644
--- a/doc/user/python.xml
+++ b/doc/user/python.xml
@@ -22,7 +22,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/repositories.xml b/doc/user/repositories.xml
index 53a7ca5..6aae2e3 100644
--- a/doc/user/repositories.xml
+++ b/doc/user/repositories.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/run.xml b/doc/user/run.xml
index 3d2f528..af28868 100644
--- a/doc/user/run.xml
+++ b/doc/user/run.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/scanners.xml b/doc/user/scanners.xml
index 4bffdba..9e3ce99 100644
--- a/doc/user/scanners.xml
+++ b/doc/user/scanners.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/sconf.xml b/doc/user/sconf.xml
index ebcbca9..d0537cb 100644
--- a/doc/user/sconf.xml
+++ b/doc/user/sconf.xml
@@ -2,7 +2,7 @@
<!DOCTYPE sconsdoc [
<!ENTITY % scons SYSTEM "../scons.mod">
%scons;
-
+
<!ENTITY % builders-mod SYSTEM "../generated/builders.mod">
%builders-mod;
<!ENTITY % functions-mod SYSTEM "../generated/functions.mod">
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -287,7 +287,7 @@ env = conf.Finish()
<para>
Check the size of a datatype by using the &CheckTypeSize; method:
</para>
-
+
<sconstruct>
env = Environment()
conf = Configure(env)
@@ -295,7 +295,7 @@ int_size = conf.CheckTypeSize('unsigned int')
print 'sizeof unsigned int is', int_size
env = conf.Finish()
</sconstruct>
-
+
<screen>
% <userinput>scons -Q</userinput>
sizeof unsigned int is 4
@@ -456,7 +456,7 @@ env = conf.Finish()
<screen>
% <userinput>scons</userinput>
scons: Reading SConscript file ...
-Checking for MyLibrary... failed
+Checking for MyLibrary... no
MyLibrary is not installed!
</screen>
@@ -470,7 +470,7 @@ MyLibrary is not installed!
<screen>
% <userinput>scons</userinput>
scons: Reading SConscript file ...
-Checking for MyLibrary... failed
+Checking for MyLibrary... yes
scons: done reading SConscript
scons: Building targets ...
.
diff --git a/doc/user/scons_title.xsl b/doc/user/scons_title.xsl
index 2ff38af..130c6a5 100644
--- a/doc/user/scons_title.xsl
+++ b/doc/user/scons_title.xsl
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/separate.xml b/doc/user/separate.xml
index 10a426b..bac7e4d 100644
--- a/doc/user/separate.xml
+++ b/doc/user/separate.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/sideeffect.xml b/doc/user/sideeffect.xml
index e83c086..16dbd08 100644
--- a/doc/user/sideeffect.xml
+++ b/doc/user/sideeffect.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/simple.xml b/doc/user/simple.xml
index 216bfb2..af7868b 100644
--- a/doc/user/simple.xml
+++ b/doc/user/simple.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -442,11 +442,11 @@ Program('hello.c') # "hello.c" is the source file.
<scons_example name="simple_declarative">
<file name="SConstruct" printme="1">
-print "Calling Program('hello.c')"
+print("Calling Program('hello.c')")
Program('hello.c')
-print "Calling Program('goodbye.c')"
+print("Calling Program('goodbye.c')")
Program('goodbye.c')
-print "Finished calling Program()"
+print("Finished calling Program()")
</file>
<file name="hello.c">
int main() { printf("Hello, world!\n"); }
diff --git a/doc/user/sourcecode.xml b/doc/user/sourcecode.xml
index b9cbde5..b3c51e4 100644
--- a/doc/user/sourcecode.xml
+++ b/doc/user/sourcecode.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/tasks.xml b/doc/user/tasks.xml
index ac1a7ba..248dcd3 100644
--- a/doc/user/tasks.xml
+++ b/doc/user/tasks.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/tools.xml b/doc/user/tools.xml
index 5206f2e..0c56603 100644
--- a/doc/user/tools.xml
+++ b/doc/user/tools.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/troubleshoot.xml b/doc/user/troubleshoot.xml
index 16a9725..aecac57 100644
--- a/doc/user/troubleshoot.xml
+++ b/doc/user/troubleshoot.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/variables.xml b/doc/user/variables.xml
index 85b9c1d..e0d1d32 100644
--- a/doc/user/variables.xml
+++ b/doc/user/variables.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/doc/user/variants.xml b/doc/user/variants.xml
index 67bc54b..1944201 100644
--- a/doc/user/variants.xml
+++ b/doc/user/variants.xml
@@ -21,7 +21,7 @@
<!--
- Copyright (c) 2001 - 2016 The SCons Foundation
+ Copyright (c) 2001 - 2017 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/shippable.yml b/shippable.yml
new file mode 100644
index 0000000..b7e363a
--- /dev/null
+++ b/shippable.yml
@@ -0,0 +1,7 @@
+language: python
+
+python:
+ - "2.7"
+ - "3.4"
+
+script: python runtest.py -a
diff --git a/src/Announce.txt b/src/Announce.txt
index f9ce9d9..ebda22e 100644
--- a/src/Announce.txt
+++ b/src/Announce.txt
@@ -11,21 +11,51 @@ scripts, allowing you to use the full power of a real scripting language
to solve build problems. You do not, however, need to know Python to
use SCons effectively.
-Please go to http://www.scons.org/download.php to get the latest production
+Please go to http://scons.org/pages/download.html to get the latest production
release of SCons.
So that everyone using SCons can help each other learn how to use it more
-effectively, please go to http://scons.org/lists.php#users to sign up for
+effectively, please go to http://scons.org/lists.html#users to sign up for
the scons-users mailing list.
-RELEASE 2.5.1 - Mon, 03 Nov 2016 13:37:42 -0400
+RELEASE 3.0.0 - Mon, 18 Sep 2017 08:32:04 -0700
Please consult the RELEASE.txt file for a summary of changes since the last
release and consult the CHANGES.txt file for complete a list of changes
since last release. This announcement highlights only the important
changes.
-
- - Please note the following important changes since release 2.4.1:
+ Please note the following important changes since release 2.5.1:
+ *IT IS NOT READY FOR PRODUCTION USE*
+
+ This is the initial release supporting both python 3.5+ and 2.7.x and pypy
+ There are some important changes:
+
+ - Any print statements must now use python 3 syntax of "print()"
+ - All node content should be in bytes. This is the default in python 2.7.x,
+ in Python 3 all strings are by default unicode. byte and/or bytearray
+ should be used if you construct content for return by a custom node type's
+ get_content() method.
+ - This is some (as yet unresolved issue) using Literal()'s in some context with
+ Python 3
+ - pypy should be supported, please report any issues to the user's mailing list.
+ - Currently if you switch back and forth between python 2.7.x and 3.5+ you will
+ need to remove your sconsign file. This should be resolves shortly, but
+ regardless switching between python 2.7.x and 3.5+ will not use compatible
+ sconsigns and as such incremental builds should be expected to rebuild
+ anything changed since the previous scons run with the same version of python.
+ - It is likely that migrating from 2.5.1 -> 3.0.0 alpha will cause rebuilds due
+ to the significant number of changes in the codebase.
+
+ - Removed deprecated tools CVS, Perforce, BitKeeper, RCS, SCCS, Subversion.
+ - Removed deprecated module SCons.Sig
+ - See CHANGES.txt for more details on other changes
+ - 3.0.0 should be slightly faster than 2.5.1. Changes yielded a 15% speed up for
+ null incremental builds.
+ - Updated D language scanner support to latest: 2.071.1.
+ - python -m SCons should now run SCons if it's installed PYTHONPATH
+
+
+ Please note the following important changes since release 2.4.1:
We're enhancing implicit language scanning functionality to improve
correctness. SCons now honors scanner keys for implicit dependencies
and correctly changes scanner type (if necessary) when traversing
@@ -1237,5 +1267,5 @@ improve SCons for your needs.
Gary Oberbrunner and Bill Deegan, maintainers
Thanks to all the contributors for all your help!
-Copyright (c) 2001 - 2016 The SCons Foundation
-src/Announce.txt rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog
+Copyright (c) 2001 - 2017 The SCons Foundation
+src/Announce.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index b6ad719..ff28506 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -4,6 +4,121 @@
Change Log
+
+RELEASE 3.0.0 - Mon, 18 Sep 2017 08:32:04 -0700
+
+NOTE: This is a major release. You should expect that some targets may rebuild when upgrading.
+Significant changes in some python action signatures. Also switching between PY 2.7 and PY 3.5, 3.6
+will cause rebuilds.
+
+
+ From William Blevins:
+ - Updated D language scanner support to latest: 2.071.1. (PR #1924)
+ https://dlang.org/spec/module.html accessed 11 August 2016
+ - Enhancements:
+ - Added support for selective imports: "import A : B, C;" -> A
+ - Added support for renamed imports. "import B = A;" -> A
+ - Supports valid combinations: "import A, B, CCC = C, DDD = D : EEE = FFF;" -> A, B, C, D
+ - Notes:
+ - May find new (previously missed) Dlang dependencies.
+ - May cause rebuild after upgrade due to dependency changes.
+ - Updated Fortran-related tests to pass under GCC 5/6.
+ - Fixed SCons.Tool.Packaging.rpm.package source nondeterminism across builds.
+
+ From William Deegan:
+ - Removed deprecated tools CVS, Perforce, BitKeeper, RCS, SCCS, Subversion.
+ - Removed deprecated module SCons.Sig
+ - Added prioritized list of xsltproc tools to docbook. The order will now be as
+ follows: xsltproc, saxon, saxon-xslt, xalan (with first being highest priority, first
+ tool found is used)
+ - Fixed MSVSProject example code (http://scons.tigris.org/issues/show_bug.cgi?id=2979)
+ - Defined MS SDK 10.0 and Changed VS 2015 to use SDK 10.0
+ - Changes to Action Function and Action Class signiture creation. NOTE: This will cause rebuilds
+ for many builds when upgrading to SCons 3.0
+ - Fixed Bug #3027 - "Cross Compiling issue: cannot override ranlib"
+ - Fixed Bug #3020 - "Download link in user guide wrong. python setup.py install --version-lib broken"
+ - Fixed Bug #2486 - Added SetOption('silent',True) - Previously this value was not allowed to be set.
+ - Fixed Bug #3040 - Non-unicode character in CHANGES.txt
+ - Fixed Bug #2622 - AlwaysBuild + MSVC regression.
+ - Fixed Bug #3025 - (Credit to Florian : User flow86 on tigris) - Fix typo JAVACLASSSUFIX should have been
+ JAVACLASSSUFFIX
+
+
+ From Ibrahim Esmat:
+ - Added the capability to build Windows Store Compatible libraries that can be used
+ with Universal Windows Platform (UWP) Apps and published to the store
+
+ From Daniel Holth:
+ - Add basic support for PyPy (by deleting __slots__ from Node with a
+ metaclass on PyPy); wrap most-used open() calls in 'with' statements to
+ avoid too many open files.
+ - Add __main__.py for `python -m SCons` in case it is on PYTHONPATH.
+ - Always use highest available pickle protocol for efficiency.
+ - Remove unused command line fallback for the zip tool.
+
+ From Gaurav Juvekar:
+ - Fix issue #2832: Expand construction variables in 'chdir' argument of builders. (PR #463)
+ - Fix issue #2910: Make --tree=all handle Unicode. (PR #427)
+ - Fix issue #2788: Fix typo in documentation example for sconf. (PR #388)
+
+ From Alexey Klimkin:
+ - Use memoization to optimize PATH evaluation across all dependencies per
+ node. (PR #345)
+ - Use set() where it is applicable (PR #344)
+
+ From M. Limber:
+ - Fixed msvs.py for Visual Studio Express editions that would report
+ "Error : ValueError: invalid literal for float(): 10.0Exp".
+
+ From Rick Lupton:
+ - Update LaTeX scanner to understand \import and related commands
+
+ From Steve Robinson:
+ - Add support for Visual Studio 2017. This support requires vswhere.exe a helper
+ tool installed with newer installs of 2017. SCons expects it to be located at
+ "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
+ It can be downloaded separately at
+ https://github.com/Microsoft/vswhere
+
+ From Tom Tanner:
+ - Allow nested $( ... $) sections
+
+ From Paweł Tomulik:
+ - Fixed the issue with LDMODULEVERSIONFLAGS reported by Tim Jenness
+ (https://pairlist4.pair.net/pipermail/scons-users/2016-May/004893.html).
+ An error was causing "-Wl,Bsymbolic" being added to linker's command-line
+ even when there was no specified value in LDMODULEVERSION and thus no
+ need for the flags to be specified.
+ - Added LoadableModule to the list of global functions (DefaultEnvironment
+ builders).
+
+ From Manish Vachharajani:
+ - Update debian rules, compat, and control to not use features
+ deprecated or obsolete in later versions of debhelpers
+ - Update python version to 2.7 in debian/control
+
+ From Richard Viney:
+ - Fixed PCHPDBFLAGS causing a deprecation warning on MSVC v8 and later when
+ using PCHs and PDBs together.
+
+
+ From Richard West:
+ - Added nested / namespace tool support
+ - Added a small fix to the python3 tool loader when loading a tool as a package
+ - Added additional documentation to the user manual on using toolpaths with the environment
+ This includes the use of sys.path to search for tools installed via pip or package managers
+ - Added support for a PyPackageDir function for use with the toolpath
+
+ From Russel Winder:
+ - Reordered the default D tools from "dmd, gdc, ldc" to "dmd, ldc, gdc".
+ - Add a ProgramAllAtOnce builder to the dmd, ldc, and gdc tools. (PR #448)
+ - Remove a file name exception for very old Fedora LDC installation.
+ - gdc can now handle building shared objects (tested for version 6.3.0).
+ - Remove establishing the SharedLibrary builder in the dmd, ldc, and gdc
+ tools, must now include the ar tool to get this builder as is required for
+ other compiler tools.
+ - Add clang and clang++ tools based on Paweł Tomulik's work.
+
RELEASE 2.5.1 - Mon, 03 Nov 2016 13:37:42 -0400
From William Deegan:
@@ -13,7 +128,6 @@ RELEASE 2.5.1 - Mon, 03 Nov 2016 13:37:42 -0400
- Use memoization to optimize PATH evaluation across all dependencies per
node. (PR #345)
-
RELEASE 2.5.0 - Mon, 09 Apr 2016 11:27:42 -0700
From Dirk Baechle:
@@ -88,7 +202,7 @@ RELEASE 2.4.1 - Mon, 07 Nov 2015 10:37:21 -0700
and continuing.
From Hiroaki Itoh :
- - Add support `Microsoft Visual C++ Compiler for Python 2.7'
+ - Add support `Microsoft Visual C++ Compiler for Python 2.7'
Compiler can be obtained at: https://www.microsoft.com/en-us/download/details.aspx?id=44266
From Florian Miedniak:
@@ -215,6 +329,9 @@ RELEASE 2.3.3 - Sun, 24 Aug 2014 21:08:33 -0400
From Russel Winder:
- Fix regression on Windows in D language update
+ From Neal Becker and Stefan Zimmermann:
+ - Python 3 port and compatibility
+
From Anatoly Techtonik:
- Do not fail on EnsureSConsVersion when running from checkout
@@ -237,34 +354,40 @@ RELEASE 2.3.3 - Sun, 24 Aug 2014 21:08:33 -0400
RELEASE 2.3.2
+ From Dirk Baechle:
+ - Update XML doc editor configuration
+ - Fix: Allow varlist to be specified as list of strings for Actions (#2754)
+
From veon on bitbucket:
- Fixed handling of nested ifs in CPP scanner PreProcessor class.
+ From Shane Gannon:
+ - Support for Visual Studio 2013 (12.0)
+
From Michael Haubenwallner:
- Respect user's CC/CXX values; don't always overwrite in generate()
- Delegate linker Tool.exists() to CC/CXX Tool.exists().
+ From Rob Managan:
+ - Updated the TeX builder to support use of the -synctex=1
+ option and the files it creates.
+ - Updated the TeX builder to correctly clean auxiliary files when
+ the biblatex package is used.
+
+ From Gary Oberbrunner:
+ - get default RPM architecture more robustly when building RPMs
+
From Amir Szekely:
- Fixed NoClean() for multi-target builders (#2353).
+ From Paweł Tomulik:
+ - Fix SConf tests that write output
+
From Russel Winder:
- Revamp of the D language support. Tools for DMD, GDC and LDC provided
and integrated with the C and C++ linking. NOTE: This is only tested
with D v2. Support for D v1 is now deprecated.
- From Paweł Tomulik:
- - Fix SConf tests that write output
-
- From Gary Oberbrunner:
- - get default RPM architecture more robustly when building RPMs
-
- From Shane Gannon:
- - Support for Visual Studio 2013 (12.0)
-
- From Sye van der Veen:
- - Support for Visual Studio 12.0Exp, and fixes for earlier MSVS
- versions.
-
From Anatoly Techtonik:
- Several improvements for running scons.py from source:
* engine files form source directory take priority over all other
@@ -279,15 +402,10 @@ RELEASE 2.3.2
SCons initialization (it will still be possible to use these tools
explicitly)
- From Dirk Baechle:
- - Update XML doc editor configuration
- - Fix: Allow varlist to be specified as list of strings for Actions (#2754)
+ From Sye van der Veen:
+ - Support for Visual Studio 12.0Exp, and fixes for earlier MSVS
+ versions.
- From Rob Managan:
- - Updated the TeX builder to support use of the -synctex=1
- option and the files it creates.
- - Updated the TeX builder to correctly clean auxiliary files when
- the biblatex package is used.
RELEASE 2.3.1
@@ -6019,5 +6137,5 @@ A brief overview of important functionality available in release 0.01:
-Copyright (c) 2001 - 2016 The SCons Foundation
-src/CHANGES.txt rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog
+Copyright (c) 2001 - 2017 The SCons Foundation
+src/CHANGES.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog
diff --git a/src/LICENSE.txt b/src/LICENSE.txt
index c730cc2..ff04f2e 100644
--- a/src/LICENSE.txt
+++ b/src/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 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/README.txt b/src/README.txt
index 0a2a53a..ffba407 100644
--- a/src/README.txt
+++ b/src/README.txt
@@ -2,7 +2,7 @@
SCons - a software construction tool
- Version 2.5.1
+ Version 3.0.0
This is SCons, a tool for building software (and other files). SCons is
@@ -57,7 +57,7 @@ provided Python-standard setup script as follows:
By default, the above command will do the following:
- -- Install the version-numbered "scons-2.5.1" and "sconsign-2.5.1"
+ -- Install the version-numbered "scons-3.0.0" and "sconsign-3.0.0"
scripts in the default system script directory (/usr/bin or
C:\Python*\Scripts, for example). This can be disabled by
specifying the "--no-version-script" option on the command
@@ -71,17 +71,17 @@ By default, the above command will do the following:
making it the default on your system.
On UNIX or Linux systems, you can have the "scons" and "sconsign"
- scripts be hard links or symbolic links to the "scons-2.5.1" and
- "sconsign-2.5.1" scripts by specifying the "--hardlink-scons"
+ scripts be hard links or symbolic links to the "scons-3.0.0" and
+ "sconsign-3.0.0" scripts by specifying the "--hardlink-scons"
or "--symlink-scons" options on the command line.
- -- Install "scons-2.5.1.bat" and "scons.bat" wrapper scripts in the
+ -- Install "scons-3.0.0.bat" and "scons.bat" wrapper scripts in the
Python prefix directory on Windows (C:\Python*, for example).
This can be disabled by specifying the "--no-install-bat" option
on the command line.
On UNIX or Linux systems, the "--install-bat" option may be
- specified to have "scons-2.5.1.bat" and "scons.bat" files
+ specified to have "scons-3.0.0.bat" and "scons.bat" files
installed in the default system script directory, which is useful
if you want to install SCons in a shared file system directory
that can be used to execute SCons from both UNIX/Linux and
@@ -89,7 +89,7 @@ By default, the above command will do the following:
-- Install the SCons build engine (a Python module) in an
appropriate version-numbered SCons library directory
- (/usr/lib/scons-2.5.1 or C:\Python*\scons-2.5.1, for example).
+ (/usr/lib/scons-3.0.0 or C:\Python*\scons-3.0.0, for example).
See below for more options related to installing the build
engine library.
diff --git a/src/RELEASE.txt b/src/RELEASE.txt
index 28eb577..82a0c5a 100644
--- a/src/RELEASE.txt
+++ b/src/RELEASE.txt
@@ -1,48 +1,51 @@
- A new SCons checkpoint release, 2.5.1, is now available
+ A new SCons checkpoint release, 3.0.0, is now available
on the SCons download page:
http://www.scons.org/download.php
- This is a minor release
- Here is a summary of the changes since 2.5.0:
+ Here is a summary of the changes since 2.5.1:
NEW FUNCTIONALITY
- - None
+ - Initial support for Python 3.5+
+ - I
DEPRECATED FUNCTIONALITY
- - None
+ - List anything that's been deprecated since the last release
CHANGED/ENHANCED EXISTING FUNCTIONALITY
- - None
+ - List modifications to existing features, where the previous behavior
+ wouldn't actually be considered a bug
FIXES
- - None
+ - List fixes of outright bugs
IMPROVEMENTS
- - Use memoization to optimize PATH evaluation across all dependencies per
- node. (PR #345) This should fix some performance degredation due to
- changes to enable enhanced multi-language scanning added in 2.5.0
+ - List improvements that wouldn't be visible to the user in the
+ documentation: performance improvements (describe the circumstances
+ under which they would be observed), or major code cleanups
PACKAGING
- - Fixed missing scons-configure-cache.py. (It was accidently omitted)
+ - List changes in the way SCons is packaged and/or released
DOCUMENTATION
- - None
+ - List any significant changes to the documentation (not individual
+ typo fixes, even if they're mentioned in src/CHANGES.txt to give
+ the contributor credit)
DEVELOPMENT
- - None
+ - List visible changes in the way SCons is developed
- Thanks to William Deegan and Alexey Klimkin for their contributions to this release.
+ Thanks to CURLY, LARRY, and MOE for their contributions to this release.
Contributors are listed alphabetically by their last name.
-Copyright (c) 2001 - 2016 The SCons Foundation
-src/RELEASE.txt rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog
+Copyright (c) 2001 - 2017 The SCons Foundation
+src/RELEASE.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog
diff --git a/src/engine/MANIFEST-xml.in b/src/engine/MANIFEST-xml.in
index a657734..cfbfd3a 100644
--- a/src/engine/MANIFEST-xml.in
+++ b/src/engine/MANIFEST-xml.in
@@ -4,4 +4,5 @@ SCons/Scanner/__init__.xml
SCons/Script/*.xml
SCons/Tool/*.xml
SCons/Tool/docbook/__init__.xml
+SCons/Tool/docbook/utils/xmldepend.xsl
SCons/Tool/packaging/__init__.xml
diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in
index f7d5aa7..2df278e 100644
--- a/src/engine/MANIFEST.in
+++ b/src/engine/MANIFEST.in
@@ -47,12 +47,12 @@ SCons/Script/Interactive.py
SCons/Script/Main.py
SCons/Script/SConscript.py
SCons/Script/SConsOptions.py
-SCons/Sig.py
SCons/Subst.py
SCons/Taskmaster.py
SCons/Tool/__init__.py
SCons/Tool/386asm.py
SCons/Tool/aixc++.py
+SCons/Tool/aixcxx.py
SCons/Tool/aixcc.py
SCons/Tool/aixf77.py
SCons/Tool/aixlink.py
@@ -60,12 +60,13 @@ SCons/Tool/applelink.py
SCons/Tool/ar.py
SCons/Tool/as.py
SCons/Tool/bcc32.py
-SCons/Tool/BitKeeper.py
SCons/Tool/c++.py
+SCons/Tool/cxx.py
SCons/Tool/cc.py
SCons/Tool/cyglink.py
+SCons/Tool/clang.py
+SCons/Tool/clangxx.py
SCons/Tool/cvf.py
-SCons/Tool/CVS.py
SCons/Tool/DCommon.py
SCons/Tool/default.py
SCons/Tool/dmd.py
@@ -73,14 +74,16 @@ SCons/Tool/docbook/__init__.py
SCons/Tool/dvi.py
SCons/Tool/dvipdf.py
SCons/Tool/dvips.py
+SCons/Tool/f03.py
+SCons/Tool/f08.py
SCons/Tool/f77.py
SCons/Tool/f90.py
SCons/Tool/f95.py
-SCons/Tool/f03.py
SCons/Tool/filesystem.py
SCons/Tool/fortran.py
SCons/Tool/FortranCommon.py
SCons/Tool/g++.py
+SCons/Tool/gxx.py
SCons/Tool/g77.py
SCons/Tool/gas.py
SCons/Tool/gcc.py
@@ -89,6 +92,7 @@ SCons/Tool/gfortran.py
SCons/Tool/gnulink.py
SCons/Tool/gs.py
SCons/Tool/hpc++.py
+SCons/Tool/hpcxx.py
SCons/Tool/hpcc.py
SCons/Tool/hplink.py
SCons/Tool/icc.py
@@ -132,22 +136,20 @@ SCons/Tool/packaging/*.py
SCons/Tool/pdf.py
SCons/Tool/pdflatex.py
SCons/Tool/pdftex.py
-SCons/Tool/Perforce.py
SCons/Tool/PharLapCommon.py
SCons/Tool/qt.py
-SCons/Tool/RCS.py
SCons/Tool/rmic.py
SCons/Tool/rpcgen.py
SCons/Tool/rpm.py
SCons/Tool/rpmutils.py
-SCons/Tool/SCCS.py
SCons/Tool/sgiar.py
SCons/Tool/sgic++.py
+SCons/Tool/sgicxx.py
SCons/Tool/sgicc.py
SCons/Tool/sgilink.py
-SCons/Tool/Subversion.py
SCons/Tool/sunar.py
SCons/Tool/sunc++.py
+SCons/Tool/suncxx.py
SCons/Tool/suncc.py
SCons/Tool/sunf77.py
SCons/Tool/sunf90.py
@@ -170,7 +172,7 @@ SCons/Variables/PackageVariable.py
SCons/Variables/PathVariable.py
SCons/Warnings.py
SCons/Tool/GettextCommon.py
-SCons/Tool/gettext.py
+SCons/Tool/gettext_tool.py
SCons/Tool/msgfmt.py
SCons/Tool/msginit.py
SCons/Tool/msgmerge.py
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index 00b2909..97040a4 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/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 - 2017 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,15 @@ 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Action.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-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
import SCons.Debug
from SCons.Debug import logInstanceCreation
@@ -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,62 +220,174 @@ 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[1:]]
+ 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 )
+
+
+ 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.func_code)]
+ 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 = []
+
+ contents.append(b',(')
+ contents.append(bytearray(b',').join(closure_contents))
+ contents.append(b')')
- return ''.join(contents)
+ 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.
# Mainly, it handles ListActions by concatenating into
@@ -305,6 +409,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 +437,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 +468,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 +490,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 +505,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 +514,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 +532,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 +551,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 +592,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 +626,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 +734,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 +759,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':
@@ -664,12 +804,12 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw):
try:
return subprocess.Popen(cmd, **kw)
- except EnvironmentError, e:
+ 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):
@@ -679,6 +819,7 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw):
stdout = stderr = f()
return dummyPopen(e)
+
class CommandAction(_ActionAction):
"""Class for command-execution actions."""
def __init__(self, cmd, **kw):
@@ -695,7 +836,7 @@ class CommandAction(_ActionAction):
_ActionAction.__init__(self, **kw)
if is_List(cmd):
- if list(filter(is_List, cmd)):
+ if [c for c in cmd if is_List(c)]:
raise TypeError("CommandAction should be given only " \
"a single command")
self.cmd_list = cmd
@@ -845,6 +986,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 +1058,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 +1155,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 +1195,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 +1229,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 +1268,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):
@@ -1153,6 +1295,7 @@ class ListAction(ActionBase):
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 +1314,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 +1349,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 +1366,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/engine/SCons/Action.xml b/src/engine/SCons/Action.xml
index 3b35a1a..99f4e86 100644
--- a/src/engine/SCons/Action.xml
+++ b/src/engine/SCons/Action.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py
index 616c949..ed2412b 100644
--- a/src/engine/SCons/ActionTests.py
+++ b/src/engine/SCons/ActionTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/ActionTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/ActionTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
# Define a null function and a null class for use as builder actions.
# Where these are defined in the file seems to affect their byte-code
@@ -61,7 +61,7 @@ test = TestCmd.TestCmd(workdir = '')
test.write('act.py', """\
import os, string, sys
f = open(sys.argv[1], 'w')
-f.write("act.py: '" + string.join(sys.argv[2:], "' '") + "'\\n")
+f.write("act.py: '" + "' '".join(sys.argv[2:]) + "'\\n")
try:
if sys.argv[3]:
f.write("act.py: '" + os.environ[sys.argv[3]] + "'\\n")
@@ -231,7 +231,7 @@ def test_positional_args(pos_callback, cmd, **kw):
"""
act = SCons.Action.Action(cmd, **kw)
pos_callback(act)
- assert act.varlist is (), act.varlist
+ assert act.varlist == (), act.varlist
if not isinstance(act, SCons.Action._ActionAction):
# only valid cmdstrfunc is None
@@ -265,7 +265,7 @@ def test_positional_args(pos_callback, cmd, **kw):
"""Test handling of bad cmdstrfunc arguments """
try:
a = SCons.Action.Action(cmd, [], **kw)
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
s = str(e)
m = 'Invalid command display variable'
assert s.find(m) != -1, 'Unexpected string: %s' % s
@@ -316,7 +316,7 @@ class ActionTestCase(unittest.TestCase):
"""
a1 = SCons.Action.Action(["x", "y", "z", [ "a", "b", "c"]])
assert isinstance(a1, SCons.Action.ListAction), a1
- assert a1.varlist is (), a1.varlist
+ assert a1.varlist == (), a1.varlist
assert isinstance(a1.list[0], SCons.Action.CommandAction), a1.list[0]
assert a1.list[0].cmd_list == "x", a1.list[0].cmd_list
assert isinstance(a1.list[1], SCons.Action.CommandAction), a1.list[1]
@@ -328,7 +328,7 @@ class ActionTestCase(unittest.TestCase):
a2 = SCons.Action.Action("x\ny\nz")
assert isinstance(a2, SCons.Action.ListAction), a2
- assert a2.varlist is (), a2.varlist
+ assert a2.varlist == (), a2.varlist
assert isinstance(a2.list[0], SCons.Action.CommandAction), a2.list[0]
assert a2.list[0].cmd_list == "x", a2.list[0].cmd_list
assert isinstance(a2.list[1], SCons.Action.CommandAction), a2.list[1]
@@ -341,7 +341,7 @@ class ActionTestCase(unittest.TestCase):
a3 = SCons.Action.Action(["x", foo, "z"])
assert isinstance(a3, SCons.Action.ListAction), a3
- assert a3.varlist is (), a3.varlist
+ assert a3.varlist == (), a3.varlist
assert isinstance(a3.list[0], SCons.Action.CommandAction), a3.list[0]
assert a3.list[0].cmd_list == "x", a3.list[0].cmd_list
assert isinstance(a3.list[1], SCons.Action.FunctionAction), a3.list[1]
@@ -351,7 +351,7 @@ class ActionTestCase(unittest.TestCase):
a4 = SCons.Action.Action(["x", "y"], strfunction=foo)
assert isinstance(a4, SCons.Action.ListAction), a4
- assert a4.varlist is (), a4.varlist
+ assert a4.varlist == (), a4.varlist
assert isinstance(a4.list[0], SCons.Action.CommandAction), a4.list[0]
assert a4.list[0].cmd_list == "x", a4.list[0].cmd_list
assert a4.list[0].strfunction == foo, a4.list[0].strfunction
@@ -361,7 +361,7 @@ class ActionTestCase(unittest.TestCase):
a5 = SCons.Action.Action("x\ny", strfunction=foo)
assert isinstance(a5, SCons.Action.ListAction), a5
- assert a5.varlist is (), a5.varlist
+ assert a5.varlist == (), a5.varlist
assert isinstance(a5.list[0], SCons.Action.CommandAction), a5.list[0]
assert a5.list[0].cmd_list == "x", a5.list[0].cmd_list
assert a5.list[0].strfunction == foo, a5.list[0].strfunction
@@ -488,7 +488,7 @@ class _ActionActionTestCase(unittest.TestCase):
def func(): pass
try:
a = SCons.Action.Action('foo', cmdstr='string', strfunction=func)
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
s = str(e)
m = 'Cannot have both strfunction and cmdstr args to Action()'
assert s.find(m) != -1, 'Unexpected string: %s' % s
@@ -556,7 +556,7 @@ class _ActionActionTestCase(unittest.TestCase):
assert isinstance(source, list), type(source)
return 9
b = SCons.Action.Action([firstfunc, execfunc, lastfunc])
-
+
sio = io.StringIO()
sys.stdout = sio
result = a("out", "in", env)
@@ -699,7 +699,7 @@ class _ActionActionTestCase(unittest.TestCase):
env['PRINT_CMD_LINE_FUNC'] = my_print_cmd_line
a("output", "input", env)
assert result == ["execfunc(['output'], ['input'])"], result
-
+
finally:
sys.stdout = save_stdout
@@ -942,7 +942,7 @@ class CommandActionTestCase(unittest.TestCase):
act = SCons.Action.CommandAction('xyzzy $TARGETS $SOURCES',
cmdstr='cmdstr\t$TARGETS\n$SOURCES ')
-
+
s = act.strfunction([], [], env)
assert s == 'cmdstr\t\n ', s
s = act.strfunction([t1], [s1], env)
@@ -1241,12 +1241,12 @@ class CommandActionTestCase(unittest.TestCase):
(env["foo"], env["bar"])
# The number 1 is there to make sure all args get converted to strings.
- a = SCons.Action.CommandAction(["|", "$(", "$foo", "|", "$bar",
- "$)", "|", "$baz", 1])
+ a = SCons.Action.CommandAction(["|", "$(", "$foo", "|", "$(", "$bar",
+ "$)", "stuff", "$)", "|", "$baz", 1])
c = a.get_contents(target=[], source=[],
env=Environment(foo = 'FFF', bar = 'BBB',
baz = CmdGen))
- assert c == "| | FFF BBB 1", c
+ assert c == b"| | FFF BBB 1", c
# Make sure that CommandActions use an Environment's
# subst_target_source() method for substitution.
@@ -1257,7 +1257,7 @@ class CommandActionTestCase(unittest.TestCase):
c = a.get_contents(target=DummyNode('ttt'), source = DummyNode('sss'),
env=SpecialEnvironment(foo = 'GGG', bar = 'CCC',
baz = 'ZZZ'))
- assert c == 'subst_target_source: | $( $foo | $bar $) | $baz 1', c
+ assert c == b'subst_target_source: | $( $foo | $( $bar $) stuff $) | $baz 1', c
# We've discussed using the real target and source names in a
# CommandAction's signature contents. This would have have the
@@ -1274,35 +1274,35 @@ class CommandActionTestCase(unittest.TestCase):
a = SCons.Action.CommandAction(["$TARGET"])
c = a.get_contents(target=t, source=s, env=env)
- assert c == "t1", c
+ assert c == b"t1", c
a = SCons.Action.CommandAction(["$TARGETS"])
c = a.get_contents(target=t, source=s, env=env)
- assert c == "t1 t2 t3 t4 t5 t6", c
+ assert c == b"t1 t2 t3 t4 t5 t6", c
a = SCons.Action.CommandAction(["${TARGETS[2]}"])
c = a.get_contents(target=t, source=s, env=env)
- assert c == "t3", c
+ assert c == b"t3", c
a = SCons.Action.CommandAction(["${TARGETS[3:5]}"])
c = a.get_contents(target=t, source=s, env=env)
- assert c == "t4 t5", c
+ assert c == b"t4 t5", c
a = SCons.Action.CommandAction(["$SOURCE"])
c = a.get_contents(target=t, source=s, env=env)
- assert c == "s1", c
+ assert c == b"s1", c
a = SCons.Action.CommandAction(["$SOURCES"])
c = a.get_contents(target=t, source=s, env=env)
- assert c == "s1 s2 s3 s4 s5 s6", c
+ assert c == b"s1 s2 s3 s4 s5 s6", c
a = SCons.Action.CommandAction(["${SOURCES[2]}"])
c = a.get_contents(target=t, source=s, env=env)
- assert c == "s3", c
+ assert c == b"s3", c
a = SCons.Action.CommandAction(["${SOURCES[3:5]}"])
c = a.get_contents(target=t, source=s, env=env)
- assert c == "s4 s5", c
+ assert c == b"s4 s5", c
class CommandGeneratorActionTestCase(unittest.TestCase):
@@ -1419,7 +1419,7 @@ class CommandGeneratorActionTestCase(unittest.TestCase):
ignore = 'foo', test=test)
a = self.factory(f)
c = a.get_contents(target=[], source=[], env=env)
- assert c == "guux FFF BBB test", c
+ assert c == b"guux FFF BBB test", c
def test_get_contents_of_function_action(self):
"""Test contents of a CommandGeneratorAction-generated FunctionAction
@@ -1428,14 +1428,16 @@ class CommandGeneratorActionTestCase(unittest.TestCase):
def LocalFunc():
pass
- func_matches = [
- "0,0,0,0,(),(),(d\000\000S),(),()",
- "0,0,0,0,(),(),(d\x00\x00S),(),()",
- ]
-
+ # Since the python bytecode has per version differences, we need different expected results per version
+ func_matches = {
+ (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
+ }
+
meth_matches = [
- "1,1,0,0,(),(),(d\000\000S),(),()",
- "1,1,0,0,(),(),(d\x00\x00S),(),()",
+ b"1, 1, 0, 0,(),(),(d\000\000S),(),()",
+ b"1, 1, 0, 0,(),(),(d\x00\x00S),(),()",
]
def f_global(target, source, env, for_signature):
@@ -1448,11 +1450,11 @@ class CommandGeneratorActionTestCase(unittest.TestCase):
a = self.factory(f_global)
c = a.get_contents(target=[], source=[], env=env)
- assert c in func_matches, repr(c)
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+repr(func_matches[sys.version_info[:2]])
a = self.factory(f_local)
c = a.get_contents(target=[], source=[], env=env)
- assert c in func_matches, repr(c)
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+repr(func_matches[sys.version_info[:2]])
def f_global(target, source, env, for_signature):
return SCons.Action.Action(GlobalFunc, varlist=['XYZ'])
@@ -1460,7 +1462,7 @@ class CommandGeneratorActionTestCase(unittest.TestCase):
def f_local(target, source, env, for_signature):
return SCons.Action.Action(LocalFunc, varlist=['XYZ'])
- matches_foo = [x + "foo" for x in func_matches]
+ matches_foo = func_matches[sys.version_info[:2]] + b'foo'
a = self.factory(f_global)
c = a.get_contents(target=[], source=[], env=env)
@@ -1533,7 +1535,8 @@ class FunctionActionTestCase(unittest.TestCase):
global count
count = count + 1
for t in target:
- open(t, 'w').write("function1\n")
+ with open(t, 'w') as f:
+ f.write("function1\n")
return 1
act = SCons.Action.FunctionAction(function1, {})
@@ -1548,7 +1551,8 @@ class FunctionActionTestCase(unittest.TestCase):
class class1a(object):
def __init__(self, target, source, env):
- open(env['out'], 'w').write("class1a\n")
+ with open(env['out'], 'w') as f:
+ f.write("class1a\n")
act = SCons.Action.FunctionAction(class1a, {})
r = act([], [], Environment(out = outfile))
@@ -1558,7 +1562,8 @@ class FunctionActionTestCase(unittest.TestCase):
class class1b(object):
def __call__(self, target, source, env):
- open(env['out'], 'w').write("class1b\n")
+ with open(env['out'], 'w') as f:
+ f.write("class1b\n")
return 2
act = SCons.Action.FunctionAction(class1b(), {})
@@ -1587,49 +1592,57 @@ class FunctionActionTestCase(unittest.TestCase):
def LocalFunc():
pass
- func_matches = [
- "0,0,0,0,(),(),(d\000\000S),(),()",
- "0,0,0,0,(),(),(d\x00\x00S),(),()",
- ]
-
- meth_matches = [
- "1,1,0,0,(),(),(d\000\000S),(),()",
- "1,1,0,0,(),(),(d\x00\x00S),(),()",
- ]
+ func_matches = {
+ (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
+ }
+
+ meth_matches = {
+ (2,7) : bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,5) : bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,6) : bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'),
+ }
def factory(act, **kw):
return SCons.Action.FunctionAction(act, kw)
a = factory(GlobalFunc)
c = a.get_contents(target=[], source=[], env=Environment())
- assert c in func_matches, repr(c)
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]])
+
a = factory(LocalFunc)
c = a.get_contents(target=[], source=[], env=Environment())
- assert c in func_matches, repr(c)
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]])
- matches_foo = [x + "foo" for x in func_matches]
+ matches_foo = func_matches[sys.version_info[:2]] + b'foo'
a = factory(GlobalFunc, varlist=['XYZ'])
c = a.get_contents(target=[], source=[], env=Environment())
- assert c in func_matches, repr(c)
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]])
+ # assert c in func_matches, repr(c)
+
c = a.get_contents(target=[], source=[], env=Environment(XYZ='foo'))
- assert c in matches_foo, repr(c)
+ assert c == matches_foo, repr(c)
##TODO: is this set of tests still needed?
# Make sure a bare string varlist works
a = factory(GlobalFunc, varlist='XYZ')
c = a.get_contents(target=[], source=[], env=Environment())
- assert c in func_matches, repr(c)
+ # assert c in func_matches, repr(c)
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]])
+
+
c = a.get_contents(target=[], source=[], env=Environment(XYZ='foo'))
assert c in matches_foo, repr(c)
class Foo(object):
def get_contents(self, target, source, env):
- return 'xyzzy'
+ return b'xyzzy'
a = factory(Foo())
c = a.get_contents(target=[], source=[], env=Environment())
- assert c == 'xyzzy', repr(c)
+ assert c == b'xyzzy', repr(c)
class LocalClass(object):
def LocalMethod(self):
@@ -1637,7 +1650,7 @@ class FunctionActionTestCase(unittest.TestCase):
lc = LocalClass()
a = factory(lc.LocalMethod)
c = a.get_contents(target=[], source=[], env=Environment())
- assert c in meth_matches, repr(c)
+ assert c == meth_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(meth_matches[sys.version_info[:2]])
def test_strfunction(self):
"""Test the FunctionAction.strfunction() method
@@ -1710,17 +1723,20 @@ class ListActionTestCase(unittest.TestCase):
cmd2 = r'%s %s %s syzygy' % (_python_, act_py, outfile)
def function2(target, source, env):
- open(env['out'], 'a').write("function2\n")
+ with open(env['out'], 'a') as f:
+ f.write("function2\n")
return 0
class class2a(object):
def __call__(self, target, source, env):
- open(env['out'], 'a').write("class2a\n")
+ with open(env['out'], 'a') as f:
+ f.write("class2a\n")
return 0
class class2b(object):
def __init__(self, target, source, env):
- open(env['out'], 'a').write("class2b\n")
+ with open(env['out'], 'a') as f:
+ f.write("class2b\n")
act = SCons.Action.ListAction([cmd2, function2, class2a(), class2b])
r = act([], [], Environment(out = outfile))
assert isinstance(r.status, class2b), r.status
@@ -1740,7 +1756,7 @@ class ListActionTestCase(unittest.TestCase):
"z"])
c = a.get_contents(target=[], source=[], env=Environment(s = self))
assert self.foo==1, self.foo
- assert c == "xyz", c
+ assert c == b"xyz", c
class LazyActionTestCase(unittest.TestCase):
def test___init__(self):
@@ -1791,7 +1807,7 @@ class LazyActionTestCase(unittest.TestCase):
a = SCons.Action.Action("${FOO}")
env = Environment(FOO = [["This", "is", "a", "test"]])
c = a.get_contents(target=[], source=[], env=env)
- assert c == "This is a test", c
+ assert c == b"This is a test", c
def test_get_contents_of_function_action(self):
"""Test fetching the contents of a lazy-evaluation FunctionAction
@@ -1800,14 +1816,16 @@ class LazyActionTestCase(unittest.TestCase):
def LocalFunc():
pass
- func_matches = [
- "0,0,0,0,(),(),(d\000\000S),(),()",
- "0,0,0,0,(),(),(d\x00\x00S),(),()",
- ]
-
+
+ func_matches = {
+ (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
+ }
+
meth_matches = [
- "1,1,0,0,(),(),(d\000\000S),(),()",
- "1,1,0,0,(),(),(d\x00\x00S),(),()",
+ b"1, 1, 0, 0,(),(),(d\000\000S),(),()",
+ b"1, 1, 0, 0,(),(),(d\x00\x00S),(),()",
]
def factory(act, **kw):
@@ -1818,22 +1836,28 @@ class LazyActionTestCase(unittest.TestCase):
env = Environment(FOO = factory(GlobalFunc))
c = a.get_contents(target=[], source=[], env=env)
- assert c in func_matches, repr(c)
+ # assert c in func_matches, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(f) for f in func_matches])
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]])
+
+
env = Environment(FOO = factory(LocalFunc))
c = a.get_contents(target=[], source=[], env=env)
- assert c in func_matches, repr(c)
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]])
+
+ # matches_foo = [x + b"foo" for x in func_matches]
+ matches_foo = func_matches[sys.version_info[:2]] + b'foo'
- matches_foo = [x + "foo" for x in func_matches]
env = Environment(FOO = factory(GlobalFunc, varlist=['XYZ']))
c = a.get_contents(target=[], source=[], env=env)
- assert c in func_matches, repr(c)
+ assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]])
env['XYZ'] = 'foo'
c = a.get_contents(target=[], source=[], env=env)
assert c in matches_foo, repr(c)
+
class ActionCallerTestCase(unittest.TestCase):
def test___init__(self):
"""Test creation of an ActionCaller"""
@@ -1850,25 +1874,23 @@ class ActionCallerTestCase(unittest.TestCase):
def LocalFunc():
pass
- matches = [
- "d\000\000S",
- "d\x00\x00S"
- ]
+
+ matches = {
+ (2,7) : b'd\x00\x00S',
+ (3,5) : b'd\x00\x00S',
+ (3,6) : b'd\x00S\x00',
+ }
+
af = SCons.Action.ActionFactory(GlobalFunc, strfunc)
ac = SCons.Action.ActionCaller(af, [], {})
c = ac.get_contents([], [], Environment())
- assert c in matches, repr(c)
+ assert c == matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(matches[sys.version_info[:2]])
af = SCons.Action.ActionFactory(LocalFunc, strfunc)
ac = SCons.Action.ActionCaller(af, [], {})
c = ac.get_contents([], [], Environment())
- assert c in matches, repr(c)
-
- matches = [
- 'd\000\000S',
- "d\x00\x00S"
- ]
+ assert c == matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(matches[sys.version_info[:2]])
class LocalActFunc(object):
def __call__(self):
@@ -1877,23 +1899,25 @@ class ActionCallerTestCase(unittest.TestCase):
af = SCons.Action.ActionFactory(GlobalActFunc(), strfunc)
ac = SCons.Action.ActionCaller(af, [], {})
c = ac.get_contents([], [], Environment())
- assert c in matches, repr(c)
+ assert c == matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(matches[sys.version_info[:2]])
af = SCons.Action.ActionFactory(LocalActFunc(), strfunc)
ac = SCons.Action.ActionCaller(af, [], {})
c = ac.get_contents([], [], Environment())
- assert c in matches, repr(c)
+ assert c == matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(matches[sys.version_info[:2]])
matches = [
- "<built-in function str>",
- "<type 'str'>",
+ b"<built-in function str>",
+ b"<type 'str'>",
]
af = SCons.Action.ActionFactory(str, strfunc)
ac = SCons.Action.ActionCaller(af, [], {})
c = ac.get_contents([], [], Environment())
assert c == "<built-in function str>" or \
- c == "<type 'str'>", repr(c)
+ c == "<type 'str'>" or \
+ c == "<class 'str'>", repr(c)
+ # ^^ class str for python3
def test___call__(self):
"""Test calling an ActionCaller"""
@@ -1999,21 +2023,85 @@ class ActionCompareTestCase(unittest.TestCase):
especially two builders that can generate the same suffix,
where one of the builders has a suffix dictionary with a None
key."""
-
+
foo = SCons.Builder.Builder(action = '$FOO', suffix = '.foo')
bar = SCons.Builder.Builder(action = {}, suffix={None:'.bar'})
bar.add_action('.cow', "$MOO")
dog = SCons.Builder.Builder(suffix = '.bar')
-
+
env = Environment( BUILDERS = {'FOO' : foo,
'BAR' : bar,
'DOG' : dog} )
-
+
assert foo.get_name(env) == 'FOO', foo.get_name(env)
assert bar.get_name(env) == 'BAR', bar.get_name(env)
assert dog.get_name(env) == 'DOG', dog.get_name(env)
+class TestClass(object):
+ """A test class used by ObjectContentsTestCase.test_object_contents"""
+ def __init__(self):
+ self.a = "a"
+ self.b = "b"
+ def method(self, arg):
+ pass
+
+
+class ObjectContentsTestCase(unittest.TestCase):
+
+ def test_function_contents(self):
+ """Test that Action._function_contents works"""
+
+ def func1(a, b, c):
+ """A test function"""
+ return a
+
+ # Since the python bytecode has per version differences, we need different expected results per version
+ expected = {
+ (2,7) : bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'),
+ (3,5) : bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'),
+ (3,6) : bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),
+ }
+
+ c = SCons.Action._function_contents(func1)
+ assert c == expected[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+"\n"+repr(expected[sys.version_info[:2]])
+
+
+ def test_object_contents(self):
+ """Test that Action._object_contents works"""
+
+ # See definition above
+ o = TestClass()
+ c = SCons.Action._object_contents(o)
+
+ # c = SCons.Action._object_instance_content(o)
+
+ # Since the python bytecode has per version differences, we need different expected results per version
+ expected = {
+ (2,7): bytearray(b"{TestClass:__main__}[[[(<type \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<type \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}"),
+ (3,5): bytearray(b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}"),
+ (3,6): bytearray(b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}"),
+ }
+
+ assert c == expected[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+"\n"+repr(expected[sys.version_info[:2]])
+
+ def test_code_contents(self):
+ """Test that Action._code_contents works"""
+
+ code = compile("print('Hello, World!')", '<string>', 'exec')
+ c = SCons.Action._code_contents(code)
+
+ # Since the python bytecode has per version differences, we need different expected results per version
+ expected = {
+ (2,7) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00GHd\x01\x00S)'),
+ (3,5) : bytearray(b'0, 0, 0, 0,(N.),(print),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)'),
+ (3,6) : bytearray(b'0, 0, 0, 0,(N.),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'),
+ }
+
+ assert c == expected[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+"\n"+expected[sys.version_info[:2]]
+
+
+
if __name__ == "__main__":
suite = unittest.TestSuite()
tclasses = [ _ActionActionTestCase,
@@ -2025,13 +2113,17 @@ if __name__ == "__main__":
LazyActionTestCase,
ActionCallerTestCase,
ActionFactoryTestCase,
- ActionCompareTestCase ]
+ ActionCompareTestCase,
+ ObjectContentsTestCase ]
for tclass in tclasses:
names = unittest.getTestCaseNames(tclass, 'test_')
suite.addTests(list(map(tclass, names)))
TestUnit.run(suite)
+ # Swap this for above to debug otherwise you can't run individual tests as TestUnit is swallowing arguments
+ # unittest.main()
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py
index 6bc5c92..9cb0f86 100644
--- a/src/engine/SCons/Builder.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Builder.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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)
@@ -299,7 +300,7 @@ 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)
+ 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'))
raise UserError(msg)
if builder.multi:
if t.builder != builder:
@@ -344,8 +345,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 +427,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 +447,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 +611,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/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py
index c2a8ad6..edc4ca8 100644
--- a/src/engine/SCons/BuilderTests.py
+++ b/src/engine/SCons/BuilderTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/BuilderTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/BuilderTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -145,8 +146,8 @@ class Environment(object):
d['SOURCES'] = ['__s1__', '__s2__', '__s3__', '__s4__', '__s5__', '__s6__']
d['SOURCE'] = d['SOURCES'][0]
return d
- def __cmp__(self, other):
- return cmp(self.scanner, other.scanner) or cmp(self.d, other.d)
+ def __eq__(self, other):
+ return self.scanner == other.scanner or self.d == other.d
class MyAction(object):
def __init__(self, action):
@@ -327,7 +328,7 @@ class BuilderTestCase(unittest.TestCase):
flag = 0
try:
target = builder(env, None, source=n20)
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
flag = 1
assert flag, "UserError should be thrown if a source node can't create a target."
@@ -343,7 +344,7 @@ class BuilderTestCase(unittest.TestCase):
suffix = '.s')
try:
builder(env, target = 'n22', source = 'n22')
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
pass
else:
raise Exception("Did not catch expected UserError.")
@@ -1499,11 +1500,12 @@ class CompositeBuilderTestCase(unittest.TestCase):
flag = 0
try:
builder(env, target='test3', source=['test2.bar', 'test1.foo'])[0]
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
flag = 1
+ err = e
assert flag, "UserError should be thrown when we call a builder with files of different suffixes."
expect = "While building `['test3']' from `test1.foo': Cannot build multiple sources with different extensions: .bar, .foo"
- assert str(e) == expect, e
+ assert str(err) == expect, err
def test_source_ext_match(self):
"""Test the CompositeBuilder source_ext_match argument"""
@@ -1530,8 +1532,8 @@ class CompositeBuilderTestCase(unittest.TestCase):
try:
tgt.build()
flag = 1
- except SCons.Errors.UserError, e:
- print e
+ except SCons.Errors.UserError as e:
+ print(e)
flag = 0
assert flag, "It should be possible to define actions in composite builders using variables."
env['FOO_SUFFIX'] = '.BAR2'
@@ -1583,47 +1585,52 @@ class CompositeBuilderTestCase(unittest.TestCase):
flag = 0
try:
builder(env, target='t5', source=['test5a.foo', 'test5b.inb'])[0]
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
flag = 1
+ err = e
assert flag, "UserError should be thrown when we call a builder with files of different suffixes."
expect = "While building `['t5']' from `test5b.bar': Cannot build multiple sources with different extensions: .foo, .bar"
- assert str(e) == expect, e
+ assert str(err) == expect, err
flag = 0
try:
builder(env, target='t6', source=['test6a.bar', 'test6b.ina'])[0]
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
flag = 1
+ err = e
assert flag, "UserError should be thrown when we call a builder with files of different suffixes."
expect = "While building `['t6']' from `test6b.foo': Cannot build multiple sources with different extensions: .bar, .foo"
- assert str(e) == expect, e
+ assert str(err) == expect, err
flag = 0
try:
builder(env, target='t4', source=['test4a.ina', 'test4b.inb'])[0]
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
flag = 1
+ err = e
assert flag, "UserError should be thrown when we call a builder with files of different suffixes."
expect = "While building `['t4']' from `test4b.bar': Cannot build multiple sources with different extensions: .foo, .bar"
- assert str(e) == expect, e
+ assert str(err) == expect, err
flag = 0
try:
builder(env, target='t7', source=[env.fs.File('test7')])[0]
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
flag = 1
+ err = e
assert flag, "UserError should be thrown when we call a builder with files of different suffixes."
expect = "While building `['t7']': Cannot deduce file extension from source files: ['test7']"
- assert str(e) == expect, e
+ assert str(err) == expect, err
flag = 0
try:
builder(env, target='t8', source=['test8.unknown'])[0]
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
flag = 1
+ err = e
assert flag, "UserError should be thrown when we call a builder target with an unknown suffix."
expect = "While building `['t8']' from `['test8.unknown']': Don't know how to build from a source file with suffix `.unknown'. Expected a suffix in this list: ['.foo', '.bar']."
- assert str(e) == expect, e
+ assert str(err) == expect, err
if __name__ == "__main__":
suite = unittest.TestSuite()
diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py
index cfeab00..8815eb3 100644
--- a/src/engine/SCons/CacheDir.py
+++ b/src/engine/SCons/CacheDir.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/CacheDir.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/CacheDir.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """
CacheDir support
diff --git a/src/engine/SCons/CacheDirTests.py b/src/engine/SCons/CacheDirTests.py
index 2daa177..e7db18c 100644
--- a/src/engine/SCons/CacheDirTests.py
+++ b/src/engine/SCons/CacheDirTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/CacheDirTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/CacheDirTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import shutil
@@ -44,7 +44,7 @@ class Action(object):
def genstring(self, target, source, env):
return str(self)
def get_contents(self, target, source, env):
- return ''
+ return bytearray('','utf-8')
class Builder(object):
def __init__(self, environment, action):
@@ -249,7 +249,7 @@ class FileTestCase(BaseTestCase):
warn_caught = 0
try:
f7.push_to_cache()
- except SCons.Errors.BuildError, e:
+ except SCons.Errors.BuildError as e:
assert e.exc_info[0] == SCons.Warnings.CacheWriteErrorWarning
warn_caught = 1
assert warn_caught
diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py
index 87a3022..abaf00d 100644
--- a/src/engine/SCons/Conftest.py
+++ b/src/engine/SCons/Conftest.py
@@ -101,7 +101,6 @@ Autoconf-like configuration support; low level implementation of tests.
#
import re
-from types import IntType
#
# PUBLIC VARIABLES
@@ -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/engine/SCons/Debug.py b/src/engine/SCons/Debug.py
index ac45bc0..d1ee991 100644
--- a/src/engine/SCons/Debug.py
+++ b/src/engine/SCons/Debug.py
@@ -9,7 +9,7 @@ caller_trace()
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Debug.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index d25d3ee..4a18045 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -10,7 +10,7 @@ from distutils.msvccompiler.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Defaults.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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)) \
@@ -458,7 +462,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 +488,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 +496,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 +515,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 +547,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
diff --git a/src/engine/SCons/Defaults.xml b/src/engine/SCons/Defaults.xml
index 8f9168f..cef1e93 100644
--- a/src/engine/SCons/Defaults.xml
+++ b/src/engine/SCons/Defaults.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/DefaultsTests.py b/src/engine/SCons/DefaultsTests.py
index 3480ada..fc9934b 100644
--- a/src/engine/SCons/DefaultsTests.py
+++ b/src/engine/SCons/DefaultsTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/DefaultsTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/DefaultsTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -70,7 +70,7 @@ class DefaultsTestCase(unittest.TestCase):
test.write(file, "test\n")
try:
mkdir_func(file)
- except os.error, e:
+ except os.error as e:
pass
else:
fail("expected os.error")
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 78fe327..64210aa 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -10,7 +10,7 @@ Environment
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Environment.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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,7 +147,7 @@ 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)
@@ -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/engine/SCons/Environment.xml b/src/engine/SCons/Environment.xml
index 80ff95e..0127bc2 100644
--- a/src/engine/SCons/Environment.xml
+++ b/src/engine/SCons/Environment.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -327,7 +327,7 @@ Examples:
# which the method will be called; the Python
# convention is to call it 'self'.
def my_method(self, arg):
- print "my_method() got", arg
+ print("my_method() got", arg)
# Use the global AddMethod() function to add a method
# to the Environment class. This
@@ -1100,7 +1100,7 @@ timestamp, such as can happen when restoring files from backup archives.
<listitem>
<para>
Specifies that a target shall be considered out of date and rebuilt
-if the dependency's content has changed sine the last time
+if the dependency's content has changed since the last time
the target was built,
as determined be performing an MD5 checksum
on the dependency's contents
@@ -1117,7 +1117,7 @@ can be used as a synonym for
<listitem>
<para>
Specifies that a target shall be considered out of date and rebuilt
-if the dependency's content has changed sine the last time
+if the dependency's content has changed since the last time
the target was built,
except that dependencies with a timestamp that matches
the last time the target was rebuilt will be
@@ -2504,6 +2504,29 @@ env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy'])
</summary>
</scons_function>
+<scons_function name="PyPackageDir">
+<arguments>
+(modulename)
+</arguments>
+<summary>
+<para>
+This returns a Directory Node similar to Dir.
+The python module / package is looked up and if located
+the directory is returned for the location.
+<varname>modulename</varname>
+Is a named python package / module to
+lookup the directory for it's location.
+</para>
+<para>
+If
+<varname>modulename</varname>
+is a list, SCons returns a list of Dir nodes.
+Construction variables are expanded in
+<varname>modulename</varname>.
+</para>
+</summary>
+</scons_function>
+
<scons_function name="Replace">
<arguments signature="env">
(key=val, [...])
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index 2aef997..70eda9e 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,9 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/EnvironmentTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+from __future__ import print_function
+
+__revision__ = "src/engine/SCons/EnvironmentTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -114,11 +116,11 @@ class Scanner(object):
global scanned_it
scanned_it[filename] = 1
- def __cmp__(self, other):
+ def __eq__(self, other):
try:
- return cmp(self.__dict__, other.__dict__)
+ return self.__dict__ == other.__dict__
except AttributeError:
- return 1
+ return False
def get_skeys(self, env):
return self.skeys
@@ -245,7 +247,9 @@ class SubstitutionTestCase(unittest.TestCase):
"""
env = SubstitutionEnvironment(XXX = 'x', YYY = 'y')
items = list(env.items())
- assert items == [('XXX','x'), ('YYY','y')], items
+ assert len(items) == 2 and ('XXX','x') in items and ('YYY','y') in items, items
+ # Was. This fails under py3 as order changes
+ # assert items == [('XXX','x'), ('YYY','y')], items
def test_arg2nodes(self):
"""Test the arg2nodes method
@@ -265,16 +269,10 @@ class SubstitutionTestCase(unittest.TestCase):
assert isinstance(nodes[0], X)
assert nodes[0].name == "Util.py UtilTests.py"
- try: unicode
- except NameError: pass
- else:
- code = """if 1:
- nodes = env.arg2nodes(u"Util.py UtilTests.py", Factory)
- assert len(nodes) == 1, nodes
- assert isinstance(nodes[0], X)
- assert nodes[0].name == u"Util.py UtilTests.py"
- \n"""
- exec code in globals(), locals()
+ nodes = env.arg2nodes(u"Util.py UtilTests.py", Factory)
+ assert len(nodes) == 1, nodes
+ assert isinstance(nodes[0], X)
+ assert nodes[0].name == u"Util.py UtilTests.py"
nodes = env.arg2nodes(["Util.py", "UtilTests.py"], Factory)
assert len(nodes) == 2, nodes
@@ -657,7 +655,7 @@ sys.exit(0)
cmd = '%s %s' % (python, test.workpath('fail.py'))
try:
env.backtick(cmd)
- except OSError, e:
+ except OSError as e:
assert str(e) == "'%s' exited 1" % cmd, str(e)
else:
self.fail("did not catch expected OSError")
@@ -1463,8 +1461,6 @@ def exists(env):
assert env['SOURCE'] == 's', env['SOURCE']
assert env['SOURCES'] == 'sss', env['SOURCES']
-
-
def test_Append(self):
"""Test appending to construction variables in an Environment
"""
@@ -1566,17 +1562,17 @@ def exists(env):
env['XXX'] = copy.copy(input)
try:
env.Append(XXX = append)
- except Exception, e:
- if failed == 0: print
- print " %s Append %s exception: %s" % \
- (repr(input), repr(append), e)
+ except Exception as e:
+ if failed == 0: print()
+ print(" %s Append %s exception: %s" % \
+ (repr(input), repr(append), e))
failed = failed + 1
else:
result = env['XXX']
if result != expect:
- if failed == 0: print
- print " %s Append %s => %s did not match %s" % \
- (repr(input), repr(append), repr(result), repr(expect))
+ if failed == 0: print()
+ print(" %s Append %s => %s did not match %s" % \
+ (repr(input), repr(append), repr(result), repr(expect)))
failed = failed + 1
del cases[:3]
assert failed == 0, "%d Append() cases failed" % failed
@@ -1598,7 +1594,7 @@ def exists(env):
self.name = name
def __str__(self):
return self.name
- def __cmp__(self, other):
+ def __eq__(self, other):
raise Exception("should not compare")
ccc = C('ccc')
@@ -1873,7 +1869,7 @@ def generate(env):
# test for pull request #150
env = self.TestEnvironment()
env._dict.pop('BUILDERS')
- assert env.has_key('BUILDERS') is False
+ assert ('BUILDERS' in env) is False
env2 = env.Clone()
def test_Copy(self):
@@ -1926,7 +1922,7 @@ def generate(env):
assert x is None, x
sub2_xxx_exe = test.workpath('sub2', 'xxx.exe')
- os.chmod(sub2_xxx_exe, 0755)
+ os.chmod(sub2_xxx_exe, 0o755)
env = self.TestEnvironment(ENV = { 'PATH' : [sub1, sub2] })
@@ -1934,7 +1930,7 @@ def generate(env):
assert x == 'xxx.exe', x
sub1_xxx_exe = test.workpath('sub1', 'xxx.exe')
- os.chmod(sub1_xxx_exe, 0755)
+ os.chmod(sub1_xxx_exe, 0o755)
x = env.Detect('xxx.exe')
assert x == 'xxx.exe', x
@@ -2252,17 +2248,17 @@ f5: \
env['XXX'] = copy.copy(input)
try:
env.Prepend(XXX = prepend)
- except Exception, e:
- if failed == 0: print
- print " %s Prepend %s exception: %s" % \
- (repr(input), repr(prepend), e)
+ except Exception as e:
+ if failed == 0: print()
+ print(" %s Prepend %s exception: %s" % \
+ (repr(input), repr(prepend), e))
failed = failed + 1
else:
result = env['XXX']
if result != expect:
- if failed == 0: print
- print " %s Prepend %s => %s did not match %s" % \
- (repr(input), repr(prepend), repr(result), repr(expect))
+ if failed == 0: print()
+ print(" %s Prepend %s => %s did not match %s" % \
+ (repr(input), repr(prepend), repr(result), repr(expect)))
failed = failed + 1
del cases[:3]
assert failed == 0, "%d Prepend() cases failed" % failed
@@ -2500,10 +2496,10 @@ def generate(env):
os.mkdir(sub2_xxx_exe)
test.write(sub3_xxx_exe, "\n")
- os.chmod(sub3_xxx_exe, 0777)
+ os.chmod(sub3_xxx_exe, 0o777)
test.write(sub4_xxx_exe, "\n")
- os.chmod(sub4_xxx_exe, 0777)
+ os.chmod(sub4_xxx_exe, 0o777)
env_path = os.environ['PATH']
diff --git a/src/engine/SCons/EnvironmentValues.py b/src/engine/SCons/EnvironmentValues.py
new file mode 100644
index 0000000..e2efccb
--- /dev/null
+++ b/src/engine/SCons/EnvironmentValues.py
@@ -0,0 +1,97 @@
+import re
+
+_is_valid_var = re.compile(r'[_a-zA-Z]\w*$')
+
+_rm = re.compile(r'\$[()]')
+_remove = re.compile(r'\$\([^\$]*(\$[^\)][^\$]*)*\$\)')
+
+# Regular expressions for splitting strings and handling substitutions,
+# for use by the scons_subst() and scons_subst_list() functions:
+#
+# The first expression compiled matches all of the $-introduced tokens
+# that we need to process in some way, and is used for substitutions.
+# The expressions it matches are:
+#
+# "$$"
+# "$("
+# "$)"
+# "$variable" [must begin with alphabetic or underscore]
+# "${any stuff}"
+#
+# The second expression compiled is used for splitting strings into tokens
+# to be processed, and it matches all of the tokens listed above, plus
+# the following that affect how arguments do or don't get joined together:
+#
+# " " [white space]
+# "non-white-space" [without any dollar signs]
+# "$" [single dollar sign]
+#
+_dollar_exps_str = r'\$[\$\(\)]|\$[_a-zA-Z][\.\w]*|\${[^}]*}'
+_dollar_exps = re.compile(r'(%s)' % _dollar_exps_str)
+_separate_args = re.compile(r'(%s|\s+|[^\s\$]+|\$)' % _dollar_exps_str)
+
+# This regular expression is used to replace strings of multiple white
+# space characters in the string result from the scons_subst() function.
+_space_sep = re.compile(r'[\t ]+(?![^{]*})')
+
+class ValueTypes(object):
+ """
+ Enum to store what type of value the variable holds.
+ """
+ UNKNOWN = 0
+ STRING = 1
+ CALLABLE = 2
+ VARIABLE = 3
+
+
+class EnvironmentValue(object):
+ """
+ Hold a single value. We're going to cache parsed version of the file
+ We're going to keep track of variables which feed into this values evaluation
+ """
+ def __init__(self, value):
+ self.value = value
+ self.var_type = ValueTypes.UNKNOWN
+
+ if callable(self.value):
+ self.var_type = ValueTypes.CALLABLE
+ else:
+ self.parse_value()
+
+
+ def parse_value(self):
+ """
+ Scan the string and break into component values
+ """
+
+ try:
+ if '$' not in self.value:
+ self._parsed = self.value
+ self.var_type = ValueTypes.STRING
+ else:
+ # Now we need to parse the specified string
+ result = _dollar_exps.sub(sub_match, args)
+ print(result)
+ pass
+ except TypeError:
+ # likely callable? either way we don't parse
+ self._parsed = self.value
+
+ def parse_trial(self):
+ """
+ Try alternate parsing methods.
+ :return:
+ """
+ parts = []
+ for c in self.value:
+
+
+
+class EnvironmentValues(object):
+ """
+ A class to hold all the environment variables
+ """
+ def __init__(self, **kw):
+ self._dict = {}
+ for k in kw:
+ self._dict[k] = EnvironmentValue(kw[k])
diff --git a/src/engine/SCons/EnvironmentValuesTest.py b/src/engine/SCons/EnvironmentValuesTest.py
new file mode 100644
index 0000000..58ee9cf
--- /dev/null
+++ b/src/engine/SCons/EnvironmentValuesTest.py
@@ -0,0 +1,16 @@
+import unittest
+
+from SCons.EnvironmentValues import EnvironmentValues
+
+class MyTestCase(unittest.TestCase):
+ def test_simple_environmentValues(self):
+ """Test comparing SubstitutionEnvironments
+ """
+
+ env1 = EnvironmentValues(XXX='x')
+ env2 = EnvironmentValues(XXX='x',XX="$X", X1="${X}", X2="$($X$)")
+
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/src/engine/SCons/Errors.py b/src/engine/SCons/Errors.py
index 801cf55..8388a0f 100644
--- a/src/engine/SCons/Errors.py
+++ b/src/engine/SCons/Errors.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Errors.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+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:
- -----------------------------------------------
+ Information about the cause of the build error:
+ -----------------------------------------------
- errstr : a description of the error message
+ 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.
+ 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.
+ 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.
+ 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.
+ 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:
- ---------------------------------------------------------
+ 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)
+ 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)
- 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)
- """
+ 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,
+ 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_str(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,14 +169,32 @@ 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
+ try:
+ filename = status.filename
+ except AttributeError:
+ filename = None
+
buildError = BuildError(
errstr=status.strerror,
status=status.errno,
@@ -195,7 +219,7 @@ def convert_to_BuildError(status, exc_info=None):
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/engine/SCons/ErrorsTests.py b/src/engine/SCons/ErrorsTests.py
index 2bd4533..6ad44e3 100644
--- a/src/engine/SCons/ErrorsTests.py
+++ b/src/engine/SCons/ErrorsTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/ErrorsTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/ErrorsTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
@@ -38,7 +38,7 @@ class ErrorsTestCase(unittest.TestCase):
raise SCons.Errors.BuildError(
errstr = "foo", status=57, filename="file", exc_info=(1,2,3),
node = "n", executor="e", action="a", command="c")
- except SCons.Errors.BuildError, e:
+ except SCons.Errors.BuildError as e:
assert e.errstr == "foo"
assert e.status == 57
assert e.exitstatus == 2, e.exitstatus
@@ -53,7 +53,7 @@ class ErrorsTestCase(unittest.TestCase):
try:
raise SCons.Errors.BuildError("n", "foo", 57, 3, "file",
"e", "a", "c", (1,2,3))
- except SCons.Errors.BuildError, e:
+ except SCons.Errors.BuildError as e:
assert e.errstr == "foo", e.errstr
assert e.status == 57, e.status
assert e.exitstatus == 3, e.exitstatus
@@ -67,7 +67,7 @@ class ErrorsTestCase(unittest.TestCase):
try:
raise SCons.Errors.BuildError()
- except SCons.Errors.BuildError, e:
+ except SCons.Errors.BuildError as e:
assert e.errstr == "Unknown error"
assert e.status == 2
assert e.exitstatus == 2
@@ -83,21 +83,21 @@ class ErrorsTestCase(unittest.TestCase):
"""Test the InternalError exception."""
try:
raise SCons.Errors.InternalError("test internal error")
- except SCons.Errors.InternalError, e:
+ except SCons.Errors.InternalError as e:
assert e.args == ("test internal error",)
def test_UserError(self):
"""Test the UserError exception."""
try:
raise SCons.Errors.UserError("test user error")
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
assert e.args == ("test user error",)
def test_ExplicitExit(self):
"""Test the ExplicitExit exception."""
try:
raise SCons.Errors.ExplicitExit("node")
- except SCons.Errors.ExplicitExit, e:
+ except SCons.Errors.ExplicitExit as e:
assert e.node == "node"
if __name__ == "__main__":
diff --git a/src/engine/SCons/Executor.py b/src/engine/SCons/Executor.py
index 3078bfa..9fabf70 100644
--- a/src/engine/SCons/Executor.py
+++ b/src/engine/SCons/Executor.py
@@ -6,7 +6,7 @@ Nodes.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Executor.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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,
@@ -455,10 +456,16 @@ class Executor(object):
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 +587,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/engine/SCons/ExecutorTests.py b/src/engine/SCons/ExecutorTests.py
index 105256e..519dff0 100644
--- a/src/engine/SCons/ExecutorTests.py
+++ b/src/engine/SCons/ExecutorTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/ExecutorTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/ExecutorTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
@@ -53,7 +53,11 @@ class MyAction(object):
def genstring(self, target, source, env):
return ' '.join(['GENSTRING'] + list(map(str, self.actions)) + target + source)
def get_contents(self, target, source, env):
- return ' '.join(self.actions + target + source)
+ return b' '.join(
+ [SCons.Util.to_bytes(aa) for aa in self.actions] +
+ [SCons.Util.to_bytes(tt) for tt in target] +
+ [SCons.Util.to_bytes(ss) for ss in source]
+ )
def get_implicit_deps(self, target, source, env):
return []
@@ -70,8 +74,12 @@ class MyNode(object):
self.pre_actions = pre
self.post_actions = post
self.missing_val = None
+ self.always_build = False
+ self.up_to_date = False
+
def __str__(self):
return self.name
+
def build(self):
executor = SCons.Executor.Executor(MyAction(self.pre_actions +
[self.builder.action] +
@@ -96,6 +104,9 @@ class MyNode(object):
def disambiguate(self):
return self
+ def is_up_to_date(self):
+ return self.up_to_date
+
class MyScanner(object):
def __init__(self, prefix):
self.prefix = prefix
@@ -311,7 +322,7 @@ class ExecutorTestCase(unittest.TestCase):
try:
r = x.prepare()
- except SCons.Errors.StopError, e:
+ except SCons.Errors.StopError as e:
assert str(e) == "Source `s2' not found, needed by target `t1'.", e
else:
raise AssertionError("did not catch expected StopError: %s" % r)
@@ -381,14 +392,14 @@ class ExecutorTestCase(unittest.TestCase):
x = SCons.Executor.Executor(MyAction(), env, [], ['t'], ['s'])
c = x.get_contents()
- assert c == 'action1 action2 t s', c
+ assert c == b'action1 action2 t s', c
x = SCons.Executor.Executor(MyAction(actions=['grow']), env, [],
['t'], ['s'])
x.add_pre_action(MyAction(['pre']))
x.add_post_action(MyAction(['post']))
c = x.get_contents()
- assert c == 'pre t sgrow t spost t s', c
+ assert c == b'pre t sgrow t spost t s', c
def test_get_timestamp(self):
"""Test fetching the "timestamp" """
@@ -451,6 +462,24 @@ class ExecutorTestCase(unittest.TestCase):
r = x.get_unignored_sources(None, [s1, s3])
assert r == [s2], list(map(str, r))
+ def test_changed_sources_for_alwaysBuild(self):
+ """
+ Ensure if a target is marked always build that the sources are always marked changed sources
+ :return:
+ """
+ env = MyEnvironment()
+ s1 = MyNode('s1')
+ s2 = MyNode('s2')
+ t1 = MyNode('t1')
+ t1.up_to_date = True
+ t1.always_build = True
+
+ x = SCons.Executor.Executor('b', env, [{}], [t1], [s1, s2])
+
+ changed_sources = x._get_changed_sources()
+ assert changed_sources == [s1, s2], "If target marked AlwaysBuild sources should always be marked changed"
+
+
if __name__ == "__main__":
diff --git a/src/engine/SCons/Job.py b/src/engine/SCons/Job.py
index 43766ef..7f3544f 100644
--- a/src/engine/SCons/Job.py
+++ b/src/engine/SCons/Job.py
@@ -7,7 +7,7 @@ stop, and wait on jobs.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Job.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py
index ed94866..cc17c1b 100644
--- a/src/engine/SCons/JobTests.py
+++ b/src/engine/SCons/JobTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/JobTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/JobTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import unittest
import random
diff --git a/src/engine/SCons/Memoize.py b/src/engine/SCons/Memoize.py
index 10d3064..5fe481d 100644
--- a/src/engine/SCons/Memoize.py
+++ b/src/engine/SCons/Memoize.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Memoize.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__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/engine/SCons/MemoizeTests.py b/src/engine/SCons/MemoizeTests.py
index 9ffd881..559232f 100644
--- a/src/engine/SCons/MemoizeTests.py
+++ b/src/engine/SCons/MemoizeTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/MemoizeTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/MemoizeTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
@@ -34,7 +34,6 @@ import SCons.Memoize
SCons.Memoize.EnableMemoization()
class FakeObject(object):
-
def __init__(self):
self._memo = {}
diff --git a/src/engine/SCons/Node/Alias.py b/src/engine/SCons/Node/Alias.py
index c5c2edb..567f663 100644
--- a/src/engine/SCons/Node/Alias.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Node/Alias.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import collections
diff --git a/src/engine/SCons/Node/AliasTests.py b/src/engine/SCons/Node/AliasTests.py
index 719456a..e1929f6 100644
--- a/src/engine/SCons/Node/AliasTests.py
+++ b/src/engine/SCons/Node/AliasTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Node/AliasTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Node/AliasTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 6935384..a953890 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Node/FS.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import fnmatch
import os
@@ -122,7 +123,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
@@ -157,7 +158,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 == '/'
@@ -178,7 +179,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
(.*/)?\.\.(?:/|$) |
@@ -200,7 +201,7 @@ needs_normpath_check = re.compile(
\./|.*/\.(?:/|$)
- ''',
+ ''',
re.VERBOSE
)
needs_normpath_match = needs_normpath_check.match
@@ -219,7 +220,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
@@ -235,7 +241,7 @@ 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:
@@ -350,33 +356,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:
@@ -421,46 +400,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):
@@ -476,6 +421,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(),
@@ -564,7 +514,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.
@@ -573,6 +523,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
@@ -608,14 +559,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
@@ -670,14 +620,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))
@@ -689,13 +639,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
@@ -799,7 +753,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:
@@ -840,13 +794,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]
@@ -939,7 +893,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'.
@@ -971,15 +925,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
@@ -1198,7 +1150,7 @@ class FS(LocalFS):
DirNodeInfo.fs = self
FileNodeInfo.fs = self
-
+
def set_SConstruct_dir(self, dir):
self.SConstruct_dir = dir
@@ -1210,9 +1162,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.
@@ -1310,7 +1262,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()
@@ -1437,6 +1389,35 @@ class FS(LocalFS):
if not isinstance(d, SCons.Node.Node):
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
@@ -1469,7 +1450,7 @@ class FS(LocalFS):
"""
Globs
- This is mainly a shim layer
+ This is mainly a shim layer
"""
if cwd is None:
cwd = self.getcwd()
@@ -1518,8 +1499,6 @@ class Dir(Base):
'root',
'dirname',
'on_disk_entries',
- 'sccs_dir',
- 'rcs_dir',
'released_target_info',
'contentsig']
@@ -1555,7 +1534,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 == '.':
@@ -1594,7 +1573,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):
@@ -1606,7 +1585,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)
@@ -1742,7 +1721,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
@@ -1913,10 +1892,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
@@ -1936,7 +1915,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:
@@ -1970,10 +1949,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
@@ -2085,9 +2064,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)
@@ -2178,7 +2155,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):
@@ -2256,9 +2233,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)
@@ -2266,7 +2243,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
@@ -2277,8 +2254,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
@@ -2336,7 +2313,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.
@@ -2352,9 +2329,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:
@@ -2433,6 +2410,7 @@ class RootDir(Dir):
def src_builder(self):
return _null
+
class FileNodeInfo(SCons.Node.NodeInfoBase):
__slots__ = ('csig', 'timestamp', 'size')
current_version_id = 2
@@ -2484,6 +2462,7 @@ class FileNodeInfo(SCons.Node.NodeInfoBase):
if key not in ('__weakref__',):
setattr(self, key, value)
+
class FileBuildInfo(SCons.Node.BuildInfoBase):
__slots__ = ()
current_version_id = 2
@@ -2514,6 +2493,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
@@ -2522,6 +2502,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
@@ -2550,6 +2531,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
@@ -2562,6 +2544,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.
"""
@@ -2578,8 +2561,6 @@ class File(Base):
'root',
'dirname',
'on_disk_entries',
- 'sccs_dir',
- 'rcs_dir',
'released_target_info',
'contentsig']
@@ -2628,11 +2609,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
@@ -2652,10 +2633,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
@@ -2663,13 +2646,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):
"""
@@ -2681,12 +2671,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:
@@ -2960,30 +2950,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...
@@ -3014,12 +3004,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
@@ -3056,7 +3041,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
@@ -3080,9 +3065,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))
#
#
@@ -3098,12 +3082,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
@@ -3117,7 +3100,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
@@ -3199,37 +3181,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:
@@ -3237,7 +3219,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
@@ -3290,7 +3272,7 @@ class File(Base):
# ...and they'd like a local copy.
e = LocalCopy(self, r, None)
if isinstance(e, SCons.Errors.BuildError):
- raise
+ raise
SCons.Node.store_info_map[self.store_info](self)
if T: Trace(' 1\n')
return 1
@@ -3372,12 +3354,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())
@@ -3397,7 +3379,7 @@ class File(Base):
return self.cachesig
except AttributeError:
pass
-
+
# Collect signatures for all children
children = self.children()
sigs = [n.get_cachedir_csig() for n in children]
@@ -3461,24 +3443,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:
@@ -3547,7 +3524,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.
@@ -3559,7 +3536,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/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 5b198c1..3a36894 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +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 division
+from __future__ import division, print_function
-__revision__ = "src/engine/SCons/Node/FSTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Node/FSTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -86,7 +86,7 @@ class Action(object):
def show(self, string):
pass
def get_contents(self, target, source, env):
- return ""
+ return bytearray("",'utf-8')
def genstring(self, target, source, env):
return ""
def strfunction(self, targets, sources, env):
@@ -231,7 +231,7 @@ class VariantDirTestCase(unittest.TestCase):
# Build path exists
assert f2.exists()
# ...and exists() should copy the file from src to build path
- assert test.read(['work', 'build', 'var2', 'test.in']) == 'test.in',\
+ assert test.read(['work', 'build', 'var2', 'test.in']) == bytearray('test.in','utf-8'),\
test.read(['work', 'build', 'var2', 'test.in'])
# Since exists() is true, so should rexists() be
assert f2.rexists()
@@ -260,7 +260,7 @@ class VariantDirTestCase(unittest.TestCase):
# Build path should exist
assert f4.exists()
# ...and copy over the file into the local build path
- assert test.read(['work', 'build', 'var2', 'test2.in']) == 'test2.in'
+ assert test.read(['work', 'build', 'var2', 'test2.in']) == bytearray('test2.in','utf-8')
# should exist in repository, since exists() is true
assert f4.rexists()
# rfile() should point to ourselves
@@ -273,12 +273,12 @@ class VariantDirTestCase(unittest.TestCase):
assert f5.exists()
# We should not copy the file from the source dir, since this is
# a derived file.
- assert test.read(['work', 'build', 'var1', 'test.out']) == 'test.old'
+ assert test.read(['work', 'build', 'var1', 'test.out']) == bytearray('test.old','utf-8')
assert f6.exists()
# We should not copy the file from the source dir, since this is
# a derived file.
- assert test.read(['work', 'build', 'var2', 'test.out']) == 'test.old'
+ assert test.read(['work', 'build', 'var2', 'test.out']) == bytearray('test.old','utf-8')
f7 = fs.File('build/var1/test2.out')
f8 = fs.File('build/var2/test2.out')
@@ -334,7 +334,7 @@ class VariantDirTestCase(unittest.TestCase):
test.write([ 'work', 'build', 'var1', 'asourcefile' ], 'stuff')
f10 = fs.File('build/var1/asourcefile')
assert f10.exists()
- assert f10.get_contents() == 'stuff', f10.get_contents()
+ assert f10.get_contents() == bytearray('stuff','utf-8'), f10.get_contents()
f11 = fs.File('src/file11')
t, m = f11.alter_targets()
@@ -485,6 +485,14 @@ class VariantDirTestCase(unittest.TestCase):
real_symlink = os.symlink
except AttributeError:
real_symlink = None
+
+ # Disable symlink and link for now in win32.
+ # We don't have a consistant plan to make these work as yet
+ # They are only supported with PY3
+ if sys.platform == 'win32':
+ real_symlink = None
+ real_link = None
+
real_copy = shutil.copy2
simulator = LinkSimulator(duplicate, real_link, real_symlink, real_copy)
@@ -569,13 +577,13 @@ class VariantDirTestCase(unittest.TestCase):
dp = dnode.srcnode().get_internal_path()
expect = os.path.normpath(srcnode_map.get(dir, dir))
if dp != expect:
- print "Dir `%s' srcnode() `%s' != expected `%s'" % (dir, dp, expect)
+ print("Dir `%s' srcnode() `%s' != expected `%s'" % (dir, dp, expect))
errors = errors + 1
fp = fnode.srcnode().get_internal_path()
expect = os.path.normpath(srcnode_map.get(f, f))
if fp != expect:
- print "File `%s' srcnode() `%s' != expected `%s'" % (f, fp, expect)
+ print("File `%s' srcnode() `%s' != expected `%s'" % (f, fp, expect))
errors = errors + 1
for dir in dir_list:
@@ -587,14 +595,14 @@ class VariantDirTestCase(unittest.TestCase):
tp = t[0].get_internal_path()
expect = os.path.normpath(alter_map.get(dir, dir))
if tp != expect:
- print "Dir `%s' alter_targets() `%s' != expected `%s'" % (dir, tp, expect)
+ print("Dir `%s' alter_targets() `%s' != expected `%s'" % (dir, tp, expect))
errors = errors + 1
t, m = fnode.alter_targets()
tp = t[0].get_internal_path()
expect = os.path.normpath(alter_map.get(f, f))
if tp != expect:
- print "File `%s' alter_targets() `%s' != expected `%s'" % (f, tp, expect)
+ print("File `%s' alter_targets() `%s' != expected `%s'" % (f, tp, expect))
errors = errors + 1
self.failIf(errors)
@@ -673,7 +681,7 @@ class BaseTestCase(_tempdirTestCase):
nonexistent = fs.Entry('nonexistent')
assert not nonexistent.isfile()
- if hasattr(os, 'symlink'):
+ if sys.platform != 'win32' and hasattr(os, 'symlink'):
def test_islink(self):
"""Test the Base.islink() method"""
test = self.test
@@ -1084,7 +1092,7 @@ class FSTestCase(_tempdirTestCase):
try:
f2 = fs.File(sep.join(['f1', 'f2']), directory = d1)
- except TypeError, x:
+ except TypeError as x:
assert str(x) == ("Tried to lookup File '%s' as a Dir." %
d1_f1), x
except:
@@ -1092,7 +1100,7 @@ class FSTestCase(_tempdirTestCase):
try:
dir = fs.Dir(sep.join(['d1', 'f1']))
- except TypeError, x:
+ except TypeError as x:
assert str(x) == ("Tried to lookup File '%s' as a Dir." %
d1_f1), x
except:
@@ -1100,7 +1108,7 @@ class FSTestCase(_tempdirTestCase):
try:
f2 = fs.File('d1')
- except TypeError, x:
+ except TypeError as x:
assert str(x) == ("Tried to lookup Dir '%s' as a File." %
'd1'), x
except:
@@ -1298,7 +1306,7 @@ class FSTestCase(_tempdirTestCase):
# get_contents() returns the binary contents.
test.write("binary_file", "Foo\x1aBar")
f1 = fs.File(test.workpath("binary_file"))
- assert f1.get_contents() == "Foo\x1aBar", f1.get_contents()
+ assert f1.get_contents() == bytearray("Foo\x1aBar",'utf-8'), f1.get_contents()
# This tests to make sure we can decode UTF-8 text files.
test_string = u"Foo\x1aBar"
@@ -1307,6 +1315,14 @@ class FSTestCase(_tempdirTestCase):
assert eval('f1.get_text_contents() == u"Foo\x1aBar"'), \
f1.get_text_contents()
+ # Check for string which doesn't have BOM and isn't valid
+ # ASCII
+ test_string = b'Gan\xdfauge'
+ test.write('latin1_file', test_string)
+ f1 = fs.File(test.workpath("latin1_file"))
+ assert f1.get_text_contents() == test_string.decode('latin-1'), \
+ f1.get_text_contents()
+
def nonexistent(method, s):
try:
x = method(s, create = 0)
@@ -1367,7 +1383,7 @@ class FSTestCase(_tempdirTestCase):
try:
e = fs.Entry('file')
c = e.get_contents()
- assert c == "file\n", c
+ assert c == bytearray("file\n",'utf-8'), c
assert e.__class__ == SCons.Node.FS.File
finally:
test.unlink("file")
@@ -1399,7 +1415,7 @@ class FSTestCase(_tempdirTestCase):
except SyntaxError:
assert c == ""
- if hasattr(os, 'symlink'):
+ if sys.platform != 'win32' and hasattr(os, 'symlink'):
os.symlink('nonexistent', test.workpath('dangling_symlink'))
e = fs.Entry('dangling_symlink')
c = e.get_contents()
@@ -1494,16 +1510,14 @@ class FSTestCase(_tempdirTestCase):
assert r, r
assert not os.path.exists(test.workpath('exists')), "exists was not removed"
- symlink = test.workpath('symlink')
- try:
+ if sys.platform != 'win32' and hasattr(os, 'symlink'):
+ symlink = test.workpath('symlink')
os.symlink(test.workpath('does_not_exist'), symlink)
assert os.path.islink(symlink)
f = fs.File('symlink')
r = f.remove()
assert r, r
assert not os.path.islink(symlink), "symlink was not removed"
- except AttributeError:
- pass
test.write('can_not_remove', "can_not_remove\n")
test.writable(test.workpath('.'), 0)
@@ -1641,7 +1655,7 @@ class FSTestCase(_tempdirTestCase):
def unc_workpath(dirs, test=test):
import ntpath
- x = apply(test.workpath, dirs)
+ x = test.workpath(*dirs)
drive, path = ntpath.splitdrive(x)
unc, path = ntpath.splitunc(path)
path = strip_slash(path)
@@ -1907,9 +1921,9 @@ class FSTestCase(_tempdirTestCase):
del cases[:3]
result = dir.rel_path(other)
if result != expect:
- if failed == 0: print
+ if failed == 0: print()
fmt = " dir_path(%(dir)s, %(other)s) => '%(result)s' did not match '%(expect)s'"
- print fmt % locals()
+ print(fmt % locals())
failed = failed + 1
assert failed == 0, "%d rel_path() cases failed" % failed
@@ -2546,9 +2560,9 @@ class GlobTestCase(_tempdirTestCase):
fmt = lambda n: n
if r != result:
import pprint
- print "Glob(%s) expected:" % repr(input)
+ print("Glob(%s) expected:" % repr(input))
pprint.pprint(list(map(fmt, result)))
- print "Glob(%s) got:" % repr(input)
+ print("Glob(%s) got:" % repr(input))
pprint.pprint(list(map(fmt, r)))
self.fail()
@@ -3099,7 +3113,7 @@ class RepositoryTestCase(_tempdirTestCase):
test.write(["rep3", "contents"], "Con\x1aTents\n")
try:
c = fs.File("contents").get_contents()
- assert c == "Con\x1aTents\n", "got '%s'" % c
+ assert c == bytearray("Con\x1aTents\n",'utf-8'), "got '%s'" % c
finally:
test.unlink(["rep3", "contents"])
@@ -3271,18 +3285,11 @@ class has_src_builderTestCase(unittest.TestCase):
fs = SCons.Node.FS.FS(test.workpath(''))
os.chdir(test.workpath(''))
test.subdir('sub1')
- test.subdir('sub2', ['sub2', 'SCCS'], ['sub2', 'RCS'])
sub1 = fs.Dir('sub1', '.')
f1 = fs.File('f1', sub1)
f2 = fs.File('f2', sub1)
f3 = fs.File('f3', sub1)
- sub2 = fs.Dir('sub2', '.')
- f4 = fs.File('f4', sub2)
- f5 = fs.File('f5', sub2)
- f6 = fs.File('f6', sub2)
- f7 = fs.File('f7', sub2)
- f8 = fs.File('f8', sub2)
h = f1.has_src_builder()
assert not h, h
@@ -3307,32 +3314,6 @@ class has_src_builderTestCase(unittest.TestCase):
assert h, h
assert f3.builder is b1, f3.builder
- f7.set_src_builder(b1)
- f8.builder_set(b1)
-
- test.write(['sub2', 'SCCS', 's.f5'], "sub2/SCCS/s.f5\n")
- test.write(['sub2', 'RCS', 'f6,v'], "sub2/RCS/f6,v\n")
- h = f4.has_src_builder()
- assert not h, h
- h = f4.has_builder()
- assert not h, h
- h = f5.has_src_builder()
- assert h, h
- h = f5.has_builder()
- assert h, h
- h = f6.has_src_builder()
- assert h, h
- h = f6.has_builder()
- assert h, h
- h = f7.has_src_builder()
- assert h, h
- h = f7.has_builder()
- assert h, h
- h = f8.has_src_builder()
- assert not h, h
- h = f8.has_builder()
- assert h, h
-
class prepareTestCase(unittest.TestCase):
def runTest(self):
"""Test the prepare() method"""
@@ -3663,7 +3644,7 @@ class SpecialAttrTestCase(unittest.TestCase):
caught = None
try:
fs.Dir('ddd').get_subst_proxy().no_such_attr
- except AttributeError, e:
+ except AttributeError as e:
assert str(e) == "Dir instance 'ddd' has no attribute 'no_such_attr'", e
caught = 1
assert caught, "did not catch expected AttributeError"
@@ -3671,7 +3652,7 @@ class SpecialAttrTestCase(unittest.TestCase):
caught = None
try:
fs.Entry('eee').get_subst_proxy().no_such_attr
- except AttributeError, e:
+ except AttributeError as e:
# Gets disambiguated to File instance by get_subst_proxy().
assert str(e) == "File instance 'eee' has no attribute 'no_such_attr'", e
caught = 1
@@ -3680,7 +3661,7 @@ class SpecialAttrTestCase(unittest.TestCase):
caught = None
try:
fs.File('fff').get_subst_proxy().no_such_attr
- except AttributeError, e:
+ except AttributeError as e:
assert str(e) == "File instance 'fff' has no attribute 'no_such_attr'", e
caught = 1
assert caught, "did not catch expected AttributeError"
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index dbda904..e50616a 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Node/NodeTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Node/NodeTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
diff --git a/src/engine/SCons/Node/Python.py b/src/engine/SCons/Node/Python.py
index fd70ab8..06cb93a 100644
--- a/src/engine/SCons/Node/Python.py
+++ b/src/engine/SCons/Node/Python.py
@@ -5,7 +5,7 @@ Python nodes.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Node/Python.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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,17 @@ 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):
+ 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()
diff --git a/src/engine/SCons/Node/PythonTests.py b/src/engine/SCons/Node/PythonTests.py
index 1ba4535..aab7e85 100644
--- a/src/engine/SCons/Node/PythonTests.py
+++ b/src/engine/SCons/Node/PythonTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Node/PythonTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Node/PythonTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
@@ -90,15 +90,15 @@ class ValueTestCase(unittest.TestCase):
"""
v1 = SCons.Node.Python.Value('aaa')
csig = v1.get_csig(None)
- assert csig == 'aaa', csig
+ assert csig.decode() == 'aaa', csig
v2 = SCons.Node.Python.Value(7)
csig = v2.get_csig(None)
- assert csig == '7', csig
+ assert csig.decode() == '7', csig
v3 = SCons.Node.Python.Value(None)
csig = v3.get_csig(None)
- assert csig == 'None', csig
+ assert csig.decode() == 'None', csig
class ValueNodeInfoTestCase(unittest.TestCase):
def test___init__(self):
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index 6567489..793e101 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/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 - 2017 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,7 +43,7 @@ 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 rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import collections
import copy
@@ -55,6 +57,8 @@ import SCons.Util
from SCons.Debug import Trace
+from SCons.compat import with_metaclass, NoSlotsPyPy
+
print_duplicate = 0
def classname(obj):
@@ -151,7 +155,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"%self)
if exists_base(node) or node.islink():
node.fs.unlink(node.get_internal_path())
# Return None explicitly because the Base.exists() call
@@ -205,13 +209,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
@@ -345,6 +350,7 @@ class NodeInfoBase(object):
"""
__slots__ = ('__weakref__',)
current_version_id = 2
+
def update(self, node):
try:
field_list = self.field_list
@@ -361,8 +367,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
@@ -377,7 +385,7 @@ class NodeInfoBase(object):
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 +415,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 +448,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 +456,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 +466,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 +497,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 +547,7 @@ class Node(object):
class Attrs(object):
__slots__ = ('shared', '__dict__')
-
+
def __init__(self):
if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node')
@@ -588,7 +599,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
@@ -737,7 +748,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 +787,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 +976,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 +1136,22 @@ 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 = self.depends
+ binfo.bdependsigs = [d.get_ninfo() for d in self.depends if d not in ignore_set]
+
+ binfo.bimplicit = self.implicit or []
+ binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit if i not in ignore_set]
+
return binfo
@@ -1239,7 +1234,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 +1253,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 +1267,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 +1327,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 +1361,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 +1385,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 +1419,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
@@ -1603,8 +1598,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
@@ -1645,6 +1640,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/engine/SCons/Options/BoolOption.py b/src/engine/SCons/Options/BoolOption.py
index ac945b5..5960a2e 100644
--- a/src/engine/SCons/Options/BoolOption.py
+++ b/src/engine/SCons/Options/BoolOption.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Options/BoolOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Options/BoolOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy
diff --git a/src/engine/SCons/Options/EnumOption.py b/src/engine/SCons/Options/EnumOption.py
index 58aece6..5e030d9 100644
--- a/src/engine/SCons/Options/EnumOption.py
+++ b/src/engine/SCons/Options/EnumOption.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Options/EnumOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Options/EnumOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy
diff --git a/src/engine/SCons/Options/ListOption.py b/src/engine/SCons/Options/ListOption.py
index b266b93..d4e63af 100644
--- a/src/engine/SCons/Options/ListOption.py
+++ b/src/engine/SCons/Options/ListOption.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Options/ListOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Options/ListOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy
diff --git a/src/engine/SCons/Options/PackageOption.py b/src/engine/SCons/Options/PackageOption.py
index fc9ea11..6ebeca2 100644
--- a/src/engine/SCons/Options/PackageOption.py
+++ b/src/engine/SCons/Options/PackageOption.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Options/PackageOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Options/PackageOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy
diff --git a/src/engine/SCons/Options/PathOption.py b/src/engine/SCons/Options/PathOption.py
index 3a5a4cb..b177687 100644
--- a/src/engine/SCons/Options/PathOption.py
+++ b/src/engine/SCons/Options/PathOption.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Options/PathOption.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Options/PathOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy
diff --git a/src/engine/SCons/Options/__init__.py b/src/engine/SCons/Options/__init__.py
index c160de4..8825d10 100644
--- a/src/engine/SCons/Options/__init__.py
+++ b/src/engine/SCons/Options/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Options/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Options/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Place-holder for the old SCons.Options module hierarchy
@@ -33,11 +33,11 @@ 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
+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
diff --git a/src/engine/SCons/PathList.py b/src/engine/SCons/PathList.py
index 6c11baa..680b853 100644
--- a/src/engine/SCons/PathList.py
+++ b/src/engine/SCons/PathList.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/PathList.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__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/engine/SCons/PathListTests.py b/src/engine/SCons/PathListTests.py
index 2a7dc1f..0e5f319 100644
--- a/src/engine/SCons/PathListTests.py
+++ b/src/engine/SCons/PathListTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/PathListTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/PathListTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
diff --git a/src/engine/SCons/Platform/PlatformTests.py b/src/engine/SCons/Platform/PlatformTests.py
index d704cf8..686d0d2 100644
--- a/src/engine/SCons/Platform/PlatformTests.py
+++ b/src/engine/SCons/Platform/PlatformTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Platform/PlatformTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/PlatformTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py
index c95f291..61a4010 100644
--- a/src/engine/SCons/Platform/__init__.py
+++ b/src/engine/SCons/Platform/__init__.py
@@ -20,8 +20,8 @@ their own platform definition.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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.
@@ -130,7 +132,7 @@ 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
@@ -183,9 +185,9 @@ 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
@@ -215,7 +217,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 +235,14 @@ 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
+
+ # 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 +251,8 @@ class TempFileMunge(object):
except AttributeError:
pass
return cmdlist
-
+
+
def Platform(name = platform_default()):
"""Select a canned Platform specification.
"""
diff --git a/src/engine/SCons/Platform/__init__.xml b/src/engine/SCons/Platform/__init__.xml
index 35e56a7..cb83a9f 100644
--- a/src/engine/SCons/Platform/__init__.xml
+++ b/src/engine/SCons/Platform/__init__.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Platform/aix.py b/src/engine/SCons/Platform/aix.py
index 42de812..caeb3fb 100644
--- a/src/engine/SCons/Platform/aix.py
+++ b/src/engine/SCons/Platform/aix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/aix.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import subprocess
-import posix
+from . import posix
import SCons.Util
import SCons.Action
diff --git a/src/engine/SCons/Platform/cygwin.py b/src/engine/SCons/Platform/cygwin.py
index 6922cf1..0e30b5f 100644
--- a/src/engine/SCons/Platform/cygwin.py
+++ b/src/engine/SCons/Platform/cygwin.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/cygwin.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/cygwin.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import posix
+from . import posix
from SCons.Platform import TempFileMunge
def generate(env):
diff --git a/src/engine/SCons/Platform/darwin.py b/src/engine/SCons/Platform/darwin.py
index d3b77db..70ffcf4 100644
--- a/src/engine/SCons/Platform/darwin.py
+++ b/src/engine/SCons/Platform/darwin.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/darwin.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-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/engine/SCons/Platform/hpux.py b/src/engine/SCons/Platform/hpux.py
index b66a791..8b34901 100644
--- a/src/engine/SCons/Platform/hpux.py
+++ b/src/engine/SCons/Platform/hpux.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/hpux.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import posix
+from . import posix
def generate(env):
posix.generate(env)
diff --git a/src/engine/SCons/Platform/irix.py b/src/engine/SCons/Platform/irix.py
index 1d57400..1ff4530 100644
--- a/src/engine/SCons/Platform/irix.py
+++ b/src/engine/SCons/Platform/irix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/irix.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import posix
+from . import posix
def generate(env):
posix.generate(env)
diff --git a/src/engine/SCons/Platform/os2.py b/src/engine/SCons/Platform/os2.py
index 584e1ed..cd1c35c 100644
--- a/src/engine/SCons/Platform/os2.py
+++ b/src/engine/SCons/Platform/os2.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
-import win32
+__revision__ = "src/engine/SCons/Platform/os2.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+from . import win32
def generate(env):
if 'ENV' not in env:
diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py
index c2d3e50..890a70a 100644
--- a/src/engine/SCons/Platform/posix.py
+++ b/src/engine/SCons/Platform/posix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/posix.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import errno
import os
@@ -56,7 +56,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 + '"'
diff --git a/src/engine/SCons/Platform/posix.xml b/src/engine/SCons/Platform/posix.xml
index f20ec64..00d42ab 100644
--- a/src/engine/SCons/Platform/posix.xml
+++ b/src/engine/SCons/Platform/posix.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Platform/sunos.py b/src/engine/SCons/Platform/sunos.py
index 77862a5..3279fb9 100644
--- a/src/engine/SCons/Platform/sunos.py
+++ b/src/engine/SCons/Platform/sunos.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/sunos.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import posix
+from . import posix
def generate(env):
posix.generate(env)
diff --git a/src/engine/SCons/Platform/sunos.xml b/src/engine/SCons/Platform/sunos.xml
index 2705c9f..541c862 100644
--- a/src/engine/SCons/Platform/sunos.xml
+++ b/src/engine/SCons/Platform/sunos.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py
index dacb27d..79955e7 100644
--- a/src/engine/SCons/Platform/win32.py
+++ b/src/engine/SCons/Platform/win32.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Platform/win32.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
@@ -60,15 +60,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,13 +69,64 @@ 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:
+ import io
+ for io_class in ['BufferedReader', 'BufferedWriter', 'BufferedRWPair',
+ 'BufferedRandom', 'TextIOWrapper']:
+ _builtin_file = getattr(io, io_class)
+ 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)
+ setattr(io, io_class, _scons_file)
+
+
+
+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.
@@ -111,11 +155,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 +181,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,7 +197,7 @@ 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]]
@@ -178,13 +222,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 +239,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 +262,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 +287,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 +318,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 +354,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 +368,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 +404,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 +414,6 @@ def generate(env):
if not cmd_interp:
cmd_interp = env.Detect('command')
-
if 'ENV' not in env:
env['ENV'] = {}
@@ -368,7 +425,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:
@@ -401,10 +458,10 @@ def generate(env):
env['TEMPFILEPREFIX'] = '@'
env['MAXLINELENGTH'] = 2048
env['ESCAPE'] = escape
-
+
env['HOST_OS'] = 'win32'
env['HOST_ARCH'] = get_architecture().arch
-
+
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Platform/win32.xml b/src/engine/SCons/Platform/win32.xml
index d085350..c2b9b01 100644
--- a/src/engine/SCons/Platform/win32.xml
+++ b/src/engine/SCons/Platform/win32.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py
index e5799ac..c1ab159 100644
--- a/src/engine/SCons/SConf.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/SConf.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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_contents().decode()
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
@@ -1004,7 +1005,7 @@ def CheckLib(context, library = None, symbol = "main",
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/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py
index d326a68..36abc7e 100644
--- a/src/engine/SCons/SConfTests.py
+++ b/src/engine/SCons/SConfTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/SConfTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/SConfTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -48,7 +48,7 @@ class SConfTestCase(unittest.TestCase):
def setUp(self):
# we always want to start with a clean directory
self.save_cwd = os.getcwd()
- self.test = TestCmd.TestCmd(workdir = '')
+ self.test = TestCmd.TestCmd(workdir = '')
os.chdir(self.test.workpath(''))
def tearDown(self):
@@ -62,7 +62,7 @@ class SConfTestCase(unittest.TestCase):
# We try to reset scons' state (including all global variables)
import SCons.SConsign
SCons.SConsign.write() # simulate normal scons-finish
- for n in sys.modules.keys():
+ for n in list(sys.modules.keys()):
if n.split('.')[0] == 'SCons' and n[:12] != 'SCons.compat':
m = sys.modules[n]
if isinstance(m, ModuleType):
@@ -102,14 +102,17 @@ class SConfTestCase(unittest.TestCase):
import SCons.Platform.win32
- file = SCons.Platform.win32._builtin_file
- open = SCons.Platform.win32._builtin_open
+ try:
+ file = SCons.Platform.win32._builtin_file
+ open = SCons.Platform.win32._builtin_open
+ except AttributeError:
+ pass
def _baseTryXXX(self, TryFunc):
# TryCompile and TryLink are much the same, so we can test them
# in one method, we pass the function as a string ('TryCompile',
# 'TryLink'), so we are aware of reloading modules.
-
+
def checks(self, sconf, TryFuncString):
TryFunc = self.SConf.SConfBase.__dict__[TryFuncString]
res1 = TryFunc( sconf, "int main() { return 0; }\n", ".c" )
@@ -128,7 +131,7 @@ class SConfTestCase(unittest.TestCase):
assert res[0] and not res[1], res
finally:
sconf.Finish()
-
+
# 2.1 test the error caching mechanism (no dependencies have changed)
self._resetSConfState()
sconf = self.SConf.SConf(self.scons_env,
@@ -139,9 +142,9 @@ class SConfTestCase(unittest.TestCase):
assert res[0] and not res[1], res
finally:
sconf.Finish()
- # we should have exactly one one error cached
- log = self.test.read( self.test.workpath('config.log') )
- expr = re.compile( ".*failed in a previous run and all", re.DOTALL )
+ # we should have exactly one one error cached
+ log = str(self.test.read( self.test.workpath('config.log') ))
+ expr = re.compile( ".*failed in a previous run and all", re.DOTALL )
firstOcc = expr.match( log )
assert firstOcc is not None, log
secondOcc = expr.match( log, firstOcc.end(0) )
@@ -171,6 +174,7 @@ class SConfTestCase(unittest.TestCase):
conf_dir=self.test.workpath('config.tests'),
log_file=self.test.workpath('config.log'))
import SCons.Builder
+ import SCons.Node
class MyBuilder(SCons.Builder.BuilderBase):
def __init__(self):
self.prefix = ''
@@ -179,7 +183,7 @@ class SConfTestCase(unittest.TestCase):
class MyNode(object):
def __init__(self, name):
self.name = name
- self.state = None
+ self.state = SCons.Node.no_state
self.waiting_parents = set()
self.side_effects = []
self.builder = None
@@ -238,11 +242,11 @@ class SConfTestCase(unittest.TestCase):
"""Test SConf.TryCompile
"""
self._baseTryXXX( "TryCompile" ) #self.SConf.SConf.TryCompile )
-
+
def test_TryLink(self):
"""Test SConf.TryLink
"""
- self._baseTryXXX( "TryLink" ) #self.SConf.SConf.TryLink )
+ self._baseTryXXX( "TryLink" ) #self.SConf.SConf.TryLink )
def test_TryRun(self):
"""Test SConf.TryRun
@@ -255,10 +259,10 @@ int main() {
return 0;
}
"""
- res1 = sconf.TryRun( prog, ".c" )
+ res1 = sconf.TryRun( prog, ".c" )
res2 = sconf.TryRun( "not a c program\n", ".c" )
return (res1, res2)
-
+
self._resetSConfState()
sconf = self.SConf.SConf(self.scons_env,
conf_dir=self.test.workpath('config.tests'),
@@ -282,8 +286,9 @@ int main() {
assert not res[1][0] and res[1][1] == "", res
finally:
sconf.Finish()
- # we should have exactly one error cached
- log = self.test.read( self.test.workpath('config.log') )
+ # we should have exactly one error cached
+ # creating string here because it's bytes by default on py3
+ log = str(self.test.read( self.test.workpath('config.log') ))
expr = re.compile( ".*failed in a previous run and all", re.DOTALL )
firstOcc = expr.match( log )
assert firstOcc is not None, log
@@ -305,7 +310,7 @@ int main() {
log_file=self.test.workpath('config.log'))
try:
(ret, output) = sconf.TryAction(action=actionOK)
- assert ret and output == "RUN OK" + os.linesep, (ret, output)
+ assert ret and output.encode('utf-8') == bytearray("RUN OK"+os.linesep,'utf-8'), (ret, output)
(ret, output) = sconf.TryAction(action=actionFAIL)
assert not ret and output == "", (ret, output)
finally:
@@ -352,7 +357,7 @@ int main() {
try:
self._test_check_compilers('CC', sconf.CheckCC, 'CheckCC')
except AssertionError:
- sys.stderr.write(self.test.read('config.log'))
+ sys.stderr.write(self.test.read('config.log', mode='r'))
raise
finally:
sconf.Finish()
@@ -368,7 +373,7 @@ int main() {
try:
self._test_check_compilers('SHCC', sconf.CheckSHCC, 'CheckSHCC')
except AssertionError:
- sys.stderr.write(self.test.read('config.log'))
+ sys.stderr.write(self.test.read('config.log', mode='r'))
raise
finally:
sconf.Finish()
@@ -384,7 +389,7 @@ int main() {
try:
self._test_check_compilers('CXX', sconf.CheckCXX, 'CheckCXX')
except AssertionError:
- sys.stderr.write(self.test.read('config.log'))
+ sys.stderr.write(self.test.read('config.log', mode='r'))
raise
finally:
sconf.Finish()
@@ -400,7 +405,7 @@ int main() {
try:
self._test_check_compilers('SHCXX', sconf.CheckSHCXX, 'CheckSHCXX')
except AssertionError:
- sys.stderr.write(self.test.read('config.log'))
+ sys.stderr.write(self.test.read('config.log', mode='r'))
raise
finally:
sconf.Finish()
@@ -625,8 +630,8 @@ int main() {
else:
r = sconf.CheckProg('cmd.exe')
self.assertIn('cmd.exe',r)
-
-
+
+
r = sconf.CheckProg('hopefully-not-a-program')
assert r is None
@@ -715,7 +720,7 @@ int main() {
# In ANSI C, malloc should be available in stdlib
r = sconf.CheckDeclaration('malloc', includes = "#include <stdlib.h>")
assert r, "malloc not declared ??"
- # For C++, __cplusplus should be declared
+ # For C++, __cplusplus should be declared
r = sconf.CheckDeclaration('__cplusplus', language = 'C++')
assert r, "__cplusplus not declared in C++ ??"
r = sconf.CheckDeclaration('__cplusplus', language = 'C')
@@ -759,7 +764,7 @@ int main() {
test.Result( ret )
assert ret and output == "Hello", (ret, output)
return ret
-
+
self._resetSConfState()
sconf = self.SConf.SConf(self.scons_env,
@@ -771,7 +776,7 @@ int main() {
assert ret, ret
finally:
sconf.Finish()
-
+
if __name__ == "__main__":
suite = unittest.makeSuite(SConfTestCase, 'test_')
diff --git a/src/engine/SCons/SConsign.py b/src/engine/SCons/SConsign.py
index 6fb018b..9d2f69e 100644
--- a/src/engine/SCons/SConsign.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+from __future__ import print_function
+
+__revision__ = "src/engine/SCons/SConsign.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/SConsignTests.py b/src/engine/SCons/SConsignTests.py
index 4fdce26..37e0de9 100644
--- a/src/engine/SCons/SConsignTests.py
+++ b/src/engine/SCons/SConsignTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/SConsignTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/SConsignTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import sys
diff --git a/src/engine/SCons/Scanner/C.py b/src/engine/SCons/Scanner/C.py
index d78bd05..6cdab4a 100644
--- a/src/engine/SCons/Scanner/C.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/C.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Scanner/CTests.py b/src/engine/SCons/Scanner/CTests.py
index abbc25a..f7b2b16 100644
--- a/src/engine/SCons/Scanner/CTests.py
+++ b/src/engine/SCons/Scanner/CTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/CTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/CTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
diff --git a/src/engine/SCons/Scanner/D.py b/src/engine/SCons/Scanner/D.py
index 0df6406..3b6f2f9 100644
--- a/src/engine/SCons/Scanner/D.py
+++ b/src/engine/SCons/Scanner/D.py
@@ -8,7 +8,7 @@ Coded by Andy Friesen
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
-
-import re
+__revision__ = "src/engine/SCons/Scanner/D.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Scanner/DTests.py b/src/engine/SCons/Scanner/DTests.py
new file mode 100644
index 0000000..58fbe76
--- /dev/null
+++ b/src/engine/SCons/Scanner/DTests.py
@@ -0,0 +1,282 @@
+#
+# Copyright (c) 2001 - 2017 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/Scanner/DTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+
+import unittest
+
+import TestCmd
+import TestUnit
+
+import SCons.Scanner.D
+
+test = TestCmd.TestCmd(workdir = '')
+
+import collections
+import os
+
+class DummyEnvironment(collections.UserDict):
+ def __init__(self, **kw):
+ collections.UserDict.__init__(self)
+ self.data.update(kw)
+ self.fs = SCons.Node.FS.FS(test.workpath(''))
+
+ def Dictionary(self, *args):
+ return self.data
+
+ def subst(self, strSubst, target=None, source=None, conv=None):
+ if strSubst[0] == '$':
+ return self.data[strSubst[1:]]
+ return strSubst
+
+ def subst_list(self, strSubst, target=None, source=None, conv=None):
+ if strSubst[0] == '$':
+ return [self.data[strSubst[1:]]]
+ return [[strSubst]]
+
+ def subst_path(self, path, target=None, source=None, conv=None):
+ if not isinstance(path, list):
+ path = [path]
+ return list(map(self.subst, path))
+
+ def get_calculator(self):
+ return None
+
+ def get_factory(self, factory):
+ return factory or self.fs.File
+
+ def Dir(self, filename):
+ return self.fs.Dir(filename)
+
+ def File(self, filename):
+ return self.fs.File(filename)
+
+if os.path.normcase('foo') == os.path.normcase('FOO'):
+ my_normpath = os.path.normcase
+else:
+ my_normpath = os.path.normpath
+
+def deps_match(self, deps, headers):
+ global my_normpath
+ scanned = list(map(my_normpath, list(map(str, deps))))
+ expect = list(map(my_normpath, headers))
+ self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned))
+
+"""
+Examples from https://dlang.org/spec/module.html
+
+D Language: 2.071.1
+Accessed: 11 August 2016
+"""
+
+# Regular import
+test.write('basic.d',"""
+import A;
+
+void main() {}
+""")
+
+# Static import
+test.write('static.d',"""
+static import A;
+
+void main()
+{
+ std.stdio.writeln("hello!"); // ok, writeln is fully qualified
+}
+""")
+
+# Public import
+test.write('public.d',"""
+public import A;
+
+void main() {}
+""")
+
+# Renamed import
+test.write('rename.d',"""
+import B = A;
+
+void main()
+{
+ io.writeln("hello!"); // ok, calls std.stdio.writeln
+}
+""")
+
+# Selective import
+test.write('selective.d',"""
+import A : B, C;
+
+void main()
+{
+ writeln("hello!"); // ok, writeln bound into current namespace
+ foo("world"); // ok, calls std.stdio.write()
+}
+""")
+
+# Renamed and Selective import
+test.write('renameAndSelective.d',"""
+import B = A : C = D;
+
+void main()
+{
+}
+""")
+
+# Scoped import
+test.write('scoped.d',"""
+void main()
+{
+ import A;
+}
+""")
+
+# Combinatorial import
+test.write('combinatorial.d',"""
+import A, B, CCC = C, DDD = D : EEE = FFF;
+
+void main()
+{
+}
+""")
+
+# Subdirs import
+test.write('subdirs.d',"""
+import X.Y, X.Z, X.X.X;
+
+void main() {}
+""")
+
+# Multiple import
+test.write('multiple.d',"""
+public import B;
+static import C;
+
+import X = X.Y : Q, R, S, T = U;
+void main()
+{
+ import A;
+}
+""")
+
+# Multiline import
+test.write('multiline.d',"""
+import
+A;
+
+void main() {}
+""")
+
+test.write('A.d',"""
+module A;
+void main() {}
+""")
+
+test.write('B.d',"""
+module B;
+void main() {}
+""")
+
+test.write('C.d',"""
+module C;
+void main() {}
+""")
+
+test.write('D.d',"""
+module D;
+void main() {}
+""")
+
+test.subdir('X', os.path.join('X','X'))
+
+test.write(os.path.join('X','Y.d'),"""
+module Y;
+void main() {}
+""")
+
+test.write(os.path.join('X','Z.d'),"""
+module Z;
+void main() {}
+""")
+
+test.write(os.path.join('X','X','X.d'),"""
+module X;
+void main() {}
+""")
+
+class DScannerTestCase(unittest.TestCase):
+ def helper(self, filename, headers):
+ env = DummyEnvironment()
+ s = SCons.Scanner.D.DScanner()
+ path = s.path(env)
+ deps = s(env.File(filename), env, path)
+ deps_match(self, deps, headers)
+
+ def test_BasicImport(self):
+ self.helper('basic.d', ['A.d'])
+
+ def test_StaticImport(self):
+ self.helper('static.d', ['A.d'])
+
+ def test_publicImport(self):
+ self.helper('public.d', ['A.d'])
+
+ def test_RenameImport(self):
+ self.helper('rename.d', ['A.d'])
+
+ def test_SelectiveImport(self):
+ self.helper('selective.d', ['A.d'])
+
+ def test_RenameAndSelectiveImport(self):
+ self.helper('renameAndSelective.d', ['A.d'])
+
+ def test_ScopedImport(self):
+ self.helper('scoped.d', ['A.d'])
+
+ def test_CombinatorialImport(self):
+ self.helper('combinatorial.d', ['A.d', 'B.d', 'C.d', 'D.d'])
+
+ def test_SubdirsImport(self):
+ self.helper('subdirs.d', [os.path.join('X','X','X.d'), os.path.join('X','Y.d'), os.path.join('X','Z.d')])
+
+ def test_MultipleImport(self):
+ self.helper('multiple.d', ['A.d', 'B.d', 'C.d', os.path.join('X','Y.d')])
+
+ def test_MultilineImport(self):
+ self.helper('multiline.d', ['A.d'])
+
+if __name__ == "__main__":
+ suite = unittest.TestSuite()
+ tclasses = [
+ DScannerTestCase,
+ ]
+ for tclass in tclasses:
+ names = unittest.getTestCaseNames(tclass, 'test_')
+ suite.addTests(list(map(tclass, names)))
+ TestUnit.run(suite)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Scanner/Dir.py b/src/engine/SCons/Scanner/Dir.py
index eefba8b..66d5b6d 100644
--- a/src/engine/SCons/Scanner/Dir.py
+++ b/src/engine/SCons/Scanner/Dir.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/Dir.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Scanner/DirTests.py b/src/engine/SCons/Scanner/DirTests.py
index 6c0e6f4..12f1844 100644
--- a/src/engine/SCons/Scanner/DirTests.py
+++ b/src/engine/SCons/Scanner/DirTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/DirTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/DirTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import sys
diff --git a/src/engine/SCons/Scanner/Fortran.py b/src/engine/SCons/Scanner/Fortran.py
index 179c8db..8a8f3eb 100644
--- a/src/engine/SCons/Scanner/Fortran.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/Fortran.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import re
diff --git a/src/engine/SCons/Scanner/FortranTests.py b/src/engine/SCons/Scanner/FortranTests.py
index b5575db..4194018 100644
--- a/src/engine/SCons/Scanner/FortranTests.py
+++ b/src/engine/SCons/Scanner/FortranTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/FortranTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/FortranTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
diff --git a/src/engine/SCons/Scanner/IDL.py b/src/engine/SCons/Scanner/IDL.py
index b7b76fd..706ff41 100644
--- a/src/engine/SCons/Scanner/IDL.py
+++ b/src/engine/SCons/Scanner/IDL.py
@@ -6,7 +6,7 @@ Definition Language) files.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/IDL.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Node.FS
import SCons.Scanner
diff --git a/src/engine/SCons/Scanner/IDLTests.py b/src/engine/SCons/Scanner/IDLTests.py
index b2a7ba3..f1b64c0 100644
--- a/src/engine/SCons/Scanner/IDLTests.py
+++ b/src/engine/SCons/Scanner/IDLTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/IDLTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/IDLTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import unittest
import sys
diff --git a/src/engine/SCons/Scanner/LaTeX.py b/src/engine/SCons/Scanner/LaTeX.py
index 0a68b7e..69154bd 100644
--- a/src/engine/SCons/Scanner/LaTeX.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/LaTeX.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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,7 +122,8 @@ 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
@@ -133,10 +140,12 @@ class LaTeX(SCons.Scanner.Base):
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_type in ('include', 'import', 'subimport',
+ 'includefrom', 'subincludefrom',
+ 'inputfrom', 'subinputfrom'):
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 == '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.
@@ -300,7 +340,7 @@ class LaTeX(SCons.Scanner.Base):
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.
@@ -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
@@ -359,11 +404,13 @@ class LaTeX(SCons.Scanner.Base):
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/engine/SCons/Scanner/LaTeXTests.py b/src/engine/SCons/Scanner/LaTeXTests.py
index 3f09fdc..93729d4 100644
--- a/src/engine/SCons/Scanner/LaTeXTests.py
+++ b/src/engine/SCons/Scanner/LaTeXTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/LaTeXTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/LaTeXTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -44,6 +44,12 @@ test.write('test1.latex',"""
include{incNO}
%\include{incNO}
xyzzy \include{inc6}
+\subimport{subdir}{inc3}
+\import{subdir}{inc3a}
+\includefrom{subdir}{inc3b}
+\subincludefrom{subdir}{inc3c}
+\inputfrom{subdir}{inc3d}
+\subinputfrom{subdir}{inc3e}
""")
test.write('test2.latex',"""
@@ -61,6 +67,10 @@ test.subdir('subdir')
test.write('inc1.tex',"\n")
test.write('inc2.tex',"\n")
test.write(['subdir', 'inc3.tex'], "\n")
+for suffix in 'abcde':
+ test.write(['subdir', 'inc3%s.tex' % suffix], "\n")
+test.write(['subdir', 'inc3b.tex'], "\n")
+test.write(['subdir', 'inc3c.tex'], "\n")
test.write(['subdir', 'inc4.eps'], "\n")
test.write('inc5.xyz', "\n")
test.write('inc6.tex', "\n")
@@ -122,7 +132,10 @@ class LaTeXScannerTestCase1(unittest.TestCase):
s = SCons.Scanner.LaTeX.LaTeXScanner()
path = s.path(env)
deps = s(env.File('test1.latex'), env, path)
- headers = ['inc1.tex', 'inc2.tex', 'inc6.tex']
+ headers = ['inc1.tex', 'inc2.tex', 'inc6.tex',
+ 'subdir/inc3.tex', 'subdir/inc3a.tex',
+ 'subdir/inc3b.tex', 'subdir/inc3c.tex',
+ 'subdir/inc3d.tex', 'subdir/inc3e.tex']
deps_match(self, deps, headers)
class LaTeXScannerTestCase2(unittest.TestCase):
diff --git a/src/engine/SCons/Scanner/Prog.py b/src/engine/SCons/Scanner/Prog.py
index 8e3245e..63d5a38 100644
--- a/src/engine/SCons/Scanner/Prog.py
+++ b/src/engine/SCons/Scanner/Prog.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/Prog.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Node
import SCons.Node.FS
diff --git a/src/engine/SCons/Scanner/ProgTests.py b/src/engine/SCons/Scanner/ProgTests.py
index 9871627..1f4dfb5 100644
--- a/src/engine/SCons/Scanner/ProgTests.py
+++ b/src/engine/SCons/Scanner/ProgTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/ProgTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/ProgTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import sys
@@ -270,7 +270,7 @@ def suite():
assert deps_match(deps, ['d1/l2.lib', 'd1/d2/l3.lib']), map(str, deps)
suite.addTest(ProgramScannerTestCase4())
\n"""
- exec code
+ exec(code)
return suite
if __name__ == "__main__":
diff --git a/src/engine/SCons/Scanner/RC.py b/src/engine/SCons/Scanner/RC.py
index 57e9e7f..4202362 100644
--- a/src/engine/SCons/Scanner/RC.py
+++ b/src/engine/SCons/Scanner/RC.py
@@ -6,7 +6,7 @@ Definition Language) files.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/RC.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+
+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/engine/SCons/Scanner/RCTests.py b/src/engine/SCons/Scanner/RCTests.py
index f0b9fff..fa0a9b4 100644
--- a/src/engine/SCons/Scanner/RCTests.py
+++ b/src/engine/SCons/Scanner/RCTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/RCTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/RCTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import unittest
import sys
diff --git a/src/engine/SCons/Scanner/SWIG.py b/src/engine/SCons/Scanner/SWIG.py
index 4114c1f..048574c 100644
--- a/src/engine/SCons/Scanner/SWIG.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/SWIG.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Scanner
diff --git a/src/engine/SCons/Scanner/ScannerTests.py b/src/engine/SCons/Scanner/ScannerTests.py
index b6ede69..a962a4c 100644
--- a/src/engine/SCons/Scanner/ScannerTests.py
+++ b/src/engine/SCons/Scanner/ScannerTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Scanner/ScannerTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/ScannerTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -105,7 +105,7 @@ class ScannerTestCase(unittest.TestCase):
assert str(s) == 'fooscan', str(s)
assert s.argument == 888, s.argument
-
+
class BaseTestCase(unittest.TestCase):
class skey_node(object):
@@ -236,7 +236,7 @@ class BaseTestCase(unittest.TestCase):
def test___cmp__(self):
"""Test the Scanner.Base class __cmp__() method"""
s = SCons.Scanner.Base(self.func, "Cmp")
- assert cmp(s, None)
+ assert s != None
def test_hash(self):
"""Test the Scanner.Base class __hash__() method"""
@@ -447,6 +447,17 @@ class CurrentTestCase(unittest.TestCase):
self.failUnless(ic.func_called, "did not call func()")
class ClassicTestCase(unittest.TestCase):
+
+ def func(self, filename, env, target, *args):
+ self.filename = filename
+ self.env = env
+ self.target = target
+
+ if len(args) > 0:
+ self.arg = args[0]
+
+ return self.deps
+
def test_find_include(self):
"""Test the Scanner.Classic find_include() method"""
env = DummyEnvironment()
@@ -548,6 +559,25 @@ class ClassicTestCase(unittest.TestCase):
ret = s.function(n, env, ('foo5',))
assert ret == ['jkl', 'mno'], ret
+ def test_recursive(self):
+ """Test the Scanner.Classic class recursive flag"""
+ nodes = [1, 2, 3, 4]
+
+
+ s = SCons.Scanner.Classic("Test", [], None, "", function=self.func, recursive=1)
+ n = s.recurse_nodes(nodes)
+ self.failUnless(n == n,
+ "recursive = 1 didn't return all nodes: %s" % n)
+
+ def odd_only(nodes):
+ return [n for n in nodes if n % 2]
+
+ s = SCons.Scanner.Classic("Test", [], None, "", function=self.func, recursive=odd_only)
+ n = s.recurse_nodes(nodes)
+ self.failUnless(n == [1, 3],
+ "recursive = 1 didn't return all nodes: %s" % n)
+
+
class ClassicCPPTestCase(unittest.TestCase):
diff --git a/src/engine/SCons/Scanner/__init__.py b/src/engine/SCons/Scanner/__init__.py
index 81617a4..73e8c09 100644
--- a/src/engine/SCons/Scanner/__init__.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Scanner/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Scanner/__init__.xml b/src/engine/SCons/Scanner/__init__.xml
index 6cd3950..db2d14b 100644
--- a/src/engine/SCons/Scanner/__init__.xml
+++ b/src/engine/SCons/Scanner/__init__.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Script/Interactive.py b/src/engine/SCons/Script/Interactive.py
index 97797b5..dee770c 100644
--- a/src/engine/SCons/Script/Interactive.py
+++ b/src/engine/SCons/Script/Interactive.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Interactive.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__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/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 19f8763..076c30b 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Script/Main.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+
import SCons.compat
@@ -42,6 +47,7 @@ import os
import sys
import time
import traceback
+import sysconfig
import SCons.CacheDir
import SCons.Debug
@@ -60,6 +66,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 +77,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 +94,7 @@ progress_display = SCons.Util.DisplayEngine()
first_command_start = None
last_command_end = None
+
class Progressor(object):
prev = ''
count = 0
@@ -149,9 +158,11 @@ def Progress(*args, **kw):
_BuildFailures = []
+
def GetBuildFailures():
return _BuildFailures
+
class BuildTask(SCons.Taskmaster.OutOfDateTask):
"""An SCons build task."""
progress = ProgressObject
@@ -220,7 +231,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 +300,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 +312,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 +337,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 +366,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 +612,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)
@@ -714,7 +726,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 +734,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 +752,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 +804,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):
@@ -992,7 +1004,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 +1065,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 +1103,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 +1169,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 +1243,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 +1252,19 @@ def _build_targets(fs, options, targets, target_top):
# various print_* settings, tree_printer list, etc.
BuildTask.options = options
+
+ python_has_threads = sysconfig.get_config_var('WITH_THREAD')
+ # 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 +1347,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 - 2017 The SCons Foundation")
version = ''.join(parts)
- import SConsOptions
+ from . import SConsOptions
parser = SConsOptions.Parser(version)
values = SConsOptions.SConsValues(parser.get_default_values())
@@ -1346,23 +1361,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 +1413,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/engine/SCons/Script/Main.xml b/src/engine/SCons/Script/Main.xml
index 809cf2b..73db83e 100644
--- a/src/engine/SCons/Script/Main.xml
+++ b/src/engine/SCons/Script/Main.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -256,7 +256,7 @@ import atexit
def print_build_failures():
from SCons.Script import GetBuildFailures
for bf in GetBuildFailures():
- print "%s failed: %s" % (bf.node, bf.errstr)
+ print("%s failed: %s" % (bf.node, bf.errstr))
atexit.register(print_build_failures)
</example_commands>
@@ -577,7 +577,7 @@ every 10 Nodes:
<example_commands>
def my_progress_function(node, *args, **kw):
- print 'Evaluating node %s!' % node
+ print('Evaluating node %s!' % node)
Progress(my_progress_function, interval=10)
</example_commands>
@@ -781,6 +781,14 @@ which corresponds to --random; and
</listitem>
</varlistentry>
<varlistentry>
+<term><literal>silent</literal></term>
+<listitem>
+<para>
+which corresponds to --silent.
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
<term><literal>stack_size</literal></term>
<listitem>
<para>
diff --git a/src/engine/SCons/Script/MainTests.py b/src/engine/SCons/Script/MainTests.py
index 3df68a8..f5660b0 100644
--- a/src/engine/SCons/Script/MainTests.py
+++ b/src/engine/SCons/Script/MainTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/MainTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Script/MainTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import unittest
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index 5bebed9..5515c7d 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConsOptions.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import optparse
import re
@@ -63,6 +63,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 +113,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 +139,7 @@ class SConsValues(optparse.Values):
'random',
'stack_size',
'warn',
+ 'silent'
]
def set_option(self, name, value):
@@ -161,7 +174,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 +199,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 +652,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 +677,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)
@@ -830,7 +844,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':
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index a9b2d57..350772e 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -5,8 +5,10 @@ files.
"""
+from __future__ import print_function
+
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,9 +28,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
-__revision__ = "src/engine/SCons/Script/SConscript.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConscript.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons
import SCons.Action
@@ -69,7 +70,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
@@ -103,7 +104,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
@@ -135,7 +136,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:
@@ -164,7 +165,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
@@ -178,10 +179,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
@@ -191,7 +192,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
@@ -247,7 +248,9 @@ def _SConscript(fs, *files, **kw):
pass
try:
try:
- exec _file_ in call_stack[-1].globals
+# _file_ = SCons.Util.to_str(_file_)
+ exec(compile(_file_.read(), _file_.name, 'exec'),
+ call_stack[-1].globals)
except SConscriptReturn:
pass
finally:
@@ -272,7 +275,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.
#
@@ -462,15 +465,15 @@ 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" % \
- (scons_ver_string, SCons.__version__)
+ print("SCons %s or greater required, but you have SCons %s" % \
+ (scons_ver_string, SCons.__version__))
sys.exit(2)
def EnsurePythonVersion(self, major, minor):
"""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):
@@ -509,7 +512,7 @@ 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):
diff --git a/src/engine/SCons/Script/SConscript.xml b/src/engine/SCons/Script/SConscript.xml
index 10b5446..e6be6d2 100644
--- a/src/engine/SCons/Script/SConscript.xml
+++ b/src/engine/SCons/Script/SConscript.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Script/SConscriptTests.py b/src/engine/SCons/Script/SConscriptTests.py
index 40c3c80..2b10446 100644
--- a/src/engine/SCons/Script/SConscriptTests.py
+++ b/src/engine/SCons/Script/SConscriptTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/SConscriptTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Script/SConscriptTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Script.SConscript
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index ea9d4fa..ffafadf 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -12,7 +12,7 @@ it goes here.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Script/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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
@@ -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
@@ -264,7 +269,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()
@@ -332,6 +337,7 @@ GlobalDefaultEnvironmentFunctions = [
'Local',
'ParseDepends',
'Precious',
+ 'PyPackageDir',
'Repository',
'Requires',
'SConsignFile',
@@ -354,6 +360,7 @@ GlobalDefaultBuilders = [
'Java',
'JavaH',
'Library',
+ 'LoadableModule',
'M4',
'MSVSProject',
'Object',
@@ -374,7 +381,7 @@ GlobalDefaultBuilders = [
]
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/engine/SCons/Sig.py b/src/engine/SCons/Sig.py
deleted file mode 100644
index ca6892b..0000000
--- a/src/engine/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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 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/engine/SCons/Subst.py b/src/engine/SCons/Subst.py
index 28445a3..90c12a0 100644
--- a/src/engine/SCons/Subst.py
+++ b/src/engine/SCons/Subst.py
@@ -5,7 +5,7 @@ SCons string substitution.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Subst.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import collections
import re
@@ -338,24 +338,28 @@ SUBST_RAW = 1
SUBST_SIG = 2
_rm = re.compile(r'\$[()]')
-_remove = re.compile(r'\$\([^\$]*(\$[^\)][^\$]*)*\$\)')
+_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.
@@ -438,14 +442,14 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={
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,12 +566,19 @@ 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.
@@ -576,6 +587,8 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={
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 +665,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/engine/SCons/Subst.xml b/src/engine/SCons/Subst.xml
index 51c9e84..a75003f 100644
--- a/src/engine/SCons/Subst.xml
+++ b/src/engine/SCons/Subst.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py
index 1d42a57..5a85b6c 100644
--- a/src/engine/SCons/SubstTests.py
+++ b/src/engine/SCons/SubstTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/SubstTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/SubstTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -182,6 +183,9 @@ class SubstTestCase(unittest.TestCase):
'HHH' : 'III',
'FFFIII' : 'BADNEWS',
+ 'THING1' : "$(STUFF$)",
+ 'THING2' : "$THING1",
+
'LITERAL' : TestLiteral("$XXX"),
# Test that we can expand to and return a function.
@@ -243,14 +247,14 @@ class SubstTestCase(unittest.TestCase):
expect = convert(expect)
try:
result = function(input, env, **kwargs)
- except Exception, e:
+ except Exception as e:
fmt = " input %s generated %s (%s)"
- print fmt % (repr(input), e.__class__.__name__, repr(e))
+ print(fmt % (repr(input), e.__class__.__name__, repr(e)))
failed = failed + 1
else:
if result != expect:
- if failed == 0: print
- print " input %s => %s did not match %s" % (repr(input), repr(result), repr(expect))
+ if failed == 0: print()
+ print(" input %s => \n%s did not match \n%s" % (repr(input), repr(result), repr(expect)))
failed = failed + 1
del cases[:2]
fmt = "%d %s() cases failed"
@@ -404,6 +408,11 @@ class scons_subst_TestCase(SubstTestCase):
"test",
"test",
+ "test $( $THING2 $)",
+ "test $( $(STUFF$) $)",
+ "test STUFF",
+ "test",
+
"$AAA ${AAA}A $BBBB $BBB",
"a aA b",
"a aA b",
@@ -462,18 +471,18 @@ class scons_subst_TestCase(SubstTestCase):
input, eraw, ecmd, esig = subst_cases[:4]
result = scons_subst(input, env, mode=SUBST_RAW, gvars=gvars)
if result != eraw:
- if failed == 0: print
- print " input %s => RAW %s did not match %s" % (repr(input), repr(result), repr(eraw))
+ if failed == 0: print()
+ print(" input %s => RAW %s did not match %s" % (repr(input), repr(result), repr(eraw)))
failed = failed + 1
result = scons_subst(input, env, mode=SUBST_CMD, gvars=gvars)
if result != ecmd:
- if failed == 0: print
- print " input %s => CMD %s did not match %s" % (repr(input), repr(result), repr(ecmd))
+ if failed == 0: print()
+ print(" input %s => CMD %s did not match %s" % (repr(input), repr(result), repr(ecmd)))
failed = failed + 1
result = scons_subst(input, env, mode=SUBST_SIG, gvars=gvars)
if result != esig:
- if failed == 0: print
- print " input %s => SIG %s did not match %s" % (repr(input), repr(result), repr(esig))
+ if failed == 0: print()
+ print(" input %s => SIG %s did not match %s" % (repr(input), repr(result), repr(esig)))
failed = failed + 1
del subst_cases[:4]
assert failed == 0, "%d subst() mode cases failed" % failed
@@ -516,7 +525,7 @@ class scons_subst_TestCase(SubstTestCase):
class Foo(object):
pass
scons_subst('${foo.bar}', env, gvars={'foo':Foo()})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
expect = [
"AttributeError `bar' trying to evaluate `${foo.bar}'",
"AttributeError `Foo instance has no attribute 'bar'' trying to evaluate `${foo.bar}'",
@@ -532,7 +541,7 @@ class scons_subst_TestCase(SubstTestCase):
env = DummyEnv(self.loc)
try:
scons_subst('$foo.bar.3.0', env)
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
expect = [
# Python 2.3, 2.4
"SyntaxError `invalid syntax (line 1)' trying to evaluate `$foo.bar.3.0'",
@@ -543,12 +552,29 @@ class scons_subst_TestCase(SubstTestCase):
else:
raise AssertionError("did not catch expected UserError")
+ def test_subst_balance_errors(self):
+ """Test scons_subst(): handling syntax errors"""
+ env = DummyEnv(self.loc)
+ try:
+ scons_subst('$(', env, mode=SUBST_SIG)
+ except SCons.Errors.UserError as e:
+ assert str(e) == "Unbalanced $(/$) in: $(", str(e)
+ else:
+ raise AssertionError("did not catch expected UserError")
+
+ try:
+ scons_subst('$)', env, mode=SUBST_SIG)
+ except SCons.Errors.UserError as e:
+ assert str(e) == "Unbalanced $(/$) in: $)", str(e)
+ else:
+ raise AssertionError("did not catch expected UserError")
+
def test_subst_type_errors(self):
"""Test scons_subst(): handling type errors"""
env = DummyEnv(self.loc)
try:
scons_subst("${NONE[2]}", env, gvars={'NONE':None})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
expect = [
# Python 2.3, 2.4
"TypeError `unsubscriptable object' trying to evaluate `${NONE[2]}'",
@@ -567,10 +593,13 @@ class scons_subst_TestCase(SubstTestCase):
def func(a, b, c):
pass
scons_subst("${func(1)}", env, gvars={'func':func})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
expect = [
# Python 2.3, 2.4, 2.5
- "TypeError `func() takes exactly 3 arguments (1 given)' trying to evaluate `${func(1)}'"
+ "TypeError `func() takes exactly 3 arguments (1 given)' trying to evaluate `${func(1)}'",
+
+ # Python 3.5 (and 3.x?)
+ "TypeError `func() missing 2 required positional arguments: 'b' and 'c'' trying to evaluate `${func(1)}'"
]
assert str(e) in expect, repr(str(e))
else:
@@ -937,18 +966,18 @@ class scons_subst_list_TestCase(SubstTestCase):
input, eraw, ecmd, esig = subst_list_cases[:4]
result = scons_subst_list(input, env, mode=SUBST_RAW, gvars=gvars)
if result != eraw:
- if failed == 0: print
- print " input %s => RAW %s did not match %s" % (repr(input), repr(result), repr(eraw))
+ if failed == 0: print()
+ print(" input %s => RAW %s did not match %s" % (repr(input), repr(result), repr(eraw)))
failed = failed + 1
result = scons_subst_list(input, env, mode=SUBST_CMD, gvars=gvars)
if result != ecmd:
- if failed == 0: print
- print " input %s => CMD %s did not match %s" % (repr(input), repr(result), repr(ecmd))
+ if failed == 0: print()
+ print(" input %s => CMD %s did not match %s" % (repr(input), repr(result), repr(ecmd)))
failed = failed + 1
result = scons_subst_list(input, env, mode=SUBST_SIG, gvars=gvars)
if result != esig:
- if failed == 0: print
- print " input %s => SIG %s did not match %s" % (repr(input), repr(result), repr(esig))
+ if failed == 0: print()
+ print(" input %s => SIG %s did not match %s" % (repr(input), repr(result), repr(esig)))
failed = failed + 1
del subst_list_cases[:4]
assert failed == 0, "%d subst() mode cases failed" % failed
@@ -960,7 +989,7 @@ class scons_subst_list_TestCase(SubstTestCase):
class Foo(object):
pass
scons_subst_list('${foo.bar}', env, gvars={'foo':Foo()})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
expect = [
"AttributeError `bar' trying to evaluate `${foo.bar}'",
"AttributeError `Foo instance has no attribute 'bar'' trying to evaluate `${foo.bar}'",
@@ -976,7 +1005,7 @@ class scons_subst_list_TestCase(SubstTestCase):
env = DummyEnv()
try:
scons_subst_list('$foo.bar.3.0', env)
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
expect = [
"SyntaxError `invalid syntax' trying to evaluate `$foo.bar.3.0'",
"SyntaxError `invalid syntax (line 1)' trying to evaluate `$foo.bar.3.0'",
@@ -1084,8 +1113,8 @@ class scons_subst_once_TestCase(unittest.TestCase):
input, key, expect = cases[:3]
result = scons_subst_once(input, env, key)
if result != expect:
- if failed == 0: print
- print " input %s (%s) => %s did not match %s" % (repr(input), repr(key), repr(result), repr(expect))
+ if failed == 0: print()
+ print(" input %s (%s) => %s did not match %s" % (repr(input), repr(key), repr(result), repr(expect)))
failed = failed + 1
del cases[:3]
assert failed == 0, "%d subst() cases failed" % failed
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py
index 90306b5..8fca4a9 100644
--- a/src/engine/SCons/Taskmaster.py
+++ b/src/engine/SCons/Taskmaster.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Taskmaster.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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()
@@ -537,7 +544,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 +692,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 +708,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 +783,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 +832,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 +862,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 +965,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/engine/SCons/TaskmasterTests.py b/src/engine/SCons/TaskmasterTests.py
index b1bd9d6..fab54cf 100644
--- a/src/engine/SCons/TaskmasterTests.py
+++ b/src/engine/SCons/TaskmasterTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -22,7 +22,7 @@
#
from __future__ import division
-__revision__ = "src/engine/SCons/TaskmasterTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/TaskmasterTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -697,7 +697,7 @@ class TaskmasterTestCase(unittest.TestCase):
tm = SCons.Taskmaster.Taskmaster([n3])
try:
t = tm.next_task()
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
assert str(e) == "Dependency cycle: n3 -> n1 -> n2 -> n3", str(e)
else:
assert 'Did not catch expected UserError'
@@ -849,14 +849,18 @@ class TaskmasterTestCase(unittest.TestCase):
t = tm.next_task()
t.exception_set((MyException, "exception value"))
exc_caught = None
+ exc_actually_caught = None
+ exc_value = None
try:
t.prepare()
- except MyException, e:
+ except MyException as e:
exc_caught = 1
- except:
+ exc_value = e
+ except Exception as e:
+ exc_actually_caught = e
pass
- assert exc_caught, "did not catch expected MyException"
- assert str(e) == "exception value", e
+ assert exc_caught, "did not catch expected MyException: %s"%exc_actually_caught
+ assert str(exc_value) == "exception value", exc_value
assert built_text is None, built_text
# Regression test, make sure we prepare not only
@@ -904,7 +908,7 @@ class TaskmasterTestCase(unittest.TestCase):
t = tm.next_task()
try:
t.prepare()
- except Exception, e:
+ except Exception as e:
assert str(e) == "Executor.prepare() exception", e
else:
raise AssertionError("did not catch expected exception")
@@ -958,7 +962,7 @@ class TaskmasterTestCase(unittest.TestCase):
t = tm.next_task()
try:
t.execute()
- except SCons.Errors.BuildError, e:
+ except SCons.Errors.BuildError as e:
assert e.node == n4, e.node
assert e.errstr == "OtherError : ", e.errstr
assert len(e.exc_info) == 3, e.exc_info
@@ -1065,10 +1069,20 @@ class TaskmasterTestCase(unittest.TestCase):
assert t.exception == 3
try: 1//0
- except: pass
- t.exception_set(None)
+ except:
+ # Moved from below
+ t.exception_set(None)
+ #pass
+
+# import pdb; pdb.set_trace()
+
+ # Having this here works for python 2.x,
+ # but it is a tuple (None, None, None) when called outside
+ # an except statement
+ # t.exception_set(None)
+
exc_type, exc_value, exc_tb = t.exception
- assert exc_type is ZeroDivisionError, exc_type
+ assert exc_type is ZeroDivisionError, "Expecting ZeroDevisionError got:%s"%exc_type
exception_values = [
"integer division or modulo",
"integer division or modulo by zero",
@@ -1078,13 +1092,14 @@ class TaskmasterTestCase(unittest.TestCase):
class Exception1(Exception):
pass
- t.exception_set((Exception1, None))
+ # Previously value was None, but while PY2 None = "", in Py3 None != "", so set to ""
+ t.exception_set((Exception1, ""))
try:
t.exception_raise()
except:
exc_type, exc_value = sys.exc_info()[:2]
assert exc_type == Exception1, exc_type
- assert str(exc_value) == '', exc_value
+ assert str(exc_value) == '', "Expecting empty string got:%s (type %s)"%(exc_value,type(exc_value))
else:
assert 0, "did not catch expected exception"
diff --git a/src/engine/SCons/Tool/386asm.py b/src/engine/SCons/Tool/386asm.py
index 8fee694..b318c4b 100644
--- a/src/engine/SCons/Tool/386asm.py
+++ b/src/engine/SCons/Tool/386asm.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/386asm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/386asm.xml b/src/engine/SCons/Tool/386asm.xml
index a29fc0f..80a2cd6 100644
--- a/src/engine/SCons/Tool/386asm.xml
+++ b/src/engine/SCons/Tool/386asm.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/BitKeeper.xml b/src/engine/SCons/Tool/BitKeeper.xml
deleted file mode 100644
index 30f3221..0000000
--- a/src/engine/SCons/Tool/BitKeeper.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
-
-This file is processed by the bin/SConsDoc.py module.
-See its __doc__ string for a discussion of the format.
--->
-
-<!DOCTYPE sconsdoc [
-<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
-%scons;
-<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
-%builders-mod;
-<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
-%functions-mod;
-<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
-%tools-mod;
-<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
-%variables-mod;
-]>
-
-<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
-
-<tool name="BitKeeper">
-<summary>
-<para>
-Sets construction variables for the BitKeeper
-source code control system.
-</para>
-</summary>
-<sets>
-<item>BITKEEPER</item>
-<item>BITKEEPERGET</item>
-<item>BITKEEPERGETFLAGS</item>
-<item>BITKEEPERCOM</item>
-</sets>
-<uses>
-<item>BITKEEPERCOMSTR</item>
-</uses>
-</tool>
-
-<cvar name="BITKEEPER">
-<summary>
-<para>
-The BitKeeper executable.
-</para>
-</summary>
-</cvar>
-
-<cvar name="BITKEEPERCOM">
-<summary>
-<para>
-The command line for
-fetching source files using BitKeeper.
-</para>
-</summary>
-</cvar>
-
-<cvar name="BITKEEPERCOMSTR">
-<summary>
-<para>
-The string displayed when fetching
-a source file using BitKeeper.
-If this is not set, then &cv-link-BITKEEPERCOM;
-(the command line) is displayed.
-</para>
-</summary>
-</cvar>
-
-<cvar name="BITKEEPERGET">
-<summary>
-<para>
-The command (&cv-link-BITKEEPER;) and subcommand
-for fetching source files using BitKeeper.
-</para>
-</summary>
-</cvar>
-
-<cvar name="BITKEEPERGETFLAGS">
-<summary>
-<para>
-Options that are passed to the BitKeeper
-<command>get</command>
-subcommand.
-</para>
-</summary>
-</cvar>
-
-<scons_function name="BitKeeper">
-<arguments signature="env">
-()
-</arguments>
-<summary>
-<para>
-A factory function that
-returns a Builder object
-to be used to fetch source files
-using BitKeeper.
-The returned Builder
-is intended to be passed to the
-&f-SourceCode;
-function.
-</para>
-
-<para>
-This function is deprecated. For details, see the entry for the
-&f-SourceCode;
-function.
-</para>
-
-<para>
-Example:
-</para>
-
-<example_commands>
-env.SourceCode('.', env.BitKeeper())
-</example_commands>
-</summary>
-</scons_function>
-
-</sconsdoc>
diff --git a/src/engine/SCons/Tool/CVS.py b/src/engine/SCons/Tool/CVS.py
deleted file mode 100644
index a8e5a8d..0000000
--- a/src/engine/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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 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/engine/SCons/Tool/CVS.xml b/src/engine/SCons/Tool/CVS.xml
deleted file mode 100644
index b6ff10a..0000000
--- a/src/engine/SCons/Tool/CVS.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
-
-This file is processed by the bin/SConsDoc.py module.
-See its __doc__ string for a discussion of the format.
--->
-
-<!DOCTYPE sconsdoc [
-<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
-%scons;
-<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
-%builders-mod;
-<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
-%functions-mod;
-<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
-%tools-mod;
-<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
-%variables-mod;
-]>
-
-<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
-
-<tool name="CVS">
-<summary>
-<para>
-Sets construction variables for the CVS source code
-management system.
-</para>
-</summary>
-<sets>
-<item>CVS</item>
-<item>CVSCOM</item>
-<item>CVSFLAGS</item>
-<item>CVSCOFLAGS</item>
-</sets>
-<uses>
-<item>CVSCOMSTR</item>
-</uses>
-</tool>
-
-<cvar name="CVS">
-<summary>
-<para>
-The CVS executable.
-</para>
-</summary>
-</cvar>
-
-<cvar name="CVSCOFLAGS">
-<summary>
-<para>
-Options that are passed to the CVS checkout subcommand.
-</para>
-</summary>
-</cvar>
-
-<cvar name="CVSCOM">
-<summary>
-<para>
-The command line used to
-fetch source files from a CVS repository.
-</para>
-</summary>
-</cvar>
-
-<cvar name="CVSCOMSTR">
-<summary>
-<para>
-The string displayed when fetching
-a source file from a CVS repository.
-If this is not set, then &cv-link-CVSCOM;
-(the command line) is displayed.
-</para>
-</summary>
-</cvar>
-
-<cvar name="CVSFLAGS">
-<summary>
-<para>
-General options that are passed to CVS.
-By default, this is set to
-<literal>-d $CVSREPOSITORY</literal>
-to specify from where the files must be fetched.
-</para>
-</summary>
-</cvar>
-
-<cvar name="CVSREPOSITORY">
-<summary>
-<para>
-The path to the CVS repository.
-This is referenced in the default
-&cv-link-CVSFLAGS; value.
-</para>
-</summary>
-</cvar>
-
-<scons_function name="CVS">
-<arguments signature="env">
-(repository, module)
-</arguments>
-<summary>
-<para>
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from the specified
-CVS
-<varname>repository</varname>.
-The returned Builder
-is intended to be passed to the
-&f-link-SourceCode;
-function.
-</para>
-
-<para>
-This function is deprecated. For details, see the entry for the
-&f-SourceCode;
-function.
-</para>
-
-<para>
-The optional specified
-<varname>module</varname>
-will be added to the beginning
-of all repository path names;
-this can be used, in essence,
-to strip initial directory names
-from the repository path names,
-so that you only have to
-replicate part of the repository
-directory hierarchy in your
-local build directory.
-</para>
-
-<para>
-Examples:
-</para>
-
-<example_commands>
-# Will fetch foo/bar/src.c
-# from /usr/local/CVSROOT/foo/bar/src.c.
-env.SourceCode('.', env.CVS('/usr/local/CVSROOT'))
-
-# Will fetch bar/src.c
-# from /usr/local/CVSROOT/foo/bar/src.c.
-env.SourceCode('.', env.CVS('/usr/local/CVSROOT', 'foo'))
-
-# Will fetch src.c
-# from /usr/local/CVSROOT/foo/bar/src.c.
-env.SourceCode('.', env.CVS('/usr/local/CVSROOT', 'foo/bar'))
-</example_commands>
-</summary>
-</scons_function>
-
-</sconsdoc>
diff --git a/src/engine/SCons/Tool/DCommon.py b/src/engine/SCons/Tool/DCommon.py
index e2750a4..8973853 100644
--- a/src/engine/SCons/Tool/DCommon.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/DCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/DCommon.xml b/src/engine/SCons/Tool/DCommon.xml
new file mode 100644
index 0000000..b1deb82
--- /dev/null
+++ b/src/engine/SCons/Tool/DCommon.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2001 - 2017 The SCons Foundation
+
+This file is processed by the bin/SConsDoc.py module.
+See its __doc__ string for a discussion of the format.
+-->
+
+<!DOCTYPE sconsdoc [
+ <!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
+ %scons;
+ <!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
+ %builders-mod;
+ <!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
+ %functions-mod;
+ <!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
+ %tools-mod;
+ <!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
+ %variables-mod;
+ ]>
+
+<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd">
+
+
+
+
+
+ <cvar name="DRPATHPREFIX">
+ <summary>
+ <para>
+ DRPATHPREFIX.
+ </para>
+ </summary>
+ </cvar>
+
+ <cvar name="DRPATHSUFFIX">
+ <summary>
+ <para>
+ DRPATHSUFFIX.
+ </para>
+ </summary>
+ </cvar>
+
+
+ <cvar name="DShLibSonameGenerator">
+ <summary>
+ <para>
+ DShLibSonameGenerator.
+ </para>
+ </summary>
+ </cvar>
+
+ <cvar name="SHDLIBVERSION">
+ <summary>
+ <para>
+ SHDLIBVERSION.
+ </para>
+ </summary>
+ </cvar>
+ <cvar name="SHDLIBVERSIONFLAGS">
+ <summary>
+ <para>
+ SHDLIBVERSIONFLAGS.
+ </para>
+ </summary>
+ </cvar>
+
+
+</sconsdoc>
diff --git a/src/engine/SCons/Tool/FortranCommon.py b/src/engine/SCons/Tool/FortranCommon.py
index 058f24d..d2126a4 100644
--- a/src/engine/SCons/Tool/FortranCommon.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/FortranCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/GettextCommon.py b/src/engine/SCons/Tool/GettextCommon.py
index 596586c..b475d8f 100644
--- a/src/engine/SCons/Tool/GettextCommon.py
+++ b/src/engine/SCons/Tool/GettextCommon.py
@@ -3,7 +3,7 @@
Used by several tools of `gettext` toolset.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,20 +24,37 @@ Used by several tools of `gettext` toolset.
# 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/GettextCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 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)
@@ -47,367 +64,406 @@ 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`.
+ """ 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.
"""
- 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)
+
+ 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
+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.
+ """ `PO` file builder.
- **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.
+ 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.
- 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()`.
+ **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`.
"""
- 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)
+
+ #
+ # * 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
+ """ 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).
+ """ Callable object, which returns pathnames relative to SCons current
+ working directory.
- def __init__(self, env):
- """ Initialize `RPaths` callable object.
-
- **Arguments**:
-
- - *env* - a `SCons.Environment.Environment` object, defines *current
- working dir*.
+ 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)
+ )
"""
- 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**:
+ # 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).
- - *nodes* ([`SCons.Node.FS.Base`]) - list of nodes.
- - *args* - currently unused.
- - *kw* - currently unused.
+ 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
- **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
+ """ 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 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
+ """ 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)
+ 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
+ """ 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)
+ 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
+ """ 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)
+ 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
+ """ 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)
+ 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' ]
-#############################################################################
+ """ List tools that shall be generated by top-level `gettext` tool """
+ return ['xgettext', 'msginit', 'msgmerge', 'msgfmt']
+#############################################################################
diff --git a/src/engine/SCons/Tool/JavaCommon.py b/src/engine/SCons/Tool/JavaCommon.py
index 38f4e47..5c2507d 100644
--- a/src/engine/SCons/Tool/JavaCommon.py
+++ b/src/engine/SCons/Tool/JavaCommon.py
@@ -5,7 +5,7 @@ Stuff for processing Java.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 @@ 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/JavaCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
diff --git a/src/engine/SCons/Tool/JavaCommonTests.py b/src/engine/SCons/Tool/JavaCommonTests.py
index 6a67370..da405f0 100644
--- a/src/engine/SCons/Tool/JavaCommonTests.py
+++ b/src/engine/SCons/Tool/JavaCommonTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/JavaCommonTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/JavaCommonTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import sys
diff --git a/src/engine/SCons/Tool/MSCommon/__init__.py b/src/engine/SCons/Tool/MSCommon/__init__.py
index 6b637fe..989ab08 100644
--- a/src/engine/SCons/Tool/MSCommon/__init__.py
+++ b/src/engine/SCons/Tool/MSCommon/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """
Common functions for Microsoft Visual Studio and Visual C/C++.
@@ -41,7 +41,8 @@ from SCons.Tool.MSCommon.sdk import mssdk_exists, \
from SCons.Tool.MSCommon.vc import msvc_exists, \
msvc_setup_env, \
- msvc_setup_env_once
+ msvc_setup_env_once, \
+ msvc_version_to_maj_min
from SCons.Tool.MSCommon.vs import get_default_version, \
get_vs_by_version, \
diff --git a/src/engine/SCons/Tool/MSCommon/arch.py b/src/engine/SCons/Tool/MSCommon/arch.py
index 46fb601..96f05a8 100644
--- a/src/engine/SCons/Tool/MSCommon/arch.py
+++ b/src/engine/SCons/Tool/MSCommon/arch.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Module to define supported Windows chip architectures.
"""
diff --git a/src/engine/SCons/Tool/MSCommon/common.py b/src/engine/SCons/Tool/MSCommon/common.py
index 1467543..fcf623f 100644
--- a/src/engine/SCons/Tool/MSCommon/common.py
+++ b/src/engine/SCons/Tool/MSCommon/common.py
@@ -1,5 +1,8 @@
+"""
+Common helper functions for working with the Microsoft tool chain.
+"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,12 +23,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/Tool/MSCommon/common.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
-
-__doc__ = """
-Common helper functions for working with the Microsoft tool chain.
-"""
+__revision__ = "src/engine/SCons/Tool/MSCommon/common.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import copy
import os
@@ -35,17 +35,17 @@ import re
import SCons.Util
-logfile = os.environ.get('SCONS_MSCOMMON_DEBUG')
-if logfile == '-':
- def debug(x):
- print x
-elif logfile:
+LOGFILE = os.environ.get('SCONS_MSCOMMON_DEBUG')
+if LOGFILE == '-':
+ def debug(message):
+ print(message)
+elif LOGFILE:
try:
import logging
except ImportError:
- debug = lambda x: open(logfile, 'a').write(x + '\n')
+ debug = lambda message: open(LOGFILE, 'a').write(message + '\n')
else:
- logging.basicConfig(filename=logfile, level=logging.DEBUG)
+ logging.basicConfig(filename=LOGFILE, level=logging.DEBUG)
debug = logging.debug
else:
debug = lambda x: None
@@ -75,7 +75,7 @@ def is_win64():
# I structured these tests to make it easy to add new ones or
# add exceptions in the future, because this is a bit fragile.
_is_win64 = False
- if os.environ.get('PROCESSOR_ARCHITECTURE','x86') != 'x86':
+ if os.environ.get('PROCESSOR_ARCHITECTURE', 'x86') != 'x86':
_is_win64 = True
if os.environ.get('PROCESSOR_ARCHITEW6432'):
_is_win64 = True
@@ -113,21 +113,30 @@ def normalize_env(env, keys, force=False):
Note: the environment is copied."""
normenv = {}
if env:
- for k in env.keys():
- normenv[k] = copy.deepcopy(env[k]).encode('mbcs')
+ for k in list(env.keys()):
+ normenv[k] = copy.deepcopy(env[k])
for k in keys:
if k in os.environ and (force or not k in normenv):
- normenv[k] = os.environ[k].encode('mbcs')
+ normenv[k] = os.environ[k]
# This shouldn't be necessary, since the default environment should include system32,
# but keep this here to be safe, since it's needed to find reg.exe which the MSVC
# bat scripts use.
- sys32_dir = os.path.join(os.environ.get("SystemRoot", os.environ.get("windir",r"C:\Windows\system32")),"System32")
+ sys32_dir = os.path.join(os.environ.get("SystemRoot",
+ os.environ.get("windir", r"C:\Windows\system32")),
+ "System32")
if sys32_dir not in normenv['PATH']:
normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_dir
+ # Without Wbem in PATH, vcvarsall.bat has a "'wmic' is not recognized"
+ # error starting with Visual Studio 2017, although the script still
+ # seems to work anyway.
+ sys32_wbem_dir = os.path.join(sys32_dir, 'Wbem')
+ if sys32_wbem_dir not in normenv['PATH']:
+ normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_wbem_dir
+
debug("PATH: %s"%normenv['PATH'])
return normenv
@@ -144,11 +153,13 @@ def get_output(vcbat, args = None, env = None):
# execution to work. This list should really be either directly
# controlled by vc.py, or else derived from the common_tools_var
# settings in vs.py.
- vars = [
+ vs_vc_vars = [
'COMSPEC',
-# VS100 and VS110: Still set, but modern MSVC setup scripts will
-# discard these if registry has values. However Intel compiler setup
-# script still requires these as of 2013/2014.
+ # VS100 and VS110: Still set, but modern MSVC setup scripts will
+ # discard these if registry has values. However Intel compiler setup
+ # script still requires these as of 2013/2014.
+ 'VS140COMNTOOLS',
+ 'VS120COMNTOOLS',
'VS110COMNTOOLS',
'VS100COMNTOOLS',
'VS90COMNTOOLS',
@@ -157,22 +168,22 @@ def get_output(vcbat, args = None, env = None):
'VS70COMNTOOLS',
'VS60COMNTOOLS',
]
- env['ENV'] = normalize_env(env['ENV'], vars, force=False)
+ env['ENV'] = normalize_env(env['ENV'], vs_vc_vars, force=False)
if args:
debug("Calling '%s %s'" % (vcbat, args))
popen = SCons.Action._subproc(env,
- '"%s" %s & set' % (vcbat, args),
- stdin = 'devnull',
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ '"%s" %s & set' % (vcbat, args),
+ stdin='devnull',
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
else:
debug("Calling '%s'" % vcbat)
popen = SCons.Action._subproc(env,
- '"%s" & set' % vcbat,
- stdin = 'devnull',
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ '"%s" & set' % vcbat,
+ stdin='devnull',
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
# Use the .stdout and .stderr attributes directly because the
# .communicate() method uses the threading module on Windows
@@ -195,10 +206,14 @@ 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")):
+ """
+ Parse output from running visual c++/studios vcvarsall.bat and running set
+ To capture the values listed in keep
+ """
+
# dkeep is a dict associating key: path_list, where key is one item from
# keep, and pat_list the associated list of paths
-
dkeep = dict([(i, []) for i in keep])
# rdk will keep the regex to match the .bat file output line starts
@@ -207,22 +222,21 @@ def parse_output(output, keep = ("INCLUDE", "LIB", "LIBPATH", "PATH")):
rdk[i] = re.compile('%s=(.*)' % i, re.I)
def add_env(rmatch, key, dkeep=dkeep):
- plist = rmatch.group(1).split(os.pathsep)
- for p in plist:
+ path_list = rmatch.group(1).split(os.pathsep)
+ for path in path_list:
# Do not add empty paths (when a var ends with ;)
- if p:
- p = p.encode('mbcs')
+ if path:
# XXX: For some reason, VC98 .bat file adds "" around the PATH
# values, and it screws up the environment later, so we strip
# it.
- p = p.strip('"')
- dkeep[key].append(p)
+ path = path.strip('"')
+ dkeep[key].append(str(path))
for line in output.splitlines():
- for k,v in rdk.items():
- m = v.match(line)
- if m:
- add_env(m, k)
+ for k, value in rdk.items():
+ match = value.match(line)
+ if match:
+ add_env(match, k)
return dkeep
diff --git a/src/engine/SCons/Tool/MSCommon/netframework.py b/src/engine/SCons/Tool/MSCommon/netframework.py
index 8d39cf6..b769c44 100644
--- a/src/engine/SCons/Tool/MSCommon/netframework.py
+++ b/src/engine/SCons/Tool/MSCommon/netframework.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """
"""
@@ -29,7 +29,7 @@ import os
import re
import SCons.Util
-from common import read_reg, debug
+from .common import read_reg, debug
# Original value recorded by dcournapeau
_FRAMEWORKDIR_HKEY_ROOT = r'Software\Microsoft\.NETFramework\InstallRoot'
@@ -40,13 +40,13 @@ def find_framework_root():
# XXX: find it from environment (FrameworkDir)
try:
froot = read_reg(_FRAMEWORKDIR_HKEY_ROOT)
- debug("Found framework install root in registry: %s" % froot)
- except SCons.Util.WinError, e:
- debug("Could not read reg key %s" % _FRAMEWORKDIR_HKEY_ROOT)
+ debug("Found framework install root in registry: {}".format(froot))
+ except SCons.Util.WinError as e:
+ debug("Could not read reg key {}".format(_FRAMEWORKDIR_HKEY_ROOT))
return None
if not os.path.exists(froot):
- debug("%s not found on fs" % froot)
+ debug("{} not found on fs".format(froot))
return None
return froot
diff --git a/src/engine/SCons/Tool/MSCommon/sdk.py b/src/engine/SCons/Tool/MSCommon/sdk.py
index 53bb8aa..8bc9830 100644
--- a/src/engine/SCons/Tool/MSCommon/sdk.py
+++ b/src/engine/SCons/Tool/MSCommon/sdk.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Module to detect the Platform/Windows SDK
@@ -33,7 +33,7 @@ import os
import SCons.Errors
import SCons.Util
-import common
+from . import common
debug = common.debug
@@ -76,23 +76,23 @@ class SDKDefinition(object):
return None
hkey = self.HKEY_FMT % self.hkey_data
- debug('find_sdk_dir(): checking registry:%s'%hkey)
+ debug('find_sdk_dir(): checking registry:{}'.format(hkey))
try:
sdk_dir = common.read_reg(hkey)
- except SCons.Util.WinError, e:
- debug('find_sdk_dir(): no SDK registry key %s' % repr(hkey))
+ except SCons.Util.WinError as e:
+ debug('find_sdk_dir(): no SDK registry key {}'.format(repr(hkey)))
return None
- debug('find_sdk_dir(): Trying SDK Dir: %s'%sdk_dir)
+ debug('find_sdk_dir(): Trying SDK Dir: {}'.format(sdk_dir))
if not os.path.exists(sdk_dir):
- debug('find_sdk_dir(): %s not on file system' % sdk_dir)
+ debug('find_sdk_dir(): {} not on file system'.format(sdk_dir))
return None
ftc = os.path.join(sdk_dir, self.sanity_check_file)
if not os.path.exists(ftc):
- debug("find_sdk_dir(): sanity check %s not found" % ftc)
+ debug("find_sdk_dir(): sanity check {} not found".format(ftc))
return None
return sdk_dir
@@ -105,7 +105,7 @@ class SDKDefinition(object):
sdk_dir = self.find_sdk_dir()
self._sdk_dir = sdk_dir
return sdk_dir
-
+
def get_sdk_vc_script(self,host_arch, target_arch):
""" Return the script to initialize the VC compiler installed by SDK
"""
@@ -113,11 +113,11 @@ class SDKDefinition(object):
if (host_arch == 'amd64' and target_arch == 'x86'):
# No cross tools needed compiling 32 bits on 64 bit machine
host_arch=target_arch
-
+
arch_string=target_arch
if (host_arch != target_arch):
arch_string='%s_%s'%(host_arch,target_arch)
-
+
debug("sdk.py: get_sdk_vc_script():arch_string:%s host_arch:%s target_arch:%s"%(arch_string,
host_arch,
target_arch))
@@ -164,6 +164,12 @@ SDK70VCSetupScripts = { 'x86' : r'bin\vcvars32.bat',
'x86_ia64' : r'bin\vcvarsx86_ia64.bat',
'ia64' : r'bin\vcvarsia64.bat'}
+SDK100VCSetupScripts = {'x86' : r'bin\vcvars32.bat',
+ 'amd64' : r'bin\vcvars64.bat',
+ 'x86_amd64': r'bin\x86_amd64\vcvarsx86_amd64.bat',
+ 'x86_arm' : r'bin\x86_arm\vcvarsx86_arm.bat'}
+
+
# The list of support SDKs which we know how to detect.
#
# The first SDK found in the list is the one used by default if there
@@ -172,6 +178,16 @@ SDK70VCSetupScripts = { 'x86' : r'bin\vcvars32.bat',
#
# If you update this list, update the documentation in Tool/mssdk.xml.
SupportedSDKList = [
+ WindowsSDK('10.0',
+ sanity_check_file=r'bin\SetEnv.Cmd',
+ include_subdir='include',
+ lib_subdir={
+ 'x86' : ['lib'],
+ 'x86_64' : [r'lib\x64'],
+ 'ia64' : [r'lib\ia64'],
+ },
+ vc_setup_scripts = SDK70VCSetupScripts,
+ ),
WindowsSDK('7.1',
sanity_check_file=r'bin\SetEnv.Cmd',
include_subdir='include',
@@ -308,8 +324,7 @@ def set_sdk_by_directory(env, sdk_dir):
def get_sdk_by_version(mssdk):
if mssdk not in SupportedSDKMap:
- msg = "SDK version %s is not supported" % repr(mssdk)
- raise SCons.Errors.UserError(msg)
+ raise SCons.Errors.UserError("SDK version {} is not supported".format(repr(mssdk)))
get_installed_sdks()
return InstalledSDKMap.get(mssdk)
@@ -327,16 +342,16 @@ def mssdk_setup_env(env):
if sdk_dir is None:
return
sdk_dir = env.subst(sdk_dir)
- debug('sdk.py:mssdk_setup_env: Using MSSDK_DIR:%s'%sdk_dir)
+ debug('sdk.py:mssdk_setup_env: Using MSSDK_DIR:{}'.format(sdk_dir))
elif 'MSSDK_VERSION' in env:
sdk_version = env['MSSDK_VERSION']
if sdk_version is None:
- msg = "SDK version is specified as None"
+ msg = "SDK version is specified as None"
raise SCons.Errors.UserError(msg)
sdk_version = env.subst(sdk_version)
mssdk = get_sdk_by_version(sdk_version)
if mssdk is None:
- msg = "SDK version %s is not installed" % sdk_version
+ msg = "SDK version %s is not installed" % sdk_version
raise SCons.Errors.UserError(msg)
sdk_dir = mssdk.get_sdk_dir()
debug('sdk.py:mssdk_setup_env: Using MSSDK_VERSION:%s'%sdk_dir)
@@ -347,7 +362,7 @@ def mssdk_setup_env(env):
debug('sdk.py:mssdk_setup_env thinks msvs_version is None')
return
msvs_version = env.subst(msvs_version)
- import vs
+ from . import vs
msvs = vs.get_vs_by_version(msvs_version)
debug('sdk.py:mssdk_setup_env:msvs is :%s'%msvs)
if not msvs:
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py
index ca8a2da..fba86af 100644
--- a/src/engine/SCons/Tool/MSCommon/vc.py
+++ b/src/engine/SCons/Tool/MSCommon/vc.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,24 +30,25 @@
# * test on 64 bits XP + VS 2005 (and VS 6 if possible)
# * SDK
# * Assembly
-__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Module for Visual C/C++ detection and configuration.
"""
import SCons.compat
import SCons.Util
+import subprocess
import os
import platform
from string import digits as string_digits
import SCons.Warnings
-import common
+from . import common
debug = common.debug
-import sdk
+from . import sdk
get_installed_sdks = sdk.get_installed_sdks
@@ -108,7 +109,7 @@ def get_host_target(env):
# PROCESSOR_ARCHITECTURE.
if not host_platform:
host_platform = os.environ.get('PROCESSOR_ARCHITECTURE', '')
-
+
# Retain user requested TARGET_ARCH
req_target_platform = env.get('TARGET_ARCH')
debug('vc.py:get_host_target() req_target_platform:%s'%req_target_platform)
@@ -118,26 +119,28 @@ def get_host_target(env):
target_platform = req_target_platform
else:
target_platform = host_platform
-
+
try:
host = _ARCH_TO_CANONICAL[host_platform.lower()]
- except KeyError, e:
+ except KeyError as e:
msg = "Unrecognized host architecture %s"
raise ValueError(msg % repr(host_platform))
try:
target = _ARCH_TO_CANONICAL[target_platform.lower()]
- except KeyError, e:
- all_archs = str(_ARCH_TO_CANONICAL.keys())
+ except KeyError as e:
+ all_archs = str(list(_ARCH_TO_CANONICAL.keys()))
raise ValueError("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs))
return (host, target,req_target_platform)
# If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the
# MSVC_VERSION documentation in Tool/msvc.xml.
-_VCVER = ["14.0", "14.0Exp", "12.0", "12.0Exp", "11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"]
+_VCVER = ["14.1", "14.0", "14.0Exp", "12.0", "12.0Exp", "11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"]
_VCVER_TO_PRODUCT_DIR = {
+ '14.1' : [
+ (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # Visual Studio 2017 doesn't set this registry key anymore
'14.0' : [
(SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\14.0\Setup\VC\ProductDir')],
'14.0Exp' : [
@@ -183,19 +186,19 @@ _VCVER_TO_PRODUCT_DIR = {
(SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++\ProductDir'),
]
}
-
+
def msvc_version_to_maj_min(msvc_version):
- msvc_version_numeric = ''.join([x for x in msvc_version if x in string_digits + '.'])
-
- t = msvc_version_numeric.split(".")
- if not len(t) == 2:
- raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric))
- try:
- maj = int(t[0])
- min = int(t[1])
- return maj, min
- except ValueError, e:
- raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric))
+ msvc_version_numeric = ''.join([x for x in msvc_version if x in string_digits + '.'])
+
+ t = msvc_version_numeric.split(".")
+ if not len(t) == 2:
+ raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric))
+ try:
+ maj = int(t[0])
+ min = int(t[1])
+ return maj, min
+ except ValueError as e:
+ 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
@@ -222,6 +225,35 @@ def is_host_target_supported(host_target, msvc_version):
return True
+
+def find_vc_pdir_vswhere(msvc_version):
+ """
+ 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
+ """
+ vswhere_path = os.path.join(
+ 'C:\\',
+ 'Program Files (x86)',
+ 'Microsoft Visual Studio',
+ 'Installer',
+ 'vswhere.exe'
+ )
+ vswhere_cmd = [vswhere_path, '-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')
+ return vc_pdir
+ else:
+ # No vswhere on system, no install info available
+ return None
+
+
def find_vc_pdir(msvc_version):
"""Try to find the product directory for the given
version.
@@ -240,26 +272,31 @@ def find_vc_pdir(msvc_version):
for hkroot, key in hkeys:
try:
comps = None
- if common.is_win64():
- try:
- # ordinally at win64, try Wow6432Node first.
- comps = common.read_reg(root + 'Wow6432Node\\' + key, hkroot)
- except SCons.Util.WinError, e:
- # at Microsoft Visual Studio for Python 2.7, value is not in Wow6432Node
- pass
- if not comps:
- # not Win64, or Microsoft Visual Studio for Python 2.7
- comps = common.read_reg(root + key, hkroot)
- except SCons.Util.WinError, e:
- debug('find_vc_dir(): no VC registry key %s' % repr(key))
+ 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)))
+ raise SCons.Util.WinError
+ else:
+ if common.is_win64():
+ try:
+ # ordinally at win64, try Wow6432Node first.
+ comps = common.read_reg(root + 'Wow6432Node\\' + key, hkroot)
+ except SCons.Util.WinError as e:
+ # at Microsoft Visual Studio for Python 2.7, value is not in Wow6432Node
+ pass
+ if not comps:
+ # not Win64, or Microsoft Visual Studio for Python 2.7
+ comps = common.read_reg(root + key, hkroot)
+ except SCons.Util.WinError as e:
+ debug('find_vc_dir(): no VC registry key {}'.format(repr(key)))
else:
- debug('find_vc_dir(): found VC in registry: %s' % comps)
+ debug('find_vc_dir(): found VC in registry: {}'.format(comps))
if os.path.exists(comps):
return comps
else:
- debug('find_vc_dir(): reg says dir is %s, but it does not exist. (ignoring)'\
- % comps)
- raise MissingConfiguration("registry dir %s not found on the filesystem" % comps)
+ debug('find_vc_dir(): reg says dir is {}, but it does not exist. (ignoring)'.format(comps))
+ raise MissingConfiguration("registry dir {} not found on the filesystem".format(comps))
return None
def find_batch_file(env,msvc_version,host_arch,target_arch):
@@ -270,8 +307,8 @@ def find_batch_file(env,msvc_version,host_arch,target_arch):
pdir = find_vc_pdir(msvc_version)
if pdir is None:
raise NoVersionFound("No version of Visual Studio found")
-
- debug('vc.py: find_batch_file() pdir:%s'%pdir)
+
+ debug('vc.py: find_batch_file() pdir:{}'.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 + "."])
@@ -282,13 +319,15 @@ def find_batch_file(env,msvc_version,host_arch,target_arch):
elif vernum < 7:
pdir = os.path.join(pdir, "Bin")
batfilename = os.path.join(pdir, "vcvars32.bat")
- else: # >= 8
+ elif 8 <= vernum <= 14:
batfilename = os.path.join(pdir, "vcvarsall.bat")
+ else: # vernum >= 14.1 VS2017 and above
+ batfilename = os.path.join(pdir, "Auxiliary", "Build", "vcvarsall.bat")
if not os.path.exists(batfilename):
debug("Not found: %s" % batfilename)
batfilename = None
-
+
installed_sdks=get_installed_sdks()
for _sdk in installed_sdks:
sdk_bat_file = _sdk.get_sdk_vc_script(host_arch,target_arch)
@@ -296,7 +335,7 @@ def find_batch_file(env,msvc_version,host_arch,target_arch):
debug("vc.py:find_batch_file() not found:%s"%_sdk)
else:
sdk_bat_file_path = os.path.join(pdir,sdk_bat_file)
- if os.path.exists(sdk_bat_file_path):
+ if os.path.exists(sdk_bat_file_path):
debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path)
return (batfilename,sdk_bat_file_path)
return (batfilename,None)
@@ -323,7 +362,7 @@ def get_installed_vcs():
installed_versions.append(ver)
else:
debug('find_vc_pdir return None for ver %s' % ver)
- except VisualCException, e:
+ except VisualCException as e:
debug('did not find VC %s: caught exception %s' % (ver, str(e)))
return installed_versions
@@ -359,7 +398,7 @@ def get_default_version(env):
msvc_version = env.get('MSVC_VERSION')
msvs_version = env.get('MSVS_VERSION')
-
+
debug('get_default_version(): msvc_version:%s msvs_version:%s'%(msvc_version,msvs_version))
if msvs_version and not msvc_version:
@@ -409,7 +448,7 @@ def msvc_find_valid_batch_script(env,version):
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
+ # 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'):
try_target_archs.append('x86_amd64')
@@ -427,7 +466,7 @@ def msvc_find_valid_batch_script(env,version):
for tp in try_target_archs:
# Set to current arch.
env['TARGET_ARCH']=tp
-
+
debug("vc.py:msvc_find_valid_batch_script() trying target_platform:%s"%tp)
host_target = (host_platform, tp)
if not is_host_target_supported(host_target, version):
@@ -436,11 +475,19 @@ def msvc_find_valid_batch_script(env,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+
+ if maj >= 14:
+ if env.get('MSVC_UWP_APP') == '1':
+ # Initialize environment variables with store/universal paths
+ arg += ' store'
+
# Try to locate a batch file for this host/target platform combo
try:
(vc_script,sdk_script) = find_batch_file(env,version,host_platform,tp)
debug('vc.py:msvc_find_valid_batch_script() vc_script:%s sdk_script:%s'%(vc_script,sdk_script))
- except VisualCException, e:
+ except VisualCException as e:
msg = str(e)
debug('Caught exception while looking for batch file (%s)' % msg)
warn_msg = "VC version %s not installed. " + \
@@ -449,13 +496,13 @@ def msvc_find_valid_batch_script(env,version):
warn_msg = warn_msg % (version, cached_get_installed_vcs())
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))
if vc_script:
try:
d = script_env(vc_script, args=arg)
- except BatchFileExecutionError, e:
+ 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
continue
@@ -463,23 +510,23 @@ 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)
- except BatchFileExecutionError,e:
+ 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
elif not vc_script and not sdk_script:
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))
break # We've found a working target_platform, so stop looking
-
+
# If we cannot find a viable installed compiler, reset the TARGET_ARCH
# To it's initial value
if not d:
env['TARGET_ARCH']=req_target_platform
-
+
return d
-
+
def msvc_setup_env(env):
debug('msvc_setup_env()')
@@ -498,12 +545,12 @@ def msvc_setup_env(env):
env['MSVS_VERSION'] = version
env['MSVS'] = {}
-
+
use_script = env.get('MSVC_USE_SCRIPT', True)
if SCons.Util.is_String(use_script):
debug('vc.py:msvc_setup_env() use_script 1 %s\n' % repr(use_script))
d = script_env(use_script)
- elif use_script:
+ elif use_script:
d = msvc_find_valid_batch_script(env,version)
debug('vc.py:msvc_setup_env() use_script 2 %s\n' % d)
if not d:
@@ -524,4 +571,3 @@ def msvc_exists(version=None):
if version is None:
return len(vcs) > 0
return version in vcs
-
diff --git a/src/engine/SCons/Tool/MSCommon/vs.py b/src/engine/SCons/Tool/MSCommon/vs.py
index 1f04cbe..dafdbaf 100644
--- a/src/engine/SCons/Tool/MSCommon/vs.py
+++ b/src/engine/SCons/Tool/MSCommon/vs.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """Module to detect Visual Studio and/or Visual C/C++
"""
@@ -31,7 +31,7 @@ import os
import SCons.Errors
import SCons.Util
-from common import debug, \
+from .common import debug, \
get_output, \
is_win64, \
normalize_env, \
@@ -83,10 +83,10 @@ class VisualStudio(object):
key = root + key
try:
comps = read_reg(key)
- except SCons.Util.WinError, e:
- debug('find_vs_dir_by_reg(): no VS registry key %s' % repr(key))
+ except SCons.Util.WinError as e:
+ debug('find_vs_dir_by_reg(): no VS registry key {}'.format(repr(key)))
else:
- debug('find_vs_dir_by_reg(): found VS in registry: %s' % comps)
+ debug('find_vs_dir_by_reg(): found VS in registry: {}'.format(comps))
return comps
return None
@@ -105,12 +105,12 @@ class VisualStudio(object):
def find_executable(self):
vs_dir = self.get_vs_dir()
if not vs_dir:
- debug('find_executable(): no vs_dir (%s)'%vs_dir)
+ debug('find_executable(): no vs_dir ({})'.format(vs_dir))
return None
executable = os.path.join(vs_dir, self.executable_path)
executable = os.path.normpath(executable)
if not os.path.isfile(executable):
- debug('find_executable(): %s not on file system' % executable)
+ debug('find_executable(): {} not on file system'.format(executable))
return None
return executable
@@ -199,17 +199,28 @@ class VisualStudio(object):
# Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml.
SupportedVSList = [
+ # Visual Studio 2017
+ VisualStudio('14.1',
+ vc_version='14.1',
+ sdk_version='10.0A',
+ hkeys=[],
+ common_tools_var='VS150COMNTOOLS',
+ executable_path=r'Common7\IDE\devenv.com',
+ batch_file_path=r'VC\Auxiliary\Build\vsvars32.bat',
+ supported_arch=['x86', 'amd64', "arm"],
+ ),
+
# Visual Studio 2015
VisualStudio('14.0',
vc_version='14.0',
- sdk_version='10.0A',
+ sdk_version='10.0',
hkeys=[r'Microsoft\VisualStudio\14.0\Setup\VS\ProductDir'],
common_tools_var='VS140COMNTOOLS',
executable_path=r'Common7\IDE\devenv.com',
batch_file_path=r'Common7\Tools\vsvars32.bat',
supported_arch=['x86', 'amd64', "arm"],
),
-
+
# Visual C++ 2015 Express Edition (for Desktop)
VisualStudio('14.0Exp',
vc_version='14.0',
diff --git a/src/engine/SCons/Tool/Perforce.py b/src/engine/SCons/Tool/Perforce.py
deleted file mode 100644
index 212150a..0000000
--- a/src/engine/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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 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/engine/SCons/Tool/Perforce.xml b/src/engine/SCons/Tool/Perforce.xml
deleted file mode 100644
index 2431c72..0000000
--- a/src/engine/SCons/Tool/Perforce.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
-
-This file is processed by the bin/SConsDoc.py module.
-See its __doc__ string for a discussion of the format.
--->
-
-<!DOCTYPE sconsdoc [
-<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
-%scons;
-<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
-%builders-mod;
-<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
-%functions-mod;
-<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
-%tools-mod;
-<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
-%variables-mod;
-]>
-
-<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
-
-<tool name="Perforce">
-<summary>
-<para>
-Sets construction variables for interacting with the
-Perforce source code management system.
-</para>
-</summary>
-<sets>
-<item>P4</item>
-<item>P4FLAGS</item>
-<item>P4COM</item>
-</sets>
-<uses>
-<item>P4COMSTR</item>
-</uses>
-</tool>
-
-<cvar name="P4">
-<summary>
-<para>
-The Perforce executable.
-</para>
-</summary>
-</cvar>
-
-<cvar name="P4COM">
-<summary>
-<para>
-The command line used to
-fetch source files from Perforce.
-</para>
-</summary>
-</cvar>
-
-<cvar name="P4COMSTR">
-<summary>
-<para>
-The string displayed when
-fetching a source file from Perforce.
-If this is not set, then &cv-link-P4COM; (the command line) is displayed.
-</para>
-</summary>
-</cvar>
-
-<cvar name="P4FLAGS">
-<summary>
-<para>
-General options that are passed to Perforce.
-</para>
-</summary>
-</cvar>
-
-<scons_function name="Perforce">
-<arguments signature="env">
-()
-</arguments>
-<summary>
-<para>
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from the Perforce source code management system.
-The returned Builder
-is intended to be passed to the
-&f-SourceCode;
-function.
-</para>
-
-<para>
-This function is deprecated. For details, see the entry for the
-&f-SourceCode;
-function.
-</para>
-
-<para>
-Example:
-</para>
-
-<example_commands>
-env.SourceCode('.', env.Perforce())
-</example_commands>
-
-<para>
-Perforce uses a number of external
-environment variables for its operation.
-Consequently, this function adds the
-following variables from the user's external environment
-to the construction environment's
-ENV dictionary:
-P4CHARSET,
-P4CLIENT,
-P4LANGUAGE,
-P4PASSWD,
-P4PORT,
-P4USER,
-SystemRoot,
-USER,
-and
-USERNAME.
-</para>
-</summary>
-</scons_function>
-
-</sconsdoc>
diff --git a/src/engine/SCons/Tool/PharLapCommon.py b/src/engine/SCons/Tool/PharLapCommon.py
index ccc2004..c45c6d3 100644
--- a/src/engine/SCons/Tool/PharLapCommon.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/PharLapCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
diff --git a/src/engine/SCons/Tool/RCS.xml b/src/engine/SCons/Tool/RCS.xml
deleted file mode 100644
index 3c034e4..0000000
--- a/src/engine/SCons/Tool/RCS.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
-
-This file is processed by the bin/SConsDoc.py module.
-See its __doc__ string for a discussion of the format.
--->
-
-<!DOCTYPE sconsdoc [
-<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
-%scons;
-<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
-%builders-mod;
-<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
-%functions-mod;
-<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
-%tools-mod;
-<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
-%variables-mod;
-]>
-
-<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
-
-<tool name="RCS">
-<summary>
-<para>
-Sets construction variables for the interaction
-with the Revision Control System.
-</para>
-</summary>
-<sets>
-<item>RCS</item>
-<item>RCS_CO</item>
-<item>RCS_COFLAGS</item>
-<item>RCS_COCOM</item>
-</sets>
-<uses>
-<item>RCS_COCOMSTR</item>
-</uses>
-</tool>
-
-<cvar name="RCS">
-<summary>
-<para>
-The RCS executable.
-Note that this variable is not actually used
-for the command to fetch source files from RCS;
-see the
-&cv-link-RCS_CO;
-construction variable, below.
-</para>
-</summary>
-</cvar>
-
-<cvar name="RCS_CO">
-<summary>
-<para>
-The RCS "checkout" executable,
-used to fetch source files from RCS.
-</para>
-</summary>
-</cvar>
-
-<cvar name="RCS_COCOM">
-<summary>
-<para>
-The command line used to
-fetch (checkout) source files from RCS.
-</para>
-</summary>
-</cvar>
-
-<cvar name="RCS_COCOMSTR">
-<summary>
-<para>
-The string displayed when fetching
-a source file from RCS.
-If this is not set, then &cv-link-RCS_COCOM;
-(the command line) is displayed.
-</para>
-</summary>
-</cvar>
-
-<cvar name="RCS_COFLAGS">
-<summary>
-<para>
-Options that are passed to the &cv-link-RCS_CO; command.
-</para>
-</summary>
-</cvar>
-
-<scons_function name="RCS">
-<arguments signature="env">
-()
-</arguments>
-<summary>
-<para>
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from RCS.
-The returned Builder
-is intended to be passed to the
-&f-SourceCode;
-function:
-</para>
-
-<para>
-This function is deprecated. For details, see the entry for the
-&f-SourceCode;
-function.
-</para>
-
-<para>
-Examples:
-</para>
-
-<example_commands>
-env.SourceCode('.', env.RCS())
-</example_commands>
-
-<para>
-Note that
-&scons;
-will fetch source files
-from RCS subdirectories automatically,
-so configuring RCS
-as demonstrated in the above example
-should only be necessary if
-you are fetching from
-RCS,v
-files in the same
-directory as the source files,
-or if you need to explicitly specify RCS
-for a specific subdirectory.
-</para>
-</summary>
-</scons_function>
-
-</sconsdoc>
diff --git a/src/engine/SCons/Tool/SCCS.xml b/src/engine/SCons/Tool/SCCS.xml
deleted file mode 100644
index 97c72a9..0000000
--- a/src/engine/SCons/Tool/SCCS.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
-
-This file is processed by the bin/SConsDoc.py module.
-See its __doc__ string for a discussion of the format.
--->
-
-<!DOCTYPE sconsdoc [
-<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
-%scons;
-<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
-%builders-mod;
-<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
-%functions-mod;
-<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
-%tools-mod;
-<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
-%variables-mod;
-]>
-
-<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
-
-<tool name="SCCS">
-<summary>
-<para>
-Sets construction variables for interacting with the
-Source Code Control System.
-</para>
-</summary>
-<sets>
-<item>SCCS</item>
-<item>SCCSFLAGS</item>
-<item>SCCSGETFLAGS</item>
-<item>SCCSCOM</item>
-</sets>
-<uses>
-<item>SCCSCOMSTR</item>
-</uses>
-</tool>
-
-<cvar name="SCCS">
-<summary>
-<para>
-The SCCS executable.
-</para>
-</summary>
-</cvar>
-
-<cvar name="SCCSCOM">
-<summary>
-<para>
-The command line used to
-fetch source files from SCCS.
-</para>
-</summary>
-</cvar>
-
-<cvar name="SCCSCOMSTR">
-<summary>
-<para>
-The string displayed when fetching
-a source file from a CVS repository.
-If this is not set, then &cv-link-SCCSCOM;
-(the command line) is displayed.
-</para>
-</summary>
-</cvar>
-
-<cvar name="SCCSFLAGS">
-<summary>
-<para>
-General options that are passed to SCCS.
-</para>
-</summary>
-</cvar>
-
-<cvar name="SCCSGETFLAGS">
-<summary>
-<para>
-Options that are passed specifically to the SCCS "get" subcommand.
-This can be set, for example, to
-<option>-e</option>
-to check out editable files from SCCS.
-</para>
-</summary>
-</cvar>
-
-<scons_function name="SCCS">
-<arguments signature="env">
-()
-</arguments>
-<summary>
-<para>
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from SCCS.
-The returned Builder
-is intended to be passed to the
-&f-link-SourceCode;
-function.
-</para>
-
-<para>
-Example:
-</para>
-
-<example_commands>
-env.SourceCode('.', env.SCCS())
-</example_commands>
-
-<para>
-Note that
-&scons;
-will fetch source files
-from SCCS subdirectories automatically,
-so configuring SCCS
-as demonstrated in the above example
-should only be necessary if
-you are fetching from
-<filename>s.SCCS</filename>
-files in the same
-directory as the source files,
-or if you need to explicitly specify SCCS
-for a specific subdirectory.
-</para>
-</summary>
-</scons_function>
-
-</sconsdoc>
diff --git a/src/engine/SCons/Tool/Subversion.xml b/src/engine/SCons/Tool/Subversion.xml
deleted file mode 100644
index 2d8fd26..0000000
--- a/src/engine/SCons/Tool/Subversion.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
-
-This file is processed by the bin/SConsDoc.py module.
-See its __doc__ string for a discussion of the format.
--->
-
-<!DOCTYPE sconsdoc [
-<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
-%scons;
-<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
-%builders-mod;
-<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
-%functions-mod;
-<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
-%tools-mod;
-<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
-%variables-mod;
-]>
-
-<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
-
-<!--
-<tool name="Subversion">
-<summary>
-<para>
-Sets construction variables for interacting with Subversion.
-</para>
-</summary>
-<sets>
-<item>SVN</item>
-<item>SVNFLAGS</item>
-<item>SVNCOM</item>
-</sets>
-<uses>
-<item>SVNCOMSTR</item>
-</uses>
-</tool>
--->
-
-<!--
-<cvar name="SVN">
-<summary>
-<para>
-The Subversion executable (usually named
-<command>svn</command>).
-</para>
-</summary>
-</cvar>
--->
-
-<!--
-<cvar name="SVNCOM">
-<summary>
-<para>
-The command line used to
-fetch source files from a Subversion repository.
-</para>
-</summary>
-</cvar>
--->
-
-<!--
-<cvar name="SVNFLAGS">
-<summary>
-<para>
-General options that are passed to Subversion.
-</para>
-</summary>
-</cvar>
--->
-
-<!--
-<scons_function name="Subversion">
-<arguments signature="global">
-(repository, module)
-</arguments>
-<summary>
-<para>
-A factory function that
-returns a Builder object
-to be used to fetch source files
-from the specified Subversion
-<varname>repository</varname>.
-The returned Builder
-is intended to be passed to the
-&f-link-SourceCode;
-function.
-</para>
-
-<para>
-The optional specified
-<varname>module</varname>
-will be added to the beginning
-of all repository path names;
-this can be used, in essence,
-to strip initial directory names
-from the repository path names,
-so that you only have to
-replicate part of the repository
-directory hierarchy in your
-local build directory.
-</para>
-
-<para>
-This function is deprecated, see the entry for the
-&f-SourceCode;
-function.
-</para>
-
-<para>
-Example:
-</para>
-
-<example_commands>
-# Will fetch foo/bar/src.c
-# from /usr/local/Subversion/foo/bar/src.c.
-env.SourceCode('.', env.Subversion('file:///usr/local/Subversion'))
-
-# Will fetch bar/src.c
-# from /usr/local/Subversion/foo/bar/src.c.
-env.SourceCode('.', env.Subversion('file:///usr/local/Subversion', 'foo'))
-
-# Will fetch src.c
-# from /usr/local/Subversion/foo/bar/src.c.
-env.SourceCode('.', env.Subversion('file:///usr/local/Subversion', 'foo/bar'))
-</example_commands>
-</summary>
-</scons_function>
--->
-
-</sconsdoc>
diff --git a/src/engine/SCons/Tool/ToolTests.py b/src/engine/SCons/Tool/ToolTests.py
index 0739063..f5678c1 100644
--- a/src/engine/SCons/Tool/ToolTests.py
+++ b/src/engine/SCons/Tool/ToolTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/ToolTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ToolTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 274b563..9265b81 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -14,7 +14,7 @@ tool definition.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,14 +35,16 @@ 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import imp
+import importlib
import sys
import re
import os
import shutil
+
import SCons.Builder
import SCons.Errors
import SCons.Node.FS
@@ -52,6 +54,7 @@ import SCons.Scanner.D
import SCons.Scanner.LaTeX
import SCons.Scanner.Prog
import SCons.Scanner.SWIG
+import collections
DefaultToolpath=[]
@@ -94,9 +97,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 +121,124 @@ 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)
+ if sys_modules_value and sys_modules_value.__file__ == spec.origin:
+ return 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)
+
+ return module
+
+
+ sys.path = oldpythonpath
full_name = 'SCons.Tool.' + self.name
try:
@@ -144,13 +247,12 @@ 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:
+ except ImportError as e:
if str(e)!="No module named %s"%self.name:
raise SCons.Errors.EnvironmentError(e)
try:
@@ -159,10 +261,10 @@ class Tool(object):
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)
@@ -217,6 +319,7 @@ def createProgBuilder(env):
return program
+
def createStaticLibBuilder(env):
"""This is a utility function that creates the StaticLibrary
Builder in an Environment if it is not there already.
@@ -228,7 +331,7 @@ def createStaticLibBuilder(env):
static_lib = env['BUILDERS']['StaticLibrary']
except KeyError:
action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ]
- if env.Detect('ranlib'):
+ if env.get('RANLIB',False) or env.Detect('ranlib'):
ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR")
action_list.append(ranlib_action)
@@ -254,22 +357,22 @@ 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
@@ -388,7 +491,7 @@ class _LibInfoGeneratorBase(object):
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
@@ -407,17 +510,17 @@ class _LibPrefixGenerator(_LibInfoGeneratorBase):
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')
@@ -441,17 +544,17 @@ 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')
@@ -474,15 +577,15 @@ 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)
@@ -490,7 +593,7 @@ class _LibSymlinkGenerator(_LibInfoGeneratorBase):
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')
@@ -499,7 +602,7 @@ 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,7 +612,7 @@ 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,11 +628,11 @@ 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:
@@ -541,7 +644,7 @@ class _LibNameGenerator(_LibInfoGeneratorBase):
name = os.path.basename(libnode.get_path())
if Verbose:
- print '_LibNameGenerator: return name=%r' % name
+ print('_LibNameGenerator: return name=%r' % name)
return name
@@ -550,7 +653,7 @@ 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,13 +669,13 @@ 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)
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)
@@ -582,10 +685,10 @@ class _LibSonameGenerator(_LibInfoGeneratorBase):
# 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
@@ -613,39 +716,39 @@ def EmitLibSymlinks(env, symlinks, libnode, **kw):
clean_targets = kw.get('clean_targets', [])
if not SCons.Util.is_List(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)
+ 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))
+ 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)
+ 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
+ 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)
+ print("CreateLibSymlinks: add symlink %r -> %r" % (link, linktgt))
return 0
def LibSymlinksActionFunction(target, source, env):
@@ -670,10 +773,11 @@ def LibSymlinksStrFun(target, source, env, *args):
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.
@@ -810,7 +914,7 @@ def CreateJarBuilder(env):
jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR')
java_jar = SCons.Builder.Builder(action = jar_com,
suffix = '$JARSUFFIX',
- src_suffix = '$JAVACLASSSUFIX',
+ src_suffix = '$JAVACLASSSUFFIX',
src_builder = 'JavaClassFile',
source_factory = fs.Entry)
env['BUILDERS']['Jar'] = java_jar
@@ -890,9 +994,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__)
@@ -949,13 +1053,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)
@@ -1005,7 +1109,7 @@ def tool_list(platform, env):
"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' ]
+ 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']
@@ -1014,7 +1118,7 @@ def tool_list(platform, env):
"prefer IBM tools on OS/2"
linkers = ['ilink', 'gnulink', ]#'mslink']
c_compilers = ['icc', 'gcc',]# 'msvc', 'cc']
- cxx_compilers = ['icc', 'g++',]# 'msvc', 'c++']
+ cxx_compilers = ['icc', 'g++',]# 'msvc', 'cxx']
assemblers = ['nasm',]# 'masm', 'gas']
fortran_compilers = ['ifl', 'g77']
ars = ['ar',]# 'mslib']
@@ -1022,7 +1126,7 @@ def tool_list(platform, env):
"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 +1134,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 +1143,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 +1151,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 +1159,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 +1167,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,7 +1206,7 @@ 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 + [
@@ -1121,9 +1225,6 @@ def tool_list(platform, env):
'tex', 'latex', 'pdflatex', 'pdftex',
# Archivers
'tar', 'zip',
- # SourceCode factories
- 'BitKeeper', 'CVS', 'Perforce',
- 'RCS', 'SCCS', # 'Subversion',
], env)
tools = ([linker, c_compiler, cxx_compiler,
@@ -1137,4 +1238,3 @@ def tool_list(platform, env):
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
-
diff --git a/src/engine/SCons/Tool/__init__.xml b/src/engine/SCons/Tool/__init__.xml
index d66b04a..32b8ce6 100644
--- a/src/engine/SCons/Tool/__init__.xml
+++ b/src/engine/SCons/Tool/__init__.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/aixc++.py b/src/engine/SCons/Tool/aixc++.py
index 77d192a..0a2465d 100644
--- a/src/engine/SCons/Tool/aixc++.py
+++ b/src/engine/SCons/Tool/aixc++.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,42 +31,10 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/aixc++.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixc++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import os.path
-
-import SCons.Platform.aix
-
-cplusplus = __import__('c++', globals(), locals(), [])
-
-packages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp']
-
-def get_xlc(env):
- xlc = env.get('CXX', 'xlC')
- return SCons.Platform.aix.get_xlc(env, xlc, packages)
-
-def generate(env):
- """Add Builders and construction variables for xlC / Visual Age
- suite to an Environment."""
- path, _cxx, version = get_xlc(env)
- if path and _cxx:
- _cxx = os.path.join(path, _cxx)
-
- if 'CXX' not in env:
- env['CXX'] = _cxx
-
- cplusplus.generate(env)
-
- if version:
- env['CXXVERSION'] = version
-
-def exists(env):
- path, _cxx, version = get_xlc(env)
- if path and _cxx:
- xlc = os.path.join(path, _cxx)
- if os.path.exists(xlc):
- return xlc
- return None
+#forward proxy to the preffered cxx version
+from SCons.Tool.aixcxx import *
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/aixc++.xml b/src/engine/SCons/Tool/aixc++.xml
index 5017357..04a27f6 100644
--- a/src/engine/SCons/Tool/aixc++.xml
+++ b/src/engine/SCons/Tool/aixc++.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/aixcc.py b/src/engine/SCons/Tool/aixcc.py
index bee2b99..aa351cd 100644
--- a/src/engine/SCons/Tool/aixcc.py
+++ b/src/engine/SCons/Tool/aixcc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixcc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import SCons.Platform.aix
-import cc
+from . import cc
packages = ['vac.C', 'ibmcxx.cmp']
diff --git a/src/engine/SCons/Tool/aixcc.xml b/src/engine/SCons/Tool/aixcc.xml
index 9157151..44ee0bc 100644
--- a/src/engine/SCons/Tool/aixcc.xml
+++ b/src/engine/SCons/Tool/aixcc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/BitKeeper.py b/src/engine/SCons/Tool/aixcxx.py
index 1a901bb..97bd8a6 100644
--- a/src/engine/SCons/Tool/BitKeeper.py
+++ b/src/engine/SCons/Tool/aixcxx.py
@@ -1,7 +1,6 @@
-"""SCons.Tool.BitKeeper.py
+"""SCons.Tool.aixc++
-Tool-specific initialization for the BitKeeper source code control
-system.
+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()
@@ -10,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,32 +31,44 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/BitKeeper.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixcxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import SCons.Action
-import SCons.Builder
-import SCons.Util
+import os.path
-def generate(env):
- """Add a Builder factory function and construction variables for
- BitKeeper to an Environment."""
+import SCons.Platform.aix
+
+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']
- 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)
+def get_xlc(env):
+ xlc = env.get('CXX', 'xlC')
+ return SCons.Platform.aix.get_xlc(env, xlc, packages)
+
+def generate(env):
+ """Add Builders and construction variables for xlC / Visual Age
+ suite to an Environment."""
+ path, _cxx, version = get_xlc(env)
+ if path and _cxx:
+ _cxx = os.path.join(path, _cxx)
- env.BitKeeper = BitKeeperFactory
+ if 'CXX' not in env:
+ env['CXX'] = _cxx
- env['BITKEEPER'] = 'bk'
- env['BITKEEPERGET'] = '$BITKEEPER get'
- env['BITKEEPERGETFLAGS'] = SCons.Util.CLVar('')
- env['BITKEEPERCOM'] = '$BITKEEPERGET $BITKEEPERGETFLAGS $TARGET'
+ cplusplus.generate(env)
+ if version:
+ env['CXXVERSION'] = version
+
def exists(env):
- return env.Detect('bk')
+ path, _cxx, version = get_xlc(env)
+ if path and _cxx:
+ xlc = os.path.join(path, _cxx)
+ if os.path.exists(xlc):
+ return xlc
+ return None
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/aixf77.py b/src/engine/SCons/Tool/aixf77.py
index 899bd4f..c72346c 100644
--- a/src/engine/SCons/Tool/aixf77.py
+++ b/src/engine/SCons/Tool/aixf77.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixf77.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/aixf77.xml b/src/engine/SCons/Tool/aixf77.xml
index e9bcc74..69f4d92 100644
--- a/src/engine/SCons/Tool/aixf77.xml
+++ b/src/engine/SCons/Tool/aixf77.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/aixlink.py b/src/engine/SCons/Tool/aixlink.py
index 0c8e1cc..fd67d66 100644
--- a/src/engine/SCons/Tool/aixlink.py
+++ b/src/engine/SCons/Tool/aixlink.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/aixlink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/aixlink.xml b/src/engine/SCons/Tool/aixlink.xml
index 52112da..d5438ef 100644
--- a/src/engine/SCons/Tool/aixlink.xml
+++ b/src/engine/SCons/Tool/aixlink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/applelink.py b/src/engine/SCons/Tool/applelink.py
index f9995b3..45f524c 100644
--- a/src/engine/SCons/Tool/applelink.py
+++ b/src/engine/SCons/Tool/applelink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,13 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/applelink.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/applelink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 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
+from . import link
def generate(env):
"""Add Builders and construction variables for applelink to an
@@ -51,6 +51,14 @@ def generate(env):
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -dynamiclib')
env['SHLINKCOM'] = env['SHLINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'
+
+ # TODO: Work needed to generate versioned shared libraries
+ # Leaving this commented out, and also going to disable versioned library checking for now
+ # 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()
+
+
# override the default for loadable modules, which are different
# on OS X than dynamic shared libs. echoing what XCode does for
# pre/suffixes:
diff --git a/src/engine/SCons/Tool/applelink.xml b/src/engine/SCons/Tool/applelink.xml
index d087361..699abf0 100644
--- a/src/engine/SCons/Tool/applelink.xml
+++ b/src/engine/SCons/Tool/applelink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/ar.py b/src/engine/SCons/Tool/ar.py
index dcaafdc..4d2a005 100644
--- a/src/engine/SCons/Tool/ar.py
+++ b/src/engine/SCons/Tool/ar.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/ar.xml b/src/engine/SCons/Tool/ar.xml
index e06dba2..9b9e0a0 100644
--- a/src/engine/SCons/Tool/ar.xml
+++ b/src/engine/SCons/Tool/ar.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/as.py b/src/engine/SCons/Tool/as.py
index 59c1e1a..ab81b89 100644
--- a/src/engine/SCons/Tool/as.py
+++ b/src/engine/SCons/Tool/as.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/as.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Tool
diff --git a/src/engine/SCons/Tool/as.xml b/src/engine/SCons/Tool/as.xml
index 8b4c51e..f4d886d 100644
--- a/src/engine/SCons/Tool/as.xml
+++ b/src/engine/SCons/Tool/as.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/bcc32.py b/src/engine/SCons/Tool/bcc32.py
index 4b83d3a..bf0a5dd 100644
--- a/src/engine/SCons/Tool/bcc32.py
+++ b/src/engine/SCons/Tool/bcc32.py
@@ -5,7 +5,7 @@ XXX
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/bcc32.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
diff --git a/src/engine/SCons/Tool/bcc32.xml b/src/engine/SCons/Tool/bcc32.xml
index 3cd4121..6163016 100644
--- a/src/engine/SCons/Tool/bcc32.xml
+++ b/src/engine/SCons/Tool/bcc32.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/c++.py b/src/engine/SCons/Tool/c++.py
index 3b2528a..ebfe0a4 100644
--- a/src/engine/SCons/Tool/c++.py
+++ b/src/engine/SCons/Tool/c++.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,68 +30,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/c++.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/c++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import os.path
-import SCons.Tool
-import SCons.Defaults
-import SCons.Util
+#forward proxy to the preffered cxx version
+from SCons.Tool.cxx import *
-compilers = ['CC', 'c++']
-
-CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']
-if SCons.Util.case_sensitive_suffixes('.c', '.C'):
- CXXSuffixes.append('.C')
-
-def iscplusplus(source):
- if not source:
- # Source might be None for unusual cases like SConf.
- return 0
- for s in source:
- if s.sources:
- ext = os.path.splitext(str(s.sources[0]))[1]
- if ext in CXXSuffixes:
- return 1
- return 0
-
-def generate(env):
- """
- Add Builders and construction variables for Visual Age C++ compilers
- to an Environment.
- """
- import SCons.Tool
- import SCons.Tool.cc
- static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
-
- for suffix in CXXSuffixes:
- static_obj.add_action(suffix, SCons.Defaults.CXXAction)
- shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
- static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)
- shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)
-
- SCons.Tool.cc.add_common_cc_variables(env)
-
- if 'CXX' not in env:
- env['CXX'] = env.Detect(compilers) or compilers[0]
- env['CXXFLAGS'] = SCons.Util.CLVar('')
- env['CXXCOM'] = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
- env['SHCXX'] = '$CXX'
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
- env['SHCXXCOM'] = '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'
-
- env['CPPDEFPREFIX'] = '-D'
- env['CPPDEFSUFFIX'] = ''
- env['INCPREFIX'] = '-I'
- env['INCSUFFIX'] = ''
- env['SHOBJSUFFIX'] = '.os'
- env['OBJSUFFIX'] = '.o'
- env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0
-
- env['CXXFILESUFFIX'] = '.cc'
-
-def exists(env):
- return env.Detect(env.get('CXX', compilers))
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/c++.xml b/src/engine/SCons/Tool/c++.xml
index 5a31ba0..e2021fc 100644
--- a/src/engine/SCons/Tool/c++.xml
+++ b/src/engine/SCons/Tool/c++.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/cc.py b/src/engine/SCons/Tool/cc.py
index ba82b5d..31e7b2b 100644
--- a/src/engine/SCons/Tool/cc.py
+++ b/src/engine/SCons/Tool/cc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/cc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Tool
import SCons.Defaults
diff --git a/src/engine/SCons/Tool/cc.xml b/src/engine/SCons/Tool/cc.xml
index 810124d..1ec3084 100644
--- a/src/engine/SCons/Tool/cc.xml
+++ b/src/engine/SCons/Tool/cc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/clang.py b/src/engine/SCons/Tool/clang.py
new file mode 100644
index 0000000..1271378
--- /dev/null
+++ b/src/engine/SCons/Tool/clang.py
@@ -0,0 +1,83 @@
+# -*- 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 - 2017 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 rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+
+# 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
+
+compilers = ['clang']
+
+def generate(env):
+ """Add Builders and construction variables for clang to an Environment."""
+ SCons.Tool.cc.generate(env)
+
+ 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/engine/SCons/Tool/clang.xml b/src/engine/SCons/Tool/clang.xml
new file mode 100644
index 0000000..3086a51
--- /dev/null
+++ b/src/engine/SCons/Tool/clang.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2001 - 2017 The SCons Foundation
+
+This file is processed by the bin/SConsDoc.py module.
+See its __doc__ string for a discussion of the format.
+-->
+
+<!DOCTYPE sconsdoc [
+<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
+%scons;
+<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
+%builders-mod;
+<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
+%functions-mod;
+<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
+%tools-mod;
+<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
+%variables-mod;
+]>
+
+<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
+
+<tool name="clang">
+<summary>
+<para>
+Set construction variables for the Clang C compiler.
+</para>
+</summary>
+<sets>
+<item>CC</item>
+<item>SHCCFLAGS</item>
+<item>CCVERSION</item>
+</sets>
+</tool>
+
+</sconsdoc>
diff --git a/src/engine/SCons/Tool/clangxx.py b/src/engine/SCons/Tool/clangxx.py
new file mode 100644
index 0000000..f56c9e5
--- /dev/null
+++ b/src/engine/SCons/Tool/clangxx.py
@@ -0,0 +1,91 @@
+# -*- 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 - 2017 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 rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+
+# 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
+
+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'
+ # 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/engine/SCons/Tool/clangxx.xml b/src/engine/SCons/Tool/clangxx.xml
new file mode 100644
index 0000000..309bb63
--- /dev/null
+++ b/src/engine/SCons/Tool/clangxx.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2001 - 2017 The SCons Foundation
+
+This file is processed by the bin/SConsDoc.py module.
+See its __doc__ string for a discussion of the format.
+-->
+
+<!DOCTYPE sconsdoc [
+<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
+%scons;
+<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
+%builders-mod;
+<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
+%functions-mod;
+<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
+%tools-mod;
+<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
+%variables-mod;
+]>
+
+<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
+
+<tool name="clangxx">
+<summary>
+<para>
+Set construction variables for the Clang C++ compiler.
+</para>
+</summary>
+<sets>
+<item>CXX</item>
+<item>SHCXXFLAGS</item>
+<item>STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME</item>
+<item>SHOBJSUFFIX</item>
+<item>CXXVERSION</item>
+</sets>
+</tool>
+
+</sconsdoc>
diff --git a/src/engine/SCons/Tool/cvf.py b/src/engine/SCons/Tool/cvf.py
index 37b4a00..a785471 100644
--- a/src/engine/SCons/Tool/cvf.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/cvf.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import fortran
+from . import fortran
compilers = ['f90']
diff --git a/src/engine/SCons/Tool/cvf.xml b/src/engine/SCons/Tool/cvf.xml
index 1227658..1b2c447 100644
--- a/src/engine/SCons/Tool/cvf.xml
+++ b/src/engine/SCons/Tool/cvf.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/cxx.py b/src/engine/SCons/Tool/cxx.py
new file mode 100644
index 0000000..236730f
--- /dev/null
+++ b/src/engine/SCons/Tool/cxx.py
@@ -0,0 +1,100 @@
+"""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 - 2017 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/cxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+
+import os.path
+
+import SCons.Tool
+import SCons.Defaults
+import SCons.Util
+
+compilers = ['CC', 'c++']
+
+CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']
+if SCons.Util.case_sensitive_suffixes('.c', '.C'):
+ CXXSuffixes.append('.C')
+
+def iscplusplus(source):
+ if not source:
+ # Source might be None for unusual cases like SConf.
+ return 0
+ for s in source:
+ if s.sources:
+ ext = os.path.splitext(str(s.sources[0]))[1]
+ if ext in CXXSuffixes:
+ return 1
+ return 0
+
+def generate(env):
+ """
+ Add Builders and construction variables for Visual Age C++ compilers
+ to an Environment.
+ """
+ import SCons.Tool
+ import SCons.Tool.cc
+ static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+ for suffix in CXXSuffixes:
+ static_obj.add_action(suffix, SCons.Defaults.CXXAction)
+ shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
+ static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)
+ shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)
+
+ SCons.Tool.cc.add_common_cc_variables(env)
+
+ if 'CXX' not in env:
+ env['CXX'] = env.Detect(compilers) or compilers[0]
+ env['CXXFLAGS'] = SCons.Util.CLVar('')
+ env['CXXCOM'] = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
+ env['SHCXX'] = '$CXX'
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
+ env['SHCXXCOM'] = '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'
+
+ env['CPPDEFPREFIX'] = '-D'
+ env['CPPDEFSUFFIX'] = ''
+ env['INCPREFIX'] = '-I'
+ env['INCSUFFIX'] = ''
+ env['SHOBJSUFFIX'] = '.os'
+ env['OBJSUFFIX'] = '.o'
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0
+
+ env['CXXFILESUFFIX'] = '.cc'
+
+def exists(env):
+ return env.Detect(env.get('CXX', compilers))
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/cyglink.py b/src/engine/SCons/Tool/cyglink.py
index 921f0eb..f69b886 100644
--- a/src/engine/SCons/Tool/cyglink.py
+++ b/src/engine/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/engine/SCons/Tool/cyglink.xml b/src/engine/SCons/Tool/cyglink.xml
index e0eac65..13556e8 100644
--- a/src/engine/SCons/Tool/cyglink.xml
+++ b/src/engine/SCons/Tool/cyglink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/default.py b/src/engine/SCons/Tool/default.py
index 1c19b7e..72d3399 100644
--- a/src/engine/SCons/Tool/default.py
+++ b/src/engine/SCons/Tool/default.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/default.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Tool
diff --git a/src/engine/SCons/Tool/default.xml b/src/engine/SCons/Tool/default.xml
index cbe561a..3683a10 100644
--- a/src/engine/SCons/Tool/default.xml
+++ b/src/engine/SCons/Tool/default.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py
index aaacd47..1dfb5d7 100644
--- a/src/engine/SCons/Tool/dmd.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/dmd.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/dmd.xml b/src/engine/SCons/Tool/dmd.xml
index c7e9ecb..a06db10 100644
--- a/src/engine/SCons/Tool/dmd.xml
+++ b/src/engine/SCons/Tool/dmd.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -32,10 +32,6 @@ Sets construction variables for D language compiler DMD.
<sets>
<item>DC</item>
<item>DCOM</item>
-<item>_DINCFLAGS</item>
-<item>_DVERFLAGS</item>
-<item>_DDEBUGFLAGS</item>
-<item>_DFLAGS</item>
<item>SHDC</item>
<item>SHDCOM</item>
<item>DPATH</item>
@@ -59,21 +55,317 @@ Sets construction variables for D language compiler DMD.
<item>SHDLINKCOM</item>
<item>DLIBLINKPREFIX</item>
<item>DLIBLINKSUFFIX</item>
-<item>_DLIBFLAGS</item>
<item>DLIBDIRPREFIX</item>
<item>DLIBDIRSUFFIX</item>
-<item>_DLIBDIRFLAGS</item>
<item>DLIB</item>
<item>DLIBCOM</item>
-<item>_DLIBFLAGS</item>
<item>DLIBFLAGPREFIX</item>
<item>DLIBFLAGSUFFIX</item>
-<item>RPATHPREFIX</item>
-<item>RPATHSUFFIX</item>
-<item>_RPATH</item>
+<item>DLINKFLAGPREFIX</item>
+<item>DLINKFLAGSUFFIX</item>
+<item>DRPATHPREFIX</item>
+<item>DRPATHSUFFIX</item>
+<item>DShLibSonameGenerator</item>
+<item>SHDLIBVERSION</item>
+<item>SHDLIBVERSIONFLAGS</item>
</sets>
<uses>
</uses>
</tool>
+<cvar name="DC">
+<summary>
+<para>
+The D compiler to use.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DCOM">
+<summary>
+<para>
+ The command line used to compile a D file to an object file.
+ Any options specified in the &cv-link-DFLAGS; construction variable
+ is included on this command line.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DDEBUG">
+<summary>
+<para>
+ List of debug tags to enable when compiling.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DFLAGS">
+<summary>
+<para>
+ General options that are passed to the D compiler.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLIB">
+<summary>
+<para>
+ Name of the lib tool to use for D codes.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLIBCOM">
+<summary>
+<para>
+ The command line to use when creating libraries.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLINK">
+<summary>
+<para>
+ Name of the linker to use for linking systems including D sources.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLINKCOM">
+<summary>
+<para>
+ The command line to use when linking systems including D sources.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLINKFLAGS">
+<summary>
+<para>
+List of linker flags.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DPATH">
+<summary>
+<para>
+ List of paths to search for import modules.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DVERSIONS">
+<summary>
+<para>
+ List of version tags to enable when compiling.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDC">
+<summary>
+<para>
+ The name of the compiler to use when compiling D source
+ destined to be in a shared objects.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDCOM">
+<summary>
+<para>
+ The command line to use when compiling code to be part of shared objects.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDLINK">
+<summary>
+<para>
+ The linker to use when creating shared objects for code bases
+ include D sources.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDLINKCOM">
+<summary>
+<para>
+ The command line to use when generating shared objects.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDLINKFLAGS">
+<summary>
+<para>
+ The list of flags to use when generating a shared object.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DVERSUFFIX">
+ <summary>
+ <para>
+ DVERSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DVERPREFIX">
+ <summary>
+ <para>
+ DVERPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLINKFLAGSUFFIX">
+ <summary>
+ <para>
+ DLINKFLAGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLINKFLAGPREFIX">
+ <summary>
+ <para>
+ DLINKFLAGPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBLINKSUFFIX">
+ <summary>
+ <para>
+ DLIBLINKSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBLINKPREFIX">
+ <summary>
+ <para>
+ DLIBLINKPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBFLAGSUFFIX">
+ <summary>
+ <para>
+ DLIBFLAGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBFLAGPREFIX">
+ <summary>
+ <para>
+ DLIBFLAGPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBDIRSUFFIX">
+ <summary>
+ <para>
+ DLIBLINKSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBDIRPREFIX">
+ <summary>
+ <para>
+ DLIBLINKPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DINCSUFFIX">
+ <summary>
+ <para>
+ DLIBFLAGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+
+<cvar name="DINCPREFIX">
+ <summary>
+ <para>
+ DINCPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DFLAGSUFFIX">
+ <summary>
+ <para>
+ DFLAGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DFLAGPREFIX">
+ <summary>
+ <para>
+ DFLAGPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DFILESUFFIX">
+ <summary>
+ <para>
+ DFILESUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DDEBUGPREFIX">
+ <summary>
+ <para>
+ DDEBUGPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DDEBUGSUFFIX">
+ <summary>
+ <para>
+ DDEBUGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<builder name="ProgramAllAtOnce">
+ <summary>
+ <para>
+ Builds an executable from D sources without first creating individual
+ objects for each file.
+ </para>
+ <para>
+ D sources can be compiled file-by-file as C and C++ source are, and
+ D is integrated into the &scons; Object and Program builders for
+ this model of build. D codes can though do whole source
+ meta-programming (some of the testing frameworks do this). For this
+ it is imperative that all sources are compiled and linked in a single call of
+ the D compiler. This builder serves that purpose.
+ </para>
+ <example_commands>
+ env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d'])
+ </example_commands>
+ <para>
+ This command will compile the modules mod_a, mod_b, and mod_c in a
+ single compilation process without first creating object files for
+ the modules. Some of the D compilers will create executable.o others
+ will not.
+ </para>
+ </summary>
+</builder>
+
</sconsdoc>
diff --git a/src/engine/SCons/Tool/docbook/__init__.py b/src/engine/SCons/Tool/docbook/__init__.py
index 83b3ecd..ed63784 100644
--- a/src/engine/SCons/Tool/docbook/__init__.py
+++ b/src/engine/SCons/Tool/docbook/__init__.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,6 +159,11 @@ 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',
'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
@@ -166,19 +173,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 +207,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 +350,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 +476,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/engine/SCons/Tool/docbook/__init__.xml b/src/engine/SCons/Tool/docbook/__init__.xml
index 11b189f..1994392 100644
--- a/src/engine/SCons/Tool/docbook/__init__.xml
+++ b/src/engine/SCons/Tool/docbook/__init__.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py
index c070602..e7b8cfa 100644
--- a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py
+++ b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py
@@ -1,5 +1,6 @@
# docbook.py: extension module
# $Id: docbook.py 8353 2009-03-17 16:57:50Z mzjn $
+from __future__ import print_function
import sys
import string
@@ -82,7 +83,7 @@ def adjustColumnWidths(ctx, nodeset):
relParts.append(relPart)
absParts.append(pixels)
- col = col.next
+ col = col.__next__
# Ok, now we have the relative widths and absolute widths in
# two parallel arrays.
@@ -116,7 +117,7 @@ def adjustColumnWidths(ctx, nodeset):
pixelWidth = convertLength(tableWidth)
if pixelWidth <= absTotal:
- print "Table is wider than table width"
+ print("Table is wider than table width")
else:
pixelWidth = pixelWidth - absTotal
@@ -151,7 +152,7 @@ def adjustColumnWidths(ctx, nodeset):
col.setProp("width", widths[count])
count = count+1
- col = col.next
+ col = col.__next__
return nodeset
@@ -163,10 +164,10 @@ def convertLength(length):
m = re.search('([+-]?[\d\.]+)(\S+)', length)
if m != None and m.lastindex > 1:
unit = pixelsPerInch
- if unitHash.has_key(m.group(2)):
+ if m.group(2) in unitHash:
unit = unitHash[m.group(2)]
else:
- print "Unrecognized length: " + m.group(2)
+ print("Unrecognized length: " + m.group(2))
pixels = unit * float(m.group(1))
else:
diff --git a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py
index c712f65..77ca0de 100644
--- a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py
+++ b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py
@@ -1,5 +1,6 @@
#!/usr/bin/python -u
# $Id: xslt.py 8353 2009-03-17 16:57:50Z mzjn $
+from __future__ import print_function
import sys
import libxml2
@@ -18,7 +19,7 @@ try:
xmlfile = sys.argv[1]
xslfile = sys.argv[2]
except IndexError:
- print usage
+ print(usage)
sys.exit(1)
def quote(astring):
@@ -38,12 +39,12 @@ try:
while (sys.argv[count]):
try:
name, value = sys.argv[count].split("=", 2)
- if params.has_key(name):
- print "Warning: '%s' re-specified; replacing value" % name
+ if name in params:
+ print("Warning: '%s' re-specified; replacing value" % name)
params[name] = quote(value)
except ValueError:
- print "Invalid parameter specification: '" + sys.argv[count] + "'"
- print usage
+ print("Invalid parameter specification: '" + sys.argv[count] + "'")
+ print(usage)
sys.exit(1)
count = count+1
except IndexError:
@@ -70,7 +71,7 @@ result = style.applyStylesheet(doc, params)
if outfile:
style.saveResultToFilename(outfile, result, 0)
else:
- print result
+ print(result)
# Free things up
style.freeStylesheet()
diff --git a/src/engine/SCons/Tool/dvi.py b/src/engine/SCons/Tool/dvi.py
index cf5504e..9ec1563 100644
--- a/src/engine/SCons/Tool/dvi.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/dvi.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Builder
import SCons.Tool
diff --git a/src/engine/SCons/Tool/dvi.xml b/src/engine/SCons/Tool/dvi.xml
index e1c4059..1ec2ef0 100644
--- a/src/engine/SCons/Tool/dvi.xml
+++ b/src/engine/SCons/Tool/dvi.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/dvipdf.py b/src/engine/SCons/Tool/dvipdf.py
index 1e7daac..339155d 100644
--- a/src/engine/SCons/Tool/dvipdf.py
+++ b/src/engine/SCons/Tool/dvipdf.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/dvipdf.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/dvipdf.xml b/src/engine/SCons/Tool/dvipdf.xml
index 1f028da..a5d2018 100644
--- a/src/engine/SCons/Tool/dvipdf.xml
+++ b/src/engine/SCons/Tool/dvipdf.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/dvips.py b/src/engine/SCons/Tool/dvips.py
index 5217a16..95641d6 100644
--- a/src/engine/SCons/Tool/dvips.py
+++ b/src/engine/SCons/Tool/dvips.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/dvips.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Action
import SCons.Builder
diff --git a/src/engine/SCons/Tool/dvips.xml b/src/engine/SCons/Tool/dvips.xml
index 161b899..7f47592 100644
--- a/src/engine/SCons/Tool/dvips.xml
+++ b/src/engine/SCons/Tool/dvips.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/f03.py b/src/engine/SCons/Tool/f03.py
index c71c487..a9f91a8 100644
--- a/src/engine/SCons/Tool/f03.py
+++ b/src/engine/SCons/Tool/f03.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f03.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/f03.xml b/src/engine/SCons/Tool/f03.xml
index beb60ab..e486acf 100644
--- a/src/engine/SCons/Tool/f03.xml
+++ b/src/engine/SCons/Tool/f03.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/f08.py b/src/engine/SCons/Tool/f08.py
index 1d3afc6..eb44487 100644
--- a/src/engine/SCons/Tool/f08.py
+++ b/src/engine/SCons/Tool/f08.py
@@ -8,8 +8,10 @@ selection method.
"""
+from __future__ import absolute_import
+
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 +33,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/f08.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f08.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Tool
import SCons.Util
-import fortran
+from . import fortran
from SCons.Tool.FortranCommon import add_all_to_env, add_f08_to_env
compilers = ['f08']
diff --git a/src/engine/SCons/Tool/f08.xml b/src/engine/SCons/Tool/f08.xml
index 17eaaa9..aac7b66 100644
--- a/src/engine/SCons/Tool/f08.xml
+++ b/src/engine/SCons/Tool/f08.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/f77.py b/src/engine/SCons/Tool/f77.py
index 48c724c..afa9a7b 100644
--- a/src/engine/SCons/Tool/f77.py
+++ b/src/engine/SCons/Tool/f77.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f77.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Scanner.Fortran
diff --git a/src/engine/SCons/Tool/f77.xml b/src/engine/SCons/Tool/f77.xml
index 6ce9226..210c646 100644
--- a/src/engine/SCons/Tool/f77.xml
+++ b/src/engine/SCons/Tool/f77.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/f90.py b/src/engine/SCons/Tool/f90.py
index 9272a63..f66ed47 100644
--- a/src/engine/SCons/Tool/f90.py
+++ b/src/engine/SCons/Tool/f90.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f90.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Scanner.Fortran
diff --git a/src/engine/SCons/Tool/f90.xml b/src/engine/SCons/Tool/f90.xml
index ad09e6f..b5f7f13 100644
--- a/src/engine/SCons/Tool/f90.xml
+++ b/src/engine/SCons/Tool/f90.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/f95.py b/src/engine/SCons/Tool/f95.py
index abc9053..bc5439f 100644
--- a/src/engine/SCons/Tool/f95.py
+++ b/src/engine/SCons/Tool/f95.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/f95.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/f95.xml b/src/engine/SCons/Tool/f95.xml
index 602ee58..f1cb7c2 100644
--- a/src/engine/SCons/Tool/f95.xml
+++ b/src/engine/SCons/Tool/f95.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/filesystem.py b/src/engine/SCons/Tool/filesystem.py
index 2981705..6615c31 100644
--- a/src/engine/SCons/Tool/filesystem.py
+++ b/src/engine/SCons/Tool/filesystem.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/filesystem.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/fortran.py b/src/engine/SCons/Tool/fortran.py
index 4cba6d5..b99b5e6 100644
--- a/src/engine/SCons/Tool/fortran.py
+++ b/src/engine/SCons/Tool/fortran.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/fortran.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import re
diff --git a/src/engine/SCons/Tool/fortran.xml b/src/engine/SCons/Tool/fortran.xml
index 85140ef..3907ce2 100644
--- a/src/engine/SCons/Tool/fortran.xml
+++ b/src/engine/SCons/Tool/fortran.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/g++.py b/src/engine/SCons/Tool/g++.py
index 1d12962..468fa87 100644
--- a/src/engine/SCons/Tool/g++.py
+++ b/src/engine/SCons/Tool/g++.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,47 +31,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/g++.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/g++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import os.path
-import re
-import subprocess
-import SCons.Tool
-import SCons.Util
+#forward proxy to the preffered cxx version
+from SCons.Tool.gxx import *
-import gcc
-
-cplusplus = __import__('c++', globals(), locals(), [])
-
-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]
-
- cplusplus.generate(env)
-
- # 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'
- # determine compiler version
- version = gcc.detect_version(env, env['CXX'])
- 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)))
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/g++.xml b/src/engine/SCons/Tool/g++.xml
index ff81c16..6698869 100644
--- a/src/engine/SCons/Tool/g++.xml
+++ b/src/engine/SCons/Tool/g++.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/g77.py b/src/engine/SCons/Tool/g77.py
index 24731f3..36b3c43 100644
--- a/src/engine/SCons/Tool/g77.py
+++ b/src/engine/SCons/Tool/g77.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/g77.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Util
from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env
diff --git a/src/engine/SCons/Tool/g77.xml b/src/engine/SCons/Tool/g77.xml
index e82472c..ae57994 100644
--- a/src/engine/SCons/Tool/g77.xml
+++ b/src/engine/SCons/Tool/g77.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/gas.py b/src/engine/SCons/Tool/gas.py
index 0c09c7b..75e5456 100644
--- a/src/engine/SCons/Tool/gas.py
+++ b/src/engine/SCons/Tool/gas.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gas.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-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/engine/SCons/Tool/gas.xml b/src/engine/SCons/Tool/gas.xml
index 5f2a7db..95ccf27 100644
--- a/src/engine/SCons/Tool/gas.xml
+++ b/src/engine/SCons/Tool/gas.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/gcc.py b/src/engine/SCons/Tool/gcc.py
index 427e80c..f241c7b 100644
--- a/src/engine/SCons/Tool/gcc.py
+++ b/src/engine/SCons/Tool/gcc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gcc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import cc
+from . import cc
import os
import re
import subprocess
@@ -80,13 +80,13 @@ def detect_version(env, cc):
#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/engine/SCons/Tool/gcc.xml b/src/engine/SCons/Tool/gcc.xml
index 9cac12a..17fe2a1 100644
--- a/src/engine/SCons/Tool/gcc.xml
+++ b/src/engine/SCons/Tool/gcc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/gdc.py b/src/engine/SCons/Tool/gdc.py
index c9ac972..f98fabc 100644
--- a/src/engine/SCons/Tool/gdc.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gdc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/gdc.xml b/src/engine/SCons/Tool/gdc.xml
index dc3d8bf..8f71b5d 100644
--- a/src/engine/SCons/Tool/gdc.xml
+++ b/src/engine/SCons/Tool/gdc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -32,10 +32,6 @@ Sets construction variables for the D language compiler GDC.
<sets>
<item>DC</item>
<item>DCOM</item>
-<item>_DINCFLAGS</item>
-<item>_DVERFLAGS</item>
-<item>_DDEBUGFLAGS</item>
-<item>_DFLAGS</item>
<item>SHDC</item>
<item>SHDCOM</item>
<item>DPATH</item>
@@ -57,16 +53,21 @@ Sets construction variables for the D language compiler GDC.
<item>SHDLINK</item>
<item>SHDLINKFLAGS</item>
<item>SHDLINKCOM</item>
+<item>DLIBLINKPREFIX</item>
+<item>DLIBLINKSUFFIX</item>
+<item>DLIBDIRPREFIX</item>
+<item>DLIBDIRSUFFIX</item>
<item>DLIB</item>
<item>DLIBCOM</item>
-<item>_DLIBFLAGS</item>
<item>DLIBFLAGPREFIX</item>
<item>DLIBFLAGSUFFIX</item>
<item>DLINKFLAGPREFIX</item>
<item>DLINKFLAGSUFFIX</item>
-<item>RPATHPREFIX</item>
-<item>RPATHSUFFIX</item>
-<item>_RPATH</item>
+<item>DRPATHPREFIX</item>
+<item>DRPATHSUFFIX</item>
+<item>DShLibSonameGenerator</item>
+<item>SHDLIBVERSION</item>
+<item>SHDLIBVERSIONFLAGS</item>
</sets>
<uses>
</uses>
@@ -75,7 +76,7 @@ Sets construction variables for the D language compiler GDC.
<cvar name="DC">
<summary>
<para>
-DC.
+The D compiler to use.
</para>
</summary>
</cvar>
@@ -83,7 +84,9 @@ DC.
<cvar name="DCOM">
<summary>
<para>
-DCOM.
+ The command line used to compile a D file to an object file.
+ Any options specified in the &cv-link-DFLAGS; construction variable
+ is included on this command line.
</para>
</summary>
</cvar>
@@ -91,39 +94,7 @@ DCOM.
<cvar name="DDEBUG">
<summary>
<para>
-DDEBUG.
-</para>
-</summary>
-</cvar>
-
-<cvar name="DDEBUGPREFIX">
-<summary>
-<para>
-DDEBUGPREFIX.
-</para>
-</summary>
-</cvar>
-
-<cvar name="DDEBUGSUFFIX">
-<summary>
-<para>
-DDEBUGSUFFIX.
-</para>
-</summary>
-</cvar>
-
-<cvar name="DFILESUFFIX">
-<summary>
-<para>
-DFILESUFFIX.
-</para>
-</summary>
-</cvar>
-
-<cvar name="DFLAGPREFIX">
-<summary>
-<para>
-DFLAGPREFIX.
+ List of debug tags to enable when compiling.
</para>
</summary>
</cvar>
@@ -131,257 +102,270 @@ DFLAGPREFIX.
<cvar name="DFLAGS">
<summary>
<para>
-DFLAGS.
-</para>
-</summary>
-</cvar>
-
-<cvar name="DFLAGSUFFIX">
-<summary>
-<para>
-DFLAGSUFFIX.
+ General options that are passed to the D compiler.
</para>
</summary>
</cvar>
-<cvar name="DINCPREFIX">
+<cvar name="DLIB">
<summary>
<para>
-DINCPREFIX.
+ Name of the lib tool to use for D codes.
</para>
</summary>
</cvar>
-<cvar name="DINCSUFFIX">
+<cvar name="DLIBCOM">
<summary>
<para>
-DINCSUFFIX.
+ The command line to use when creating libraries.
</para>
</summary>
</cvar>
-<cvar name="DLIB">
+<cvar name="DLINK">
<summary>
<para>
-DLIB.
+ Name of the linker to use for linking systems including D sources.
</para>
</summary>
</cvar>
-<cvar name="DLIBCOM">
+<cvar name="DLINKCOM">
<summary>
<para>
-DLIBCOM.
+ The command line to use when linking systems including D sources.
</para>
</summary>
</cvar>
-<cvar name="DLIBDIRPREFIX">
+<cvar name="DLINKFLAGS">
<summary>
<para>
-DLIBDIRPREFIX.
+List of linker flags.
</para>
</summary>
</cvar>
-<cvar name="DLIBDIRSUFFIX">
+<cvar name="DPATH">
<summary>
<para>
-DLIBDIRSUFFIX.
+ List of paths to search for import modules.
</para>
</summary>
</cvar>
-<cvar name="DLIBFLAGPREFIX">
+<cvar name="DVERSIONS">
<summary>
<para>
-DLIBFLAGPREFIX.
+ List of version tags to enable when compiling.
</para>
</summary>
</cvar>
-<cvar name="DLIBFLAGSUFFIX">
+<cvar name="SHDC">
<summary>
<para>
-DLIBFLAGSUFFIX.
+ The name of the compiler to use when compiling D source
+ destined to be in a shared objects.
</para>
</summary>
</cvar>
-<cvar name="DLIBLINKPREFIX">
+<cvar name="SHDCOM">
<summary>
<para>
-DLIBLINKPREFIX.
+ The command line to use when compiling code to be part of shared objects.
</para>
</summary>
</cvar>
-<cvar name="DLIBLINKSUFFIX">
+<cvar name="SHDLINK">
<summary>
<para>
-DLIBLINKSUFFIX.
+ The linker to use when creating shared objects for code bases
+ include D sources.
</para>
</summary>
</cvar>
-<cvar name="DLINK">
+<cvar name="SHDLINKCOM">
<summary>
<para>
-DLINK.
+ The command line to use when generating shared objects.
</para>
</summary>
</cvar>
-<cvar name="DLINKCOM">
+<cvar name="SHDLINKFLAGS">
<summary>
<para>
-DLINKCOM.
+ The list of flags to use when generating a shared object.
</para>
</summary>
</cvar>
-<cvar name="DLINKFLAGPREFIX">
-<summary>
-<para>
-DLINKFLAGPREFIX.
-</para>
-</summary>
+<cvar name="DVERSUFFIX">
+ <summary>
+ <para>
+ DVERSUFFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="DLINKFLAGS">
-<summary>
-<para>
-DLINKFLAGS.
-</para>
-</summary>
+<cvar name="DVERPREFIX">
+ <summary>
+ <para>
+ DVERPREFIX.
+ </para>
+ </summary>
</cvar>
<cvar name="DLINKFLAGSUFFIX">
-<summary>
-<para>
-DLINKFLAGSUFFIX.
-</para>
-</summary>
+ <summary>
+ <para>
+ DLINKFLAGSUFFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="DPATH">
-<summary>
-<para>
-DPATH.
-</para>
-</summary>
+<cvar name="DLINKFLAGPREFIX">
+ <summary>
+ <para>
+ DLINKFLAGPREFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="DVERPREFIX">
-<summary>
-<para>
-DVERPREFIX.
-</para>
-</summary>
+<cvar name="DLIBLINKSUFFIX">
+ <summary>
+ <para>
+ DLIBLINKSUFFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="DVERSIONS">
-<summary>
-<para>
-DVERSIONS.
-</para>
-</summary>
+<cvar name="DLIBLINKPREFIX">
+ <summary>
+ <para>
+ DLIBLINKPREFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="DVERSUFFIX">
-<summary>
-<para>
-DVERSUFFIX.
-</para>
-</summary>
+<cvar name="DLIBFLAGSUFFIX">
+ <summary>
+ <para>
+ DLIBFLAGSUFFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="SHDC">
-<summary>
-<para>
-SHDC.
-</para>
-</summary>
+<cvar name="DLIBFLAGPREFIX">
+ <summary>
+ <para>
+ DLIBFLAGPREFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="SHDCOM">
-<summary>
-<para>
-SHDCOM.
-</para>
-</summary>
+<cvar name="DLIBDIRSUFFIX">
+ <summary>
+ <para>
+ DLIBLINKSUFFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="SHDLINK">
-<summary>
-<para>
-SHDLINK.
-</para>
-</summary>
+<cvar name="DLIBDIRPREFIX">
+ <summary>
+ <para>
+ DLIBLINKPREFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="SHDLINKCOM">
-<summary>
-<para>
-SHDLINKCOM.
-</para>
-</summary>
+<cvar name="DINCSUFFIX">
+ <summary>
+ <para>
+ DLIBFLAGSUFFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="SHDLINKFLAGS">
-<summary>
-<para>
-SHDLINKFLAGS.
-</para>
-</summary>
-</cvar>
-<cvar name="_DDEBUGFLAGS">
-<summary>
-<para>
-_DDEBUGFLAGS.
-</para>
-</summary>
+<cvar name="DINCPREFIX">
+ <summary>
+ <para>
+ DINCPREFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="_DFLAGS">
-<summary>
-<para>
-_DFLAGS.
-</para>
-</summary>
+<cvar name="DFLAGSUFFIX">
+ <summary>
+ <para>
+ DFLAGSUFFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="_DINCFLAGS">
-<summary>
-<para>
-_DINCFLAGS.
-</para>
-</summary>
+<cvar name="DFLAGPREFIX">
+ <summary>
+ <para>
+ DFLAGPREFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="_DLIBDIRFLAGS">
-<summary>
-<para>
-_DLIBDIRFLAGS.
-</para>
-</summary>
+<cvar name="DFILESUFFIX">
+ <summary>
+ <para>
+ DFILESUFFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="_DLIBFLAGS">
-<summary>
-<para>
-_DLIBFLAGS.
-</para>
-</summary>
+<cvar name="DDEBUGPREFIX">
+ <summary>
+ <para>
+ DDEBUGPREFIX.
+ </para>
+ </summary>
</cvar>
-<cvar name="_DVERFLAGS">
-<summary>
-<para>
-_DVERFLAGS.
-</para>
-</summary>
-</cvar>
+<cvar name="DDEBUGSUFFIX">
+ <summary>
+ <para>
+ DDEBUGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<builder name="ProgramAllAtOnce">
+ <summary>
+ <para>
+ Builds an executable from D sources without first creating individual
+ objects for each file.
+ </para>
+ <para>
+ D sources can be compiled file-by-file as C and C++ source are, and
+ D is integrated into the &scons; Object and Program builders for
+ this model of build. D codes can though do whole source
+ meta-programming (some of the testing frameworks do this). For this
+ it is imperative that all sources are compiled and linked in a single call of
+ the D compiler. This builder serves that purpose.
+ </para>
+ <example_commands>
+ env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d'])
+ </example_commands>
+ <para>
+ This command will compile the modules mod_a, mod_b, and mod_c in a
+ single compilation process without first creating object files for
+ the modules. Some of the D compilers will create executable.o others
+ will not.
+ </para>
+ </summary>
+</builder>
</sconsdoc>
diff --git a/src/engine/SCons/Tool/gettext.xml b/src/engine/SCons/Tool/gettext.xml
index 5fe4a51..299184a 100644
--- a/src/engine/SCons/Tool/gettext.xml
+++ b/src/engine/SCons/Tool/gettext.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/gettext.py b/src/engine/SCons/Tool/gettext_tool.py
index 79c1dd2..e500a18 100644
--- a/src/engine/SCons/Tool/gettext.py
+++ b/src/engine/SCons/Tool/gettext_tool.py
@@ -2,7 +2,7 @@
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,7 +23,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/gettext.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gettext_tool.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
#############################################################################
def generate(env,**kw):
diff --git a/src/engine/SCons/Tool/gfortran.py b/src/engine/SCons/Tool/gfortran.py
index d25073c..730ad55 100644
--- a/src/engine/SCons/Tool/gfortran.py
+++ b/src/engine/SCons/Tool/gfortran.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gfortran.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Util
-import fortran
+from . import fortran
def generate(env):
"""Add Builders and construction variables for gfortran to an
diff --git a/src/engine/SCons/Tool/gfortran.xml b/src/engine/SCons/Tool/gfortran.xml
index e8ffdc1..926a2c8 100644
--- a/src/engine/SCons/Tool/gfortran.xml
+++ b/src/engine/SCons/Tool/gfortran.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/gnulink.py b/src/engine/SCons/Tool/gnulink.py
index 794bee6..56bae9a 100644
--- a/src/engine/SCons/Tool/gnulink.py
+++ b/src/engine/SCons/Tool/gnulink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gnulink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/gnulink.xml b/src/engine/SCons/Tool/gnulink.xml
index 325d469..fce7a55 100644
--- a/src/engine/SCons/Tool/gnulink.xml
+++ b/src/engine/SCons/Tool/gnulink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/gs.py b/src/engine/SCons/Tool/gs.py
index 77a49fc..ec5ab27 100644
--- a/src/engine/SCons/Tool/gs.py
+++ b/src/engine/SCons/Tool/gs.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gs.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/gs.xml b/src/engine/SCons/Tool/gs.xml
index 180cc28..40e6f06 100644
--- a/src/engine/SCons/Tool/gs.xml
+++ b/src/engine/SCons/Tool/gs.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/Subversion.py b/src/engine/SCons/Tool/gxx.py
index cb34e07..709f72b 100644
--- a/src/engine/SCons/Tool/Subversion.py
+++ b/src/engine/SCons/Tool/gxx.py
@@ -1,6 +1,6 @@
-"""SCons.Tool.Subversion.py
+"""SCons.Tool.g++
-Tool-specific initialization for Subversion.
+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()
@@ -8,7 +8,8 @@ selection method.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+#
+# Copyright (c) 2001 - 2017 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,40 +29,48 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
-__revision__ = "src/engine/SCons/Tool/Subversion.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
+import re
+import subprocess
-import SCons.Action
-import SCons.Builder
+import SCons.Tool
import SCons.Util
+from . import gcc
+from . import cxx
+
+compilers = ['g++']
+
def generate(env):
- """Add a Builder factory function and construction variables for
- Subversion to an Environment."""
+ """Add Builders and construction variables for g++ to an Environment."""
+ static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
- 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)
+ if 'CXX' not in env:
+ env['CXX'] = env.Detect(compilers) or compilers[0]
- env.Subversion = SubversionFactory
+ cxx.generate(env)
- env['SVN'] = 'svn'
- env['SVNFLAGS'] = SCons.Util.CLVar('')
- env['SVNCOM'] = '$SVN $SVNFLAGS cat $SVNREPOSITORY/$SVNMODULE$TARGET > $TARGET'
+ # 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'
+ # determine compiler version
+ version = gcc.detect_version(env, env['CXX'])
+ if version:
+ env['CXXVERSION'] = version
def exists(env):
- return env.Detect('svn')
+ # is executable, and is a GNU compiler (or accepts '--version' at least)
+ return gcc.detect_version(env, env.Detect(env.get('CXX', compilers)))
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/hpc++.py b/src/engine/SCons/Tool/hpc++.py
index d713825..9471ef5 100644
--- a/src/engine/SCons/Tool/hpc++.py
+++ b/src/engine/SCons/Tool/hpc++.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,51 +31,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/hpc++.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/hpc++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import os.path
-import SCons.Util
+#forward proxy to the preffered cxx version
+from SCons.Tool.hpcxx import *
-cplusplus = __import__('c++', globals(), locals(), [])
-
-acc = None
-
-# search for the acc compiler and linker front end
-
-try:
- dirs = os.listdir('/opt')
-except (IOError, OSError):
- # Not being able to read the directory because it doesn't exist
- # (IOError) or isn't readable (OSError) is okay.
- dirs = []
-
-for dir in dirs:
- cc = '/opt/' + dir + '/bin/aCC'
- if os.path.exists(cc):
- acc = cc
- break
-
-
-def generate(env):
- """Add Builders and construction variables for g++ to an Environment."""
- cplusplus.generate(env)
-
- if acc:
- env['CXX'] = acc or 'aCC'
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
- # determine version of aCC
- line = os.popen(acc + ' -V 2>&1').readline().rstrip()
- if line.find('aCC: HP ANSI C++') == 0:
- env['CXXVERSION'] = line.split()[-1]
-
- if env['PLATFORM'] == 'cygwin':
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
- else:
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
-
-def exists(env):
- return acc
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/hpc++.xml b/src/engine/SCons/Tool/hpc++.xml
index b69f765..d3d11c4 100644
--- a/src/engine/SCons/Tool/hpc++.xml
+++ b/src/engine/SCons/Tool/hpc++.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/hpcc.py b/src/engine/SCons/Tool/hpcc.py
index 11aec7b..0f6a5b4 100644
--- a/src/engine/SCons/Tool/hpcc.py
+++ b/src/engine/SCons/Tool/hpcc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/hpcc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/hpcc.xml b/src/engine/SCons/Tool/hpcc.xml
index a770dc9..765860f 100644
--- a/src/engine/SCons/Tool/hpcc.xml
+++ b/src/engine/SCons/Tool/hpcc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/SCCS.py b/src/engine/SCons/Tool/hpcxx.py
index c4dbbf8..847eaca 100644
--- a/src/engine/SCons/Tool/SCCS.py
+++ b/src/engine/SCons/Tool/hpcxx.py
@@ -1,6 +1,6 @@
-"""SCons.Tool.SCCS.py
+"""SCons.Tool.hpc++
-Tool-specific initialization for SCCS.
+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()
@@ -8,7 +8,8 @@ selection method.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+#
+# Copyright (c) 2001 - 2017 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,33 +29,56 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "src/engine/SCons/Tool/hpcxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-__revision__ = "src/engine/SCons/Tool/SCCS.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 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
- SCCS to an Environment."""
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('cxx', globals(), locals(), [])
+
- 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)
+acc = None
+
+# search for the acc compiler and linker front end
+
+try:
+ dirs = os.listdir('/opt')
+except (IOError, OSError):
+ # Not being able to read the directory because it doesn't exist
+ # (IOError) or isn't readable (OSError) is okay.
+ dirs = []
+
+for dir in dirs:
+ cc = '/opt/' + dir + '/bin/aCC'
+ if os.path.exists(cc):
+ acc = cc
+ break
+
+
+def generate(env):
+ """Add Builders and construction variables for g++ to an Environment."""
+ cplusplus.generate(env)
- env.SCCS = SCCSFactory
+ if acc:
+ env['CXX'] = acc or 'aCC'
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
+ # determine version of aCC
+ line = os.popen(acc + ' -V 2>&1').readline().rstrip()
+ if line.find('aCC: HP ANSI C++') == 0:
+ env['CXXVERSION'] = line.split()[-1]
- env['SCCS'] = 'sccs'
- env['SCCSFLAGS'] = SCons.Util.CLVar('')
- env['SCCSGETFLAGS'] = SCons.Util.CLVar('')
- env['SCCSCOM'] = '$SCCS $SCCSFLAGS get $SCCSGETFLAGS $TARGET'
+ if env['PLATFORM'] == 'cygwin':
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
+ else:
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
def exists(env):
- return env.Detect('sccs')
+ return acc
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/hplink.py b/src/engine/SCons/Tool/hplink.py
index d120827..2329282 100644
--- a/src/engine/SCons/Tool/hplink.py
+++ b/src/engine/SCons/Tool/hplink.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/hplink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
import SCons.Util
-import link
+from . import link
ccLinker = None
diff --git a/src/engine/SCons/Tool/hplink.xml b/src/engine/SCons/Tool/hplink.xml
index 233d4d5..ffa6c0d 100644
--- a/src/engine/SCons/Tool/hplink.xml
+++ b/src/engine/SCons/Tool/hplink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/icc.py b/src/engine/SCons/Tool/icc.py
index 4ae57e7..1f9e8cf 100644
--- a/src/engine/SCons/Tool/icc.py
+++ b/src/engine/SCons/Tool/icc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/icc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import cc
+from . import cc
def generate(env):
"""Add Builders and construction variables for the OS/2 to an Environment."""
diff --git a/src/engine/SCons/Tool/icc.xml b/src/engine/SCons/Tool/icc.xml
index 1675e4d..b0af318 100644
--- a/src/engine/SCons/Tool/icc.xml
+++ b/src/engine/SCons/Tool/icc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/icl.py b/src/engine/SCons/Tool/icl.py
index 846368e..99410cd 100644
--- a/src/engine/SCons/Tool/icl.py
+++ b/src/engine/SCons/Tool/icl.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/icl.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Tool.intelc
diff --git a/src/engine/SCons/Tool/icl.xml b/src/engine/SCons/Tool/icl.xml
index 6f55403..035a3a9 100644
--- a/src/engine/SCons/Tool/icl.xml
+++ b/src/engine/SCons/Tool/icl.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/ifl.py b/src/engine/SCons/Tool/ifl.py
index 61622bf..116c9ac 100644
--- a/src/engine/SCons/Tool/ifl.py
+++ b/src/engine/SCons/Tool/ifl.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ifl.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/ifl.xml b/src/engine/SCons/Tool/ifl.xml
index 2d9a1f6..d693ef6 100644
--- a/src/engine/SCons/Tool/ifl.xml
+++ b/src/engine/SCons/Tool/ifl.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/ifort.py b/src/engine/SCons/Tool/ifort.py
index b44a6f7..8e88946 100644
--- a/src/engine/SCons/Tool/ifort.py
+++ b/src/engine/SCons/Tool/ifort.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ifort.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/ifort.xml b/src/engine/SCons/Tool/ifort.xml
index f2644f2..26d4ca9 100644
--- a/src/engine/SCons/Tool/ifort.xml
+++ b/src/engine/SCons/Tool/ifort.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/ilink.py b/src/engine/SCons/Tool/ilink.py
index d66c75e..577e54b 100644
--- a/src/engine/SCons/Tool/ilink.py
+++ b/src/engine/SCons/Tool/ilink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ilink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Tool
diff --git a/src/engine/SCons/Tool/ilink.xml b/src/engine/SCons/Tool/ilink.xml
index 700450f..941db53 100644
--- a/src/engine/SCons/Tool/ilink.xml
+++ b/src/engine/SCons/Tool/ilink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/ilink32.py b/src/engine/SCons/Tool/ilink32.py
index b07afc8..3e8e095 100644
--- a/src/engine/SCons/Tool/ilink32.py
+++ b/src/engine/SCons/Tool/ilink32.py
@@ -5,7 +5,7 @@ XXX
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ilink32.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Tool
import SCons.Tool.bcc32
diff --git a/src/engine/SCons/Tool/ilink32.xml b/src/engine/SCons/Tool/ilink32.xml
index 69a0cd2..02343d9 100644
--- a/src/engine/SCons/Tool/ilink32.xml
+++ b/src/engine/SCons/Tool/ilink32.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/install.py b/src/engine/SCons/Tool/install.py
index 4cebf5b..12dcf8f 100644
--- a/src/engine/SCons/Tool/install.py
+++ b/src/engine/SCons/Tool/install.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/install.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/install.xml b/src/engine/SCons/Tool/install.xml
index 40e83b8..139cd1e 100644
--- a/src/engine/SCons/Tool/install.xml
+++ b/src/engine/SCons/Tool/install.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py
index 995377c..425f221 100644
--- a/src/engine/SCons/Tool/intelc.py
+++ b/src/engine/SCons/Tool/intelc.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/intelc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import math, sys, os.path, glob, string, re
@@ -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/engine/SCons/Tool/intelc.xml b/src/engine/SCons/Tool/intelc.xml
index 9f88c14..3ec9ddd 100644
--- a/src/engine/SCons/Tool/intelc.xml
+++ b/src/engine/SCons/Tool/intelc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/ipkg.py b/src/engine/SCons/Tool/ipkg.py
index f7f8fb2..4ad53c9 100644
--- a/src/engine/SCons/Tool/ipkg.py
+++ b/src/engine/SCons/Tool/ipkg.py
@@ -11,7 +11,7 @@ packages fake_root.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ipkg.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py
index ba69547..a56dd70 100644
--- a/src/engine/SCons/Tool/jar.py
+++ b/src/engine/SCons/Tool/jar.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/jar.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/jar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Subst
import SCons.Util
diff --git a/src/engine/SCons/Tool/jar.xml b/src/engine/SCons/Tool/jar.xml
index 7141cc2..e18207e 100644
--- a/src/engine/SCons/Tool/jar.xml
+++ b/src/engine/SCons/Tool/jar.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/javac.py b/src/engine/SCons/Tool/javac.py
index adaf35f..f3cabf3 100644
--- a/src/engine/SCons/Tool/javac.py
+++ b/src/engine/SCons/Tool/javac.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/javac.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/javac.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
diff --git a/src/engine/SCons/Tool/javac.xml b/src/engine/SCons/Tool/javac.xml
index 0f3ee13..be478ba 100644
--- a/src/engine/SCons/Tool/javac.xml
+++ b/src/engine/SCons/Tool/javac.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/javacTests.py b/src/engine/SCons/Tool/javacTests.py
index 6cfb42e..0debbb6 100644
--- a/src/engine/SCons/Tool/javacTests.py
+++ b/src/engine/SCons/Tool/javacTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/engine/SCons/Tool/javah.py b/src/engine/SCons/Tool/javah.py
index 76a49d4..0e1885c 100644
--- a/src/engine/SCons/Tool/javah.py
+++ b/src/engine/SCons/Tool/javah.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/javah.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
diff --git a/src/engine/SCons/Tool/javah.xml b/src/engine/SCons/Tool/javah.xml
index 35a5e28..f362e3e 100644
--- a/src/engine/SCons/Tool/javah.xml
+++ b/src/engine/SCons/Tool/javah.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/latex.py b/src/engine/SCons/Tool/latex.py
index 18c53aa..aa7ea15 100644
--- a/src/engine/SCons/Tool/latex.py
+++ b/src/engine/SCons/Tool/latex.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/latex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/latex.xml b/src/engine/SCons/Tool/latex.xml
index 1504317..bb0816d 100644
--- a/src/engine/SCons/Tool/latex.xml
+++ b/src/engine/SCons/Tool/latex.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/ldc.py b/src/engine/SCons/Tool/ldc.py
index f0d726e..5bb04ff 100644
--- a/src/engine/SCons/Tool/ldc.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/ldc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/ldc.xml b/src/engine/SCons/Tool/ldc.xml
index 0db55c3..1479867 100644
--- a/src/engine/SCons/Tool/ldc.xml
+++ b/src/engine/SCons/Tool/ldc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -32,10 +32,6 @@ Sets construction variables for the D language compiler LDC2.
<sets>
<item>DC</item>
<item>DCOM</item>
-<item>_DINCFLAGS</item>
-<item>_DVERFLAGS</item>
-<item>_DDEBUGFLAGS</item>
-<item>_DFLAGS</item>
<item>SHDC</item>
<item>SHDCOM</item>
<item>DPATH</item>
@@ -59,23 +55,317 @@ Sets construction variables for the D language compiler LDC2.
<item>SHDLINKCOM</item>
<item>DLIBLINKPREFIX</item>
<item>DLIBLINKSUFFIX</item>
-<item>_DLIBFLAGS</item>
<item>DLIBDIRPREFIX</item>
<item>DLIBDIRSUFFIX</item>
-<item>_DLIBDIRFLAGS</item>
<item>DLIB</item>
<item>DLIBCOM</item>
-<item>_DLIBFLAGS</item>
<item>DLIBFLAGPREFIX</item>
<item>DLIBFLAGSUFFIX</item>
<item>DLINKFLAGPREFIX</item>
<item>DLINKFLAGSUFFIX</item>
-<item>RPATHPREFIX</item>
-<item>RPATHSUFFIX</item>
-<item>_RPATH</item>
+<item>DRPATHPREFIX</item>
+<item>DRPATHSUFFIX</item>
+<item>DShLibSonameGenerator</item>
+<item>SHDLIBVERSION</item>
+<item>SHDLIBVERSIONFLAGS</item>
</sets>
<uses>
</uses>
</tool>
+<cvar name="DC">
+<summary>
+<para>
+The D compiler to use.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DCOM">
+<summary>
+<para>
+ The command line used to compile a D file to an object file.
+ Any options specified in the &cv-link-DFLAGS; construction variable
+ is included on this command line.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DDEBUG">
+<summary>
+<para>
+ List of debug tags to enable when compiling.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DFLAGS">
+<summary>
+<para>
+ General options that are passed to the D compiler.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLIB">
+<summary>
+<para>
+ Name of the lib tool to use for D codes.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLIBCOM">
+<summary>
+<para>
+ The command line to use when creating libraries.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLINK">
+<summary>
+<para>
+ Name of the linker to use for linking systems including D sources.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLINKCOM">
+<summary>
+<para>
+ The command line to use when linking systems including D sources.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DLINKFLAGS">
+<summary>
+<para>
+List of linker flags.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DPATH">
+<summary>
+<para>
+ List of paths to search for import modules.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DVERSIONS">
+<summary>
+<para>
+ List of version tags to enable when compiling.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDC">
+<summary>
+<para>
+ The name of the compiler to use when compiling D source
+ destined to be in a shared objects.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDCOM">
+<summary>
+<para>
+ The command line to use when compiling code to be part of shared objects.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDLINK">
+<summary>
+<para>
+ The linker to use when creating shared objects for code bases
+ include D sources.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDLINKCOM">
+<summary>
+<para>
+ The command line to use when generating shared objects.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDLINKFLAGS">
+<summary>
+<para>
+ The list of flags to use when generating a shared object.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DVERSUFFIX">
+ <summary>
+ <para>
+ DVERSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DVERPREFIX">
+ <summary>
+ <para>
+ DVERPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLINKFLAGSUFFIX">
+ <summary>
+ <para>
+ DLINKFLAGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLINKFLAGPREFIX">
+ <summary>
+ <para>
+ DLINKFLAGPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBLINKSUFFIX">
+ <summary>
+ <para>
+ DLIBLINKSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBLINKPREFIX">
+ <summary>
+ <para>
+ DLIBLINKPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBFLAGSUFFIX">
+ <summary>
+ <para>
+ DLIBFLAGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBFLAGPREFIX">
+ <summary>
+ <para>
+ DLIBFLAGPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBDIRSUFFIX">
+ <summary>
+ <para>
+ DLIBLINKSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DLIBDIRPREFIX">
+ <summary>
+ <para>
+ DLIBLINKPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DINCSUFFIX">
+ <summary>
+ <para>
+ DLIBFLAGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+
+<cvar name="DINCPREFIX">
+ <summary>
+ <para>
+ DINCPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DFLAGSUFFIX">
+ <summary>
+ <para>
+ DFLAGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DFLAGPREFIX">
+ <summary>
+ <para>
+ DFLAGPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DFILESUFFIX">
+ <summary>
+ <para>
+ DFILESUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DDEBUGPREFIX">
+ <summary>
+ <para>
+ DDEBUGPREFIX.
+ </para>
+ </summary>
+</cvar>
+
+<cvar name="DDEBUGSUFFIX">
+ <summary>
+ <para>
+ DDEBUGSUFFIX.
+ </para>
+ </summary>
+</cvar>
+
+<builder name="ProgramAllAtOnce">
+ <summary>
+ <para>
+ Builds an executable from D sources without first creating individual
+ objects for each file.
+ </para>
+ <para>
+ D sources can be compiled file-by-file as C and C++ source are, and
+ D is integrated into the &scons; Object and Program builders for
+ this model of build. D codes can though do whole source
+ meta-programming (some of the testing frameworks do this). For this
+ it is imperative that all sources are compiled and linked in a single call of
+ the D compiler. This builder serves that purpose.
+ </para>
+ <example_commands>
+ env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d'])
+ </example_commands>
+ <para>
+ This command will compile the modules mod_a, mod_b, and mod_c in a
+ single compilation process without first creating object files for
+ the modules. Some of the D compilers will create executable.o others
+ will not.
+ </para>
+ </summary>
+</builder>
+
</sconsdoc>
diff --git a/src/engine/SCons/Tool/lex.py b/src/engine/SCons/Tool/lex.py
index 4c5bb92..e185b93 100644
--- a/src/engine/SCons/Tool/lex.py
+++ b/src/engine/SCons/Tool/lex.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/lex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
diff --git a/src/engine/SCons/Tool/lex.xml b/src/engine/SCons/Tool/lex.xml
index 9dd512e..e178308 100644
--- a/src/engine/SCons/Tool/lex.xml
+++ b/src/engine/SCons/Tool/lex.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/link.py b/src/engine/SCons/Tool/link.py
index 720a66c..e8c11ed 100644
--- a/src/engine/SCons/Tool/link.py
+++ b/src/engine/SCons/Tool/link.py
@@ -1,3 +1,4 @@
+
"""SCons.Tool.link
Tool-specific initialization for the generic Posix linker.
@@ -9,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 +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/link.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/link.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import re
@@ -45,7 +47,9 @@ from SCons.Tool.FortranCommon import isfortran
from SCons.Tool.DCommon import isD
-cplusplus = __import__('c++', globals(), locals(), [])
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+# cplusplus = __import__(__package__+'.cxx', globals(), locals(), ['*'])
issued_mixed_link_warning = False
@@ -76,20 +80,20 @@ def smart_link(source, target, env, for_signature):
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])
@@ -108,28 +112,28 @@ 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):
@@ -146,33 +150,33 @@ 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.
@@ -181,23 +185,23 @@ def _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, so
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)
@@ -213,7 +217,7 @@ def _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, so
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
@@ -239,15 +243,17 @@ def _versioned_lib_callbacks():
'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
use_soname = False
- try: use_soname = kw['use_soname']
+ try: use_soname = kw['use_soname']
except KeyError: pass
# The $_SHLIBVERSIONFLAGS define extra commandline flags used when
diff --git a/src/engine/SCons/Tool/link.xml b/src/engine/SCons/Tool/link.xml
index 9b12f00..669a020 100644
--- a/src/engine/SCons/Tool/link.xml
+++ b/src/engine/SCons/Tool/link.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/linkloc.py b/src/engine/SCons/Tool/linkloc.py
index 3b0b678..b79be06 100644
--- a/src/engine/SCons/Tool/linkloc.py
+++ b/src/engine/SCons/Tool/linkloc.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/linkloc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/linkloc.xml b/src/engine/SCons/Tool/linkloc.xml
index 959b8c4..09b43cb 100644
--- a/src/engine/SCons/Tool/linkloc.xml
+++ b/src/engine/SCons/Tool/linkloc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/m4.py b/src/engine/SCons/Tool/m4.py
index 0e7c965..38b9976 100644
--- a/src/engine/SCons/Tool/m4.py
+++ b/src/engine/SCons/Tool/m4.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/m4.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Action
import SCons.Builder
diff --git a/src/engine/SCons/Tool/m4.xml b/src/engine/SCons/Tool/m4.xml
index e5fadda..f919af9 100644
--- a/src/engine/SCons/Tool/m4.xml
+++ b/src/engine/SCons/Tool/m4.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/masm.py b/src/engine/SCons/Tool/masm.py
index 62f3003..90162f4 100644
--- a/src/engine/SCons/Tool/masm.py
+++ b/src/engine/SCons/Tool/masm.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/masm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Tool
diff --git a/src/engine/SCons/Tool/masm.xml b/src/engine/SCons/Tool/masm.xml
index 12f74b4..acc3aa3 100644
--- a/src/engine/SCons/Tool/masm.xml
+++ b/src/engine/SCons/Tool/masm.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/midl.py b/src/engine/SCons/Tool/midl.py
index c7e2577..4088fc4 100644
--- a/src/engine/SCons/Tool/midl.py
+++ b/src/engine/SCons/Tool/midl.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/midl.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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()
diff --git a/src/engine/SCons/Tool/midl.xml b/src/engine/SCons/Tool/midl.xml
index 6b11128..cc1b880 100644
--- a/src/engine/SCons/Tool/midl.xml
+++ b/src/engine/SCons/Tool/midl.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py
index b4889b0..c2eaa96 100644
--- a/src/engine/SCons/Tool/mingw.py
+++ b/src/engine/SCons/Tool/mingw.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/mingw.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mingw.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
@@ -86,7 +86,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'):
diff --git a/src/engine/SCons/Tool/mingw.xml b/src/engine/SCons/Tool/mingw.xml
index a503f4f..4848637 100644
--- a/src/engine/SCons/Tool/mingw.xml
+++ b/src/engine/SCons/Tool/mingw.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/msgfmt.py b/src/engine/SCons/Tool/msgfmt.py
index 09b1e2a..7e3e2a4 100644
--- a/src/engine/SCons/Tool/msgfmt.py
+++ b/src/engine/SCons/Tool/msgfmt.py
@@ -1,6 +1,6 @@
""" msgfmt tool """
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msgfmt.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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
diff --git a/src/engine/SCons/Tool/msgfmt.xml b/src/engine/SCons/Tool/msgfmt.xml
index 246f91e..e00f372 100644
--- a/src/engine/SCons/Tool/msgfmt.xml
+++ b/src/engine/SCons/Tool/msgfmt.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/msginit.py b/src/engine/SCons/Tool/msginit.py
index aa95d78..63daf7f 100644
--- a/src/engine/SCons/Tool/msginit.py
+++ b/src/engine/SCons/Tool/msginit.py
@@ -3,7 +3,7 @@
Tool specific initialization of msginit tool.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msginit.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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'
diff --git a/src/engine/SCons/Tool/msginit.xml b/src/engine/SCons/Tool/msginit.xml
index df7f33f..3a2a969 100644
--- a/src/engine/SCons/Tool/msginit.xml
+++ b/src/engine/SCons/Tool/msginit.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/msgmerge.py b/src/engine/SCons/Tool/msgmerge.py
index c7ebd88..aef1f5f 100644
--- a/src/engine/SCons/Tool/msgmerge.py
+++ b/src/engine/SCons/Tool/msgmerge.py
@@ -3,7 +3,7 @@
Tool specific initialization for `msgmerge` tool.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msgmerge.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
#############################################################################
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'
diff --git a/src/engine/SCons/Tool/msgmerge.xml b/src/engine/SCons/Tool/msgmerge.xml
index 01ea726..65d19e1 100644
--- a/src/engine/SCons/Tool/msgmerge.xml
+++ b/src/engine/SCons/Tool/msgmerge.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/mslib.py b/src/engine/SCons/Tool/mslib.py
index 22683a7..3d79649 100644
--- a/src/engine/SCons/Tool/mslib.py
+++ b/src/engine/SCons/Tool/mslib.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mslib.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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."""
diff --git a/src/engine/SCons/Tool/mslib.xml b/src/engine/SCons/Tool/mslib.xml
index b6af18c..6ee2f22 100644
--- a/src/engine/SCons/Tool/mslib.xml
+++ b/src/engine/SCons/Tool/mslib.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py
index 173df7f..1b16b63 100644
--- a/src/engine/SCons/Tool/mslink.py
+++ b/src/engine/SCons/Tool/mslink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mslink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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)
diff --git a/src/engine/SCons/Tool/mslink.xml b/src/engine/SCons/Tool/mslink.xml
index 99fd253..24b79c7 100644
--- a/src/engine/SCons/Tool/mslink.xml
+++ b/src/engine/SCons/Tool/mslink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/mssdk.py b/src/engine/SCons/Tool/mssdk.py
index 7cf439a..dd9de93 100644
--- a/src/engine/SCons/Tool/mssdk.py
+++ b/src/engine/SCons/Tool/mssdk.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mssdk.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
"""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/engine/SCons/Tool/mssdk.xml b/src/engine/SCons/Tool/mssdk.xml
index a29c4eb..0ae3553 100644
--- a/src/engine/SCons/Tool/mssdk.xml
+++ b/src/engine/SCons/Tool/mssdk.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index 08368e7..2fe16c3 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msvc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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."""
@@ -259,7 +274,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
diff --git a/src/engine/SCons/Tool/msvc.xml b/src/engine/SCons/Tool/msvc.xml
index f7e2173..edc6936 100644
--- a/src/engine/SCons/Tool/msvc.xml
+++ b/src/engine/SCons/Tool/msvc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -352,6 +352,8 @@ constructor; setting it later has no effect.
<para>
Valid values for Windows are
+<literal>14.0</literal>,
+<literal>14.0Exp</literal>,
<literal>12.0</literal>,
<literal>12.0Exp</literal>,
<literal>11.0</literal>,
@@ -440,4 +442,27 @@ For example, if you want to compile 64-bit binaries, you would set
</summary>
</cvar>
+<cvar name="MSVC_UWP_APP">
+<summary>
+<para>
+Build libraries for a Universal Windows Platform (UWP) Application.
+</para>
+
+<para>
+If &cv-MSVC_UWP_APP; is set, the Visual Studio environment will be set up to point
+to the Windows Store compatible libraries and Visual Studio runtimes. In doing so,
+any libraries that are built will be able to be used in a UWP App and published
+to the Windows Store.
+This flag will only have an effect with Visual Studio 2015+.
+This variable must be passed as an argument to the Environment()
+constructor; setting it later has no effect.
+</para>
+
+<para>
+Valid values are '1' or '0'
+</para>
+
+</summary>
+</cvar>
+
</sconsdoc>
diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py
index c7e91b4..05531c6 100644
--- a/src/engine/SCons/Tool/msvs.py
+++ b/src/engine/SCons/Tool/msvs.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+from __future__ import print_function
+
+__revision__ = "src/engine/SCons/Tool/msvs.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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] + "}"
@@ -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,7 +188,7 @@ 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:
dbg_settings = []
elif SCons.Util.is_Dict(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 = """\
@@ -1100,7 +1104,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
self.dspheader = V10DSPHeader
self.dspconfiguration = V10DSPProjectConfiguration
self.dspglobals = V10DSPGlobals
-
+
_GenerateV10User.__init__(self, dspfile, source, env)
def PrintHeader(self):
@@ -1131,27 +1135,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 +1168,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 +1185,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 +1210,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 +1252,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 +1273,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 +1285,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]],
+
+ 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 +1296,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 +1309,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 +1332,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 +1346,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 +1432,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 +1444,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 +1465,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)
@@ -1507,7 +1511,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)
@@ -1605,14 +1609,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 +1666,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()
@@ -1718,8 +1723,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 +1739,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 +1848,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 +1977,7 @@ def generate(env):
else:
env['MSVS']['PROJECTSUFFIX'] = '.vcxproj'
env['MSVS']['SOLUTIONSUFFIX'] = '.sln'
-
+
if (version_num >= 10.0):
env['MSVSENCODING'] = 'utf-8'
else:
diff --git a/src/engine/SCons/Tool/msvs.xml b/src/engine/SCons/Tool/msvs.xml
index 4ca5fb1..0408509 100644
--- a/src/engine/SCons/Tool/msvs.xml
+++ b/src/engine/SCons/Tool/msvs.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -127,22 +127,24 @@ compilation error messages displayed in the Visual Studio console output
window. This can be remedied by adding the Visual C/C++ <literal>/FC</literal>
compiler option to the &cv-link-CCFLAGS; variable so that the compiler will
print the full path name of any files that cause compilation errors. </para>
-<para> Example usage: </para> <example_commands>barsrcs = ['bar.cpp'],
-barincs = ['bar.h'],
+<para> Example usage: </para>
+ <example_commands>
+barsrcs = ['bar.cpp']
+barincs = ['bar.h']
barlocalincs = ['StdAfx.h']
barresources = ['bar.rc','resource.h']
barmisc = ['bar_readme.txt']
dll = env.SharedLibrary(target = 'bar.dll',
source = barsrcs)
-
+buildtarget = [s for s in dll if str(s).endswith('dll')]
env.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'],
srcs = barsrcs,
incs = barincs,
localincs = barlocalincs,
resources = barresources,
misc = barmisc,
- buildtarget = dll,
+ buildtarget = buildtarget,
variant = 'Release')
</example_commands>
<para>Starting with version 2.4 of
diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py
index 86df271..8c09487 100644
--- a/src/engine/SCons/Tool/msvsTests.py
+++ b/src/engine/SCons/Tool/msvsTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Tool/msvsTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/msvsTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import sys
@@ -623,7 +624,7 @@ class msvsTestCase(unittest.TestCase):
tests_cmdargs = [(None, dict.fromkeys(list_variant, '')),
('', dict.fromkeys(list_variant, '')),
(list_cmdargs[0], dict.fromkeys(list_variant, list_cmdargs[0])),
- (list_cmdargs, dict(zip(list_variant, list_cmdargs)))]
+ (list_cmdargs, dict(list(zip(list_variant, list_cmdargs))))]
# Run the test for each test case
for param_cmdargs, expected_cmdargs in tests_cmdargs:
@@ -650,8 +651,8 @@ class msvsTestCase(unittest.TestCase):
'cmdargs': expected_cmdargs[variant_platform]}
# Create parameter environment with final parameter dictionary
- param_dict = dict(zip(('variant', 'runfile', 'buildtarget', 'outdir'),
- [list(l) for l in zip(*param_configs)]))
+ param_dict = dict(list(zip(('variant', 'runfile', 'buildtarget', 'outdir'),
+ [list(l) for l in zip(*param_configs)])))
param_dict['cmdargs'] = param_cmdargs
# Hack to be able to run the test with a 'DummyEnv'
@@ -667,8 +668,8 @@ class msvsTestCase(unittest.TestCase):
genDSP = function_test(dspfile, source, env)
# Check expected result
- self.assertListEqual(genDSP.configs.keys(), expected_configs.keys())
- for key in genDSP.configs.keys():
+ self.assertListEqual(list(genDSP.configs.keys()), list(expected_configs.keys()))
+ for key in list(genDSP.configs.keys()):
self.assertDictEqual(genDSP.configs[key].__dict__, expected_configs[key])
class msvs6aTestCase(msvsTestCase):
@@ -827,7 +828,7 @@ if __name__ == "__main__":
]
for test_class in test_classes:
- print "TEST: ", test_class.__doc__
+ print("TEST: ", test_class.__doc__)
back_osenv = copy.deepcopy(os.environ)
try:
# XXX: overriding the os.environ is bad, but doing it
diff --git a/src/engine/SCons/Tool/mwcc.py b/src/engine/SCons/Tool/mwcc.py
index a7ddb53..566f812 100644
--- a/src/engine/SCons/Tool/mwcc.py
+++ b/src/engine/SCons/Tool/mwcc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mwcc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
diff --git a/src/engine/SCons/Tool/mwcc.xml b/src/engine/SCons/Tool/mwcc.xml
index 65f4852..39e6dfa 100644
--- a/src/engine/SCons/Tool/mwcc.xml
+++ b/src/engine/SCons/Tool/mwcc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/mwld.py b/src/engine/SCons/Tool/mwld.py
index eeb80f0..9abeeb5 100644
--- a/src/engine/SCons/Tool/mwld.py
+++ b/src/engine/SCons/Tool/mwld.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/mwld.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Tool
diff --git a/src/engine/SCons/Tool/mwld.xml b/src/engine/SCons/Tool/mwld.xml
index c081461..993fefe 100644
--- a/src/engine/SCons/Tool/mwld.xml
+++ b/src/engine/SCons/Tool/mwld.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/nasm.py b/src/engine/SCons/Tool/nasm.py
index ee1d78c..c605cc6 100644
--- a/src/engine/SCons/Tool/nasm.py
+++ b/src/engine/SCons/Tool/nasm.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/nasm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Tool
diff --git a/src/engine/SCons/Tool/nasm.xml b/src/engine/SCons/Tool/nasm.xml
index f7b7b38..1834b34 100644
--- a/src/engine/SCons/Tool/nasm.xml
+++ b/src/engine/SCons/Tool/nasm.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/packaging.xml b/src/engine/SCons/Tool/packaging.xml
index 98ba508..ea39115 100644
--- a/src/engine/SCons/Tool/packaging.xml
+++ b/src/engine/SCons/Tool/packaging.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/packaging/__init__.py b/src/engine/SCons/Tool/packaging/__init__.py
index 9b1a14a..b844afb 100644
--- a/src/engine/SCons/Tool/packaging/__init__.py
+++ b/src/engine/SCons/Tool/packaging/__init__.py
@@ -4,7 +4,7 @@ SCons Packaging Tool.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 @@ 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Environment
from SCons.Variables import *
@@ -119,7 +119,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 +140,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,10 +156,10 @@ 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.
@@ -233,7 +233,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))
@@ -288,7 +288,7 @@ def stripinstallbuilder(target, source, env):
(file.builder.name=="InstallBuilder" or\
file.builder.name=="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/engine/SCons/Tool/packaging/__init__.xml b/src/engine/SCons/Tool/packaging/__init__.xml
index 794184d..0ee0f6b 100644
--- a/src/engine/SCons/Tool/packaging/__init__.xml
+++ b/src/engine/SCons/Tool/packaging/__init__.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/packaging/ipk.py b/src/engine/SCons/Tool/packaging/ipk.py
index b3abe13..71fa2b0 100644
--- a/src/engine/SCons/Tool/packaging/ipk.py
+++ b/src/engine/SCons/Tool/packaging/ipk.py
@@ -2,7 +2,7 @@
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/packaging/ipk.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/ipk.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Builder
import SCons.Node.FS
@@ -169,7 +169,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/engine/SCons/Tool/packaging/msi.py b/src/engine/SCons/Tool/packaging/msi.py
index 087a8b1..827ce76 100644
--- a/src/engine/SCons/Tool/packaging/msi.py
+++ b/src/engine/SCons/Tool/packaging/msi.py
@@ -4,7 +4,7 @@ The msi packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/msi.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import SCons
@@ -216,7 +216,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] )
#
diff --git a/src/engine/SCons/Tool/packaging/rpm.py b/src/engine/SCons/Tool/packaging/rpm.py
index 899e375..3c48b02 100644
--- a/src/engine/SCons/Tool/packaging/rpm.py
+++ b/src/engine/SCons/Tool/packaging/rpm.py
@@ -4,7 +4,7 @@ The rpm packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/rpm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
@@ -95,13 +95,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,
@@ -136,7 +138,7 @@ def build_specfile(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 RPM is missing.' % e.args[0] )
@@ -225,7 +227,6 @@ 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', }
@@ -270,7 +271,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 +325,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 +336,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/engine/SCons/Tool/packaging/src_tarbz2.py b/src/engine/SCons/Tool/packaging/src_tarbz2.py
index 686d6ca..b40e550 100644
--- a/src/engine/SCons/Tool/packaging/src_tarbz2.py
+++ b/src/engine/SCons/Tool/packaging/src_tarbz2.py
@@ -4,7 +4,7 @@ The tarbz2 SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
from SCons.Tool.packaging import putintopackageroot
diff --git a/src/engine/SCons/Tool/packaging/src_targz.py b/src/engine/SCons/Tool/packaging/src_targz.py
index a993d58..01fc91a 100644
--- a/src/engine/SCons/Tool/packaging/src_targz.py
+++ b/src/engine/SCons/Tool/packaging/src_targz.py
@@ -4,7 +4,7 @@ The targz SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
from SCons.Tool.packaging import putintopackageroot
diff --git a/src/engine/SCons/Tool/packaging/src_zip.py b/src/engine/SCons/Tool/packaging/src_zip.py
index c288fd9..ea21a87 100644
--- a/src/engine/SCons/Tool/packaging/src_zip.py
+++ b/src/engine/SCons/Tool/packaging/src_zip.py
@@ -4,7 +4,7 @@ The zip SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
from SCons.Tool.packaging import putintopackageroot
diff --git a/src/engine/SCons/Tool/packaging/tarbz2.py b/src/engine/SCons/Tool/packaging/tarbz2.py
index 51d998a..c919cab 100644
--- a/src/engine/SCons/Tool/packaging/tarbz2.py
+++ b/src/engine/SCons/Tool/packaging/tarbz2.py
@@ -4,7 +4,7 @@ The tarbz2 SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/tarbz2.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
diff --git a/src/engine/SCons/Tool/packaging/targz.py b/src/engine/SCons/Tool/packaging/targz.py
index 121599b..e9e984e 100644
--- a/src/engine/SCons/Tool/packaging/targz.py
+++ b/src/engine/SCons/Tool/packaging/targz.py
@@ -4,7 +4,7 @@ The targz SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/targz.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
diff --git a/src/engine/SCons/Tool/packaging/zip.py b/src/engine/SCons/Tool/packaging/zip.py
index 873de02..3b80ead 100644
--- a/src/engine/SCons/Tool/packaging/zip.py
+++ b/src/engine/SCons/Tool/packaging/zip.py
@@ -4,7 +4,7 @@ The zip SRC packager.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/zip.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
diff --git a/src/engine/SCons/Tool/pdf.py b/src/engine/SCons/Tool/pdf.py
index b29cd15..381732a 100644
--- a/src/engine/SCons/Tool/pdf.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/pdf.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Builder
import SCons.Tool
diff --git a/src/engine/SCons/Tool/pdf.xml b/src/engine/SCons/Tool/pdf.xml
index 0d19da3..9688a6f 100644
--- a/src/engine/SCons/Tool/pdf.xml
+++ b/src/engine/SCons/Tool/pdf.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/pdflatex.py b/src/engine/SCons/Tool/pdflatex.py
index a182586..d539770 100644
--- a/src/engine/SCons/Tool/pdflatex.py
+++ b/src/engine/SCons/Tool/pdflatex.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/pdflatex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/pdflatex.xml b/src/engine/SCons/Tool/pdflatex.xml
index 8b757da..4dae90b 100644
--- a/src/engine/SCons/Tool/pdflatex.xml
+++ b/src/engine/SCons/Tool/pdflatex.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/pdftex.py b/src/engine/SCons/Tool/pdftex.py
index c47d537..06e9d7c 100644
--- a/src/engine/SCons/Tool/pdftex.py
+++ b/src/engine/SCons/Tool/pdftex.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/pdftex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/pdftex.xml b/src/engine/SCons/Tool/pdftex.xml
index f2e1dd3..e84296a 100644
--- a/src/engine/SCons/Tool/pdftex.xml
+++ b/src/engine/SCons/Tool/pdftex.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/qt.py b/src/engine/SCons/Tool/qt.py
index 69e534f..e7c1b95 100644
--- a/src/engine/SCons/Tool/qt.py
+++ b/src/engine/SCons/Tool/qt.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/qt.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/qt.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import re
@@ -58,7 +59,11 @@ 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(), [])
+
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('cxx', globals(), locals(), [])
+
cxx_suffixes = cplusplus.CXXSuffixes
def checkMocIncluded(target, source, env):
@@ -130,15 +135,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 +155,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 +168,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
diff --git a/src/engine/SCons/Tool/qt.xml b/src/engine/SCons/Tool/qt.xml
index 4e38417..86d50d6 100644
--- a/src/engine/SCons/Tool/qt.xml
+++ b/src/engine/SCons/Tool/qt.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/rmic.py b/src/engine/SCons/Tool/rmic.py
index 0a04b59..9e1eaee 100644
--- a/src/engine/SCons/Tool/rmic.py
+++ b/src/engine/SCons/Tool/rmic.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/rmic.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
diff --git a/src/engine/SCons/Tool/rmic.xml b/src/engine/SCons/Tool/rmic.xml
index d305f55..2b0d42b 100644
--- a/src/engine/SCons/Tool/rmic.xml
+++ b/src/engine/SCons/Tool/rmic.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/rpcgen.py b/src/engine/SCons/Tool/rpcgen.py
index 2348e39..1f2c66d 100644
--- a/src/engine/SCons/Tool/rpcgen.py
+++ b/src/engine/SCons/Tool/rpcgen.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/rpcgen.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
from SCons.Builder import Builder
import SCons.Util
diff --git a/src/engine/SCons/Tool/rpcgen.xml b/src/engine/SCons/Tool/rpcgen.xml
index 6760ab1..60f216e 100644
--- a/src/engine/SCons/Tool/rpcgen.xml
+++ b/src/engine/SCons/Tool/rpcgen.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/rpm.py b/src/engine/SCons/Tool/rpm.py
index 43bb0e7..5cd97b3 100644
--- a/src/engine/SCons/Tool/rpm.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/rpm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/rpmutils.py b/src/engine/SCons/Tool/rpmutils.py
index 07c1ff3..f71d664 100644
--- a/src/engine/SCons/Tool/rpmutils.py
+++ b/src/engine/SCons/Tool/rpmutils.py
@@ -14,7 +14,7 @@ exact syntax.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/rpmutils.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/sgiar.py b/src/engine/SCons/Tool/sgiar.py
index aa3cb44..a421cc1 100644
--- a/src/engine/SCons/Tool/sgiar.py
+++ b/src/engine/SCons/Tool/sgiar.py
@@ -11,7 +11,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgiar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Tool
diff --git a/src/engine/SCons/Tool/sgiar.xml b/src/engine/SCons/Tool/sgiar.xml
index b47b990..ffbc80e 100644
--- a/src/engine/SCons/Tool/sgiar.xml
+++ b/src/engine/SCons/Tool/sgiar.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/sgic++.py b/src/engine/SCons/Tool/sgic++.py
index 6124ade..7a9b1e9 100644
--- a/src/engine/SCons/Tool/sgic++.py
+++ b/src/engine/SCons/Tool/sgic++.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,25 +31,10 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sgic++.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgic++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import SCons.Util
-
-cplusplus = __import__('c++', globals(), locals(), [])
-
-def generate(env):
- """Add Builders and construction variables for SGI MIPS C++ to an Environment."""
-
- cplusplus.generate(env)
-
- env['CXX'] = 'CC'
- env['CXXFLAGS'] = SCons.Util.CLVar('-LANG:std')
- env['SHCXX'] = '$CXX'
- env['SHOBJSUFFIX'] = '.o'
- env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
-
-def exists(env):
- return env.Detect('CC')
+#forward proxy to the preffered cxx version
+from SCons.Tool.sgicxx import *
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/sgic++.xml b/src/engine/SCons/Tool/sgic++.xml
index 7635173..03ca3b1 100644
--- a/src/engine/SCons/Tool/sgic++.xml
+++ b/src/engine/SCons/Tool/sgic++.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/sgicc.py b/src/engine/SCons/Tool/sgicc.py
index 0a0604f..e9f561d 100644
--- a/src/engine/SCons/Tool/sgicc.py
+++ b/src/engine/SCons/Tool/sgicc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgicc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import cc
+from . import cc
def generate(env):
"""Add Builders and construction variables for gcc to an Environment."""
diff --git a/src/engine/SCons/Tool/sgicc.xml b/src/engine/SCons/Tool/sgicc.xml
index 99b9ee6..1e12bf3 100644
--- a/src/engine/SCons/Tool/sgicc.xml
+++ b/src/engine/SCons/Tool/sgicc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/RCS.py b/src/engine/SCons/Tool/sgicxx.py
index 7a8b8b1..61c415b 100644
--- a/src/engine/SCons/Tool/RCS.py
+++ b/src/engine/SCons/Tool/sgicxx.py
@@ -1,6 +1,6 @@
-"""SCons.Tool.RCS.py
+"""SCons.Tool.sgic++
-Tool-specific initialization for RCS.
+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()
@@ -8,7 +8,8 @@ selection method.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
+#
+# Copyright (c) 2001 - 2017 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,33 +29,30 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
-__revision__ = "src/engine/SCons/Tool/RCS.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgicxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 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."""
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('cxx', globals(), locals(), [])
- 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
+def generate(env):
+ """Add Builders and construction variables for SGI MIPS C++ to an Environment."""
- env['RCS'] = 'rcs'
- env['RCS_CO'] = 'co'
- env['RCS_COFLAGS'] = SCons.Util.CLVar('')
- env['RCS_COCOM'] = '$RCS_CO $RCS_COFLAGS $TARGET'
+ cplusplus.generate(env)
+ env['CXX'] = 'CC'
+ env['CXXFLAGS'] = SCons.Util.CLVar('-LANG:std')
+ env['SHCXX'] = '$CXX'
+ env['SHOBJSUFFIX'] = '.o'
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
+
def exists(env):
- return env.Detect('rcs')
+ return env.Detect('CC')
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/sgilink.py b/src/engine/SCons/Tool/sgilink.py
index 9f7446b..c327151 100644
--- a/src/engine/SCons/Tool/sgilink.py
+++ b/src/engine/SCons/Tool/sgilink.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sgilink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Util
-import link
+from . import link
linkers = ['CC', 'cc']
diff --git a/src/engine/SCons/Tool/sgilink.xml b/src/engine/SCons/Tool/sgilink.xml
index ef741e7..ede0eed 100644
--- a/src/engine/SCons/Tool/sgilink.xml
+++ b/src/engine/SCons/Tool/sgilink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/sunar.py b/src/engine/SCons/Tool/sunar.py
index a055708..cd1e18d 100644
--- a/src/engine/SCons/Tool/sunar.py
+++ b/src/engine/SCons/Tool/sunar.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Defaults
import SCons.Tool
diff --git a/src/engine/SCons/Tool/sunar.xml b/src/engine/SCons/Tool/sunar.xml
index 6f26a29..b97e6a2 100644
--- a/src/engine/SCons/Tool/sunar.xml
+++ b/src/engine/SCons/Tool/sunar.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/sunc++.py b/src/engine/SCons/Tool/sunc++.py
index f8b12a1..1219bcf 100644
--- a/src/engine/SCons/Tool/sunc++.py
+++ b/src/engine/SCons/Tool/sunc++.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,109 +31,12 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/sunc++.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunc++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-import SCons
-import os
-import re
-import subprocess
+#forward proxy to the preffered cxx version
+from SCons.Tool.suncxx import *
-cplusplus = __import__('c++', globals(), locals(), [])
-
-package_info = {}
-
-def get_package_info(package_name, pkginfo, pkgchk):
- try:
- return package_info[package_name]
- except KeyError:
- version = None
- pathname = None
- try:
- sadm_contents = open('/var/sadm/install/contents', 'r').read()
- except EnvironmentError:
- pass
- else:
- sadm_re = re.compile('^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M)
- sadm_match = sadm_re.search(sadm_contents)
- if sadm_match:
- pathname = os.path.dirname(sadm_match.group(1))
-
- try:
- p = subprocess.Popen([pkginfo, '-l', package_name],
- stdout=subprocess.PIPE,
- stderr=open('/dev/null', 'w'))
- except EnvironmentError:
- pass
- else:
- pkginfo_contents = p.communicate()[0]
- version_re = re.compile('^ *VERSION:\s*(.*)$', re.M)
- version_match = version_re.search(pkginfo_contents)
- if version_match:
- version = version_match.group(1)
-
- if pathname is None:
- try:
- p = subprocess.Popen([pkgchk, '-l', package_name],
- stdout=subprocess.PIPE,
- stderr=open('/dev/null', 'w'))
- except EnvironmentError:
- pass
- else:
- pkgchk_contents = p.communicate()[0]
- pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M)
- pathname_match = pathname_re.search(pkgchk_contents)
- if pathname_match:
- pathname = os.path.dirname(pathname_match.group(1))
-
- package_info[package_name] = (pathname, version)
- return package_info[package_name]
-
-# use the package installer tool lslpp to figure out where cppc and what
-# version of it is installed
-def get_cppc(env):
- cxx = env.subst('$CXX')
- if cxx:
- cppcPath = os.path.dirname(cxx)
- else:
- cppcPath = None
-
- cppcVersion = None
-
- pkginfo = env.subst('$PKGINFO')
- pkgchk = env.subst('$PKGCHK')
-
- for package in ['SPROcpl']:
- path, version = get_package_info(package, pkginfo, pkgchk)
- if path and version:
- cppcPath, cppcVersion = path, version
- break
-
- return (cppcPath, 'CC', 'CC', cppcVersion)
-
-def generate(env):
- """Add Builders and construction variables for SunPRO C++."""
- path, cxx, shcxx, version = get_cppc(env)
- if path:
- cxx = os.path.join(path, cxx)
- shcxx = os.path.join(path, shcxx)
-
- cplusplus.generate(env)
-
- env['CXX'] = cxx
- env['SHCXX'] = shcxx
- env['CXXVERSION'] = version
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -KPIC')
- env['SHOBJPREFIX'] = 'so_'
- env['SHOBJSUFFIX'] = '.o'
-
-def exists(env):
- path, cxx, shcxx, version = get_cppc(env)
- if path and cxx:
- cppc = os.path.join(path, cxx)
- if os.path.exists(cppc):
- return cppc
- return None
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/sunc++.xml b/src/engine/SCons/Tool/sunc++.xml
index 023a7f4..2e7b220 100644
--- a/src/engine/SCons/Tool/sunc++.xml
+++ b/src/engine/SCons/Tool/sunc++.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/suncc.py b/src/engine/SCons/Tool/suncc.py
index 4bcba29..bc4eb4f 100644
--- a/src/engine/SCons/Tool/suncc.py
+++ b/src/engine/SCons/Tool/suncc.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/suncc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Util
-import cc
+from . import cc
def generate(env):
"""
diff --git a/src/engine/SCons/Tool/suncc.xml b/src/engine/SCons/Tool/suncc.xml
index f015870..61cfb30 100644
--- a/src/engine/SCons/Tool/suncc.xml
+++ b/src/engine/SCons/Tool/suncc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/suncxx.py b/src/engine/SCons/Tool/suncxx.py
new file mode 100644
index 0000000..1545500
--- /dev/null
+++ b/src/engine/SCons/Tool/suncxx.py
@@ -0,0 +1,144 @@
+"""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 - 2017 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/suncxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+
+import SCons
+
+import os
+import re
+import subprocess
+
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
+#cplusplus = __import__('c++', globals(), locals(), [])
+
+package_info = {}
+
+def get_package_info(package_name, pkginfo, pkgchk):
+ try:
+ return package_info[package_name]
+ except KeyError:
+ version = None
+ pathname = None
+ try:
+ sadm_contents = open('/var/sadm/install/contents', 'r').read()
+ except EnvironmentError:
+ pass
+ else:
+ sadm_re = re.compile('^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M)
+ sadm_match = sadm_re.search(sadm_contents)
+ if sadm_match:
+ pathname = os.path.dirname(sadm_match.group(1))
+
+ try:
+ p = subprocess.Popen([pkginfo, '-l', package_name],
+ stdout=subprocess.PIPE,
+ stderr=open('/dev/null', 'w'))
+ except EnvironmentError:
+ pass
+ else:
+ pkginfo_contents = p.communicate()[0]
+ version_re = re.compile('^ *VERSION:\s*(.*)$', re.M)
+ version_match = version_re.search(pkginfo_contents)
+ if version_match:
+ version = version_match.group(1)
+
+ if pathname is None:
+ try:
+ p = subprocess.Popen([pkgchk, '-l', package_name],
+ stdout=subprocess.PIPE,
+ stderr=open('/dev/null', 'w'))
+ except EnvironmentError:
+ pass
+ else:
+ pkgchk_contents = p.communicate()[0]
+ pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M)
+ pathname_match = pathname_re.search(pkgchk_contents)
+ if pathname_match:
+ pathname = os.path.dirname(pathname_match.group(1))
+
+ package_info[package_name] = (pathname, version)
+ return package_info[package_name]
+
+# use the package installer tool lslpp to figure out where cppc and what
+# version of it is installed
+def get_cppc(env):
+ cxx = env.subst('$CXX')
+ if cxx:
+ cppcPath = os.path.dirname(cxx)
+ else:
+ cppcPath = None
+
+ cppcVersion = None
+
+ pkginfo = env.subst('$PKGINFO')
+ pkgchk = env.subst('$PKGCHK')
+
+ for package in ['SPROcpl']:
+ path, version = get_package_info(package, pkginfo, pkgchk)
+ if path and version:
+ cppcPath, cppcVersion = path, version
+ break
+
+ return (cppcPath, 'CC', 'CC', cppcVersion)
+
+def generate(env):
+ """Add Builders and construction variables for SunPRO C++."""
+ path, cxx, shcxx, version = get_cppc(env)
+ if path:
+ cxx = os.path.join(path, cxx)
+ shcxx = os.path.join(path, shcxx)
+
+ cplusplus.generate(env)
+
+ env['CXX'] = cxx
+ env['SHCXX'] = shcxx
+ env['CXXVERSION'] = version
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -KPIC')
+ env['SHOBJPREFIX'] = 'so_'
+ env['SHOBJSUFFIX'] = '.o'
+
+def exists(env):
+ path, cxx, shcxx, version = get_cppc(env)
+ if path and cxx:
+ cppc = os.path.join(path, cxx)
+ if os.path.exists(cppc):
+ return cppc
+ return None
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/sunf77.py b/src/engine/SCons/Tool/sunf77.py
index 3a1dc7b..9842d31 100644
--- a/src/engine/SCons/Tool/sunf77.py
+++ b/src/engine/SCons/Tool/sunf77.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunf77.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Util
-from FortranCommon import add_all_to_env
+from .FortranCommon import add_all_to_env
compilers = ['sunf77', 'f77']
diff --git a/src/engine/SCons/Tool/sunf77.xml b/src/engine/SCons/Tool/sunf77.xml
index d9bc8a6..8f6ecaf 100644
--- a/src/engine/SCons/Tool/sunf77.xml
+++ b/src/engine/SCons/Tool/sunf77.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/sunf90.py b/src/engine/SCons/Tool/sunf90.py
index e5f3788..7245f99 100644
--- a/src/engine/SCons/Tool/sunf90.py
+++ b/src/engine/SCons/Tool/sunf90.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunf90.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Util
-from FortranCommon import add_all_to_env
+from .FortranCommon import add_all_to_env
compilers = ['sunf90', 'f90']
diff --git a/src/engine/SCons/Tool/sunf90.xml b/src/engine/SCons/Tool/sunf90.xml
index 4541971..8f151fe 100644
--- a/src/engine/SCons/Tool/sunf90.xml
+++ b/src/engine/SCons/Tool/sunf90.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/sunf95.py b/src/engine/SCons/Tool/sunf95.py
index 8534f40..aae8828 100644
--- a/src/engine/SCons/Tool/sunf95.py
+++ b/src/engine/SCons/Tool/sunf95.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunf95.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Util
-from FortranCommon import add_all_to_env
+from .FortranCommon import add_all_to_env
compilers = ['sunf95', 'f95']
diff --git a/src/engine/SCons/Tool/sunf95.xml b/src/engine/SCons/Tool/sunf95.xml
index 986f410..a2c77da 100644
--- a/src/engine/SCons/Tool/sunf95.xml
+++ b/src/engine/SCons/Tool/sunf95.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/sunlink.py b/src/engine/SCons/Tool/sunlink.py
index b36d0e5..175157f 100644
--- a/src/engine/SCons/Tool/sunlink.py
+++ b/src/engine/SCons/Tool/sunlink.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/sunlink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import os.path
import SCons.Util
-import link
+from . import link
ccLinker = None
diff --git a/src/engine/SCons/Tool/sunlink.xml b/src/engine/SCons/Tool/sunlink.xml
index 2d470f5..b652f5c 100644
--- a/src/engine/SCons/Tool/sunlink.xml
+++ b/src/engine/SCons/Tool/sunlink.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py
index 0f6883c..dedf103 100644
--- a/src/engine/SCons/Tool/swig.py
+++ b/src/engine/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 - 2017 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 +32,7 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/swig.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/swig.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import re
@@ -140,13 +141,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."""
diff --git a/src/engine/SCons/Tool/swig.xml b/src/engine/SCons/Tool/swig.xml
index d56c491..53d92ef 100644
--- a/src/engine/SCons/Tool/swig.xml
+++ b/src/engine/SCons/Tool/swig.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/tar.py b/src/engine/SCons/Tool/tar.py
index 924358b..77392ae 100644
--- a/src/engine/SCons/Tool/tar.py
+++ b/src/engine/SCons/Tool/tar.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/tar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Action
import SCons.Builder
diff --git a/src/engine/SCons/Tool/tar.xml b/src/engine/SCons/Tool/tar.xml
index ace2c4c..637b7db 100644
--- a/src/engine/SCons/Tool/tar.xml
+++ b/src/engine/SCons/Tool/tar.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py
index 8da6d75..990c9fa 100644
--- a/src/engine/SCons/Tool/tex.py
+++ b/src/engine/SCons/Tool/tex.py
@@ -10,7 +10,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/tex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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)
+ print("multibib match ",multibibmatch.group(1))
if multibibmatch != 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/engine/SCons/Tool/tex.xml b/src/engine/SCons/Tool/tex.xml
index c269dba..87741c0 100644
--- a/src/engine/SCons/Tool/tex.xml
+++ b/src/engine/SCons/Tool/tex.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/textfile.py b/src/engine/SCons/Tool/textfile.py
index 3cea7eb..7303e06 100644
--- a/src/engine/SCons/Tool/textfile.py
+++ b/src/engine/SCons/Tool/textfile.py
@@ -1,6 +1,6 @@
# -*- python -*-
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/textfile.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/textfile.xml b/src/engine/SCons/Tool/textfile.xml
index b6fe30d..bca7232 100644
--- a/src/engine/SCons/Tool/textfile.xml
+++ b/src/engine/SCons/Tool/textfile.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -150,7 +150,7 @@ and the result replaces the key.
env = Environment(tools = ['default', 'textfile'])
env['prefix'] = '/usr/bin'
-script_dict = {'@prefix@': '/bin', @exec_prefix@: '$prefix'}
+script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix'}
env.Substfile('script.in', SUBST_DICT = script_dict)
conf_dict = {'%VERSION%': '1.2.3', '%BASE%': 'MyProg'}
diff --git a/src/engine/SCons/Tool/tlib.py b/src/engine/SCons/Tool/tlib.py
index dd2721a..c0a755e 100644
--- a/src/engine/SCons/Tool/tlib.py
+++ b/src/engine/SCons/Tool/tlib.py
@@ -5,7 +5,7 @@ XXX
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/tlib.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Tool
import SCons.Tool.bcc32
diff --git a/src/engine/SCons/Tool/tlib.xml b/src/engine/SCons/Tool/tlib.xml
index b0b7c02..cb15db3 100644
--- a/src/engine/SCons/Tool/tlib.xml
+++ b/src/engine/SCons/Tool/tlib.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/wix.py b/src/engine/SCons/Tool/wix.py
index 85b46e5..3ddfa84 100644
--- a/src/engine/SCons/Tool/wix.py
+++ b/src/engine/SCons/Tool/wix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/wix.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.Builder
import SCons.Action
diff --git a/src/engine/SCons/Tool/wixTests.py b/src/engine/SCons/Tool/wixTests.py
index de47a56..965ca57 100644
--- a/src/engine/SCons/Tool/wixTests.py
+++ b/src/engine/SCons/Tool/wixTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/wixTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/wixTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import unittest
import os.path
diff --git a/src/engine/SCons/Tool/xgettext.py b/src/engine/SCons/Tool/xgettext.py
index b05df26..2e2934b 100644
--- a/src/engine/SCons/Tool/xgettext.py
+++ b/src/engine/SCons/Tool/xgettext.py
@@ -1,10 +1,10 @@
-""" xgettext tool
+""" xgettext tool
Tool specific initialization of `xgettext` tool.
"""
-# Copyright (c) 2001 - 2016 The SCons Foundation
-#
+# Copyright (c) 2001 - 2017 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
@@ -12,10 +12,10 @@ Tool specific initialization of `xgettext` tool.
# 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
@@ -24,312 +24,335 @@ Tool specific initialization of `xgettext` 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/xgettext.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/xgettext.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 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
+ """ 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.
+ """ 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 and re-throw exception.
+ # Revert working dirs to previous state.
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
+ # 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 = "messages in file found to be up-to-date"
- else:
- # Messages are outdated
- needs_update = True
- explain = "messages in file were outdated"
+ explain = "no internationalized messages encountered"
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
+ 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 _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:
+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
- 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:
+ """ 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
- 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)
+ 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)
+ """ 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 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
+ """ Check, whether the tool exists """
+ from SCons.Tool.GettextCommon import _xgettext_exists
+ try:
+ return _xgettext_exists(env)
+ except:
+ return False
+
#############################################################################
# Local Variables:
diff --git a/src/engine/SCons/Tool/xgettext.xml b/src/engine/SCons/Tool/xgettext.xml
index 6937bd3..0b68c14 100644
--- a/src/engine/SCons/Tool/xgettext.xml
+++ b/src/engine/SCons/Tool/xgettext.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/yacc.py b/src/engine/SCons/Tool/yacc.py
index a2fa83c..4f9fbc2 100644
--- a/src/engine/SCons/Tool/yacc.py
+++ b/src/engine/SCons/Tool/yacc.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/yacc.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/yacc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
diff --git a/src/engine/SCons/Tool/yacc.xml b/src/engine/SCons/Tool/yacc.xml
index 00ad40b..6bdbd53 100644
--- a/src/engine/SCons/Tool/yacc.xml
+++ b/src/engine/SCons/Tool/yacc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Tool/zip.py b/src/engine/SCons/Tool/zip.py
index 7cfea31..0f6a8dd 100644
--- a/src/engine/SCons/Tool/zip.py
+++ b/src/engine/SCons/Tool/zip.py
@@ -9,7 +9,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/zip.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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/engine/SCons/Tool/zip.xml b/src/engine/SCons/Tool/zip.xml
index 9d3494e..82eb61a 100644
--- a/src/engine/SCons/Tool/zip.xml
+++ b/src/engine/SCons/Tool/zip.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001 - 2016 The SCons Foundation
+Copyright (c) 2001 - 2017 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 2370a9c..2a1604b 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -3,7 +3,7 @@
Various utility functions go here.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,50 @@ 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Util.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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 UserDict import UserDict
+except ImportError as e:
+ from collections import UserDict
+
+try:
+ from UserList import UserList
+except ImportError as e:
+ from collections import UserList
+
+from collections import Iterable
+
+try:
+ from UserString import UserString
+except ImportError as e:
+ from collections import UserString
# 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:
+ unicode
+except NameError:
+ UnicodeType = str
+else:
+ UnicodeType = unicode
def dictify(keys, values, result={}):
for k, v in zip(keys, values):
@@ -111,9 +137,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 +173,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 +217,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 +231,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 +267,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 +312,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 +337,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
@@ -311,11 +376,17 @@ 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 +412,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 +420,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 +438,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 +459,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,11 +472,11 @@ 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
@@ -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.
"""
@@ -1206,11 +1283,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
@@ -1377,50 +1454,61 @@ def make_path_relative(path):
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,9 +1518,15 @@ except ImportError:
else:
if hasattr(hashlib, 'md5'):
md5 = True
+
def MD5signature(s):
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):
@@ -1442,10 +1536,10 @@ else:
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 +1588,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 +1612,16 @@ class NullSeq(Null):
del __revision__
+def to_bytes (s):
+ if isinstance (s, (bytes, bytearray)) or bytes is str:
+ return s
+ return bytes (s, 'utf-8')
+
+def to_str (s):
+ if bytes is str or is_String(s):
+ return s
+ return str (s, 'utf-8')
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py
index 9ce3d23..1df4069 100644
--- a/src/engine/SCons/UtilTests.py
+++ b/src/engine/SCons/UtilTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/UtilTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/UtilTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import SCons.compat
@@ -186,26 +186,31 @@ class UtilTestCase(unittest.TestCase):
try:
node, expect, withtags = self.tree_case_1()
- sys.stdout = io.StringIO()
+ if sys.version_info.major < 3:
+ IOStream = io.BytesIO
+ else:
+ IOStream = io.StringIO
+
+ sys.stdout = IOStream()
print_tree(node, get_children)
actual = sys.stdout.getvalue()
assert expect == actual, (expect, actual)
- sys.stdout = io.StringIO()
+ sys.stdout = IOStream()
print_tree(node, get_children, showtags=1)
actual = sys.stdout.getvalue()
assert withtags == actual, (withtags, actual)
-
+
# Test that explicitly setting prune to zero works
# the same as the default (see above)
node, expect, withtags = self.tree_case_2(prune=0)
-
- sys.stdout = io.StringIO()
+
+ sys.stdout = IOStream()
print_tree(node, get_children, 0)
actual = sys.stdout.getvalue()
assert expect == actual, (expect, actual)
-
- sys.stdout = io.StringIO()
+
+ sys.stdout = IOStream()
print_tree(node, get_children, 0, showtags=1)
actual = sys.stdout.getvalue()
assert withtags == actual, (withtags, actual)
@@ -213,7 +218,7 @@ class UtilTestCase(unittest.TestCase):
# Test output with prune=1
node, expect, withtags = self.tree_case_2(prune=1)
- sys.stdout = io.StringIO()
+ sys.stdout = IOStream()
print_tree(node, get_children, 1)
actual = sys.stdout.getvalue()
assert expect == actual, (expect, actual)
@@ -222,12 +227,12 @@ class UtilTestCase(unittest.TestCase):
# again. This wasn't possible in version 2.4.1 and earlier
# due to a bug in print_tree (visited was set to {} as default
# parameter)
- sys.stdout = io.StringIO()
+ sys.stdout = IOStream()
print_tree(node, get_children, 1)
actual = sys.stdout.getvalue()
assert expect == actual, (expect, actual)
- sys.stdout = io.StringIO()
+ sys.stdout = IOStream()
print_tree(node, get_children, 1, showtags=1)
actual = sys.stdout.getvalue()
assert withtags == actual, (withtags, actual)
@@ -237,7 +242,11 @@ class UtilTestCase(unittest.TestCase):
def test_is_Dict(self):
assert is_Dict({})
assert is_Dict(UserDict())
- assert is_Dict(os.environ)
+
+ # os.environ is not a dictionary in python 3
+ if sys.version_info < (3,0):
+ assert is_Dict(os.environ)
+
try:
class mydict(dict):
pass
@@ -249,7 +258,7 @@ class UtilTestCase(unittest.TestCase):
assert not is_Dict(())
assert not is_Dict("")
if HasUnicode:
- exec "assert not is_Dict(u'')"
+ exec("assert not is_Dict(u'')")
def test_is_List(self):
assert is_List([])
@@ -265,12 +274,12 @@ class UtilTestCase(unittest.TestCase):
assert not is_List({})
assert not is_List("")
if HasUnicode:
- exec "assert not is_List(u'')"
+ exec("assert not is_List(u'')")
def test_is_String(self):
assert is_String("")
if HasUnicode:
- exec "assert is_String(u'')"
+ exec("assert is_String(u'')")
assert is_String(UserString(''))
try:
class mystr(str):
@@ -296,7 +305,7 @@ class UtilTestCase(unittest.TestCase):
assert not is_Tuple({})
assert not is_Tuple("")
if HasUnicode:
- exec "assert not is_Tuple(u'')"
+ exec("assert not is_Tuple(u'')")
def test_to_String(self):
"""Test the to_String() method."""
@@ -343,10 +352,10 @@ class UtilTestCase(unittest.TestCase):
os.mkdir(sub2_xxx_exe)
test.write(sub3_xxx_exe, "\n")
- os.chmod(sub3_xxx_exe, 0777)
+ os.chmod(sub3_xxx_exe, 0o777)
test.write(sub4_xxx_exe, "\n")
- os.chmod(sub4_xxx_exe, 0777)
+ os.chmod(sub4_xxx_exe, 0o777)
env_path = os.environ['PATH']
@@ -723,7 +732,7 @@ class UtilTestCase(unittest.TestCase):
def test_LogicalLines(self):
"""Test the LogicalLines class"""
- content = r"""
+ content = u"""
foo \
bar \
baz
@@ -732,9 +741,7 @@ bling \
bling \ bling
bling
"""
- # Python 2.7 and beyond require unicode strings.
- fobj = io.StringIO(unicode(content))
-
+ fobj = io.StringIO(content)
lines = LogicalLines(fobj).readlines()
assert lines == [
'\n',
@@ -746,8 +753,8 @@ bling
def test_intern(self):
s1 = silent_intern("spam")
- # Python 3.x does not have a unicode() global function
- if sys.version[0] == '2':
+ # TODO: Python 3.x does not have a unicode() global function
+ if sys.version[0] == '2':
s2 = silent_intern(unicode("unicode spam"))
s3 = silent_intern(42)
s4 = silent_intern("spam")
@@ -760,7 +767,7 @@ class MD5TestCase(unittest.TestCase):
"""Test collecting a list of signatures into a new signature value
"""
s = list(map(MD5signature, ('111', '222', '333')))
-
+
assert '698d51a19d8a121ce581499d7b701668' == MD5collect(s[0:1])
assert '8980c988edc2c78cc43ccb718c06efd5' == MD5collect(s[0:2])
assert '53fd88c84ff8a285eb6e0a687e55b8c7' == MD5collect(s)
diff --git a/src/engine/SCons/Variables/BoolVariable.py b/src/engine/SCons/Variables/BoolVariable.py
index 4473184..881a6b4 100644
--- a/src/engine/SCons/Variables/BoolVariable.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/BoolVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__all__ = ['BoolVariable',]
diff --git a/src/engine/SCons/Variables/BoolVariableTests.py b/src/engine/SCons/Variables/BoolVariableTests.py
index 85504a1..42beaee 100644
--- a/src/engine/SCons/Variables/BoolVariableTests.py
+++ b/src/engine/SCons/Variables/BoolVariableTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Variables/BoolVariableTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/BoolVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
diff --git a/src/engine/SCons/Variables/EnumVariable.py b/src/engine/SCons/Variables/EnumVariable.py
index 57c4661..b6fc382 100644
--- a/src/engine/SCons/Variables/EnumVariable.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/EnumVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__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/engine/SCons/Variables/EnumVariableTests.py b/src/engine/SCons/Variables/EnumVariableTests.py
index 2f6baee..caef48f 100644
--- a/src/engine/SCons/Variables/EnumVariableTests.py
+++ b/src/engine/SCons/Variables/EnumVariableTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Variables/EnumVariableTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/EnumVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
diff --git a/src/engine/SCons/Variables/ListVariable.py b/src/engine/SCons/Variables/ListVariable.py
index 1840561..8f9a9a8 100644
--- a/src/engine/SCons/Variables/ListVariable.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/ListVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
# Known Bug: This should behave like a Set-Type, but does not really,
# since elements can occur twice.
diff --git a/src/engine/SCons/Variables/ListVariableTests.py b/src/engine/SCons/Variables/ListVariableTests.py
index c49bd31..be45aed 100644
--- a/src/engine/SCons/Variables/ListVariableTests.py
+++ b/src/engine/SCons/Variables/ListVariableTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Variables/ListVariableTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/ListVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import copy
import sys
diff --git a/src/engine/SCons/Variables/PackageVariable.py b/src/engine/SCons/Variables/PackageVariable.py
index 6d4761f..8e229b7 100644
--- a/src/engine/SCons/Variables/PackageVariable.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PackageVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__all__ = ['PackageVariable',]
diff --git a/src/engine/SCons/Variables/PackageVariableTests.py b/src/engine/SCons/Variables/PackageVariableTests.py
index 083fe63..30a88b5 100644
--- a/src/engine/SCons/Variables/PackageVariableTests.py
+++ b/src/engine/SCons/Variables/PackageVariableTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Variables/PackageVariableTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PackageVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
diff --git a/src/engine/SCons/Variables/PathVariable.py b/src/engine/SCons/Variables/PathVariable.py
index aa3f218..dc5fcd2 100644
--- a/src/engine/SCons/Variables/PathVariable.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PathVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__all__ = ['PathVariable',]
diff --git a/src/engine/SCons/Variables/PathVariableTests.py b/src/engine/SCons/Variables/PathVariableTests.py
index 2e574eb..c8518af 100644
--- a/src/engine/SCons/Variables/PathVariableTests.py
+++ b/src/engine/SCons/Variables/PathVariableTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Variables/PathVariableTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PathVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import sys
@@ -67,7 +67,7 @@ class PathVariableTestCase(unittest.TestCase):
dne = test.workpath('does_not_exist')
try:
o.validator('X', dne, {})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
assert str(e) == 'Path for option X does not exist: %s' % dne, e
except:
raise Exception("did not catch expected UserError")
@@ -91,7 +91,7 @@ class PathVariableTestCase(unittest.TestCase):
f = test.workpath('file')
try:
o.validator('X', f, {})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
assert str(e) == 'Directory path for option X is a file: %s' % f, e
except:
raise Exception("did not catch expected UserError")
@@ -99,7 +99,7 @@ class PathVariableTestCase(unittest.TestCase):
dne = test.workpath('does_not_exist')
try:
o.validator('X', dne, {})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
assert str(e) == 'Directory path for option X does not exist: %s' % dne, e
except:
raise Exception("did not catch expected UserError")
@@ -124,7 +124,7 @@ class PathVariableTestCase(unittest.TestCase):
f = test.workpath('file')
try:
o.validator('X', f, {})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
assert str(e) == 'Path for option X is a file, not a directory: %s' % f, e
except:
raise Exception("did not catch expected UserError")
@@ -148,7 +148,7 @@ class PathVariableTestCase(unittest.TestCase):
d = test.workpath('d')
try:
o.validator('X', d, {})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
assert str(e) == 'File path for option X does not exist: %s' % d, e
except:
raise Exception("did not catch expected UserError")
@@ -156,7 +156,7 @@ class PathVariableTestCase(unittest.TestCase):
dne = test.workpath('does_not_exist')
try:
o.validator('X', dne, {})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
assert str(e) == 'File path for option X does not exist: %s' % dne, e
except:
raise Exception("did not catch expected UserError")
@@ -200,7 +200,7 @@ class PathVariableTestCase(unittest.TestCase):
dne = test.workpath('does_not_exist')
try:
o.validator('X', dne, {})
- except SCons.Errors.UserError, e:
+ except SCons.Errors.UserError as e:
expect = 'Path for option X does not exist: %s' % dne
assert str(e) == expect, e
else:
@@ -219,7 +219,7 @@ class PathVariableTestCase(unittest.TestCase):
try:
o.validator('Y', 'value', {})
- except Exception, e:
+ except Exception as e:
assert str(e) == 'my_validator() got called for Y, value!', e
else:
raise Exception("did not catch expected exception from my_validator()")
diff --git a/src/engine/SCons/Variables/VariablesTests.py b/src/engine/SCons/Variables/VariablesTests.py
index a6a1b5e..dc507ce 100644
--- a/src/engine/SCons/Variables/VariablesTests.py
+++ b/src/engine/SCons/Variables/VariablesTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/Variables/VariablesTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/VariablesTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
@@ -49,6 +49,14 @@ class Environment(object):
return key in self.dict
+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 check(key, value, env):
assert int(value) == 6 * 9, "key %s = %s" % (key, repr(value))
@@ -57,7 +65,7 @@ def check(key, value, env):
def checkSave(file, expected):
gdict = {}
ldict = {}
- exec open(file, 'rU').read() in gdict, ldict
+ exec(open(file, 'r').read(), gdict, ldict)
assert expected == ldict, "%s\n...not equal to...\n%s" % (expected, ldict)
class VariablesTestCase(unittest.TestCase):
diff --git a/src/engine/SCons/Variables/__init__.py b/src/engine/SCons/Variables/__init__.py
index 284813f..784f795 100644
--- a/src/engine/SCons/Variables/__init__.py
+++ b/src/engine/SCons/Variables/__init__.py
@@ -5,7 +5,7 @@ customizable variables to an SCons build.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 @@ 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os.path
import sys
@@ -36,11 +36,11 @@ 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 +115,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 +141,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 +178,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 +216,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 +278,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):
diff --git a/src/engine/SCons/Warnings.py b/src/engine/SCons/Warnings.py
index 25efcb9..33ba050 100644
--- a/src/engine/SCons/Warnings.py
+++ b/src/engine/SCons/Warnings.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Warnings.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
diff --git a/src/engine/SCons/WarningsTests.py b/src/engine/SCons/WarningsTests.py
index 5678ad2..fbba547 100644
--- a/src/engine/SCons/WarningsTests.py
+++ b/src/engine/SCons/WarningsTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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/WarningsTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/WarningsTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import sys
import unittest
diff --git a/src/engine/SCons/__init__.py b/src/engine/SCons/__init__.py
index d5c94a7..5a22146 100644
--- a/src/engine/SCons/__init__.py
+++ b/src/engine/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 - 2017 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,15 +27,15 @@ 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-__version__ = "2.5.1"
+__version__ = "3.0.0"
-__build__ = "rel_2.5.1:3735:9dc6cee5c168[MODIFIED]"
+__build__ = "rel_3.0.0:4395:8972f6a2f699"
-__buildsys__ = "mongodog"
+__buildsys__ = "ubuntu-16"
-__date__ = "2016/11/03 14:02:02"
+__date__ = "2017/09/18 12:59:24"
__developer__ = "bdbaddog"
diff --git a/src/engine/SCons/__main__.py b/src/engine/SCons/__main__.py
new file mode 100644
index 0000000..0dfbb9d
--- /dev/null
+++ b/src/engine/SCons/__main__.py
@@ -0,0 +1,4 @@
+import SCons.Script
+# this does all the work, and calls sys.exit
+# with the proper exit status when done.
+SCons.Script.main()
diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py
index d3d4fe6..7973732 100644
--- a/src/engine/SCons/compat/__init__.py
+++ b/src/engine/SCons/compat/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/compat/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
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 = 2
+
+# 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/engine/SCons/compat/_scons_dbm.py b/src/engine/SCons/compat/_scons_dbm.py
index ab8534c..7adbeb9 100644
--- a/src/engine/SCons/compat/_scons_dbm.py
+++ b/src/engine/SCons/compat/_scons_dbm.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/compat/_scons_dbm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
class error(Exception):
pass
diff --git a/src/engine/SCons/cpp.py b/src/engine/SCons/cpp.py
index 60484f7..ff750c2 100644
--- a/src/engine/SCons/cpp.py
+++ b/src/engine/SCons/cpp.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/cpp.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
__doc__ = """
SCons C Pre-Processor module
"""
-#TODO 2.3 and before has no sorted()
import SCons.compat
import os
@@ -87,7 +86,7 @@ del op_list
override = {
'if' : 'if(?!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 +129,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 +265,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 +311,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 +378,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 +510,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 +542,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/engine/SCons/cppTests.py b/src/engine/SCons/cppTests.py
index 1019f8f..2108277 100644
--- a/src/engine/SCons/cppTests.py
+++ b/src/engine/SCons/cppTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,9 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/cppTests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+from __future__ import absolute_import
+
+__revision__ = "src/engine/SCons/cppTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import atexit
import sys
diff --git a/src/engine/SCons/dblite.py b/src/engine/SCons/dblite.py
index 707a4f8..87a1763 100644
--- a/src/engine/SCons/dblite.py
+++ b/src/engine/SCons/dblite.py
@@ -1,21 +1,24 @@
# dblite.py module contributed by Ralf W. Grosse-Kunstleve.
# Extended for Unicode by Steven Knight.
-
-import SCons.compat
+from __future__ import print_function
import os
-# compat layer imports "cPickle" for us if it's available.
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
+ print("Warning: Discarding corrupt database:", filename)
-try: unicode
+
+try:
+ unicode
except NameError:
def is_string(s):
return isinstance(s, str)
@@ -23,231 +26,258 @@ 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
+ 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.
- # 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())))
+ 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
- def _check_writable(self):
- if (self._flag == "r"):
- raise IOError("Read-only database: %s" % self._file_name)
+ 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
- def __getitem__(self, key):
- return self._dict[key]
+ 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 __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 close(self):
+ if (self._needs_sync):
+ self.sync()
- def keys(self):
- return list(self._dict.keys())
+ def __del__(self):
+ self.close()
- def has_key(self, key):
- return key in self._dict
+ 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()
- def __contains__(self, key):
- return key in self._dict
+ # 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 iterkeys(self):
- # Wrapping name in () prevents fixer from "fixing" this
- return (self._dict.iterkeys)()
+ def _check_writable(self):
+ if (self._flag == "r"):
+ raise IOError("Read-only database: %s" % self._file_name)
- __iter__ = iterkeys
+ def __getitem__(self, key):
+ return self._dict[key]
- def __len__(self):
- return len(self._dict)
+ 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 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 = 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()
- 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:
+ 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")
- except IOError, e:
- assert str(e) == "[Errno 2] No such file or directory: 'tmp.dblite'", str(e)
- else:
- raise RuntimeError("IOError expected.")
- print "OK"
+ 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()
+ _exercise()
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/exitfuncs.py b/src/engine/SCons/exitfuncs.py
index 756b925..2b7bd51 100644
--- a/src/engine/SCons/exitfuncs.py
+++ b/src/engine/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 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/exitfuncs.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import atexit
diff --git a/src/script/scons-configure-cache.py b/src/script/scons-configure-cache.py
index a376b2d..9b8b737 100644
--- a/src/script/scons-configure-cache.py
+++ b/src/script/scons-configure-cache.py
@@ -1,139 +1,141 @@
-#! /usr/bin/env python
-#
-# SCons - a Software Constructor
-#
-# 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/script/scons-configure-cache.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
-
-__version__ = "2.5.1"
-
-__build__ = "rel_2.5.1:3735:9dc6cee5c168[MODIFIED]"
-
-__buildsys__ = "mongodog"
-
-__date__ = "2016/11/03 14:02:02"
-
-__developer__ = "bdbaddog"
-
-import argparse
-import glob
-import json
-import os
-
-def rearrange_cache_entries(current_prefix_len, new_prefix_len):
- 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)
- dir = name[:current_prefix_len].upper()
- if dir not in old_dirs:
- print 'Migrating', dir
- old_dirs.add(dir)
- dir = name[:new_prefix_len].upper()
- if dir not in dirs:
- os.mkdir(dir)
- dirs.add(dir)
- os.rename(file, os.path.join(dir, name))
-
- # Now delete the original directories
- for dir in old_dirs:
- os.rmdir(dir)
-
-# This dictionary should have one entry per entry in the cache config
-# Each entry should have 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 it's necessary to do some work
-# 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 = '''
- Unless you specify an option, it will not be changed (if it is
- already set in the cache config), or changed to an appropriate
- default (it it is not set).
- '''
- )
-
-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')
-
-# Get the command line as a dict without any of the unspecified entries.
-args = dict(filter(lambda x: x[1], vars(parser.parse_args()).items()))
-
-# It seems somewhat strange to me, but positional arguments don't get the -
-# in the name changed to _, whereas optional arguments do...
-os.chdir(args['cache-dir'])
-del args['cache-dir']
-
-if not os.path.exists('config'):
- # 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("This doesn't look like a version 1 cache directory")
- config = dict()
-else:
- with open('config') as conf:
- config = json.load(conf)
-
-# Find any keys that aren't 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 we 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) \ No newline at end of file
+#! /usr/bin/env python
+#
+# SCons - a Software Constructor
+#
+# Copyright (c) 2001 - 2017 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.
+
+from __future__ import print_function
+
+__revision__ = "src/script/scons-configure-cache.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+
+__version__ = "3.0.0"
+
+__build__ = "rel_3.0.0:4395:8972f6a2f699"
+
+__buildsys__ = "ubuntu-16"
+
+__date__ = "2017/09/18 12:59:24"
+
+__developer__ = "bdbaddog"
+
+import argparse
+import glob
+import json
+import os
+
+def rearrange_cache_entries(current_prefix_len, new_prefix_len):
+ 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)
+ dir = name[:current_prefix_len].upper()
+ if dir not in old_dirs:
+ print('Migrating', dir)
+ old_dirs.add(dir)
+ dir = name[:new_prefix_len].upper()
+ if dir not in dirs:
+ os.mkdir(dir)
+ dirs.add(dir)
+ os.rename(file, os.path.join(dir, name))
+
+ # Now delete the original directories
+ for dir in old_dirs:
+ os.rmdir(dir)
+
+# This dictionary should have one entry per entry in the cache config
+# Each entry should have 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 it's necessary to do some work
+# 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 = '''
+ Unless you specify an option, it will not be changed (if it is
+ already set in the cache config), or changed to an appropriate
+ default (it it is not set).
+ '''
+ )
+
+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')
+
+# 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...
+os.chdir(args['cache-dir'])
+del args['cache-dir']
+
+if not os.path.exists('config'):
+ # 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("This doesn't look like a version 1 cache directory")
+ config = dict()
+else:
+ with open('config') as conf:
+ config = json.load(conf)
+
+# Find any keys that aren't 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 we 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/script/scons-time.py b/src/script/scons-time.py
index 3438062..08bde60 100644
--- a/src/script/scons-time.py
+++ b/src/script/scons-time.py
@@ -9,7 +9,7 @@
#
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/script/scons-time.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import getopt
import glob
@@ -66,8 +65,8 @@ def HACK_for_exec(cmd, *args):
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 ]
@@ -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/script/scons.bat b/src/script/scons.bat
index 7a7690e..f759e43 100644
--- a/src/script/scons.bat
+++ b/src/script/scons.bat
@@ -1,11 +1,11 @@
-@REM Copyright (c) 2001 - 2016 The SCons Foundation
-@REM src/script/scons.bat rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog
+@REM Copyright (c) 2001 - 2017 The SCons Foundation
+@REM src/script/scons.bat rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog
@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-2.5.1'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-2.5.1'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
+python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.0.0'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.0.0'), 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
diff --git a/src/script/scons.py b/src/script/scons.py
index 967d398..bee0224 100644
--- a/src/script/scons.py
+++ b/src/script/scons.py
@@ -2,7 +2,7 @@
#
# SCons - a Software Constructor
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,15 +23,17 @@
# 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+from __future__ import print_function
-__version__ = "2.5.1"
+__revision__ = "src/script/scons.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-__build__ = "rel_2.5.1:3735:9dc6cee5c168[MODIFIED]"
+__version__ = "3.0.0"
-__buildsys__ = "mongodog"
+__build__ = "rel_3.0.0:4395:8972f6a2f699"
-__date__ = "2016/11/03 14:02:02"
+__buildsys__ = "ubuntu-16"
+
+__date__ = "2017/09/18 12:59:24"
__developer__ = "bdbaddog"
@@ -56,9 +58,9 @@ import sys
# engine modules if they're in either directory.
-if sys.version_info >= (3,0,0):
+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 < 3.5 is not yet supported.\n"
sys.stderr.write(msg % (__version__, sys.version.split()[0]))
sys.exit(1)
@@ -98,7 +100,7 @@ try:
except ImportError:
pass
else:
- # when running from an egg add the egg's directory
+ # when running from an egg add the egg's directory
try:
d = pkg_resources.get_distribution('scons')
except pkg_resources.DistributionNotFound:
@@ -191,7 +193,7 @@ if __name__ == "__main__":
except ImportError:
print("SCons import failed. Unable to find engine files in:")
for path in libs:
- print(" %s" % path)
+ print(" {}".format(path))
raise
# this does all the work, and calls sys.exit
diff --git a/src/script/sconsign.py b/src/script/sconsign.py
index 90572c3..d3450ab 100644
--- a/src/script/sconsign.py
+++ b/src/script/sconsign.py
@@ -2,7 +2,7 @@
#
# SCons - a Software Constructor
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,15 +23,17 @@
# 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.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+from __future__ import print_function
-__version__ = "2.5.1"
+__revision__ = "src/script/sconsign.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
-__build__ = "rel_2.5.1:3735:9dc6cee5c168[MODIFIED]"
+__version__ = "3.0.0"
-__buildsys__ = "mongodog"
+__build__ = "rel_3.0.0:4395:8972f6a2f699"
-__date__ = "2016/11/03 14:02:02"
+__buildsys__ = "ubuntu-16"
+
+__date__ = "2017/09/18 12:59:24"
__developer__ = "bdbaddog"
@@ -55,13 +57,6 @@ import sys
# 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"
- sys.stderr.write(msg % (__version__, sys.version.split()[0]))
- sys.exit(1)
-
-
script_dir = sys.path[0]
if script_dir in sys.path:
@@ -95,7 +90,7 @@ try:
except ImportError:
pass
else:
- # when running from an egg add the egg's directory
+ # when running from an egg add the egg's directory
try:
d = pkg_resources.get_distribution('scons')
except pkg_resources.DistributionNotFound:
@@ -182,9 +177,14 @@ 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
@@ -202,8 +202,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:
@@ -235,6 +241,11 @@ def default_mapper(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):
@@ -323,14 +334,14 @@ 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:
@@ -343,9 +354,9 @@ 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)
else:
for name in sorted(entries.keys()):
@@ -353,9 +364,9 @@ 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):
@@ -374,7 +385,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,7 +399,7 @@ 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
@@ -399,7 +410,7 @@ class Do_SConsignDB(object):
except pickle.UnpicklingError:
sys.stderr.write("sconsign: ignoring invalid `%s' file `%s'\n" % (self.dbm_name, fname))
return
- except Exception, e:
+ except Exception as e:
sys.stderr.write("sconsign: ignoring invalid `%s' file `%s': %s\n" % (self.dbm_name, fname, e))
return
@@ -416,13 +427,13 @@ class Do_SConsignDB(object):
self.printentries(dir, db[dir])
def printentries(self, dir, val):
- print '=== ' + dir + ':'
+ print('=== ' + dir + ':')
printentries(pickle.loads(val), dir)
def Do_SConsignDir(name):
try:
fp = open(name, 'rb')
- except (IOError, OSError), e:
+ except (IOError, OSError) as e:
sys.stderr.write("sconsign: %s\n" % (e))
return
try:
@@ -432,7 +443,7 @@ def Do_SConsignDir(name):
except pickle.UnpicklingError:
sys.stderr.write("sconsign: ignoring invalid .sconsign file `%s'\n" % (name))
return
- except Exception, e:
+ except Exception as e:
sys.stderr.write("sconsign: ignoring invalid .sconsign file `%s': %s\n" % (name, e))
return
printentries(sconsign.entries, args[0])
@@ -494,13 +505,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
@@ -515,12 +526,13 @@ for o, a in opts:
elif o in ('-v', '--verbose'):
Verbose = 1
+
if Do_Call:
for a in args:
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'}
if dbm_name != "SCons.dblite":
diff --git a/src/setup.cfg b/src/setup.cfg
index f04ca1b..bda7571 100644
--- a/src/setup.cfg
+++ b/src/setup.cfg
@@ -3,3 +3,6 @@ group = Development/Tools
[bdist_wininst]
title = SCons - a software construction tool
+
+[bdist_wheel]
+universal=1
diff --git a/src/setup.py b/src/setup.py
index 59a90f4..7a2b84a 100644
--- a/src/setup.py
+++ b/src/setup.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,13 +32,15 @@ NOTE: Installed SCons is not importable like usual Python packages. It is
below is dedicated to make it happen on various platforms.
"""
-__revision__ = "src/setup.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+from __future__ import print_function
+
+__revision__ = "src/setup.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import os
import stat
import sys
-Version = "2.5.1"
+Version = "3.0.0"
man_pages = [
'scons.1',
@@ -46,21 +48,12 @@ man_pages = [
'scons-time.1',
]
-# Exit with error if trying to install with Python >= 3.0
-if sys.version_info >= (3,0,0):
- msg = "scons: *** SCons does not run under Python version %s.\n\
-Python 3 and above are not yet supported.\n"
- sys.stderr.write(msg % (sys.version.split()[0]))
- sys.exit(1)
-
-
# change to setup.py directory if it was executed from other dir
(head, tail) = os.path.split(sys.argv[0])
if head:
os.chdir(head)
sys.argv[0] = tail
-
# flag if setup.py is run on win32 or _for_ win32 platform,
# (when building windows installer on linux, for example)
is_win32 = 0
@@ -73,7 +66,6 @@ if not sys.platform == 'win32':
else:
is_win32 = 1
-
import distutils
import distutils.core
import distutils.command.install
@@ -83,6 +75,7 @@ import distutils.command.install_scripts
import distutils.command.build_scripts
import distutils.msvccompiler
+
def get_build_version():
""" monkey patch distutils msvc version if we're not on windows.
We need to use vc version 9 for python 2.7.x and it defaults to 6
@@ -90,6 +83,7 @@ def get_build_version():
monkey patching"""
return 9
+
distutils.msvccompiler.get_build_version = get_build_version
_install = distutils.command.install.install
@@ -98,13 +92,16 @@ _install_lib = distutils.command.install_lib.install_lib
_install_scripts = distutils.command.install_scripts.install_scripts
_build_scripts = distutils.command.build_scripts.build_scripts
+
class _options(object):
pass
+
Options = _options()
Installed = []
+
def set_explicitly(name, args):
"""
Return if the installation directory was set explicitly by the
@@ -125,51 +122,52 @@ def set_explicitly(name, args):
break
return set
+
class install(_install):
user_options = _install.user_options + [
- ('no-scons-script', None,
- "don't install 'scons', only install 'scons-%s'" % Version),
- ('no-version-script', None,
- "don't install 'scons-%s', only install 'scons'" % Version),
- ('install-bat', None,
- "install 'scons.bat' script"),
- ('no-install-bat', None,
- "do not install 'scons.bat' script"),
- ('install-man', None,
- "install SCons man pages"),
- ('no-install-man', None,
- "do not install SCons man pages"),
- ('standard-lib', None,
- "install SCons library in standard Python location"),
- ('standalone-lib', None,
- "install SCons library in separate standalone directory"),
- ('version-lib', None,
- "install SCons library in version-numbered directory"),
- ]
+ ('no-scons-script', None,
+ "don't install 'scons', only install 'scons-%s'" % Version),
+ ('no-version-script', None,
+ "don't install 'scons-%s', only install 'scons'" % Version),
+ ('install-bat', None,
+ "install 'scons.bat' script"),
+ ('no-install-bat', None,
+ "do not install 'scons.bat' script"),
+ ('install-man', None,
+ "install SCons man pages"),
+ ('no-install-man', None,
+ "do not install SCons man pages"),
+ ('standard-lib', None,
+ "install SCons library in standard Python location"),
+ ('standalone-lib', None,
+ "install SCons library in separate standalone directory"),
+ ('version-lib', None,
+ "install SCons library in version-numbered directory"),
+ ]
boolean_options = _install.boolean_options + [
- 'no-scons-script',
- 'no-version-script',
- 'install-bat',
- 'no-install-bat',
- 'install-man',
- 'no-install-man',
- 'standard-lib',
- 'standalone-lib',
- 'version-lib'
- ]
+ 'no-scons-script',
+ 'no-version-script',
+ 'install-bat',
+ 'no-install-bat',
+ 'install-man',
+ 'no-install-man',
+ 'standard-lib',
+ 'standalone-lib',
+ 'version-lib'
+ ]
if hasattr(os, 'link'):
user_options.append(
- ('hardlink-scons', None,
- "hard link 'scons' to the version-numbered script, don't make a separate 'scons' copy"),
- )
+ ('hardlink-scons', None,
+ "hard link 'scons' to the version-numbered script, don't make a separate 'scons' copy"),
+ )
boolean_options.append('hardlink-script')
if hasattr(os, 'symlink'):
user_options.append(
- ('symlink-scons', None,
- "make 'scons' a symbolic link to the version-numbered script, don't make a separate 'scons' copy"),
- )
+ ('symlink-scons', None,
+ "make 'scons' a symbolic link to the version-numbered script, don't make a separate 'scons' copy"),
+ )
boolean_options.append('symlink-script')
def initialize_options(self):
@@ -207,6 +205,7 @@ class install(_install):
Options.hardlink_scons = self.hardlink_scons
Options.symlink_scons = self.symlink_scons
+
def get_scons_prefix(libdir, is_win32):
"""
Return the right prefix for SCons library installation. Find
@@ -231,6 +230,7 @@ def get_scons_prefix(libdir, is_win32):
return os.path.join(drive + head)
return libdir
+
def force_to_usr_local(self):
"""
A hack to decide if we need to "force" the installation directories
@@ -242,6 +242,7 @@ def force_to_usr_local(self):
(self.install_dir[:9] == '/Library/' or
self.install_dir[:16] == '/System/Library/'))
+
class install_lib(_install_lib):
def finalize_options(self):
_install_lib.finalize_options(self)
@@ -264,6 +265,7 @@ class install_lib(_install_lib):
msg = "Installed SCons library modules into %s" % self.install_dir
Installed.append(msg)
+
class install_scripts(_install_scripts):
def finalize_options(self):
_install_scripts.finalize_options(self)
@@ -277,18 +279,24 @@ class install_scripts(_install_scripts):
pass
def hardlink_scons(self, src, dst, ver):
- try: os.unlink(dst)
- except OSError: pass
+ try:
+ os.unlink(dst)
+ except OSError:
+ pass
os.link(ver, dst)
def symlink_scons(self, src, dst, ver):
- try: os.unlink(dst)
- except OSError: pass
+ try:
+ os.unlink(dst)
+ except OSError:
+ pass
os.symlink(os.path.split(ver)[1], dst)
def copy_scons(self, src, dst, *args):
- try: os.unlink(dst)
- except OSError: pass
+ try:
+ os.unlink(dst)
+ except OSError:
+ pass
self.copy_file(src, dst)
self.outfiles.append(dst)
@@ -343,7 +351,7 @@ class install_scripts(_install_scripts):
self.copy_scons(src, scons_version_bat)
# --- distutils copy/paste ---
- if hasattr(os, 'chmod') and hasattr(os,'stat'):
+ if hasattr(os, 'chmod') and hasattr(os, 'stat'):
# Set the executable bits (owner, group, and world) on
# all the scripts we just installed.
for file in self.get_outputs():
@@ -353,20 +361,23 @@ class install_scripts(_install_scripts):
else:
# Use symbolic versions of permissions so this script doesn't fail to parse under python3.x
exec_and_read_permission = stat.S_IXOTH | stat.S_IXUSR | stat.S_IXGRP | stat.S_IROTH | stat.S_IRUSR | stat.S_IRGRP
- mode_mask = 4095 # Octal 07777 used because python3 has different octal syntax than python 2
+ mode_mask = 4095 # Octal 07777 used because python3 has different octal syntax than python 2
mode = ((os.stat(file)[stat.ST_MODE]) | exec_and_read_permission) & mode_mask
# log.info("changing mode of %s to %o", file, mode)
os.chmod(file, mode)
- # --- /distutils copy/paste ---
+ # --- /distutils copy/paste ---
+
class build_scripts(_build_scripts):
def finalize_options(self):
_build_scripts.finalize_options(self)
self.build_dir = os.path.join('build', 'scripts')
+
class install_data(_install_data):
def initialize_options(self):
_install_data.initialize_options(self)
+
def finalize_options(self):
_install_data.finalize_options(self)
if force_to_usr_local(self):
@@ -383,6 +394,7 @@ class install_data(_install_data):
else:
self.data_files = []
+
description = "Open Source next-generation build tool."
long_description = """Open Source next-generation build tool.
@@ -404,103 +416,103 @@ scripts = [
]
arguments = {
- 'name' : "scons",
- 'version' : Version,
- 'description' : description,
- 'long_description' : long_description,
- 'author' : 'Steven Knight',
- 'author_email' : 'knight@baldmt.com',
- 'url' : "http://www.scons.org/",
- 'packages' : ["SCons",
- "SCons.compat",
- "SCons.Node",
- "SCons.Options",
- "SCons.Platform",
- "SCons.Scanner",
- "SCons.Script",
- "SCons.Tool",
- "SCons.Tool.docbook",
- "SCons.Tool.MSCommon",
- "SCons.Tool.packaging",
- "SCons.Variables",
- ],
- 'package_dir' : {'' : 'engine',
- 'SCons.Tool.docbook' : 'engine/SCons/Tool/docbook'},
- 'package_data' : {'SCons.Tool.docbook' : ['docbook-xsl-1.76.1/*',
- 'docbook-xsl-1.76.1/common/*',
- 'docbook-xsl-1.76.1/docsrc/*',
- 'docbook-xsl-1.76.1/eclipse/*',
- 'docbook-xsl-1.76.1/epub/*',
- 'docbook-xsl-1.76.1/epub/bin/*',
- 'docbook-xsl-1.76.1/epub/bin/lib/*',
- 'docbook-xsl-1.76.1/epub/bin/xslt/*',
- 'docbook-xsl-1.76.1/extensions/*',
- 'docbook-xsl-1.76.1/fo/*',
- 'docbook-xsl-1.76.1/highlighting/*',
- 'docbook-xsl-1.76.1/html/*',
- 'docbook-xsl-1.76.1/htmlhelp/*',
- 'docbook-xsl-1.76.1/images/*',
- 'docbook-xsl-1.76.1/images/callouts/*',
- 'docbook-xsl-1.76.1/images/colorsvg/*',
- 'docbook-xsl-1.76.1/javahelp/*',
- 'docbook-xsl-1.76.1/lib/*',
- 'docbook-xsl-1.76.1/manpages/*',
- 'docbook-xsl-1.76.1/params/*',
- 'docbook-xsl-1.76.1/profiling/*',
- 'docbook-xsl-1.76.1/roundtrip/*',
- 'docbook-xsl-1.76.1/slides/browser/*',
- 'docbook-xsl-1.76.1/slides/fo/*',
- 'docbook-xsl-1.76.1/slides/graphics/*',
- 'docbook-xsl-1.76.1/slides/graphics/active/*',
- 'docbook-xsl-1.76.1/slides/graphics/inactive/*',
- 'docbook-xsl-1.76.1/slides/graphics/toc/*',
- 'docbook-xsl-1.76.1/slides/html/*',
- 'docbook-xsl-1.76.1/slides/htmlhelp/*',
- 'docbook-xsl-1.76.1/slides/keynote/*',
- 'docbook-xsl-1.76.1/slides/keynote/xsltsl/*',
- 'docbook-xsl-1.76.1/slides/svg/*',
- 'docbook-xsl-1.76.1/slides/xhtml/*',
- 'docbook-xsl-1.76.1/template/*',
- 'docbook-xsl-1.76.1/tests/*',
- 'docbook-xsl-1.76.1/tools/bin/*',
- 'docbook-xsl-1.76.1/tools/make/*',
- 'docbook-xsl-1.76.1/webhelp/*',
- 'docbook-xsl-1.76.1/webhelp/docs/*',
- 'docbook-xsl-1.76.1/webhelp/docs/common/*',
- 'docbook-xsl-1.76.1/webhelp/docs/common/css/*',
- 'docbook-xsl-1.76.1/webhelp/docs/common/images/*',
- 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/*',
- 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/*',
- 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/images/*',
- 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/*',
- 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/images/*',
- 'docbook-xsl-1.76.1/webhelp/docs/content/*',
- 'docbook-xsl-1.76.1/webhelp/docs/content/search/*',
- 'docbook-xsl-1.76.1/webhelp/docs/content/search/stemmers/*',
- 'docbook-xsl-1.76.1/webhelp/docsrc/*',
- 'docbook-xsl-1.76.1/webhelp/template/*',
- 'docbook-xsl-1.76.1/webhelp/template/common/*',
- 'docbook-xsl-1.76.1/webhelp/template/common/css/*',
- 'docbook-xsl-1.76.1/webhelp/template/common/images/*',
- 'docbook-xsl-1.76.1/webhelp/template/common/jquery/*',
- 'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/*',
- 'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/images/*',
- 'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/*',
- 'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/images/*',
- 'docbook-xsl-1.76.1/webhelp/template/content/search/*',
- 'docbook-xsl-1.76.1/webhelp/template/content/search/stemmers/*',
- 'docbook-xsl-1.76.1/webhelp/xsl/*',
- 'docbook-xsl-1.76.1/website/*',
- 'docbook-xsl-1.76.1/xhtml/*',
- 'docbook-xsl-1.76.1/xhtml-1_1/*',
- 'utils/*']},
- 'data_files' : [('man/man1', man_pages)],
- 'scripts' : scripts,
- 'cmdclass' : {'install' : install,
- 'install_lib' : install_lib,
- 'install_data' : install_data,
- 'install_scripts' : install_scripts,
- 'build_scripts' : build_scripts}
+ 'name': "scons",
+ 'version': Version,
+ 'description': description,
+ 'long_description': long_description,
+ 'author': 'Steven Knight',
+ 'author_email': 'knight@baldmt.com',
+ 'url': "http://www.scons.org/",
+ 'packages': ["SCons",
+ "SCons.compat",
+ "SCons.Node",
+ "SCons.Options",
+ "SCons.Platform",
+ "SCons.Scanner",
+ "SCons.Script",
+ "SCons.Tool",
+ "SCons.Tool.docbook",
+ "SCons.Tool.MSCommon",
+ "SCons.Tool.packaging",
+ "SCons.Variables",
+ ],
+ 'package_dir': {'': 'engine',
+ 'SCons.Tool.docbook': 'engine/SCons/Tool/docbook'},
+ 'package_data': {'SCons.Tool.docbook': ['docbook-xsl-1.76.1/*',
+ 'docbook-xsl-1.76.1/common/*',
+ 'docbook-xsl-1.76.1/docsrc/*',
+ 'docbook-xsl-1.76.1/eclipse/*',
+ 'docbook-xsl-1.76.1/epub/*',
+ 'docbook-xsl-1.76.1/epub/bin/*',
+ 'docbook-xsl-1.76.1/epub/bin/lib/*',
+ 'docbook-xsl-1.76.1/epub/bin/xslt/*',
+ 'docbook-xsl-1.76.1/extensions/*',
+ 'docbook-xsl-1.76.1/fo/*',
+ 'docbook-xsl-1.76.1/highlighting/*',
+ 'docbook-xsl-1.76.1/html/*',
+ 'docbook-xsl-1.76.1/htmlhelp/*',
+ 'docbook-xsl-1.76.1/images/*',
+ 'docbook-xsl-1.76.1/images/callouts/*',
+ 'docbook-xsl-1.76.1/images/colorsvg/*',
+ 'docbook-xsl-1.76.1/javahelp/*',
+ 'docbook-xsl-1.76.1/lib/*',
+ 'docbook-xsl-1.76.1/manpages/*',
+ 'docbook-xsl-1.76.1/params/*',
+ 'docbook-xsl-1.76.1/profiling/*',
+ 'docbook-xsl-1.76.1/roundtrip/*',
+ 'docbook-xsl-1.76.1/slides/browser/*',
+ 'docbook-xsl-1.76.1/slides/fo/*',
+ 'docbook-xsl-1.76.1/slides/graphics/*',
+ 'docbook-xsl-1.76.1/slides/graphics/active/*',
+ 'docbook-xsl-1.76.1/slides/graphics/inactive/*',
+ 'docbook-xsl-1.76.1/slides/graphics/toc/*',
+ 'docbook-xsl-1.76.1/slides/html/*',
+ 'docbook-xsl-1.76.1/slides/htmlhelp/*',
+ 'docbook-xsl-1.76.1/slides/keynote/*',
+ 'docbook-xsl-1.76.1/slides/keynote/xsltsl/*',
+ 'docbook-xsl-1.76.1/slides/svg/*',
+ 'docbook-xsl-1.76.1/slides/xhtml/*',
+ 'docbook-xsl-1.76.1/template/*',
+ 'docbook-xsl-1.76.1/tests/*',
+ 'docbook-xsl-1.76.1/tools/bin/*',
+ 'docbook-xsl-1.76.1/tools/make/*',
+ 'docbook-xsl-1.76.1/webhelp/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/common/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/common/css/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/common/images/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/images/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/images/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/content/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/content/search/*',
+ 'docbook-xsl-1.76.1/webhelp/docs/content/search/stemmers/*',
+ 'docbook-xsl-1.76.1/webhelp/docsrc/*',
+ 'docbook-xsl-1.76.1/webhelp/template/*',
+ 'docbook-xsl-1.76.1/webhelp/template/common/*',
+ 'docbook-xsl-1.76.1/webhelp/template/common/css/*',
+ 'docbook-xsl-1.76.1/webhelp/template/common/images/*',
+ 'docbook-xsl-1.76.1/webhelp/template/common/jquery/*',
+ 'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/*',
+ 'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/images/*',
+ 'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/*',
+ 'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/images/*',
+ 'docbook-xsl-1.76.1/webhelp/template/content/search/*',
+ 'docbook-xsl-1.76.1/webhelp/template/content/search/stemmers/*',
+ 'docbook-xsl-1.76.1/webhelp/xsl/*',
+ 'docbook-xsl-1.76.1/website/*',
+ 'docbook-xsl-1.76.1/xhtml/*',
+ 'docbook-xsl-1.76.1/xhtml-1_1/*',
+ 'utils/*']},
+ 'data_files': [('man/man1', man_pages)],
+ 'scripts': scripts,
+ 'cmdclass': {'install': install,
+ 'install_lib': install_lib,
+ 'install_data': install_data,
+ 'install_scripts': install_scripts,
+ 'build_scripts': build_scripts}
}
distutils.core.setup(**arguments)
diff --git a/src/test_aegistests.py b/src/test_aegistests.py
deleted file mode 100644
index fa97088..0000000
--- a/src/test_aegistests.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
-#
-# 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/test_aegistests.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
-
-"""
-Verify that we have proper Copyright notices on all the right files
-in our distributions.
-
-Note that this is a packaging test, not a functional test, so the
-name of this script doesn't end in *Tests.py.
-"""
-
-import os
-import popen2
-import re
-import sys
-
-import TestSCons
-
-test = TestSCons.TestSCons()
-
-try:
- popen2.Popen3
-except AttributeError:
- def get_stdout(command):
- (tochild, fromchild, childerr) = os.popen3(command)
- tochild.close()
- return fromchild.read()
-else:
- def get_stdout(command):
- p = popen2.Popen3(command, 1)
- p.tochild.close()
- return p.fromchild.read()
-
-output = get_stdout('aegis -list -unformatted pf') +\
- get_stdout('aegis -list -unformatted cf')
-lines = output.split('\n')[:-1]
-sources = [x for x in lines if x[:7] == 'source ']
-
-re1 = re.compile(r' src/.*Tests\.py')
-re2 = re.compile(r' src/test_.*\.py')
-re3 = re.compile(r' test/.*\.py')
-
-def filename_is_a_test(x):
- return re1.search(x) or re2.search(x) or re3.search(x)
-
-test_files = list(filter(filename_is_a_test, sources))
-
-if test_files:
- sys.stderr.write("Found the following files with test names not marked as Aegis tests:\n")
- sys.stderr.write('\t' + '\n\t'.join(test_files) + '\n')
- test.fail_test(1)
-
-test.pass_test()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/test_files.py b/src/test_files.py
index b44b0ad..e552751 100644
--- a/src/test_files.py
+++ b/src/test_files.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,8 +21,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/test_files.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/test_files.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
"""
Verify that we have certain important files in our distribution
@@ -87,13 +88,13 @@ for directory, check_list in check.items():
no_result.append(directory)
if missing:
- print "Missing the following files:\n"
- print "\t" + "\n\t".join(missing)
+ print("Missing the following files:\n")
+ print("\t" + "\n\t".join(missing))
test.fail_test(1)
if no_result:
- print "Cannot check files, the following have apparently not been built:"
- print "\t" + "\n\t".join(no_result)
+ print("Cannot check files, the following have apparently not been built:")
+ print("\t" + "\n\t".join(no_result))
test.no_result(1)
test.pass_test()
diff --git a/src/test_interrupts.py b/src/test_interrupts.py
index e6a81f8..744677f 100644
--- a/src/test_interrupts.py
+++ b/src/test_interrupts.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,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.
-__revision__ = "src/test_interrupts.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+from __future__ import print_function
+
+__revision__ = "src/test_interrupts.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
"""
Verify that the SCons source code contains only correct handling of
@@ -102,7 +104,7 @@ for f in files:
indent_list.append( (line_num, match.group('try_or_except') ) )
try_except_lines[match.group('indent')] = indent_list
uncaught_this_file = []
- for indent in try_except_lines.keys():
+ for indent in list(try_except_lines.keys()):
exc_keyboardint_seen = 0
exc_all_seen = 0
for (l,statement) in try_except_lines[indent] + [(-1,indent + 'try')]:
@@ -129,9 +131,9 @@ for f in files:
if expected_num != len(uncaught_this_file):
uncaughtKeyboardInterrupt = 1
msg = "%s: expected %d uncaught interrupts, got %d:"
- print msg % (f, expected_num, len(uncaught_this_file))
+ print(msg % (f, expected_num, len(uncaught_this_file)))
for line in uncaught_this_file:
- print " File %s:%d: Uncaught KeyboardInterrupt!" % (f,line)
+ print(" File %s:%d: Uncaught KeyboardInterrupt!" % (f,line))
test.fail_test(uncaughtKeyboardInterrupt)
diff --git a/src/test_pychecker.py b/src/test_pychecker.py
index 9ac30b3..b0c231f 100644
--- a/src/test_pychecker.py
+++ b/src/test_pychecker.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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 @@
# 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/test_pychecker.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/test_pychecker.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
"""
Use pychecker to catch various Python coding errors.
@@ -139,7 +140,7 @@ for file in files:
mismatches.append(stderr)
if mismatches:
- print ''.join(mismatches[1:])
+ print(''.join(mismatches[1:]))
test.fail_test()
test.pass_test()
diff --git a/src/test_setup.py b/src/test_setup.py
index db265c0..af8ed66 100644
--- a/src/test_setup.py
+++ b/src/test_setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,8 +21,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/test_setup.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/test_setup.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
"""
Test how the setup.py script installs SCons.
@@ -197,9 +198,9 @@ if not os.path.isdir(scons_version) and os.path.isfile(tar_gz):
os.system("gunzip -c %s | tar xf -" % tar_gz)
if not os.path.isdir(scons_version):
- print "Cannot test package installation, found none of the following packages:"
- print "\t" + tar_gz
- print "\t" + zip
+ print("Cannot test package installation, found none of the following packages:")
+ print("\t" + tar_gz)
+ print("\t" + zip)
test.no_result(1)
# Verify that a virgin installation installs the version library,
diff --git a/src/test_strings.py b/src/test_strings.py
index abf8cfa..ec62e82 100644
--- a/src/test_strings.py
+++ b/src/test_strings.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 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,8 +21,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/test_strings.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/test_strings.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
"""
Verify that we have proper strings like Copyright notices on all the
@@ -106,8 +107,8 @@ class Checker(object):
class CheckUnexpandedStrings(Checker):
expressions = [
- re.compile('Copyright (c) 2001 - 2016 The SCons Foundation'),
- re.compile('src/test_strings.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog'),
+ re.compile('Copyright (c) 2001 - 2017 The SCons Foundation'),
+ re.compile('src/test_strings.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog'),
]
def must_be_built(self):
return None
@@ -248,13 +249,13 @@ for collector in check_list:
not_built.append(collector.directory)
if missing_strings:
- print "Found the following files with missing strings:"
- print "\t" + "\n\t".join(missing_strings)
+ print("Found the following files with missing strings:")
+ print("\t" + "\n\t".join(missing_strings))
test.fail_test(1)
if not_built:
- print "Cannot check all strings, the following have apparently not been built:"
- print "\t" + "\n\t".join(not_built)
+ print("Cannot check all strings, the following have apparently not been built:")
+ print("\t" + "\n\t".join(not_built))
test.no_result(1)
test.pass_test()