summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--QMTest/TestSCons.py8
-rw-r--r--README.rst1
-rw-r--r--SConstruct5
-rw-r--r--bin/update-release-info.py17
-rw-r--r--doc/SConscript30
-rw-r--r--doc/design/engine.xml8
-rw-r--r--doc/editor_configs/serna/scons/xsd/dbpoolx.xsd3
-rw-r--r--doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd3
-rw-r--r--doc/generated/builders.gen60
-rw-r--r--doc/generated/builders.mod8
-rw-r--r--doc/generated/examples/commandline_Variables_custom_py_1_custom.py2
-rw-r--r--doc/generated/examples/depends_include_SConstruct2
-rw-r--r--doc/generated/examples/depends_include_hello.h2
-rw-r--r--doc/generated/examples/hierarchy_Return_foo_SConscript6
-rw-r--r--doc/generated/examples/hierarchy_ex1_prog1_SConscript4
-rw-r--r--doc/generated/examples/hierarchy_ex1_prog2_SConscript4
-rw-r--r--doc/generated/examples/separate_builddir_sconscript_SConstruct4
-rw-r--r--doc/generated/examples/troubleshoot_explain1_3.xml7
-rw-r--r--doc/generated/functions.gen22
-rw-r--r--doc/generated/functions.mod4
-rw-r--r--doc/generated/tools.gen12
-rw-r--r--doc/generated/variables.gen49
-rw-r--r--doc/generated/variables.mod4
-rw-r--r--doc/man/MANIFEST3
-rw-r--r--doc/man/SConstruct15
-rw-r--r--doc/man/cover.jpgbin0 -> 306 bytes
-rw-r--r--doc/man/epub.css33
-rw-r--r--doc/man/epub.xsl35
-rw-r--r--doc/man/html.xsl4
-rw-r--r--doc/man/pdf.xsl5
-rw-r--r--doc/man/scons.xml75
-rw-r--r--doc/python10/design.xml26
-rw-r--r--doc/reference/Library.xml36
-rw-r--r--doc/user/MANIFEST2
-rw-r--r--doc/user/SConstruct15
-rw-r--r--doc/user/actions.xml4
-rw-r--r--doc/user/add-method.xml54
-rw-r--r--doc/user/alias.xml30
-rw-r--r--doc/user/build-install.xml26
-rw-r--r--doc/user/builders-built-in.xml126
-rw-r--r--doc/user/builders-commands.xml20
-rw-r--r--doc/user/builders-writing.xml362
-rw-r--r--doc/user/caching.xml72
-rw-r--r--doc/user/chtml.xsl4
-rw-r--r--doc/user/command-line.xml534
-rw-r--r--doc/user/cover.jpgbin0 -> 306 bytes
-rw-r--r--doc/user/depends.xml396
-rw-r--r--doc/user/environments.xml252
-rw-r--r--doc/user/epub.css33
-rw-r--r--doc/user/epub.xsl36
-rw-r--r--doc/user/factories.xml146
-rw-r--r--doc/user/file-removal.xml42
-rw-r--r--doc/user/gettext.xml276
-rw-r--r--doc/user/hierarchy.xml138
-rw-r--r--doc/user/html.xsl4
-rw-r--r--doc/user/install.xml72
-rw-r--r--doc/user/java.xml408
-rw-r--r--doc/user/less-simple.xml106
-rw-r--r--doc/user/libraries.xml54
-rw-r--r--doc/user/main.xml1
-rw-r--r--doc/user/mergeflags.xml32
-rw-r--r--doc/user/misc.xml180
-rw-r--r--doc/user/nodes.xml68
-rw-r--r--doc/user/output.xml202
-rw-r--r--doc/user/parseconfig.xml28
-rw-r--r--doc/user/parseflags.xml64
-rw-r--r--doc/user/pdf.xsl4
-rw-r--r--doc/user/repositories.xml114
-rw-r--r--doc/user/scanners.xml56
-rw-r--r--doc/user/sconf.xml228
-rw-r--r--doc/user/separate.xml72
-rw-r--r--doc/user/sideeffect.xml46
-rw-r--r--doc/user/simple.xml56
-rw-r--r--doc/user/sourcecode.xml36
-rw-r--r--doc/user/troubleshoot.xml142
-rw-r--r--doc/user/variants.xml62
-rw-r--r--doc/xsd/dbpoolx.xsd3
-rwxr-xr-xruntest.py38
-rw-r--r--src/CHANGES.txt43
-rw-r--r--src/engine/SCons/Action.py14
-rw-r--r--src/engine/SCons/Builder.py7
-rw-r--r--src/engine/SCons/CacheDir.py8
-rw-r--r--src/engine/SCons/Debug.py4
-rw-r--r--src/engine/SCons/Environment.py43
-rw-r--r--src/engine/SCons/EnvironmentTests.py39
-rw-r--r--src/engine/SCons/Executor.py13
-rw-r--r--src/engine/SCons/Node/FS.py152
-rw-r--r--src/engine/SCons/Node/NodeTests.py13
-rw-r--r--src/engine/SCons/Node/__init__.py95
-rw-r--r--src/engine/SCons/Platform/posix.py172
-rw-r--r--src/engine/SCons/SConf.py3
-rw-r--r--src/engine/SCons/SConfTests.py2
-rw-r--r--src/engine/SCons/Script/Main.py36
-rw-r--r--src/engine/SCons/Script/Main.xml21
-rw-r--r--src/engine/SCons/Script/SConsOptions.py47
-rw-r--r--src/engine/SCons/Subst.py14
-rw-r--r--src/engine/SCons/SubstTests.py5
-rw-r--r--src/engine/SCons/Taskmaster.py37
-rw-r--r--src/engine/SCons/TaskmasterTests.py5
-rw-r--r--src/engine/SCons/Tool/MSCommon/common.py8
-rw-r--r--src/engine/SCons/Tool/MSCommon/vc.py17
-rw-r--r--src/engine/SCons/Tool/__init__.py30
-rw-r--r--src/engine/SCons/Tool/docbook/__init__.py197
-rw-r--r--src/engine/SCons/Tool/docbook/__init__.xml34
-rw-r--r--src/engine/SCons/Tool/gs.py30
-rw-r--r--src/engine/SCons/Tool/gs.xml38
-rw-r--r--src/engine/SCons/Tool/msginit.xml4
-rw-r--r--src/engine/SCons/Tool/rpm.py4
-rw-r--r--src/engine/SCons/Tool/zip.xml2
-rw-r--r--src/engine/SCons/Warnings.py3
-rw-r--r--test/CacheDir/option--cr.py138
-rw-r--r--test/Docbook/basedir/htmlchunked/htmlchunked.py6
-rw-r--r--test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py57
-rw-r--r--test/Docbook/basedir/htmlchunked/image/SConstruct.cmd2
-rw-r--r--test/Docbook/basedir/htmlhelp/htmlhelp.py6
-rw-r--r--test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py61
-rw-r--r--test/Docbook/basedir/htmlhelp/image/SConstruct.cmd3
-rw-r--r--test/Docbook/basedir/slideshtml/image/SConstruct.cmd3
-rw-r--r--test/Docbook/basedir/slideshtml/slideshtml.py7
-rw-r--r--test/Docbook/basedir/slideshtml/slideshtml_cmd.py64
-rw-r--r--test/Docbook/basic/epub/epub.py62
-rw-r--r--test/Docbook/basic/epub/epub_cmd.py59
-rw-r--r--test/Docbook/basic/epub/image/SConstruct2
-rw-r--r--test/Docbook/basic/epub/image/SConstruct.cmd2
-rw-r--r--test/Docbook/basic/epub/image/manual.xml388
-rw-r--r--test/Docbook/basic/html/html_cmd.py54
-rw-r--r--test/Docbook/basic/html/image/SConstruct.cmd3
-rw-r--r--test/Docbook/basic/htmlchunked/htmlchunked_cmd.py55
-rw-r--r--test/Docbook/basic/htmlchunked/image/SConstruct.cmd3
-rw-r--r--test/Docbook/basic/htmlhelp/htmlhelp_cmd.py58
-rw-r--r--test/Docbook/basic/htmlhelp/image/SConstruct.cmd3
-rw-r--r--test/Docbook/basic/man/image/SConstruct.cmd3
-rw-r--r--test/Docbook/basic/man/man_cmd.py56
-rw-r--r--test/Docbook/basic/slideshtml/image/SConstruct.cmd3
-rw-r--r--test/Docbook/basic/slideshtml/slideshtml.py7
-rw-r--r--test/Docbook/basic/slideshtml/slideshtml_cmd.py64
-rw-r--r--test/Docbook/rootname/htmlchunked/htmlchunked.py6
-rw-r--r--test/Docbook/rootname/htmlhelp/htmlhelp.py6
-rw-r--r--test/Docbook/rootname/slideshtml/slideshtml.py7
-rw-r--r--test/Ghostscript/GS.py2
-rw-r--r--test/Libs/SharedLibrary-update-deps.py70
-rw-r--r--test/Libs/SharedLibrary.py13
-rw-r--r--test/Libs/bug2903/SConstruct13
-rw-r--r--test/Libs/bug2903/SConstruct-libs5
-rw-r--r--test/Libs/bug2903/lib.c4
-rw-r--r--test/Libs/bug2903/main.c6
-rw-r--r--test/Pseudo.py65
-rw-r--r--test/builderrors.py11
-rw-r--r--test/leaky-handles.py60
-rw-r--r--test/option/debug-multiple.py86
-rw-r--r--test/option/warn-dependency.py1
-rw-r--r--test/warning-TargetNotBuiltWarning.py55
152 files changed, 5122 insertions, 2738 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index 5d0b4c64..ef83a4a3 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -151,7 +151,7 @@ def deprecated_python_version(version=sys.version_info):
if deprecated_python_version():
msg = r"""
-scons: warning: Support for pre-2.4 Python (%s) is deprecated.
+scons: warning: Support for pre-2.7.0 Python version (%s) is deprecated.
If this will cause hardship, contact dev@scons.tigris.org.
"""
@@ -1131,9 +1131,9 @@ SConscript( sconscript )
self.run(program = python, stdin = """\
import os, sys
try:
- py_ver = 'python%d.%d' % sys.version_info[:2]
+ py_ver = 'python%d.%d' % sys.version_info[:2]
except AttributeError:
- py_ver = 'python' + sys.version[:3]
+ py_ver = 'python' + sys.version[:3]
print os.path.join(sys.prefix, 'include', py_ver)
print os.path.join(sys.prefix, 'lib', py_ver, 'config')
print py_ver
@@ -1357,7 +1357,7 @@ class TimeSCons(TestSCons):
options = kw.get('options', '')
if additional is not None:
options += additional
- kw['options'] = options + ' --debug=memory --debug=time'
+ kw['options'] = options + ' --debug=memory,time'
def startup(self, *args, **kw):
"""
diff --git a/README.rst b/README.rst
index 63e507a6..a1025ca1 100644
--- a/README.rst
+++ b/README.rst
@@ -752,3 +752,4 @@ With plenty of help from the SCons Development team:
__COPYRIGHT__
+
diff --git a/SConstruct b/SConstruct
index 09eb7395..1e00b132 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1040,7 +1040,10 @@ for p in [ scons ]:
if dh_builddeb and fakeroot:
# Our Debian packaging builds directly into build/dist,
# so we don't need to Install() the .debs.
- deb = os.path.join(build_dir, 'dist', "%s_%s_all.deb" % (pkg, version))
+ # 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 = os.path.join(build_dir, 'dist', "%s_%s_all.deb" % (pkg, 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)
diff --git a/bin/update-release-info.py b/bin/update-release-info.py
index b6cf9420..be9e0f56 100644
--- a/bin/update-release-info.py
+++ b/bin/update-release-info.py
@@ -334,17 +334,18 @@ t.replace_assign('deprecated_python_version', str(deprecated_version))
# Update doc/user/main.{in,xml}
docyears = ', '.join(map(str, range(2004, release_date[0] + 1)))
-t = UpdateFile(os.path.join('doc', 'user', 'main.in'))
-if DEBUG: t.file = '/tmp/main.in'
-## TODO debug these
-#t.sub('<pubdate>[^<]*</pubdate>', '<pubdate>' + docyears + '</pubdate>')
-#t.sub('<year>[^<]*</year>', '<year>' + docyears + '</year>')
+if os.path.exists(os.path.join('doc', 'user', 'main.in')):
+ # this is no longer used as of Dec 2013
+ t = UpdateFile(os.path.join('doc', 'user', 'main.in'))
+ if DEBUG: t.file = '/tmp/main.in'
+ ## TODO debug these
+ #t.sub('<pubdate>[^<]*</pubdate>', '<pubdate>' + docyears + '</pubdate>')
+ #t.sub('<year>[^<]*</year>', '<year>' + docyears + '</year>')
t = UpdateFile(os.path.join('doc', 'user', 'main.xml'))
if DEBUG: t.file = '/tmp/main.xml'
-## TODO debug these
-#t.sub('<pubdate>[^<]*</pubdate>', '<pubdate>' + docyears + '</pubdate>')
-#t.sub('<year>[^<]*</year>', '<year>' + docyears + '</year>')
+t.sub('<pubdate>[^<]*</pubdate>', '<pubdate>' + docyears + '</pubdate>')
+t.sub('<year>[^<]*</year>', '<year>' + docyears + '</year>')
# Write out the last update
diff --git a/doc/SConscript b/doc/SConscript
index a1feba96..18262eb6 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -42,6 +42,7 @@ build = os.path.join(build_dir, 'doc')
fop = whereis('fop')
xep = whereis('xep')
epydoc_cli = whereis('epydoc')
+gs = whereis('gs')
#
#
@@ -159,6 +160,8 @@ else:
env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['html']))))
env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['fo']))))
env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['manpages']))))
+ env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['epub']))))
+ env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['xhtml-1_1']))))
env.Execute(Copy(os.path.join(build_dir, *dbpath),
os.path.join('..', *(dbpath + ['VERSION']))))
for g in glob.glob(os.path.join('..', *(dbpath + ['common', '*.*']))):
@@ -171,6 +174,20 @@ else:
env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['fo'])), g))
for g in glob.glob(os.path.join('..', *(dbpath + ['manpages', '*.*']))):
env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['manpages'])), g))
+ for g in glob.glob(os.path.join('..', *(dbpath + ['epub', '*.xsl']))):
+ env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['epub'])), g))
+ for g in glob.glob(os.path.join('..', *(dbpath + ['xhtml-1_1', '*.*']))):
+ env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['xhtml-1_1'])), g))
+
+ #
+ # Copy additional Tools (gs, zip)
+ #
+ toolpath = ['src', 'engine', 'SCons', 'Tool']
+ env.Execute(Copy(os.path.join(build_dir, *toolpath),
+ os.path.join('..', *(toolpath + ['gs.py']))))
+ env.Execute(Copy(os.path.join(build_dir, *toolpath),
+ os.path.join('..', *(toolpath + ['zip.py']))))
+
#
# Each document will live in its own subdirectory. List them here
@@ -183,8 +200,8 @@ else:
#'python10' : ['chtml','html','pdf'],
'reference' : ['chtml','html','pdf'],
#'developer' : ['chtml','html','pdf'],
- 'user' : ['chtml','html','pdf'],
- 'man' : ['man']
+ 'user' : ['chtml','html','pdf','epub'],
+ 'man' : ['man','epub']
}
# The names of the target files for the MAN pages
man_page_list = ['scons.1','scons-time.1','sconsign.1']
@@ -248,6 +265,7 @@ else:
htmlindex = os.path.join(htmldir, 'index.html')
html = os.path.join(build, 'HTML', 'scons-%s.html' % doc)
pdf = os.path.join(build, 'PDF', 'scons-%s.pdf' % doc)
+ epub = os.path.join(build, 'EPUB', 'scons-%s.epub' % doc)
if 'chtml' in docs[doc]:
env.Install(htmldir, Glob(os.path.join(build, doc,'scons-%s' % doc, '*.html')))
tar_deps.extend([htmlindex])
@@ -269,6 +287,14 @@ else:
tar_deps.append(pdf)
tar_list.append(pdf)
+
+ if 'epub' in docs[doc] and gs:
+ env.InstallAs(epub, os.path.join(build, doc,'scons-%s.epub' % doc))
+ Local(epub)
+ env.Ignore(epub, version_xml)
+
+ tar_deps.append(epub)
+ tar_list.append(epub)
if 'man' in docs[doc]:
#
diff --git a/doc/design/engine.xml b/doc/design/engine.xml
index b8bdd4b8..6989f8a0 100644
--- a/doc/design/engine.xml
+++ b/doc/design/engine.xml
@@ -1411,8 +1411,8 @@ Comments?
</para>
<programlisting>
- env.Library(target = 'libfoo.a', source = ['aaa.c', 'bbb.c', 'ccc.c'])
- env.NoClean('libfoo.a')
+env.Library(target = 'libfoo.a', source = ['aaa.c', 'bbb.c', 'ccc.c'])
+env.NoClean('libfoo.a')
</programlisting>
<para>
@@ -1425,8 +1425,8 @@ Comments?
during "cleanup":
<programlisting>
- env.Clean(target = 'foo')
- env.NoClean('foo')
+env.Clean(target = 'foo')
+env.NoClean('foo')
</programlisting>
diff --git a/doc/editor_configs/serna/scons/xsd/dbpoolx.xsd b/doc/editor_configs/serna/scons/xsd/dbpoolx.xsd
index f0a3f1ca..0ce5cb7b 100644
--- a/doc/editor_configs/serna/scons/xsd/dbpoolx.xsd
+++ b/doc/editor_configs/serna/scons/xsd/dbpoolx.xsd
@@ -2589,7 +2589,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:group ref="tool.mix"/>
</xs:choice>
@@ -2616,7 +2615,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:group ref="tool.mix"/>
</xs:choice>
@@ -2644,7 +2642,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:element ref="summary"/>
</xs:choice>
diff --git a/doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd b/doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd
index f0a3f1ca..0ce5cb7b 100644
--- a/doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd
+++ b/doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd
@@ -2589,7 +2589,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:group ref="tool.mix"/>
</xs:choice>
@@ -2616,7 +2615,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:group ref="tool.mix"/>
</xs:choice>
@@ -2644,7 +2642,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:element ref="summary"/>
</xs:choice>
diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen
index eec4711c..41239d4f 100644
--- a/doc/generated/builders.gen
+++ b/doc/generated/builders.gen
@@ -84,6 +84,32 @@ env.CXXFile(target = 'bar', source = 'bar.yy')
</example_commands>
</listitem>
</varlistentry>
+ <varlistentry id="b-DocbookEpub">
+ <term>
+ <function>DocbookEpub()</function>
+ </term>
+ <term>
+ <function>env.DocbookEpub()</function>
+ </term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+A pseudo-Builder, providing a Docbook toolchain for EPUB output.
+</para>
+
+<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">env = Environment(tools=['docbook'])
+env.DocbookEpub('manual.epub', 'manual.xml')
+</example_commands>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+or simply
+</para>
+
+<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">env = Environment(tools=['docbook'])
+env.DocbookEpub('manual')
+</example_commands>
+
+</listitem>
+ </varlistentry>
<varlistentry id="b-DocbookHtml">
<term>
<function>DocbookHtml()</function>
@@ -397,6 +423,27 @@ env.DVI(target = 'ccc.dvi', source = 'ccc.latex')
</example_commands>
</listitem>
</varlistentry>
+ <varlistentry id="b-Gs">
+ <term>
+ <function>Gs()</function>
+ </term>
+ <term>
+ <function>env.Gs()</function>
+ </term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+A Builder for explicitly calling the <literal>gs</literal> executable.
+Depending on the underlying OS, the different names <literal>gs</literal>,
+<literal>gsos2</literal> and <literal>gswin32c</literal>
+are tried.
+</para>
+<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">env = Environment(tools=['gs'])
+env.Gs('cover.jpg','scons-scons.pdf',
+ GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q')
+ )
+</example_commands>
+</listitem>
+ </varlistentry>
<varlistentry id="b-Install">
<term>
<function>Install()</function>
@@ -1841,6 +1888,17 @@ listed in the targets.
</para>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
+On Cygwin systems, the
+<function xmlns="http://www.scons.org/dbxsd/v1.0">SharedLibrary</function>
+builder method will always build an import
+(<filename>.dll.a</filename>) library
+in addition to the shared (<filename>.dll</filename>) library,
+adding a <filename>.dll.a</filename> library with the same basename
+if there is not already a <filename>.dll.a</filename> file explicitly
+listed in the targets.
+</para>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
Any object files listed in the
<literal>source</literal>
must have been built for a shared library
@@ -1870,7 +1928,7 @@ alpha, beta, or release candidate patch levels.
<para xmlns="http://www.scons.org/dbxsd/v1.0">
This builder may create multiple links to the library. On a POSIX system,
for the shared library libbar.so.2.3.1, the links created would be
-libbar.so, libbar.so.2, and libbar.so.2.3; on a Darwin (OSX) system
+libbar.so and libbar.so.2; on a Darwin (OSX) system
the library would be libbar.2.3.1.dylib and the link would be
libbar.dylib.
</para>
diff --git a/doc/generated/builders.mod b/doc/generated/builders.mod
index 59900cc1..50591b45 100644
--- a/doc/generated/builders.mod
+++ b/doc/generated/builders.mod
@@ -11,6 +11,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-CFile "<function xmlns='http://www.scons.org/dbxsd/v1.0'>CFile</function>">
<!ENTITY b-Command "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Command</function>">
<!ENTITY b-CXXFile "<function xmlns='http://www.scons.org/dbxsd/v1.0'>CXXFile</function>">
+<!ENTITY b-DocbookEpub "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DocbookEpub</function>">
<!ENTITY b-DocbookHtml "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DocbookHtml</function>">
<!ENTITY b-DocbookHtmlChunked "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DocbookHtmlChunked</function>">
<!ENTITY b-DocbookHtmlhelp "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DocbookHtmlhelp</function>">
@@ -21,6 +22,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-DocbookXInclude "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DocbookXInclude</function>">
<!ENTITY b-DocbookXslt "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DocbookXslt</function>">
<!ENTITY b-DVI "<function xmlns='http://www.scons.org/dbxsd/v1.0'>DVI</function>">
+<!ENTITY b-Gs "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Gs</function>">
<!ENTITY b-Install "<function xmlns='http://www.scons.org/dbxsd/v1.0'>Install</function>">
<!ENTITY b-InstallAs "<function xmlns='http://www.scons.org/dbxsd/v1.0'>InstallAs</function>">
<!ENTITY b-InstallVersionedLib "<function xmlns='http://www.scons.org/dbxsd/v1.0'>InstallVersionedLib</function>">
@@ -64,6 +66,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-env-CFile "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.CFile</function>">
<!ENTITY b-env-Command "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Command</function>">
<!ENTITY b-env-CXXFile "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.CXXFile</function>">
+<!ENTITY b-env-DocbookEpub "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DocbookEpub</function>">
<!ENTITY b-env-DocbookHtml "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DocbookHtml</function>">
<!ENTITY b-env-DocbookHtmlChunked "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DocbookHtmlChunked</function>">
<!ENTITY b-env-DocbookHtmlhelp "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DocbookHtmlhelp</function>">
@@ -74,6 +77,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-env-DocbookXInclude "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DocbookXInclude</function>">
<!ENTITY b-env-DocbookXslt "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DocbookXslt</function>">
<!ENTITY b-env-DVI "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.DVI</function>">
+<!ENTITY b-env-Gs "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Gs</function>">
<!ENTITY b-env-Install "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.Install</function>">
<!ENTITY b-env-InstallAs "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.InstallAs</function>">
<!ENTITY b-env-InstallVersionedLib "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.InstallVersionedLib</function>">
@@ -127,6 +131,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-link-CFile "<link linkend='b-CFile' xmlns='http://www.scons.org/dbxsd/v1.0'><function>CFile</function></link>">
<!ENTITY b-link-Command "<link linkend='b-Command' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Command</function></link>">
<!ENTITY b-link-CXXFile "<link linkend='b-CXXFile' xmlns='http://www.scons.org/dbxsd/v1.0'><function>CXXFile</function></link>">
+<!ENTITY b-link-DocbookEpub "<link linkend='b-DocbookEpub' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DocbookEpub</function></link>">
<!ENTITY b-link-DocbookHtml "<link linkend='b-DocbookHtml' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DocbookHtml</function></link>">
<!ENTITY b-link-DocbookHtmlChunked "<link linkend='b-DocbookHtmlChunked' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DocbookHtmlChunked</function></link>">
<!ENTITY b-link-DocbookHtmlhelp "<link linkend='b-DocbookHtmlhelp' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DocbookHtmlhelp</function></link>">
@@ -137,6 +142,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-link-DocbookXInclude "<link linkend='b-DocbookXInclude' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DocbookXInclude</function></link>">
<!ENTITY b-link-DocbookXslt "<link linkend='b-DocbookXslt' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DocbookXslt</function></link>">
<!ENTITY b-link-DVI "<link linkend='b-DVI' xmlns='http://www.scons.org/dbxsd/v1.0'><function>DVI</function></link>">
+<!ENTITY b-link-Gs "<link linkend='b-Gs' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Gs</function></link>">
<!ENTITY b-link-Install "<link linkend='b-Install' xmlns='http://www.scons.org/dbxsd/v1.0'><function>Install</function></link>">
<!ENTITY b-link-InstallAs "<link linkend='b-InstallAs' xmlns='http://www.scons.org/dbxsd/v1.0'><function>InstallAs</function></link>">
<!ENTITY b-link-InstallVersionedLib "<link linkend='b-InstallVersionedLib' xmlns='http://www.scons.org/dbxsd/v1.0'><function>InstallVersionedLib</function></link>">
@@ -180,6 +186,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-link-env-CFile "<link linkend='b-CFile' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.CFile</function></link>">
<!ENTITY b-link-env-Command "<link linkend='b-Command' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Command</function></link>">
<!ENTITY b-link-env-CXXFile "<link linkend='b-CXXFile' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.CXXFile</function></link>">
+<!ENTITY b-link-env-DocbookEpub "<link linkend='b-DocbookEpub' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DocbookEpub</function></link>">
<!ENTITY b-link-env-DocbookHtml "<link linkend='b-DocbookHtml' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DocbookHtml</function></link>">
<!ENTITY b-link-env-DocbookHtmlChunked "<link linkend='b-DocbookHtmlChunked' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DocbookHtmlChunked</function></link>">
<!ENTITY b-link-env-DocbookHtmlhelp "<link linkend='b-DocbookHtmlhelp' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DocbookHtmlhelp</function></link>">
@@ -190,6 +197,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY b-link-env-DocbookXInclude "<link linkend='b-DocbookXInclude' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DocbookXInclude</function></link>">
<!ENTITY b-link-env-DocbookXslt "<link linkend='b-DocbookXslt' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DocbookXslt</function></link>">
<!ENTITY b-link-env-DVI "<link linkend='b-DVI' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.DVI</function></link>">
+<!ENTITY b-link-env-Gs "<link linkend='b-Gs' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Gs</function></link>">
<!ENTITY b-link-env-Install "<link linkend='b-Install' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.Install</function></link>">
<!ENTITY b-link-env-InstallAs "<link linkend='b-InstallAs' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.InstallAs</function></link>">
<!ENTITY b-link-env-InstallVersionedLib "<link linkend='b-InstallVersionedLib' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.InstallVersionedLib</function></link>">
diff --git a/doc/generated/examples/commandline_Variables_custom_py_1_custom.py b/doc/generated/examples/commandline_Variables_custom_py_1_custom.py
index f2acb0dd..ff314fa8 100644
--- a/doc/generated/examples/commandline_Variables_custom_py_1_custom.py
+++ b/doc/generated/examples/commandline_Variables_custom_py_1_custom.py
@@ -1,3 +1,3 @@
- RELEASE = 1
+RELEASE = 1
diff --git a/doc/generated/examples/depends_include_SConstruct b/doc/generated/examples/depends_include_SConstruct
index 5f6d7f54..2da2ecfb 100644
--- a/doc/generated/examples/depends_include_SConstruct
+++ b/doc/generated/examples/depends_include_SConstruct
@@ -1,3 +1,3 @@
- Program('hello.c', CPPPATH = '.')
+Program('hello.c', CPPPATH = '.')
diff --git a/doc/generated/examples/depends_include_hello.h b/doc/generated/examples/depends_include_hello.h
index c9046b3b..d6032ce5 100644
--- a/doc/generated/examples/depends_include_hello.h
+++ b/doc/generated/examples/depends_include_hello.h
@@ -1,3 +1,3 @@
- #define string "world"
+#define string "world"
diff --git a/doc/generated/examples/hierarchy_Return_foo_SConscript b/doc/generated/examples/hierarchy_Return_foo_SConscript
index 5d742644..4f45c0fd 100644
--- a/doc/generated/examples/hierarchy_Return_foo_SConscript
+++ b/doc/generated/examples/hierarchy_Return_foo_SConscript
@@ -1,5 +1,5 @@
- Import('env')
- obj = env.Object('foo.c')
- Return('obj')
+Import('env')
+obj = env.Object('foo.c')
+Return('obj')
diff --git a/doc/generated/examples/hierarchy_ex1_prog1_SConscript b/doc/generated/examples/hierarchy_ex1_prog1_SConscript
index 425f1b8c..caf26368 100644
--- a/doc/generated/examples/hierarchy_ex1_prog1_SConscript
+++ b/doc/generated/examples/hierarchy_ex1_prog1_SConscript
@@ -1,4 +1,4 @@
- env = Environment()
- env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c'])
+env = Environment()
+env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c'])
diff --git a/doc/generated/examples/hierarchy_ex1_prog2_SConscript b/doc/generated/examples/hierarchy_ex1_prog2_SConscript
index fb529b40..88b05a3e 100644
--- a/doc/generated/examples/hierarchy_ex1_prog2_SConscript
+++ b/doc/generated/examples/hierarchy_ex1_prog2_SConscript
@@ -1,4 +1,4 @@
- env = Environment()
- env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c'])
+env = Environment()
+env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c'])
diff --git a/doc/generated/examples/separate_builddir_sconscript_SConstruct b/doc/generated/examples/separate_builddir_sconscript_SConstruct
index c3da7256..d53d1c6f 100644
--- a/doc/generated/examples/separate_builddir_sconscript_SConstruct
+++ b/doc/generated/examples/separate_builddir_sconscript_SConstruct
@@ -1,4 +1,4 @@
- VariantDir('build', 'src')
- SConscript('build/SConscript')
+VariantDir('build', 'src')
+SConscript('build/SConscript')
diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml
new file mode 100644
index 00000000..b62be879
--- /dev/null
+++ b/doc/generated/examples/troubleshoot_explain1_3.xml
@@ -0,0 +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/scons.xsd scons.xsd">% <userinput>scons -Q --warn=target-not-built</userinput>
+scons: building `file.out' because it doesn't exist
+cp file.in file.oout
+
+scons: warning: Cannot find target file.out after building
+</screen>
diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen
index 4849ac6d..072b91ca 100644
--- a/doc/generated/functions.gen
+++ b/doc/generated/functions.gen
@@ -3419,6 +3419,28 @@ Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5)
</example_commands>
</listitem>
</varlistentry>
+ <varlistentry id="f-Pseudo">
+ <term>
+ <literal>Pseudo(target, ...)</literal>
+ </term>
+ <term>
+ <literal>env.Pseudo(target, ...)</literal>
+ </term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+This indicates that each given
+<varname>target</varname>
+should not be created by the build rule, and if the target is created,
+an error will be generated. This is similar to the gnu make .PHONY
+target. However, in the vast majority of cases, an
+<function xmlns="http://www.scons.org/dbxsd/v1.0">Alias</function>
+is more appropriate.
+
+Multiple targets can be passed in to a single call to
+<function xmlns="http://www.scons.org/dbxsd/v1.0">Pseudo</function>.
+</para>
+</listitem>
+ </varlistentry>
<varlistentry id="f-RCS">
<term>
<literal>env.RCS()</literal>
diff --git a/doc/generated/functions.mod b/doc/generated/functions.mod
index 0f5dd21a..99aaa480 100644
--- a/doc/generated/functions.mod
+++ b/doc/generated/functions.mod
@@ -71,6 +71,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-PrependENVPath "<function xmlns='http://www.scons.org/dbxsd/v1.0'>PrependENVPath</function>">
<!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-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>">
@@ -158,6 +159,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-env-PrependENVPath "<function xmlns='http://www.scons.org/dbxsd/v1.0'>env.PrependENVPath</function>">
<!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-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>">
@@ -255,6 +257,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-PrependENVPath "<link linkend='f-PrependENVPath' xmlns='http://www.scons.org/dbxsd/v1.0'><function>PrependENVPath</function></link>">
<!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-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>">
@@ -342,6 +345,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY f-link-env-PrependENVPath "<link linkend='f-PrependENVPath' xmlns='http://www.scons.org/dbxsd/v1.0'><function>env.PrependENVPath</function></link>">
<!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-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>">
diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen
index 57bb0a24..a0a709e9 100644
--- a/doc/generated/tools.gen
+++ b/doc/generated/tools.gen
@@ -222,7 +222,7 @@ accordingly.
</para>
</important>
<para xmlns="http://www.scons.org/dbxsd/v1.0">The rules given above are valid for the Builders <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookHtml"><function>DocbookHtml</function></link>,
-<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookPdf"><function>DocbookPdf</function></link>, <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookSlidesPdf"><function>DocbookSlidesPdf</function></link> and <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookXInclude"><function>DocbookXInclude</function></link>. For the
+<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookPdf"><function>DocbookPdf</function></link>, <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookEpub"><function>DocbookEpub</function></link>, <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookSlidesPdf"><function>DocbookSlidesPdf</function></link> and <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookXInclude"><function>DocbookXInclude</function></link>. For the
<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookMan"><function>DocbookMan</function></link> transformation you
can specify a target name, but the actual output names are automatically
set from the <literal>refname</literal> entries in your XML source.
@@ -261,6 +261,7 @@ variables for setting the default XSL name is provided. These are:
DOCBOOK_DEFAULT_XSL_HTMLCHUNKED
DOCBOOK_DEFAULT_XSL_HTMLHELP
DOCBOOK_DEFAULT_XSL_PDF
+DOCBOOK_DEFAULT_XSL_EPUB
DOCBOOK_DEFAULT_XSL_MAN
DOCBOOK_DEFAULT_XSL_SLIDESPDF
DOCBOOK_DEFAULT_XSL_SLIDESHTML
@@ -272,7 +273,7 @@ DOCBOOK_DEFAULT_XSL_SLIDESHTML
DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl')
env.DocbookHtml('manual') # now uses html.xsl
</screen>
-<para>Sets: &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.</para><para>Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;.</para></listitem>
+<para>Sets: &cv-link-DOCBOOK_DEFAULT_XSL_EPUB;, &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.</para><para>Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;.</para></listitem>
</varlistentry>
<varlistentry id="t-dvi">
<term>dvi</term>
@@ -444,7 +445,12 @@ Set construction variables for GNU linker/loader.
<term>gs</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Set construction variables for Ghostscript.
+This Tool sets the required construction variables for working with
+the Ghostscript command. It also registers an appropriate Action
+with the PDF Builder (<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-PDF"><function>PDF</function></link>), such that the conversion from
+PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain.
+Finally, it adds an explicit Ghostscript Builder (<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-Gs"><function>Gs</function></link>) to the
+environment.
</para>
<para>Sets: &cv-link-GS;, &cv-link-GSCOM;, &cv-link-GSFLAGS;.</para><para>Uses: &cv-link-GSCOMSTR;.</para></listitem>
</varlistentry>
diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen
index 18281122..efdac8ef 100644
--- a/doc/generated/variables.gen
+++ b/doc/generated/variables.gen
@@ -909,6 +909,15 @@ into a list of Dir instances relative to the target being built.
</para>
</listitem>
</varlistentry>
+ <varlistentry id="cv-DOCBOOK_DEFAULT_XSL_EPUB">
+ <term>DOCBOOK_DEFAULT_XSL_EPUB</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The default XSLT file for the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-DocbookEpub"><function>DocbookEpub</function></link> builder within the
+current environment, if no other XSLT gets specified via keyword.
+</para>
+</listitem>
+ </varlistentry>
<varlistentry id="cv-DOCBOOK_DEFAULT_XSL_HTML">
<term>DOCBOOK_DEFAULT_XSL_HTML</term>
<listitem>
@@ -2324,7 +2333,7 @@ described above.)
<term>GS</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The Ghostscript program used to convert PostScript to PDF files.
+The Ghostscript program used, e.g. to convert PostScript to PDF files.
</para>
</listitem>
</varlistentry>
@@ -2332,7 +2341,8 @@ The Ghostscript program used to convert PostScript to PDF files.
<term>GSCOM</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-The Ghostscript command line used to convert PostScript to PDF files.
+The full Ghostscript command line used for the conversion process. Its default
+value is <quote><literal>$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES</literal></quote>.
</para>
</listitem>
</varlistentry>
@@ -2341,9 +2351,8 @@ The Ghostscript command line used to convert PostScript to PDF files.
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when
-Ghostscript is used to convert
-a PostScript file to a PDF file.
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-GSCOM"><envar>$GSCOM</envar></link> (the command line) is displayed.
+Ghostscript is called for the conversion process.
+If this is not set (the default), then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-GSCOM"><envar>$GSCOM</envar></link> (the command line) is displayed.
</para>
</listitem>
</varlistentry>
@@ -2351,8 +2360,9 @@ If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="
<term>GSFLAGS</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-General options passed to the Ghostscript program
-when converting PostScript to PDF files.
+General options passed to the Ghostscript program,
+when converting PostScript to PDF files for example. Its default value
+is <quote><literal>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite</literal></quote>
</para>
</listitem>
</varlistentry>
@@ -3548,6 +3558,9 @@ See <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="t-msginit"><literal>m
Internal ``macro''. Computes locale (language) name based on target filename
(default: <literal>'${TARGET.filebase}' </literal>).
</para>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+See <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="t-msginit"><literal>msginit</literal></link> tool and <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="b-POInit"><function>POInit</function></link> builder.
+</para>
</listitem>
</varlistentry>
<varlistentry id="cv-MSGMERGE">
@@ -7352,6 +7365,28 @@ General options passed to the zip utility.
</para>
</listitem>
</varlistentry>
+ <varlistentry id="cv-ZIPROOT">
+ <term>ZIPROOT</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+An optional zip root directory (default empty). The filenames stored
+in the zip file will be relative to this directory, if given.
+Otherwise the filenames are relative to the current directory of the
+command.
+For instance:
+</para>
+<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
+env = Environment()
+env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1')
+</example_commands>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+will produce a zip file <literal>foo.zip</literal>
+containing a file with the name
+<literal>subdir2/file1</literal> rather than
+<literal>subdir1/subdir2/file1</literal>.
+</para>
+</listitem>
+ </varlistentry>
<varlistentry id="cv-ZIPSUFFIX">
<term>ZIPSUFFIX</term>
<listitem>
diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod
index 7247f554..b55b2188 100644
--- a/doc/generated/variables.mod
+++ b/doc/generated/variables.mod
@@ -70,6 +70,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-DESCRIPTION_lang "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DESCRIPTION_lang</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-DOCBOOK_DEFAULT_XSL_EPUB "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DOCBOOK_DEFAULT_XSL_EPUB</envar>">
<!ENTITY cv-DOCBOOK_DEFAULT_XSL_HTML "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DOCBOOK_DEFAULT_XSL_HTML</envar>">
<!ENTITY cv-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DOCBOOK_DEFAULT_XSL_HTMLCHUNKED</envar>">
<!ENTITY cv-DOCBOOK_DEFAULT_XSL_HTMLHELP "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DOCBOOK_DEFAULT_XSL_HTMLHELP</envar>">
@@ -576,6 +577,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-ZIPCOMPRESSION "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$ZIPCOMPRESSION</envar>">
<!ENTITY cv-ZIPCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$ZIPCOMSTR</envar>">
<!ENTITY cv-ZIPFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$ZIPFLAGS</envar>">
+<!ENTITY cv-ZIPROOT "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$ZIPROOT</envar>">
<!ENTITY cv-ZIPSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$ZIPSUFFIX</envar>">
<!--
@@ -650,6 +652,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-DESCRIPTION_lang "<link linkend='cv-DESCRIPTION_lang' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DESCRIPTION_lang</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-DOCBOOK_DEFAULT_XSL_EPUB "<link linkend='cv-DOCBOOK_DEFAULT_XSL_EPUB' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DOCBOOK_DEFAULT_XSL_EPUB</envar></link>">
<!ENTITY cv-link-DOCBOOK_DEFAULT_XSL_HTML "<link linkend='cv-DOCBOOK_DEFAULT_XSL_HTML' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DOCBOOK_DEFAULT_XSL_HTML</envar></link>">
<!ENTITY cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED "<link linkend='cv-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DOCBOOK_DEFAULT_XSL_HTMLCHUNKED</envar></link>">
<!ENTITY cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP "<link linkend='cv-DOCBOOK_DEFAULT_XSL_HTMLHELP' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DOCBOOK_DEFAULT_XSL_HTMLHELP</envar></link>">
@@ -1156,6 +1159,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-ZIPCOMPRESSION "<link linkend='cv-ZIPCOMPRESSION' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$ZIPCOMPRESSION</envar></link>">
<!ENTITY cv-link-ZIPCOMSTR "<link linkend='cv-ZIPCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$ZIPCOMSTR</envar></link>">
<!ENTITY cv-link-ZIPFLAGS "<link linkend='cv-ZIPFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$ZIPFLAGS</envar></link>">
+<!ENTITY cv-link-ZIPROOT "<link linkend='cv-ZIPROOT' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$ZIPROOT</envar></link>">
<!ENTITY cv-link-ZIPSUFFIX "<link linkend='cv-ZIPSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$ZIPSUFFIX</envar></link>">
<!--
diff --git a/doc/man/MANIFEST b/doc/man/MANIFEST
index 7f0ad45b..4b3ce9ff 100644
--- a/doc/man/MANIFEST
+++ b/doc/man/MANIFEST
@@ -5,8 +5,9 @@ scons.xml
sconsign.xml
scons-time.xml
*.xsl
-scons.css
+*.css
SConstruct
+cover.jpg
titlepage/bricks.jpg
titlepage/mapnik_final_colors.svg
titlepage/SCons_path.svg
diff --git a/doc/man/SConstruct b/doc/man/SConstruct
index cd940215..927bfa24 100644
--- a/doc/man/SConstruct
+++ b/doc/man/SConstruct
@@ -27,7 +27,7 @@
import os
env = Environment(ENV={'PATH' : os.environ['PATH']},
- tools=['docbook'],
+ tools=['docbook','gs','zip'],
toolpath=['../../src/engine/SCons/Tool'],
DOCBOOK_DEFAULT_XSL_HTML='html.xsl',
DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl')
@@ -53,3 +53,16 @@ def createManPages(env, target):
createManPages(env, "scons")
createManPages(env, "sconsign")
createManPages(env, "scons-time")
+
+has_gs = False
+if env.WhereIs('gs'):
+ has_gs = True
+
+#
+# Create the EPUB format
+#
+if has_gs and has_pdf:
+ jpg = env.Gs('OEBPS/cover.jpg','scons-scons.pdf',
+ GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q')
+ epub = env.DocbookEpub('scons-man.epub', 'scons_db.xml', xsl='epub.xsl')
+ env.Depends(epub, jpg)
diff --git a/doc/man/cover.jpg b/doc/man/cover.jpg
new file mode 100644
index 00000000..e2c2cb39
--- /dev/null
+++ b/doc/man/cover.jpg
Binary files differ
diff --git a/doc/man/epub.css b/doc/man/epub.css
new file mode 100644
index 00000000..31cebe54
--- /dev/null
+++ b/doc/man/epub.css
@@ -0,0 +1,33 @@
+/* This defines styles and classes used in the book */
+body { }
+code { font-family: monospace; }
+h1, h2, h3, h4, h5, h6 { text-align: center; margin-bottom:2em;}
+h1.title { }
+h2.author { }
+p{
+ padding:0;
+ margin:0;
+ text-indent:2em;
+}
+blockquote{
+ margin-left:3em;
+ margin-right:3em;
+}
+.caption{
+ text-align:center;
+ font-style:italic;
+ margin-bottom:1em;
+ margin-top:.2em;
+ font-size:.8em;
+}
+blockquote > p{
+ text-indent:0;
+ margin-bottom:1em;
+}
+img{
+ display:block;
+ margin-left: auto;
+ margin-right: auto;
+ text-align:center;
+ margin-top:1em;
+}
diff --git a/doc/man/epub.xsl b/doc/man/epub.xsl
new file mode 100644
index 00000000..bc1d4b3f
--- /dev/null
+++ b/doc/man/epub.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<!--
+
+ __COPYRIGHT__
+
+ 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.
+
+-->
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="../../src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/docbook.xsl"/>
+
+<xsl:param name="html.stylesheet" select="'epub.css'"/>
+
+</xsl:stylesheet>
diff --git a/doc/man/html.xsl b/doc/man/html.xsl
index 71a847a3..864af882 100644
--- a/doc/man/html.xsl
+++ b/doc/man/html.xsl
@@ -51,5 +51,9 @@ reference title
set toc,title
</xsl:param>
+<!-- Prevent our EPUB cover image from getting included -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
</xsl:stylesheet>
diff --git a/doc/man/pdf.xsl b/doc/man/pdf.xsl
index 652975f0..f3141030 100644
--- a/doc/man/pdf.xsl
+++ b/doc/man/pdf.xsl
@@ -67,5 +67,8 @@ set toc,title
<xsl:apply-templates select="." mode="vl.as.blocks"/>
</xsl:template>
-</xsl:stylesheet>
+<!-- Prevent our EPUB cover image from getting printed to the PDF -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+</xsl:stylesheet>
diff --git a/doc/man/scons.xml b/doc/man/scons.xml
index 602bdbee..55608474 100644
--- a/doc/man/scons.xml
+++ b/doc/man/scons.xml
@@ -60,13 +60,16 @@
</copyright>
<releaseinfo>version &buildversion;</releaseinfo>
+
+ <mediaobject role="cover"><imageobject><imagedata fileref="cover.jpg" format="JPG"/></imageobject></mediaobject>
+
</referenceinfo>
-
+
<title>SCons &buildversion;</title>
<subtitle>MAN page</subtitle>
-
-
-<refentry id='scons1'>
+
+
+<refentry id='scons1'>
<refmeta>
<refentrytitle>SCONS</refentrytitle>
<manvolnum>1</manvolnum>
@@ -79,7 +82,7 @@
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
- <command>scons</command>
+ <command>scons</command>
<arg choice='opt' rep='repeat'><replaceable>options</replaceable></arg>
<arg choice='opt' rep='repeat'><replaceable>name=val</replaceable></arg>
<arg choice='opt' rep='repeat'><replaceable>targets</replaceable></arg>
@@ -381,6 +384,7 @@ will be retrieved from the cache instead of being rebuilt locally.
Caching behavior may be disabled and controlled in other ways by the
<option>--cache-force</option>,
<option>--cache-disable</option>,
+<option>--cache-readonly</option>,
and
<option>--cache-show</option>
command-line options. The
@@ -542,6 +546,15 @@ option.</para>
</listitem>
</varlistentry>
+<varlistentry>
+ <term>--cache-readonly</term>
+ <listitem>
+<para>Use the cache (if enabled) for reading, but do not not update the
+cache with changed files.
+</para>
+
+ </listitem>
+ </varlistentry>
<varlistentry>
<term>--cache-show</term>
<listitem>
@@ -661,8 +674,9 @@ directory.</para>
<term>--debug=<emphasis>type</emphasis></term>
<listitem>
<para>Debug the build process.
-<emphasis>type</emphasis>
-specifies what type of debugging:</para>
+<emphasis>type[,type...]</emphasis>
+specifies what type of debugging. Multiple types may be specified,
+separated by commas. The following types are valid:</para>
</listitem>
</varlistentry>
@@ -1094,6 +1108,7 @@ command:</para>
--cache-debug=FILE
--cache-disable, --no-cache
--cache-force, --cache-populate
+--cache-readonly
--cache-show
--debug=TYPE
-i, --ignore-errors
@@ -1458,11 +1473,11 @@ the last dir examined comes first in the resulting path.</para>
<term>Windows:</term>
<listitem>
<literallayout class="monospaced">
- %ALLUSERSPROFILE/Application Data/scons/site_scons
- %USERPROFILE%/Local Settings/Application Data/scons/site_scons
- %APPDATA%/scons/site_scons
- %HOME%/.scons/site_scons
- ./site_scons
+%ALLUSERSPROFILE/Application Data/scons/site_scons
+%USERPROFILE%/Local Settings/Application Data/scons/site_scons
+%APPDATA%/scons/site_scons
+%HOME%/.scons/site_scons
+./site_scons
</literallayout>
</listitem>
</varlistentry>
@@ -1470,12 +1485,12 @@ the last dir examined comes first in the resulting path.</para>
<term>Mac OS X:</term>
<listitem>
<literallayout class="monospaced">
- /Library/Application Support/SCons/site_scons
- /opt/local/share/scons/site_scons (for MacPorts)
- /sw/share/scons/site_scons (for Fink)
- $HOME/Library/Application Support/SCons/site_scons
- $HOME/.scons/site_scons
- ./site_scons
+/Library/Application Support/SCons/site_scons
+/opt/local/share/scons/site_scons (for MacPorts)
+/sw/share/scons/site_scons (for Fink)
+$HOME/Library/Application Support/SCons/site_scons
+$HOME/.scons/site_scons
+./site_scons
</literallayout>
</listitem>
</varlistentry>
@@ -1483,10 +1498,10 @@ the last dir examined comes first in the resulting path.</para>
<term>Solaris:</term>
<listitem>
<literallayout class="monospaced">
- /opt/sfw/scons/site_scons
- /usr/share/scons/site_scons
- $HOME/.scons/site_scons
- ./site_scons
+/opt/sfw/scons/site_scons
+/usr/share/scons/site_scons
+$HOME/.scons/site_scons
+./site_scons
</literallayout>
</listitem>
</varlistentry>
@@ -1494,9 +1509,9 @@ the last dir examined comes first in the resulting path.</para>
<term>Linux, HPUX, and other Posix-like systems:</term>
<listitem>
<literallayout class="monospaced">
- /usr/share/scons/site_scons
- $HOME/.scons/site_scons
- ./site_scons
+/usr/share/scons/site_scons
+$HOME/.scons/site_scons
+./site_scons
</literallayout>
</listitem>
@@ -1940,6 +1955,14 @@ These warnings are enabled by default.</para>
</listitem>
</varlistentry>
<varlistentry>
+ <term>--warn=target_not_build, --warn=no-target_not_built</term>
+ <listitem>
+<para>Enables or disables warnings about a build rule not building the
+ expected targets. These warnings are not currently enabled by default.</para>
+
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>-Y<emphasis> repository</emphasis>, --repository=<emphasis>repository</emphasis>, --srcdir=<emphasis>repository</emphasis></term>
<listitem>
<para>Search the specified repository for any input and target
@@ -6775,7 +6798,7 @@ specified in the
<emphasis role="bold">$MYPATH</emphasis>
construction variable. It lets SCons detect the file
<emphasis role="bold">incs/foo.inc</emphasis>
-, even if
+, even if
<emphasis role="bold">foo.x</emphasis>
contains the line
<emphasis role="bold">include foo.inc</emphasis>
diff --git a/doc/python10/design.xml b/doc/python10/design.xml
index f4b5b396..beee6960 100644
--- a/doc/python10/design.xml
+++ b/doc/python10/design.xml
@@ -556,8 +556,8 @@
</para>
<programlisting>
- env = Environment()
- env_debug = Environment(CCFLAGS = '-g')
+env = Environment()
+env_debug = Environment(CCFLAGS = '-g')
</programlisting>
</section>
@@ -584,7 +584,7 @@
</para>
<programlisting>
- bld = Builder(name = 'Program', action = "$CC -o $TARGET $SOURCES")
+bld = Builder(name = 'Program', action = "$CC -o $TARGET $SOURCES")
</programlisting>
<para>
@@ -633,8 +633,8 @@
</para>
<programlisting>
- bld_lib = Builder(name = 'Library', action = "$AR r $TARGET $SOURCES",
- prefix = 'lib', suffix = '.a', src_suffix = '.o')
+bld_lib = Builder(name = 'Library', action = "$AR r $TARGET $SOURCES",
+ prefix = 'lib', suffix = '.a', src_suffix = '.o')
</programlisting>
<para>
@@ -660,7 +660,7 @@
</para>
<programlisting>
- env = Environment(BUILDERS = [ Object, Library, WebPage, Program ])
+env = Environment(BUILDERS = [ Object, Library, WebPage, Program ])
</programlisting>
</section>
@@ -709,7 +709,7 @@
</para>
<programlisting>
- env = Environment(SCANNERS = [ CScan, M4Scan ])
+env = Environment(SCANNERS = [ CScan, M4Scan ])
</programlisting>
<para>
@@ -745,7 +745,7 @@
</para>
<programlisting>
- BuildDir(source = 'src', build = 'bld')
+BuildDir(source = 'src', build = 'bld')
</programlisting>
<para>
@@ -763,7 +763,7 @@
</para>
<programlisting>
- BuildDir(source = 'src', build = 'bld', no_sources = 1)
+BuildDir(source = 'src', build = 'bld', no_sources = 1)
</programlisting>
</section>
@@ -784,7 +784,7 @@
</para>
<programlisting>
- Repository('/home/source/1.1', '/home/source/1.0')
+Repository('/home/source/1.1', '/home/source/1.0')
</programlisting>
<para>
@@ -810,7 +810,7 @@
</para>
<programlisting>
- Cache('/var/build.cache/i386')
+Cache('/var/build.cache/i386')
</programlisting>
<para>
@@ -880,7 +880,7 @@
</para>
<programlisting>
- source_files = 'f1.c f2.c f3.c'
+source_files = 'f1.c f2.c f3.c'
</programlisting>
<para>
@@ -892,7 +892,7 @@
</para>
<programlisting>
- SConscript('src/SConscript', 'lib/SConscript')
+SConscript('src/SConscript', 'lib/SConscript')
</programlisting>
<para>
diff --git a/doc/reference/Library.xml b/doc/reference/Library.xml
index 5d87ee7c..40217443 100644
--- a/doc/reference/Library.xml
+++ b/doc/reference/Library.xml
@@ -79,16 +79,16 @@ be generated (the rest will disappear!).
<title>Linking With a Library</title>
<programlisting>
- env = Environment(CC = 'gcc',
- LIBS = 'world')
- env.Program('hello.c')
+env = Environment(CC = 'gcc',
+ LIBS = 'world')
+env.Program('hello.c')
</programlisting>
<literallayout>
- % <userinput>scons</userinput>
- gcc -c hello.c -o hello.o
- gcc -c world.c -o world.o
- gcc -o hello hello.o -lworld
+% <userinput>scons</userinput>
+gcc -c hello.c -o hello.o
+gcc -c world.c -o world.o
+gcc -o hello hello.o -lworld
</literallayout>
</section>
@@ -97,20 +97,20 @@ be generated (the rest will disappear!).
<title>Creating a Library</title>
<programlisting>
- env = Environment(CC = 'gcc',
- LIBS = 'world')
- env.Program('hello.c')
- env.Library('world.c')
+env = Environment(CC = 'gcc',
+ LIBS = 'world')
+env.Program('hello.c')
+env.Library('world.c')
</programlisting>
<literallayout>
- % <userinput>scons</userinput>
- gcc -c hello.c -o hello.o
- gcc -c world.c -o world.o
- ar r libworld.a world.o
- ar: creating libworld.a
- ranlib libworld.a
- gcc -o hello hello.o libworld.a
+% <userinput>scons</userinput>
+gcc -c hello.c -o hello.o
+gcc -c world.c -o world.o
+ar r libworld.a world.o
+ar: creating libworld.a
+ranlib libworld.a
+gcc -o hello hello.o libworld.a
</literallayout>
</section>
diff --git a/doc/user/MANIFEST b/doc/user/MANIFEST
index e5f8988f..62da288d 100644
--- a/doc/user/MANIFEST
+++ b/doc/user/MANIFEST
@@ -51,7 +51,7 @@ variants.xml
variables.xml
*.jpg
*.xsl
-scons.css
+*.css
SConstruct
titlepage/bricks.jpg
titlepage/mapnik_final_colors.svg
diff --git a/doc/user/SConstruct b/doc/user/SConstruct
index 002aea4f..701fb7bc 100644
--- a/doc/user/SConstruct
+++ b/doc/user/SConstruct
@@ -27,7 +27,7 @@
import os
env = Environment(ENV={'PATH' : os.environ['PATH']},
- tools=['docbook'],
+ tools=['docbook','gs','zip'],
toolpath=['../../src/engine/SCons/Tool'],
DOCBOOK_DEFAULT_XSL_HTML='html.xsl',
DOCBOOK_DEFAULT_XSL_HTMLCHUNKED='chtml.xsl',
@@ -51,3 +51,16 @@ env.DocbookHtml('index.html','scons_db.xml')
env.DocbookHtmlChunked('index.html', 'scons_db.xml', base_dir='scons-user/')
if has_pdf:
env.DocbookPdf('scons-user.pdf','scons_db.xml')
+
+has_gs = False
+if env.WhereIs('gs'):
+ has_gs = True
+
+#
+# Create the EPUB format
+#
+if has_gs and has_pdf:
+ jpg = env.Gs('OEBPS/cover.jpg','scons-user.pdf',
+ GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q')
+ epub = env.DocbookEpub('scons-user.epub', 'scons_db.xml', xsl='epub.xsl')
+ env.Depends(epub, jpg)
diff --git a/doc/user/actions.xml b/doc/user/actions.xml
index 4b7c13a6..eab9c105 100644
--- a/doc/user/actions.xml
+++ b/doc/user/actions.xml
@@ -267,7 +267,7 @@ solutions to the above limitations.
</para>
<sconstruct>
- b = Builder(action = 'build &lt; $SOURCE &gt; $TARGET')
+b = Builder(action = 'build &lt; $SOURCE &gt; $TARGET')
</sconstruct>
<para>
@@ -277,7 +277,7 @@ solutions to the above limitations.
</para>
<sconstruct>
- b = Builder(action = Action('build &lt; $SOURCE &gt; $TARGET'))
+b = Builder(action = Action('build &lt; $SOURCE &gt; $TARGET'))
</sconstruct>
<para>
diff --git a/doc/user/add-method.xml b/doc/user/add-method.xml
index a9a89d3b..c50786cd 100644
--- a/doc/user/add-method.xml
+++ b/doc/user/add-method.xml
@@ -63,17 +63,17 @@
<scons_example name="addmethod_ex1">
<file name="SConstruct" printme="1">
- def install_in_bin_dirs(env, source):
- """Install source in both bin dirs"""
- i1 = env.Install("$BIN", source)
- i2 = env.Install("$LOCALBIN", source)
- return [i1[0], i2[0]] # Return a list, like a normal builder
- env = Environment(BIN='__ROOT__/usr/bin', LOCALBIN='#install/bin')
- env.AddMethod(install_in_bin_dirs, "InstallInBinDirs")
- env.InstallInBinDirs(Program('hello.c')) # installs hello in both bin dirs
+def install_in_bin_dirs(env, source):
+ """Install source in both bin dirs"""
+ i1 = env.Install("$BIN", source)
+ i2 = env.Install("$LOCALBIN", source)
+ return [i1[0], i2[0]] # Return a list, like a normal builder
+env = Environment(BIN='__ROOT__/usr/bin', LOCALBIN='#install/bin')
+env.AddMethod(install_in_bin_dirs, "InstallInBinDirs")
+env.InstallInBinDirs(Program('hello.c')) # installs hello in both bin dirs
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -100,28 +100,28 @@
<scons_example name="addmethod_ex2">
<file name="SConstruct" printme="1">
- def BuildTestProg(env, testfile, resourcefile, testdir="tests"):
- """Build the test program;
- prepends "test_" to src and target,
- and puts target into testdir."""
- srcfile = "test_%s.c" % testfile
- target = "%s/test_%s" % (testdir, testfile)
- if env['PLATFORM'] == 'win32':
- resfile = env.RES(resourcefile)
- p = env.Program(target, [srcfile, resfile])
- else:
- p = env.Program(target, srcfile)
- return p
- AddMethod(Environment, BuildTestProg)
-
- env = Environment()
- env.BuildTestProg('stuff', resourcefile='res.rc')
+def BuildTestProg(env, testfile, resourcefile, testdir="tests"):
+ """Build the test program;
+ prepends "test_" to src and target,
+ and puts target into testdir."""
+ srcfile = "test_%s.c" % testfile
+ target = "%s/test_%s" % (testdir, testfile)
+ if env['PLATFORM'] == 'win32':
+ resfile = env.RES(resourcefile)
+ p = env.Program(target, [srcfile, resfile])
+ else:
+ p = env.Program(target, srcfile)
+ return p
+AddMethod(Environment, BuildTestProg)
+
+env = Environment()
+env.BuildTestProg('stuff', resourcefile='res.rc')
</file>
<file name="test_stuff.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="res.rc">
- res.rc
+res.rc
</file>
</scons_example>
diff --git a/doc/user/alias.xml b/doc/user/alias.xml
index dfaea5bf..63253168 100644
--- a/doc/user/alias.xml
+++ b/doc/user/alias.xml
@@ -54,13 +54,13 @@
<scons_example name="alias_ex1">
<file name="SConstruct" printme="1">
- env = Environment()
- hello = env.Program('hello.c')
- env.Install('__ROOT__/usr/bin', hello)
- env.Alias('install', '__ROOT__/usr/bin')
+env = Environment()
+hello = env.Program('hello.c')
+env.Install('__ROOT__/usr/bin', hello)
+env.Alias('install', '__ROOT__/usr/bin')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -90,20 +90,20 @@
<scons_example name="alias_ex2">
<file name="SConstruct" printme="1">
- env = Environment()
- p = env.Program('foo.c')
- l = env.Library('bar.c')
- env.Install('__ROOT__/usr/bin', p)
- env.Install('__ROOT__/usr/lib', l)
- ib = env.Alias('install-bin', '__ROOT__/usr/bin')
- il = env.Alias('install-lib', '__ROOT__/usr/lib')
- env.Alias('install', [ib, il])
+env = Environment()
+p = env.Program('foo.c')
+l = env.Library('bar.c')
+env.Install('__ROOT__/usr/bin', p)
+env.Install('__ROOT__/usr/lib', l)
+ib = env.Alias('install-bin', '__ROOT__/usr/bin')
+il = env.Alias('install-lib', '__ROOT__/usr/lib')
+env.Alias('install', [ib, il])
</file>
<file name="foo.c">
- int main() { printf("foo.c\n"); }
+int main() { printf("foo.c\n"); }
</file>
<file name="bar.c">
- void bar() { printf("bar.c\n"); }
+void bar() { printf("bar.c\n"); }
</file>
</scons_example>
diff --git a/doc/user/build-install.xml b/doc/user/build-install.xml
index 62fe2c48..c6f8e6d3 100644
--- a/doc/user/build-install.xml
+++ b/doc/user/build-install.xml
@@ -106,8 +106,8 @@
</para>
<screen>
- $ <userinput>python -V</userinput>
- Python 2.5.1
+$ <userinput>python -V</userinput>
+Python 2.5.1
</screen>
<para>
@@ -117,8 +117,8 @@
</para>
<screen>
- C:\><userinput>python -V</userinput>
- Python 2.5.1
+C:\><userinput>python -V</userinput>
+Python 2.5.1
</screen>
<para>
@@ -200,7 +200,7 @@
</para>
<screen>
- # <userinput>yum install scons</userinput>
+# <userinput>yum install scons</userinput>
</screen>
<para>
@@ -225,7 +225,7 @@
</para>
<screen>
- # <userinput>rpm -Uvh scons-&buildversion;-1.noarch.rpm</userinput>
+# <userinput>rpm -Uvh scons-&buildversion;-1.noarch.rpm</userinput>
</screen>
<para>
@@ -258,7 +258,7 @@
</para>
<screen>
- # <userinput>apt-get install scons</userinput>
+# <userinput>apt-get install scons</userinput>
</screen>
<!--
@@ -273,7 +273,7 @@
</para>
<screen>
- # <userinput>db-XXX scons-*.deb</userinput>
+# <userinput>db-XXX scons-*.deb</userinput>
</screen>
-->
@@ -419,8 +419,8 @@
</para>
<screen>
- # <userinput>cd scons-&buildversion;</userinput>
- # <userinput>python setup.py install</userinput>
+# <userinput>cd scons-&buildversion;</userinput>
+# <userinput>python setup.py install</userinput>
</screen>
<para>
@@ -480,7 +480,7 @@
</para>
<screen>
- # <userinput>python setup.py install --version-lib</userinput>
+# <userinput>python setup.py install --version-lib</userinput>
</screen>
<para>
@@ -522,7 +522,7 @@
</para>
<screen>
- # <userinput>python setup.py install --prefix=/opt/scons</userinput>
+# <userinput>python setup.py install --prefix=/opt/scons</userinput>
</screen>
<para>
@@ -573,7 +573,7 @@
</para>
<screen>
- $ <userinput>python setup.py install --prefix=$HOME</userinput>
+$ <userinput>python setup.py install --prefix=$HOME</userinput>
</screen>
<para>
diff --git a/doc/user/builders-built-in.xml b/doc/user/builders-built-in.xml
index 9c280205..2fcf3139 100644
--- a/doc/user/builders-built-in.xml
+++ b/doc/user/builders-built-in.xml
@@ -77,7 +77,7 @@
</para>
<programlisting>
- Program('prog', 'file1.o')
+Program('prog', 'file1.o')
</programlisting>
<para>
@@ -102,8 +102,8 @@
</para>
<programlisting>
- env = Environment(PROGPREFIX='my', PROGSUFFIX='.xxx')
- env.Program('prog', ['file1.o', 'file2.o'])
+env = Environment(PROGPREFIX='my', PROGSUFFIX='.xxx')
+env.Program('prog', ['file1.o', 'file2.o'])
</programlisting>
<para>
@@ -126,7 +126,7 @@
</para>
<programlisting>
- Program(['hello.c', 'goodbye.c'])
+Program(['hello.c', 'goodbye.c'])
</programlisting>
<para>
@@ -154,15 +154,15 @@
<scons_example name="buildersbuiltin_libs">
<file name="SConstruct" printme="1">
- env = Environment(LIBS = ['foo1', 'foo2'],
- LIBPATH = ['/usr/dir1', 'dir2'])
- env.Program(['hello.c', 'goodbye.c'])
+env = Environment(LIBS = ['foo1', 'foo2'],
+ LIBPATH = ['/usr/dir1', 'dir2'])
+env.Program(['hello.c', 'goodbye.c'])
</file>
<file name="hello.c">
- int hello() { printf("Hello, world!\n"); }
+int hello() { printf("Hello, world!\n"); }
</file>
<file name="goodbye.c">
- int goodbye() { printf("Goodbye, world!\n"); }
+int goodbye() { printf("Goodbye, world!\n"); }
</file>
</scons_example>
@@ -258,7 +258,7 @@
</para>
<programlisting>
- StaticObject('file', 'file.c')
+StaticObject('file', 'file.c')
</programlisting>
<para>
@@ -283,8 +283,8 @@
</para>
<programlisting>
- env = Environment(OBJPREFIX='my', OBJSUFFIX='.xxx')
- env.StaticObject('file', 'file.c')
+env = Environment(OBJPREFIX='my', OBJSUFFIX='.xxx')
+env.StaticObject('file', 'file.c')
</programlisting>
<para>
@@ -307,7 +307,7 @@
</para>
<programlisting>
- StaticObject('file.c')
+StaticObject('file.c')
</programlisting>
<para>
@@ -337,7 +337,7 @@
</para>
<programlisting>
- SharedObject('file', 'file.c')
+SharedObject('file', 'file.c')
</programlisting>
<para>
@@ -362,8 +362,8 @@
</para>
<programlisting>
- env = Environment(SHOBJPREFIX='my', SHOBJSUFFIX='.xxx')
- env.SharedObject('file', 'file.c')
+env = Environment(SHOBJPREFIX='my', SHOBJSUFFIX='.xxx')
+env.SharedObject('file', 'file.c')
</programlisting>
<para>
@@ -386,7 +386,7 @@
</para>
<programlisting>
- SharedObject('file.c')
+SharedObject('file.c')
</programlisting>
<para>
@@ -440,7 +440,7 @@
</para>
<programlisting>
- StaticLibrary('foo', ['file1.c', 'file2.c'])
+StaticLibrary('foo', ['file1.c', 'file2.c'])
</programlisting>
<para>
@@ -457,8 +457,8 @@
</para>
<programlisting>
- env = Environment(LIBPREFIX='my', LIBSUFFIX='.xxx')
- env.StaticLibrary('lib', ['file1.o', 'file2.o'])
+env = Environment(LIBPREFIX='my', LIBSUFFIX='.xxx')
+env.StaticLibrary('lib', ['file1.o', 'file2.o'])
</programlisting>
<para>
@@ -470,7 +470,7 @@
</para>
<programlisting>
- StaticLibrary('foo', ['file1.c', 'file2.c'])
+StaticLibrary('foo', ['file1.c', 'file2.c'])
</programlisting>
<para>
@@ -484,7 +484,7 @@
</para>
<programlisting>
- StaticLibrary(['file.c', 'another.c'])
+StaticLibrary(['file.c', 'another.c'])
</programlisting>
<para>
@@ -514,7 +514,7 @@
</para>
<programlisting>
- SharedLibrary('foo', ['file1.c', 'file2.c'])
+SharedLibrary('foo', ['file1.c', 'file2.c'])
</programlisting>
<para>
@@ -531,8 +531,8 @@
</para>
<programlisting>
- env = Environment(SHLIBPREFIX='my', SHLIBSUFFIX='.xxx')
- env.SharedLibrary('shared', ['file1.o', 'file2.o'])
+env = Environment(SHLIBPREFIX='my', SHLIBSUFFIX='.xxx')
+env.SharedLibrary('shared', ['file1.o', 'file2.o'])
</programlisting>
<para>
@@ -544,7 +544,7 @@
</para>
<programlisting>
- SharedLibrary('foo', ['file1.c', 'file2.c'])
+SharedLibrary('foo', ['file1.c', 'file2.c'])
</programlisting>
<para>
@@ -558,7 +558,7 @@
</para>
<programlisting>
- SharedLibrary(['file.c', 'another.c'])
+SharedLibrary(['file.c', 'another.c'])
</programlisting>
<para>
@@ -631,11 +631,11 @@
</para>
<programlisting>
- XXX CFile() programlisting
+XXX CFile() programlisting
</programlisting>
<screen>
- XXX CFile() screen
+XXX CFile() screen
</screen>
</section>
@@ -650,11 +650,11 @@
</para>
<programlisting>
- XXX CXXFILE() programlisting
+XXX CXXFILE() programlisting
</programlisting>
<screen>
- XXX CXXFILE() screen
+XXX CXXFILE() screen
</screen>
</section>
@@ -681,11 +681,11 @@
</para>
<programlisting>
- XXX DVI() programlisting
+XXX DVI() programlisting
</programlisting>
<screen>
- XXX DVI() screen
+XXX DVI() screen
</screen>
</section>
@@ -711,11 +711,11 @@
</para>
<programlisting>
- XXX PostScript() programlisting
+XXX PostScript() programlisting
</programlisting>
<screen>
- XXX PostScript() screen
+XXX PostScript() screen
</screen>
</section>
@@ -745,18 +745,18 @@
<scons_example name="buildersbuiltin_ex1">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Tar('out1.tar', ['file1', 'file2'])
- env.Tar('out2', 'directory')
+env = Environment()
+env.Tar('out1.tar', ['file1', 'file2'])
+env.Tar('out2', 'directory')
</file>
<file name="file1">
- file1
+file1
</file>
<file name="file2">
- file2
+file2
</file>
<file name="directory/file3">
- directory/file3
+directory/file3
</file>
</scons_example>
@@ -781,11 +781,11 @@
<scons_example name="buildersbuiltin_ex2">
<file name="SConstruct" printme="1">
- env = Environment(TARFLAGS = '-c -z')
- env.Tar('out.tar.gz', 'directory')
+env = Environment(TARFLAGS = '-c -z')
+env.Tar('out.tar.gz', 'directory')
</file>
<file name="directory/file">
- directory/file
+directory/file
</file>
</scons_example>
@@ -805,12 +805,12 @@
<scons_example name="buildersbuiltin_ex3">
<file name="SConstruct" printme="1">
- env = Environment(TARFLAGS = '-c -z',
- TARSUFFIX = '.tgz')
- env.Tar('out', 'directory')
+env = Environment(TARFLAGS = '-c -z',
+ TARSUFFIX = '.tgz')
+env.Tar('out', 'directory')
</file>
<file name="directory/file">
- directory/file
+directory/file
</file>
</scons_example>
@@ -837,14 +837,14 @@
<scons_example name="buildersbuiltin_ex4">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Zip('out', ['file1', 'file2'])
+env = Environment()
+env.Zip('out', ['file1', 'file2'])
</file>
<file name="file1">
- file1
+file1
</file>
<file name="file2">
- file2
+file2
</file>
</scons_example>
@@ -891,8 +891,8 @@
</para>
<programlisting>
- env = Environment()
- env.Java(target = 'classes', source = 'src')
+env = Environment()
+env.Java(target = 'classes', source = 'src')
</programlisting>
<para>
@@ -905,7 +905,7 @@
</para>
<screen>
- XXX Java() screen
+XXX Java() screen
</screen>
</section>
@@ -920,13 +920,13 @@
</para>
<programlisting>
- env = Environment()
- env.Java(target = 'classes', source = 'src')
- env.Jar(target = '', source = 'classes')
+env = Environment()
+env.Java(target = 'classes', source = 'src')
+env.Jar(target = '', source = 'classes')
</programlisting>
<screen>
- XXX Jar() screen
+XXX Jar() screen
</screen>
</section>
@@ -941,11 +941,11 @@
</para>
<programlisting>
- XXX JavaH() programlisting
+XXX JavaH() programlisting
</programlisting>
<screen>
- XXX JavaH() screen
+XXX JavaH() screen
</screen>
</section>
@@ -960,11 +960,11 @@
</para>
<programlisting>
- XXX RMIC() programlisting
+XXX RMIC() programlisting
</programlisting>
<screen>
- XXX RMIC() screen
+XXX RMIC() screen
</screen>
</section>
diff --git a/doc/user/builders-commands.xml b/doc/user/builders-commands.xml
index 52e98c87..d496ef11 100644
--- a/doc/user/builders-commands.xml
+++ b/doc/user/builders-commands.xml
@@ -93,11 +93,11 @@
<scons_example name="builderscommands_ex1">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Command('foo.out', 'foo.in', "sed 's/x/y/' &lt; $SOURCE > $TARGET")
+env = Environment()
+env.Command('foo.out', 'foo.in', "sed 's/x/y/' &lt; $SOURCE > $TARGET")
</file>
<file name="foo.in">
- foo.in
+foo.in
</file>
</scons_example>
@@ -133,14 +133,14 @@
<scons_example name="builderscommands_ex2">
<file name="SConstruct" printme="1">
- env = Environment()
- def build(target, source, env):
- # Whatever it takes to build
- return None
- env.Command('foo.out', 'foo.in', build)
+env = Environment()
+def build(target, source, env):
+ # Whatever it takes to build
+ return None
+env.Command('foo.out', 'foo.in', build)
</file>
<file name="foo.in">
- foo.in
+foo.in
</file>
</scons_example>
@@ -164,7 +164,7 @@
<scons_example name="builderscommands_ex3">
<file name="SConstruct" printme="1">
- env.Command('${SOURCE.basename}.out', 'foo.in', build)
+env.Command('${SOURCE.basename}.out', 'foo.in', build)
</file>
</scons_example>
diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml
index 2dea8f7c..e6e2aaf2 100644
--- a/doc/user/builders-writing.xml
+++ b/doc/user/builders-writing.xml
@@ -151,7 +151,7 @@ This functionality could be invoked as in the following example:
</para>
<programlisting>
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
</programlisting>
<para>
@@ -187,23 +187,23 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_ex1">
<file name="SConstruct">
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
- env = Environment(BUILDERS = {'Foo' : bld})
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- env.Foo('file.foo', 'file.input')
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+env = Environment(BUILDERS = {'Foo' : bld})
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+env.Foo('file.foo', 'file.input')
</file>
<file name="file.input">
- file.input
+file.input
</file>
<file name="foobuild" chmod="0755">
- cat
+cat
</file>
</scons_example>
<sconstruct>
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
- env = Environment(BUILDERS = {'Foo' : bld})
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+env = Environment(BUILDERS = {'Foo' : bld})
</sconstruct>
<para>
@@ -215,7 +215,7 @@ This functionality could be invoked as in the following example:
</para>
<programlisting>
- env.Foo('file.foo', 'file.input')
+env.Foo('file.foo', 'file.input')
</programlisting>
<para>
@@ -261,22 +261,22 @@ This functionality could be invoked as in the following example:
-->
<scons_example name="builderswriting_ex2">
<file name="SConstruct">
- import SCons.Defaults; SCons.Defaults.ConstructionEnvironment['TOOLS'] = {}; bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
- env = Environment(BUILDERS = {'Foo' : bld})
- env.Foo('file.foo', 'file.input')
- env.Program('hello.c')
+import SCons.Defaults; SCons.Defaults.ConstructionEnvironment['TOOLS'] = {}; bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+env = Environment(BUILDERS = {'Foo' : bld})
+env.Foo('file.foo', 'file.input')
+env.Program('hello.c')
</file>
<file name="SConstruct.printme" printme="1">
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
- env = Environment(BUILDERS = {'Foo' : bld})
- env.Foo('file.foo', 'file.input')
- env.Program('hello.c')
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+env = Environment(BUILDERS = {'Foo' : bld})
+env.Foo('file.foo', 'file.input')
+env.Program('hello.c')
</file>
<file name="file.input">
- file.input
+file.input
</file>
<file name="hello.c">
- hello.c
+hello.c
</file>
</scons_example>
@@ -295,31 +295,31 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_ex3">
<file name="SConstruct">
- env = Environment()
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
- env.Append(BUILDERS = {'Foo' : bld})
- env.Foo('file.foo', 'file.input')
- env.Program('hello.c')
+env = Environment()
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+env.Append(BUILDERS = {'Foo' : bld})
+env.Foo('file.foo', 'file.input')
+env.Program('hello.c')
</file>
<file name="file.input">
- file.input
+file.input
</file>
<file name="hello.c">
- hello.c
+hello.c
</file>
<file name="foobuild" chmod="0755">
- cat
+cat
</file>
</scons_example>
<sconstruct>
- env = Environment()
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
- env.Append(BUILDERS = {'Foo' : bld})
- env.Foo('file.foo', 'file.input')
- env.Program('hello.c')
+env = Environment()
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+env.Append(BUILDERS = {'Foo' : bld})
+env.Foo('file.foo', 'file.input')
+env.Program('hello.c')
</sconstruct>
<para>
@@ -330,11 +330,11 @@ This functionality could be invoked as in the following example:
</para>
<sconstruct>
- env = Environment()
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
- env['BUILDERS']['Foo'] = bld
- env.Foo('file.foo', 'file.input')
- env.Program('hello.c')
+env = Environment()
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+env['BUILDERS']['Foo'] = bld
+env.Foo('file.foo', 'file.input')
+env.Program('hello.c')
</sconstruct>
<para>
@@ -374,33 +374,33 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_ex4">
<file name="SConstruct">
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET',
- suffix = '.foo',
- src_suffix = '.input')
- env = Environment(BUILDERS = {'Foo' : bld})
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- env.Foo('file1')
- env.Foo('file2')
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET',
+ suffix = '.foo',
+ src_suffix = '.input')
+env = Environment(BUILDERS = {'Foo' : bld})
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+env.Foo('file1')
+env.Foo('file2')
</file>
<file name="file1.input">
- file1.input
+file1.input
</file>
<file name="file2.input">
- file2.input
+file2.input
</file>
<file name="foobuild" chmod="0755">
- cat
+cat
</file>
</scons_example>
<sconstruct>
- bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET',
- suffix = '.foo',
- src_suffix = '.input')
- env = Environment(BUILDERS = {'Foo' : bld})
- env.Foo('file1')
- env.Foo('file2')
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET',
+ suffix = '.foo',
+ src_suffix = '.input')
+env = Environment(BUILDERS = {'Foo' : bld})
+env.Foo('file1')
+env.Foo('file2')
</sconstruct>
<scons_output example="builderswriting_ex4" suffix="1">
@@ -432,9 +432,9 @@ This functionality could be invoked as in the following example:
</para>
<programlisting>
- def build_function(target, source, env):
- # Code to build "target" from "source"
- return None
+def build_function(target, source, env):
+ # Code to build "target" from "source"
+ return None
</programlisting>
<para>
@@ -521,17 +521,17 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_ex5">
<file name="SConstruct" printme="1">
- def build_function(target, source, env):
- # Code to build "target" from "source"
- return None
- bld = Builder(action = build_function,
- suffix = '.foo',
- src_suffix = '.input')
- env = Environment(BUILDERS = {'Foo' : bld})
- env.Foo('file')
+def build_function(target, source, env):
+ # Code to build "target" from "source"
+ return None
+bld = Builder(action = build_function,
+ suffix = '.foo',
+ src_suffix = '.input')
+env = Environment(BUILDERS = {'Foo' : bld})
+env.Foo('file')
</file>
<file name="file.input">
- file.input
+file.input
</file>
</scons_example>
@@ -565,8 +565,8 @@ This functionality could be invoked as in the following example:
</para>
<programlisting>
- def generate_actions(source, target, env, for_signature):
- return 'foobuild &lt; %s &gt; %s' % (target[0], source[0])
+def generate_actions(source, target, env, for_signature):
+ return 'foobuild &lt; %s &gt; %s' % (target[0], source[0])
</programlisting>
<para>
@@ -668,32 +668,32 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_ex6">
<file name="SConstruct">
- def generate_actions(source, target, env, for_signature):
- return 'foobuild &lt; %s &gt; %s' % (source[0], target[0])
- bld = Builder(generator = generate_actions,
- suffix = '.foo',
- src_suffix = '.input')
- env = Environment(BUILDERS = {'Foo' : bld})
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- env.Foo('file')
+def generate_actions(source, target, env, for_signature):
+ return 'foobuild &lt; %s &gt; %s' % (source[0], target[0])
+bld = Builder(generator = generate_actions,
+ suffix = '.foo',
+ src_suffix = '.input')
+env = Environment(BUILDERS = {'Foo' : bld})
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+env.Foo('file')
</file>
<file name="file.input">
- file.input
+file.input
</file>
<file name="foobuild" chmod="0755">
- cat
+cat
</file>
</scons_example>
<sconstruct>
- def generate_actions(source, target, env, for_signature):
- return 'foobuild &lt; %s &gt; %s' % (source[0], target[0])
- bld = Builder(generator = generate_actions,
- suffix = '.foo',
- src_suffix = '.input')
- env = Environment(BUILDERS = {'Foo' : bld})
- env.Foo('file')
+def generate_actions(source, target, env, for_signature):
+ return 'foobuild &lt; %s &gt; %s' % (source[0], target[0])
+bld = Builder(generator = generate_actions,
+ suffix = '.foo',
+ src_suffix = '.input')
+env = Environment(BUILDERS = {'Foo' : bld})
+env.Foo('file')
</sconstruct>
<scons_output example="builderswriting_ex6" suffix="1">
@@ -746,41 +746,41 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_ex7">
<file name="SConstruct">
- def modify_targets(target, source, env):
- target.append('new_target')
- source.append('new_source')
- return target, source
- bld = Builder(action = 'foobuild $TARGETS - $SOURCES',
- suffix = '.foo',
- src_suffix = '.input',
- emitter = modify_targets)
- env = Environment(BUILDERS = {'Foo' : bld})
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- env.Foo('file')
+def modify_targets(target, source, env):
+ target.append('new_target')
+ source.append('new_source')
+ return target, source
+bld = Builder(action = 'foobuild $TARGETS - $SOURCES',
+ suffix = '.foo',
+ src_suffix = '.input',
+ emitter = modify_targets)
+env = Environment(BUILDERS = {'Foo' : bld})
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+env.Foo('file')
</file>
<file name="file.input">
- file.input
+file.input
</file>
<file name="new_source">
- new_source
+new_source
</file>
<file name="foobuild" chmod="0755">
- cat
+cat
</file>
</scons_example>
<sconstruct>
- def modify_targets(target, source, env):
- target.append('new_target')
- source.append('new_source')
- return target, source
- bld = Builder(action = 'foobuild $TARGETS - $SOURCES',
- suffix = '.foo',
- src_suffix = '.input',
- emitter = modify_targets)
- env = Environment(BUILDERS = {'Foo' : bld})
- env.Foo('file')
+def modify_targets(target, source, env):
+ target.append('new_target')
+ source.append('new_source')
+ return target, source
+bld = Builder(action = 'foobuild $TARGETS - $SOURCES',
+ suffix = '.foo',
+ src_suffix = '.input',
+ emitter = modify_targets)
+env = Environment(BUILDERS = {'Foo' : bld})
+env.Foo('file')
</sconstruct>
<para>
@@ -812,57 +812,57 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_MY_EMITTER">
<file name="SConstruct" printme="1">
- bld = Builder(action = 'my_command $SOURCES &gt; $TARGET',
- suffix = '.foo',
- src_suffix = '.input',
- emitter = '$MY_EMITTER')
- def modify1(target, source, env):
- return target, source + ['modify1.in']
- def modify2(target, source, env):
- return target, source + ['modify2.in']
- env1 = Environment(BUILDERS = {'Foo' : bld},
- MY_EMITTER = modify1)
- env2 = Environment(BUILDERS = {'Foo' : bld},
- MY_EMITTER = modify2)
- env1.Foo('file1')
- env2.Foo('file2')
- import os
- env1['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd()
- env2['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd()
+bld = Builder(action = 'my_command $SOURCES &gt; $TARGET',
+ suffix = '.foo',
+ src_suffix = '.input',
+ emitter = '$MY_EMITTER')
+def modify1(target, source, env):
+ return target, source + ['modify1.in']
+def modify2(target, source, env):
+ return target, source + ['modify2.in']
+env1 = Environment(BUILDERS = {'Foo' : bld},
+ MY_EMITTER = modify1)
+env2 = Environment(BUILDERS = {'Foo' : bld},
+ MY_EMITTER = modify2)
+env1.Foo('file1')
+env2.Foo('file2')
+import os
+env1['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd()
+env2['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd()
</file>
<file name="file1.input">
- file1.input
+file1.input
</file>
<file name="file2.input">
- file2.input
+file2.input
</file>
<file name="modify1.in">
- modify1.input
+modify1.input
</file>
<file name="modify2.in">
- modify2.input
+modify2.input
</file>
<file name="my_command" chmod="0755">
- cat
+cat
</file>
</scons_example>
<sconstruct>
- bld = Builder(action = 'my_command $SOURCES &gt; $TARGET',
- suffix = '.foo',
- src_suffix = '.input',
- emitter = '$MY_EMITTER')
- def modify1(target, source, env):
- return target, source + ['modify1.in']
- def modify2(target, source, env):
- return target, source + ['modify2.in']
- env1 = Environment(BUILDERS = {'Foo' : bld},
- MY_EMITTER = modify1)
- env2 = Environment(BUILDERS = {'Foo' : bld},
- MY_EMITTER = modify2)
- env1.Foo('file1')
- env2.Foo('file2')
+bld = Builder(action = 'my_command $SOURCES &gt; $TARGET',
+ suffix = '.foo',
+ src_suffix = '.input',
+ emitter = '$MY_EMITTER')
+def modify1(target, source, env):
+ return target, source + ['modify1.in']
+def modify2(target, source, env):
+ return target, source + ['modify2.in']
+env1 = Environment(BUILDERS = {'Foo' : bld},
+ MY_EMITTER = modify1)
+env2 = Environment(BUILDERS = {'Foo' : bld},
+ MY_EMITTER = modify2)
+env1.Foo('file1')
+env2.Foo('file2')
</sconstruct>
<para>
@@ -962,19 +962,19 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_site1">
<file name="site_scons/site_init.py" printme="1">
- def TOOL_ADD_HEADER(env):
- """A Tool to add a header from $HEADER to the source file"""
- add_header = Builder(action=['echo "$HEADER" &gt; $TARGET',
- 'cat $SOURCE &gt;&gt; $TARGET'])
- env.Append(BUILDERS = {'AddHeader' : add_header})
- env['HEADER'] = '' # set default value
+def TOOL_ADD_HEADER(env):
+ """A Tool to add a header from $HEADER to the source file"""
+ add_header = Builder(action=['echo "$HEADER" &gt; $TARGET',
+ 'cat $SOURCE &gt;&gt; $TARGET'])
+ env.Append(BUILDERS = {'AddHeader' : add_header})
+ env['HEADER'] = '' # set default value
</file>
<file name="SConstruct">
- env=Environment(tools=['default', TOOL_ADD_HEADER], HEADER="=====")
- env.AddHeader('tgt', 'src')
+env=Environment(tools=['default', TOOL_ADD_HEADER], HEADER="=====")
+env.AddHeader('tgt', 'src')
</file>
<file name="src">
- hi there
+hi there
</file>
</scons_example>
@@ -985,9 +985,9 @@ This functionality could be invoked as in the following example:
</para>
<sconstruct>
- # Use TOOL_ADD_HEADER from site_scons/site_init.py
- env=Environment(tools=['default', TOOL_ADD_HEADER], HEADER="=====")
- env.AddHeader('tgt', 'src')
+# Use TOOL_ADD_HEADER from site_scons/site_init.py
+env=Environment(tools=['default', TOOL_ADD_HEADER], HEADER="=====")
+env.AddHeader('tgt', 'src')
</sconstruct>
<para>
@@ -1036,18 +1036,18 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_site2">
<file name="site_scons/my_utils.py" printme="1">
- from SCons.Script import * # for Execute and Mkdir
- def build_id():
- """Return a build ID (stub version)"""
- return "100"
- def MakeWorkDir(workdir):
- """Create the specified dir immediately"""
- Execute(Mkdir(workdir))
+from SCons.Script import * # for Execute and Mkdir
+def build_id():
+ """Return a build ID (stub version)"""
+ return "100"
+def MakeWorkDir(workdir):
+ """Create the specified dir immediately"""
+ Execute(Mkdir(workdir))
</file>
<file name="SConscript">
- import my_utils
- MakeWorkDir('/tmp/work')
- print "build_id=" + my_utils.build_id()
+import my_utils
+MakeWorkDir('/tmp/work')
+print "build_id=" + my_utils.build_id()
</file>
</scons_example>
@@ -1059,9 +1059,9 @@ This functionality could be invoked as in the following example:
</para>
<sconstruct>
- import my_utils
- print "build_id=" + my_utils.build_id()
- my_utils.MakeWorkDir('/tmp/work')
+import my_utils
+print "build_id=" + my_utils.build_id()
+my_utils.MakeWorkDir('/tmp/work')
</sconstruct>
<para>
@@ -1074,7 +1074,7 @@ This functionality could be invoked as in the following example:
than a &SConstruct; or &SConscript; you always need to do
</para>
<sconstruct>
- from SCons.Script import *
+from SCons.Script import *
</sconstruct>
<para>
@@ -1112,12 +1112,12 @@ This functionality could be invoked as in the following example:
<scons_example name="builderswriting_ex8">
<file name="SConstruct" printme="1">
- env = Environment()
- #env.SourceCode('.', env.BitKeeper('my_command'))
- env.Program('hello.c')
+env = Environment()
+#env.SourceCode('.', env.BitKeeper('my_command'))
+env.Program('hello.c')
</file>
<file name="hello.c">
- hello.c
+hello.c
</file>
</scons_example>
diff --git a/doc/user/caching.xml b/doc/user/caching.xml
index 4e6dcf5a..9c66c318 100644
--- a/doc/user/caching.xml
+++ b/doc/user/caching.xml
@@ -67,17 +67,17 @@
<scons_example name="caching_ex1">
<file name="SConstruct">
- env = Environment()
- env.Program('hello.c')
- CacheDir('cache')
+env = Environment()
+env.Program('hello.c')
+CacheDir('cache')
</file>
<file name="hello.c">
- hello.c
+hello.c
</file>
<directory name="cache">
</directory>
<file name="not_used" printme="1">
- CacheDir('/usr/local/build_cache')
+CacheDir('/usr/local/build_cache')
</file>
</scons_example>
@@ -205,14 +205,14 @@
<scons_example name="ex-NoCache">
<file name="SConstruct" printme="1">
- env = Environment()
- obj = env.Object('hello.c')
- env.Program('hello.c')
- CacheDir('cache')
- NoCache('hello.o')
+env = Environment()
+obj = env.Object('hello.c')
+env.Program('hello.c')
+CacheDir('cache')
+NoCache('hello.o')
</file>
<file name="hello.c">
- hello.c
+hello.c
</file>
<directory name="cache">
</directory>
@@ -241,15 +241,15 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- cc -o hello.o -c hello.c
- cc -o hello hello.o
- % <userinput>scons -Q -c</userinput>
- Removed hello.o
- Removed hello
- % <userinput>scons -Q</userinput>
- cc -o hello.o -c hello.c
- Retrieved `hello' from cache
+% <userinput>scons -Q</userinput>
+cc -o hello.o -c hello.c
+cc -o hello hello.o
+% <userinput>scons -Q -c</userinput>
+Removed hello.o
+Removed hello
+% <userinput>scons -Q</userinput>
+cc -o hello.o -c hello.c
+Retrieved `hello' from cache
</screen>
</section>
@@ -367,8 +367,8 @@
<scons_example name="caching_ex-random">
<file name="SConstruct" printme="1">
- Program('prog',
- ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c'])
+Program('prog',
+ ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c'])
</file>
<file name="f1.c">f1.c</file>
<file name="f2.c">f2.c</file>
@@ -424,20 +424,20 @@
<scons_output_command>scons -Q - -random</scons_output_command>
</scons_output>
- We captured it directly here to guarantee a "random" order,
- guarding against the potential for - -random to happen
- to return things in the original sorted order.
+We captured it directly here to guarantee a "random" order,
+guarding against the potential for - -random to happen
+to return things in the original sorted order.
- -->
+-->
<screen>
- % <userinput>scons -Q --random</userinput>
- cc -o f3.o -c f3.c
- cc -o f1.o -c f1.c
- cc -o f5.o -c f5.c
- cc -o f2.o -c f2.c
- cc -o f4.o -c f4.c
- cc -o prog f1.o f2.o f3.o f4.o f5.o
+ % <userinput>scons -Q --random</userinput>
+ cc -o f3.o -c f3.c
+ cc -o f1.o -c f1.c
+ cc -o f5.o -c f5.c
+ cc -o f2.o -c f2.c
+ cc -o f4.o -c f4.c
+ cc -o prog f1.o f2.o f3.o f4.o f5.o
</screen>
<para>
@@ -479,9 +479,9 @@
<scons_example name="caching_ex-random">
<file name="SConstruct" printme="1">
- SetOption('random', 1)
- Program('prog',
- ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c'])
+SetOption('random', 1)
+Program('prog',
+ ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c'])
</file>
<file name="f1.c">f1.c</file>
<file name="f2.c">f2.c</file>
diff --git a/doc/user/chtml.xsl b/doc/user/chtml.xsl
index fa01b464..e292c88e 100644
--- a/doc/user/chtml.xsl
+++ b/doc/user/chtml.xsl
@@ -52,5 +52,9 @@ reference toc,title
set toc,title
</xsl:param>
+<!-- Prevent our EPUB cover image from getting included -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
</xsl:stylesheet>
diff --git a/doc/user/command-line.xml b/doc/user/command-line.xml
index a167ecac..f410b3ee 100644
--- a/doc/user/command-line.xml
+++ b/doc/user/command-line.xml
@@ -170,16 +170,16 @@
<scons_example name="commandline_SCONSFLAGS">
<file name="SConstruct">
- def b(target, source, env):
- pass
- def s(target, source, env):
- return " ... [build output] ..."
- a = Action(b, strfunction = s)
- env = Environment(BUILDERS = {'A' : Builder(action=a)})
- env.A('foo.out', 'foo.in')
+def b(target, source, env):
+ pass
+def s(target, source, env):
+ return " ... [build output] ..."
+a = Action(b, strfunction = s)
+env = Environment(BUILDERS = {'A' : Builder(action=a)})
+env.A('foo.out', 'foo.in')
</file>
<file name="foo.in">
- foo.in
+foo.in
</file>
</scons_example>
@@ -197,7 +197,7 @@
</para>
<screen>
- $ <userinput>setenv SCONSFLAGS "-Q"</userinput>
+$ <userinput>setenv SCONSFLAGS "-Q"</userinput>
</screen>
<para>
@@ -244,8 +244,8 @@
</para>
<sconstruct>
- if not GetOption('help'):
- SConscript('src/SConscript', export='env')
+if not GetOption('help'):
+ SConscript('src/SConscript', export='env')
</sconstruct>
<para>
@@ -314,13 +314,13 @@
<scons_example name="commandline_SetOption">
<file name="SConstruct" printme="1">
- import os
- num_cpu = int(os.environ.get('NUM_CPU', 2))
- SetOption('num_jobs', num_cpu)
- print "running with -j", GetOption('num_jobs')
+import os
+num_cpu = int(os.environ.get('NUM_CPU', 2))
+SetOption('num_jobs', num_cpu)
+print "running with -j", GetOption('num_jobs')
</file>
<file name="foo.in">
- foo.in
+foo.in
</file>
</scons_example>
@@ -628,21 +628,21 @@
<scons_example name="commandline_AddOption">
<file name="SConstruct" printme="1">
- AddOption('--prefix',
- dest='prefix',
- type='string',
- nargs=1,
- action='store',
- metavar='DIR',
- help='installation prefix')
-
- env = Environment(PREFIX = GetOption('prefix'))
-
- installed_foo = env.Install('$PREFIX/usr/bin', 'foo.in')
- Default(installed_foo)
+AddOption('--prefix',
+ dest='prefix',
+ type='string',
+ nargs=1,
+ action='store',
+ metavar='DIR',
+ help='installation prefix')
+
+env = Environment(PREFIX = GetOption('prefix'))
+
+installed_foo = env.Install('$PREFIX/usr/bin', 'foo.in')
+Default(installed_foo)
</file>
<file name="foo.in">
- foo.in
+foo.in
</file>
</scons_example>
@@ -699,7 +699,7 @@
</para>
<screen>
- % <userinput>scons -Q debug=1</userinput>
+% <userinput>scons -Q debug=1</userinput>
</screen>
<para>
@@ -733,14 +733,14 @@
<scons_example name="commandline_ARGUMENTS">
<file name="SConstruct" printme="1">
- env = Environment()
- debug = ARGUMENTS.get('debug', 0)
- if int(debug):
- env.Append(CCFLAGS = '-g')
- env.Program('prog.c')
+env = Environment()
+debug = ARGUMENTS.get('debug', 0)
+if int(debug):
+ env.Append(CCFLAGS = '-g')
+env.Program('prog.c')
</file>
<file name="prog.c">
- prog.c
+prog.c
</file>
</scons_example>
@@ -822,15 +822,15 @@
<scons_example name="commandline_ARGLIST">
<file name="SConstruct" printme="1">
- cppdefines = []
- for key, value in ARGLIST:
- if key == 'define':
- cppdefines.append(value)
- env = Environment(CPPDEFINES = cppdefines)
- env.Object('prog.c')
+cppdefines = []
+for key, value in ARGLIST:
+ if key == 'define':
+ cppdefines.append(value)
+env = Environment(CPPDEFINES = cppdefines)
+env.Object('prog.c')
</file>
<file name="prog.c">
- prog.c
+prog.c
</file>
</scons_example>
@@ -907,17 +907,17 @@
<scons_example name="commandline_Variables1">
<file name="SConstruct" printme="1">
- vars = Variables(None, ARGUMENTS)
- vars.Add('RELEASE', 'Set to 1 to build for release', 0)
- env = Environment(variables = vars,
- CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
- env.Program(['foo.c', 'bar.c'])
+vars = Variables(None, ARGUMENTS)
+vars.Add('RELEASE', 'Set to 1 to build for release', 0)
+env = Environment(variables = vars,
+ CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
+env.Program(['foo.c', 'bar.c'])
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="bar.c">
- bar.c
+bar.c
</file>
</scons_example>
@@ -998,10 +998,10 @@
<scons_example name="commandline_Variables_Help">
<file name="SConstruct" printme="1">
- vars = Variables(None, ARGUMENTS)
- vars.Add('RELEASE', 'Set to 1 to build for release', 0)
- env = Environment(variables = vars)
- Help(vars.GenerateHelpText(env))
+vars = Variables(None, ARGUMENTS)
+vars.Add('RELEASE', 'Set to 1 to build for release', 0)
+env = Environment(variables = vars)
+Help(vars.GenerateHelpText(env))
</file>
</scons_example>
@@ -1045,21 +1045,21 @@
<scons_example name="commandline_Variables_custom_py_1">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add('RELEASE', 'Set to 1 to build for release', 0)
- env = Environment(variables = vars,
- CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
- env.Program(['foo.c', 'bar.c'])
- Help(vars.GenerateHelpText(env))
+vars = Variables('custom.py')
+vars.Add('RELEASE', 'Set to 1 to build for release', 0)
+env = Environment(variables = vars,
+ CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
+env.Program(['foo.c', 'bar.c'])
+Help(vars.GenerateHelpText(env))
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="bar.c">
- bar.c
+bar.c
</file>
<file name="custom.py">
- RELEASE = 1
+RELEASE = 1
</file>
</scons_example>
@@ -1092,21 +1092,21 @@
<scons_example name="commandline_Variables_custom_py_2">
<file name="SConstruct">
- vars = Variables('custom.py')
- vars.Add('RELEASE', 'Set to 1 to build for release', 0)
- env = Environment(variables = vars,
- CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
- env.Program(['foo.c', 'bar.c'])
- Help(vars.GenerateHelpText(env))
+ vars = Variables('custom.py')
+ vars.Add('RELEASE', 'Set to 1 to build for release', 0)
+ env = Environment(variables = vars,
+ CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
+ env.Program(['foo.c', 'bar.c'])
+ Help(vars.GenerateHelpText(env))
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="bar.c">
- bar.c
+bar.c
</file>
<file name="custom.py" printme="1">
- RELEASE = 0
+RELEASE = 0
</file>
</scons_example>
@@ -1128,7 +1128,7 @@
</para>
<screen>
- vars = Variables('custom.py', ARGUMENTS)
+vars = Variables('custom.py', ARGUMENTS)
</screen>
<para>
@@ -1182,14 +1182,14 @@
<scons_example name="commandline_BoolVariable">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(BoolVariable('RELEASE', 'Set to build for release', 0))
- env = Environment(variables = vars,
- CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(BoolVariable('RELEASE', 'Set to build for release', 0))
+env = Environment(variables = vars,
+ CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -1286,15 +1286,15 @@
<scons_example name="commandline_EnumVariable">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(EnumVariable('COLOR', 'Set background color', 'red',
- allowed_values=('red', 'green', 'blue')))
- env = Environment(variables = vars,
- CPPDEFINES={'COLOR' : '"${COLOR}"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(EnumVariable('COLOR', 'Set background color', 'red',
+ allowed_values=('red', 'green', 'blue')))
+env = Environment(variables = vars,
+ CPPDEFINES={'COLOR' : '"${COLOR}"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -1340,16 +1340,16 @@
<scons_example name="EnumVariable_map">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(EnumVariable('COLOR', 'Set background color', 'red',
- allowed_values=('red', 'green', 'blue'),
- map={'navy':'blue'}))
- env = Environment(variables = vars,
- CPPDEFINES={'COLOR' : '"${COLOR}"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(EnumVariable('COLOR', 'Set background color', 'red',
+ allowed_values=('red', 'green', 'blue'),
+ map={'navy':'blue'}))
+env = Environment(variables = vars,
+ CPPDEFINES={'COLOR' : '"${COLOR}"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -1395,17 +1395,17 @@
<scons_example name="commandline_EnumVariable_ic1">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(EnumVariable('COLOR', 'Set background color', 'red',
- allowed_values=('red', 'green', 'blue'),
- map={'navy':'blue'},
- ignorecase=1))
- env = Environment(variables = vars,
- CPPDEFINES={'COLOR' : '"${COLOR}"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(EnumVariable('COLOR', 'Set background color', 'red',
+ allowed_values=('red', 'green', 'blue'),
+ map={'navy':'blue'},
+ ignorecase=1))
+env = Environment(variables = vars,
+ CPPDEFINES={'COLOR' : '"${COLOR}"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -1435,17 +1435,17 @@
<scons_example name="commandline_EnumVariable_ic2">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(EnumVariable('COLOR', 'Set background color', 'red',
- allowed_values=('red', 'green', 'blue'),
- map={'navy':'blue'},
- ignorecase=2))
- env = Environment(variables = vars,
- CPPDEFINES={'COLOR' : '"${COLOR}"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(EnumVariable('COLOR', 'Set background color', 'red',
+ allowed_values=('red', 'green', 'blue'),
+ map={'navy':'blue'},
+ ignorecase=2))
+env = Environment(variables = vars,
+ CPPDEFINES={'COLOR' : '"${COLOR}"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -1484,15 +1484,15 @@
<scons_example name="commandline_ListVariable">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(ListVariable('COLORS', 'List of colors', 0,
- ['red', 'green', 'blue']))
- env = Environment(variables = vars,
- CPPDEFINES={'COLORS' : '"${COLORS}"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(ListVariable('COLORS', 'List of colors', 0,
+ ['red', 'green', 'blue']))
+env = Environment(variables = vars,
+ CPPDEFINES={'COLORS' : '"${COLORS}"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -1555,22 +1555,22 @@
<scons_example name="commandline_PathVariable">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(PathVariable('CONFIG',
- 'Path to configuration file',
- '__ROOT__/etc/my_config'))
- env = Environment(variables = vars,
- CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(PathVariable('CONFIG',
+ 'Path to configuration file',
+ '__ROOT__/etc/my_config'))
+env = Environment(variables = vars,
+ CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="__ROOT__/etc/my_config">
- /opt/location
+/opt/location
</file>
<file name="__ROOT__/usr/local/etc/other_config">
- /opt/location
+/opt/location
</file>
</scons_example>
@@ -1611,20 +1611,20 @@
<scons_example name="commandline_PathIsFile">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(PathVariable('CONFIG',
- 'Path to configuration file',
- '__ROOT__/etc/my_config',
- PathVariable.PathIsFile))
- env = Environment(variables = vars,
- CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(PathVariable('CONFIG',
+ 'Path to configuration file',
+ '__ROOT__/etc/my_config',
+ PathVariable.PathIsFile))
+env = Environment(variables = vars,
+ CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="__ROOT__/etc/my_config">
- /opt/location
+/opt/location
</file>
</scons_example>
@@ -1638,20 +1638,20 @@
<scons_example name="commandline_PathIsDir">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(PathVariable('DBDIR',
- 'Path to database directory',
- '__ROOT__/var/my_dbdir',
- PathVariable.PathIsDir))
- env = Environment(variables = vars,
- CPPDEFINES={'DBDIR' : '"$DBDIR"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(PathVariable('DBDIR',
+ 'Path to database directory',
+ '__ROOT__/var/my_dbdir',
+ PathVariable.PathIsDir))
+env = Environment(variables = vars,
+ CPPDEFINES={'DBDIR' : '"$DBDIR"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="__ROOT__/var/my_dbdir">
- /opt/location
+/opt/location
</file>
</scons_example>
@@ -1667,20 +1667,20 @@
<scons_example name="commandline_PathIsDirCreate">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(PathVariable('DBDIR',
- 'Path to database directory',
- '__ROOT__/var/my_dbdir',
- PathVariable.PathIsDirCreate))
- env = Environment(variables = vars,
- CPPDEFINES={'DBDIR' : '"$DBDIR"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(PathVariable('DBDIR',
+ 'Path to database directory',
+ '__ROOT__/var/my_dbdir',
+ PathVariable.PathIsDirCreate))
+env = Environment(variables = vars,
+ CPPDEFINES={'DBDIR' : '"$DBDIR"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="__ROOT__/var/my_dbdir">
- /opt/location
+/opt/location
</file>
</scons_example>
@@ -1695,17 +1695,17 @@
<scons_example name="commandline_PathAccept">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(PathVariable('OUTPUT',
- 'Path to output file or directory',
- None,
- PathVariable.PathAccept))
- env = Environment(variables = vars,
- CPPDEFINES={'OUTPUT' : '"$OUTPUT"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(PathVariable('OUTPUT',
+ 'Path to output file or directory',
+ None,
+ PathVariable.PathAccept))
+env = Environment(variables = vars,
+ CPPDEFINES={'OUTPUT' : '"$OUTPUT"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -1730,22 +1730,22 @@
<scons_example name="commandline_PackageVariable">
<file name="SConstruct" printme="1">
- vars = Variables('custom.py')
- vars.Add(PackageVariable('PACKAGE',
- 'Location package',
- '__ROOT__/opt/location'))
- env = Environment(variables = vars,
- CPPDEFINES={'PACKAGE' : '"$PACKAGE"'})
- env.Program('foo.c')
+vars = Variables('custom.py')
+vars.Add(PackageVariable('PACKAGE',
+ 'Location package',
+ '__ROOT__/opt/location'))
+env = Environment(variables = vars,
+ CPPDEFINES={'PACKAGE' : '"$PACKAGE"'})
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="__ROOT__/opt/location">
- /opt/location
+/opt/location
</file>
<file name="__ROOT__/usr/local/location">
- /opt/location
+/opt/location
</file>
</scons_example>
@@ -1796,23 +1796,23 @@
<scons_example name="commandline_AddVariables_1">
<file name="SConstruct" printme="1">
- vars = Variables()
- vars.AddVariables(
- ('RELEASE', 'Set to 1 to build for release', 0),
- ('CONFIG', 'Configuration file', '/etc/my_config'),
- BoolVariable('warnings', 'compilation with -Wall and similiar', 1),
- EnumVariable('debug', 'debug output and symbols', 'no',
- allowed_values=('yes', 'no', 'full'),
- map={}, ignorecase=0), # case sensitive
- ListVariable('shared',
- 'libraries to build as shared libraries',
- 'all',
- names = list_of_libs),
- PackageVariable('x11',
- 'use X11 installed here (yes = search some places)',
- 'yes'),
- PathVariable('qtdir', 'where the root of Qt is installed', qtdir),
- )
+vars = Variables()
+vars.AddVariables(
+ ('RELEASE', 'Set to 1 to build for release', 0),
+ ('CONFIG', 'Configuration file', '/etc/my_config'),
+ BoolVariable('warnings', 'compilation with -Wall and similiar', 1),
+ EnumVariable('debug', 'debug output and symbols', 'no',
+ allowed_values=('yes', 'no', 'full'),
+ map={}, ignorecase=0), # case sensitive
+ ListVariable('shared',
+ 'libraries to build as shared libraries',
+ 'all',
+ names = list_of_libs),
+ PackageVariable('x11',
+ 'use X11 installed here (yes = search some places)',
+ 'yes'),
+ PathVariable('qtdir', 'where the root of Qt is installed', qtdir),
+)
</file>
</scons_example>
@@ -1857,18 +1857,18 @@
<scons_example name="commandline_UnknownVariables">
<file name="SConstruct" printme="1">
- vars = Variables(None)
- vars.Add('RELEASE', 'Set to 1 to build for release', 0)
- env = Environment(variables = vars,
- CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
- unknown = vars.UnknownVariables()
- if unknown:
- print "Unknown variables:", unknown.keys()
- Exit(1)
- env.Program('foo.c')
+vars = Variables(None)
+vars.Add('RELEASE', 'Set to 1 to build for release', 0)
+env = Environment(variables = vars,
+ CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
+unknown = vars.UnknownVariables()
+if unknown:
+ print "Unknown variables:", unknown.keys()
+ Exit(1)
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -1944,16 +1944,16 @@
<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!"
- Default(Program('foo.c'))
- Program('bar.c')
+if 'bar' in COMMAND_LINE_TARGETS:
+ print "Don't forget to copy `bar' to the archive!"
+Default(Program('foo.c'))
+Program('bar.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
<file name="bar.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -2006,16 +2006,16 @@
<scons_example name="commandline_Default1">
<file name="SConstruct" printme="1">
- env = Environment()
- hello = env.Program('hello.c')
- env.Program('goodbye.c')
- Default(hello)
+env = Environment()
+hello = env.Program('hello.c')
+env.Program('goodbye.c')
+Default(hello)
</file>
<file name="hello.c">
- hello.c
+hello.c
</file>
<file name="goodbye.c">
- goodbye.c
+goodbye.c
</file>
</scons_example>
@@ -2060,21 +2060,21 @@
<scons_example name="commandline_Default2">
<file name="SConstruct" printme="1">
- env = Environment()
- prog1 = env.Program('prog1.c')
- Default(prog1)
- prog2 = env.Program('prog2.c')
- prog3 = env.Program('prog3.c')
- Default(prog3)
+env = Environment()
+prog1 = env.Program('prog1.c')
+Default(prog1)
+prog2 = env.Program('prog2.c')
+prog3 = env.Program('prog3.c')
+Default(prog3)
</file>
<file name="prog1.c">
- prog1.c
+prog1.c
</file>
<file name="prog2.c">
- prog2.c
+prog2.c
</file>
<file name="prog3.c">
- prog3.c
+prog3.c
</file>
</scons_example>
@@ -2086,11 +2086,11 @@
</para>
<programlisting>
- env = Environment()
- prog1 = env.Program('prog1.c')
- prog2 = env.Program('prog2.c')
- prog3 = env.Program('prog3.c')
- Default(prog1, prog3)
+env = Environment()
+prog1 = env.Program('prog1.c')
+prog2 = env.Program('prog2.c')
+prog3 = env.Program('prog3.c')
+Default(prog1, prog3)
</programlisting>
<para>
@@ -2118,24 +2118,24 @@
<scons_example name="commandline_Default3">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Program(['prog1/main.c', 'prog1/foo.c'])
- env.Program(['prog2/main.c', 'prog2/bar.c'])
- Default('prog1')
+env = Environment()
+env.Program(['prog1/main.c', 'prog1/foo.c'])
+env.Program(['prog2/main.c', 'prog2/bar.c'])
+Default('prog1')
</file>
<directory name="prog1"></directory>
<directory name="prog2"></directory>
<file name="prog1/main.c">
- int main() { printf("prog1/main.c\n"); }
+int main() { printf("prog1/main.c\n"); }
</file>
<file name="prog1/foo.c">
- int foo() { printf("prog1/foo.c\n"); }
+int foo() { printf("prog1/foo.c\n"); }
</file>
<file name="prog2/main.c">
- int main() { printf("prog2/main.c\n"); }
+int main() { printf("prog2/main.c\n"); }
</file>
<file name="prog2/bar.c">
- int bar() { printf("prog2/bar.c\n"); }
+int bar() { printf("prog2/bar.c\n"); }
</file>
</scons_example>
@@ -2163,16 +2163,16 @@
<scons_example name="commandline_Default4">
<file name="SConstruct" printme="1">
- env = Environment()
- prog1 = env.Program('prog1.c')
- prog2 = env.Program('prog2.c')
- Default(None)
+env = Environment()
+prog1 = env.Program('prog1.c')
+prog2 = env.Program('prog2.c')
+Default(None)
</file>
<file name="prog1.c">
- prog1.c
+prog1.c
</file>
<file name="prog2.c">
- prog2.c
+prog2.c
</file>
</scons_example>
@@ -2208,12 +2208,12 @@
<scons_example name="commandline_DEFAULT_TARGETS_1">
<file name="SConstruct" printme="1">
- prog1 = Program('prog1.c')
- Default(prog1)
- print "DEFAULT_TARGETS is", map(str, DEFAULT_TARGETS)
+prog1 = Program('prog1.c')
+Default(prog1)
+print "DEFAULT_TARGETS is", map(str, DEFAULT_TARGETS)
</file>
<file name="prog1.c">
- prog1.c
+prog1.c
</file>
</scons_example>
@@ -2242,18 +2242,18 @@
<scons_example name="commandline_DEFAULT_TARGETS_2">
<file name="SConstruct" printme="1">
- prog1 = Program('prog1.c')
- Default(prog1)
- print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS)
- prog2 = Program('prog2.c')
- Default(prog2)
- print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS)
+prog1 = Program('prog1.c')
+Default(prog1)
+print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS)
+prog2 = Program('prog2.c')
+Default(prog2)
+print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS)
</file>
<file name="prog1.c">
- prog1.c
+prog1.c
</file>
<file name="prog2.c">
- prog2.c
+prog2.c
</file>
</scons_example>
@@ -2304,10 +2304,10 @@
</para>
<sconstruct>
- if COMMAND_LINE_TARGETS:
- targets = COMMAND_LINE_TARGETS
- else:
- targets = DEFAULT_TARGETS
+if COMMAND_LINE_TARGETS:
+ targets = COMMAND_LINE_TARGETS
+else:
+ targets = DEFAULT_TARGETS
</sconstruct>
<para>
@@ -2335,16 +2335,16 @@
<scons_example name="commandline_BUILD_TARGETS_1">
<file name="SConstruct" printme="1">
- prog1 = Program('prog1.c')
- Program('prog2.c')
- Default(prog1)
- print "BUILD_TARGETS is", map(str, BUILD_TARGETS)
+prog1 = Program('prog1.c')
+Program('prog2.c')
+Default(prog1)
+print "BUILD_TARGETS is", map(str, BUILD_TARGETS)
</file>
<file name="prog1.c">
- prog1.c
+prog1.c
</file>
<file name="prog2.c">
- prog2.c
+prog2.c
</file>
</scons_example>
diff --git a/doc/user/cover.jpg b/doc/user/cover.jpg
new file mode 100644
index 00000000..e2c2cb39
--- /dev/null
+++ b/doc/user/cover.jpg
Binary files differ
diff --git a/doc/user/depends.xml b/doc/user/depends.xml
index d252544d..a5639a19 100644
--- a/doc/user/depends.xml
+++ b/doc/user/depends.xml
@@ -60,11 +60,11 @@
<scons_example name="depends_ex1">
<file name="SConstruct">
- Program('hello.c')
+Program('hello.c')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
- </file>
+int main() { printf("Hello, world!\n"); }
+</file>
</scons_example>
<scons_output example="depends_ex1" os="posix" suffix="1">
@@ -173,8 +173,8 @@
</para>
<sconstruct>
- Program('hello.c')
- Decider('MD5')
+Program('hello.c')
+Decider('MD5')
</sconstruct>
<para>
@@ -270,11 +270,11 @@
<scons_example name="depends_newer">
<file name="SConstruct" printme="1">
- Object('hello.c')
- Decider('timestamp-newer')
+Object('hello.c')
+Decider('timestamp-newer')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -303,8 +303,8 @@
</para>
<sconstruct>
- Object('hello.c')
- Decider('make')
+Object('hello.c')
+Decider('make')
</sconstruct>
<para>
@@ -339,11 +339,11 @@
<scons_example name="depends_match">
<file name="SConstruct" printme="1">
- Object('hello.c')
- Decider('timestamp-match')
+Object('hello.c')
+Decider('timestamp-match')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -398,11 +398,11 @@
<scons_example name="depends_MD5-timestamp">
<file name="SConstruct" printme="1">
- Program('hello.c')
- Decider('MD5-timestamp')
+Program('hello.c')
+Decider('MD5-timestamp')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -431,17 +431,17 @@
-->
<screen>
- % <userinput>scons -Q hello</userinput>
- cc -o hello.o -c hello.c
- cc -o hello hello.o
- % <userinput>touch hello.c</userinput>
- % <userinput>scons -Q hello</userinput>
- scons: `hello' is up to date.
- % <userinput>edit hello.c</userinput>
- [CHANGE THE CONTENTS OF hello.c]
- % <userinput>scons -Q hello</userinput>
- cc -o hello.o -c hello.c
- cc -o hello hello.o
+% <userinput>scons -Q hello</userinput>
+cc -o hello.o -c hello.c
+cc -o hello hello.o
+% <userinput>touch hello.c</userinput>
+% <userinput>scons -Q hello</userinput>
+scons: `hello' is up to date.
+% <userinput>edit hello.c</userinput>
+ [CHANGE THE CONTENTS OF hello.c]
+% <userinput>scons -Q hello</userinput>
+cc -o hello.o -c hello.c
+cc -o hello hello.o
</screen>
<para>
@@ -516,18 +516,18 @@
<scons_example name="depends_function">
<file name="SConstruct" printme="1">
- Program('hello.c')
- def decide_if_changed(dependency, target, prev_ni):
- if self.get_timestamp() != prev_ni.timestamp:
- dep = str(dependency)
- tgt = str(target)
- if specific_part_of_file_has_changed(dep, tgt):
- return True
- return False
- Decider(decide_if_changed)
+Program('hello.c')
+def decide_if_changed(dependency, target, prev_ni):
+ if self.get_timestamp() != prev_ni.timestamp:
+ dep = str(dependency)
+ tgt = str(target)
+ if specific_part_of_file_has_changed(dep, tgt):
+ return True
+ return False
+Decider(decide_if_changed)
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -635,35 +635,35 @@
</para>
<sconstruct>
- env = Environment()
-
- def config_file_decider(dependency, target, prev_ni):
- import os.path
-
- # We always have to init the .csig value...
- dep_csig = dependency.get_csig()
- # .csig may not exist, because no target was built yet...
- if 'csig' not in dir(prev_ni):
- return True
- # Target file may not exist yet
- if not os.path.exists(str(target.abspath)):
- return True
- if dep_csig != prev_ni.csig:
- # Some change on source file => update installed one
- return True
- return False
-
- def update_file():
- f = open("test.txt","a")
- f.write("some line\n")
- f.close()
-
- update_file()
-
- # Activate our own decider function
- env.Decider(config_file_decider)
-
- env.Install("install","test.txt")
+env = Environment()
+
+def config_file_decider(dependency, target, prev_ni):
+ import os.path
+
+ # We always have to init the .csig value...
+ dep_csig = dependency.get_csig()
+ # .csig may not exist, because no target was built yet...
+ if 'csig' not in dir(prev_ni):
+ return True
+ # Target file may not exist yet
+ if not os.path.exists(str(target.abspath)):
+ return True
+ if dep_csig != prev_ni.csig:
+ # Some change on source file => update installed one
+ return True
+ return False
+
+def update_file():
+ f = open("test.txt","a")
+ f.write("some line\n")
+ f.close()
+
+update_file()
+
+# Activate our own decider function
+env.Decider(config_file_decider)
+
+env.Install("install","test.txt")
</sconstruct>
</section>
@@ -698,22 +698,22 @@
<scons_example name="depends_mixing">
<file name="SConstruct" printme="1">
- env1 = Environment(CPPPATH = ['.'])
- env2 = env1.Clone()
- env2.Decider('timestamp-match')
- env1.Program('prog-MD5', 'program1.c')
- env2.Program('prog-timestamp', 'program2.c')
+env1 = Environment(CPPPATH = ['.'])
+env2 = env1.Clone()
+env2.Decider('timestamp-match')
+env1.Program('prog-MD5', 'program1.c')
+env2.Program('prog-timestamp', 'program2.c')
</file>
<file name="program1.c">
- #include "inc.h"
- int main() { printf("Hello, world!\n"); }
+#include "inc.h"
+int main() { printf("Hello, world!\n"); }
</file>
<file name="program2.c">
- #include "inc.h"
- int main() { printf("Hello, world!\n"); }
+#include "inc.h"
+int main() { printf("Hello, world!\n"); }
</file>
<file name="inc.h">
- #define INC 1
+#define INC 1
</file>
</scons_example>
@@ -771,8 +771,8 @@
</para>
<sconstruct>
- Program('hello.c')
- SourceSignatures('MD5')
+Program('hello.c')
+SourceSignatures('MD5')
</sconstruct>
<para>
@@ -782,8 +782,8 @@
</para>
<sconstruct>
- Program('hello.c')
- SourceSignatures('timestamp')
+Program('hello.c')
+SourceSignatures('timestamp')
</sconstruct>
<para>
@@ -839,8 +839,8 @@
</para>
<sconstruct>
- Program('hello.c')
- TargetSignatures('MD5')
+Program('hello.c')
+TargetSignatures('MD5')
</sconstruct>
<para>
@@ -853,8 +853,8 @@
</para>
<sconstruct>
- Program('hello.c')
- TargetSignatures('timestamp')
+Program('hello.c')
+TargetSignatures('timestamp')
</sconstruct>
<para>
@@ -882,9 +882,9 @@
</para>
<sconstruct>
- Program('hello.c')
- TargetSignatures('source')
- SourceSignatures('timestamp')
+Program('hello.c')
+TargetSignatures('source')
+SourceSignatures('timestamp')
</sconstruct>
<para>
@@ -949,18 +949,18 @@
<scons_example name="depends_include">
<file name="SConstruct">
- Program('hello.c', CPPPATH = '.')
+Program('hello.c', CPPPATH = '.')
</file>
<file name="hello.c" printme="1">
- #include &lt;hello.h&gt;
- int
- main()
- {
- printf("Hello, %s!\n", string);
- }
+#include &lt;hello.h&gt;
+int
+main()
+{
+ printf("Hello, %s!\n", string);
+}
</file>
<file name="hello.h">
- #define string "world"
+#define string "world"
</file>
</scons_example>
@@ -1049,10 +1049,10 @@
<scons_example name="depends_ex5">
<file name="SConstruct" printme="1">
- Program('hello.c', CPPPATH = ['include', '/home/project/inc'])
+Program('hello.c', CPPPATH = ['include', '/home/project/inc'])
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -1142,7 +1142,7 @@
</para>
<sconstruct>
- SetOption('implicit_cache', 1)
+SetOption('implicit_cache', 1)
</sconstruct>
<para>
@@ -1291,23 +1291,23 @@
</para>
<programlisting>
- hello = Program('hello.c')
- Depends(hello, 'other_file')
+hello = Program('hello.c')
+Depends(hello, 'other_file')
</programlisting>
<!-- XXX mention that you can use arrays for target and source? -->
<screen>
- % <userinput>scons -Q hello</userinput>
- cc -c hello.c -o hello.o
- cc -o hello hello.o
- % <userinput>scons -Q hello</userinput>
- scons: `hello' is up to date.
- % <userinput>edit other_file</userinput>
- [CHANGE THE CONTENTS OF other_file]
- % <userinput>scons -Q hello</userinput>
- cc -c hello.c -o hello.o
- cc -o hello hello.o
+% <userinput>scons -Q hello</userinput>
+cc -c hello.c -o hello.o
+cc -o hello hello.o
+% <userinput>scons -Q hello</userinput>
+scons: `hello' is up to date.
+% <userinput>edit other_file</userinput>
+ [CHANGE THE CONTENTS OF other_file]
+% <userinput>scons -Q hello</userinput>
+cc -c hello.c -o hello.o
+cc -o hello hello.o
</screen>
<para>
@@ -1320,9 +1320,9 @@
</para>
<programlisting>
- hello = Program('hello.c')
- goodbye = Program('goodbye.c')
- Depends(hello, goodbye)
+hello = Program('hello.c')
+goodbye = Program('goodbye.c')
+Depends(hello, goodbye)
</programlisting>
<para>
@@ -1333,11 +1333,11 @@
</para>
<screen>
- % <userinput>scons -Q hello</userinput>
- cc -c goodbye.c -o goodbye.o
- cc -o goodbye goodbye.o
- cc -c hello.c -o hello.o
- cc -o hello hello.o
+% <userinput>scons -Q hello</userinput>
+cc -c goodbye.c -o goodbye.o
+cc -o goodbye goodbye.o
+cc -c hello.c -o hello.o
+cc -o hello hello.o
</screen>
</section>
@@ -1364,18 +1364,18 @@
<scons_example name="depends_macroinc">
<file name="hello.c" printme="1">
- #define FOO_HEADER &lt;foo.h&gt;
- #include FOO_HEADER
+#define FOO_HEADER &lt;foo.h&gt;
+#include FOO_HEADER
- int main() {
- return FOO;
- }
+int main() {
+ return FOO;
+}
</file>
<file name="SConstruct">
- Program('hello', 'hello.c', CPPPATH='.')
+Program('hello', 'hello.c', CPPPATH='.')
</file>
<file name="foo.h">
- #define FOO 42
+#define FOO 42
</file>
</scons_example>
@@ -1416,24 +1416,24 @@
<scons_example name="depends_parsedep">
<file name="hello.c">
- #define FOO_HEADER &lt;foo.h&gt;
- #include FOO_HEADER
+#define FOO_HEADER &lt;foo.h&gt;
+#include FOO_HEADER
- int main() {
- return FOO;
- }
+int main() {
+ return FOO;
+}
</file>
<file name="SConstruct" printme="1">
- obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.')
- SideEffect('hello.d', obj)
- ParseDepends('hello.d')
- Program('hello', obj)
+obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.')
+SideEffect('hello.d', obj)
+ParseDepends('hello.d')
+Program('hello', obj)
</file>
<file name="foo.h">
- #define FOO 42
+#define FOO 42
</file>
<file name="hello.d">
- hello.o: hello.c foo.h
+hello.o: hello.c foo.h
</file>
</scons_example>
@@ -1453,21 +1453,21 @@
<scons_example name="depends_parsedeprebuild">
<file name="hello.c">
- #define FOO_HEADER &lt;foo.h&gt;
- #include FOO_HEADER
+#define FOO_HEADER &lt;foo.h&gt;
+#include FOO_HEADER
- int main() {
- return FOO;
- }
+int main() {
+ return FOO;
+}
</file>
<file name="SConstruct">
- obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.')
- SideEffect('hello.d', obj)
- ParseDepends('hello.d')
- Program('hello', obj)
+obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.')
+SideEffect('hello.d', obj)
+ParseDepends('hello.d')
+Program('hello', obj)
</file>
<file name="foo.h">
- #define FOO 42
+#define FOO 42
</file>
</scons_example>
@@ -1480,14 +1480,14 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- cc -o hello.o -c -MD -MF hello.d -I. hello.c
- cc -o hello hello.o
- % <userinput>scons -Q --debug=explain</userinput>
- scons: rebuilding `hello.o' because `foo.h' is a new dependency
- cc -o hello.o -c -MD -MF hello.d -I. hello.c
- % <userinput>scons -Q</userinput>
- scons: `.' is up to date.
+% <userinput>scons -Q</userinput>
+cc -o hello.o -c -MD -MF hello.d -I. hello.c
+cc -o hello hello.o
+% <userinput>scons -Q --debug=explain</userinput>
+scons: rebuilding `hello.o' because `foo.h' is a new dependency
+cc -o hello.o -c -MD -MF hello.d -I. hello.c
+% <userinput>scons -Q</userinput>
+scons: `.' is up to date.
</screen>
<para>
@@ -1532,16 +1532,16 @@
<scons_example name="depends_ignore">
<file name="SConstruct" printme="1">
- hello_obj=Object('hello.c')
- hello = Program(hello_obj)
- Ignore(hello_obj, 'hello.h')
+hello_obj=Object('hello.c')
+hello = Program(hello_obj)
+Ignore(hello_obj, 'hello.h')
</file>
<file name="hello.c">
- #include "hello.h"
- int main() { printf("Hello, %s!\n", string); }
+#include "hello.h"
+int main() { printf("Hello, %s!\n", string); }
</file>
<file name="hello.h">
- #define string "world"
+#define string "world"
</file>
</scons_example>
@@ -1558,15 +1558,15 @@
-->
<screen>
- % <userinput>scons -Q hello</userinput>
- cc -c -o hello.o hello.c
- cc -o hello hello.o
- % <userinput>scons -Q hello</userinput>
- scons: `hello' is up to date.
- % <userinput>edit hello.h</userinput>
- [CHANGE THE CONTENTS OF hello.h]
- % <userinput>scons -Q hello</userinput>
- scons: `hello' is up to date.
+% <userinput>scons -Q hello</userinput>
+cc -c -o hello.o hello.c
+cc -o hello hello.o
+% <userinput>scons -Q hello</userinput>
+scons: `hello' is up to date.
+% <userinput>edit hello.h</userinput>
+ [CHANGE THE CONTENTS OF hello.h]
+% <userinput>scons -Q hello</userinput>
+scons: `hello' is up to date.
</screen>
<para>
@@ -1591,8 +1591,8 @@
</para>
<programlisting>
- hello = Program('hello.c', CPPPATH=['/usr/include'])
- Ignore(hello, '/usr/include/stdio.h')
+hello = Program('hello.c', CPPPATH=['/usr/include'])
+Ignore(hello, '/usr/include/stdio.h')
</programlisting>
<para>
@@ -1608,13 +1608,13 @@
<scons_example name="depends_ignore_explicit">
<file name="SConstruct" printme="1">
- hello_obj=Object('hello.c')
- hello = Program(hello_obj)
- Ignore('.',[hello,hello_obj])
+hello_obj=Object('hello.c')
+hello = Program(hello_obj)
+Ignore('.',[hello,hello_obj])
</file>
<file name="hello.c">
- #include "stdio.h"
- int main() { printf("Hello!\n"); }
+#include "stdio.h"
+int main() { printf("Hello!\n"); }
</file>
</scons_example>
@@ -1669,18 +1669,18 @@
<scons_example name="depends_no-Requires">
<file name="SConstruct" printme="1">
- import time
+import time
- version_c_text = """
- char *date = "%s";
- """ % time.ctime(time.time())
- open('version.c', 'w').write(version_c_text)
+version_c_text = """
+char *date = "%s";
+""" % time.ctime(time.time())
+open('version.c', 'w').write(version_c_text)
- hello = Program(['hello.c', 'version.c'])
+hello = Program(['hello.c', 'version.c'])
</file>
<file name="hello.c">
- extern char *date;
- int main() { printf("Hello, %s! I was built: %s\n", date); }
+extern char *date;
+int main() { printf("Hello, %s! I was built: %s\n", date); }
</file>
</scons_example>
@@ -1728,23 +1728,23 @@
<scons_example name="depends_Requires">
<file name="SConstruct" printme="1">
- import time
+import time
- version_c_text = """
- char *date = "%s";
- """ % time.ctime(time.time())
- open('version.c', 'w').write(version_c_text)
+version_c_text = """
+char *date = "%s";
+""" % time.ctime(time.time())
+open('version.c', 'w').write(version_c_text)
- version_obj = Object('version.c')
+version_obj = Object('version.c')
- hello = Program('hello.c',
- LINKFLAGS = str(version_obj[0]))
+hello = Program('hello.c',
+ LINKFLAGS = str(version_obj[0]))
- Requires(hello, version_obj)
+Requires(hello, version_obj)
</file>
<file name="hello.c">
- extern char *date;
- int main() { printf("Hello, %s! I was built: %s\n", date); }
+extern char *date;
+int main() { printf("Hello, %s! I was built: %s\n", date); }
</file>
</scons_example>
@@ -1801,11 +1801,11 @@
<scons_example name="depends_AlwaysBuild">
<file name="SConstruct" printme="1">
- hello = Program('hello.c')
- AlwaysBuild(hello)
+hello = Program('hello.c')
+AlwaysBuild(hello)
</file>
<file name="hello.c">
- int main() { printf("Hello, %s!\n", string); }
+int main() { printf("Hello, %s!\n", string); }
</file>
</scons_example>
diff --git a/doc/user/environments.xml b/doc/user/environments.xml
index 0a4192f8..b9585cb3 100644
--- a/doc/user/environments.xml
+++ b/doc/user/environments.xml
@@ -490,10 +490,10 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex1">
<file name="SConstruct" printme="1">
- import os
+import os
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -546,7 +546,7 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env = Environment()
+env = Environment()
</sconstruct>
<para>
@@ -579,13 +579,13 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex1">
<file name="SConstruct" printme="1">
- env = Environment(CC = 'gcc',
- CCFLAGS = '-O2')
+ env = Environment(CC = 'gcc',
+ CCFLAGS = '-O2')
- env.Program('foo.c')
+ env.Program('foo.c')
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -626,8 +626,8 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex6">
<file name="SConstruct" printme="1">
- env = Environment()
- print "CC is:", env['CC']
+env = Environment()
+print "CC is:", env['CC']
</file>
</scons_example>
@@ -655,10 +655,10 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex6b">
<file name="SConstruct" printme="1">
- env = Environment(FOO = 'foo', BAR = 'bar')
- dict = env.Dictionary()
- for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']:
- print "key = %s, value = %s" % (key, dict[key])
+env = Environment(FOO = 'foo', BAR = 'bar')
+dict = env.Dictionary()
+for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']:
+ print "key = %s, value = %s" % (key, dict[key])
</file>
</scons_example>
@@ -693,9 +693,9 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env = Environment()
- for item in sorted(env.Dictionary().items()):
- print "construction variable = '%s', value = '%s'" % item
+env = Environment()
+for item in sorted(env.Dictionary().items()):
+ print "construction variable = '%s', value = '%s'" % item
</sconstruct>
</section>
@@ -720,8 +720,8 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env = Environment()
- print "CC is:", env.subst('$CC')
+env = Environment()
+print "CC is:", env.subst('$CC')
</sconstruct>
<para>
@@ -737,8 +737,8 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env = Environment(CCFLAGS = '-DFOO')
- print "CCCOM is:", env['CCCOM']
+env = Environment(CCFLAGS = '-DFOO')
+print "CCCOM is:", env['CCCOM']
</sconstruct>
<para>
@@ -750,9 +750,9 @@ environment, of directory names, suffixes, etc.
</para>
<screen>
- % <userinput>scons -Q</userinput>
- CCCOM is: $CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES
- scons: `.' is up to date.
+% <userinput>scons -Q</userinput>
+CCCOM is: $CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES
+scons: `.' is up to date.
</screen>
<para>
@@ -763,8 +763,8 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env = Environment(CCFLAGS = '-DFOO')
- print "CCCOM is:", env.subst('$CCCOM')
+env = Environment(CCFLAGS = '-DFOO')
+print "CCCOM is:", env.subst('$CCCOM')
</sconstruct>
<para>
@@ -777,9 +777,9 @@ environment, of directory names, suffixes, etc.
</para>
<screen>
- % <userinput>scons -Q</userinput>
- CCCOM is: gcc -DFOO -c -o
- scons: `.' is up to date.
+% <userinput>scons -Q</userinput>
+CCCOM is: gcc -DFOO -c -o
+scons: `.' is up to date.
</screen>
<para>
@@ -805,8 +805,8 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_missing1">
<file name="SConstruct" printme="1">
- env = Environment()
- print "value is:", env.subst( '->$MISSING&lt;-' )
+env = Environment()
+print "value is:", env.subst( '->$MISSING&lt;-' )
</file>
</scons_example>
@@ -832,9 +832,9 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_missing2">
<file name="SConstruct" printme="1">
- AllowSubstExceptions()
- env = Environment()
- print "value is:", env.subst( '->$MISSING&lt;-' )
+AllowSubstExceptions()
+env = Environment()
+print "value is:", env.subst( '->$MISSING&lt;-' )
</file>
</scons_example>
@@ -852,17 +852,15 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_missing3">
<file name="SConstruct" printme="1">
- AllowSubstExceptions(IndexError, NameError, ZeroDivisionError)
- env = Environment()
- print "value is:", env.subst( '->${1 / 0}&lt;-' )
+AllowSubstExceptions(IndexError, NameError, ZeroDivisionError)
+env = Environment()
+print "value is:", env.subst( '->${1 / 0}&lt;-' )
</file>
</scons_example>
<scons_output example="environments_missing3" suffix="1">
<scons_output_command>scons -Q</scons_output_command>
</scons_output>
- <sconstruct>
- </sconstruct>
<para>
If &AllowSubstExceptions; is called multiple times, each call
@@ -903,9 +901,7 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
-
- DefaultEnvironment(CC = '/usr/local/bin/gcc')
-
+DefaultEnvironment(CC = '/usr/local/bin/gcc')
</sconstruct>
<para>
@@ -937,10 +933,8 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
-
- env = DefaultEnvironment()
- env['CC'] = '/usr/local/bin/gcc'
-
+env = DefaultEnvironment()
+env['CC'] = '/usr/local/bin/gcc'
</sconstruct>
<para>
@@ -966,10 +960,8 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
-
- env = DefaultEnvironment(tools = ['gcc', 'gnulink'],
- CC = '/usr/local/bin/gcc')
-
+env = DefaultEnvironment(tools = ['gcc', 'gnulink'],
+ CC = '/usr/local/bin/gcc')
</sconstruct>
<para>
@@ -1005,18 +997,18 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex2">
<file name="SConstruct" printme="1">
- opt = Environment(CCFLAGS = '-O2')
- dbg = Environment(CCFLAGS = '-g')
+opt = Environment(CCFLAGS = '-O2')
+dbg = Environment(CCFLAGS = '-g')
- opt.Program('foo', 'foo.c')
+opt.Program('foo', 'foo.c')
- dbg.Program('bar', 'bar.c')
+dbg.Program('bar', 'bar.c')
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
<file name="bar.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -1036,15 +1028,15 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex3">
<file name="SConstruct" printme="1">
- opt = Environment(CCFLAGS = '-O2')
- dbg = Environment(CCFLAGS = '-g')
+opt = Environment(CCFLAGS = '-O2')
+dbg = Environment(CCFLAGS = '-g')
- opt.Program('foo', 'foo.c')
+opt.Program('foo', 'foo.c')
- dbg.Program('foo', 'foo.c')
+dbg.Program('foo', 'foo.c')
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -1081,17 +1073,17 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex4">
<file name="SConstruct" printme="1">
- opt = Environment(CCFLAGS = '-O2')
- dbg = Environment(CCFLAGS = '-g')
+opt = Environment(CCFLAGS = '-O2')
+dbg = Environment(CCFLAGS = '-g')
- o = opt.Object('foo-opt', 'foo.c')
- opt.Program(o)
+o = opt.Object('foo-opt', 'foo.c')
+opt.Program(o)
- d = dbg.Object('foo-dbg', 'foo.c')
- dbg.Program(d)
+d = dbg.Object('foo-dbg', 'foo.c')
+dbg.Program(d)
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -1149,20 +1141,20 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex5">
<file name="SConstruct" printme="1">
- env = Environment(CC = 'gcc')
- opt = env.Clone(CCFLAGS = '-O2')
- dbg = env.Clone(CCFLAGS = '-g')
+env = Environment(CC = 'gcc')
+opt = env.Clone(CCFLAGS = '-O2')
+dbg = env.Clone(CCFLAGS = '-g')
- env.Program('foo', 'foo.c')
+env.Program('foo', 'foo.c')
- o = opt.Object('foo-opt', 'foo.c')
- opt.Program(o)
+o = opt.Object('foo-opt', 'foo.c')
+opt.Program(o)
- d = dbg.Object('foo-dbg', 'foo.c')
- dbg.Program(d)
+d = dbg.Object('foo-dbg', 'foo.c')
+dbg.Program(d)
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -1190,12 +1182,12 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_Replace1">
<file name="SConstruct" printme="1">
- env = Environment(CCFLAGS = '-DDEFINE1')
- env.Replace(CCFLAGS = '-DDEFINE2')
- env.Program('foo.c')
+env = Environment(CCFLAGS = '-DDEFINE1')
+env.Replace(CCFLAGS = '-DDEFINE2')
+env.Program('foo.c')
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -1222,9 +1214,9 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_Replace-nonexistent">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Replace(NEW_VARIABLE = 'xyzzy')
- print "NEW_VARIABLE =", env['NEW_VARIABLE']
+env = Environment()
+env.Replace(NEW_VARIABLE = 'xyzzy')
+print "NEW_VARIABLE =", env['NEW_VARIABLE']
</file>
</scons_example>
@@ -1258,19 +1250,19 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_Replace2">
<file name="SConstruct" printme="1">
- env = Environment(CCFLAGS = '-DDEFINE1')
- print "CCFLAGS =", env['CCFLAGS']
- env.Program('foo.c')
+env = Environment(CCFLAGS = '-DDEFINE1')
+print "CCFLAGS =", env['CCFLAGS']
+env.Program('foo.c')
- env.Replace(CCFLAGS = '-DDEFINE2')
- print "CCFLAGS =", env['CCFLAGS']
- env.Program('bar.c')
+env.Replace(CCFLAGS = '-DDEFINE2')
+print "CCFLAGS =", env['CCFLAGS']
+env.Program('bar.c')
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
<file name="bar.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -1321,7 +1313,7 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env.SetDefault(SPECIAL_FLAG = '-extra-option')
+env.SetDefault(SPECIAL_FLAG = '-extra-option')
</sconstruct>
<para>
@@ -1352,12 +1344,12 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex8">
<file name="SConstruct" printme="1">
- env = Environment(CCFLAGS = ['-DMY_VALUE'])
- env.Append(CCFLAGS = ['-DLAST'])
- env.Program('foo.c')
+env = Environment(CCFLAGS = ['-DMY_VALUE'])
+env.Append(CCFLAGS = ['-DLAST'])
+env.Program('foo.c')
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -1381,9 +1373,9 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_Append-nonexistent">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Append(NEW_VARIABLE = 'added')
- print "NEW_VARIABLE =", env['NEW_VARIABLE']
+env = Environment()
+env.Append(NEW_VARIABLE = 'added')
+print "NEW_VARIABLE =", env['NEW_VARIABLE']
</file>
</scons_example>
@@ -1425,7 +1417,7 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env.AppendUnique(CCFLAGS=['-g'])
+env.AppendUnique(CCFLAGS=['-g'])
</sconstruct>
<para>
@@ -1452,12 +1444,12 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex9">
<file name="SConstruct" printme="1">
- env = Environment(CCFLAGS = ['-DMY_VALUE'])
- env.Prepend(CCFLAGS = ['-DFIRST'])
- env.Program('foo.c')
+env = Environment(CCFLAGS = ['-DMY_VALUE'])
+env.Prepend(CCFLAGS = ['-DFIRST'])
+env.Program('foo.c')
</file>
<file name="foo.c">
- int main() { }
+int main() { }
</file>
</scons_example>
@@ -1481,9 +1473,9 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_Prepend-nonexistent">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Prepend(NEW_VARIABLE = 'added')
- print "NEW_VARIABLE =", env['NEW_VARIABLE']
+env = Environment()
+env.Prepend(NEW_VARIABLE = 'added')
+print "NEW_VARIABLE =", env['NEW_VARIABLE']
</file>
</scons_example>
@@ -1527,7 +1519,7 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env.PrependUnique(CCFLAGS=['-g'])
+env.PrependUnique(CCFLAGS=['-g'])
</sconstruct>
<para>
@@ -1598,8 +1590,8 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- path = ['/usr/local/bin', '/bin', '/usr/bin']
- env = Environment(ENV = {'PATH' : path})
+path = ['/usr/local/bin', '/bin', '/usr/bin']
+env = Environment(ENV = {'PATH' : path})
</sconstruct>
<para>
@@ -1618,7 +1610,7 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env['ENV']['PATH'] = ['/usr/local/bin', '/bin', '/usr/bin']
+env['ENV']['PATH'] = ['/usr/local/bin', '/bin', '/usr/bin']
</sconstruct>
<para>
@@ -1631,7 +1623,7 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env['ENV']['PATH'] = '/usr/local/bin:/bin:/usr/bin'
+env['ENV']['PATH'] = '/usr/local/bin:/bin:/usr/bin'
</sconstruct>
<para>
@@ -1646,19 +1638,19 @@ environment, of directory names, suffixes, etc.
<scons_example name="environments_ex1">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Command('foo', [], '__ROOT__/usr/bin/printenv.py')
+env = Environment()
+env.Command('foo', [], '__ROOT__/usr/bin/printenv.py')
</file>
<file name="__ROOT__/usr/bin/printenv.py" chmod="0755">
- #!/usr/bin/env python
- import os
- import sys
- if len(sys.argv) &gt; 1:
- keys = sys.argv[1:]
- else:
- keys = sorted(os.environ.keys())
- for key in keys:
- print " " + key + "=" + os.environ[key]
+#!/usr/bin/env python
+import os
+import sys
+if len(sys.argv) &gt; 1:
+ keys = sys.argv[1:]
+else:
+ keys = sorted(os.environ.keys())
+for key in keys:
+ print " " + key + "=" + os.environ[key]
</file>
</scons_example>
@@ -1689,8 +1681,8 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- import os
- env = Environment(ENV = {'PATH' : os.environ['PATH']})
+import os
+env = Environment(ENV = {'PATH' : os.environ['PATH']})
</sconstruct>
<para>
@@ -1705,8 +1697,8 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- import os
- env = Environment(ENV = os.environ)
+import os
+env = Environment(ENV = os.environ)
</sconstruct>
<para>
@@ -1752,9 +1744,9 @@ environment, of directory names, suffixes, etc.
</para>
<sconstruct>
- env = Environment(ENV = os.environ)
- env.PrependENVPath('PATH', '/usr/local/bin')
- env.AppendENVPath('LIB', '/usr/local/lib')
+env = Environment(ENV = os.environ)
+env.PrependENVPath('PATH', '/usr/local/bin')
+env.AppendENVPath('LIB', '/usr/local/lib')
</sconstruct>
<para>
diff --git a/doc/user/epub.css b/doc/user/epub.css
new file mode 100644
index 00000000..31cebe54
--- /dev/null
+++ b/doc/user/epub.css
@@ -0,0 +1,33 @@
+/* This defines styles and classes used in the book */
+body { }
+code { font-family: monospace; }
+h1, h2, h3, h4, h5, h6 { text-align: center; margin-bottom:2em;}
+h1.title { }
+h2.author { }
+p{
+ padding:0;
+ margin:0;
+ text-indent:2em;
+}
+blockquote{
+ margin-left:3em;
+ margin-right:3em;
+}
+.caption{
+ text-align:center;
+ font-style:italic;
+ margin-bottom:1em;
+ margin-top:.2em;
+ font-size:.8em;
+}
+blockquote > p{
+ text-indent:0;
+ margin-bottom:1em;
+}
+img{
+ display:block;
+ margin-left: auto;
+ margin-right: auto;
+ text-align:center;
+ margin-top:1em;
+}
diff --git a/doc/user/epub.xsl b/doc/user/epub.xsl
new file mode 100644
index 00000000..6ff435ce
--- /dev/null
+++ b/doc/user/epub.xsl
@@ -0,0 +1,36 @@
+<?xml version='1.0'?>
+<!--
+
+ __COPYRIGHT__
+
+ 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.
+
+-->
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="../../src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/docbook.xsl"/>
+
+<xsl:param name="html.stylesheet" select="'epub.css'"/>
+
+</xsl:stylesheet>
+
diff --git a/doc/user/factories.xml b/doc/user/factories.xml
index 15a962d5..93283bb7 100644
--- a/doc/user/factories.xml
+++ b/doc/user/factories.xml
@@ -84,7 +84,7 @@
<scons_example name="factories_Copy1">
<file name="SConstruct" printme="1">
- Command("file.out", "file.in", Copy("$TARGET", "$SOURCE"))
+Command("file.out", "file.in", Copy("$TARGET", "$SOURCE"))
</file>
<file name="file.in">file.in</file>
</scons_example>
@@ -113,7 +113,7 @@
<scons_example name="factories_Copy2">
<file name="SConstruct" printme="1">
- Command("file.out", [], Copy("$TARGET", "file.in"))
+Command("file.out", [], Copy("$TARGET", "file.in"))
</file>
<file name="file.in">file.in</file>
</scons_example>
@@ -147,22 +147,22 @@
<scons_example name="factories_Copy3">
<file name="S" printme="1">
- Command("file.out", "file.in",
- [
- Copy("tempfile", "$SOURCE"),
- "modify tempfile",
- Copy("$TARGET", "tempfile"),
- ])
+Command("file.out", "file.in",
+ [
+ Copy("tempfile", "$SOURCE"),
+ "modify tempfile",
+ Copy("$TARGET", "tempfile"),
+ ])
</file>
<file name="SConstruct">
- env = DefaultEnvironment()
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- SConscript('S')
+env = DefaultEnvironment()
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+SConscript('S')
</file>
<file name="file.in">file.in</file>
<file name="modify" chmod="0755">
- touch $*
+touch $*
</file>
</scons_example>
@@ -198,23 +198,23 @@
<scons_example name="factories_Delete1">
<file name="S" printme="1">
- Command("file.out", "file.in",
- [
- Delete("tempfile"),
- Copy("tempfile", "$SOURCE"),
- "modify tempfile",
- Copy("$TARGET", "tempfile"),
- ])
+Command("file.out", "file.in",
+ [
+ Delete("tempfile"),
+ Copy("tempfile", "$SOURCE"),
+ "modify tempfile",
+ Copy("$TARGET", "tempfile"),
+ ])
</file>
<file name="SConstruct">
- env = DefaultEnvironment()
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- SConscript('S')
+env = DefaultEnvironment()
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+SConscript('S')
</file>
<file name="file.in">file.in</file>
<file name="modify" chmod="0755">
- touch $*
+touch $*
</file>
</scons_example>
@@ -239,11 +239,11 @@
<scons_example name="factories_Delete2">
<file name="SConstruct" printme="1">
- Command("file.out", "file.in",
- [
- Delete("$TARGET"),
- Copy("$TARGET", "$SOURCE")
- ])
+Command("file.out", "file.in",
+ [
+ Delete("$TARGET"),
+ Copy("$TARGET", "$SOURCE")
+ ])
</file>
<file name="file.in">file.in</file>
</scons_example>
@@ -293,22 +293,22 @@
<scons_example name="factories_Move">
<file name="S" printme="1">
- Command("file.out", "file.in",
- [
- Copy("tempfile", "$SOURCE"),
- "modify tempfile",
- Move("$TARGET", "tempfile"),
- ])
+Command("file.out", "file.in",
+ [
+ Copy("tempfile", "$SOURCE"),
+ "modify tempfile",
+ Move("$TARGET", "tempfile"),
+ ])
</file>
<file name="SConstruct">
- env = DefaultEnvironment()
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- SConscript('S')
+env = DefaultEnvironment()
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+SConscript('S')
</file>
<file name="file.in">file.in</file>
<file name="modify" chmod="0755">
- touch $*
+touch $*
</file>
</scons_example>
@@ -337,17 +337,17 @@
<scons_example name="factories_Touch">
<file name="S" printme="1">
- Command("file.out", "file.in",
- [
- Copy("$TARGET", "$SOURCE"),
- Touch("$TARGET"),
- ])
+Command("file.out", "file.in",
+ [
+ Copy("$TARGET", "$SOURCE"),
+ Touch("$TARGET"),
+ ])
</file>
<file name="SConstruct">
- env = DefaultEnvironment()
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- SConscript('S')
+env = DefaultEnvironment()
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+SConscript('S')
</file>
<file name="file.in">file.in</file>
</scons_example>
@@ -381,25 +381,25 @@
<scons_example name="factories_Mkdir">
<file name="S" printme="1">
- Command("file.out", "file.in",
- [
- Delete("tempdir"),
- Mkdir("tempdir"),
- Copy("tempdir/${SOURCE.file}", "$SOURCE"),
- "process tempdir",
- Move("$TARGET", "tempdir/output_file"),
- Delete("tempdir"),
- ])
+Command("file.out", "file.in",
+ [
+ Delete("tempdir"),
+ Mkdir("tempdir"),
+ Copy("tempdir/${SOURCE.file}", "$SOURCE"),
+ "process tempdir",
+ Move("$TARGET", "tempdir/output_file"),
+ Delete("tempdir"),
+ ])
</file>
<file name="SConstruct">
- env = DefaultEnvironment()
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- SConscript('S')
+env = DefaultEnvironment()
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+SConscript('S')
</file>
<file name="file.in">file.in</file>
<file name="process" chmod="0755">
- touch $*
+touch $*
</file>
</scons_example>
@@ -431,11 +431,11 @@
<scons_example name="factories_Chmod">
<file name="SConstruct" printme="1">
- Command("file.out", "file.in",
- [
- Copy("$TARGET", "$SOURCE"),
- Chmod("$TARGET", 0755),
- ])
+Command("file.out", "file.in",
+ [
+ Copy("$TARGET", "$SOURCE"),
+ Chmod("$TARGET", 0755),
+ ])
</file>
<file name="file.in">file.in</file>
</scons_example>
@@ -470,7 +470,7 @@
<scons_example name="factories_Execute">
<file name="SConstruct" printme="1">
- Execute(Mkdir('__ROOT__/tmp/my_temp_directory'))
+Execute(Mkdir('__ROOT__/tmp/my_temp_directory'))
</file>
</scons_example>
@@ -521,9 +521,9 @@
</para>
<sconstruct>
- if Execute(Mkdir('__ROOT__/tmp/my_temp_directory')):
- # A problem occurred while making the temp directory.
- Exit(1)
+if Execute(Mkdir('__ROOT__/tmp/my_temp_directory')):
+ # A problem occurred while making the temp directory.
+ Exit(1)
</sconstruct>
</section>
diff --git a/doc/user/file-removal.xml b/doc/user/file-removal.xml
index 3b1c36e8..ebf7cc92 100644
--- a/doc/user/file-removal.xml
+++ b/doc/user/file-removal.xml
@@ -80,18 +80,18 @@
<scons_example name="fileremoval_precious-ex1">
<file name="SConstruct" printme="1">
- env = Environment(RANLIBCOM='')
- lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
- env.Precious(lib)
+ env = Environment(RANLIBCOM='')
+ lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
+ env.Precious(lib)
</file>
<file name="f1.c">
- int f1() { }
+int f1() { }
</file>
<file name="f2.c">
- int f2() { }
+int f2() { }
</file>
<file name="f3.c">
- int f3() { }
+int f3() { }
</file>
</scons_example>
@@ -138,18 +138,18 @@
<scons_example name="fileremoval_noclean-ex1">
<file name="SConstruct" printme="1">
- env = Environment(RANLIBCOM='')
- lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
- env.NoClean(lib)
+env = Environment(RANLIBCOM='')
+lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
+env.NoClean(lib)
</file>
<file name="f1.c">
- int f1() { }
+int f1() { }
</file>
<file name="f2.c">
- int f2() { }
+int f2() { }
</file>
<file name="f3.c">
- int f3() { }
+int f3() { }
</file>
</scons_example>
@@ -199,23 +199,23 @@
<scons_example name="fileremoval_clean-ex1">
<file name="S" printme="1">
- t = Command('foo.out', 'foo.in', 'build -o $TARGET $SOURCE')
- Clean(t, 'foo.log')
+t = Command('foo.out', 'foo.in', 'build -o $TARGET $SOURCE')
+Clean(t, 'foo.log')
</file>
<file name="SConstruct">
- env = DefaultEnvironment()
- import os
- env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
- SConscript('S')
+env = DefaultEnvironment()
+import os
+env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd()
+SConscript('S')
</file>
<file name="foo.in">
- foo.in
+foo.in
</file>
<file name="foo.log">
- foo.log
+foo.log
</file>
<file name="build" chmod="0755">
- cat $3 > $2
+cat $3 > $2
</file>
</scons_example>
diff --git a/doc/user/gettext.xml b/doc/user/gettext.xml
index 9698c95e..4b1e9ea1 100644
--- a/doc/user/gettext.xml
+++ b/doc/user/gettext.xml
@@ -80,13 +80,13 @@
for example
<scons_example name="gettext_ex1">
<file name="hello.c" printme="1">
- /* hello.c */
- #include &lt;stdio.h&gt;
- int main(int argc, char* argv[])
- {
- printf("Hello world\n");
- return 0;
- }
+/* hello.c */
+#include &lt;stdio.h&gt;
+int main(int argc, char* argv[])
+{
+ printf("Hello world\n");
+ return 0;
+}
</file>
</scons_example>
@@ -94,9 +94,9 @@
as usual.
<scons_example name="gettext_ex2">
<file name="SConstruct" printme="1">
- # SConstruct
- env = Environment()
- hello = Program(["hello.c"])
+# SConstruct
+env = Environment()
+hello = Program(["hello.c"])
</file>
</scons_example>
</para>
@@ -120,18 +120,18 @@
internationalization. Change the previous code so it reads as follows:
<scons_example name="gettext_ex3">
<file name="hello.c" printme="1">
- /* hello.c */
- #include &lt;stdio.h&gt;
- #include &lt;libintl.h&gt;
- #include &lt;locale.h&gt;
- int main(int argc, char* argv[])
- {
- bindtextdomain("hello", "locale");
- setlocale(LC_ALL, "");
- textdomain("hello");
- printf(gettext("Hello world\n"));
- return 0;
- }
+/* hello.c */
+#include &lt;stdio.h&gt;
+#include &lt;libintl.h&gt;
+#include &lt;locale.h&gt;
+int main(int argc, char* argv[])
+{
+ bindtextdomain("hello", "locale");
+ setlocale(LC_ALL, "");
+ textdomain("hello");
+ printf(gettext("Hello world\n"));
+ return 0;
+}
</file>
</scons_example>
Detailed recipes for such conversion can
@@ -162,18 +162,18 @@
<filename>SConstruct</filename> is as follows:
<scons_example name="gettext_ex4">
<file name="SConstruct" printme="1">
- # SConstruct
- env = Environment( tools = ['default', 'gettext'] )
- hello = env.Program(["hello.c"])
- env['XGETTEXTFLAGS'] = [
- '--package-name=%s' % 'hello',
- '--package-version=%s' % '1.0',
- ]
- po = env.Translate(["pl","en", "de"], ["hello.c"], POAUTOINIT = 1)
- mo = env.MOFiles(po)
- InstallAs(["locale/en/LC_MESSAGES/hello.mo"], ["en.mo"])
- InstallAs(["locale/pl/LC_MESSAGES/hello.mo"], ["pl.mo"])
- InstallAs(["locale/de/LC_MESSAGES/hello.mo"], ["de.mo"])
+# SConstruct
+env = Environment( tools = ['default', 'gettext'] )
+hello = env.Program(["hello.c"])
+env['XGETTEXTFLAGS'] = [
+ '--package-name=%s' % 'hello',
+ '--package-version=%s' % '1.0',
+]
+po = env.Translate(["pl","en", "de"], ["hello.c"], POAUTOINIT = 1)
+mo = env.MOFiles(po)
+InstallAs(["locale/en/LC_MESSAGES/hello.mo"], ["en.mo"])
+InstallAs(["locale/pl/LC_MESSAGES/hello.mo"], ["pl.mo"])
+InstallAs(["locale/de/LC_MESSAGES/hello.mo"], ["de.mo"])
</file>
</scons_example>
</para>
@@ -181,29 +181,29 @@
Generate the translation files with <command>scons po-update</command>.
You should see the output from SCons simillar to this:
<screen>
- user@host:$ scons po-update
- scons: Reading SConscript files ...
- scons: done reading SConscript files.
- scons: Building targets ...
- Entering '/home/ptomulik/projects/tmp'
- xgettext --package-name=hello --package-version=1.0 -o - hello.c
- Leaving '/home/ptomulik/projects/tmp'
- Writting 'messages.pot' (new file)
- msginit --no-translator -l pl -i messages.pot -o pl.po
- Created pl.po.
- msginit --no-translator -l en -i messages.pot -o en.po
- Created en.po.
- msginit --no-translator -l de -i messages.pot -o de.po
- Created de.po.
- scons: done building targets.
+user@host:$ scons po-update
+scons: Reading SConscript files ...
+scons: done reading SConscript files.
+scons: Building targets ...
+Entering '/home/ptomulik/projects/tmp'
+xgettext --package-name=hello --package-version=1.0 -o - hello.c
+Leaving '/home/ptomulik/projects/tmp'
+Writting 'messages.pot' (new file)
+msginit --no-translator -l pl -i messages.pot -o pl.po
+Created pl.po.
+msginit --no-translator -l en -i messages.pot -o en.po
+Created en.po.
+msginit --no-translator -l de -i messages.pot -o de.po
+Created de.po.
+scons: done building targets.
</screen>
</para>
<para>
If everything is right, you should see following new files.
<screen>
- user@host:$ ls *.po*
- de.po en.po messages.pot pl.po
+user@host:$ ls *.po*
+de.po en.po messages.pot pl.po
</screen>
</para>
@@ -228,19 +228,19 @@
Now compile the project by executing <command>scons</command>. The
output should be similar to this:
<screen>
- user@host:$ scons
- scons: Reading SConscript files ...
- scons: done reading SConscript files.
- scons: Building targets ...
- msgfmt -c -o de.mo de.po
- msgfmt -c -o en.mo en.po
- gcc -o hello.o -c hello.c
- gcc -o hello hello.o
- Install file: "de.mo" as "locale/de/LC_MESSAGES/hello.mo"
- Install file: "en.mo" as "locale/en/LC_MESSAGES/hello.mo"
- msgfmt -c -o pl.mo pl.po
- Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo"
- scons: done building targets.
+user@host:$ scons
+scons: Reading SConscript files ...
+scons: done reading SConscript files.
+scons: Building targets ...
+msgfmt -c -o de.mo de.po
+msgfmt -c -o en.mo en.po
+gcc -o hello.o -c hello.c
+gcc -o hello hello.o
+Install file: "de.mo" as "locale/de/LC_MESSAGES/hello.mo"
+Install file: "en.mo" as "locale/en/LC_MESSAGES/hello.mo"
+msgfmt -c -o pl.mo pl.po
+Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo"
+scons: done building targets.
</screen>
SCons automatically compiled the <literal>PO</literal> files to binary format
<literal>MO</literal>, and the <literal>InstallAs</literal> lines installed
@@ -249,16 +249,16 @@
<para>
Your program should be now ready. You may try it as follows (linux):
<screen>
- user@host:$ LANG=en_US.UTF-8 ./hello
- Welcome to beautiful world
+user@host:$ LANG=en_US.UTF-8 ./hello
+Welcome to beautiful world
</screen>
<screen>
- user@host:$ LANG=de_DE.UTF-8 ./hello
- Hallo Welt
+user@host:$ LANG=de_DE.UTF-8 ./hello
+Hallo Welt
</screen>
<screen>
- user@host:$ LANG=pl_PL.UTF-8 ./hello
- Witaj swiecie
+user@host:$ LANG=pl_PL.UTF-8 ./hello
+Witaj swiecie
</screen>
</para>
<para>
@@ -267,13 +267,13 @@
swiecie\n"</literal>. Run <command>scons</command> to see how scons
reacts to this
<screen>
- user@host:$scons
- scons: Reading SConscript files ...
- scons: done reading SConscript files.
- scons: Building targets ...
- msgfmt -c -o pl.mo pl.po
- Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo"
- scons: done building targets.
+user@host:$scons
+scons: Reading SConscript files ...
+scons: done reading SConscript files.
+scons: Building targets ...
+msgfmt -c -o pl.mo pl.po
+Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo"
+scons: done building targets.
</screen>
</para>
<para>
@@ -281,19 +281,19 @@
<literal>printf</literal> line with new message.
<scons_example name="gettext_ex5">
<file name="hello.c" printme="1">
- /* hello.c */
- #include &lt;stdio.h&gt;
- #include &lt;libintl.h&gt;
- #include &lt;locale.h&gt;
- int main(int argc, char* argv[])
- {
- bindtextdomain("hello", "locale");
- setlocale(LC_ALL, "");
- textdomain("hello");
- printf(gettext("Hello world\n"));
- printf(gettext("and good bye\n"));
- return 0;
- }
+/* hello.c */
+#include &lt;stdio.h&gt;
+#include &lt;libintl.h&gt;
+#include &lt;locale.h&gt;
+int main(int argc, char* argv[])
+{
+ bindtextdomain("hello", "locale");
+ setlocale(LC_ALL, "");
+ textdomain("hello");
+ printf(gettext("Hello world\n"));
+ printf(gettext("and good bye\n"));
+ return 0;
+}
</file>
</scons_example>
</para>
@@ -302,29 +302,29 @@
<command>msgmerge(1)</command> program is used by SCons to update
<literal>PO</literal> file. The output from compilation is like:
<screen>
- user@host:$scons
- scons: Reading SConscript files ...
- scons: done reading SConscript files.
- scons: Building targets ...
- Entering '/home/ptomulik/projects/tmp'
- xgettext --package-name=hello --package-version=1.0 -o - hello.c
- Leaving '/home/ptomulik/projects/tmp'
- Writting 'messages.pot' (messages in file were outdated)
- msgmerge --update de.po messages.pot
- ... done.
- msgfmt -c -o de.mo de.po
- msgmerge --update en.po messages.pot
- ... done.
- msgfmt -c -o en.mo en.po
- gcc -o hello.o -c hello.c
- gcc -o hello hello.o
- Install file: "de.mo" as "locale/de/LC_MESSAGES/hello.mo"
- Install file: "en.mo" as "locale/en/LC_MESSAGES/hello.mo"
- msgmerge --update pl.po messages.pot
- ... done.
- msgfmt -c -o pl.mo pl.po
- Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo"
- scons: done building targets.
+user@host:$scons
+scons: Reading SConscript files ...
+scons: done reading SConscript files.
+scons: Building targets ...
+Entering '/home/ptomulik/projects/tmp'
+xgettext --package-name=hello --package-version=1.0 -o - hello.c
+Leaving '/home/ptomulik/projects/tmp'
+Writting 'messages.pot' (messages in file were outdated)
+msgmerge --update de.po messages.pot
+... done.
+msgfmt -c -o de.mo de.po
+msgmerge --update en.po messages.pot
+... done.
+msgfmt -c -o en.mo en.po
+gcc -o hello.o -c hello.c
+gcc -o hello hello.o
+Install file: "de.mo" as "locale/de/LC_MESSAGES/hello.mo"
+Install file: "en.mo" as "locale/en/LC_MESSAGES/hello.mo"
+msgmerge --update pl.po messages.pot
+... done.
+msgfmt -c -o pl.mo pl.po
+Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo"
+scons: done building targets.
</screen>
</para>
<para>
@@ -336,35 +336,35 @@
line to the program (after the last printf), so its code becomes:
<scons_example name="gettext_ex6">
<file name="hello.c" printme="1">
- /* hello.c */
- #include &lt;stdio.h&gt;
- #include &lt;libintl.h&gt;
- #include &lt;locale.h&gt;
- int main(int argc, char* argv[])
- {
- bindtextdomain("hello", "locale");
- setlocale(LC_ALL, "");
- textdomain("hello");
- printf(gettext("Hello world\n"));
- printf(gettext("and good bye\n"));
- printf("----------------\n");
- return a;
- }
+/* hello.c */
+#include &lt;stdio.h&gt;
+#include &lt;libintl.h&gt;
+#include &lt;locale.h&gt;
+int main(int argc, char* argv[])
+{
+ bindtextdomain("hello", "locale");
+ setlocale(LC_ALL, "");
+ textdomain("hello");
+ printf(gettext("Hello world\n"));
+ printf(gettext("and good bye\n"));
+ printf("----------------\n");
+ return a;
+}
</file>
</scons_example>
Compile the project. You'll see on your screen
<screen>
- user@host:$scons
- scons: Reading SConscript files ...
- scons: done reading SConscript files.
- scons: Building targets ...
- Entering '/home/ptomulik/projects/tmp'
- xgettext --package-name=hello --package-version=1.0 -o - hello.c
- Leaving '/home/ptomulik/projects/tmp'
- Not writting 'messages.pot' (messages in file found to be up-to-date)
- gcc -o hello.o -c hello.c
- gcc -o hello hello.o
- scons: done building targets.
+user@host:$scons
+scons: Reading SConscript files ...
+scons: done reading SConscript files.
+scons: Building targets ...
+Entering '/home/ptomulik/projects/tmp'
+xgettext --package-name=hello --package-version=1.0 -o - hello.c
+Leaving '/home/ptomulik/projects/tmp'
+Not writting 'messages.pot' (messages in file found to be up-to-date)
+gcc -o hello.o -c hello.c
+gcc -o hello hello.o
+scons: done building targets.
</screen>
As you see, the internationalized messages ditn't change, so the
<literal>POT</literal> and the rest of translation files have not
diff --git a/doc/user/hierarchy.xml b/doc/user/hierarchy.xml
index d2d01e7e..9aaecc2e 100644
--- a/doc/user/hierarchy.xml
+++ b/doc/user/hierarchy.xml
@@ -219,10 +219,10 @@ make no difference to the build.
</para>
<sconstruct>
- SConscript(['drivers/display/SConscript',
- 'drivers/mouse/SConscript',
- 'parser/SConscript',
- 'utilities/SConscript'])
+SConscript(['drivers/display/SConscript',
+ 'drivers/mouse/SConscript',
+ 'parser/SConscript',
+ 'utilities/SConscript'])
</sconstruct>
<para>
@@ -241,9 +241,9 @@ make no difference to the build.
</para>
<sconstruct>
- SConscript(['drivers/SConscript',
- 'parser/SConscript',
- 'utilities/SConscript'])
+SConscript(['drivers/SConscript',
+ 'parser/SConscript',
+ 'utilities/SConscript'])
</sconstruct>
<para>
@@ -255,8 +255,8 @@ make no difference to the build.
</para>
<sconstruct>
- SConscript(['display/SConscript',
- 'mouse/SConscript'])
+SConscript(['display/SConscript',
+ 'mouse/SConscript'])
</sconstruct>
<para>
@@ -303,36 +303,36 @@ make no difference to the build.
<scons_example name="hierarchy_ex1">
<file name="SConstruct" printme="1">
- SConscript(['prog1/SConscript',
- 'prog2/SConscript'])
+SConscript(['prog1/SConscript',
+ 'prog2/SConscript'])
</file>
<file name="prog1/SConscript">
- env = Environment()
- env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c'])
+env = Environment()
+env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c'])
</file>
<file name="prog2/SConscript">
- env = Environment()
- env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c'])
+env = Environment()
+env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c'])
</file>
<directory name="prog1"></directory>
<file name="prog1/main.c">
- x
+x
</file>
<file name="prog1/foo1.c">
- x
+x
</file>
<file name="prog1/foo2.c">
- x
+x
</file>
<directory name="prog2"></directory>
<file name="prog2/main.c">
- x
+x
</file>
<file name="prog2/bar1.c">
- x
+x
</file>
<file name="prog2/bar2.c">
- x
+x
</file>
</scons_example>
@@ -404,20 +404,20 @@ make no difference to the build.
<scons_example name="hierarchy_ex2">
<file name="SConstruct">
- SConscript('src/prog/SConscript')
+SConscript('src/prog/SConscript')
</file>
<file name="src/prog/SConscript" printme="1">
- env = Environment()
- env.Program('prog', ['main.c', '#lib/foo1.c', 'foo2.c'])
+env = Environment()
+env.Program('prog', ['main.c', '#lib/foo1.c', 'foo2.c'])
</file>
<file name="src/prog/main.c">
- x
+x
</file>
<file name="lib/foo1.c">
- x
+x
</file>
<file name="src/prog/foo2.c">
- x
+x
</file>
</scons_example>
@@ -460,20 +460,20 @@ make no difference to the build.
<scons_example name="hierarchy_ex3">
<file name="SConstruct">
- SConscript('src/prog/SConscript')
+SConscript('src/prog/SConscript')
</file>
<file name="src/prog/SConscript" printme="1">
- env = Environment()
- env.Program('prog', ['main.c', '__ROOT__/usr/joe/lib/foo1.c', 'foo2.c'])
+env = Environment()
+env.Program('prog', ['main.c', '__ROOT__/usr/joe/lib/foo1.c', 'foo2.c'])
</file>
<file name="src/prog/main.c">
- x
+x
</file>
<file name="__ROOT__/usr/joe/lib/foo1.c">
- x
+x
</file>
<file name="src/prog/foo2.c">
- x
+x
</file>
</scons_example>
@@ -549,8 +549,8 @@ make no difference to the build.
</para>
<sconstruct>
- env = Environment()
- Export('env')
+env = Environment()
+Export('env')
</sconstruct>
<para>
@@ -560,9 +560,9 @@ make no difference to the build.
</para>
<sconstruct>
- env = Environment()
- debug = ARGUMENTS['debug']
- Export('env', 'debug')
+env = Environment()
+debug = ARGUMENTS['debug']
+Export('env', 'debug')
</sconstruct>
<para>
@@ -574,7 +574,7 @@ make no difference to the build.
</para>
<sconstruct>
- Export('env debug')
+Export('env debug')
</sconstruct>
<para>
@@ -586,7 +586,7 @@ make no difference to the build.
</para>
<sconstruct>
- SConscript('src/SConscript', 'env')
+SConscript('src/SConscript', 'env')
</sconstruct>
<para>
@@ -596,7 +596,7 @@ make no difference to the build.
</para>
<sconstruct>
- SConscript('src/SConscript', exports='env')
+SConscript('src/SConscript', exports='env')
</sconstruct>
<para>
@@ -609,8 +609,8 @@ make no difference to the build.
</para>
<sconstruct>
- SConscript(['src1/SConscript',
- 'src2/SConscript'], exports='env')
+SConscript(['src1/SConscript',
+ 'src2/SConscript'], exports='env')
</sconstruct>
<para>
@@ -637,8 +637,8 @@ make no difference to the build.
</para>
<sconstruct>
- Import('env')
- env.Program('prog', ['prog.c'])
+Import('env')
+env.Program('prog', ['prog.c'])
</sconstruct>
<para>
@@ -659,9 +659,9 @@ make no difference to the build.
</para>
<sconstruct>
- Import('env', 'debug')
- env = env.Clone(DEBUG = debug)
- env.Program('prog', ['prog.c'])
+Import('env', 'debug')
+env = env.Clone(DEBUG = debug)
+env.Program('prog', ['prog.c'])
</sconstruct>
<para>
@@ -673,9 +673,9 @@ make no difference to the build.
</para>
<sconstruct>
- Import('env debug')
- env = env.Clone(DEBUG = debug)
- env.Program('prog', ['prog.c'])
+Import('env debug')
+env = env.Clone(DEBUG = debug)
+env.Program('prog', ['prog.c'])
</sconstruct>
<para>
@@ -688,9 +688,9 @@ make no difference to the build.
</para>
<sconstruct>
- Import('*')
- env = env.Clone(DEBUG = debug)
- env.Program('prog', ['prog.c'])
+Import('*')
+env = env.Clone(DEBUG = debug)
+env.Program('prog', ['prog.c'])
</sconstruct>
<para>
@@ -738,31 +738,31 @@ make no difference to the build.
<scons_example name="hierarchy_Return">
<file name="SConstruct" printme="1">
- env = Environment()
- Export('env')
- objs = []
- for subdir in ['foo', 'bar']:
- o = SConscript('%s/SConscript' % subdir)
- objs.append(o)
- env.Library('prog', objs)
+env = Environment()
+Export('env')
+objs = []
+for subdir in ['foo', 'bar']:
+ o = SConscript('%s/SConscript' % subdir)
+ objs.append(o)
+env.Library('prog', objs)
</file>
<directory name="foo"></directory>
<directory name="bar"></directory>
<file name="foo/SConscript">
- Import('env')
- obj = env.Object('foo.c')
- Return('obj')
+Import('env')
+obj = env.Object('foo.c')
+Return('obj')
</file>
<file name="bar/SConscript">
- Import('env')
- obj = env.Object('bar.c')
- Return('obj')
+Import('env')
+obj = env.Object('bar.c')
+Return('obj')
</file>
<file name="foo/foo.c">
- void foo(void) { printf("foo/foo.c\n"); }
+void foo(void) { printf("foo/foo.c\n"); }
</file>
<file name="bar/bar.c">
- void bar(void) { printf("bar/bar.c\n"); }
+void bar(void) { printf("bar/bar.c\n"); }
</file>
</scons_example>
diff --git a/doc/user/html.xsl b/doc/user/html.xsl
index 74ea5296..c275c3d1 100644
--- a/doc/user/html.xsl
+++ b/doc/user/html.xsl
@@ -51,5 +51,9 @@ reference toc,title
set toc,title
</xsl:param>
+<!-- Prevent our EPUB cover image from getting included -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
</xsl:stylesheet>
diff --git a/doc/user/install.xml b/doc/user/install.xml
index 7c2f00ee..159b8866 100644
--- a/doc/user/install.xml
+++ b/doc/user/install.xml
@@ -58,12 +58,12 @@
<scons_example name="install_ex1">
<file name="SConstruct" printme="1">
- env = Environment()
- hello = env.Program('hello.c')
- env.Install('__ROOT__/usr/bin', hello)
+env = Environment()
+hello = env.Program('hello.c')
+env.Install('__ROOT__/usr/bin', hello)
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -104,13 +104,13 @@
<scons_example name="install_ex2">
<file name="SConstruct" printme="1">
- env = Environment()
- hello = env.Program('hello.c')
- env.Install('__ROOT__/usr/bin', hello)
- env.Alias('install', '__ROOT__/usr/bin')
+env = Environment()
+hello = env.Program('hello.c')
+env.Install('__ROOT__/usr/bin', hello)
+env.Alias('install', '__ROOT__/usr/bin')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -139,18 +139,18 @@
<scons_example name="install_ex3">
<file name="SConstruct" printme="1">
- env = Environment()
- hello = env.Program('hello.c')
- goodbye = env.Program('goodbye.c')
- env.Install('__ROOT__/usr/bin', hello)
- env.Install('__ROOT__/usr/bin', goodbye)
- env.Alias('install', '__ROOT__/usr/bin')
+env = Environment()
+hello = env.Program('hello.c')
+goodbye = env.Program('goodbye.c')
+env.Install('__ROOT__/usr/bin', hello)
+env.Install('__ROOT__/usr/bin', goodbye)
+env.Alias('install', '__ROOT__/usr/bin')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="goodbye.c">
- int main() { printf("Goodbye, world!\n"); }
+int main() { printf("Goodbye, world!\n"); }
</file>
</scons_example>
@@ -163,11 +163,11 @@
</para>
<sconstruct>
- env = Environment()
- hello = env.Program('hello.c')
- goodbye = env.Program('goodbye.c')
- env.Install('__ROOT__/usr/bin', [hello, goodbye])
- env.Alias('install', '__ROOT__/usr/bin')
+env = Environment()
+hello = env.Program('hello.c')
+goodbye = env.Program('goodbye.c')
+env.Install('__ROOT__/usr/bin', [hello, goodbye])
+env.Alias('install', '__ROOT__/usr/bin')
</sconstruct>
<para>
@@ -197,13 +197,13 @@
<scons_example name="install_ex4">
<file name="SConstruct" printme="1">
- env = Environment()
- hello = env.Program('hello.c')
- env.InstallAs('__ROOT__/usr/bin/hello-new', hello)
- env.Alias('install', '__ROOT__/usr/bin')
+env = Environment()
+hello = env.Program('hello.c')
+env.InstallAs('__ROOT__/usr/bin/hello-new', hello)
+env.Alias('install', '__ROOT__/usr/bin')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -237,19 +237,19 @@
<scons_example name="install_ex5">
<file name="SConstruct" printme="1">
- env = Environment()
- hello = env.Program('hello.c')
- goodbye = env.Program('goodbye.c')
- env.InstallAs(['__ROOT__/usr/bin/hello-new',
- '__ROOT__/usr/bin/goodbye-new'],
- [hello, goodbye])
- env.Alias('install', '__ROOT__/usr/bin')
+env = Environment()
+hello = env.Program('hello.c')
+goodbye = env.Program('goodbye.c')
+env.InstallAs(['__ROOT__/usr/bin/hello-new',
+ '__ROOT__/usr/bin/goodbye-new'],
+ [hello, goodbye])
+env.Alias('install', '__ROOT__/usr/bin')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="goodbye.c">
- int main() { printf("Goodbye, world!\n"); }
+int main() { printf("Goodbye, world!\n"); }
</file>
</scons_example>
diff --git a/doc/user/java.xml b/doc/user/java.xml
index 418faf6e..40a82a3f 100644
--- a/doc/user/java.xml
+++ b/doc/user/java.xml
@@ -80,34 +80,34 @@
<scons_example name="java_java">
<file name="SConstruct" printme="1">
- Java('classes', 'src')
+Java('classes', 'src')
</file>
<file name="src/Example1.java">
- public class Example1
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
<file name="src/Example2.java">
- public class Example2
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example2
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
<file name="src/Example3.java">
- public class Example3
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example3
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
</scons_example>
@@ -155,50 +155,50 @@
<scons_example name="java_java-classes">
<file name="SConstruct" printme="1">
- Java('classes', 'src')
+Java('classes', 'src')
</file>
<file name="src/Example1.java">
- public class Example1
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
- public class AdditionalClass1
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
+public class AdditionalClass1
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
<file name="src/Example2.java">
- public class Example2
- {
- class Inner2 {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
- }
+public class Example2
+{
+ class Inner2 {
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+ }
+}
</file>
<file name="src/Example3.java">
- public class Example3
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
- public class AdditionalClass3
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example3
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
+public class AdditionalClass3
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
</scons_example>
@@ -253,7 +253,7 @@
</para>
<sconstruct>
- Java('classes', 'src', JAVAVERSION='1.6')
+Java('classes', 'src', JAVAVERSION='1.6')
</sconstruct>
<para>
@@ -280,35 +280,35 @@
<scons_example name="java_jar1">
<file name="SConstruct" printme="1">
- Java(target = 'classes', source = 'src')
- Jar(target = 'test.jar', source = 'classes')
+Java(target = 'classes', source = 'src')
+Jar(target = 'test.jar', source = 'classes')
</file>
<file name="src/Example1.java">
- public class Example1
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
<file name="src/Example2.java">
- public class Example2
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example2
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
<file name="src/Example3.java">
- public class Example3
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example3
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
</scons_example>
@@ -344,46 +344,46 @@
<scons_example name="java_jar2">
<file name="SConstruct" printme="1">
- prog1_class_files = Java(target = 'classes', source = 'prog1')
- prog2_class_files = Java(target = 'classes', source = 'prog2')
- Jar(target = 'prog1.jar', source = prog1_class_files)
- Jar(target = 'prog2.jar', source = prog2_class_files)
+prog1_class_files = Java(target = 'classes', source = 'prog1')
+prog2_class_files = Java(target = 'classes', source = 'prog2')
+Jar(target = 'prog1.jar', source = prog1_class_files)
+Jar(target = 'prog2.jar', source = prog2_class_files)
</file>
<file name="prog1/Example1.java">
- public class Example1
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
<file name="prog1/Example2.java">
- public class Example2
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example2
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
<file name="prog2/Example3.java">
- public class Example3
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example3
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
<file name="prog2/Example4.java">
- public class Example4
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example4
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
</scons_example>
@@ -418,35 +418,35 @@
<scons_example name="java_javah">
<file name="SConstruct" printme="1">
- classes = Java(target = 'classes', source = 'src/pkg/sub')
- JavaH(target = 'native', source = classes)
+classes = Java(target = 'classes', source = 'src/pkg/sub')
+JavaH(target = 'native', source = classes)
</file>
<file name="src/pkg/sub/Example1.java">
- package pkg.sub;
- public class Example1
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
<file name="src/pkg/sub/Example2.java">
- package pkg.sub;
- public class Example2
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example2
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
<file name="src/pkg/sub/Example3.java">
- package pkg.sub;
- public class Example3
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example3
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
</scons_example>
@@ -502,38 +502,38 @@
<scons_example name="java_JAVACLASSDIR">
<file name="SConstruct" printme="1">
- Java(target = 'classes', source = 'src/pkg/sub')
- class_file_list = ['classes/pkg/sub/Example1.class',
- 'classes/pkg/sub/Example2.class',
- 'classes/pkg/sub/Example3.class']
- JavaH(target = 'native', source = class_file_list, JAVACLASSDIR = 'classes')
+Java(target = 'classes', source = 'src/pkg/sub')
+class_file_list = ['classes/pkg/sub/Example1.class',
+ 'classes/pkg/sub/Example2.class',
+ 'classes/pkg/sub/Example3.class']
+JavaH(target = 'native', source = class_file_list, JAVACLASSDIR = 'classes')
</file>
<file name="src/pkg/sub/Example1.java">
- package pkg.sub;
- public class Example1
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
<file name="src/pkg/sub/Example2.java">
- package pkg.sub;
- public class Example2
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example2
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
<file name="src/pkg/sub/Example3.java">
- package pkg.sub;
- public class Example3
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example3
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
</scons_example>
@@ -560,35 +560,35 @@
<scons_example name="java_javah_file">
<file name="SConstruct" printme="1">
- classes = Java(target = 'classes', source = 'src/pkg/sub')
- JavaH(target = File('native.h'), source = classes)
+classes = Java(target = 'classes', source = 'src/pkg/sub')
+JavaH(target = File('native.h'), source = classes)
</file>
<file name="src/pkg/sub/Example1.java">
- package pkg.sub;
- public class Example1
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
<file name="src/pkg/sub/Example2.java">
- package pkg.sub;
- public class Example2
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example2
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
<file name="src/pkg/sub/Example3.java">
- package pkg.sub;
- public class Example3
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example3
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
</scons_example>
@@ -629,26 +629,26 @@
<scons_example name="java_RMIC">
<file name="SConstruct" printme="1">
- classes = Java(target = 'classes', source = 'src/pkg/sub')
- RMIC(target = 'outdir', source = classes)
+classes = Java(target = 'classes', source = 'src/pkg/sub')
+RMIC(target = 'outdir', source = classes)
</file>
<file name="src/pkg/sub/Example1.java">
- package pkg.sub;
- public class Example1
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
<file name="src/pkg/sub/Example2.java">
- package pkg.sub;
- public class Example2
- {
- public static void main(String[] args)
- {
- }
- }
+package pkg.sub;
+public class Example2
+{
+ public static void main(String[] args)
+ {
+ }
+}
</file>
</scons_example>
diff --git a/doc/user/less-simple.xml b/doc/user/less-simple.xml
index 53e64331..41a1f3d4 100644
--- a/doc/user/less-simple.xml
+++ b/doc/user/less-simple.xml
@@ -72,7 +72,7 @@
</para>
<programlisting>
- Program('hello.c')
+Program('hello.c')
</programlisting>
<para>
@@ -86,10 +86,10 @@
<scons_example name="lesssimple_target">
<file name="SConstruct" printme="1">
- Program('new_hello', 'hello.c')
+Program('new_hello', 'hello.c')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -147,16 +147,16 @@
<scons_example name="lesssimple_ex2">
<file name="SConstruct" printme="1">
- Program(['prog.c', 'file1.c', 'file2.c'])
+Program(['prog.c', 'file1.c', 'file2.c'])
</file>
<file name="prog.c">
- int main() { printf("prog.c\n"); }
+int main() { printf("prog.c\n"); }
</file>
<file name="file1.c">
- void file1() { printf("file1.c\n"); }
+void file1() { printf("file1.c\n"); }
</file>
<file name="file2.c">
- void file2() { printf("file2.c\n"); }
+void file2() { printf("file2.c\n"); }
</file>
</scons_example>
@@ -194,16 +194,16 @@
<scons_example name="lesssimple_ex3">
<file name="SConstruct" printme="1">
- Program('program', ['prog.c', 'file1.c', 'file2.c'])
+Program('program', ['prog.c', 'file1.c', 'file2.c'])
</file>
<file name="prog.c">
- int main() { printf("prog.c\n"); }
+int main() { printf("prog.c\n"); }
</file>
<file name="file1.c">
- void file1() { printf("file1.c\n"); }
+void file1() { printf("file1.c\n"); }
</file>
<file name="file2.c">
- void file2() { printf("file2.c\n"); }
+void file2() { printf("file2.c\n"); }
</file>
</scons_example>
@@ -247,7 +247,7 @@
</para>
<sconstruct>
- Program('program', Glob('*.c'))
+Program('program', Glob('*.c'))
</sconstruct>
<para>
@@ -275,7 +275,7 @@
</para>
<sconstruct>
- Program('hello', ['file1.c', 'file2.c'])
+Program('hello', ['file1.c', 'file2.c'])
</sconstruct>
<para>
@@ -285,7 +285,7 @@
</para>
<sconstruct>
- Program('hello', 'hello.c')
+Program('hello', 'hello.c')
</sconstruct>
<para>
@@ -296,7 +296,7 @@
</para>
<sconstruct>
- Program('hello', ['hello.c'])
+Program('hello', ['hello.c'])
</sconstruct>
<para>
@@ -324,9 +324,9 @@
</para>
<sconstruct>
- # The following two calls both work correctly:
- Program('program1', 'program1.c')
- Program('program2', ['program2.c'])
+# The following two calls both work correctly:
+Program('program1', 'program1.c')
+Program('program2', ['program2.c'])
</sconstruct>
<para>
@@ -337,15 +337,15 @@
</para>
<sconstruct>
- common_sources = ['file1.c', 'file2.c']
+common_sources = ['file1.c', 'file2.c']
- # THE FOLLOWING IS INCORRECT AND GENERATES A PYTHON ERROR
- # BECAUSE IT TRIES TO ADD A STRING TO A LIST:
- Program('program1', common_sources + 'program1.c')
+# THE FOLLOWING IS INCORRECT AND GENERATES A PYTHON ERROR
+# BECAUSE IT TRIES TO ADD A STRING TO A LIST:
+Program('program1', common_sources + 'program1.c')
- # The following works correctly, because it's adding two
- # lists together to make another list.
- Program('program2', common_sources + ['program2.c'])
+# The following works correctly, because it's adding two
+# lists together to make another list.
+Program('program2', common_sources + ['program2.c'])
</sconstruct>
</important>
@@ -383,7 +383,7 @@
</para>
<programlisting>
- Program('program', Split('main.c file1.c file2.c'))
+Program('program', Split('main.c file1.c file2.c'))
</programlisting>
<para>
@@ -417,8 +417,8 @@
</para>
<programlisting>
- src_files = Split('main.c file1.c file2.c')
- Program('program', src_files)
+src_files = Split('main.c file1.c file2.c')
+Program('program', src_files)
</programlisting>
<para>
@@ -433,10 +433,10 @@
</para>
<programlisting>
- src_files = Split("""main.c
- file1.c
- file2.c""")
- Program('program', src_files)
+src_files = Split("""main.c
+ file1.c
+ file2.c""")
+Program('program', src_files)
</programlisting>
<para>
@@ -469,8 +469,8 @@
</para>
<programlisting>
- src_files = Split('main.c file1.c file2.c')
- Program(target = 'program', source = src_files)
+src_files = Split('main.c file1.c file2.c')
+Program(target = 'program', source = src_files)
</programlisting>
<para>
@@ -482,8 +482,8 @@
</para>
<programlisting>
- src_files = Split('main.c file1.c file2.c')
- Program(source = src_files, target = 'program')
+src_files = Split('main.c file1.c file2.c')
+Program(source = src_files, target = 'program')
</programlisting>
<para>
@@ -514,17 +514,17 @@
<scons_example name="lesssimple_ex4">
<file name="SConstruct" printme="1">
- Program('foo.c')
- Program('bar', ['bar1.c', 'bar2.c'])
+Program('foo.c')
+Program('bar', ['bar1.c', 'bar2.c'])
</file>
<file name="foo.c">
- int main() { printf("foo.c\n"); }
+int main() { printf("foo.c\n"); }
</file>
<file name="bar1.c">
- int main() { printf("bar1.c\n"); }
+int main() { printf("bar1.c\n"); }
</file>
<file name="bar2.c">
- void bar2() { printf("bar2.c\n"); }
+void bar2() { printf("bar2.c\n"); }
</file>
</scons_example>
@@ -579,23 +579,23 @@
<scons_example name="lesssimple_ex5">
<file name="SConstruct" printme="1">
- Program(Split('foo.c common1.c common2.c'))
- Program('bar', Split('bar1.c bar2.c common1.c common2.c'))
+Program(Split('foo.c common1.c common2.c'))
+Program('bar', Split('bar1.c bar2.c common1.c common2.c'))
</file>
<file name="foo.c">
- int main() { printf("foo.c\n"); }
+int main() { printf("foo.c\n"); }
</file>
<file name="bar1.c">
- int main() { printf("bar1.c\n"); }
+int main() { printf("bar1.c\n"); }
</file>
<file name="bar2.c">
- int bar2() { printf("bar2.c\n"); }
+int bar2() { printf("bar2.c\n"); }
</file>
<file name="common1.c">
- void common1() { printf("common1.c\n"); }
+void common1() { printf("common1.c\n"); }
</file>
<file name="common2.c">
- void common22() { printf("common2.c\n"); }
+void common22() { printf("common2.c\n"); }
</file>
</scons_example>
@@ -628,11 +628,11 @@
</para>
<programlisting>
- common = ['common1.c', 'common2.c']
- foo_files = ['foo.c'] + common
- bar_files = ['bar1.c', 'bar2.c'] + common
- Program('foo', foo_files)
- Program('bar', bar_files)
+common = ['common1.c', 'common2.c']
+foo_files = ['foo.c'] + common
+bar_files = ['bar1.c', 'bar2.c'] + common
+Program('foo', foo_files)
+Program('bar', bar_files)
</programlisting>
<para>
diff --git a/doc/user/libraries.xml b/doc/user/libraries.xml
index 1b43a480..63d4544c 100644
--- a/doc/user/libraries.xml
+++ b/doc/user/libraries.xml
@@ -65,16 +65,16 @@
<scons_example name="libraries_ex1" printme="1">
<file name="SConstruct" printme="1">
- Library('foo', ['f1.c', 'f2.c', 'f3.c'])
+Library('foo', ['f1.c', 'f2.c', 'f3.c'])
</file>
<file name="f1.c">
- void f1() { printf("f1.c\n"); }
+void f1() { printf("f1.c\n"); }
</file>
<file name="f2.c">
- void f2() { printf("f2.c\n"); }
+void f2() { printf("f2.c\n"); }
</file>
<file name="f3.c">
- void f3() { printf("f3.c\n"); }
+void f3() { printf("f3.c\n"); }
</file>
</scons_example>
@@ -131,19 +131,19 @@
<scons_example name="libraries_objects" printme="1">
<file name="SConstruct" printme="1">
- Library('foo', ['f1.c', 'f2.o', 'f3.c', 'f4.o'])
+Library('foo', ['f1.c', 'f2.o', 'f3.c', 'f4.o'])
</file>
<file name="f1.c">
- void f1() { printf("f1.c\n"); }
+void f1() { printf("f1.c\n"); }
</file>
<file name="f2.o">
- object file
+object file
</file>
<file name="f3.c">
- void f3() { printf("f3.c\n"); }
+void f3() { printf("f3.c\n"); }
</file>
<file name="f4.o">
- object file
+object file
</file>
</scons_example>
@@ -186,7 +186,7 @@
<scons_example name="libraries_StaticLibrary" printme="1">
<file name="SConstruct" printme="1">
- StaticLibrary('foo', ['f1.c', 'f2.c', 'f3.c'])
+StaticLibrary('foo', ['f1.c', 'f2.c', 'f3.c'])
</file>
</scons_example>
@@ -212,16 +212,16 @@
<scons_example name="libraries_SharedLibrary" printme="1">
<file name="SConstruct" printme="1">
- SharedLibrary('foo', ['f1.c', 'f2.c', 'f3.c'])
+SharedLibrary('foo', ['f1.c', 'f2.c', 'f3.c'])
</file>
<file name="f1.c">
- void f1() { printf("f1.c\n"); }
+void f1() { printf("f1.c\n"); }
</file>
<file name="f2.c">
- void f2() { printf("f2.c\n"); }
+void f2() { printf("f2.c\n"); }
</file>
<file name="f3.c">
- void f3() { printf("f3.c\n"); }
+void f3() { printf("f3.c\n"); }
</file>
</scons_example>
@@ -280,20 +280,20 @@
<scons_example name="libraries_ex2">
<file name="SConstruct" printme="1">
- Library('foo', ['f1.c', 'f2.c', 'f3.c'])
- Program('prog.c', LIBS=['foo', 'bar'], LIBPATH='.')
+Library('foo', ['f1.c', 'f2.c', 'f3.c'])
+Program('prog.c', LIBS=['foo', 'bar'], LIBPATH='.')
</file>
<file name="f1.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="f2.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="f3.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="prog.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -347,7 +347,7 @@
</para>
<sconstruct>
- Program('prog.c', LIBS='foo', LIBPATH='.')
+Program('prog.c', LIBS='foo', LIBPATH='.')
</sconstruct>
<para>
@@ -357,7 +357,7 @@
</para>
<sconstruct>
- Program('prog.c', LIBS=['foo'], LIBPATH='.')
+Program('prog.c', LIBS=['foo'], LIBPATH='.')
</sconstruct>
<para>
@@ -387,11 +387,11 @@
<scons_example name="libraries_ex3">
<file name="SConstruct" printme="1">
- Program('prog.c', LIBS = 'm',
- LIBPATH = ['/usr/lib', '/usr/local/lib'])
+Program('prog.c', LIBS = 'm',
+ LIBPATH = ['/usr/lib', '/usr/local/lib'])
</file>
<file name="prog.c">
- int main() { printf("prog.c\n"); }
+int main() { printf("prog.c\n"); }
</file>
</scons_example>
@@ -406,7 +406,7 @@
</para>
<sconstruct>
- LIBPATH = '/usr/lib:/usr/local/lib'
+LIBPATH = '/usr/lib:/usr/local/lib'
</sconstruct>
<para>
@@ -416,7 +416,7 @@
</para>
<sconstruct>
- LIBPATH = 'C:\\lib;D:\\lib'
+LIBPATH = 'C:\\lib;D:\\lib'
</sconstruct>
<para>
diff --git a/doc/user/main.xml b/doc/user/main.xml
index cb516e14..60dd8c92 100644
--- a/doc/user/main.xml
+++ b/doc/user/main.xml
@@ -85,6 +85,7 @@
<releaseinfo>version &buildversion;</releaseinfo>
+ <mediaobject role="cover"><imageobject><imagedata fileref="cover.jpg" format="JPG"/></imageobject></mediaobject>
</bookinfo>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="preface.xml"/>
diff --git a/doc/user/mergeflags.xml b/doc/user/mergeflags.xml
index 393cfbc6..1143ee98 100644
--- a/doc/user/mergeflags.xml
+++ b/doc/user/mergeflags.xml
@@ -73,11 +73,11 @@
<scons_example name="mergeflags_MergeFlags1">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Append(CCFLAGS = '-option -O3 -O1')
- flags = { 'CCFLAGS' : '-whatever -O3' }
- env.MergeFlags(flags)
- print env['CCFLAGS']
+env = Environment()
+env.Append(CCFLAGS = '-option -O3 -O1')
+flags = { 'CCFLAGS' : '-whatever -O3' }
+env.MergeFlags(flags)
+print env['CCFLAGS']
</file>
</scons_example>
@@ -100,11 +100,11 @@
<scons_example name="mergeflags_MergeFlags2">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include'])
- flags = { 'CPPPATH' : ['/usr/opt/include', '/usr/local/include'] }
- env.MergeFlags(flags)
- print env['CPPPATH']
+env = Environment()
+env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include'])
+flags = { 'CPPPATH' : ['/usr/opt/include', '/usr/local/include'] }
+env.MergeFlags(flags)
+print env['CPPPATH']
</file>
</scons_example>
@@ -134,12 +134,12 @@
<scons_example name="mergeflags_MergeFlags3">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Append(CCFLAGS = '-option -O3 -O1')
- env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include'])
- env.MergeFlags('-whatever -I/usr/opt/include -O3 -I/usr/local/include')
- print env['CCFLAGS']
- print env['CPPPATH']
+env = Environment()
+env.Append(CCFLAGS = '-option -O3 -O1')
+env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include'])
+env.MergeFlags('-whatever -I/usr/opt/include -O3 -I/usr/local/include')
+print env['CCFLAGS']
+print env['CPPPATH']
</file>
</scons_example>
diff --git a/doc/user/misc.xml b/doc/user/misc.xml
index 37393027..d0aeb59f 100644
--- a/doc/user/misc.xml
+++ b/doc/user/misc.xml
@@ -91,14 +91,14 @@
<scons_example name="misc_EnsurePythonVersion">
<file name="SConstruct" printme="1">
- EnsurePythonVersion(2, 5)
+EnsurePythonVersion(2, 5)
</file>
</scons_example>
-->
<sconstruct>
- EnsurePythonVersion(2, 5)
+EnsurePythonVersion(2, 5)
</sconstruct>
<para>
@@ -122,8 +122,8 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- Python 2.5 or greater required, but you have Python 2.3.6
+% <userinput>scons -Q</userinput>
+Python 2.5 or greater required, but you have Python 2.3.6
</screen>
</section>
@@ -160,14 +160,14 @@
<scons_example name="misc_EnsureSConsVersion">
<file name="SConstruct" printme="1">
- EnsureSConsVersion(1, 0)
+EnsureSConsVersion(1, 0)
</file>
</scons_example>
-->
<sconstruct>
- EnsureSConsVersion(1, 0)
+EnsureSConsVersion(1, 0)
</sconstruct>
<para>
@@ -191,8 +191,8 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- SCons 1.0 or greater required, but you have SCons 0.98.5
+% <userinput>scons -Q</userinput>
+SCons 1.0 or greater required, but you have SCons 0.98.5
</screen>
</section>
@@ -212,14 +212,14 @@
<scons_example name="misc_Exit">
<file name="SConstruct" printme="1">
- if ARGUMENTS.get('FUTURE'):
- print "The FUTURE option is not supported yet!"
- Exit(2)
- env = Environment()
- env.Program('hello.c')
+if ARGUMENTS.get('FUTURE'):
+ print "The FUTURE option is not supported yet!"
+ Exit(2)
+env = Environment()
+env.Program('hello.c')
</file>
<file name="hello.c">
- hello.c
+hello.c
</file>
</scons_example>
@@ -268,13 +268,13 @@
<scons_example name="misc_FindFile1a">
<file name="SConstruct" printme="1">
- # one directory
- print FindFile('missing', '.')
- t = FindFile('exists', '.')
- print t.__class__, t
+# one directory
+print FindFile('missing', '.')
+t = FindFile('exists', '.')
+print t.__class__, t
</file>
<file name="exists">
- exists
+ exists
</file>
</scons_example>
@@ -284,23 +284,23 @@
<scons_example name="misc_FindFile1b">
<file name="SConstruct" printme="1">
- # several directories
- includes = [ '.', 'include', 'src/include']
- headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h']
- for hdr in headers:
- print '%-12s' % ('%s:' % hdr), FindFile(hdr, includes)
+# several directories
+includes = [ '.', 'include', 'src/include']
+headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h']
+for hdr in headers:
+ print '%-12s' % ('%s:' % hdr), FindFile(hdr, includes)
</file>
<file name="config.h">
- exists
+exists
</file>
<directory name="src"></directory>
<directory name="src/include"></directory>
<file name="src/include/private.h">
- exists
+exists
</file>
<directory name="include"></directory>
<file name="include/dist.h">
- exists
+exists
</file>
</scons_example>
@@ -318,23 +318,23 @@
<scons_example name="misc_FindFile1c">
<file name="SConstruct" printme="1">
- # several directories
- includes = [ '.', 'include', 'src/include']
- headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h']
- print FindFile(headers, includes)
+# several directories
+includes = [ '.', 'include', 'src/include']
+headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h']
+print FindFile(headers, includes)
</file>
<file name="config.h">
- exists
+exists
</file>
<directory name="src"></directory>
<directory name="src/include"></directory>
</file>
<file name="src/include/private.h">
- exists
+exists
<directory name="include"></directory>
</file>
<file name="include/dist.h">
- exists
+exists
</scons_example>
<scons_output example="misc_FindFile1c" os="posix" suffix="1">
@@ -351,21 +351,21 @@
<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">
- exists
+exists
</file>
<directory name="sub2"></directory>
<file name="sub2/multiple">
- exists
+exists
</file>
<directory name="sub3"></directory>
<file name="sub3/multiple">
- exists
+exists
</file>
</scons_example>
@@ -385,10 +385,10 @@
<scons_example name="misc_FindFile2">
<file name="SConstruct" printme="1">
- # Neither file exists, so build will fail
- Command('derived', 'leaf', 'cat >$TARGET $SOURCE')
- print FindFile('leaf', '.')
- print FindFile('derived', '.')
+# Neither file exists, so build will fail
+Command('derived', 'leaf', 'cat >$TARGET $SOURCE')
+print FindFile('leaf', '.')
+print FindFile('derived', '.')
</file>
</scons_example>
@@ -398,13 +398,13 @@
<scons_example name="misc_FindFile2">
<file name="SConstruct" printme="1">
- # Only 'leaf' exists
- Command('derived', 'leaf', 'cat >$TARGET $SOURCE')
- print FindFile('leaf', '.')
- print FindFile('derived', '.')
+# Only 'leaf' exists
+Command('derived', 'leaf', 'cat >$TARGET $SOURCE')
+print FindFile('leaf', '.')
+print FindFile('derived', '.')
</file>
<file name="leaf">
- leaf
+leaf
</file>
</scons_example>
@@ -421,13 +421,13 @@
<scons_example name="misc_FindFile3">
<file name="SConstruct" printme="1">
- # Only 'src/leaf' exists
- VariantDir('build', 'src')
- print FindFile('leaf', 'build')
+# Only 'src/leaf' exists
+VariantDir('build', 'src')
+print FindFile('leaf', 'build')
</file>
<directory name="src"></directory>
<file name="src/leaf">
- leaf
+leaf
</file>
</scons_example>
@@ -460,17 +460,17 @@
<scons_example name="misc_Flatten1">
<file name="SConstruct" printme="1">
- objects = [
- Object('prog1.c'),
- Object('prog2.c', CCFLAGS='-DFOO'),
- ]
- Program(objects)
+objects = [
+ Object('prog1.c'),
+ Object('prog2.c', CCFLAGS='-DFOO'),
+]
+Program(objects)
</file>
<file name="prog1.c">
- prog1.c
+prog1.c
</file>
<file name="prog2.c">
- prog2.c
+prog2.c
</file>
</scons_example>
@@ -501,20 +501,20 @@
<scons_example name="misc_Flatten2">
<file name="SConstruct" printme="1">
- objects = [
- Object('prog1.c'),
- Object('prog2.c', CCFLAGS='-DFOO'),
- ]
- Program(objects)
+objects = [
+ Object('prog1.c'),
+ Object('prog2.c', CCFLAGS='-DFOO'),
+]
+Program(objects)
- for object_file in objects:
- print object_file.abspath
+for object_file in objects:
+ print object_file.abspath
</file>
<file name="prog1.c">
- prog1.c
+prog1.c
</file>
<file name="prog2.c">
- prog2.c
+prog2.c
</file>
</scons_example>
@@ -542,20 +542,20 @@
<scons_example name="misc_Flatten3">
<file name="SConstruct" printme="1">
- objects = [
- Object('prog1.c'),
- Object('prog2.c', CCFLAGS='-DFOO'),
- ]
- Program(objects)
+objects = [
+ Object('prog1.c'),
+ Object('prog2.c', CCFLAGS='-DFOO'),
+]
+Program(objects)
- for object_file in Flatten(objects):
- print object_file.abspath
+for object_file in Flatten(objects):
+ print object_file.abspath
</file>
<file name="prog1.c">
- prog1.c
+prog1.c
</file>
<file name="prog2.c">
- prog2.c
+prog2.c
</file>
</scons_example>
@@ -570,12 +570,12 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- /home/me/project/prog1.o
- /home/me/project/prog2.o
- cc -o prog1.o -c prog1.c
- cc -o prog2.o -c -DFOO prog2.c
- cc -o prog1 prog1.o prog2.o
+% <userinput>scons -Q</userinput>
+/home/me/project/prog1.o
+/home/me/project/prog2.o
+cc -o prog1.o -c prog1.c
+cc -o prog2.o -c -DFOO prog2.c
+cc -o prog1 prog1.o prog2.o
</screen>
</section>
@@ -592,12 +592,12 @@
</para>
<sconstruct>
- env = Environment(
- LAUNCHDIR = GetLaunchDir(),
- )
- env.Command('directory_build_info',
- '$LAUNCHDIR/build_info'
- Copy('$TARGET', '$SOURCE'))
+env = Environment(
+ LAUNCHDIR = GetLaunchDir(),
+)
+env.Command('directory_build_info',
+ '$LAUNCHDIR/build_info'
+ Copy('$TARGET', '$SOURCE'))
</sconstruct>
<para>
diff --git a/doc/user/nodes.xml b/doc/user/nodes.xml
index 9b5a7d6b..1c9b4fd9 100644
--- a/doc/user/nodes.xml
+++ b/doc/user/nodes.xml
@@ -80,8 +80,8 @@
</para>
<sconstruct>
- Object('hello.c', CCFLAGS='-DHELLO')
- Object('goodbye.c', CCFLAGS='-DGOODBYE')
+Object('hello.c', CCFLAGS='-DHELLO')
+Object('goodbye.c', CCFLAGS='-DGOODBYE')
</sconstruct>
<para>
@@ -95,9 +95,9 @@
</para>
<sconstruct>
- Object('hello.c', CCFLAGS='-DHELLO')
- Object('goodbye.c', CCFLAGS='-DGOODBYE')
- Program(['hello.o', 'goodbye.o'])
+Object('hello.c', CCFLAGS='-DHELLO')
+Object('goodbye.c', CCFLAGS='-DGOODBYE')
+Program(['hello.o', 'goodbye.o'])
</sconstruct>
<para>
@@ -123,15 +123,15 @@
<scons_example name="nodes_ex1">
<file name="SConstruct" printme="1">
- hello_list = Object('hello.c', CCFLAGS='-DHELLO')
- goodbye_list = Object('goodbye.c', CCFLAGS='-DGOODBYE')
- Program(hello_list + goodbye_list)
+hello_list = Object('hello.c', CCFLAGS='-DHELLO')
+goodbye_list = Object('goodbye.c', CCFLAGS='-DGOODBYE')
+Program(hello_list + goodbye_list)
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="goodbye.c">
- int main() { printf("Goodbye, world!\n"); }
+int main() { printf("Goodbye, world!\n"); }
</file>
</scons_example>
@@ -183,11 +183,11 @@
<scons_example name="nodes_print">
<file name="SConstruct" printme="1">
- hello_c = File('hello.c')
- Program(hello_c)
+hello_c = File('hello.c')
+Program(hello_c)
- classes = Dir('classes')
- Java(classes, 'src')
+classes = Dir('classes')
+Java(classes, 'src')
</file>
</scons_example>
@@ -229,7 +229,7 @@
</para>
<sconstruct>
- xyzzy = Entry('xyzzy')
+xyzzy = Entry('xyzzy')
</sconstruct>
<para>
@@ -263,13 +263,13 @@
<scons_example name="nodes_print">
<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]
+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]
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -330,14 +330,14 @@
<scons_example name="nodes_exists">
<file name="SConstruct" printme="1">
- 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!"
+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!"
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -372,9 +372,9 @@
<scons_example name="nodes_GetBuildPath">
<file name="SConstruct" printme="1">
- env=Environment(VAR="value")
- n=File("foo.c")
- print env.GetBuildPath([n, "sub/dir/$VAR"])
+env=Environment(VAR="value")
+n=File("foo.c")
+print env.GetBuildPath([n, "sub/dir/$VAR"])
</file>
</scons_example>
@@ -412,13 +412,13 @@
<scons_example name="nodes_read">
<file name="SConstruct" printme="1">
- hello_c = File('hello.c')
- contents = hello_c.read()
- print "contents are:"
- print contents
+hello_c = File('hello.c')
+contents = hello_c.read()
+print "contents are:"
+print contents
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
diff --git a/doc/user/output.xml b/doc/user/output.xml
index d601e720..069d525a 100644
--- a/doc/user/output.xml
+++ b/doc/user/output.xml
@@ -74,10 +74,10 @@
<scons_example name="output_ex1">
<file name="SConstruct" printme="1">
- Help("""
- Type: 'scons program' to build the production program,
- 'scons debug' to build the debug version.
- """)
+Help("""
+Type: 'scons program' to build the production program,
+ 'scons debug' to build the debug version.
+""")
</file>
</scons_example>
@@ -132,12 +132,12 @@
<scons_example name="output_ex2">
<file name="SConstruct" printme="1">
- env = Environment()
+env = Environment()
- Help("\nType: 'scons program' to build the production program.\n")
+Help("\nType: 'scons program' to build the production program.\n")
- if env['PLATFORM'] == 'win32':
- Help("\nType: 'scons windebug' to build the Windows debug version.\n")
+if env['PLATFORM'] == 'win32':
+ Help("\nType: 'scons windebug' to build the Windows debug version.\n")
</file>
</scons_example>
@@ -214,12 +214,12 @@
<scons_example name="output_COMSTR">
<file name="SConstruct" printme="1">
- env = Environment(CCCOMSTR = "Compiling $TARGET",
- LINKCOMSTR = "Linking $TARGET")
- env.Program('foo.c')
+env = Environment(CCCOMSTR = "Compiling $TARGET",
+ LINKCOMSTR = "Linking $TARGET")
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -238,9 +238,9 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- Compiling foo.o
- Linking foo
+% <userinput>scons -Q</userinput>
+Compiling foo.o
+Linking foo
</screen>
<para>
@@ -286,14 +286,14 @@
<scons_example name="output_COMSTR-VERBOSE">
<file name="SConstruct" printme="1">
- env = Environment()
- if ARGUMENTS.get('VERBOSE') != "1':
- env['CCCOMSTR'] = "Compiling $TARGET"
- env['LINKCOMSTR'] = "Linking $TARGET"
- env.Program('foo.c')
+env = Environment()
+if ARGUMENTS.get('VERBOSE') != "1':
+ env['CCCOMSTR'] = "Compiling $TARGET"
+ env['LINKCOMSTR'] = "Linking $TARGET"
+env.Program('foo.c')
</file>
<file name="foo.c">
- foo.c
+foo.c
</file>
</scons_example>
@@ -322,15 +322,15 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- Compiling foo.o
- Linking foo
- % <userinput>scons -Q -c</userinput>
- Removed foo.o
- Removed foo
- % <userinput>scons -Q VERBOSE=1</userinput>
- cc -o foo.o -c foo.c
- cc -o foo foo.o
+% <userinput>scons -Q</userinput>
+Compiling foo.o
+Linking foo
+% <userinput>scons -Q -c</userinput>
+Removed foo.o
+Removed foo
+% <userinput>scons -Q VERBOSE=1</userinput>
+cc -o foo.o -c foo.c
+cc -o foo foo.o
</screen>
</section>
@@ -372,15 +372,15 @@
<scons_example name="output_Progress-TARGET">
<file name="SConstruct" printme="1">
- Progress('Evaluating $TARGET\n')
- Program('f1.c')
- Program('f2.c')
+Progress('Evaluating $TARGET\n')
+Program('f1.c')
+Program('f2.c')
</file>
<file name="f1.c">
- f1.c
+f1.c
</file>
<file name="f2.c">
- f2.c
+f2.c
</file>
</scons_example>
@@ -425,11 +425,11 @@
</para>
<sconstruct>
- Progress('$TARGET\r',
- file=open('/dev/tty', 'w'),
- overwrite=True)
- Program('f1.c')
- Program('f2.c')
+Progress('$TARGET\r',
+ file=open('/dev/tty', 'w'),
+ overwrite=True)
+Program('f1.c')
+Program('f2.c')
</sconstruct>
<para>
@@ -482,9 +482,9 @@
</para>
<sconstruct>
- Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5)
- Program('f1.c')
- Program('f2.c')
+Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5)
+Program('f1.c')
+Program('f2.c')
</sconstruct>
<para>
@@ -522,13 +522,13 @@
<scons_example name="output_Progress-callable">
<file name="SConstruct" printme="1">
- screen = open('/dev/tty', 'w')
- count = 0
- def progress_function(node)
- count += 1
- screen.write('Node %4d: %s\r' % (count, node))
+screen = open('/dev/tty', 'w')
+count = 0
+def progress_function(node)
+ count += 1
+ screen.write('Node %4d: %s\r' % (count, node))
- Progress(progress_function)
+Progress(progress_function)
</file>
</scons_example>
@@ -595,13 +595,13 @@
<scons_example name="output_gbf1">
<file name="SConstruct" printme="1">
- import atexit
+import atexit
- def print_build_failures():
- from SCons.Script import GetBuildFailures
- for bf in GetBuildFailures():
- print "%s failed: %s" % (bf.node, bf.errstr)
- atexit.register(print_build_failures)
+def print_build_failures():
+ from SCons.Script import GetBuildFailures
+ for bf in GetBuildFailures():
+ print "%s failed: %s" % (bf.node, bf.errstr)
+atexit.register(print_build_failures)
</file>
</scons_example>
@@ -639,52 +639,52 @@
<scons_example name="output_gbf2">
<file name="SConstruct" printme="1">
- # Make the build fail if we pass fail=1 on the command line
- if ARGUMENTS.get('fail', 0):
- Command('target', 'source', ['/bin/false'])
-
- def bf_to_str(bf):
- """Convert an element of GetBuildFailures() to a string
- in a useful way."""
- import SCons.Errors
- if bf is None: # unknown targets product None in list
- return '(unknown tgt)'
- elif isinstance(bf, SCons.Errors.StopError):
- return str(bf)
- elif bf.node:
- return str(bf.node) + ': ' + bf.errstr
- elif bf.filename:
- return bf.filename + ': ' + bf.errstr
- return 'unknown failure: ' + bf.errstr
- import atexit
-
- def build_status():
- """Convert the build status to a 2-tuple, (status, msg)."""
- from SCons.Script import GetBuildFailures
- bf = GetBuildFailures()
- if bf:
- # bf is normally a list of build failures; if an element is None,
- # it's because of a target that scons doesn't know anything about.
- status = 'failed'
- failures_message = "\n".join(["Failed building %s" % bf_to_str(x)
- for x in bf if x is not None])
- else:
- # if bf is None, the build completed successfully.
- status = 'ok'
- failures_message = ''
- return (status, failures_message)
-
- def display_build_status():
- """Display the build status. Called by atexit.
- 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.
- elif status == 'ok':
- print "Build succeeded."
- print failures_message
-
- atexit.register(display_build_status)
+# Make the build fail if we pass fail=1 on the command line
+if ARGUMENTS.get('fail', 0):
+ Command('target', 'source', ['/bin/false'])
+
+def bf_to_str(bf):
+ """Convert an element of GetBuildFailures() to a string
+ in a useful way."""
+ import SCons.Errors
+ if bf is None: # unknown targets product None in list
+ return '(unknown tgt)'
+ elif isinstance(bf, SCons.Errors.StopError):
+ return str(bf)
+ elif bf.node:
+ return str(bf.node) + ': ' + bf.errstr
+ elif bf.filename:
+ return bf.filename + ': ' + bf.errstr
+ return 'unknown failure: ' + bf.errstr
+import atexit
+
+def build_status():
+ """Convert the build status to a 2-tuple, (status, msg)."""
+ from SCons.Script import GetBuildFailures
+ bf = GetBuildFailures()
+ if bf:
+ # bf is normally a list of build failures; if an element is None,
+ # it's because of a target that scons doesn't know anything about.
+ status = 'failed'
+ failures_message = "\n".join(["Failed building %s" % bf_to_str(x)
+ for x in bf if x is not None])
+ else:
+ # if bf is None, the build completed successfully.
+ status = 'ok'
+ failures_message = ''
+ return (status, failures_message)
+
+def display_build_status():
+ """Display the build status. Called by atexit.
+ 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.
+ elif status == 'ok':
+ print "Build succeeded."
+ print failures_message
+
+atexit.register(display_build_status)
</file>
</scons_example>
diff --git a/doc/user/parseconfig.xml b/doc/user/parseconfig.xml
index cf3531bb..6125812d 100644
--- a/doc/user/parseconfig.xml
+++ b/doc/user/parseconfig.xml
@@ -84,10 +84,10 @@
<scons_example name="parseconfig_ex1">
<file name="SConstruct" printme="1">
- env = Environment()
- env['CPPPATH'] = ['/lib/compat']
- env.ParseConfig("pkg-config x11 --cflags --libs")
- print env['CPPPATH']
+env = Environment()
+env['CPPPATH'] = ['/lib/compat']
+env.ParseConfig("pkg-config x11 --cflags --libs")
+print env['CPPPATH']
</file>
</scons_example>
@@ -111,9 +111,9 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- ['/lib/compat', '/usr/X11/include']
- scons: `.' is up to date.
+% <userinput>scons -Q</userinput>
+['/lib/compat', '/usr/X11/include']
+scons: `.' is up to date.
</screen>
<para>
@@ -136,10 +136,10 @@
<scons_example name="parseconfig_ex2">
<file name="SConstruct" printme="1">
- env = Environment()
- env.ParseConfig("pkg-config x11 --cflags --libs")
- env.ParseConfig("pkg-config x11 --cflags --libs")
- print env['CPPPATH']
+env = Environment()
+env.ParseConfig("pkg-config x11 --cflags --libs")
+env.ParseConfig("pkg-config x11 --cflags --libs")
+print env['CPPPATH']
</file>
</scons_example>
@@ -155,9 +155,9 @@
-->
<screen>
- % <userinput>scons -Q</userinput>
- ['/usr/X11/include']
- scons: `.' is up to date.
+% <userinput>scons -Q</userinput>
+['/usr/X11/include']
+scons: `.' is up to date.
</screen>
</section>
diff --git a/doc/user/parseflags.xml b/doc/user/parseflags.xml
index d20df80e..a3462a52 100644
--- a/doc/user/parseflags.xml
+++ b/doc/user/parseflags.xml
@@ -80,16 +80,16 @@
<scons_example name="parseflags_ex1">
<file name="SConstruct" printme="1">
- env = Environment()
- d = env.ParseFlags("-I/opt/include -L/opt/lib -lfoo")
- for k,v in sorted(d.items()):
- if v:
- print k, v
- env.MergeFlags(d)
- env.Program('f1.c')
+env = Environment()
+d = env.ParseFlags("-I/opt/include -L/opt/lib -lfoo")
+for k,v in sorted(d.items()):
+ if v:
+ print k, v
+env.MergeFlags(d)
+env.Program('f1.c')
</file>
<file name="f1.c">
- int main() { return 0; }
+int main() { return 0; }
</file>
</scons_example>
@@ -119,16 +119,16 @@
<scons_example name="parseflags_ex2">
<file name="SConstruct" printme="1">
- env = Environment()
- d = env.ParseFlags("-whatever")
- for k,v in sorted(d.items()):
- if v:
- print k, v
- env.MergeFlags(d)
- env.Program('f1.c')
+env = Environment()
+d = env.ParseFlags("-whatever")
+for k,v in sorted(d.items()):
+ if v:
+ print k, v
+env.MergeFlags(d)
+env.Program('f1.c')
</file>
<file name="f1.c">
- int main() { return 0; }
+ int main() { return 0; }
</file>
</scons_example>
@@ -145,16 +145,16 @@
<scons_example name="parseflags_ex3">
<file name="SConstruct" printme="1">
- env = Environment()
- d = env.ParseFlags(["-I/opt/include", ["-L/opt/lib", "-lfoo"]])
- for k,v in sorted(d.items()):
- if v:
- print k, v
- env.MergeFlags(d)
- env.Program('f1.c')
+env = Environment()
+d = env.ParseFlags(["-I/opt/include", ["-L/opt/lib", "-lfoo"]])
+for k,v in sorted(d.items()):
+ if v:
+ print k, v
+env.MergeFlags(d)
+env.Program('f1.c')
</file>
<file name="f1.c">
- int main() { return 0; }
+int main() { return 0; }
</file>
</scons_example>
@@ -172,16 +172,16 @@
<scons_example name="parseflags_ex4">
<file name="SConstruct" printme="1">
- env = Environment()
- d = env.ParseFlags(["!echo -I/opt/include", "!echo -L/opt/lib", "-lfoo"])
- for k,v in sorted(d.items()):
- if v:
- print k, v
- env.MergeFlags(d)
- env.Program('f1.c')
+env = Environment()
+d = env.ParseFlags(["!echo -I/opt/include", "!echo -L/opt/lib", "-lfoo"])
+for k,v in sorted(d.items()):
+ if v:
+ print k, v
+env.MergeFlags(d)
+env.Program('f1.c')
</file>
<file name="f1.c">
- int main() { return 0; }
+int main() { return 0; }
</file>
</scons_example>
diff --git a/doc/user/pdf.xsl b/doc/user/pdf.xsl
index 652975f0..9c545925 100644
--- a/doc/user/pdf.xsl
+++ b/doc/user/pdf.xsl
@@ -67,5 +67,9 @@ set toc,title
<xsl:apply-templates select="." mode="vl.as.blocks"/>
</xsl:template>
+<!-- Prevent our EPUB cover image from getting printed to the PDF -->
+<xsl:template match="mediaobject[@role = 'cover']">
+</xsl:template>
+
</xsl:stylesheet>
diff --git a/doc/user/repositories.xml b/doc/user/repositories.xml
index 8e8ba4eb..4ff8b931 100644
--- a/doc/user/repositories.xml
+++ b/doc/user/repositories.xml
@@ -96,12 +96,12 @@
<scons_example name="repositories_ex1">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Program('hello.c')
- Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2')
+env = Environment()
+env.Program('hello.c')
+Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -165,12 +165,12 @@
<scons_example name="repositories_ex2">
<file name="SConstruct">
- env = Environment()
- env.Program('hello.c')
- Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2')
+env = Environment()
+env.Program('hello.c')
+Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2')
</file>
<file name="__ROOT__/usr/repository1/hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -188,12 +188,12 @@
<scons_example name="repositories_ex3">
<file name="SConstruct">
- env = Environment()
- env.Program('hello.c')
- Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2')
+env = Environment()
+env.Program('hello.c')
+Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2')
</file>
<file name="__ROOT__/usr/repository2/hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -238,9 +238,9 @@
</para>
<screen>
- % <userinput>scons -Q</userinput>
- cc -o hello.o -c hello.c
- hello.c:1: hello.h: No such file or directory
+% <userinput>scons -Q</userinput>
+cc -o hello.o -c hello.c
+hello.c:1: hello.h: No such file or directory
</screen>
<para>
@@ -256,12 +256,12 @@
<scons_example name="repositories_CPPPATH">
<file name="SConstruct" printme="1">
- env = Environment(CPPPATH = ['.'])
- env.Program('hello.c')
- Repository('__ROOT__/usr/repository1')
+env = Environment(CPPPATH = ['.'])
+env.Program('hello.c')
+Repository('__ROOT__/usr/repository1')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -292,12 +292,12 @@
<scons_example name="repositories_CPPPATH3">
<file name="SConstruct" printme="1">
- env = Environment(CPPPATH = ['dir1', 'dir2', 'dir3'])
- env.Program('hello.c')
- Repository('__ROOT__/r1', '__ROOT__/r2')
+env = Environment(CPPPATH = ['dir1', 'dir2', 'dir3'])
+env.Program('hello.c')
+Repository('__ROOT__/r1', '__ROOT__/r2')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -355,13 +355,13 @@ coming into existence.)
</para>
<programlisting>
- #include "hello.h"
- int
- main(int argc, char *argv[])
- {
- printf(HELLO_MESSAGE);
- return (0);
- }
+#include "hello.h"
+int
+main(int argc, char *argv[])
+{
+ printf(HELLO_MESSAGE);
+ return (0);
+}
</programlisting>
<para>
@@ -376,12 +376,12 @@ coming into existence.)
<scons_example name="repositories_quote1">
<file name="SConstruct">
- env = Environment(CPPPATH = ['.'])
- env.Program('hello.c')
- Repository('__ROOT__/usr/repository1')
+env = Environment(CPPPATH = ['.'])
+env.Program('hello.c')
+Repository('__ROOT__/usr/repository1')
</file>
<file name="__ROOT__/usr/repository1/hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -471,7 +471,7 @@ coming into existence.)
</para>
<screen>
- % <userinput>scons -Q -Y /usr/repository1 -Y /usr/repository2</userinput>
+% <userinput>scons -Q -Y /usr/repository1 -Y /usr/repository2</userinput>
</screen>
<para>
@@ -515,18 +515,18 @@ coming into existence.)
<scons_example name="repositories_ex4">
<file name="SConstruct">
- env = Environment()
- env.Program(['hello.c', 'file1.c', 'file2.c'])
- Repository('/usr/repository1', '/usr/repository2')
+env = Environment()
+env.Program(['hello.c', 'file1.c', 'file2.c'])
+Repository('/usr/repository1', '/usr/repository2')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="file1.c">
- int f1() { printf("file1\n"); }
+int f1() { printf("file1\n"); }
</file>
<file name="file2.c">
- int f2() { printf("file2.c\n"); }
+int f2() { printf("file2.c\n"); }
</file>
</scons_example>
@@ -563,11 +563,11 @@ coming into existence.)
</scons_output>
-->
<screen>
- % <userinput>cd $HOME/build</userinput>
- % <userinput>edit hello.c</userinput>
- % <userinput>scons -Q -Y /usr/repository1</userinput>
- cc -c -o hello.o hello.c
- cc -o hello hello.o /usr/repository1/file1.o /usr/repository1/file2.o
+% <userinput>cd $HOME/build</userinput>
+% <userinput>edit hello.c</userinput>
+% <userinput>scons -Q -Y /usr/repository1</userinput>
+cc -c -o hello.o hello.c
+cc -o hello hello.o /usr/repository1/file1.o /usr/repository1/file2.o
</screen>
<para>
@@ -594,10 +594,10 @@ coming into existence.)
</para>
<screen>
- % <userinput>mkdir $HOME/build2</userinput>
- % <userinput>cd $HOME/build2</userinput>
- % <userinput>scons -Q -Y /usr/all/repository hello</userinput>
- scons: `hello' is up-to-date.
+% <userinput>mkdir $HOME/build2</userinput>
+% <userinput>cd $HOME/build2</userinput>
+% <userinput>scons -Q -Y /usr/all/repository hello</userinput>
+scons: `hello' is up-to-date.
</screen>
<para>
@@ -627,12 +627,12 @@ coming into existence.)
<scons_example name="repositories_ex5">
<file name="SConstruct" printme="1">
- env = Environment()
- hello = env.Program('hello.c')
- Local(hello)
+env = Environment()
+hello = env.Program('hello.c')
+Local(hello)
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -646,9 +646,9 @@ coming into existence.)
</para>
<screen>
- % <userinput>scons -Y /usr/all/repository hello</userinput>
- Local copy of hello from /usr/all/repository/hello
- scons: `hello' is up-to-date.
+% <userinput>scons -Y /usr/all/repository hello</userinput>
+Local copy of hello from /usr/all/repository/hello
+scons: `hello' is up-to-date.
</screen>
<para>
diff --git a/doc/user/scanners.xml b/doc/user/scanners.xml
index 46b2a9f1..758a8490 100644
--- a/doc/user/scanners.xml
+++ b/doc/user/scanners.xml
@@ -172,7 +172,7 @@ over the file scanning rather than being called for each input line:
</para>
<programlisting>
- include filename.foo
+include filename.foo
</programlisting>
<para>
@@ -186,13 +186,13 @@ over the file scanning rather than being called for each input line:
</para>
<programlisting>
- import re
-
- include_re = re.compile(r'^include\s+(\S+)$', re.M)
-
- def kfile_scan(node, env, path, arg):
- contents = node.get_text_contents()
- return env.File(include_re.findall(contents))
+import re
+
+include_re = re.compile(r'^include\s+(\S+)$', re.M)
+
+def kfile_scan(node, env, path, arg):
+ contents = node.get_text_contents()
+ return env.File(include_re.findall(contents))
</programlisting>
<para>
@@ -295,9 +295,9 @@ over the file scanning rather than being called for each input line:
</para>
<programlisting>
- kscan = Scanner(function = kfile_scan,
- skeys = ['.k'])
- env.Append(SCANNERS = kscan)
+kscan = Scanner(function = kfile_scan,
+ skeys = ['.k'])
+env.Append(SCANNERS = kscan)
</programlisting>
<para>
@@ -308,34 +308,34 @@ over the file scanning rather than being called for each input line:
<scons_example name="scanners_scan">
<file name="SConstruct" printme="1">
- import re
+ import re
- include_re = re.compile(r'^include\s+(\S+)$', re.M)
+ include_re = re.compile(r'^include\s+(\S+)$', re.M)
- def kfile_scan(node, env, path):
- contents = node.get_text_contents()
- includes = include_re.findall(contents)
- return env.File(includes)
+ def kfile_scan(node, env, path):
+ contents = node.get_text_contents()
+ includes = include_re.findall(contents)
+ return env.File(includes)
- kscan = Scanner(function = kfile_scan,
- skeys = ['.k'])
+ kscan = Scanner(function = kfile_scan,
+ skeys = ['.k'])
- env = Environment(ENV = {'PATH' : '__ROOT__/usr/local/bin'})
- env.Append(SCANNERS = kscan)
+ env = Environment(ENV = {'PATH' : '__ROOT__/usr/local/bin'})
+ env.Append(SCANNERS = kscan)
- env.Command('foo', 'foo.k', 'kprocess &lt; $SOURCES &gt; $TARGET')
+ env.Command('foo', 'foo.k', 'kprocess &lt; $SOURCES &gt; $TARGET')
</file>
<file name="foo.k">
- include other_file
+include other_file
</file>
<file name="other_file">
- other_file
+other_file
</file>
<directory name="__ROOT__/usr"></directory>
<directory name="__ROOT__/usr/local"></directory>
<directory name="__ROOT__/usr/local/bin"></directory>
<file name="__ROOT_/usr/local/bin/kprocess" chmod="755">
- cat
+cat
</file>
</scons_example>
@@ -393,9 +393,9 @@ over the file scanning rather than being called for each input line:
<scons_example name="scanners_findpathdirs">
<file name="SConstruct" printme="1">
- kscan = Scanner(function = kfile_scan,
- skeys = ['.k'],
- path=FindPathDirs('KPATH'))
+kscan = Scanner(function = kfile_scan,
+ skeys = ['.k'],
+ path=FindPathDirs('KPATH'))
</file>
</scons_example>
diff --git a/doc/user/sconf.xml b/doc/user/sconf.xml
index 92fb4548..31bd45e0 100644
--- a/doc/user/sconf.xml
+++ b/doc/user/sconf.xml
@@ -80,10 +80,10 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env)
- # Checks for libraries, header files, etc. go here!
- env = conf.Finish()
+env = Environment()
+conf = Configure(env)
+# Checks for libraries, header files, etc. go here!
+env = conf.Finish()
</sconstruct>
<para>
@@ -131,14 +131,14 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env)
- if not conf.CheckCHeader('math.h'):
- print 'Math.h must be installed!'
- Exit(1)
- if conf.CheckCHeader('foo.h'):
- conf.env.Append('-DHAS_FOO_H')
- env = conf.Finish()
+env = Environment()
+conf = Configure(env)
+if not conf.CheckCHeader('math.h'):
+ print 'Math.h must be installed!'
+ Exit(1)
+if conf.CheckCHeader('foo.h'):
+ conf.env.Append('-DHAS_FOO_H')
+env = conf.Finish()
</sconstruct>
<para>
@@ -159,12 +159,12 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env)
- if not conf.CheckCXXHeader('vector.h'):
- print 'vector.h must be installed!'
- Exit(1)
- env = conf.Finish()
+env = Environment()
+conf = Configure(env)
+if not conf.CheckCXXHeader('vector.h'):
+ print 'vector.h must be installed!'
+ Exit(1)
+env = conf.Finish()
</sconstruct>
</section>
@@ -180,12 +180,12 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env)
- if not conf.CheckFunc('strcpy'):
- print 'Did not find strcpy(), using local version'
- conf.env.Append(CPPDEFINES = '-Dstrcpy=my_local_strcpy')
- env = conf.Finish()
+env = Environment()
+conf = Configure(env)
+if not conf.CheckFunc('strcpy'):
+ print 'Did not find strcpy(), using local version'
+ conf.env.Append(CPPDEFINES = '-Dstrcpy=my_local_strcpy')
+env = conf.Finish()
</sconstruct>
</section>
@@ -204,12 +204,12 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env)
- if not conf.CheckLib('m'):
- print 'Did not find libm.a or m.lib, exiting!'
- Exit(1)
- env = conf.Finish()
+env = Environment()
+conf = Configure(env)
+if not conf.CheckLib('m'):
+ print 'Did not find libm.a or m.lib, exiting!'
+ Exit(1)
+env = conf.Finish()
</sconstruct>
<para>
@@ -225,12 +225,12 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env)
- if not conf.CheckLibWithHeader('m', 'math.h', 'c'):
- print 'Did not find libm.a or m.lib, exiting!'
- Exit(1)
- env = conf.Finish()
+env = Environment()
+conf = Configure(env)
+if not conf.CheckLibWithHeader('m', 'math.h', 'c'):
+ print 'Did not find libm.a or m.lib, exiting!'
+ Exit(1)
+env = conf.Finish()
</sconstruct>
<para>
@@ -254,12 +254,12 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env)
- if not conf.CheckType('off_t'):
- print 'Did not find off_t typedef, assuming int'
- conf.env.Append(CCFLAGS = '-Doff_t=int')
- env = conf.Finish()
+env = Environment()
+conf = Configure(env)
+if not conf.CheckType('off_t'):
+ print 'Did not find off_t typedef, assuming int'
+ conf.env.Append(CCFLAGS = '-Doff_t=int')
+env = conf.Finish()
</sconstruct>
<para>
@@ -273,12 +273,12 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env)
- if not conf.CheckType('off_t', '#include &amp;lt;sys/types.h&amp;gt;\n'):
- print 'Did not find off_t typedef, assuming int'
- conf.env.Append(CCFLAGS = '-Doff_t=int')
- env = conf.Finish()
+env = Environment()
+conf = Configure(env)
+if not conf.CheckType('off_t', '#include &amp;lt;sys/types.h&amp;gt;\n'):
+ print 'Did not find off_t typedef, assuming int'
+ conf.env.Append(CCFLAGS = '-Doff_t=int')
+env = conf.Finish()
</sconstruct>
</section>
@@ -303,20 +303,20 @@
</para>
<sconstruct>
- mylib_test_source_file = """
- #include &amp;lt;mylib.h&amp;gt;
- int main(int argc, char **argv)
- {
- MyLibrary mylib(argc, argv);
- return 0;
- }
- """
-
- def CheckMyLibrary(context):
- context.Message('Checking for MyLibrary...')
- result = context.TryLink(mylib_test_source_file, '.c')
- context.Result(result)
- return result
+mylib_test_source_file = """
+#include &amp;lt;mylib.h&amp;gt;
+int main(int argc, char **argv)
+{
+ MyLibrary mylib(argc, argv);
+ return 0;
+}
+"""
+
+def CheckMyLibrary(context):
+ context.Message('Checking for MyLibrary...')
+ result = context.TryLink(mylib_test_source_file, '.c')
+ context.Result(result)
+ return result
</sconstruct>
<para>
@@ -358,8 +358,8 @@
</para>
<sconstruct>
- env = Environment()
- conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
+env = Environment()
+conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
</sconstruct>
<para>
@@ -380,30 +380,30 @@
</para>
<sconstruct>
- mylib_test_source_file = """
- #include &amp;lt;mylib.h&amp;gt;
- int main(int argc, char **argv)
- {
- MyLibrary mylib(argc, argv);
- return 0;
- }
- """
-
- def CheckMyLibrary(context):
- context.Message('Checking for MyLibrary... ')
- result = context.TryLink(mylib_test_source_file, '.c')
- context.Result(result)
- return result
-
- env = Environment()
- conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
- if not conf.CheckMyLibrary():
- print 'MyLibrary is not installed!'
- Exit(1)
- env = conf.Finish()
-
- # We would then add actual calls like Program() to build
- # something using the "env" construction environment.
+mylib_test_source_file = """
+#include &amp;lt;mylib.h&amp;gt;
+int main(int argc, char **argv)
+{
+ MyLibrary mylib(argc, argv);
+ return 0;
+}
+"""
+
+def CheckMyLibrary(context):
+ context.Message('Checking for MyLibrary... ')
+ result = context.TryLink(mylib_test_source_file, '.c')
+ context.Result(result)
+ return result
+
+env = Environment()
+conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
+if not conf.CheckMyLibrary():
+ print 'MyLibrary is not installed!'
+ Exit(1)
+env = conf.Finish()
+
+# We would then add actual calls like Program() to build
+# something using the "env" construction environment.
</sconstruct>
<para>
@@ -414,10 +414,10 @@
</para>
<screen>
- % <userinput>scons</userinput>
- scons: Reading SConscript file ...
- Checking for MyLibrary... failed
- MyLibrary is not installed!
+% <userinput>scons</userinput>
+scons: Reading SConscript file ...
+Checking for MyLibrary... failed
+MyLibrary is not installed!
</screen>
<para>
@@ -428,14 +428,14 @@
</para>
<screen>
- % <userinput>scons</userinput>
- scons: Reading SConscript file ...
- Checking for MyLibrary... failed
- scons: done reading SConscript
- scons: Building targets ...
- .
- .
- .
+% <userinput>scons</userinput>
+scons: Reading SConscript file ...
+Checking for MyLibrary... failed
+scons: done reading SConscript
+scons: Building targets ...
+ .
+ .
+ .
</screen>
</section>
@@ -455,10 +455,10 @@
</para>
<screen>
- % <userinput>scons -Q -c</userinput>
- Checking for MyLibrary... yes
- Removed foo.o
- Removed foo
+% <userinput>scons -Q -c</userinput>
+Checking for MyLibrary... yes
+Removed foo.o
+Removed foo
</screen>
<para>
@@ -474,19 +474,19 @@
</para>
<sconstruct>
- env = Environment()
- if not env.GetOption('clean'):
- conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
- if not conf.CheckMyLibrary():
- print 'MyLibrary is not installed!'
- Exit(1)
- env = conf.Finish()
+env = Environment()
+if not env.GetOption('clean'):
+ conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
+ if not conf.CheckMyLibrary():
+ print 'MyLibrary is not installed!'
+ Exit(1)
+ env = conf.Finish()
</sconstruct>
<screen>
- % <userinput>scons -Q -c</userinput>
- Removed foo.o
- Removed foo
+% <userinput>scons -Q -c</userinput>
+Removed foo.o
+Removed foo
</screen>
</section>
diff --git a/doc/user/separate.xml b/doc/user/separate.xml
index dfe83f65..0a2e0dbe 100644
--- a/doc/user/separate.xml
+++ b/doc/user/separate.xml
@@ -174,14 +174,14 @@ program using the F<build/foo.c> path name.
<scons_example name="separate_ex1">
<file name="SConstruct" printme="1">
- SConscript('src/SConscript', variant_dir='build')
+SConscript('src/SConscript', variant_dir='build')
</file>
<file name="src/SConscript">
- env = Environment()
- env.Program('hello.c')
+env = Environment()
+env.Program('hello.c')
</file>
<file name="src/hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -267,7 +267,7 @@ program using the F<build/foo.c> path name.
</para>
<sconstruct>
- #include "file.h"
+#include "file.h"
</sconstruct>
<para>
@@ -320,7 +320,7 @@ program using the F<build/foo.c> path name.
</para>
<sconstruct>
- SConscript('src/SConscript', variant_dir='build', duplicate=0)
+SConscript('src/SConscript', variant_dir='build', duplicate=0)
</sconstruct>
<para>
@@ -334,15 +334,15 @@ program using the F<build/foo.c> path name.
</para>
<screen>
- % <userinput>ls src</userinput>
- SConscript
- hello.c
- % <userinput>scons -Q</userinput>
- cc -c src/hello.c -o build/hello.o
- cc -o build/hello build/hello.o
- % <userinput>ls build</userinput>
- hello
- hello.o
+% <userinput>ls src</userinput>
+SConscript
+hello.c
+% <userinput>scons -Q</userinput>
+cc -c src/hello.c -o build/hello.o
+cc -o build/hello build/hello.o
+% <userinput>ls build</userinput>
+hello
+hello.o
</screen>
</section>
@@ -360,12 +360,12 @@ program using the F<build/foo.c> path name.
<scons_example name="separate_builddir">
<file name="SConstruct" printme="1">
- VariantDir('build', 'src')
- env = Environment()
- env.Program('build/hello.c')
+VariantDir('build', 'src')
+env = Environment()
+env.Program('build/hello.c')
</file>
<file name="src/hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -404,12 +404,12 @@ program using the F<build/foo.c> path name.
<scons_example name="separate_duplicate0">
<file name="SConstruct" printme="1">
- VariantDir('build', 'src', duplicate=0)
- env = Environment()
- env.Program('build/hello.c')
+VariantDir('build', 'src', duplicate=0)
+env = Environment()
+env.Program('build/hello.c')
</file>
<file name="src/hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -444,15 +444,15 @@ program using the F<build/foo.c> path name.
<scons_example name="separate_builddir_sconscript">
<file name="SConstruct">
- VariantDir('build', 'src')
- SConscript('build/SConscript')
+VariantDir('build', 'src')
+SConscript('build/SConscript')
</file>
<file name="src/SConscript" printme="1">
- env = Environment()
- env.Program('hello.c')
+env = Environment()
+env.Program('hello.c')
</file>
<file name="src/hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -502,22 +502,22 @@ program using the F<build/foo.c> path name.
<scons_example name="separate_glob_builddir_sconscript">
<file name="SConstruct">
- VariantDir('build', 'src')
- SConscript('build/SConscript')
+VariantDir('build', 'src')
+SConscript('build/SConscript')
</file>
<file name="src/SConscript" printme="1">
- env = Environment()
- env.Program('hello', Glob('*.c'))
+env = Environment()
+env.Program('hello', Glob('*.c'))
</file>
<file name="src/f1.c">
- #include "f2.h"
- int main() { printf(f2()); }
+#include "f2.h"
+int main() { printf(f2()); }
</file>
<file name="src/f2.c">
- const char * f2() { return("Hello, world!\n"); }
+const char * f2() { return("Hello, world!\n"); }
</file>
<file name="src/f2.h">
- const char * f2();
+const char * f2();
</file>
</scons_example>
diff --git a/doc/user/sideeffect.xml b/doc/user/sideeffect.xml
index c0c7ecab..cf959af3 100644
--- a/doc/user/sideeffect.xml
+++ b/doc/user/sideeffect.xml
@@ -77,12 +77,12 @@
<scons_example name="sideeffect_simple">
<file name="SConstruct" printme="1">
- env = Environment()
- f2 = env.Command('file2', 'log', Copy('$TARGET', '$SOURCE'))
- f1 = env.Command('file1', [],
- 'echo >$TARGET data1; echo >log updated file1'))
- env.SideEffect('log', env.Command('file1', [],
- 'echo >$TARGET data1; echo >log updated file1'))
+env = Environment()
+f2 = env.Command('file2', 'log', Copy('$TARGET', '$SOURCE'))
+f1 = env.Command('file1', [],
+ 'echo >$TARGET data1; echo >log updated file1'))
+env.SideEffect('log', env.Command('file1', [],
+ 'echo >$TARGET data1; echo >log updated file1'))
</file>
</scons_example>
@@ -114,11 +114,11 @@
</para>
<screen>
- env = Environment()
- env.Command('file1.out', 'file.in',
- './build --log logfile.txt $SOURCE $TARGET')
- env.Command('file2.out', 'file.in',
- './build --log logfile.txt $SOURCE $TARGET')
+env = Environment()
+env.Command('file1.out', 'file.in',
+ './build --log logfile.txt $SOURCE $TARGET')
+env.Command('file2.out', 'file.in',
+ './build --log logfile.txt $SOURCE $TARGET')
</screen>
<para>
@@ -155,17 +155,17 @@
<scons_example name="sideeffect_shared">
<file name="SConstruct" printme="1">
- env = Environment()
- f1 = env.Command('file1.out', 'file1.in',
- './build --log logfile.txt $SOURCE $TARGET')
- f2 = env.Command('file2.out', 'file2.in',
- './build --log logfile.txt $SOURCE $TARGET')
- env.SideEffect('logfile.txt', f1 + f2)
+env = Environment()
+f1 = env.Command('file1.out', 'file1.in',
+ './build --log logfile.txt $SOURCE $TARGET')
+f2 = env.Command('file2.out', 'file2.in',
+ './build --log logfile.txt $SOURCE $TARGET')
+env.SideEffect('logfile.txt', f1 + f2)
</file>
<file name="file1.in">file1.in</file>
<file name="file2.in">file2.in</file>
<file name="build" chmod="0755">
- cat
+cat
</file>
</scons_example>
@@ -199,11 +199,11 @@
<scons_example name="sideeffect_parallel">
<file name="SConstruct" printme="1">
- env = Environment()
- f1 = env.Command('file1.out', [], 'echo >$TARGET data1')
- env.SideEffect('not_really_updated', f1)
- f2 = env.Command('file2.out', [], 'echo >$TARGET data2')
- env.SideEffect('not_really_updated', f2)
+env = Environment()
+f1 = env.Command('file1.out', [], 'echo >$TARGET data1')
+env.SideEffect('not_really_updated', f1)
+f2 = env.Command('file2.out', [], 'echo >$TARGET data2')
+env.SideEffect('not_really_updated', f2)
</file>
</scons_example>
diff --git a/doc/user/simple.xml b/doc/user/simple.xml
index 0e67e1ee..33b9e279 100644
--- a/doc/user/simple.xml
+++ b/doc/user/simple.xml
@@ -66,11 +66,11 @@
</para>
<programlisting>
- int
- main()
- {
- printf("Hello, world!\n");
- }
+int
+main()
+{
+ printf("Hello, world!\n");
+}
</programlisting>
<para>
@@ -82,10 +82,10 @@
<scons_example name="simple_ex1">
<file name="SConstruct" printme="1">
- Program('hello.c')
+Program('hello.c')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -179,10 +179,10 @@
<scons_example name="simple_Object">
<file name="SConstruct" printme="1">
- Object('hello.c')
+Object('hello.c')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -228,16 +228,16 @@
<scons_example name="simple_java">
<file name="SConstruct" printme="1">
- Java('classes', 'src')
+Java('classes', 'src')
</file>
<file name="src/hello.java">
- public class Example1
- {
- public static void main(String[] args)
- {
- System.out.println("Hello Java world!\n");
- }
- }
+public class Example1
+{
+ public static void main(String[] args)
+ {
+ System.out.println("Hello Java world!\n");
+ }
+}
</file>
</scons_example>
@@ -285,10 +285,10 @@
<scons_example name="simple_clean">
<file name="SConstruct">
- Program('hello.c')
+Program('hello.c')
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
</scons_example>
@@ -358,8 +358,8 @@
</para>
<programlisting>
- # Arrange to build the "hello" program.
- Program('hello.c') # "hello.c" is the source file.
+# Arrange to build the "hello" program.
+Program('hello.c') # "hello.c" is the source file.
</programlisting>
<para>
@@ -442,17 +442,17 @@
<scons_example name="simple_declarative">
<file name="SConstruct" printme="1">
- print "Calling Program('hello.c')"
- Program('hello.c')
- print "Calling Program('goodbye.c')"
- Program('goodbye.c')
- print "Finished calling Program()"
+print "Calling Program('hello.c')"
+Program('hello.c')
+print "Calling Program('goodbye.c')"
+Program('goodbye.c')
+print "Finished calling Program()"
</file>
<file name="hello.c">
- int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
</file>
<file name="goodbye.c">
- int main() { printf("Goodbye, world!\n"); }
+int main() { printf("Goodbye, world!\n"); }
</file>
</scons_example>
diff --git a/doc/user/sourcecode.xml b/doc/user/sourcecode.xml
index 22258823..c6d645f3 100644
--- a/doc/user/sourcecode.xml
+++ b/doc/user/sourcecode.xml
@@ -65,12 +65,12 @@
<scons_example name="sourcecode_bitkeeper">
<file name="SConstruct" printme="1">
- env = Environment()
- env.SourceCode('.', env.BitKeeper())
- env.Program('hello.c')
+env = Environment()
+env.SourceCode('.', env.BitKeeper())
+env.Program('hello.c')
</file>
<file name="s.hello.c">
- s.hello.c
+s.hello.c
</file>
</scons_example>
@@ -91,9 +91,9 @@
<scons_example name="sourcecode_cvs">
<file name="SConstruct" printme="1">
- env = Environment()
- env.SourceCode('.', env.CVS('/usr/local/CVS'))
- env.Program('hello.c')
+env = Environment()
+env.SourceCode('.', env.CVS('/usr/local/CVS'))
+env.Program('hello.c')
</file>
</scons_example>
@@ -114,12 +114,12 @@
<scons_example name="sourcecode_rcs">
<file name="SConstruct" printme="1">
- env = Environment()
- env.SourceCode('.', env.RCS())
- env.Program('hello.c')
+env = Environment()
+env.SourceCode('.', env.RCS())
+env.Program('hello.c')
</file>
<file name="hello.c,v">
- hello.c,v
+hello.c,v
</file>
</scons_example>
@@ -140,12 +140,12 @@
<scons_example name="sourcecode_sccs">
<file name="SConstruct" printme="1">
- env = Environment()
- env.SourceCode('.', env.SCCS())
- env.Program('hello.c')
+env = Environment()
+env.SourceCode('.', env.SCCS())
+env.Program('hello.c')
</file>
<file name="s.hello.c">
- s.hello.c
+s.hello.c
</file>
</scons_example>
@@ -168,9 +168,9 @@
<scons_example name="sourcecode_subversion">
<file name="SConstruct" printme="1">
- env = Environment()
- env.SourceCode('.', env.Subversion('XXX'))
- env.Program('hello.c')
+env = Environment()
+env.SourceCode('.', env.Subversion('XXX'))
+env.Program('hello.c')
</file>
</scons_example>
diff --git a/doc/user/troubleshoot.xml b/doc/user/troubleshoot.xml
index 076c0544..65c91994 100644
--- a/doc/user/troubleshoot.xml
+++ b/doc/user/troubleshoot.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">
@@ -92,12 +92,12 @@
<scons_example name="troubleshoot_explain1">
<file name="SConstruct" printme="1">
- # Intentionally misspell the output file name in the
- # command used to create the file:
- Command('file.out', 'file.in', 'cp $SOURCE file.oout')
+# Intentionally misspell the output file name in the
+# command used to create the file:
+Command('file.out', 'file.in', 'cp $SOURCE file.oout')
</file>
<file name="file.in">
- file.in
+file.in
</file>
</scons_example>
@@ -160,6 +160,16 @@
</para>
<para>
+ Note that you can also use --warn=target-not-built which checks
+ whether or not expected targets exist after a build rule is
+ executed.
+ </para>
+
+ <scons_output example="troubleshoot_explain1" os="posix" suffix="3">
+ <scons_output_command>scons -Q --warn=target-not-built</scons_output_command>
+ </scons_output>
+
+ <para>
The &debug-explain; option also comes in handy
to help figure out what input file changed.
@@ -174,16 +184,16 @@
<scons_example name="troubleshoot_explain2">
<file name="SConstruct">
- Program('prog', ['file1.c', 'file2.c', 'file3.c'])
+Program('prog', ['file1.c', 'file2.c', 'file3.c'])
</file>
<file name="file1.c">
- file1.c
+file1.c
</file>
<file name="file2.c">
- file2.c
+file2.c
</file>
<file name="file3.c">
- file3.c
+file3.c
</file>
</scons_example>
@@ -212,21 +222,21 @@
<scons_example name="troubleshoot_explain3">
<file name="SConstruct">
- Program('prog', ['file1.c', 'file2.c', 'file3.c'], CPPPATH='.')
+Program('prog', ['file1.c', 'file2.c', 'file3.c'], CPPPATH='.')
</file>
<file name="file1.c">
- #include &lt;hello.h&gt;
- file1.c
+#include &lt;hello.h&gt;
+file1.c
</file>
<file name="file2.c">
- file2.c
+file2.c
</file>
<file name="file3.c">
- #include &lt;hello.h&gt;
- file3.c
+#include &lt;hello.h&gt;
+file3.c
</file>
<file name="hello.h">
- #define string "world"
+#define string "world"
</file>
</scons_example>
@@ -278,8 +288,8 @@
<scons_example name="troubleshoot_Dump">
<file name="SConstruct" printme="1">
- env = Environment()
- print env.Dump()
+env = Environment()
+print env.Dump()
</file>
</scons_example>
@@ -338,8 +348,8 @@
<scons_example name="troubleshoot_Dump_ENV">
<file name="SConstruct" printme="1">
- env = Environment()
- print env.Dump('ENV')
+env = Environment()
+print env.Dump('ENV')
</file>
</scons_example>
@@ -391,20 +401,20 @@
<scons_example name="troubleshoot_tree1">
<file name="SConstruct" printme="1">
- env = Environment(CPPPATH = ['.'])
- env.Program('prog', ['f1.c', 'f2.c', 'f3.c'])
+env = Environment(CPPPATH = ['.'])
+env.Program('prog', ['f1.c', 'f2.c', 'f3.c'])
</file>
<file name="f1.c">
- #include "inc.h"
+#include "inc.h"
</file>
<file name="f2.c">
- #include "inc.h"
+#include "inc.h"
</file>
<file name="f3.c">
- #include "inc.h"
+#include "inc.h"
</file>
<file name="inc.h">
- inc.h
+inc.h
</file>
</scons_example>
@@ -523,30 +533,30 @@
<scons_example name="troubleshoot_tree2">
<file name="SConstruct" printme="1">
- env = Environment(CPPPATH = ['.'],
- LIBS = ['foo'],
- LIBPATH = ['.'])
- env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
- env.Program('prog1.c')
- env.Program('prog2.c')
+env = Environment(CPPPATH = ['.'],
+ LIBS = ['foo'],
+ LIBPATH = ['.'])
+env.Library('foo', ['f1.c', 'f2.c', 'f3.c'])
+env.Program('prog1.c')
+env.Program('prog2.c')
</file>
<file name="prog1.c">
- #include "inc.h"
+#include "inc.h"
</file>
<file name="prog2.c">
- #include "inc.h"
+#include "inc.h"
</file>
<file name="f1.c">
- #include "inc.h"
+#include "inc.h"
</file>
<file name="f2.c">
- #include "inc.h"
+#include "inc.h"
</file>
<file name="f3.c">
- #include "inc.h"
+#include "inc.h"
</file>
<file name="inc.h">
- inc.h
+inc.h
</file>
</scons_example>
@@ -609,11 +619,11 @@
<scons_example name="troubleshoot_presub">
<file name="SConstruct">
- env = Environment(CPPPATH = ['.'])
- env.Program('prog', 'prog.c')
+env = Environment(CPPPATH = ['.'])
+env.Program('prog', 'prog.c')
</file>
<file name="prog.c">
- prog.c
+prog.c
</file>
</scons_example>
@@ -630,13 +640,13 @@
-->
<screen>
- % <userinput>scons -Q --debug=presub</userinput>
- Building prog.o with action:
- $CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCOMCOM $SOURCES
- cc -o prog.o -c -I. prog.c
- Building prog with action:
- $SMART_LINKCOM
- cc -o prog prog.o
+% <userinput>scons -Q --debug=presub</userinput>
+Building prog.o with action:
+ $CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCOMCOM $SOURCES
+cc -o prog.o -c -I. prog.c
+Building prog with action:
+ $SMART_LINKCOM
+cc -o prog prog.o
</screen>
</section>
@@ -657,17 +667,17 @@
<scons_example name="troubleshoot_findlibs">
<file name="SConstruct" printme="1">
- env = Environment(LIBPATH = ['libs1', 'libs2'])
- env.Program('prog.c', LIBS=['foo', 'bar'])
+env = Environment(LIBPATH = ['libs1', 'libs2'])
+env.Program('prog.c', LIBS=['foo', 'bar'])
</file>
<file name="prog.c">
- prog.c
+prog.c
</file>
<file name="libs1/libfoo.a">
- libs1/libfoo.a
+libs1/libfoo.a
</file>
<file name="libs2/libbar.a">
- libs2/libbar.a
+libs2/libbar.a
</file>
</scons_example>
@@ -701,19 +711,19 @@
<scons_example name="troubleshoot_includes">
<file name="SConstruct" printme="1">
- env = Environment(CPPPATH = ['inc1', 'inc2'])
- env.Program('prog.c')
+env = Environment(CPPPATH = ['inc1', 'inc2'])
+env.Program('prog.c')
</file>
<file name="prog.c">
- #include "file1.h"
- #include "file2.h"
- prog.c
+#include "file1.h"
+#include "file2.h"
+prog.c
</file>
<file name="inc1/file1.h">
- inc1/file1.h
+inc1/file1.h
</file>
<file name="inc2/file2.h">
- inc2/file2.h
+inc2/file2.h
</file>
</scons_example>
@@ -749,7 +759,7 @@
<scons_example name="troubleshoot_stacktrace">
<file name="SConstruct" printme="1">
- Program('prog.c')
+Program('prog.c')
</file>
</scons_example>
@@ -829,15 +839,15 @@
<scons_example name="troubleshoot_taskmastertrace">
<file name="SConstruct" printme="1">
- env = Environment(CPPPATH = ['.'])
- env.Program('prog.c')
+env = Environment(CPPPATH = ['.'])
+env.Program('prog.c')
</file>
<file name="prog.c">
- #include "inc.h"
- prog.c
+#include "inc.h"
+prog.c
</file>
<file name="inc.h">
- #define STRING "one"
+#define STRING "one"
</file>
</scons_example>
diff --git a/doc/user/variants.xml b/doc/user/variants.xml
index 491074f6..74a155b0 100644
--- a/doc/user/variants.xml
+++ b/doc/user/variants.xml
@@ -84,53 +84,53 @@ is pretty smart about rebuilding things when you change options.
<scons_example name="variants_ex">
<file name="SConstruct" printme="1">
- platform = ARGUMENTS.get('OS', Platform())
+platform = ARGUMENTS.get('OS', Platform())
- include = "#export/$PLATFORM/include"
- lib = "#export/$PLATFORM/lib"
- bin = "#export/$PLATFORM/bin"
+include = "#export/$PLATFORM/include"
+lib = "#export/$PLATFORM/lib"
+bin = "#export/$PLATFORM/bin"
- env = Environment(PLATFORM = platform,
- BINDIR = bin,
- INCDIR = include,
- LIBDIR = lib,
- CPPPATH = [include],
- LIBPATH = [lib],
- LIBS = 'world')
+env = Environment(PLATFORM = platform,
+ BINDIR = bin,
+ INCDIR = include,
+ LIBDIR = lib,
+ CPPPATH = [include],
+ LIBPATH = [lib],
+ LIBS = 'world')
- Export('env')
+Export('env')
- env.SConscript('src/SConscript', variant_dir='build/$PLATFORM')
+env.SConscript('src/SConscript', variant_dir='build/$PLATFORM')
</file>
<directory name="src"></directory>
<directory name="src/hello"></directory>
<directory name="src/world"></directory>
<file name="src/SConscript">
- Import('env')
- SConscript('hello/SConscript')
- SConscript('world/SConscript')
+Import('env')
+SConscript('hello/SConscript')
+SConscript('world/SConscript')
</file>
<file name="src/hello/SConscript">
- Import('env')
- hello = env.Program('hello.c')
- env.Install('$BINDIR', hello)
+Import('env')
+hello = env.Program('hello.c')
+env.Install('$BINDIR', hello)
</file>
<file name="src/hello/hello.c">
- #include "world.h"
- int main(int argc, char *argv[]) { printf "hello.c\n"; world(); }
+#include "world.h"
+int main(int argc, char *argv[]) { printf "hello.c\n"; world(); }
</file>
<file name="src/world/SConscript">
- Import('env')
- world = env.Library('world.c')
- env.Install('$LIBDIR', world)
- env.Install('$INCDIR', 'world.h')
+Import('env')
+world = env.Library('world.c')
+env.Install('$LIBDIR', world)
+env.Install('$INCDIR', 'world.h')
</file>
<file name="src/world/world.h">
- #define STRING "world.h"
- extern int world();
+#define STRING "world.h"
+extern int world();
</file>
<file name="src/world/world.c">
- int world() { printf "world.c\n"; }
+int world() { printf "world.c\n"; }
</file>
</scons_example>
@@ -159,9 +159,9 @@ is pretty smart about rebuilding things when you change options.
<scons_example name="variants_ex2">
<file name="SConstruct" printme="1">
- env = Environment(OS = ARGUMENTS.get('OS'))
- for os in ['newell', 'post']:
- SConscript('src/SConscript', variant_dir='build/' + os)
+env = Environment(OS = ARGUMENTS.get('OS'))
+for os in ['newell', 'post']:
+ SConscript('src/SConscript', variant_dir='build/' + os)
</file>
</scons_example>
diff --git a/doc/xsd/dbpoolx.xsd b/doc/xsd/dbpoolx.xsd
index f0a3f1ca..0ce5cb7b 100644
--- a/doc/xsd/dbpoolx.xsd
+++ b/doc/xsd/dbpoolx.xsd
@@ -2589,7 +2589,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:group ref="tool.mix"/>
</xs:choice>
@@ -2616,7 +2615,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:group ref="tool.mix"/>
</xs:choice>
@@ -2644,7 +2642,6 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
<xs:element ref="summary"/>
</xs:choice>
diff --git a/runtest.py b/runtest.py
index 0fad6554..2470a618 100755
--- a/runtest.py
+++ b/runtest.py
@@ -58,6 +58,8 @@
# command line it will execute before
# executing it. This suppresses that print.
#
+# --quit-on-failure Quit on any test failure
+#
# -s Short progress. Prints only the command line
# and a percentage value, based on the total and
# current number of tests.
@@ -127,6 +129,7 @@ print_progress = 1
suppress_stdout = False
suppress_stderr = False
allow_pipe_files = True
+quit_on_failure = False
helpstr = """\
Usage: runtest.py [OPTIONS] [TEST ...]
@@ -162,6 +165,7 @@ Options:
--passed Summarize which tests passed.
--qmtest Run using the QMTest harness (deprecated).
-q, --quiet Don't print the test being executed.
+ --quit-on-failure Quit on any test failure
-s, --short-progress Short progress, prints only the command line
and a percentage value, based on the total and
current number of tests.
@@ -218,7 +222,9 @@ opts, args = getopt.getopt(args, "3b:def:hj:klnP:p:qsv:Xx:t",
'jobs=',
'list', 'no-exec', 'nopipefiles',
'package=', 'passed', 'python=', 'qmtest',
- 'quiet', 'short-progress', 'time',
+ 'quiet',
+ 'quit-on-failure',
+ 'short-progress', 'time',
'version=', 'exec=',
'verbose='])
@@ -271,7 +277,9 @@ for o, a in opts:
elif o in ['-q', '--quiet']:
printcommand = 0
suppress_stdout = True
- suppress_stderr = True
+ suppress_stderr = True
+ elif o in ['--quit-on-failure']:
+ quit_on_failure = True
elif o in ['-s', '--short-progress']:
print_progress = 1
suppress_stdout = True
@@ -377,16 +385,16 @@ else:
# Else, we catch the output of both pipes...
if allow_pipe_files:
# The subprocess.Popen() suffers from a well-known
- # problem. Data for stdout/stderr is read into a
+ # problem. Data for stdout/stderr is read into a
# memory buffer of fixed size, 65K which is not very much.
# When it fills up, it simply stops letting the child process
# write to it. The child will then sit and patiently wait to
- # be able to write the rest of its output. Hang!
+ # be able to write the rest of its output. Hang!
# In order to work around this, we follow a suggestion
# by Anders Pearson in
# http://http://thraxil.org/users/anders/posts/2008/03/13/Subprocess-Hanging-PIPE-is-your-enemy/
# and pass temp file objects to Popen() instead of the ubiquitous
- # subprocess.PIPE.
+ # subprocess.PIPE.
def spawn_it(command_args):
# Create temporary files
import tempfile
@@ -399,7 +407,7 @@ else:
shell=True)
# ... and wait for it to finish.
ret = p.wait()
-
+
try:
# Rewind to start of files
tmp_stdout.seek(0)
@@ -411,10 +419,10 @@ else:
# Remove temp files by closing them
tmp_stdout.close()
tmp_stderr.close()
-
+
# Return values
return (spawned_stderr, spawned_stdout, ret)
-
+
else:
# We get here only if the user gave the '--nopipefiles'
# option, meaning the "temp file" approach for
@@ -423,9 +431,9 @@ else:
# potential deadlock situation in the following code:
# If the subprocess writes a lot of data to its stderr,
# the pipe will fill up (nobody's reading it yet) and the
- # subprocess will wait for someone to read it.
+ # subprocess will wait for someone to read it.
# But the parent process is trying to read from stdin
- # (but the subprocess isn't writing anything there).
+ # (but the subprocess isn't writing anything there).
# Hence a deadlock.
# Be dragons here! Better don't use this!
def spawn_it(command_args):
@@ -473,7 +481,7 @@ class PopenExecutor(Base):
shell=True)
# ... and wait for it to finish.
self.status = p.wait()
-
+
try:
# Rewind to start of files
tmp_stdout.seek(0)
@@ -485,7 +493,7 @@ class PopenExecutor(Base):
# Remove temp files by closing them
tmp_stdout.close()
tmp_stderr.close()
- else:
+ else:
def execute(self):
p = subprocess.Popen(self.command_str,
stdout=subprocess.PIPE,
@@ -836,7 +844,7 @@ def run_test(t, io_lock, async=True):
if head:
os.environ['PYTHON_SCRIPT_DIR'] = head
else:
- os.environ['PYTHON_SCRIPT_DIR'] = ''
+ os.environ['PYTHON_SCRIPT_DIR'] = ''
test_start_time = time_func()
if execute_tests:
t.execute()
@@ -853,6 +861,10 @@ def run_test(t, io_lock, async=True):
print_time_func("Test execution time: %.1f seconds\n", t.test_time)
if io_lock:
io_lock.release()
+ if quit_on_failure and t.status == 1:
+ print("Exiting due to error")
+ print(t.status)
+ sys.exit(1)
class RunTest(threading.Thread):
def __init__(self, queue, io_lock):
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index e80a1615..978c82c8 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -6,6 +6,37 @@
RELEASE 2.3.1.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
+ From Andrew Featherstone:
+ - Added support for EPUB output format to the DocBook tool.
+
+ From Tom Tanner:
+ - Stop leaking file handles to subprocesses by switching to using subprocess
+ always.
+ - Allow multiple options to be specified with --debug=a,b,c
+ - Add support for a readonly cache (--cache-readonly)
+ - Always print stats if requested
+ - Generally try harder to print out a message on build errors
+ - Adds a switch to warn on missing targets
+ - Add Pseudo command to mark targets which should not exist after
+ they are built.
+
+ From Bogdan Tenea:
+ - Check for 8.3 filenames on cygwin as well as win32 to make variant_dir work properly.
+
+ From Alexandre Feblot:
+ - Make sure SharedLibrary depends on all dependent libs (by depending on SHLINKCOM)
+
+ From Stefan Sperling:
+ - Fixed the setup of linker flags for a versioned SharedLibrary
+ under OpenBSD (#2916).
+
+ From Antonio Cavallo:
+ - Improve error if Visual Studio bat file not found.
+
+ From Manuel Francisco Naranjo:
+ - Allow Subst.Literal string objects to be compared with each other,
+ so they work better in AddUnique() and Remove().
+
From David Rothenberger:
- Added cyglink linker that uses Cygwin naming conventions for
shared libraries and automatically generates import libraries.
@@ -13,6 +44,11 @@ RELEASE 2.3.1.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
From Dirk Baechle:
- Update bootstrap.py so it can be used from any dir, to run
SCons from a source (non-installed) dir.
+ - Count statistics of instances are now collected only when
+ the --debug=count command-line option is used (#2922).
+ - Added release_target_info() to File nodes, which helps to
+ reduce memory consumption in clean builds and update runs
+ of large projects.
From Gary Oberbrunner:
- Test harness: fail_test() can now print a message to help debugging.
@@ -37,14 +73,14 @@ RELEASE 2.3.1.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
approach, that also requires less external dependencies (programs and
Python packages). Added a customized Docbook XSD for strict validation of
all input XML files.
-
+
From Luca Falavigna:
- Fixed spelling errors in MAN pages (#2897).
-
+
From Michael McDougall:
- Fixed description of ignore_case for EnumVariable in the
MAN page (#2774).
-
+
RELEASE 2.3.0 - Mon, 02 Mar 2013 13:22:29 -0400
From Anatoly Techtonik:
@@ -5693,5 +5729,6 @@ A brief overview of important functionality available in release 0.01:
- Windows installer available.
+
__COPYRIGHT__
__FILE__ __REVISION__ __DATE__ __DEVELOPER__
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index 49b9f35f..4ca0b1a1 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/SCons/Action.py
@@ -109,6 +109,7 @@ import re
import sys
import subprocess
+import SCons.Debug
from SCons.Debug import logInstanceCreation
import SCons.Errors
import SCons.Executor
@@ -440,7 +441,8 @@ class ActionBase(object):
vl = self.get_varlist(target, source, env)
if is_String(vl): vl = (vl,)
for v in vl:
- result.append(SCons.Util.to_bytes(env.subst('${'+v+'}')))
+ # do the subst this way to ignore $(...$) parts:
+ result.append(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source)))
return b''.join(result)
def __add__(self, other):
@@ -699,7 +701,7 @@ class CommandAction(_ActionAction):
# factory above does). cmd will be passed to
# Environment.subst_list() for substituting environment
# variables.
- if __debug__: logInstanceCreation(self, 'Action.CommandAction')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandAction')
_ActionAction.__init__(self, **kw)
if is_List(cmd):
@@ -856,7 +858,7 @@ class CommandAction(_ActionAction):
class CommandGeneratorAction(ActionBase):
"""Class for command-generator actions."""
def __init__(self, generator, kw):
- if __debug__: logInstanceCreation(self, 'Action.CommandGeneratorAction')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandGeneratorAction')
self.generator = generator
self.gen_kw = kw
self.varlist = kw.get('varlist', ())
@@ -945,7 +947,7 @@ class CommandGeneratorAction(ActionBase):
class LazyAction(CommandGeneratorAction, CommandAction):
def __init__(self, var, kw):
- if __debug__: logInstanceCreation(self, 'Action.LazyAction')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.LazyAction')
#FUTURE CommandAction.__init__(self, '${'+var+'}', **kw)
CommandAction.__init__(self, '${'+var+'}', **kw)
self.var = SCons.Util.to_String(var)
@@ -987,7 +989,7 @@ class FunctionAction(_ActionAction):
"""Class for Python function actions."""
def __init__(self, execfunction, kw):
- if __debug__: logInstanceCreation(self, 'Action.FunctionAction')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.FunctionAction')
self.execfunction = execfunction
try:
@@ -1109,7 +1111,7 @@ class FunctionAction(_ActionAction):
class ListAction(ActionBase):
"""Class for lists of other actions."""
def __init__(self, actionlist):
- if __debug__: logInstanceCreation(self, 'Action.ListAction')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.ListAction')
def list_of_actions(x):
if isinstance(x, ActionBase):
return x
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py
index 4b418272..db249bf1 100644
--- a/src/engine/SCons/Builder.py
+++ b/src/engine/SCons/Builder.py
@@ -102,6 +102,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import collections
import SCons.Action
+import SCons.Debug
from SCons.Debug import logInstanceCreation
from SCons.Errors import InternalError, UserError
import SCons.Executor
@@ -225,7 +226,7 @@ class OverrideWarner(collections.UserDict):
"""
def __init__(self, dict):
collections.UserDict.__init__(self, dict)
- if __debug__: logInstanceCreation(self, 'Builder.OverrideWarner')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.OverrideWarner')
self.already_warned = None
def warn(self):
if self.already_warned:
@@ -379,7 +380,7 @@ class BuilderBase(object):
src_builder = None,
ensure_suffix = False,
**overrides):
- if __debug__: logInstanceCreation(self, 'Builder.BuilderBase')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.BuilderBase')
self._memo = {}
self.action = action
self.multi = multi
@@ -853,7 +854,7 @@ class CompositeBuilder(SCons.Util.Proxy):
"""
def __init__(self, builder, cmdgen):
- if __debug__: logInstanceCreation(self, 'Builder.CompositeBuilder')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.CompositeBuilder')
SCons.Util.Proxy.__init__(self, builder)
# cmdgen should always be an instance of DictCmdGenerator.
diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py
index 3516018b..9dd18e50 100644
--- a/src/engine/SCons/CacheDir.py
+++ b/src/engine/SCons/CacheDir.py
@@ -37,6 +37,7 @@ cache_enabled = True
cache_debug = False
cache_force = False
cache_show = False
+cache_readonly = False
def CacheRetrieveFunc(target, source, env):
t = target[0]
@@ -70,6 +71,8 @@ CacheRetrieve = SCons.Action.Action(CacheRetrieveFunc, CacheRetrieveString)
CacheRetrieveSilent = SCons.Action.Action(CacheRetrieveFunc, None)
def CachePushFunc(target, source, env):
+ if cache_readonly: return
+
t = target[0]
if t.nocache:
return
@@ -150,6 +153,9 @@ class CacheDir(object):
def is_enabled(self):
return (cache_enabled and not self.path is None)
+ def is_readonly(self):
+ return cache_readonly
+
def cachepath(self, node):
"""
"""
@@ -201,7 +207,7 @@ class CacheDir(object):
return False
def push(self, node):
- if not self.is_enabled():
+ if self.is_readonly() or not self.is_enabled():
return
return CachePush(node, [], node.get_build_env())
diff --git a/src/engine/SCons/Debug.py b/src/engine/SCons/Debug.py
index 1c0c6385..99740398 100644
--- a/src/engine/SCons/Debug.py
+++ b/src/engine/SCons/Debug.py
@@ -35,6 +35,10 @@ import sys
import time
import weakref
+# Global variable that gets set to 'True' by the Main script,
+# when the creation of class instances should get tracked.
+track_instances = False
+# List of currently tracked classes
tracked_classes = {}
def logInstanceCreation(instance, name=None):
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 7a369a97..737289b0 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -43,6 +43,7 @@ from collections import UserDict
import SCons.Action
import SCons.Builder
+import SCons.Debug
from SCons.Debug import logInstanceCreation
import SCons.Defaults
import SCons.Errors
@@ -370,7 +371,7 @@ class SubstitutionEnvironment(object):
def __init__(self, **kw):
"""Initialization of an underlying SubstitutionEnvironment class.
"""
- if __debug__: logInstanceCreation(self, 'Environment.SubstitutionEnvironment')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.SubstitutionEnvironment')
self.fs = SCons.Node.FS.get_default_fs()
self.ans = SCons.Node.Alias.default_ans
self.lookup_list = SCons.Node.arg2nodes_lookups
@@ -704,7 +705,7 @@ class SubstitutionEnvironment(object):
# -symbolic (linker global binding)
# -R dir (deprecated linker rpath)
# IBM compilers may also accept -qframeworkdir=foo
-
+
params = shlex.split(arg)
append_next_arg_to = None # for multi-word args
for arg in params:
@@ -794,7 +795,7 @@ class SubstitutionEnvironment(object):
append_next_arg_to = arg
else:
dict['CCFLAGS'].append(arg)
-
+
for arg in flags:
do_parse(arg)
return dict
@@ -858,7 +859,7 @@ class SubstitutionEnvironment(object):
# def MergeShellPaths(self, args, prepend=1):
# """
-# Merge the dict in args into the shell environment in env['ENV'].
+# Merge the dict in args into the shell environment in env['ENV'].
# Shell path elements are appended or prepended according to prepend.
# Uses Pre/AppendENVPath, so it always appends or prepends uniquely.
@@ -931,7 +932,7 @@ class Base(SubstitutionEnvironment):
initialize things in a very specific order that doesn't work
with the much simpler base class initialization.
"""
- if __debug__: logInstanceCreation(self, 'Environment.Base')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.Base')
self._memo = {}
self.fs = SCons.Node.FS.get_default_fs()
self.ans = SCons.Node.Alias.default_ans
@@ -961,14 +962,14 @@ class Base(SubstitutionEnvironment):
platform = SCons.Platform.Platform(platform)
self._dict['PLATFORM'] = str(platform)
platform(self)
-
+
self._dict['HOST_OS'] = self._dict.get('HOST_OS',None)
self._dict['HOST_ARCH'] = self._dict.get('HOST_ARCH',None)
-
+
# Now set defaults for TARGET_{OS|ARCH}
self._dict['TARGET_OS'] = self._dict.get('TARGET_OS',None)
self._dict['TARGET_ARCH'] = self._dict.get('TARGET_ARCH',None)
-
+
# Apply the passed-in and customizable variables to the
# environment before calling the tools, because they may use
@@ -1157,7 +1158,7 @@ class Base(SubstitutionEnvironment):
# "continue" statements whenever we finish processing an item,
# but Python 1.5.2 apparently doesn't let you use "continue"
# within try:-except: blocks, so we have to nest our code.
- try:
+ try:
if key == 'CPPDEFINES' and SCons.Util.is_String(self._dict[key]):
self._dict[key] = [self._dict[key]]
orig = self._dict[key]
@@ -1208,7 +1209,7 @@ class Base(SubstitutionEnvironment):
orig = list(orig.items())
orig += val
self._dict[key] = orig
- else:
+ else:
for v in val:
orig[v] = None
else:
@@ -1231,7 +1232,7 @@ class Base(SubstitutionEnvironment):
path = str(self.fs.Dir(path))
return path
- def AppendENVPath(self, name, newpath, envname = 'ENV',
+ def AppendENVPath(self, name, newpath, envname = 'ENV',
sep = os.pathsep, delete_existing=1):
"""Append path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
@@ -1289,7 +1290,7 @@ class Base(SubstitutionEnvironment):
dk = list(dk.items())
elif SCons.Util.is_String(dk):
dk = [(dk,)]
- else:
+ else:
tmp = []
for i in dk:
if SCons.Util.is_List(i):
@@ -1334,7 +1335,7 @@ class Base(SubstitutionEnvironment):
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]
+ dk = [x for x in dk if x not in val]
self._dict[key] = dk + val
else:
# By elimination, val is not a list. Since dk is a
@@ -1381,7 +1382,7 @@ class Base(SubstitutionEnvironment):
builders = self._dict['BUILDERS']
except KeyError:
pass
-
+
clone = copy.copy(self)
# BUILDERS is not safe to do a simple copy
clone._dict = semi_deepcopy_dict(self._dict, ['BUILDERS'])
@@ -1409,12 +1410,12 @@ class Base(SubstitutionEnvironment):
apply_tools(clone, tools, toolpath)
# apply them again in case the tools overwrote them
- clone.Replace(**new)
+ clone.Replace(**new)
# Finally, apply any flags to be merged in
if parse_flags: clone.MergeFlags(parse_flags)
- if __debug__: logInstanceCreation(self, 'Environment.EnvironmentClone')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.EnvironmentClone')
return clone
def Copy(self, *args, **kw):
@@ -2086,6 +2087,14 @@ class Base(SubstitutionEnvironment):
t.set_precious()
return tlist
+ def Pseudo(self, *targets):
+ tlist = []
+ for t in targets:
+ tlist.extend(self.arg2nodes(t, self.fs.Entry))
+ for t in tlist:
+ t.set_pseudo()
+ return tlist
+
def Repository(self, *dirs, **kw):
dirs = self.arg2nodes(list(dirs), self.fs.Dir)
self.fs.Repository(*dirs, **kw)
@@ -2270,7 +2279,7 @@ class OverrideEnvironment(Base):
"""
def __init__(self, subject, overrides={}):
- if __debug__: logInstanceCreation(self, 'Environment.OverrideEnvironment')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.OverrideEnvironment')
self.__dict__['__subject'] = subject
self.__dict__['overrides'] = overrides
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index 6933b6b9..5b4153e5 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -171,7 +171,7 @@ class TestEnvironmentFixture(object):
single_source = 1)
kw['BUILDERS'] = {'Object' : static_obj}
static_obj.add_action('.cpp', 'fake action')
-
+
env = Environment(*args, **kw)
return env
@@ -1677,6 +1677,8 @@ def exists(env):
CCC1 = '',
CCC2 = '',
DDD1 = ['a', 'b', 'c'])
+ env['LL1'] = [env.Literal('a literal'), env.Literal('b literal')]
+ env['LL2'] = [env.Literal('c literal'), env.Literal('b literal')]
env.AppendUnique(AAA1 = 'a1',
AAA2 = ['a2'],
AAA3 = ['a3', 'b', 'c', 'c', 'b', 'a3'], # ignore dups
@@ -1689,7 +1691,9 @@ def exists(env):
BBB5 = ['b5.new'],
CCC1 = 'c1',
CCC2 = ['c2'],
- DDD1 = 'b')
+ DDD1 = 'b',
+ LL1 = env.Literal('a literal'),
+ LL2 = env.Literal('a literal'))
assert env['AAA1'] == 'a1a1', env['AAA1']
assert env['AAA2'] == ['a2'], env['AAA2']
@@ -1704,6 +1708,8 @@ def exists(env):
assert env['CCC1'] == 'c1', env['CCC1']
assert env['CCC2'] == ['c2'], env['CCC2']
assert env['DDD1'] == ['a', 'b', 'c'], env['DDD1']
+ assert env['LL1'] == [env.Literal('a literal'), env.Literal('b literal')], env['LL1']
+ assert env['LL2'] == [env.Literal('c literal'), env.Literal('b literal'), env.Literal('a literal')], [str(x) for x in env['LL2']]
env.AppendUnique(DDD1 = 'b', delete_existing=1)
assert env['DDD1'] == ['a', 'c', 'b'], env['DDD1'] # b moves to end
@@ -1711,7 +1717,7 @@ def exists(env):
assert env['DDD1'] == ['c', 'a', 'b'], env['DDD1'] # a & b move to end
env.AppendUnique(DDD1 = ['e','f', 'e'], delete_existing=1)
assert env['DDD1'] == ['c', 'a', 'b', 'f', 'e'], env['DDD1'] # add last
-
+
env['CLVar'] = CLVar([])
env.AppendUnique(CLVar = 'bar')
result = env['CLVar']
@@ -2019,7 +2025,7 @@ def generate(env):
try:
save_command = []
- env.backtick = my_backtick(save_command,
+ env.backtick = my_backtick(save_command,
"-I/usr/include/fum -I bar -X\n" + \
"-L/usr/fax -L foo -lxxx -l yyy " + \
"-Wa,-as -Wl,-link " + \
@@ -2364,7 +2370,7 @@ f5: \
env.PrependUnique(DDD1 = ['a','c'], delete_existing=1)
assert env['DDD1'] == ['a', 'c', 'b'], env['DDD1'] # a & c move to front
env.PrependUnique(DDD1 = ['d','e','d'], delete_existing=1)
- assert env['DDD1'] == ['d', 'e', 'a', 'c', 'b'], env['DDD1']
+ assert env['DDD1'] == ['d', 'e', 'a', 'c', 'b'], env['DDD1']
env['CLVar'] = CLVar([])
@@ -3114,6 +3120,29 @@ def generate(env):
assert t[4].path == 'p_ggg'
assert t[4].precious
+ def test_Pseudo(self):
+ """Test the Pseudo() method"""
+ env = self.TestEnvironment(FOO='ggg', BAR='hhh')
+ env.Dir('p_hhhb')
+ env.File('p_d')
+ t = env.Pseudo('p_a', 'p_${BAR}b', ['p_c', 'p_d'], 'p_$FOO')
+
+ assert t[0].__class__.__name__ == 'Entry', t[0].__class__.__name__
+ assert t[0].path == 'p_a'
+ assert t[0].pseudo
+ assert t[1].__class__.__name__ == 'Dir', t[1].__class__.__name__
+ assert t[1].path == 'p_hhhb'
+ assert t[1].pseudo
+ assert t[2].__class__.__name__ == 'Entry', t[2].__class__.__name__
+ assert t[2].path == 'p_c'
+ assert t[2].pseudo
+ assert t[3].__class__.__name__ == 'File', t[3].__class__.__name__
+ assert t[3].path == 'p_d'
+ assert t[3].pseudo
+ assert t[4].__class__.__name__ == 'Entry', t[4].__class__.__name__
+ assert t[4].path == 'p_ggg'
+ assert t[4].pseudo
+
def test_Repository(self):
"""Test the Repository() method."""
class MyFS(object):
diff --git a/src/engine/SCons/Executor.py b/src/engine/SCons/Executor.py
index 6248cf1b..2c53f21d 100644
--- a/src/engine/SCons/Executor.py
+++ b/src/engine/SCons/Executor.py
@@ -31,6 +31,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import collections
+import SCons.Debug
from SCons.Debug import logInstanceCreation
import SCons.Errors
import SCons.Memoize
@@ -123,7 +124,7 @@ class Executor(object):
def __init__(self, action, env=None, overridelist=[{}],
targets=[], sources=[], builder_kw={}):
- if __debug__: logInstanceCreation(self, 'Executor.Executor')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Executor')
self.set_action_list(action)
self.pre_actions = []
self.post_actions = []
@@ -229,6 +230,8 @@ class Executor(object):
self.action_list = action
def get_action_list(self):
+ if self.action_list is None:
+ return []
return self.pre_actions + self.action_list + self.post_actions
def get_all_targets(self):
@@ -267,7 +270,8 @@ class Executor(object):
"""
result = SCons.Util.UniqueList([])
for target in self.get_all_targets():
- result.extend(target.prerequisites)
+ if target.prerequisites is not None:
+ result.extend(target.prerequisites)
return result
def get_action_side_effects(self):
@@ -570,12 +574,12 @@ class Null(object):
"""A null Executor, with a null build Environment, that does
nothing when the rest of the methods call it.
- This might be able to disapper when we refactor things to
+ This might be able to disappear when we refactor things to
disassociate Builders from Nodes entirely, so we're not
going to worry about unit tests for this--at least for now.
"""
def __init__(self, *args, **kw):
- if __debug__: logInstanceCreation(self, 'Executor.Null')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Null')
self.batches = [Batch(kw['targets'][:], [])]
def get_build_env(self):
return get_NullEnvironment()
@@ -625,7 +629,6 @@ class Null(object):
self._morph()
self.set_action_list(action)
-
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 91c6893b..2d155ad6 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -45,6 +45,7 @@ import time
import codecs
import SCons.Action
+import SCons.Debug
from SCons.Debug import logInstanceCreation
import SCons.Errors
import SCons.Memoize
@@ -582,7 +583,7 @@ class Base(SCons.Node.Node):
our relative and absolute paths, identify our parent
directory, and indicate that this node should use
signatures."""
- if __debug__: logInstanceCreation(self, 'Node.FS.Base')
+ 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
@@ -1112,7 +1113,7 @@ class FS(LocalFS):
The path argument must be a valid absolute path.
"""
- if __debug__: logInstanceCreation(self, 'Node.FS')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS')
self._memo = {}
@@ -1446,7 +1447,7 @@ class Dir(Base):
BuildInfo = DirBuildInfo
def __init__(self, name, directory, fs):
- if __debug__: logInstanceCreation(self, 'Node.FS.Dir')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Dir')
Base.__init__(self, name, directory, fs)
self._morph()
@@ -1842,7 +1843,7 @@ class Dir(Base):
for entry in map(_my_normcase, entries):
d[entry] = True
self.on_disk_entries = d
- if sys.platform == 'win32':
+ if sys.platform == 'win32' or sys.platform == 'cygwin':
name = _my_normcase(name)
result = d.get(name)
if result is None:
@@ -2114,7 +2115,7 @@ class RootDir(Dir):
this directory.
"""
def __init__(self, drive, fs):
- if __debug__: logInstanceCreation(self, 'Node.FS.RootDir')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir')
# We're going to be our own parent directory (".." entry and .dir
# attribute) so we have to set up some values so Base.__init__()
# won't gag won't it calls some of our methods.
@@ -2362,7 +2363,7 @@ class File(Base):
"Directory %s found where file expected.")
def __init__(self, name, directory, fs):
- if __debug__: logInstanceCreation(self, 'Node.FS.File')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File')
Base.__init__(self, name, directory, fs)
self._morph()
@@ -2398,6 +2399,8 @@ class File(Base):
self.scanner_paths = {}
if not hasattr(self, '_local'):
self._local = 0
+ if not hasattr(self, 'released_target_info'):
+ self.released_target_info = False
# If there was already a Builder set on this entry, then
# we need to make sure we call the target-decider function,
@@ -2725,7 +2728,7 @@ class File(Base):
return self.get_build_env().get_CacheDir().retrieve(self)
def visited(self):
- if self.exists():
+ if self.exists() and self.executor is not None:
self.get_build_env().get_CacheDir().push_if_forced(self)
ninfo = self.get_ninfo()
@@ -2747,6 +2750,58 @@ class File(Base):
self.store_info()
+ 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
+ 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.
+
+ 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...
+ self.changed()
+ self.get_contents_sig()
+ self.get_build_env()
+ # Now purge unneeded stuff to free memory...
+ self.executor = None
+ self._memo.pop('rfile', None)
+ self.prerequisites = None
+ # Cleanup lists, but only if they're empty
+ if not len(self.ignore_set):
+ self.ignore_set = None
+ if not len(self.implicit_set):
+ self.implicit_set = None
+ if not len(self.depends_set):
+ self.depends_set = None
+ if not len(self.ignore):
+ self.ignore = None
+ if not len(self.depends):
+ self.depends = None
+ # Mark this node as done, we only have to release
+ # the memory once...
+ self.released_target_info = True
+
def find_src_builder(self):
if self.rexists():
return None
@@ -2957,6 +3012,48 @@ class File(Base):
SCons.Node.Node.builder_set(self, builder)
self.changed_since_last_build = self.decide_target
+ 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 hasattr(self.attributes, 'keep_targetinfo'):
+ # Ensure that the build infos get computed and cached...
+ self.store_info()
+ # ... 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):
+ """
+ Returns if the node is up-to-date with respect to the BuildInfo
+ 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().
+ """
+ if node is None:
+ try:
+ return self._memo['changed']
+ except KeyError:
+ pass
+
+ has_changed = SCons.Node.Node.changed(self, node)
+ self._memo['changed'] = has_changed
+ return has_changed
+
def changed_content(self, target, prev_ni):
cur_csig = self.get_csig()
try:
@@ -3090,25 +3187,50 @@ class File(Base):
self.cachedir_csig = self.get_csig()
return self.cachedir_csig
+ def get_contents_sig(self):
+ """
+ A helper method for get_cachedir_bsig.
+
+ 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())
+ return result
+
def get_cachedir_bsig(self):
+ """
+ Return the signature for a cached file, including
+ its children.
+
+ It adds the path of the cached file to the cache signature,
+ because multiple targets built by the same action will all
+ have the same build signature, and we have to differentiate
+ them somehow.
+ """
try:
return self.cachesig
except AttributeError:
pass
-
- # Add the path to the cache signature, because multiple
- # targets built by the same action will all have the same
- # build signature, and we have to differentiate them somehow.
+
+ # Collect signatures for all children
children = self.children()
- executor = self.get_executor()
- # sigs = [n.get_cachedir_csig() for n in children]
sigs = [n.get_cachedir_csig() for n in children]
- sigs.append(SCons.Util.MD5signature(executor.get_contents()))
+ # Append this node's signature...
+ sigs.append(self.get_contents_sig())
+ # ...and it's path
sigs.append(self.path)
+ # Merge this all into a single signature
result = self.cachesig = SCons.Util.MD5collect(sigs)
return result
-
default_fs = None
def get_default_fs():
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index a3016543..076ca65a 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -693,6 +693,15 @@ class NodeTestCase(unittest.TestCase):
node.set_precious(7)
assert node.precious == 7
+ def test_set_pseudo(self):
+ """Test setting a Node's pseudo value
+ """
+ node = SCons.Node.Node()
+ node.set_pseudo()
+ assert node.pseudo
+ node.set_pseudo(False)
+ assert not node.pseudo
+
def test_exists(self):
"""Test evaluating whether a Node exists.
"""
@@ -954,7 +963,7 @@ class NodeTestCase(unittest.TestCase):
self.source_scanner = scanner
builder = Builder2(ts1)
-
+
targets = builder([source])
s = targets[0].get_source_scanner(source)
assert s is ts1, s
@@ -967,7 +976,7 @@ class NodeTestCase(unittest.TestCase):
builder = Builder1(env=Environment(SCANNERS = [ts3]))
targets = builder([source])
-
+
s = targets[0].get_source_scanner(source)
assert s is ts3, s
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index 7f5d7ffe..9b6ab81d 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -47,6 +47,7 @@ import collections
import copy
from itertools import chain
+import SCons.Debug
from SCons.Debug import logInstanceCreation
import SCons.Executor
import SCons.Memoize
@@ -57,6 +58,10 @@ from SCons.Debug import Trace
def classname(obj):
return str(obj.__class__).split('.')[-1]
+# Set to false if we're doing a dry run. There's more than one of these
+# little treats
+do_store_info = True
+
# Node states
#
# These are in "priority" order, so that the maximum value for any
@@ -95,6 +100,11 @@ def do_nothing(node): pass
Annotate = do_nothing
+# Gets set to 'True' if we're running in interactive mode. Is
+# currently used to release parts of a target's info during
+# clean builds and update runs (see release_target_info).
+interactive = False
+
# Classes for signature info for Nodes.
class NodeInfoBase(object):
@@ -183,7 +193,7 @@ class Node(object):
pass
def __init__(self):
- if __debug__: logInstanceCreation(self, 'Node.Node')
+ if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node')
# Note that we no longer explicitly initialize a self.builder
# attribute to None here. That's because the self.builder
# attribute may be created on-the-fly later by a subclass (the
@@ -204,7 +214,7 @@ class Node(object):
self.depends_set = set()
self.ignore = [] # dependencies to ignore
self.ignore_set = set()
- self.prerequisites = SCons.Util.UniqueList()
+ self.prerequisites = None
self.implicit = None # implicit (scanned) dependencies (None means not scanned yet)
self.waiting_parents = set()
self.waiting_s_e = set()
@@ -214,6 +224,7 @@ class Node(object):
self.env = None
self.state = no_state
self.precious = None
+ self.pseudo = False
self.noclean = 0
self.nocache = 0
self.cached = 0 # is this node pulled from cache?
@@ -286,7 +297,8 @@ class Node(object):
except AttributeError:
pass
else:
- executor.cleanup()
+ if executor is not None:
+ executor.cleanup()
def reset_executor(self):
"Remove cached executor; forces recompute when needed."
@@ -346,10 +358,11 @@ class Node(object):
methods should call this base class method to get the child
check and the BuildInfo structure.
"""
- for d in self.depends:
- if d.missing():
- msg = "Explicit dependency `%s' not found, needed by target `%s'."
- raise SCons.Errors.StopError(msg % (d, self))
+ if self.depends is not None:
+ for d in self.depends:
+ if d.missing():
+ msg = "Explicit dependency `%s' not found, needed by target `%s'."
+ raise SCons.Errors.StopError(msg % (d, self))
if self.implicit is not None:
for i in self.implicit:
if i.missing():
@@ -385,6 +398,13 @@ class Node(object):
self.clear()
+ if self.pseudo:
+ if self.exists():
+ raise SCons.Errors.UserError("Pseudo target " + str(self) + " must not exist")
+ else:
+ if not self.exists() and do_store_info:
+ SCons.Warnings.warn(SCons.Warnings.TargetNotBuiltWarning,
+ "Cannot find target " + str(self) + " after building")
self.ninfo.update(self)
def visited(self):
@@ -400,6 +420,23 @@ class Node(object):
self.ninfo.update(self)
self.store_info()
+ 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
+
#
#
#
@@ -501,7 +538,7 @@ class Node(object):
def is_derived(self):
"""
- Returns true iff this node is derived (i.e. built).
+ Returns true if this node is derived (i.e. built).
This should return true only for nodes whose path should be in
the variant directory when duplicate=0 and should contribute their build
@@ -788,6 +825,10 @@ class Node(object):
"""Set the Node's precious value."""
self.precious = precious
+ def set_pseudo(self, pseudo = True):
+ """Set the Node's precious value."""
+ self.pseudo = pseudo
+
def set_noclean(self, noclean = 1):
"""Set the Node's noclean value."""
# Make sure noclean is an integer so the --debug=stree
@@ -837,6 +878,8 @@ class Node(object):
def add_prerequisite(self, prerequisite):
"""Adds prerequisites"""
+ if self.prerequisites is None:
+ self.prerequisites = SCons.Util.UniqueList()
self.prerequisites.extend(prerequisite)
self._children_reset()
@@ -924,20 +967,14 @@ class Node(object):
# dictionary patterns I found all ended up using "not in"
# internally anyway...)
if self.ignore_set:
- if self.implicit is None:
- iter = chain(self.sources,self.depends)
- else:
- iter = chain(self.sources, self.depends, self.implicit)
+ iter = chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit]))
children = []
for i in iter:
if i not in self.ignore_set:
children.append(i)
else:
- if self.implicit is None:
- children = self.sources + self.depends
- else:
- children = self.sources + self.depends + self.implicit
+ children = self.all_children(scan=0)
self._memo['children_get'] = children
return children
@@ -964,10 +1001,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...)
- if self.implicit is None:
- return self.sources + self.depends
- else:
- return self.sources + self.depends + self.implicit
+ return list(chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit])))
def children(self, scan=1):
"""Return a list of the node's direct children, minus those
@@ -1103,17 +1137,18 @@ class Node(object):
Return a text representation, suitable for displaying to the
user, of the include tree for the sources of this node.
"""
- if self.is_derived() and self.env:
+ if self.is_derived():
env = self.get_build_env()
- for s in self.sources:
- scanner = self.get_source_scanner(s)
- if scanner:
- path = self.get_build_scanner_path(scanner)
- else:
- path = None
- def f(node, env=env, scanner=scanner, path=path):
- return node.get_found_includes(env, scanner, path)
- return SCons.Util.render_tree(s, f, 1)
+ if env:
+ for s in self.sources:
+ scanner = self.get_source_scanner(s)
+ if scanner:
+ path = self.get_build_scanner_path(scanner)
+ else:
+ path = None
+ def f(node, env=env, scanner=scanner, path=path):
+ return node.get_found_includes(env, scanner, path)
+ return SCons.Util.render_tree(s, f, 1)
else:
return None
diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py
index 908be4de..2e21e5ab 100644
--- a/src/engine/SCons/Platform/posix.py
+++ b/src/engine/SCons/Platform/posix.py
@@ -58,176 +58,32 @@ def escape(arg):
return '"' + arg + '"'
-def exec_system(l, env):
- stat = os.system(' '.join(l))
- if stat & 0xff:
- return stat | 0x80
- return stat >> 8
+def exec_subprocess(l, env):
+ proc = subprocess.Popen(l, env = env, close_fds = True)
+ return proc.wait()
-def exec_spawnvpe(l, env):
- stat = os.spawnvpe(os.P_WAIT, l[0], l, env)
- # os.spawnvpe() returns the actual exit code, not the encoding
- # returned by os.waitpid() or os.system().
- return stat
-
-def exec_fork(l, env):
- pid = os.fork()
- if not pid:
- # Child process.
- exitval = 127
- try:
- os.execvpe(l[0], l, env)
- except OSError as e:
- exitval = exitvalmap.get(e[0], e[0])
- sys.stderr.write("scons: %s: %s\n" % (l[0], e[1]))
- os._exit(exitval)
- else:
- # Parent process.
- pid, stat = os.waitpid(pid, 0)
- if stat & 0xff:
- return stat | 0x80
- return stat >> 8
-
-def _get_env_command(sh, escape, cmd, args, env):
- s = ' '.join(args)
- if env:
- l = ['env', '-'] + \
- [escape(t[0])+'='+escape(t[1]) for t in env.items()] + \
- [sh, '-c', escape(s)]
- s = ' '.join(l)
- return s
-
-def env_spawn(sh, escape, cmd, args, env):
- return exec_system([_get_env_command( sh, escape, cmd, args, env)], env)
-
-def spawnvpe_spawn(sh, escape, cmd, args, env):
- return exec_spawnvpe([sh, '-c', ' '.join(args)], env)
-
-def fork_spawn(sh, escape, cmd, args, env):
- return exec_fork([sh, '-c', ' '.join(args)], env)
-
-def process_cmd_output(cmd_stdout, cmd_stderr, stdout, stderr):
- stdout_eof = stderr_eof = 0
- while not (stdout_eof and stderr_eof):
- try:
- (i,o,e) = select.select([cmd_stdout, cmd_stderr], [], [])
- if cmd_stdout in i:
- str = cmd_stdout.read()
- if len(str) == 0:
- stdout_eof = 1
- elif stdout is not None:
- stdout.write(str)
- if cmd_stderr in i:
- str = cmd_stderr.read()
- if len(str) == 0:
- #sys.__stderr__.write( "stderr_eof=1\n" )
- stderr_eof = 1
- else:
- #sys.__stderr__.write( "str(stderr) = %s\n" % str )
- stderr.write(str)
- except select.error as xxx_todo_changeme:
- (_errno, _strerror) = xxx_todo_changeme.args
- if _errno != errno.EINTR:
- raise
+def subprocess_spawn(sh, escape, cmd, args, env):
+ return exec_subprocess([sh, '-c', ' '.join(args)], env)
def exec_popen3(l, env, stdout, stderr):
- proc = subprocess.Popen(' '.join(l),
- stdout=stdout,
- stderr=stderr,
- shell=True)
- stat = proc.wait()
- if stat & 0xff:
- return stat | 0x80
- return stat >> 8
-
-def exec_piped_fork(l, env, stdout, stderr):
- # spawn using fork / exec and providing a pipe for the command's
- # stdout / stderr stream
- if stdout != stderr:
- (rFdOut, wFdOut) = os.pipe()
- (rFdErr, wFdErr) = os.pipe()
- else:
- (rFdOut, wFdOut) = os.pipe()
- rFdErr = rFdOut
- wFdErr = wFdOut
- # do the fork
- pid = os.fork()
- if not pid:
- # Child process
- os.close( rFdOut )
- if rFdOut != rFdErr:
- os.close( rFdErr )
- os.dup2( wFdOut, 1 ) # is there some symbolic way to do that ?
- os.dup2( wFdErr, 2 )
- os.close( wFdOut )
- if stdout != stderr:
- os.close( wFdErr )
- exitval = 127
- try:
- os.execvpe(l[0], l, env)
- except OSError as e:
- exitval = exitvalmap.get(e[0], e[0])
- stderr.write("scons: %s: %s\n" % (l[0], e[1]))
- os._exit(exitval)
- else:
- # Parent process
- pid, stat = os.waitpid(pid, 0)
- os.close( wFdOut )
- if stdout != stderr:
- os.close( wFdErr )
- childOut = os.fdopen( rFdOut )
- if stdout != stderr:
- childErr = os.fdopen( rFdErr )
- else:
- childErr = childOut
- process_cmd_output(childOut, childErr, stdout, stderr)
- os.close( rFdOut )
- if stdout != stderr:
- os.close( rFdErr )
- if stat & 0xff:
- return stat | 0x80
- return stat >> 8
+ proc = subprocess.Popen(l, env = env, close_fds = True,
+ stdout = stdout,
+ stderr = stderr)
+ return proc.wait()
def piped_env_spawn(sh, escape, cmd, args, env, stdout, stderr):
# spawn using Popen3 combined with the env command
# the command name and the command's stdout is written to stdout
# the command's stderr is written to stderr
- return exec_popen3([_get_env_command(sh, escape, cmd, args, env)],
+ return exec_popen3([sh, '-c', ' '.join(args)],
env, stdout, stderr)
-def piped_fork_spawn(sh, escape, cmd, args, env, stdout, stderr):
- # spawn using fork / exec and providing a pipe for the command's
- # stdout / stderr stream
- return exec_piped_fork([sh, '-c', ' '.join(args)],
- env, stdout, stderr)
-
-
def generate(env):
- # If os.spawnvpe() exists, we use it to spawn commands. Otherwise
- # if the env utility exists, we use os.system() to spawn commands,
- # finally we fall back on os.fork()/os.exec().
- #
- # os.spawnvpe() is prefered because it is the most efficient. But
- # for Python versions without it, os.system() is prefered because it
- # is claimed that it works better with threads (i.e. -j) and is more
- # efficient than forking Python.
- #
- # NB: Other people on the scons-users mailing list have claimed that
- # os.fork()/os.exec() works better than os.system(). There may just
- # not be a default that works best for all users.
-
- if 'spawnvpe' in os.__dict__:
- spawn = spawnvpe_spawn
- elif env.Detect('env'):
- spawn = env_spawn
- else:
- spawn = fork_spawn
-
- if env.Detect('env'):
- pspawn = piped_env_spawn
- else:
- pspawn = piped_fork_spawn
+ # Bearing in mind we have python 2.4 as a baseline, we can just do this:
+ spawn = subprocess_spawn
+ pspawn = piped_env_spawn
+ # Note that this means that 'escape' is no longer used
if 'ENV' not in env:
env['ENV'] = {}
diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py
index 62f26712..be0b9c17 100644
--- a/src/engine/SCons/SConf.py
+++ b/src/engine/SCons/SConf.py
@@ -484,6 +484,9 @@ class SConfBase(object):
# so we really control how it gets written.
for n in nodes:
n.store_info = n.do_not_store_info
+ if not hasattr(n, 'attributes'):
+ n.attributes = SCons.Node.Node.Attrs()
+ n.attributes.keep_targetinfo = 1
ret = 1
diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py
index ba524fd5..5ce4f0a8 100644
--- a/src/engine/SCons/SConfTests.py
+++ b/src/engine/SCons/SConfTests.py
@@ -182,7 +182,7 @@ class SConfTestCase(unittest.TestCase):
self.waiting_parents = set()
self.side_effects = []
self.builder = None
- self.prerequisites = []
+ self.prerequisites = None
def disambiguate(self):
return self
def has_builder(self):
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 584960bc..79064880 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -81,7 +81,12 @@ 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
+ # has redirected them elsewhere.
+ sys.stderr = sys.__stderr__
+ sys.stdout = sys.__stdout__
class SConsPrintHelpException(Exception):
pass
@@ -274,6 +279,9 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
(EnvironmentError, SCons.Errors.StopError,
SCons.Errors.UserError))):
type, value, trace = buildError.exc_info
+ if tb and print_stacktrace:
+ sys.stderr.write("scons: internal stack trace:\n")
+ traceback.print_tb(tb, file=sys.stderr)
traceback.print_exception(type, value, trace)
elif tb and print_stacktrace:
sys.stderr.write("scons: internal stack trace:\n")
@@ -624,7 +632,7 @@ def _set_debug_values(options):
debug_values = options.debug
if "count" in debug_values:
- # All of the object counts are within "if __debug__:" blocks,
+ # All of the object counts are within "if track_instances:" blocks,
# which get stripped when running optimized (with python -O or
# from compiled *.pyo files). Provide a warning if __debug__ is
# stripped, so it doesn't just look like --debug=count is broken.
@@ -632,6 +640,7 @@ def _set_debug_values(options):
if __debug__: enable_count = True
if enable_count:
count_stats.enable(sys.stdout)
+ SCons.Debug.track_instances = True
else:
msg = "--debug=count is not supported when running SCons\n" + \
"\twith the python -O option or optimized (.pyo) modules."
@@ -646,6 +655,8 @@ def _set_debug_values(options):
if "memory" in debug_values:
memory_stats.enable(sys.stdout)
print_objects = ("objects" in debug_values)
+ if print_objects:
+ SCons.Debug.track_instances = True
if "presub" in debug_values:
SCons.Action.print_actions_presub = 1
if "stacktrace" in debug_values:
@@ -985,9 +996,9 @@ def _main(parser):
# reading SConscript files and haven't started building
# things yet, stop regardless of whether they used -i or -k
# or anything else.
+ revert_io()
sys.stderr.write("scons: *** %s Stop.\n" % e)
- exit_status = 2
- sys.exit(exit_status)
+ sys.exit(2)
global sconscript_time
sconscript_time = time.time() - start_time
@@ -1065,6 +1076,7 @@ def _main(parser):
platform = SCons.Platform.platform_module()
if options.interactive:
+ SCons.Node.interactive = True
SCons.Script.Interactive.interact(fs, OptionsParser, options,
targets, target_top)
@@ -1073,6 +1085,8 @@ def _main(parser):
# Build the targets
nodes = _build_targets(fs, options, targets, target_top)
if not nodes:
+ revert_io()
+ print('Found nothing to build')
exit_status = 2
def _build_targets(fs, options, targets, target_top):
@@ -1085,12 +1099,14 @@ def _build_targets(fs, options, targets, target_top):
SCons.Action.print_actions = not options.silent
SCons.Action.execute_actions = not options.no_exec
SCons.Node.FS.do_store_info = not options.no_exec
+ SCons.Node.do_store_info = not options.no_exec
SCons.SConf.dryrun = options.no_exec
if options.diskcheck:
SCons.Node.FS.set_diskcheck(options.diskcheck)
SCons.CacheDir.cache_enabled = not options.cache_disable
+ SCons.CacheDir.cache_readonly = options.cache_readonly
SCons.CacheDir.cache_debug = options.cache_debug
SCons.CacheDir.cache_force = options.cache_force
SCons.CacheDir.cache_show = options.cache_show
@@ -1300,12 +1316,8 @@ def _exec_main(parser, values):
prof = Profile()
try:
prof.runcall(_main, parser)
- except SConsPrintHelpException as e:
+ finally:
prof.dump_stats(options.profile_file)
- raise e
- except SystemExit:
- pass
- prof.dump_stats(options.profile_file)
else:
_main(parser)
@@ -1343,7 +1355,10 @@ def main():
OptionsParser = parser
try:
- _exec_main(parser, values)
+ try:
+ _exec_main(parser, values)
+ finally:
+ revert_io()
except SystemExit as s:
if s:
exit_status = s
@@ -1360,6 +1375,7 @@ def main():
parser.print_help()
exit_status = 0
except SCons.Errors.BuildError as e:
+ print(e)
exit_status = e.exitstatus
except:
# An exception here is likely a builtin Python exception Python
diff --git a/src/engine/SCons/Script/Main.xml b/src/engine/SCons/Script/Main.xml
index b582e0d7..147e778a 100644
--- a/src/engine/SCons/Script/Main.xml
+++ b/src/engine/SCons/Script/Main.xml
@@ -685,6 +685,25 @@ Multiple targets can be passed in to a single call to
</summary>
</scons_function>
+<scons_function name="Pseudo">
+<arguments>
+(target, ...)
+</arguments>
+<summary>
+<para>
+This indicates that each given
+<varname>target</varname>
+should not be created by the build rule, and if the target is created,
+an error will be generated. This is similar to the gnu make .PHONY
+target. However, in the vast majority of cases, an
+&f-Alias;
+is more appropriate.
+
+Multiple targets can be passed in to a single call to
+&f-Pseudo;.
+</para>
+</summary>
+</scons_function>
<scons_function name="SetOption">
<arguments>
(name, value)
@@ -788,4 +807,4 @@ SetOption('max_drift', 1)
</summary>
</scons_function>
-</sconsdoc> \ No newline at end of file
+</sconsdoc>
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index a97fc947..3602663c 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -248,7 +248,7 @@ class SConsOption(optparse.Option):
class SConsOptionGroup(optparse.OptionGroup):
"""
A subclass for SCons-specific option groups.
-
+
The only difference between this and the base class is that we print
the group's help text flush left, underneath their own title but
lined up with the normal "SCons Options".
@@ -340,7 +340,7 @@ class SConsOptionParser(optparse.OptionParser):
def add_local_option(self, *args, **kw):
"""
Adds a local option to the parser.
-
+
This is initiated by a SetOption() call to add a user-defined
command-line option. We add the option to a separate option
group for the local options, creating the group if necessary.
@@ -394,11 +394,11 @@ class SConsIndentedHelpFormatter(optparse.IndentedHelpFormatter):
out liking:
-- add our own regular expression that doesn't break on hyphens
- (so things like --no-print-directory don't get broken);
+ (so things like --no-print-directory don't get broken);
-- wrap the list of options themselves when it's too long
(the wrapper.fill(opts) call below);
-
+
-- set the subsequent_indent when wrapping the help_text.
"""
# The help for each option consists of two parts:
@@ -564,6 +564,11 @@ def Parser(version):
action="store_true",
help="Copy already-built targets into the CacheDir.")
+ op.add_option('--cache-readonly',
+ dest='cache_readonly', default=False,
+ action="store_true",
+ help="Do not update CacheDir with built targets.")
+
op.add_option('--cache-show',
dest='cache_show', default=False,
action="store_true",
@@ -579,8 +584,10 @@ def Parser(version):
if not value in c_options:
raise OptionValueError(opt_invalid('config', value, c_options))
setattr(parser.values, option.dest, value)
+
opt_config_help = "Controls Configure subsystem: %s." \
% ", ".join(config_options)
+
op.add_option('--config',
nargs=1, type="string",
dest="config", default="auto",
@@ -606,23 +613,25 @@ def Parser(version):
"pdb", "prepare", "presub", "stacktrace",
"time"]
- def opt_debug(option, opt, value, parser,
+ def opt_debug(option, opt, value__, parser,
debug_options=debug_options,
deprecated_debug_options=deprecated_debug_options):
- if value in debug_options:
- parser.values.debug.append(value)
- elif value in deprecated_debug_options.keys():
- parser.values.debug.append(value)
- try:
- parser.values.delayed_warnings
- except AttributeError:
- parser.values.delayed_warnings = []
- msg = deprecated_debug_options[value]
- w = "The --debug=%s option is deprecated%s." % (value, msg)
- t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w)
- parser.values.delayed_warnings.append(t)
- else:
- raise OptionValueError(opt_invalid('debug', value, debug_options))
+ for value in value__.split(','):
+ if value in debug_options:
+ parser.values.debug.append(value)
+ elif value in deprecated_debug_options.keys():
+ parser.values.debug.append(value)
+ try:
+ parser.values.delayed_warnings
+ except AttributeError:
+ parser.values.delayed_warnings = []
+ msg = deprecated_debug_options[value]
+ w = "The --debug=%s option is deprecated%s." % (value, msg)
+ t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w)
+ parser.values.delayed_warnings.append(t)
+ else:
+ raise OptionValueError(opt_invalid('debug', value, debug_options))
+
opt_debug_help = "Print various types of debugging information: %s." \
% ", ".join(debug_options)
op.add_option('--debug',
diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py
index f1e80ac9..43f2e1fd 100644
--- a/src/engine/SCons/Subst.py
+++ b/src/engine/SCons/Subst.py
@@ -78,6 +78,14 @@ class Literal(object):
def is_literal(self):
return 1
+ def __eq__(self, other):
+ if not isinstance(other, Literal):
+ return False
+ return self.lstr == other.lstr
+
+ def __neq__(self, other):
+ return not self.__eq__(other)
+
class SpecialAttrWrapper(object):
"""This is a wrapper for what we call a 'Node special attribute.'
This is any of the attributes of a Node that we can reference from
@@ -172,7 +180,7 @@ class NLWrapper(object):
In practice, this might be a wash performance-wise, but it's a little
cleaner conceptually...
"""
-
+
def __init__(self, list, func):
self.list = list
self.func = func
@@ -190,7 +198,7 @@ class NLWrapper(object):
self._create_nodelist = self._return_nodelist
return self.nodelist
_create_nodelist = _gen_nodelist
-
+
class Targets_or_Sources(collections.UserList):
"""A class that implements $TARGETS or $SOURCES expansions by in turn
@@ -451,7 +459,7 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={
raise_exception(NameError(key), lvars['TARGETS'], s)
else:
return ''
-
+
# Before re-expanding the result, handle
# recursive expansion by copying the local
# variable dictionary and overwriting a null
diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py
index 7001899a..05405833 100644
--- a/src/engine/SCons/SubstTests.py
+++ b/src/engine/SCons/SubstTests.py
@@ -1148,6 +1148,11 @@ class LiteralTestCase(unittest.TestCase):
cmd_list = escape_list(cmd_list[0], escape_func)
assert cmd_list == ['BAZ', '**$BAR**'], cmd_list
+ def test_LiteralEqualsTest(self):
+ """Test that Literals compare for equality properly"""
+ assert Literal('a literal') == Literal('a literal')
+ assert Literal('a literal') != Literal('b literal')
+
class SpecialAttrWrapperTestCase(unittest.TestCase):
def test_SpecialAttrWrapper(self):
"""Test the SpecialAttrWrapper() function."""
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py
index 86bff53a..00147b2c 100644
--- a/src/engine/SCons/Taskmaster.py
+++ b/src/engine/SCons/Taskmaster.py
@@ -187,6 +187,8 @@ class Task(object):
# or implicit dependencies exists, and also initialize the
# .sconsign info.
executor = self.targets[0].get_executor()
+ if executor is None:
+ return
executor.prepare()
for t in executor.get_action_targets():
if print_prepare:
@@ -290,6 +292,7 @@ class Task(object):
post-visit actions that must take place regardless of whether
or not the target was an actual built target or a source Node.
"""
+ global print_prepare
T = self.tm.trace
if T: T.write(self.trace_message('Task.executed_with_callbacks()',
self.node))
@@ -302,7 +305,12 @@ class Task(object):
if not t.cached:
t.push_to_cache()
t.built()
- t.visited()
+ t.visited()
+ if (not print_prepare and
+ (not hasattr(self, 'options') or not self.options.debug_includes)):
+ t.release_target_info()
+ else:
+ t.visited()
executed = executed_with_callbacks
@@ -383,6 +391,7 @@ class Task(object):
This is the default behavior for building only what's necessary.
"""
+ global print_prepare
T = self.tm.trace
if T: T.write(self.trace_message(u'Task.make_ready_current()',
self.node))
@@ -415,6 +424,9 @@ class Task(object):
# parallel build...)
t.visited()
t.set_state(NODE_UP_TO_DATE)
+ if (not print_prepare and
+ (not hasattr(self, 'options') or not self.options.debug_includes)):
+ t.release_target_info()
make_ready = make_ready_current
@@ -454,14 +466,15 @@ class Task(object):
parents[p] = parents.get(p, 0) + 1
for t in targets:
- for s in t.side_effects:
- if s.get_state() == NODE_EXECUTING:
- s.set_state(NODE_NO_STATE)
- for p in s.waiting_parents:
- parents[p] = parents.get(p, 0) + 1
- for p in s.waiting_s_e:
- if p.ref_count == 0:
- self.tm.candidates.append(p)
+ if t.side_effects is not None:
+ for s in t.side_effects:
+ if s.get_state() == NODE_EXECUTING:
+ s.set_state(NODE_NO_STATE)
+ for p in s.waiting_parents:
+ parents[p] = parents.get(p, 0) + 1
+ for p in s.waiting_s_e:
+ if p.ref_count == 0:
+ self.tm.candidates.append(p)
for p, subtract in parents.items():
p.ref_count = p.ref_count - subtract
@@ -924,7 +937,11 @@ class Taskmaster(object):
if node is None:
return None
- tlist = node.get_executor().get_all_targets()
+ 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:
diff --git a/src/engine/SCons/TaskmasterTests.py b/src/engine/SCons/TaskmasterTests.py
index 278b690c..d1264f3e 100644
--- a/src/engine/SCons/TaskmasterTests.py
+++ b/src/engine/SCons/TaskmasterTests.py
@@ -49,7 +49,7 @@ class Node(object):
self.scanned = 0
self.scanner = None
self.targets = [self]
- self.prerequisites = []
+ self.prerequisites = None
class Builder(object):
def targets(self, node):
return node.targets
@@ -141,6 +141,9 @@ class Node(object):
self.clear()
+ def release_target_info(self):
+ pass
+
def has_builder(self):
return not self.builder is None
diff --git a/src/engine/SCons/Tool/MSCommon/common.py b/src/engine/SCons/Tool/MSCommon/common.py
index e1b4820f..e5c78e93 100644
--- a/src/engine/SCons/Tool/MSCommon/common.py
+++ b/src/engine/SCons/Tool/MSCommon/common.py
@@ -147,9 +147,11 @@ def get_output(vcbat, args = None, env = None):
# settings in vs.py.
vars = [
'COMSPEC',
-# Still set, but setup script will discard these if registry has values.
-# 'VS110COMNTOOLS',
-# 'VS100COMNTOOLS',
+# 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.
+ 'VS110COMNTOOLS',
+ 'VS100COMNTOOLS',
'VS90COMNTOOLS',
'VS80COMNTOOLS',
'VS71COMNTOOLS',
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py
index 1a221ace..8f075694 100644
--- a/src/engine/SCons/Tool/MSCommon/vc.py
+++ b/src/engine/SCons/Tool/MSCommon/vc.py
@@ -258,15 +258,16 @@ def find_batch_file(env,msvc_version,host_arch,target_arch):
installed_sdks=get_installed_sdks()
for _sdk in installed_sdks:
- sdk_bat_file=_sdk.get_sdk_vc_script(host_arch,target_arch)
- sdk_bat_file_path=os.path.join(pdir,sdk_bat_file)
- debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path)
- if os.path.exists(sdk_bat_file_path):
- return (batfilename,sdk_bat_file_path)
+ sdk_bat_file = _sdk.get_sdk_vc_script(host_arch,target_arch)
+ if not sdk_bat_file:
+ debug("vc.py:find_batch_file() not found:%s"%_sdk)
else:
- debug("vc.py:find_batch_file() not found:%s"%sdk_bat_file_path)
- else:
- return (batfilename,None)
+ sdk_bat_file_path = os.path.join(pdir,sdk_bat_file)
+ 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)
+
__INSTALLED_VCS_RUN = None
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 517b987e..d30159d9 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -258,6 +258,10 @@ def VersionShLibLinkNames(version, libname, env):
print("VersionShLibLinkNames: linkname = ",linkname)
linknames.append(linkname)
elif platform == 'posix':
+ if sys.platform.startswith('openbsd'):
+ # OpenBSD uses x.y shared library versioning numbering convention
+ # and doesn't use symlinks to backwards-compatible libraries
+ return []
# For libfoo.so.x.y.z, linknames libfoo.so libfoo.so.x.y libfoo.so.x
suffix_re = re.escape(shlib_suffix + '.' + version)
# First linkname has no version number
@@ -303,13 +307,17 @@ symlinks for the platform we are on"""
if version:
# set the shared library link flags
if platform == 'posix':
- suffix_re = re.escape(shlib_suffix + '.' + version)
- (major, age, revision) = version.split(".")
- # soname will have only the major version number in it
- soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major
- shlink_flags += [ '-Wl,-Bsymbolic', '-Wl,-soname=%s' % soname ]
- if Verbose:
- print(" soname ",soname,", shlink_flags ",shlink_flags)
+ shlink_flags += [ '-Wl,-Bsymbolic' ]
+ # OpenBSD doesn't usually use SONAME for libraries
+ if not sys.platform.startswith('openbsd'):
+ # continue setup of shlink flags for all other POSIX systems
+ suffix_re = re.escape(shlib_suffix + '.' + version)
+ (major, age, revision) = version.split(".")
+ # soname will have only the major version number in it
+ soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major
+ shlink_flags += [ '-Wl,-soname=%s' % soname ]
+ if Verbose:
+ print(" soname ",soname,", shlink_flags ",shlink_flags)
elif platform == 'cygwin':
shlink_flags += [ '-Wl,-Bsymbolic',
'-Wl,--out-implib,${TARGET.base}.a' ]
@@ -357,7 +365,13 @@ symlinks for the platform we are on"""
print("VerShLib: made sym link of %s -> %s" % (linkname, lib_ver))
return result
-ShLibAction = SCons.Action.Action(VersionedSharedLibrary, None)
+# Fix http://scons.tigris.org/issues/show_bug.cgi?id=2903 :
+# Ensure we still depend on SCons.Defaults.ShLinkAction command line which is $SHLINKCOM.
+# This was tricky because we don't want changing LIBPATH to cause a rebuild, but
+# changing other link args should. LIBPATH has $( ... $) around it but until this
+# fix, when the varlist was added to the build sig those ignored parts weren't getting
+# ignored.
+ShLibAction = SCons.Action.Action(VersionedSharedLibrary, None, varlist=['SHLINKCOM'])
def createSharedLibBuilder(env):
"""This is a utility function that creates the SharedLibrary
diff --git a/src/engine/SCons/Tool/docbook/__init__.py b/src/engine/SCons/Tool/docbook/__init__.py
index d6713c69..72ea1758 100644
--- a/src/engine/SCons/Tool/docbook/__init__.py
+++ b/src/engine/SCons/Tool/docbook/__init__.py
@@ -260,6 +260,34 @@ def __xml_scan(node, env, path, arg):
docbook_xml_scanner = SCons.Script.Scanner(function = __xml_scan,
argument = None)
+
+#
+# Action generators
+#
+def __generate_xsltproc_action(source, target, env, for_signature):
+ cmd = env['DOCBOOK_XSLTPROCCOM']
+ # Does the environment have a base_dir defined?
+ base_dir = env.subst('$base_dir')
+ if base_dir:
+ # Yes, so replace target path by its filename
+ return cmd.replace('$TARGET','${TARGET.file}')
+ return cmd
+
+
+#
+# Emitters
+#
+def __emit_xsl_basedir(target, source, env):
+ # Does the environment have a base_dir defined?
+ base_dir = env.subst('$base_dir')
+ if base_dir:
+ # Yes, so prepend it to each target
+ return [os.path.join(base_dir, str(t)) for t in target], source
+
+ # No, so simply pass target and source names through
+ return target, source
+
+
#
# Builders
#
@@ -290,9 +318,14 @@ def __build_lxml(target, source, env):
"""
from lxml import etree
+ xslt_ac = etree.XSLTAccessControl(read_file=True,
+ write_file=True,
+ create_dir=True,
+ read_network=False,
+ write_network=False)
xsl_style = env.subst('$DOCBOOK_XSL')
xsl_tree = etree.parse(xsl_style)
- transform = etree.XSLT(xsl_tree)
+ transform = etree.XSLT(xsl_tree, access_control=xslt_ac)
doc = etree.parse(str(source[0]))
# Support for additional parameters
parampass = {}
@@ -340,11 +373,13 @@ def __xinclude_lxml(target, source, env):
__libxml2_builder = SCons.Builder.Builder(
action = __build_libxml2,
src_suffix = '.xml',
- source_scanner = docbook_xml_scanner)
+ source_scanner = docbook_xml_scanner,
+ emitter = __emit_xsl_basedir)
__lxml_builder = SCons.Builder.Builder(
action = __build_lxml,
src_suffix = '.xml',
- source_scanner = docbook_xml_scanner)
+ source_scanner = docbook_xml_scanner,
+ emitter = __emit_xsl_basedir)
__xinclude_libxml2_builder = SCons.Builder.Builder(
action = __xinclude_libxml2,
@@ -358,9 +393,11 @@ __xinclude_lxml_builder = SCons.Builder.Builder(
source_scanner = docbook_xml_scanner)
__xsltproc_builder = SCons.Builder.Builder(
- action = SCons.Action.Action('$DOCBOOK_XSLTPROCCOM','$DOCBOOK_XSLTPROCCOMSTR'),
+ action = SCons.Action.CommandGeneratorAction(__generate_xsltproc_action,
+ {'cmdstr' : '$DOCBOOK_XSLTPROCCOMSTR'}),
src_suffix = '.xml',
- source_scanner = docbook_xml_scanner)
+ source_scanner = docbook_xml_scanner,
+ emitter = __emit_xsl_basedir)
__xmllint_builder = SCons.Builder.Builder(
action = SCons.Action.Action('$DOCBOOK_XMLLINTCOM','$DOCBOOK_XMLLINTCOMSTR'),
suffix = '.xml',
@@ -372,6 +409,124 @@ __fop_builder = SCons.Builder.Builder(
src_suffix = '.fo',
ensure_suffix=1)
+def DocbookEpub(env, target, source=None, *args, **kw):
+ """
+ A pseudo-Builder, providing a Docbook toolchain for ePub output.
+ """
+ import zipfile
+ import shutil
+
+ def build_open_container(target, source, env):
+ """Generate the *.epub file from intermediate outputs
+
+ Constructs the epub file according to the Open Container Format. This
+ function could be replaced by a call to the SCons Zip builder if support
+ was added for different compression formats for separate source nodes.
+ """
+ zf = zipfile.ZipFile(str(target[0]), 'w')
+ mime_file = open('mimetype', 'w')
+ mime_file.write('application/epub+zip')
+ mime_file.close()
+ zf.write(mime_file.name, compress_type = zipfile.ZIP_STORED)
+ for s in source:
+ 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', ''))),
+ zipfile.ZIP_DEFLATED)
+ zf.close()
+
+ def add_resources(target, source, env):
+ """Add missing resources to the OEBPS directory
+
+ Ensure all the resources in the manifest are present in the OEBPS directory.
+ """
+ hrefs = []
+ content_file = os.path.join(source[0].abspath, 'content.opf')
+ if not os.path.isfile(content_file):
+ return
+
+ hrefs = []
+ if has_libxml2:
+ nsmap = {'opf' : 'http://www.idpf.org/2007/opf'}
+ # Read file and resolve entities
+ doc = libxml2.readFile(content_file, None, 0)
+ opf = doc.getRootElement()
+ # Create xpath context
+ xpath_context = doc.xpathNewContext()
+ # Register namespaces
+ for key, val in nsmap.iteritems():
+ xpath_context.xpathRegisterNs(key, val)
+
+ if hasattr(opf, 'xpathEval') and xpath_context:
+ # Use the xpath context
+ xpath_context.setContextNode(opf)
+ items = xpath_context.xpathEval(".//opf:item")
+ else:
+ items = opf.findall(".//{'http://www.idpf.org/2007/opf'}item")
+
+ for item in items:
+ if hasattr(item, 'prop'):
+ hrefs.append(item.prop('href'))
+ else:
+ hrefs.append(item.attrib['href'])
+
+ doc.freeDoc()
+ xpath_context.xpathFreeContext()
+ elif has_lxml:
+ from lxml import etree
+
+ opf = etree.parse(content_file)
+ # All the opf:item elements are resources
+ for item in opf.xpath('//opf:item',
+ namespaces= { 'opf': 'http://www.idpf.org/2007/opf' }):
+ hrefs.append(item.attrib['href'])
+
+ for href in hrefs:
+ # If the resource was not already created by DocBook XSL itself,
+ # copy it into the OEBPS folder
+ referenced_file = os.path.join(source[0].abspath, href)
+ if not os.path.exists(referenced_file):
+ shutil.copy(href, os.path.join(source[0].abspath, href))
+
+ # Init list of targets/sources
+ target, source = __extend_targets_sources(target, source)
+
+ # Init XSL stylesheet
+ __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_EPUB', ['epub','docbook.xsl'])
+
+ # Setup builder
+ __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+
+ # Create targets
+ result = []
+ if not env.GetOption('clean'):
+ # Ensure that the folders OEBPS and META-INF exist
+ __create_output_dir('OEBPS/')
+ __create_output_dir('META-INF/')
+ dirs = env.Dir(['OEBPS', 'META-INF'])
+
+ # Set the fixed base_dir
+ kw['base_dir'] = 'OEBPS/'
+ tocncx = __builder.__call__(env, 'toc.ncx', source[0], **kw)
+ cxml = env.File('META-INF/container.xml')
+ env.SideEffect(cxml, tocncx)
+
+ env.Depends(tocncx, kw['DOCBOOK_XSL'])
+ result.extend(tocncx+[cxml])
+
+ container = env.Command(__ensure_suffix(str(target[0]), '.epub'),
+ tocncx+[cxml], [add_resources, build_open_container])
+ mimetype = env.File('mimetype')
+ env.SideEffect(mimetype, container)
+
+ result.extend(container)
+ # Add supporting files for cleanup
+ env.Clean(tocncx, dirs)
+
+ return result
+
def DocbookHtml(env, target, source=None, *args, **kw):
"""
A pseudo-Builder, providing a Docbook toolchain for HTML output.
@@ -420,11 +575,11 @@ def DocbookHtmlChunked(env, target, source=None, *args, **kw):
# Create targets
result = []
- r = __builder.__call__(env, base_dir+__ensure_suffix(str(target[0]), '.html'), source[0], **kw)
+ r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)
env.Depends(r, kw['DOCBOOK_XSL'])
result.extend(r)
# Add supporting files for cleanup
- env.Clean(r, glob.glob(base_dir+'*.html'))
+ env.Clean(r, glob.glob(os.path.join(base_dir, '*.html')))
return result
@@ -455,12 +610,12 @@ def DocbookHtmlhelp(env, target, source=None, *args, **kw):
# Create targets
result = []
- r = __builder.__call__(env, base_dir+__ensure_suffix(str(target[0]), '.html'), source[0], **kw)
+ r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)
env.Depends(r, kw['DOCBOOK_XSL'])
result.extend(r)
# Add supporting files for cleanup
env.Clean(r, ['toc.hhc', 'htmlhelp.hhp', 'index.hhk'] +
- glob.glob(base_dir+'[ar|bk|ch]*.html'))
+ glob.glob(os.path.join(base_dir, '[ar|bk|ch]*.html')))
return result
@@ -605,12 +760,12 @@ def DocbookSlidesHtml(env, target, source=None, *args, **kw):
# Create targets
result = []
- r = __builder.__call__(env, base_dir+__ensure_suffix(str(target[0]), '.html'), source[0], **kw)
+ r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)
env.Depends(r, kw['DOCBOOK_XSL'])
result.extend(r)
# Add supporting files for cleanup
- env.Clean(r, [base_dir+'toc.html'] +
- glob.glob(base_dir+'foil*.html'))
+ env.Clean(r, [os.path.join(base_dir, 'toc.html')] +
+ glob.glob(os.path.join(base_dir, 'foil*.html')))
return result
@@ -654,19 +809,19 @@ def DocbookXslt(env, target, source=None, *args, **kw):
return result
-
def generate(env):
"""Add Builders and construction variables for docbook to an Environment."""
env.SetDefault(
# Default names for customized XSL stylesheets
- DOCBOOK_DEFAULT_XSL_HTML = '',
- DOCBOOK_DEFAULT_XSL_HTMLCHUNKED = '',
- DOCBOOK_DEFAULT_XSL_HTMLHELP = '',
- DOCBOOK_DEFAULT_XSL_PDF = '',
- DOCBOOK_DEFAULT_XSL_MAN = '',
- DOCBOOK_DEFAULT_XSL_SLIDESPDF = '',
- DOCBOOK_DEFAULT_XSL_SLIDESHTML = '',
+ DOCBOOK_DEFAULT_XSL_EPUB = '',
+ DOCBOOK_DEFAULT_XSL_HTML = '',
+ DOCBOOK_DEFAULT_XSL_HTMLCHUNKED = '',
+ DOCBOOK_DEFAULT_XSL_HTMLHELP = '',
+ DOCBOOK_DEFAULT_XSL_PDF = '',
+ DOCBOOK_DEFAULT_XSL_MAN = '',
+ DOCBOOK_DEFAULT_XSL_SLIDESPDF = '',
+ DOCBOOK_DEFAULT_XSL_SLIDESHTML = '',
# Paths to the detected executables
DOCBOOK_XSLTPROC = '',
@@ -693,6 +848,7 @@ def generate(env):
_detect(env)
try:
+ env.AddMethod(DocbookEpub, "DocbookEpub")
env.AddMethod(DocbookHtml, "DocbookHtml")
env.AddMethod(DocbookHtmlChunked, "DocbookHtmlChunked")
env.AddMethod(DocbookHtmlhelp, "DocbookHtmlhelp")
@@ -705,6 +861,7 @@ def generate(env):
except AttributeError:
# Looks like we use a pre-0.98 version of SCons...
from SCons.Script.SConscript import SConsEnvironment
+ SConsEnvironment.DocbookEpub = DocbookEpub
SConsEnvironment.DocbookHtml = DocbookHtml
SConsEnvironment.DocbookHtmlChunked = DocbookHtmlChunked
SConsEnvironment.DocbookHtmlhelp = DocbookHtmlhelp
diff --git a/src/engine/SCons/Tool/docbook/__init__.xml b/src/engine/SCons/Tool/docbook/__init__.xml
index be2f2cab..07487384 100644
--- a/src/engine/SCons/Tool/docbook/__init__.xml
+++ b/src/engine/SCons/Tool/docbook/__init__.xml
@@ -97,7 +97,7 @@ accordingly.
</para>
</important>
<para>The rules given above are valid for the Builders &b-link-DocbookHtml;,
-&b-link-DocbookPdf;, &b-link-DocbookSlidesPdf; and &b-link-DocbookXInclude;. For the
+&b-link-DocbookPdf;, &b-link-DocbookEpub;, &b-link-DocbookSlidesPdf; and &b-link-DocbookXInclude;. For the
&b-link-DocbookMan; transformation you
can specify a target name, but the actual output names are automatically
set from the <literal>refname</literal> entries in your XML source.
@@ -136,6 +136,7 @@ variables for setting the default XSL name is provided. These are:
DOCBOOK_DEFAULT_XSL_HTMLCHUNKED
DOCBOOK_DEFAULT_XSL_HTMLHELP
DOCBOOK_DEFAULT_XSL_PDF
+DOCBOOK_DEFAULT_XSL_EPUB
DOCBOOK_DEFAULT_XSL_MAN
DOCBOOK_DEFAULT_XSL_SLIDESPDF
DOCBOOK_DEFAULT_XSL_SLIDESHTML
@@ -153,6 +154,7 @@ env.DocbookHtml('manual') # now uses html.xsl
<item>DOCBOOK_DEFAULT_XSL_HTMLCHUNKED</item>
<item>DOCBOOK_DEFAULT_XSL_HTMLHELP</item>
<item>DOCBOOK_DEFAULT_XSL_PDF</item>
+<item>DOCBOOK_DEFAULT_XSL_EPUB</item>
<item>DOCBOOK_DEFAULT_XSL_MAN</item>
<item>DOCBOOK_DEFAULT_XSL_SLIDESPDF</item>
<item>DOCBOOK_DEFAULT_XSL_SLIDESHTML</item>
@@ -212,6 +214,15 @@ current environment, if no other XSLT gets specified via keyword.
</summary>
</cvar>
+<cvar name="DOCBOOK_DEFAULT_XSL_EPUB">
+<summary>
+<para>
+The default XSLT file for the &b-link-DocbookEpub; builder within the
+current environment, if no other XSLT gets specified via keyword.
+</para>
+</summary>
+</cvar>
+
<cvar name="DOCBOOK_DEFAULT_XSL_MAN">
<summary>
<para>
@@ -473,6 +484,27 @@ env.DocbookPdf('manual')
</summary>
</builder>
+<builder name="DocbookEpub">
+<summary>
+<para>
+A pseudo-Builder, providing a Docbook toolchain for EPUB output.
+</para>
+
+<example_commands>env = Environment(tools=['docbook'])
+env.DocbookEpub('manual.epub', 'manual.xml')
+</example_commands>
+
+<para>
+or simply
+</para>
+
+<example_commands>env = Environment(tools=['docbook'])
+env.DocbookEpub('manual')
+</example_commands>
+
+</summary>
+</builder>
+
<builder name="DocbookMan">
<summary>
<para>
diff --git a/src/engine/SCons/Tool/gs.py b/src/engine/SCons/Tool/gs.py
index c5506ce1..443ace26 100644
--- a/src/engine/SCons/Tool/gs.py
+++ b/src/engine/SCons/Tool/gs.py
@@ -34,6 +34,7 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import SCons.Action
+import SCons.Builder
import SCons.Platform
import SCons.Util
@@ -52,17 +53,26 @@ GhostscriptAction = None
def generate(env):
"""Add Builders and construction variables for Ghostscript to an
Environment."""
-
global GhostscriptAction
- if GhostscriptAction is None:
- GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR')
-
- from . import pdf
- pdf.generate(env)
-
- bld = env['BUILDERS']['PDF']
- bld.add_action('.ps', GhostscriptAction)
-
+ # The following try-except block enables us to use the Tool
+ # in standalone mode (without the accompanying pdf.py),
+ # whenever we need an explicit call of gs via the Gs()
+ # Builder ...
+ try:
+ if GhostscriptAction is None:
+ GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR')
+
+ from . import pdf
+ pdf.generate(env)
+
+ bld = env['BUILDERS']['PDF']
+ bld.add_action('.ps', GhostscriptAction)
+ except ImportError as e:
+ pass
+
+ gsbuilder = SCons.Builder.Builder(action = SCons.Action.Action('$GSCOM', '$GSCOMSTR'))
+ env['BUILDERS']['Gs'] = gsbuilder
+
env['GS'] = gs
env['GSFLAGS'] = SCons.Util.CLVar('-dNOPAUSE -dBATCH -sDEVICE=pdfwrite')
env['GSCOM'] = '$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES'
diff --git a/src/engine/SCons/Tool/gs.xml b/src/engine/SCons/Tool/gs.xml
index c34f0047..3fe51651 100644
--- a/src/engine/SCons/Tool/gs.xml
+++ b/src/engine/SCons/Tool/gs.xml
@@ -26,7 +26,12 @@ See its __doc__ string for a discussion of the format.
<tool name="gs">
<summary>
<para>
-Set construction variables for Ghostscript.
+This Tool sets the required construction variables for working with
+the Ghostscript command. It also registers an appropriate Action
+with the PDF Builder (&b-link-PDF;), such that the conversion from
+PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain.
+Finally, it adds an explicit Ghostscript Builder (&b-link-Gs;) to the
+environment.
</para>
</summary>
<sets>
@@ -42,7 +47,7 @@ Set construction variables for Ghostscript.
<cvar name="GS">
<summary>
<para>
-The Ghostscript program used to convert PostScript to PDF files.
+The Ghostscript program used, e.g. to convert PostScript to PDF files.
</para>
</summary>
</cvar>
@@ -50,7 +55,8 @@ The Ghostscript program used to convert PostScript to PDF files.
<cvar name="GSCOM">
<summary>
<para>
-The Ghostscript command line used to convert PostScript to PDF files.
+The full Ghostscript command line used for the conversion process. Its default
+value is <quote><literal>$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES</literal></quote>.
</para>
</summary>
</cvar>
@@ -59,9 +65,8 @@ The Ghostscript command line used to convert PostScript to PDF files.
<summary>
<para>
The string displayed when
-Ghostscript is used to convert
-a PostScript file to a PDF file.
-If this is not set, then &cv-link-GSCOM; (the command line) is displayed.
+Ghostscript is called for the conversion process.
+If this is not set (the default), then &cv-link-GSCOM; (the command line) is displayed.
</para>
</summary>
</cvar>
@@ -69,10 +74,27 @@ If this is not set, then &cv-link-GSCOM; (the command line) is displayed.
<cvar name="GSFLAGS">
<summary>
<para>
-General options passed to the Ghostscript program
-when converting PostScript to PDF files.
+General options passed to the Ghostscript program,
+when converting PostScript to PDF files for example. Its default value
+is <quote><literal>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite</literal></quote>
</para>
</summary>
</cvar>
+<builder name="Gs">
+<summary>
+<para>
+A Builder for explicitly calling the <literal>gs</literal> executable.
+Depending on the underlying OS, the different names <literal>gs</literal>,
+<literal>gsos2</literal> and <literal>gswin32c</literal>
+are tried.
+</para>
+<example_commands>env = Environment(tools=['gs'])
+env.Gs('cover.jpg','scons-scons.pdf',
+ GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q')
+ )
+</example_commands>
+</summary>
+</builder>
+
</sconsdoc> \ No newline at end of file
diff --git a/src/engine/SCons/Tool/msginit.xml b/src/engine/SCons/Tool/msginit.xml
index 0f89020a..7ce785cf 100644
--- a/src/engine/SCons/Tool/msginit.xml
+++ b/src/engine/SCons/Tool/msginit.xml
@@ -216,8 +216,10 @@ See &t-link-msginit; tool and &b-link-POInit; builder.
Internal ``macro''. Computes locale (language) name based on target filename
(default: <literal>'${TARGET.filebase}' </literal>).
</para>
-</summary>
+<para>
See &t-link-msginit; tool and &b-link-POInit; builder.
+</para>
+</summary>
</cvar>
</sconsdoc> \ No newline at end of file
diff --git a/src/engine/SCons/Tool/rpm.py b/src/engine/SCons/Tool/rpm.py
index 26d21099..1f6eafe0 100644
--- a/src/engine/SCons/Tool/rpm.py
+++ b/src/engine/SCons/Tool/rpm.py
@@ -79,7 +79,7 @@ def build_rpm(target, source, env):
errstr=output,
filename=str(target[0]) )
else:
- # XXX: assume that LC_ALL=c is set while running rpmbuild
+ # XXX: assume that LC_ALL=C is set while running rpmbuild
output_files = re.compile( 'Wrote: (.*)' ).findall( output )
for output, input in zip( output_files, target ):
@@ -117,7 +117,7 @@ def generate(env):
bld = RpmBuilder
env['BUILDERS']['Rpm'] = bld
- env.SetDefault(RPM = 'LC_ALL=c rpmbuild')
+ env.SetDefault(RPM = 'LC_ALL=C rpmbuild')
env.SetDefault(RPMFLAGS = SCons.Util.CLVar('-ta'))
env.SetDefault(RPMCOM = rpmAction)
env.SetDefault(RPMSUFFIX = '.rpm')
diff --git a/src/engine/SCons/Tool/zip.xml b/src/engine/SCons/Tool/zip.xml
index af685332..f43aa311 100644
--- a/src/engine/SCons/Tool/zip.xml
+++ b/src/engine/SCons/Tool/zip.xml
@@ -145,11 +145,13 @@ The suffix used for zip file names.
<cvar name="ZIPROOT">
<summary>
+<para>
An optional zip root directory (default empty). The filenames stored
in the zip file will be relative to this directory, if given.
Otherwise the filenames are relative to the current directory of the
command.
For instance:
+</para>
<example_commands>
env = Environment()
env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1')
diff --git a/src/engine/SCons/Warnings.py b/src/engine/SCons/Warnings.py
index a260c4ac..ca6acee9 100644
--- a/src/engine/SCons/Warnings.py
+++ b/src/engine/SCons/Warnings.py
@@ -42,6 +42,9 @@ class WarningOnByDefault(Warning):
# NOTE: If you add a new warning class, add it to the man page, too!
+class TargetNotBuiltWarning(Warning): # Should go to OnByDefault
+ pass
+
class CacheWriteErrorWarning(Warning):
pass
diff --git a/test/CacheDir/option--cr.py b/test/CacheDir/option--cr.py
new file mode 100644
index 00000000..de6bbc85
--- /dev/null
+++ b/test/CacheDir/option--cr.py
@@ -0,0 +1,138 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the --cache-readonly option when retrieving derived files from a
+CacheDir. It should retrieve as normal but not update files.
+"""
+
+import os.path
+import shutil
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.subdir('cache', 'src')
+
+test.write(['src', 'SConstruct'], """
+def cat(env, source, target):
+ target = str(target[0])
+ open('cat.out', 'ab').write(target + "\\n")
+ f = open(target, "wb")
+ for src in source:
+ f.write(open(str(src), "rb").read())
+ f.close()
+env = Environment(BUILDERS={'Cat':Builder(action=cat)})
+env.Cat('aaa.out', 'aaa.in')
+env.Cat('bbb.out', 'bbb.in')
+env.Cat('ccc.out', 'ccc.in')
+env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out'])
+CacheDir(r'%s')
+""" % test.workpath('cache'))
+
+test.write(['src', 'aaa.in'], "aaa.in\n")
+test.write(['src', 'bbb.in'], "bbb.in\n")
+test.write(['src', 'ccc.in'], "ccc.in\n")
+
+# Verify that a normal build works correctly, and clean up.
+# This should populate the cache with our derived files.
+test.run(chdir = 'src', arguments = '.')
+
+test.must_match(['src', 'all'], "aaa.in\nbbb.in\nccc.in\n")
+test.must_match(['src', 'cat.out'], "aaa.out\nbbb.out\nccc.out\nall\n")
+
+test.up_to_date(chdir = 'src', arguments = '.')
+
+test.run(chdir = 'src', arguments = '-c .')
+test.unlink(['src', 'cat.out'])
+
+# Verify that we now retrieve the derived files from cache,
+# not rebuild them. Then clean up.
+test.run(chdir = 'src', arguments = '--cache-readonly .',
+ stdout = test.wrap_stdout("""\
+Retrieved `aaa.out' from cache
+Retrieved `bbb.out' from cache
+Retrieved `ccc.out' from cache
+Retrieved `all' from cache
+"""))
+
+test.must_match(['src', 'all'], "aaa.in\nbbb.in\nccc.in\n")
+test.must_not_exist(test.workpath('src', 'cat.out'))
+
+test.up_to_date(chdir = 'src', arguments = '.')
+
+test.run(chdir = 'src', arguments = '-c .')
+
+# What we do now is to change one of the files and rebuild
+test.write(['src', 'aaa.in'], "aaa.rebuild\n")
+
+# This should just rebuild aaa.out (and all)
+test.run(chdir = 'src',
+ arguments = '--cache-readonly .',
+ stdout = test.wrap_stdout("""\
+cat(["aaa.out"], ["aaa.in"])
+Retrieved `bbb.out' from cache
+Retrieved `ccc.out' from cache
+cat(["all"], ["aaa.out", "bbb.out", "ccc.out"])
+"""))
+
+test.must_match(['src', 'all'], "aaa.rebuild\nbbb.in\nccc.in\n")
+# cat.out contains only the things we built (not got from cache)
+test.must_match(['src', 'cat.out'], "aaa.out\nall\n")
+
+test.up_to_date(chdir = 'src', arguments = '.')
+
+test.run(chdir = 'src', arguments = '-c .')
+test.unlink(['src', 'cat.out'])
+
+# Verify that aaa.out contents weren't updated with the last build
+# Then clean up.
+test.run(chdir = 'src',
+ arguments = '--cache-readonly .',
+ stdout = test.wrap_stdout("""\
+cat(["aaa.out"], ["aaa.in"])
+Retrieved `bbb.out' from cache
+Retrieved `ccc.out' from cache
+cat(["all"], ["aaa.out", "bbb.out", "ccc.out"])
+"""))
+
+test.must_match(['src', 'all'], "aaa.rebuild\nbbb.in\nccc.in\n")
+test.must_match(['src', 'cat.out'], "aaa.out\nall\n")
+
+test.up_to_date(chdir = 'src', arguments = '.')
+
+test.run(chdir = 'src', arguments = '-c .')
+test.unlink(['src', 'cat.out'])
+
+# All done.
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basedir/htmlchunked/htmlchunked.py b/test/Docbook/basedir/htmlchunked/htmlchunked.py
index c5817017..cf5f3d17 100644
--- a/test/Docbook/basedir/htmlchunked/htmlchunked.py
+++ b/test/Docbook/basedir/htmlchunked/htmlchunked.py
@@ -26,10 +26,16 @@
Test the base_dir argument for the chunked HTML builder.
"""
+import os
+import sys
import TestSCons
test = TestSCons.TestSCons()
+if not (sys.platform.startswith('linux') and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl')):
+ test.skip_test('Wrong OS or no stylesheets installed, skipping test.\n')
+
try:
import libxml2
except:
diff --git a/test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py b/test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py
new file mode 100644
index 00000000..b507eb12
--- /dev/null
+++ b/test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the base_dir argument for the chunked HTML builder while using
+the xsltproc executable, if it exists.
+"""
+
+import os
+import sys
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not (xsltproc and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl')):
+ test.skip_test('No xsltproc or no stylesheets installed, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
+test.must_exist(test.workpath('output/index.html'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('output/index.html'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basedir/htmlchunked/image/SConstruct.cmd b/test/Docbook/basedir/htmlchunked/image/SConstruct.cmd
new file mode 100644
index 00000000..d981b284
--- /dev/null
+++ b/test/Docbook/basedir/htmlchunked/image/SConstruct.cmd
@@ -0,0 +1,2 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookHtmlChunked('manual', xsl='html.xsl', base_dir='output/')
diff --git a/test/Docbook/basedir/htmlhelp/htmlhelp.py b/test/Docbook/basedir/htmlhelp/htmlhelp.py
index 736f7322..22bbd72a 100644
--- a/test/Docbook/basedir/htmlhelp/htmlhelp.py
+++ b/test/Docbook/basedir/htmlhelp/htmlhelp.py
@@ -26,10 +26,16 @@
Test the base_dir argument for the HTMLHELP builder.
"""
+import os
+import sys
import TestSCons
test = TestSCons.TestSCons()
+if not (sys.platform.startswith('linux') and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl')):
+ test.skip_test('Wrong OS or no stylesheets installed, skipping test.\n')
+
try:
import libxml2
except:
diff --git a/test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py b/test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py
new file mode 100644
index 00000000..a0f5e8ac
--- /dev/null
+++ b/test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the base_dir argument for the HTMLHELP builder while using
+the xsltproc executable, if it exists.
+"""
+
+import os
+import sys
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not (xsltproc and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl')):
+ test.skip_test('No xsltproc or no stylesheets installed, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
+test.must_exist(test.workpath('output/index.html'))
+test.must_exist(test.workpath('htmlhelp.hhp'))
+test.must_exist(test.workpath('toc.hhc'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('output/index.html'))
+test.must_not_exist(test.workpath('htmlhelp.hhp'))
+test.must_not_exist(test.workpath('toc.hhc'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basedir/htmlhelp/image/SConstruct.cmd b/test/Docbook/basedir/htmlhelp/image/SConstruct.cmd
new file mode 100644
index 00000000..8c7c9ca3
--- /dev/null
+++ b/test/Docbook/basedir/htmlhelp/image/SConstruct.cmd
@@ -0,0 +1,3 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/')
+
diff --git a/test/Docbook/basedir/slideshtml/image/SConstruct.cmd b/test/Docbook/basedir/slideshtml/image/SConstruct.cmd
new file mode 100644
index 00000000..297aeb59
--- /dev/null
+++ b/test/Docbook/basedir/slideshtml/image/SConstruct.cmd
@@ -0,0 +1,3 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookSlidesHtml('virt', xsl='slides.xsl', base_dir='output/')
+
diff --git a/test/Docbook/basedir/slideshtml/slideshtml.py b/test/Docbook/basedir/slideshtml/slideshtml.py
index 505d36de..a2375e4a 100644
--- a/test/Docbook/basedir/slideshtml/slideshtml.py
+++ b/test/Docbook/basedir/slideshtml/slideshtml.py
@@ -26,10 +26,17 @@
Test the base_dir argument for the Slides HTML builder.
"""
+import os
+import sys
import TestSCons
test = TestSCons.TestSCons()
+if not (sys.platform.startswith('linux') and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl/slides') and
+ os.path.isdir('/usr/share/xml/docbook/custom/slides/3.3.1')):
+ test.skip_test('Wrong OS or no "slides" stylesheets installed, skipping test.\n')
+
try:
import libxml2
except:
diff --git a/test/Docbook/basedir/slideshtml/slideshtml_cmd.py b/test/Docbook/basedir/slideshtml/slideshtml_cmd.py
new file mode 100644
index 00000000..51ed6e4d
--- /dev/null
+++ b/test/Docbook/basedir/slideshtml/slideshtml_cmd.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the base_dir argument for the Slides HTML builder while using
+the xsltproc executable, if it exists.
+"""
+
+import os
+import sys
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not (xsltproc and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl/slides') and
+ os.path.isdir('/usr/share/xml/docbook/custom/slides/3.3.1')):
+ test.skip_test('No xsltproc or no "slides" stylesheets installed, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
+test.must_exist(test.workpath('output/index.html'))
+test.must_exist(test.workpath('output/toc.html'))
+test.must_exist(test.workpath('output/foil01.html'))
+test.must_exist(test.workpath('output/foilgroup01.html'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('output/index.html'))
+test.must_not_exist(test.workpath('output/toc.html'))
+test.must_not_exist(test.workpath('output/foil01.html'))
+test.must_not_exist(test.workpath('output/foilgroup01.html'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basic/epub/epub.py b/test/Docbook/basic/epub/epub.py
new file mode 100644
index 00000000..19e08a0a
--- /dev/null
+++ b/test/Docbook/basic/epub/epub.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the EPUB builder.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+try:
+ import libxml2
+except:
+ try:
+ import lxml
+ except:
+ test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(stderr=None)
+test.must_exist(test.workpath('manual.epub'))
+test.must_exist(test.workpath('OEBPS','toc.ncx'))
+test.must_exist(test.workpath('OEBPS','content.opf'))
+test.must_exist(test.workpath('META-INF','container.xml'))
+
+# Cleanup
+test.run(arguments='-c')
+test.must_not_exist(test.workpath('manual.epub'))
+test.must_not_exist(test.workpath('OEBPS'))
+test.must_not_exist(test.workpath('META-INF'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basic/epub/epub_cmd.py b/test/Docbook/basic/epub/epub_cmd.py
new file mode 100644
index 00000000..b79d1859
--- /dev/null
+++ b/test/Docbook/basic/epub/epub_cmd.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the EPUB builder while using
+the xsltproc executable, if it exists.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not xsltproc:
+ test.skip_test('No xsltproc executable found, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
+test.must_exist(test.workpath('manual.epub'))
+test.must_exist(test.workpath('OEBPS','toc.ncx'))
+test.must_exist(test.workpath('OEBPS','content.opf'))
+test.must_exist(test.workpath('META-INF','container.xml'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('manual.epub'))
+test.must_not_exist(test.workpath('OEBPS'))
+test.must_not_exist(test.workpath('META-INF'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basic/epub/image/SConstruct b/test/Docbook/basic/epub/image/SConstruct
new file mode 100644
index 00000000..16a06996
--- /dev/null
+++ b/test/Docbook/basic/epub/image/SConstruct
@@ -0,0 +1,2 @@
+env = Environment(tools=['docbook'])
+env.DocbookEpub('manual')
diff --git a/test/Docbook/basic/epub/image/SConstruct.cmd b/test/Docbook/basic/epub/image/SConstruct.cmd
new file mode 100644
index 00000000..27cf2c8f
--- /dev/null
+++ b/test/Docbook/basic/epub/image/SConstruct.cmd
@@ -0,0 +1,2 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookEpub('manual')
diff --git a/test/Docbook/basic/epub/image/manual.xml b/test/Docbook/basic/epub/image/manual.xml
new file mode 100644
index 00000000..ca12e0ed
--- /dev/null
+++ b/test/Docbook/basic/epub/image/manual.xml
@@ -0,0 +1,388 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2001-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
+ 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.
+
+-->
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<article>
+ <title>The SCons qt4 tool</title>
+
+ <articleinfo>
+ <author>
+ <surname>Dirk Baechle</surname>
+ </author>
+
+ <pubdate>2010-12-06</pubdate>
+ </articleinfo>
+
+ <section id="basics">
+ <title>Basics</title>
+
+ <para>This tool can be used to compile Qt projects, designed for versions
+ 4.x.y and higher. It is not usable for Qt3 and older versions, since some
+ of the helper tools (<literal>moc</literal>, <literal>uic</literal>)
+ behave different.</para>
+
+ <section id="install">
+ <title>Install</title>
+
+ <para>Installing it, requires you to copy (or, even better: checkout)
+ the contents of the package's <literal>qt4</literal> folder to</para>
+
+ <orderedlist>
+ <listitem>
+ <para><quote><literal>/path_to_your_project/site_scons/site_tools/qt4</literal></quote>,
+ if you need the Qt4 Tool in one project only, or</para>
+ </listitem>
+
+ <listitem>
+ <para><quote><literal>~/.scons/site_scons/site_tools/qt4</literal></quote>,
+ for a system-wide installation under your current login.</para>
+ </listitem>
+ </orderedlist>
+
+ <para>For more infos about this, please refer to</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>the SCons User's Guide, chap. 17.7 "Where to put your custom
+ Builders and Tools" and</para>
+ </listitem>
+
+ <listitem>
+ <para>the SCons Tools Wiki page at <ulink
+ url="http://scons.org/wiki/ToolsIndex">http://scons.org/wiki/ToolsIndex</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="activation">
+ <title>How to activate</title>
+
+ <para>For activating the tool "qt4", you have to add its name to the
+ Environment constructor, like this</para>
+
+ <screen>env = Environment(tools=['default','qt4'])
+</screen>
+
+ <para>On its startup, the Qt4 tool tries to read the variable
+ <literal>QT4DIR</literal> from the current Environment and
+ <literal>os.environ</literal>. If it is not set, the value of
+ <literal>QTDIR</literal> (in Environment/<literal>os.environ</literal>)
+ is used as a fallback.</para>
+
+ <para>So, you either have to explicitly give the path of your Qt4
+ installation to the Environment with</para>
+
+ <screen>env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3'
+</screen>
+
+ <para>or set the <literal>QT4DIR</literal> as environment variable in
+ your shell.</para>
+ </section>
+
+ <section id="requirements">
+ <title>Requirements</title>
+
+ <para>Under Linux, "qt4" uses the system tool
+ <literal>pkg-config</literal> for automatically setting the required
+ compile and link flags of the single Qt4 modules (like QtCore,
+ QtGui,...). This means that</para>
+
+ <orderedlist>
+ <listitem>
+ <para>you should have <literal>pkg-config</literal> installed,
+ and</para>
+ </listitem>
+
+ <listitem>
+ <para>you additionally have to set
+ <literal>PKG_CONFIG_PATH</literal> in your shell environment, such
+ that it points to $<literal>QT4DIR/lib/pkgconfig</literal> (or
+ $<literal>QT4DIR/lib</literal> for some older versions).</para>
+ </listitem>
+ </orderedlist>
+
+ <para>Based on these two environment variables
+ (<literal>QT4DIR</literal> and <literal>PKG_CONFIG_PATH</literal>), the
+ "qt4" tool initializes all <literal>QT4_*</literal> construction
+ variables listed in the Reference manual. This happens when the tool is
+ "detected" during Environment construction. As a consequence, the setup
+ of the tool gets a two-stage process, if you want to override the values
+ provided by your current shell settings:</para>
+
+ <screen># Stage 1: create plain environment
+qtEnv = Environment()
+# Set new vars
+qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3
+qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig'
+# Stage 2: add qt4 tool
+qtEnv.Tool('qt4')
+</screen>
+ </section>
+ </section>
+
+ <section id="boilerplate">
+ <title>Suggested boilerplate</title>
+
+ <para>Based on the requirements above, we suggest a simple ready-to-go
+ setup as follows:</para>
+
+ <para>SConstruct</para>
+
+ <screen># Detect Qt version
+qtdir = detectLatestQtDir()
+
+# Create base environment
+baseEnv = Environment()
+#...further customization of base env
+
+# Clone Qt environment
+qtEnv = baseEnv.Clone()
+# Set QT4DIR and PKG_CONFIG_PATH
+qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig')
+qtEnv['QT4DIR'] = qtdir
+# Add qt4 tool
+qtEnv.Tool('qt4')
+#...further customization of qt env
+
+# Export environments
+Export('baseEnv qtEnv')
+
+# Your other stuff...
+# ...including the call to your SConscripts
+</screen>
+
+ <para>In a SConscript</para>
+
+ <screen># Get the Qt4 environment
+Import('qtEnv')
+# Clone it
+env = qtEnv.clone()
+# Patch it
+env.Append(CCFLAGS=['-m32']) # or whatever
+# Use it
+env.StaticLibrary('foo', Glob('*.cpp'))
+</screen>
+
+ <para>The detection of the Qt directory could be as simple as directly
+ assigning a fixed path</para>
+
+ <screen>def detectLatestQtDir():
+ return "/usr/local/qt4.3.2"
+</screen>
+
+ <para>or a little more sophisticated</para>
+
+ <screen># Tries to detect the path to the installation of Qt with
+# the highest version number
+def detectLatestQtDir():
+ if sys.platform.startswith("linux"):
+ # Simple check: inspect only '/usr/local/Trolltech'
+ paths = glob.glob('/usr/local/Trolltech/*')
+ if len(paths):
+ paths.sort()
+ return paths[-1]
+ else:
+ return ""
+ else:
+ # Simple check: inspect only 'C:\Qt'
+ paths = glob.glob('C:\\Qt\\*')
+ if len(paths):
+ paths.sort()
+ return paths[-1]
+ else:
+ return os.environ.get("QTDIR","")
+</screen>
+ </section>
+
+ <section id="firstproject">
+ <title>A first project</title>
+
+ <para>The following SConscript is for a simple project with some cxx
+ files, using the QtCore, QtGui and QtNetwork modules:</para>
+
+ <screen>Import('qtEnv')
+env = qtEnv.Clone()
+env.EnableQt4Modules([
+ 'QtGui',
+ 'QtCore',
+ 'QtNetwork'
+ ])
+# Add your CCFLAGS and CPPPATHs to env here...
+
+env.Program('foo', Glob('*.cpp'))
+</screen>
+ </section>
+
+ <section id="mocup">
+ <title>MOC it up</title>
+
+ <para>For the basic support of automocing, nothing needs to be done by the
+ user. The tool usually detects the <literal>Q_OBJECT</literal> macro and
+ calls the <quote><literal>moc</literal></quote> executable
+ accordingly.</para>
+
+ <para>If you don't want this, you can switch off the automocing by
+ a</para>
+
+ <screen>env['QT4_AUTOSCAN'] = 0
+</screen>
+
+ <para>in your SConscript file. Then, you have to moc your files
+ explicitly, using the Moc4 builder.</para>
+
+ <para>You can also switch to an extended automoc strategy with</para>
+
+ <screen>env['QT4_AUTOSCAN_STRATEGY'] = 1
+</screen>
+
+ <para>Please read the description of the
+ <literal>QT4_AUTOSCAN_STRATEGY</literal> variable in the Reference manual
+ for details.</para>
+
+ <para>For debugging purposes, you can set the variable
+ <literal>QT4_DEBUG</literal> with</para>
+
+ <screen>env['QT4_DEBUG'] = 1
+</screen>
+
+ <para>which outputs a lot of messages during automocing.</para>
+ </section>
+
+ <section id="forms">
+ <title>Forms (.ui)</title>
+
+ <para>The header files with setup code for your GUI classes, are not
+ compiled automatically from your <literal>.ui</literal> files. You always
+ have to call the Uic4 builder explicitly like</para>
+
+ <screen>env.Uic4(Glob('*.ui'))
+env.Program('foo', Glob('*.cpp'))
+</screen>
+ </section>
+
+ <section id="resources">
+ <title>Resource files (.qrc)</title>
+
+ <para>Resource files are not built automatically, you always have to add
+ the names of the <literal>.qrc</literal> files to the source list for your
+ program or library:</para>
+
+ <screen>env.Program('foo', Glob('*.cpp')+Glob('*.qrc'))
+</screen>
+
+ <para>For each of the Resource input files, its prefix defines the name of
+ the resulting resource. An appropriate
+ <quote><literal>-name</literal></quote> option is added to the call of the
+ <literal>rcc</literal> executable by default.</para>
+
+ <para>You can also call the Qrc4 builder explicitly as</para>
+
+ <screen>qrccc = env.Qrc4('foo') # ['foo.qrc'] -&gt; ['qrc_foo.cc']
+</screen>
+
+ <para>or (overriding the default suffix)</para>
+
+ <screen>qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -&gt; ['qrc_myprefix_foo.cxx']
+</screen>
+
+ <para>and then add the resulting cxx file to the sources of your
+ Program/Library:</para>
+
+ <screen>env.Program('foo', Glob('*.cpp') + qrccc)
+</screen>
+ </section>
+
+ <section id="translation">
+ <title>Translation files</title>
+
+ <para>The update of the <literal>.ts</literal> files and the conversion to
+ binary <literal>.qm</literal> files is not done automatically. You have to
+ call the corresponding builders on your own.</para>
+
+ <para>Example for updating a translation file:</para>
+
+ <screen>env.Ts4('foo.ts','.') # -&gt; ['foo.ts']
+</screen>
+
+ <para>By default, the <literal>.ts</literal> files are treated as
+ <emphasis>precious</emphasis> targets. This means that they are not
+ removed prior to a rebuild, but simply get updated. Additionally, they do
+ not get cleaned on a <quote><literal>scons -c</literal></quote>. If you
+ want to delete the translation files on the
+ <quote><literal>-c</literal></quote> SCons command, you can set the
+ variable <quote><literal>QT4_CLEAN_TS</literal></quote> like this</para>
+
+ <screen>env['QT4_CLEAN_TS']=1
+</screen>
+
+ <para>Example for releasing a translation file, i.e. compiling it to a
+ <literal>.qm</literal> binary file:</para>
+
+ <screen>env.Qm4('foo') # ['foo.ts'] -&gt; ['foo.qm']
+</screen>
+
+ <para>or (overriding the output prefix)</para>
+
+ <screen>env.Qm4('myprefix','foo') # ['foo.ts'] -&gt; ['myprefix.qm']
+</screen>
+
+ <para>As an extension both, the Ts4() and Qm4 builder, support the
+ definition of multiple targets. So, calling</para>
+
+ <screen>env.Ts4(['app_en','app_de'], Glob('*.cpp'))
+</screen>
+
+ <para>and</para>
+
+ <screen>env.Qm4(['app','copy'], Glob('*.ts'))
+</screen>
+
+ <para>should work fine.</para>
+
+ <para>Finally, two short notes about the support of directories for the
+ Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to
+ it, as in</para>
+
+ <screen>env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']))
+</screen>
+
+ <para>where <literal>sub1</literal> is a folder that gets scanned
+ recursively for cxx files by <literal>lupdate</literal>. But like this,
+ you lose all dependency information for the subdir, i.e. if a file inside
+ the folder changes, the .ts file is not updated automatically! In this
+ case you should tell SCons to always update the target:</para>
+
+ <screen>ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])
+env.AlwaysBuild(ts)
+</screen>
+
+ <para>Last note: specifying the current folder
+ <quote><literal>.</literal></quote> as input to Ts4() and storing the
+ resulting .ts file in the same directory, leads to a dependency cycle! You
+ then have to store the .ts and .qm files outside of the current folder, or
+ use <literal>Glob('*.cpp'))</literal> instead.</para>
+ </section>
+</article>
diff --git a/test/Docbook/basic/html/html_cmd.py b/test/Docbook/basic/html/html_cmd.py
new file mode 100644
index 00000000..acb4dad9
--- /dev/null
+++ b/test/Docbook/basic/html/html_cmd.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the HTML builder while using
+the xsltproc executable, if it exists.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not xsltproc:
+ test.skip_test('No xsltproc executable found, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'])
+test.must_exist(test.workpath('manual.html'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('manual.html'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basic/html/image/SConstruct.cmd b/test/Docbook/basic/html/image/SConstruct.cmd
new file mode 100644
index 00000000..20b4aa25
--- /dev/null
+++ b/test/Docbook/basic/html/image/SConstruct.cmd
@@ -0,0 +1,3 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookHtml('manual')
+
diff --git a/test/Docbook/basic/htmlchunked/htmlchunked_cmd.py b/test/Docbook/basic/htmlchunked/htmlchunked_cmd.py
new file mode 100644
index 00000000..e1ad49a2
--- /dev/null
+++ b/test/Docbook/basic/htmlchunked/htmlchunked_cmd.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the chunked HTML builder while using
+the xsltproc executable, if it exists.
+"""
+
+import os
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not xsltproc:
+ test.skip_test('No xsltproc executable found, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
+test.must_exist(test.workpath('index.html'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('index.html'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basic/htmlchunked/image/SConstruct.cmd b/test/Docbook/basic/htmlchunked/image/SConstruct.cmd
new file mode 100644
index 00000000..e2406f29
--- /dev/null
+++ b/test/Docbook/basic/htmlchunked/image/SConstruct.cmd
@@ -0,0 +1,3 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookHtmlChunked('manual')
+
diff --git a/test/Docbook/basic/htmlhelp/htmlhelp_cmd.py b/test/Docbook/basic/htmlhelp/htmlhelp_cmd.py
new file mode 100644
index 00000000..8e1c1b6b
--- /dev/null
+++ b/test/Docbook/basic/htmlhelp/htmlhelp_cmd.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the HTMLHELP builder while using
+the xsltproc executable, if it exists.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not xsltproc:
+ test.skip_test('No xsltproc executable found, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
+test.must_exist(test.workpath('index.html'))
+test.must_exist(test.workpath('htmlhelp.hhp'))
+test.must_exist(test.workpath('toc.hhc'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('index.html'))
+test.must_not_exist(test.workpath('htmlhelp.hhp'))
+test.must_not_exist(test.workpath('toc.hhc'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basic/htmlhelp/image/SConstruct.cmd b/test/Docbook/basic/htmlhelp/image/SConstruct.cmd
new file mode 100644
index 00000000..29fb4fa6
--- /dev/null
+++ b/test/Docbook/basic/htmlhelp/image/SConstruct.cmd
@@ -0,0 +1,3 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookHtmlhelp('manual')
+
diff --git a/test/Docbook/basic/man/image/SConstruct.cmd b/test/Docbook/basic/man/image/SConstruct.cmd
new file mode 100644
index 00000000..8b1406b7
--- /dev/null
+++ b/test/Docbook/basic/man/image/SConstruct.cmd
@@ -0,0 +1,3 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookMan('refdb')
+
diff --git a/test/Docbook/basic/man/man_cmd.py b/test/Docbook/basic/man/man_cmd.py
new file mode 100644
index 00000000..f5127e32
--- /dev/null
+++ b/test/Docbook/basic/man/man_cmd.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the Man builder while using
+the xsltproc executable, if it exists.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not xsltproc:
+ test.skip_test('No xsltproc executable found, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
+test.must_exist(test.workpath('refdb.8'))
+test.must_exist(test.workpath('refdb.sh.8'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('refdb.8'))
+test.must_not_exist(test.workpath('refdb.sh.8'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/basic/slideshtml/image/SConstruct.cmd b/test/Docbook/basic/slideshtml/image/SConstruct.cmd
new file mode 100644
index 00000000..133cb118
--- /dev/null
+++ b/test/Docbook/basic/slideshtml/image/SConstruct.cmd
@@ -0,0 +1,3 @@
+env = Environment(DOCBOOK_PREFER_XSLTPROC=1, tools=['docbook'])
+env.DocbookSlidesHtml('virt')
+
diff --git a/test/Docbook/basic/slideshtml/slideshtml.py b/test/Docbook/basic/slideshtml/slideshtml.py
index d4636d4b..37c2be0c 100644
--- a/test/Docbook/basic/slideshtml/slideshtml.py
+++ b/test/Docbook/basic/slideshtml/slideshtml.py
@@ -26,10 +26,17 @@
Test the Slides HTML builder.
"""
+import os
+import sys
import TestSCons
test = TestSCons.TestSCons()
+if not (sys.platform.startswith('linux') and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl/slides') and
+ os.path.isdir('/usr/share/xml/docbook/custom/slides/3.3.1')):
+ test.skip_test('Wrong OS or no "slides" stylesheets installed, skipping test.\n')
+
try:
import libxml2
except:
diff --git a/test/Docbook/basic/slideshtml/slideshtml_cmd.py b/test/Docbook/basic/slideshtml/slideshtml_cmd.py
new file mode 100644
index 00000000..ce5c30ba
--- /dev/null
+++ b/test/Docbook/basic/slideshtml/slideshtml_cmd.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-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
+# 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.
+#
+
+"""
+Test the Slides HTML builder while using
+the xsltproc executable, if it exists.
+"""
+
+import os
+import sys
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+xsltproc = test.where_is('xsltproc')
+if not (xsltproc and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl/slides') and
+ os.path.isdir('/usr/share/xml/docbook/custom/slides/3.3.1')):
+ test.skip_test('No xsltproc executable or no "slides" stylesheets installed, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run(arguments=['-f','SConstruct.cmd'], stderr=None)
+test.must_exist(test.workpath('index.html'))
+test.must_exist(test.workpath('toc.html'))
+test.must_exist(test.workpath('foil01.html'))
+test.must_exist(test.workpath('foilgroup01.html'))
+
+# Cleanup
+test.run(arguments=['-f','SConstruct.cmd','-c'])
+test.must_not_exist(test.workpath('index.html'))
+test.must_not_exist(test.workpath('toc.html'))
+test.must_not_exist(test.workpath('foil01.html'))
+test.must_not_exist(test.workpath('foilgroup01.html'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Docbook/rootname/htmlchunked/htmlchunked.py b/test/Docbook/rootname/htmlchunked/htmlchunked.py
index 24890194..8ab91d2d 100644
--- a/test/Docbook/rootname/htmlchunked/htmlchunked.py
+++ b/test/Docbook/rootname/htmlchunked/htmlchunked.py
@@ -26,10 +26,16 @@
Test the root.name argument for the chunked HTML builder.
"""
+import os
+import sys
import TestSCons
test = TestSCons.TestSCons()
+if not (sys.platform.startswith('linux') and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl')):
+ test.skip_test('Wrong OS or no stylesheets installed, skipping test.\n')
+
try:
import libxml2
except:
diff --git a/test/Docbook/rootname/htmlhelp/htmlhelp.py b/test/Docbook/rootname/htmlhelp/htmlhelp.py
index 84be5d95..ee37e1a9 100644
--- a/test/Docbook/rootname/htmlhelp/htmlhelp.py
+++ b/test/Docbook/rootname/htmlhelp/htmlhelp.py
@@ -26,10 +26,16 @@
Test the root.name argument for the HTMLHELP builder.
"""
+import os
+import sys
import TestSCons
test = TestSCons.TestSCons()
+if not (sys.platform.startswith('linux') and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl')):
+ test.skip_test('Wrong OS or no stylesheets installed, skipping test.\n')
+
try:
import libxml2
except:
diff --git a/test/Docbook/rootname/slideshtml/slideshtml.py b/test/Docbook/rootname/slideshtml/slideshtml.py
index c316adae..4d550358 100644
--- a/test/Docbook/rootname/slideshtml/slideshtml.py
+++ b/test/Docbook/rootname/slideshtml/slideshtml.py
@@ -26,10 +26,17 @@
Test the root.name argument for the Slides HTML builder.
"""
+import os
+import sys
import TestSCons
test = TestSCons.TestSCons()
+if not (sys.platform.startswith('linux') and
+ os.path.isdir('/usr/share/xml/docbook/stylesheet/docbook-xsl/slides') and
+ os.path.isdir('/usr/share/xml/docbook/custom/slides/3.3.1')):
+ test.skip_test('Wrong OS or no "slides" stylesheets installed, skipping test.\n')
+
try:
import libxml2
except:
diff --git a/test/Ghostscript/GS.py b/test/Ghostscript/GS.py
index 2cae8b8d..daeea09e 100644
--- a/test/Ghostscript/GS.py
+++ b/test/Ghostscript/GS.py
@@ -51,6 +51,7 @@ env = Environment(GS = r'%(_python_)s mygs.py',
GSCOM = r'$GS $TARGET $SOURCE',
tools=['gs'])
env.PDF(target = 'test1.pdf', source = 'test1.ps')
+env.Gs(target = 'test2.pdf', source = 'test1.ps')
""" % locals())
test.write('test1.ps', r"""This is a .ps test.
@@ -60,6 +61,7 @@ test.write('test1.ps', r"""This is a .ps test.
test.run(arguments = '.', stderr = None)
test.fail_test(test.read('test1.pdf') != "This is a .ps test.\n")
+test.fail_test(test.read('test2.pdf') != "This is a .ps test.\n")
diff --git a/test/Libs/SharedLibrary-update-deps.py b/test/Libs/SharedLibrary-update-deps.py
new file mode 100644
index 00000000..5394bc7a
--- /dev/null
+++ b/test/Libs/SharedLibrary-update-deps.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that SharedLibrary() updates when a different lib is linked, even if it has the same md5.
+This is Tigris bug #2903.
+"""
+
+import sys
+import os.path
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.dir_fixture( "bug2903" )
+
+# Build the sub-libs (don't care about details of this)
+test.run(arguments='-f SConstruct-libs')
+
+# This should build the main lib, using libfoo.so
+test.run(arguments='libname=foo')
+# This should rebuild the main lib, using libbar.so;
+# it should NOT say it's already up to date.
+test.run(arguments='libname=bar')
+test.must_not_contain_any_line(test.stdout(), ["is up to date"])
+# Try it again, in reverse, to make sure:
+test.run(arguments='libname=foo')
+test.must_not_contain_any_line(test.stdout(), ["is up to date"])
+
+# Now try changing the link command line (in an innocuous way); should rebuild.
+if sys.platform == 'win32':
+ extraflags='shlinkflags=/DEBUG'
+else:
+ extraflags='shlinkflags=-g'
+
+test.run(arguments=['libname=foo', extraflags])
+test.must_not_contain_any_line(test.stdout(), ["is up to date"])
+test.run(arguments=['libname=foo', extraflags, '--debug=explain'])
+test.must_contain_all_lines(test.stdout(), ["is up to date"])
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Libs/SharedLibrary.py b/test/Libs/SharedLibrary.py
index b7d13744..eac575cb 100644
--- a/test/Libs/SharedLibrary.py
+++ b/test/Libs/SharedLibrary.py
@@ -60,6 +60,13 @@ obj = env.SharedObject('bar', 'foo.c')
Default(env.Library(target = 'foo', source = obj))
""")
+test.write('SConstructBaz', """
+env=Environment()
+env['SHLIBVERSION'] = '1.0.0'
+obj = env.SharedObject('baz', 'foo.c')
+Default(env.SharedLibrary(target = 'baz', source = obj))
+""")
+
test.write('foo.c', r"""
#include <stdio.h>
@@ -287,6 +294,12 @@ main(int argc, char *argv[])
test.run(program = test.workpath('progbar'),
stdout = "f4.c\nprogbar.c\n")
+if sys.platform.startswith('openbsd'):
+ # Make sure we don't link libraries with -Wl,-soname on OpenBSD.
+ test.run(arguments = '-f SConstructBaz')
+ for line in test.stdout().split('\n'):
+ test.fail_test(line.find('-Wl,-soname=libbaz.so') != -1)
+
test.pass_test()
# Local Variables:
diff --git a/test/Libs/bug2903/SConstruct b/test/Libs/bug2903/SConstruct
new file mode 100644
index 00000000..12919cef
--- /dev/null
+++ b/test/Libs/bug2903/SConstruct
@@ -0,0 +1,13 @@
+# SConstruct for testing but #2903.
+# The test changes the lib name to make sure it rebuilds
+# when the name changes, even if the content of the lib is the same.
+# Also, the test passes in extra shlinkflags to ensure things rebuild
+# when other linker options change, and not when they don't.
+# (This doesn't specifically test LIBPATH, but there's a test for
+# that already.)
+env=Environment()
+libname=ARGUMENTS.get('libname', 'foo')
+env.Append(SHLINKFLAGS=' $EXTRA_SHLINKFLAGS')
+shlinkflags=ARGUMENTS.get('shlinkflags', '')
+env.SharedLibrary('myshared', ['main.c'],
+ LIBS=[libname], LIBPATH='.', EXTRA_SHLINKFLAGS=shlinkflags)
diff --git a/test/Libs/bug2903/SConstruct-libs b/test/Libs/bug2903/SConstruct-libs
new file mode 100644
index 00000000..15900628
--- /dev/null
+++ b/test/Libs/bug2903/SConstruct-libs
@@ -0,0 +1,5 @@
+env=Environment()
+libfoo = env.SharedLibrary('foo', 'lib.c')
+env.InstallAs('${SHLIBPREFIX}bar${SHLIBSUFFIX}', libfoo[0])
+if len(libfoo) > 1: # on Windows, there's an import lib (also a .exp, but we don't want that)
+ env.InstallAs('${LIBPREFIX}bar${LIBSUFFIX}', libfoo[1])
diff --git a/test/Libs/bug2903/lib.c b/test/Libs/bug2903/lib.c
new file mode 100644
index 00000000..65f4cd29
--- /dev/null
+++ b/test/Libs/bug2903/lib.c
@@ -0,0 +1,4 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int i;
diff --git a/test/Libs/bug2903/main.c b/test/Libs/bug2903/main.c
new file mode 100644
index 00000000..a4b1ecc1
--- /dev/null
+++ b/test/Libs/bug2903/main.c
@@ -0,0 +1,6 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+void func()
+{
+}
diff --git a/test/Pseudo.py b/test/Pseudo.py
new file mode 100644
index 00000000..db3c30c0
--- /dev/null
+++ b/test/Pseudo.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+# Firstly, build a pseudo target and make sure we get no warnings it
+# doesn't exist under any circumstances
+test.write('SConstruct', """
+env = Environment()
+env.Pseudo(env.Command('foo.out', [], '@echo boo'))
+""")
+
+test.run(arguments='-Q', stdout = 'boo\n')
+
+test.run(arguments='-Q --warning=target-not-built', stdout = "boo\n")
+
+# Now do the same thing again but create the target and check we get an
+# error if it exists after the build
+test.write('SConstruct', """
+env = Environment()
+env.Pseudo(env.Command('foo.out', [], Touch('$TARGET')))
+""")
+
+test.run(arguments='-Q', stdout = 'Touch("foo.out")\n', stderr = None,
+ status = 2)
+test.must_contain_all_lines(test.stderr(),
+ 'scons: *** Pseudo target foo.out must not exist')
+test.run(arguments='-Q --warning=target-not-built',
+ stdout = 'Touch("foo.out")\n',
+ stderr = None, status = 2)
+test.must_contain_all_lines(test.stderr(),
+ 'scons: *** Pseudo target foo.out must not exist')
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/builderrors.py b/test/builderrors.py
index 0133107f..3d443bf7 100644
--- a/test/builderrors.py
+++ b/test/builderrors.py
@@ -107,9 +107,6 @@ test.fail_test(os.path.exists(test.workpath('f3.out')))
test.write('SConstruct', """
env=Environment()
-if env['PLATFORM'] == 'posix':
- from SCons.Platform.posix import fork_spawn
- env['SPAWN'] = fork_spawn
env['ENV']['PATH'] = ''
env.Command(target='foo.out', source=[], action='not_a_program')
""")
@@ -123,9 +120,6 @@ test.must_not_contain_any_line(test.stderr(), ['Exception', 'Traceback'])
long_cmd = 'xyz ' + "foobarxyz" * 100000
test.write('SConstruct', """
env=Environment()
-if env['PLATFORM'] == 'posix':
- from SCons.Platform.posix import fork_spawn
- env['SPAWN'] = fork_spawn
env.Command(target='longcmd.out', source=[], action='echo %s')
"""%long_cmd)
@@ -147,9 +141,6 @@ test.must_not_contain_any_line(test.stderr(), ['Exception', 'Traceback'])
# with error "Permission denied" or "No such file or directory".
test.write('SConstruct', """
env=Environment()
-if env['PLATFORM'] in ('posix', 'darwin'):
- from SCons.Platform.posix import fork_spawn
- env['SPAWN'] = fork_spawn
env['SHELL'] = 'one'
env.Command(target='badshell.out', source=[], action='foo')
""")
@@ -191,7 +182,7 @@ env2.Install("target", "dir2/myFile")
def print_build_failures():
from SCons.Script import GetBuildFailures
for bf in GetBuildFailures():
- print bf.action
+ print bf.action
atexit.register(print_build_failures)
""")
diff --git a/test/leaky-handles.py b/test/leaky-handles.py
new file mode 100644
index 00000000..9502d1b5
--- /dev/null
+++ b/test/leaky-handles.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Verify that file handles aren't leaked to child processes
+"""
+
+import os
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+if os.name != 'posix':
+ msg = "Skipping fork leak test on non-posix platform '%s'\n" % os.name
+ test.skip_test(msg)
+
+test.write('SConstruct', """
+
+#Leak a file handle
+open('/dev/null')
+
+#Check it gets closed
+test2 = Command('test2', [], '@ls /proc/$$$$/fd|wc -l')
+""")
+
+# In theory that should have 3 lines (handles 0/1/2). This is v. unix specific
+
+test.run(arguments = '-Q', stdout='3\n')
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/option/debug-multiple.py b/test/option/debug-multiple.py
new file mode 100644
index 00000000..f5bbdf09
--- /dev/null
+++ b/test/option/debug-multiple.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that --debug can take multiple options
+"""
+
+import re
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.write('SConstruct', """
+def cat(target, source, env):
+ open(str(target[0]), 'wb').write(open(str(source[0]), 'rb').read())
+env = Environment(BUILDERS={'Cat':Builder(action=Action(cat))})
+env.Cat('file.out', 'file.in')
+""")
+
+test.write('file.in', "file.in\n")
+
+# Just check that object counts for some representative classes
+# show up in the output.
+
+def find_object_count(s, stdout):
+ re_string = '\d+ +\d+ %s' % re.escape(s)
+ return re.search(re_string, stdout)
+
+objects = [
+ 'Action.CommandAction',
+ 'Builder.BuilderBase',
+ 'Environment.Base',
+ 'Executor.Executor',
+ 'Node.FS',
+ 'Node.FS.Base',
+ 'Node.Node',
+]
+
+for args in ['--debug=prepare,count', '--debug=count,prepare']:
+ test.run(arguments = args)
+ stdout = test.stdout()
+ missing = [o for o in objects if find_object_count(o, stdout) is None]
+
+ if missing:
+ print "Missing the following object lines from '%s' output:" % args
+ print "\t", ' '.join(missing)
+ print "STDOUT =========="
+ print stdout
+ test.fail_test(1)
+
+ if 'Preparing target file.out...' not in stdout:
+ print "Missing 'Preparing' lines from '%s' output:" % args
+ print "STDOUT =========="
+ print stdout
+ 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/test/option/warn-dependency.py b/test/option/warn-dependency.py
index 95d8fed3..ca0c2aa8 100644
--- a/test/option/warn-dependency.py
+++ b/test/option/warn-dependency.py
@@ -43,6 +43,7 @@ env=Environment()
env['BUILDERS']['test'] = Builder(action=build,
source_scanner=SCons.Defaults.ObjSourceScan)
env.test(target='foo', source='foo.c')
+env.Pseudo('foo')
""")
test.write("foo.c","""
diff --git a/test/warning-TargetNotBuiltWarning.py b/test/warning-TargetNotBuiltWarning.py
new file mode 100644
index 00000000..76fdc5cd
--- /dev/null
+++ b/test/warning-TargetNotBuiltWarning.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.write('SConstruct', """
+foo = Command('foo.out', [], '@echo boo')
+bill = Command('bill.out', [], Touch('$TARGET'))
+Depends(bill, foo)
+Alias('jim', bill)
+""")
+
+test.run(arguments='-Q jim', stdout = 'boo\nTouch("bill.out")\n')
+
+test.run(arguments='-Q jim --warning=target-not-built',
+ stdout = "boo\nscons: `jim' is up to date.\n",
+ stderr = None)
+test.must_contain_all_lines(test.stderr(),
+ 'scons: warning: Cannot find target foo.out after building')
+
+test.run(arguments='-Q jim --warning=target-not-built -n',
+ stdout = "scons: `jim' is up to date.\n")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: