Commits

Tom Tanner committed b8f89b5 Merge

Merged scons/scons into default

Comments (0)

Files changed (71)

QMTest/TestSCons.py

 
 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.
 """
 

File contents unchanged.

doc/design/engine.xml

   </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>
     during "cleanup":
     
     <programlisting>
-      env.Clean(target = 'foo')
-      env.NoClean('foo')
+env.Clean(target = 'foo')
+env.NoClean('foo')
     </programlisting>
     
     

doc/generated/builders.gen

 </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
 <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>

doc/generated/examples/commandline_Variables_custom_py_1_custom.py

 
-        RELEASE = 1
+RELEASE = 1
         
Add a comment to this file

doc/generated/examples/depends_ex1_5.xml

File contents unchanged.

doc/generated/examples/depends_include_SConstruct

 
-       Program('hello.c', CPPPATH = '.')
+Program('hello.c', CPPPATH = '.')
       

doc/generated/examples/depends_include_hello.h

 
-       #define string    "world"
+#define string    "world"
       

doc/generated/examples/hierarchy_Return_foo_SConscript

 
-          Import('env')
-          obj = env.Object('foo.c')
-          Return('obj')
+Import('env')
+obj = env.Object('foo.c')
+Return('obj')
         

doc/generated/examples/hierarchy_ex1_prog1_SConscript

 
-      env = Environment()
-      env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c'])
+env = Environment()
+env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c'])
       

doc/generated/examples/hierarchy_ex1_prog2_SConscript

 
-      env = Environment()
-      env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c'])
+env = Environment()
+env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c'])
       

doc/generated/examples/separate_builddir_sconscript_SConstruct

 
-      VariantDir('build', 'src')
-      SConscript('build/SConscript')
+VariantDir('build', 'src')
+SConscript('build/SConscript')
       

doc/generated/variables.gen

 </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>

doc/generated/variables.mod

 <!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>">
 
 <!--
 <!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>">
 
 <!--

doc/man/scons.xml

   <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>
   <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>
   <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>
   <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>

doc/python10/design.xml

     </para>
 
     <programlisting>
-      env = Environment()
-      env_debug = Environment(CCFLAGS = '-g')
+env = Environment()
+env_debug = Environment(CCFLAGS = '-g')
     </programlisting>
 
   </section>
     </para>
 
     <programlisting>
-      bld = Builder(name = 'Program', action = "$CC -o $TARGET $SOURCES")
+bld = Builder(name = 'Program', action = "$CC -o $TARGET $SOURCES")
     </programlisting>
 
     <para>
     </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>
     </para>
 
     <programlisting>
-      env = Environment(BUILDERS = [ Object, Library, WebPage, Program ])
+env = Environment(BUILDERS = [ Object, Library, WebPage, Program ])
     </programlisting>
 
   </section>
     </para>
 
     <programlisting>
-      env = Environment(SCANNERS = [ CScan, M4Scan ])
+env = Environment(SCANNERS = [ CScan, M4Scan ])
     </programlisting>
 
     <para>
     </para>
 
     <programlisting>
-      BuildDir(source = 'src', build = 'bld')
+BuildDir(source = 'src', build = 'bld')
     </programlisting>
 
     <para>
     </para>
 
     <programlisting>
-      BuildDir(source = 'src', build = 'bld', no_sources = 1)
+BuildDir(source = 'src', build = 'bld', no_sources = 1)
     </programlisting>
 
   </section>
     </para>
 
     <programlisting>
-      Repository('/home/source/1.1', '/home/source/1.0')
+Repository('/home/source/1.1', '/home/source/1.0')
     </programlisting>
 
     <para>
     </para>
 
     <programlisting>
-      Cache('/var/build.cache/i386')
+Cache('/var/build.cache/i386')
     </programlisting>
 
     <para>
   </para>
 
   <programlisting>
-    source_files = 'f1.c f2.c f3.c'
+source_files = 'f1.c f2.c f3.c'
   </programlisting>
 
   <para>
   </para>
 
   <programlisting>
-    SConscript('src/SConscript', 'lib/SConscript')
+SConscript('src/SConscript', 'lib/SConscript')
   </programlisting>
 
   <para>

doc/reference/Library.xml

  <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>
  <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>

doc/user/actions.xml

   </para>
 
   <sconstruct>
-    b = Builder(action = 'build &lt; $SOURCE &gt; $TARGET')
+b = Builder(action = 'build &lt; $SOURCE &gt; $TARGET')
   </sconstruct>
 
   <para>
   </para>
 
   <sconstruct>
-    b = Builder(action = Action('build &lt; $SOURCE &gt; $TARGET'))
+b = Builder(action = Action('build &lt; $SOURCE &gt; $TARGET'))
   </sconstruct>
 
   <para>

doc/user/add-method.xml

 
   <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>
 
 
   <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)
+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')
+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>
 

doc/user/alias.xml

 
   <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>
 
 
   <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>
 

doc/user/build-install.xml

     </para>
 
     <screen>
-       $ <userinput>python -V</userinput>
-       Python 2.5.1
+$ <userinput>python -V</userinput>
+Python 2.5.1
     </screen>
 
     <para>
     </para>
 
     <screen>
-       C:\><userinput>python -V</userinput>
-       Python 2.5.1
+C:\><userinput>python -V</userinput>
+Python 2.5.1
     </screen>
 
     <para>
       </para>
 
       <screen>
-        # <userinput>yum install scons</userinput>
+# <userinput>yum install scons</userinput>
       </screen>
 
       <para>
       </para>
 
       <screen>
-        # <userinput>rpm -Uvh scons-&buildversion;-1.noarch.rpm</userinput>
+# <userinput>rpm -Uvh scons-&buildversion;-1.noarch.rpm</userinput>
       </screen>
 
       <para>
       </para>
 
       <screen>
-        # <userinput>apt-get install scons</userinput>
+# <userinput>apt-get install scons</userinput>
       </screen>
 
       <!--
       </para>
 
       <screen>
-        # <userinput>db-XXX scons-*.deb</userinput>
+# <userinput>db-XXX scons-*.deb</userinput>
       </screen>
 
       -->
     </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>
       </para>
 
       <screen>
-        # <userinput>python setup.py install --version-lib</userinput>
+# <userinput>python setup.py install --version-lib</userinput>
       </screen>
 
       <para>
       </para>
 
       <screen>
-        # <userinput>python setup.py install --prefix=/opt/scons</userinput>
+# <userinput>python setup.py install --prefix=/opt/scons</userinput>
       </screen>
 
       <para>
       </para>
 
       <screen>
-        $ <userinput>python setup.py install --prefix=$HOME</userinput>
+$ <userinput>python setup.py install --prefix=$HOME</userinput>
       </screen>
 
       <para>

doc/user/builders-built-in.xml

     </para>
 
     <programlisting>
-      Program('prog', 'file1.o')
+Program('prog', 'file1.o')
     </programlisting>
 
     <para>
     </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>
     </para>
 
     <programlisting>
-      Program(['hello.c', 'goodbye.c'])
+Program(['hello.c', 'goodbye.c'])
     </programlisting>
 
     <para>
 
     <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>
 
       </para>
 
       <programlisting>
-        StaticObject('file', 'file.c')
+StaticObject('file', 'file.c')
       </programlisting>
 
       <para>
       </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>
       </para>
 
       <programlisting>
-        StaticObject('file.c')
+StaticObject('file.c')
       </programlisting>
 
       <para>
       </para>
 
       <programlisting>
-        SharedObject('file', 'file.c')
+SharedObject('file', 'file.c')
       </programlisting>
 
       <para>
       </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>
       </para>
 
       <programlisting>
-        SharedObject('file.c')
+SharedObject('file.c')
       </programlisting>
 
       <para>
       </para>
 
       <programlisting>
-        StaticLibrary('foo', ['file1.c', 'file2.c'])
+StaticLibrary('foo', ['file1.c', 'file2.c'])
       </programlisting>
 
       <para>
       </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>
       </para>
 
       <programlisting>
-        StaticLibrary('foo', ['file1.c', 'file2.c'])
+StaticLibrary('foo', ['file1.c', 'file2.c'])
       </programlisting>
 
       <para>
       </para>
 
       <programlisting>
-        StaticLibrary(['file.c', 'another.c'])
+StaticLibrary(['file.c', 'another.c'])
       </programlisting>
 
       <para>
       </para>
 
       <programlisting>
-        SharedLibrary('foo', ['file1.c', 'file2.c'])
+SharedLibrary('foo', ['file1.c', 'file2.c'])
       </programlisting>
 
       <para>
       </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>
       </para>
 
       <programlisting>
-        SharedLibrary('foo', ['file1.c', 'file2.c'])
+SharedLibrary('foo', ['file1.c', 'file2.c'])
       </programlisting>
 
       <para>
       </para>
 
       <programlisting>
-        SharedLibrary(['file.c', 'another.c'])
+SharedLibrary(['file.c', 'another.c'])
       </programlisting>
 
       <para>
       </para>
 
       <programlisting>
-        XXX CFile() programlisting
+XXX CFile() programlisting
       </programlisting>
 
       <screen>
-        XXX CFile() screen
+XXX CFile() screen
       </screen>
 
     </section>
       </para>
 
       <programlisting>
-        XXX CXXFILE() programlisting
+XXX CXXFILE() programlisting
       </programlisting>
 
       <screen>
-        XXX CXXFILE() screen
+XXX CXXFILE() screen
       </screen>
 
     </section>
       </para>
 
       <programlisting>
-        XXX DVI() programlisting
+XXX DVI() programlisting
       </programlisting>
 
       <screen>
-        XXX DVI() screen
+XXX DVI() screen
       </screen>
 
     </section>
       </para>
 
       <programlisting>
-        XXX PostScript() programlisting
+XXX PostScript() programlisting
       </programlisting>
 
       <screen>
-        XXX PostScript() screen
+XXX PostScript() screen
       </screen>
 
     </section>
 
       <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>
 
 
       <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>
 
 
       <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>
 
 
       <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>
 
       </para>
 
       <programlisting>
-        env = Environment()
-        env.Java(target = 'classes', source = 'src')
+env = Environment()
+env.Java(target = 'classes', source = 'src')
       </programlisting>
 
       <para>
       </para>
 
       <screen>
-        XXX Java() screen
+XXX Java() screen
       </screen>
 
     </section>
       </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>
       </para>
 
       <programlisting>
-        XXX JavaH() programlisting
+XXX JavaH() programlisting
       </programlisting>
 
       <screen>
-        XXX JavaH() screen
+XXX JavaH() screen
       </screen>
 
     </section>
       </para>
 
       <programlisting>
-        XXX RMIC() programlisting
+XXX RMIC() programlisting
       </programlisting>
 
       <screen>
-        XXX RMIC() screen
+XXX RMIC() screen
       </screen>
 
     </section>

doc/user/builders-commands.xml

 
   <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>
 
 
   <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>
 
 
   <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>
 

doc/user/builders-writing.xml

     </para>
 
     <programlisting>
-       bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
+bld = Builder(action = 'foobuild &lt; $SOURCE &gt; $TARGET')
     </programlisting>
 
     <para>
 
     <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>
     </para>
 
     <programlisting>
-       env.Foo('file.foo', 'file.input')
+env.Foo('file.foo', 'file.input')
     </programlisting>
 
     <para>
    -->
     <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>
 
 
     <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>
     </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>
 
     <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">
     </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>
 
     <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>
 
     </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>
 
     <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">
 
     <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>
     <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>
 
     <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>
 
     </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>
       
     <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>
 
     </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>
       than a &SConstruct; or &SConscript; you always need to do
     </para>
     <sconstruct>
-        from SCons.Script import *
+from SCons.Script import *
     </sconstruct>
 
     <para>
 
     <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>
 

doc/user/caching.xml

 
     <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>
 
 
     <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>
     -->
 
     <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>
 
     <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>
       <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>
 
     <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>

doc/user/command-line.xml

 
       <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>
 
       </para>
 
       <screen>
-        $ <userinput>setenv SCONSFLAGS "-Q"</userinput>
+$ <userinput>setenv SCONSFLAGS "-Q"</userinput>
       </screen>
 
       <para>
       </para>
 
       <sconstruct>
-        if not GetOption('help'):
-            SConscript('src/SConscript', export='env')
+if not GetOption('help'):
+    SConscript('src/SConscript', export='env')
       </sconstruct>
 
       <para>
 
       <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>
 
 
       <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>
 
     </para>
 
     <screen>
-      % <userinput>scons -Q debug=1</userinput>
+% <userinput>scons -Q debug=1</userinput>
     </screen>
 
     <para>
 
     <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>
 
 
     <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>
 
 
       <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>
 
 
       <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>
 
 
       <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>
 
 
       <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