http://scons.tigris.org/issues/show_bug.cgi?id=2345
[scons.git] / doc / man / scons.1
index 593d416f42205bdd5d63bce1f696d5e0b0d2f834..3a47547e873942c1ef34ccc13a43fca80760af6f 100644 (file)
@@ -73,7 +73,7 @@ The
 .I SConstruct
 file can specify subsidiary
 configuration files using the
-.B SConscript()
+.BR SConscript ()
 function.
 By convention,
 these subsidiary files are named
@@ -1356,7 +1356,7 @@ Enables or disables all warnings about use of
 currently deprecated features.
 These warnings are enabled by default.
 Note that the
-.b --warn=no-deprecated
+.B --warn=no-deprecated
 option does not disable warnings about absolutely all deprecated features.
 Warnings for some deprecated features that have already been through
 several releases with deprecation warnings
@@ -1801,6 +1801,7 @@ sunlink
 swig
 tar
 tex
+textfile
 tlib
 yacc
 zip
@@ -1840,9 +1841,7 @@ and a same-named environment method
 that split a single string
 into a list, separated on
 strings of white-space characters.
-(These are similar to the
-string.split() method
-from the standard Python library,
+(These are similar to the split() member function of Python strings
 but work even if the input isn't a string.)
 
 Like all Python arguments,
@@ -1861,7 +1860,7 @@ env.Program('bar', env.Split('bar.c foo.c'))
 env.Program(source =  ['bar.c', 'foo.c'], target = 'bar')
 env.Program(target = 'bar', Split('bar.c foo.c'))
 env.Program(target = 'bar', env.Split('bar.c foo.c'))
-env.Program('bar', source = string.split('bar.c foo.c'))
+env.Program('bar', source = 'bar.c foo.c'.split())
 .EE
 
 Target and source file names
@@ -3669,9 +3668,10 @@ so subsequent calls to
 will over-write previous exports that have the same name.
 Multiple variable names can be passed to
 .BR Export ()
-as separate arguments or as a list. A dictionary can be used to map
-variables to a different name when exported. Both local variables and
-global variables can be exported.
+as separate arguments or as a list.
+Keyword arguments can be used to provide names and their values.
+A dictionary can be used to map variables to a different name when exported.
+Both local variables and global variables can be exported.
 
 Examples:
 
@@ -3687,7 +3687,10 @@ Export("env", "package")
 # Make env and package available for all SConscript files:
 Export(["env", "package"])
 
-# Make env available using the name debug:.
+# Make env available using the name debug:
+Export(debug = env)
+
+# Make env available using the name debug:
 Export({"debug":env})
 .EE
 
@@ -5316,17 +5319,24 @@ The
 '\" .I src_dir
 '\" arguments are interpreted relative to the directory of the calling
 argument is interpreted relative to the directory of the calling
-.BR SConscript file.
+.B SConscript
+file.
 See the description of the
 .BR VariantDir ()
 function below for additional details and restrictions.
 
 If
-'\" .IR variant_dir " is present, but"
+.I variant_dir
+is present,
+'\" but
 '\" .IR src_dir " is not,"
-.IR variant_dir " is present,"
-the source directory is relative to the called
-.BR SConscript " file."
+the source directory is the directory in which the
+.B SConscript
+file resides and the
+.B SConscript
+file is evaluated as if it were in the
+.I variant_dir
+directory:
 .ES
 SConscript('src/SConscript', variant_dir = 'build')
 .EE
@@ -5337,7 +5347,7 @@ SConscript('build/SConscript')
 .EE
 This later paradigm is often used when the sources are
 in the same directory as the
-.BR SConstruct file:
+.BR SConstruct:
 .ES
 SConscript('SConscript', variant_dir = 'build')
 .EE
@@ -5522,7 +5532,7 @@ The following statements are equivalent:
 .ES
 env.SetDefault(FOO = 'foo')
 
-if not env.has_key('FOO'): env['FOO'] = 'foo'
+if 'FOO' not in env: env['FOO'] = 'foo'
 .EE
 
 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -7383,7 +7393,7 @@ vars.Add('CC', 'The C compiler')
 
 def validate_color(key, val, env):
     if not val in ['red', 'blue', 'yellow']:
-        raise "Invalid color value '%s'" % val
+        raise Exception("Invalid color value '%s'" % val)
 vars.Add('COLOR', validator=valid_color)
 .EE
 
@@ -7994,7 +8004,7 @@ may be indicated by a dictionary entry with a key value of None.
 .P
 
 .ES
-b = Builder("build_it < $SOURCE > $TARGET"
+b = Builder("build_it < $SOURCE > $TARGET",
             prefix = "file-")
 
 def gen_prefix(env, sources):
@@ -8280,7 +8290,7 @@ multi-stage builder.
 
 .IP single_source
 Specifies that this builder expects exactly one source file per call. Giving
-more than one source files without target files results in implicitely calling
+more than one source file without target files results in implicitely calling
 the builder multiple times (once for each source given). Giving multiple
 source files together with target files results in a UserError exception.
 
@@ -9889,7 +9899,7 @@ as follows:
 def pf(env, dir, target, source, arg):
     top_dir = Dir('#').abspath
     results = []
-    if env.has_key('MYPATH'):
+    if 'MYPATH' in env:
         for p in env['MYPATH']:
             results.append(top_dir + os.sep + p)
     return results