From 140d836e9cd54fb67b969fd82ef7ed19ba574d40 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Sat, 26 Apr 2014 15:11:58 +0200 Subject: Imported Upstream version 2.3.1 --- doc/user/misc.xml | 408 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 236 insertions(+), 172 deletions(-) (limited to 'doc/user/misc.xml') diff --git a/doc/user/misc.xml b/doc/user/misc.xml index 524bca3..1d892a4 100644 --- a/doc/user/misc.xml +++ b/doc/user/misc.xml @@ -1,6 +1,27 @@ + + + %scons; + + + %builders-mod; + + %functions-mod; + + %tools-mod; + + %variables-mod; +]> + + +Miscellaneous Functionality + - - EnsurePythonVersion(2, 5) - + +EnsurePythonVersion(2, 5) + @@ -94,15 +115,15 @@ regardless of executing Python version by faking out the infrastructure in some way. - + scons -Q --> - % scons -Q - Python 2.5 or greater required, but you have Python 2.3.6 +% scons -Q +Python 2.5 or greater required, but you have Python 2.3.6 @@ -137,17 +158,17 @@ regardless of executing SCons version by faking out the infrastructure in some way. - + - EnsureSConsVersion(1, 0) +EnsureSConsVersion(1, 0) --> - - EnsureSConsVersion(1, 0) - + +EnsureSConsVersion(1, 0) + @@ -163,15 +184,15 @@ regardless of executing SCons version by faking out the infrastructure in some way. - + scons -Q --> - % scons -Q - SCons 1.0 or greater required, but you have SCons 0.98.5 +% scons -Q +SCons 1.0 or greater required, but you have SCons 0.98.5 @@ -189,21 +210,23 @@ - - 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') + + +hello.c + + - - % scons -Q FUTURE=1 - The FUTURE option is not supported yet! - % scons -Q - cc -o hello.o -c hello.c - cc -o hello hello.o - + + scons -Q FUTURE=1 + scons -Q + @@ -243,36 +266,47 @@ - - # one directory - print FindFile('missing', '.') - t = FindFile('exists', '.') - print t.__class__, t - + + +# one directory +print FindFile('missing', '.') +t = FindFile('exists', '.') +print t.__class__, t + + + exists + + - - % scons -Q - None - <class 'SCons.Node.FS.File'> exists - scons: `.' is up to date. - + + scons -Q + - - # 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) + + +exists + + + + +exists + + + +exists + + - - % scons -Q - nonesuch.h: None - config.h: config.h - private.h: src/include/private.h - dist.h: include/dist.h - scons: `.' is up to date. - + + scons -Q + @@ -315,19 +349,29 @@ - - 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']) + + + +exists + + + +exists + + + +exists + + - - % scons -Q - sub1/multiple - sub2/multiple - sub3/multiple - scons: `.' is up to date. - + + scons -Q + @@ -339,38 +383,34 @@ - - # Neither file exists, so build will fail - Command('derived', 'leaf', 'cat >$TARGET $SOURCE') - print FindFile('leaf', '.') - print FindFile('derived', '.') - - - - % scons -Q - None - derived - scons: *** [derived] Source `leaf' not found, needed by target `derived'. - + + +# 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', '.') + + scons -Q + - # 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', '.') + + +leaf + + - - % scons -Q - leaf - derived - cat > derived leaf - + + scons -Q + @@ -379,17 +419,21 @@ - - # Only 'src/leaf' exists - VariantDir('build', 'src') - print FindFile('leaf', 'build') - + + +# Only 'src/leaf' exists +VariantDir('build', 'src') +print FindFile('leaf', 'build') + + + +leaf + + - - % scons -Q - build/leaf - scons: `.' is up to date. - + + scons -Q + @@ -414,13 +458,21 @@ - - objects = [ - Object('prog1.c'), - Object('prog2.c', CCFLAGS='-DFOO'), - ] - Program(objects) - + + +objects = [ + Object('prog1.c'), + Object('prog2.c', CCFLAGS='-DFOO'), +] +Program(objects) + + +prog1.c + + +prog2.c + + @@ -430,12 +482,9 @@ - - % scons -Q - cc -o prog1.o -c prog1.c - cc -o prog2.o -c -DFOO prog2.c - cc -o prog1 prog1.o prog2.o - + + scons -Q + @@ -450,16 +499,24 @@ - - objects = [ - Object('prog1.c'), - Object('prog2.c', CCFLAGS='-DFOO'), - ] - Program(objects) - - for object_file in objects: - print object_file.abspath - + + +objects = [ + Object('prog1.c'), + Object('prog2.c', CCFLAGS='-DFOO'), +] +Program(objects) + +for object_file in objects: + print object_file.abspath + + +prog1.c + + +prog2.c + + @@ -471,12 +528,9 @@ - - % scons -Q - AttributeError: 'NodeList' object has no attribute 'abspath': - File "/home/my/project/SConstruct", line 8: - print object_file.abspath - + + scons -Q + @@ -486,34 +540,42 @@ - - objects = [ - Object('prog1.c'), - Object('prog2.c', CCFLAGS='-DFOO'), - ] - Program(objects) - - for object_file in Flatten(objects): - print object_file.abspath - + + +objects = [ + Object('prog1.c'), + Object('prog2.c', CCFLAGS='-DFOO'), +] +Program(objects) + +for object_file in Flatten(objects): + print object_file.abspath + + +prog1.c + + +prog2.c + + - % scons -Q - /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 +% scons -Q +/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 @@ -529,14 +591,14 @@ - - 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')) + @@ -563,3 +625,5 @@ + + -- cgit v1.2.3