summaryrefslogtreecommitdiffstats
path: root/doc/design/overview.xml
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2007-08-17 03:17:04 (GMT)
committerSteven Knight <knight@baldmt.com>2007-08-17 03:17:04 (GMT)
commit8cb34cccc26935bce5d07ed3f51cc29fbbd1ab03 (patch)
tree7bc281e44fe45cae35656e0e457fef8f308fbb7b /doc/design/overview.xml
parent5b4b4c6e5384712ab1835bdcf8beea09611b6e62 (diff)
downloadSCons-8cb34cccc26935bce5d07ed3f51cc29fbbd1ab03.zip
SCons-8cb34cccc26935bce5d07ed3f51cc29fbbd1ab03.tar.gz
SCons-8cb34cccc26935bce5d07ed3f51cc29fbbd1ab03.tar.bz2
Merged revisions 2136-2200,2202-2290,2292-2301 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core ........ r2145 | stevenknight | 2007-07-17 09:15:12 -0500 (Tue, 17 Jul 2007) | 3 lines Don't put null strings (from variable expansion) in a path list. (They get turned into the current directory on later expansion.) ........ r2146 | stevenknight | 2007-07-17 10:47:39 -0500 (Tue, 17 Jul 2007) | 3 lines Add support for optional arguments on command-line long options by specifying nargs='?'. ........ r2149 | stevenknight | 2007-07-17 15:22:24 -0500 (Tue, 17 Jul 2007) | 2 lines Remove left-over Optik mentions. ........ r2150 | stevenknight | 2007-07-17 15:39:34 -0500 (Tue, 17 Jul 2007) | 4 lines Add a $SWIGPATH variable for finding SWIG dependencies, with $SWIGINC{PREFIX,SUFFIX} for adding them to the command line. ........ r2154 | stevenknight | 2007-07-18 20:05:31 -0500 (Wed, 18 Jul 2007) | 2 lines Fix variable misspellings in the doc added for $SWIGOUTPUT. ........ r2155 | stevenknight | 2007-07-18 20:07:28 -0500 (Wed, 18 Jul 2007) | 2 lines Add the Python eggs info file to the RPM packaging build. ........ r2156 | stevenknight | 2007-07-18 20:15:08 -0500 (Wed, 18 Jul 2007) | 2 lines Convert documentation from DocBook SGML to XML. ........ r2158 | stevenknight | 2007-07-19 17:16:19 -0500 (Thu, 19 Jul 2007) | 3 lines Conditionally add the .egg-info the RPM file list only if the distutils in the version of Python that rpmbuild will execute knows about them. ........ r2161 | stevenknight | 2007-07-19 19:12:29 -0500 (Thu, 19 Jul 2007) | 5 lines Capture a test case (contributed by Tilo Prutz) where instantiation of a private class causes javac to generate an additional anonymous inner class file. (No solution yet, but there's no sense throwing away the preparatory work.) ........ r2162 | stevenknight | 2007-07-20 11:29:56 -0500 (Fri, 20 Jul 2007) | 3 lines Support passing a list of .java files as source to the Java() builder. (Leanid Nazdrynau) ........ r2163 | garyo | 2007-07-20 12:00:35 -0500 (Fri, 20 Jul 2007) | 1 line Fixed cut-n-paste error in Touch factory method doc in users guide. ........ r2167 | stevenknight | 2007-07-21 22:59:40 -0500 (Sat, 21 Jul 2007) | 2 lines Don't execute the SWIGOUTDIR test if swig isn't installed. ........ r2168 | stevenknight | 2007-07-21 23:14:17 -0500 (Sat, 21 Jul 2007) | 2 lines Fix the test's ability to run under a path name containing spaces. ........ r2171 | stevenknight | 2007-07-24 15:54:41 -0500 (Tue, 24 Jul 2007) | 2 lines Handle white space in key file names in the packaging build. ........ r2172 | stevenknight | 2007-07-24 21:41:15 -0500 (Tue, 24 Jul 2007) | 2 lines More efficient copying of construction environments. ........ r2173 | stevenknight | 2007-07-25 10:56:02 -0500 (Wed, 25 Jul 2007) | 2 lines Update the SCons build for Subversion and general clean-up. ........ r2174 | stevenknight | 2007-07-25 11:35:16 -0500 (Wed, 25 Jul 2007) | 3 lines Suppress the [brackets] around a node in the --tree=prune output if the node is a source. ........ r2175 | stevenknight | 2007-07-25 12:52:18 -0500 (Wed, 25 Jul 2007) | 3 lines Commonize the skip_test() method and make its behavior configurable via a TESTCOMMON_PASS_SKIPS environment variable. ........ r2178 | stevenknight | 2007-07-25 21:43:47 -0500 (Wed, 25 Jul 2007) | 3 lines Add $JAVACLASSPATH and $JAVASOURCEPATH construction variables. (Leanid Nazdrynau) ........ r2182 | stevenknight | 2007-07-30 12:10:20 -0500 (Mon, 30 Jul 2007) | 3 lines Refactor Builder suffix-adjusting into its own method, so we can (potentially) re-use it for Builders with attached source Builders. ........ r2183 | stevenknight | 2007-07-30 14:51:53 -0500 (Mon, 30 Jul 2007) | 2 lines More efficient source-builder suffix matching. ........ r2184 | stevenknight | 2007-07-30 16:01:42 -0500 (Mon, 30 Jul 2007) | 4 lines Encapsulate initialization of the default FS object by an accessor function in SCons.Node.FS. (This also gets rid of an unnecessary reference to SCons.Node.FS.default_fs in the LaTeX scanner.) ........ r2193 | stevenknight | 2007-07-30 18:24:07 -0500 (Mon, 30 Jul 2007) | 3 lines Fix interpretation of source arguments that have no suffix when the called Builder has both a src_suffix and a src_builder. ........ r2194 | stevenknight | 2007-07-31 10:25:31 -0500 (Tue, 31 Jul 2007) | 2 lines Increase the number of tries for random output from three to ten. ........ r2195 | stevenknight | 2007-07-31 10:52:28 -0500 (Tue, 31 Jul 2007) | 3 lines Skip the test gracefully if the zipfile module can't read the file it just wrote (which is the case for Python 2.1 on 64-bit systems). ........ r2196 | stevenknight | 2007-07-31 13:06:21 -0500 (Tue, 31 Jul 2007) | 2 lines Move the "import zipfile" so it doesn't fail on Python <= 2.0. ........ r2197 | stevenknight | 2007-07-31 14:51:50 -0500 (Tue, 31 Jul 2007) | 3 lines Commonize initialization of the various Java builders so they can be hooked up into a multi-stage Builder chain. (Leanid Nazdrynau) ........ r2198 | stevenknight | 2007-07-31 16:15:18 -0500 (Tue, 31 Jul 2007) | 3 lines Fix use of ${TARGET.dir} and ${SOURCE.dir} expansions in $FORTRANMODDIR $JARCHDIR, $JARFLAGS, $LEXFLAGS, $SWIGFLAGS, $SWIGOUTDIR and $YACCFLAGS. ........ r2199 | stevenknight | 2007-07-31 16:25:48 -0500 (Tue, 31 Jul 2007) | 2 lines Remove left-over Trace() call. ........ r2202 | stevenknight | 2007-08-01 12:31:48 -0500 (Wed, 01 Aug 2007) | 3 lines Bail out via test.skip_test() if wix ("candle") isn't found. Put the main body of code flush left instead of under an if: block. ........ r2203 | stevenknight | 2007-08-01 15:35:55 -0500 (Wed, 01 Aug 2007) | 5 lines Fix Tool.packaging.rpm.package() so it doesn't always overwrite $RPMFLAGS with -ta. Set --buildroot in RPM packaging tests so they don't overwrite each other when run simultaneously. ........ r2204 | stevenknight | 2007-08-01 15:37:36 -0500 (Wed, 01 Aug 2007) | 2 lines Fix a nested scope issue with the internal build_sources() function. ........ r2205 | stevenknight | 2007-08-01 15:46:08 -0500 (Wed, 01 Aug 2007) | 5 lines Normalize (X out) the CreationDate field inside embedded, compressed PostScript streams within the generated PDF files. Also normalize preceding Length field, since compression length is affected by different patterns of input, including the variable CreationDate value. ........ r2211 | stevenknight | 2007-08-02 08:52:06 -0500 (Thu, 02 Aug 2007) | 2 lines Add the new modules from branches/packaging to the SCons packaging build. ........ r2212 | stevenknight | 2007-08-02 19:59:01 -0500 (Thu, 02 Aug 2007) | 2 lines Fix the JAVACLASSPATH test when javah isn't on the default $PATH. ........ r2214 | stevenknight | 2007-08-03 15:05:21 -0500 (Fri, 03 Aug 2007) | 4 lines Hook up the Java builders into a multi-step chain underneath a Java() pseudo-builder (wrapper) that examines its arguments and calls the appropriate underlying file-or-dir builder. ........ r2215 | stevenknight | 2007-08-03 15:49:58 -0500 (Fri, 03 Aug 2007) | 2 lines Fix for old Python versions: use apply() instead of *args, **kw. ........ r2216 | stevenknight | 2007-08-03 16:49:31 -0500 (Fri, 03 Aug 2007) | 2 lines Hook up the SWIG builder as a source builder for .java files. ........ r2217 | stevenknight | 2007-08-03 17:28:19 -0500 (Fri, 03 Aug 2007) | 2 lines Don't use .endswith(), which didn't appear until later Python versions. ........ r2218 | stevenknight | 2007-08-03 17:29:38 -0500 (Fri, 03 Aug 2007) | 2 lines Replace tabs with spaces. ........ r2219 | stevenknight | 2007-08-04 08:06:23 -0500 (Sat, 04 Aug 2007) | 3 lines Initialize a loop-invariant lambda for matching .java suffixes outside the loop. ........ r2220 | stevenknight | 2007-08-07 15:06:13 -0500 (Tue, 07 Aug 2007) | 2 lines Refactor parallel class-generation loops into one. ........ r2221 | stevenknight | 2007-08-07 16:04:06 -0500 (Tue, 07 Aug 2007) | 5 lines Have the Java multi-step builder test actually check for generated files, and fix the generation of .java and .class file names, and interaction with the SWIG builder, so that the files are generated in the correct place. ........ r2222 | stevenknight | 2007-08-07 16:45:05 -0500 (Tue, 07 Aug 2007) | 3 lines Fix dependencies on SWIG-generated .java files so they don't have to be built in multiple passes. ........ r2226 | stevenknight | 2007-08-07 18:00:22 -0500 (Tue, 07 Aug 2007) | 2 lines Fix SWIG when used with BuildDir(). ........ r2227 | stevenknight | 2007-08-07 22:15:55 -0500 (Tue, 07 Aug 2007) | 5 lines User's guide updates: - Make the multiple files example match its text. - Expand a truncated sentence about being able to use Python function actions in the Command() Builder. ........ r2228 | stevenknight | 2007-08-07 23:25:18 -0500 (Tue, 07 Aug 2007) | 3 lines Don't generate an error if a #include file matches a same-named directory in $CPPPATH (or $FORTRANPATH, etc.). ........ r2229 | stevenknight | 2007-08-07 23:40:00 -0500 (Tue, 07 Aug 2007) | 2 lines Fix a code example. (Gary Oberbrunner) ........ r2230 | stevenknight | 2007-08-08 00:05:43 -0500 (Wed, 08 Aug 2007) | 3 lines Capture a test case to make sure AddPostAction() doesn't interfere with normal linking. (Matt Doar, Gary Oberbrunner) ........ r2233 | stevenknight | 2007-08-08 14:15:44 -0500 (Wed, 08 Aug 2007) | 2 lines Fix documentation typo in a construction variable cross-reference. ........ r2234 | stevenknight | 2007-08-08 17:03:25 -0500 (Wed, 08 Aug 2007) | 2 lines Changes to SCons packaging to support checkpoint releases. ........ r2235 | stevenknight | 2007-08-09 10:10:01 -0500 (Thu, 09 Aug 2007) | 2 lines Sidestep false negatives on heavily loaded systems. ........ r2236 | garyo | 2007-08-09 11:16:26 -0500 (Thu, 09 Aug 2007) | 1 line Allow unpackaged files (e.g. *.pyo) to exist in the build dir without being packaged in the RPM. Without this, on some systems the rpmbuild may error out. ........ r2237 | stevenknight | 2007-08-09 11:27:56 -0500 (Thu, 09 Aug 2007) | 5 lines Fix test/SWIG/build-dir.py so it works on old Python versions without distutils.sysconfig. Instead of just cutting-and-pasting initialization code from other SWIG tests, centralize it in some new TestSCons methods. ........ r2238 | garyo | 2007-08-09 11:30:58 -0500 (Thu, 09 Aug 2007) | 1 line Use docbook 4.3 instead of 4.4 for the XML doctype since some older(?) jade parsers can't handle new 4-byte Unicode chars in the 4.4 version of isogrk4.ent. ........ r2240 | stevenknight | 2007-08-09 16:35:06 -0500 (Thu, 09 Aug 2007) | 2 lines User's Guide updates (post packaging changes). ........ r2243 | stevenknight | 2007-08-10 10:31:51 -0500 (Fri, 10 Aug 2007) | 3 lines Fix the User's Guide build to use openjade, and to accomodate a change in the name of the main generated file (book1.html => index.html). ........ r2245 | stevenknight | 2007-08-10 11:09:16 -0500 (Fri, 10 Aug 2007) | 2 lines Update the {CHANGES,RELEASE}.txt datestamp lines. ........ r2253 | stevenknight | 2007-08-10 16:21:54 -0500 (Fri, 10 Aug 2007) | 2 lines Fix the wix Tool module's ability to handle null entries in $PATH. ........ r2261 | stevenknight | 2007-08-11 23:08:12 -0500 (Sat, 11 Aug 2007) | 3 lines Remove unnecessary files (.svnt/*, .{ae,cvs}ignore, www/*) from the scons-src packages. ........ r2262 | stevenknight | 2007-08-11 23:24:49 -0500 (Sat, 11 Aug 2007) | 2 lines Add missing __revision__ lines. ........ r2263 | stevenknight | 2007-08-11 23:33:42 -0500 (Sat, 11 Aug 2007) | 2 lines Skip the test if the MANIFEST file hasn't been built. ........ r2264 | stevenknight | 2007-08-11 23:36:30 -0500 (Sat, 11 Aug 2007) | 2 lines Add recent compatibility modules to the relevant exceptions lists. ........ r2265 | stevenknight | 2007-08-11 23:39:00 -0500 (Sat, 11 Aug 2007) | 3 lines Update __VERSION__ strings in the QMTest/*.py modules, so that packaging tests (src/test_*.py) will pass after builds of checkpoint releases. ........ r2266 | stevenknight | 2007-08-12 07:36:19 -0500 (Sun, 12 Aug 2007) | 2 lines Add a comment about why we construct the __VERSION__ string at run time. ........ r2267 | stevenknight | 2007-08-12 07:42:30 -0500 (Sun, 12 Aug 2007) | 2 lines Avoid reading the MANIFEST file twice. (Courtesy review by Greg Noel.) ........ r2268 | stevenknight | 2007-08-12 08:14:53 -0500 (Sun, 12 Aug 2007) | 3 lines Shift Install() and InstallAs() from being documented as functions to being documented as Builders. ........ r2269 | garyo | 2007-08-13 08:49:52 -0500 (Mon, 13 Aug 2007) | 1 line Tests: Skip some more Java tests if javac is not installed on the test machine so they don't get marked as failing. ........ r2270 | garyo | 2007-08-13 11:09:39 -0500 (Mon, 13 Aug 2007) | 1 line Fixed typo in test (shows up on non-Linux platforms). ........ r2271 | garyo | 2007-08-13 14:09:05 -0500 (Mon, 13 Aug 2007) | 4 lines Test portability fixes for Darwin/OSX and IRIX. This does not make all the tests pass on those OSes, but it takes care of some of the more obvious errors that I have time for right now. More to come. ........ r2272 | stevenknight | 2007-08-13 15:33:29 -0500 (Mon, 13 Aug 2007) | 2 lines Tab => space fix. ........ r2273 | stevenknight | 2007-08-13 15:33:52 -0500 (Mon, 13 Aug 2007) | 2 lines Test for swig, too, which is used to build from the .i file. ........ r2277 | garyo | 2007-08-14 10:40:00 -0500 (Tue, 14 Aug 2007) | 8 lines Test portability on IRIX: test/Actions/pre-post creates target file before building target, then IRIX CC does not chmod +x afterwards. I think this change is safe on all OSes. test/AS/ml.py: I think this is only supposed to be run on win32 (not skipped only on win32); the sense of the skip test was backwards. ........ r2278 | stevenknight | 2007-08-14 11:04:40 -0500 (Tue, 14 Aug 2007) | 2 lines Add -tt when running tests, to catch inconsistent tab usage. ........ r2279 | stevenknight | 2007-08-14 14:00:43 -0500 (Tue, 14 Aug 2007) | 2 lines Minor refactor of logic in File.retrieve_from_cache(). ........ r2280 | stevenknight | 2007-08-15 01:11:40 -0500 (Wed, 15 Aug 2007) | 2 lines Refactor CacheDir support into its own module. ........ r2281 | stevenknight | 2007-08-15 07:24:51 -0500 (Wed, 15 Aug 2007) | 2 lines Move the cachepath() method from FS.File to the CacheDir class. ........ r2282 | stevenknight | 2007-08-15 08:31:34 -0500 (Wed, 15 Aug 2007) | 2 lines Python 1.5.2 fix in the new Null class. ........ r2283 | stevenknight | 2007-08-15 10:45:53 -0500 (Wed, 15 Aug 2007) | 5 lines Refactor CacheDir unit tests to: - restore functionality that was dropped in the transition; - commonize creation of test Nodes and other (mock) objects - separate CacheDir tests from tests of CacheDir through Node.FS.File. ........ r2284 | stevenknight | 2007-08-15 11:46:38 -0500 (Wed, 15 Aug 2007) | 3 lines Replace the Executor.Null.NullEnvironment object with a real Null object, so it will absorb the CacheDir method calls as well. ........ r2285 | stevenknight | 2007-08-15 11:52:57 -0500 (Wed, 15 Aug 2007) | 5 lines Add a get_CacheDir() method to a construction environment, which will be used to fetch per-environment CacheDir specifications. (Right now all calls to it still just return the one attached to underlying default FS object.) ........ r2286 | stevenknight | 2007-08-15 15:15:46 -0500 (Wed, 15 Aug 2007) | 2 lines Support per-construction-environment configuration of CacheDir(). ........ r2287 | stevenknight | 2007-08-15 15:33:04 -0500 (Wed, 15 Aug 2007) | 2 lines Move the tests of CacheDir()-related command-line options into test/CacheDir. ........ r2293 | stevenknight | 2007-08-16 11:14:49 -0500 (Thu, 16 Aug 2007) | 3 lines Add the Package() builder description to the documentation build, fixing the XML so that it will build. ........ r2294 | stevenknight | 2007-08-16 12:51:19 -0500 (Thu, 16 Aug 2007) | 3 lines Reorganize packaging documentation: alphabetize the variable definitions (and function names), document Tag() as a function, not a builder. ........ r2296 | stevenknight | 2007-08-16 12:55:01 -0500 (Thu, 16 Aug 2007) | 2 lines Add a build command. ........ r2300 | stevenknight | 2007-08-16 16:49:13 -0500 (Thu, 16 Aug 2007) | 2 lines First cut at documenting packaging variables. ........ r2301 | stevenknight | 2007-08-16 16:51:21 -0500 (Thu, 16 Aug 2007) | 3 lines Construct the .src.rpm and .arch.rpm file names independnetly, not by trying to massage one into the other. ........
Diffstat (limited to 'doc/design/overview.xml')
-rw-r--r--doc/design/overview.xml498
1 files changed, 498 insertions, 0 deletions
diff --git a/doc/design/overview.xml b/doc/design/overview.xml
new file mode 100644
index 0000000..38e4258
--- /dev/null
+++ b/doc/design/overview.xml
@@ -0,0 +1,498 @@
+<!--
+
+ Copyright (c) 2001, 2002, 2003 Steven Knight
+
+ 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.
+
+-->
+
+<section id="sect-architecture">
+ <title>Architecture</title>
+
+ <para>
+
+ The heart of &SCons; is its <emphasis>Build Engine</emphasis>.
+ The &SCons; Build Engine is a Python module
+ that manages dependencies between
+ external objects
+ such as files or database records.
+ The Build Engine is designed to
+ be interface-neutral
+ and easily embeddable in any
+ software system that needs dependency
+ analysis between updatable objects.
+
+ </para>
+
+ <para>
+
+ The key parts of the Build Engine architecture
+ are captured in the following quasi-UML diagram:
+
+ </para>
+
+<!--
+Including this figure makes our PDF build blow up.
+The figure, however,
+is left over from the Software Carpentry contest
+and is therefore old, out-of-date, and needs to be redone anyway.
+This is where it will go, anyway...
+-->
+
+ <!--
+ YARG! THIS MAKES THE PDF BUILD BLOW UP. HELP!
+ <figure>
+ <title>&SCons; Architecture</title>
+ <graphic fileref="engine.jpg">
+ </figure>
+ -->
+
+ <para>
+
+ The point of &SCons; is to manage
+ dependencies between arbitrary external objects.
+ Consequently, the Build Engine does not restrict or specify
+ the nature of the external objects it manages,
+ but instead relies on subclass of the &Node;
+ class to interact with the external system or systems
+ (file systems, database management systems)
+ that maintain the objects being examined or updated.
+
+ </para>
+
+ <para>
+
+ The Build Engine presents to the software system in
+ which it is embedded
+ a Python API for specifying source (input) and target (output) objects,
+ rules for building/updating objects,
+ rules for scanning objects for dependencies, etc.
+ Above its Python API,
+ the Build Engine is completely
+ interface-independent,
+ and can be encapsulated by any other software
+ that supports embedded Python.
+
+ </para>
+
+ <para>
+
+ Software that chooses to use the Build Engine
+ for dependency management
+ interacts with it
+ through <emphasis>Construction Environments</emphasis>.
+ A Construction Environment consists
+ of a dictionary of environment variables,
+ and one or more associated
+ &Scanner; objects
+ and &Builder; objects.
+ The Python API is used to
+ form these associations.
+
+ </para>
+
+ <para>
+
+ A &Scanner; object specifies
+ how to examine a type of source object
+ (C source file, database record)
+ for dependency information.
+ A &Scanner; object may use
+ variables from the associated
+ Construction Environment
+ to modify how it scans an object:
+ specifying a search path for included files,
+ which field in a database record to consult,
+ etc.
+
+ </para>
+
+ <para>
+
+ A &Builder; object specifies
+ how to update a type of target object:
+ executable program, object file, database field, etc.
+ Like a &Scanner; object,
+ a &Builder; object may use
+ variables from the associated
+ Construction Environment
+ to modify how it builds an object:
+ specifying flags to a compiler,
+ using a different update function,
+ etc.
+
+ </para>
+
+ <para>
+
+ &Scanner; and &Builder; objects will return one or more
+ &Node; objects that represent external objects.
+ &Node; objects are the means by which the
+ Build Engine tracks dependencies:
+ A &Node; may represent a source (input) object that
+ should already exist,
+ or a target (output) object which may be built,
+ or both.
+ The &Node; class is sub-classed to
+ represent external objects of specific type:
+ files, directories, database fields or records, etc.
+ Because dependency information, however,
+ is tracked by the top-level &Node; methods and attributes,
+ dependencies can exist
+ between nodes representing different external object types.
+ For example,
+ building a file could be made
+ dependent on the value of a given
+ field in a database record,
+ or a database table could depend
+ on the contents of an external file.
+
+ </para>
+
+ <para>
+
+ The Build Engine uses a &Job; class (not displayed)
+ to manage the actual work of updating external target objects:
+ spawning commands to build files,
+ submitting the necessary commands to update a database record,
+ etc.
+ The &Job; class has sub-classes
+ to handle differences between spawning
+ jobs in parallel and serially.
+
+ </para>
+
+ <para>
+
+ The Build Engine also uses a
+ &Signature; class (not displayed)
+ to maintain information about whether
+ an external object is up-to-date.
+ Target objects with out-of-date signatures
+ are updated using the appropriate
+ &Builder; object.
+
+ </para>
+
+ <!-- BEGIN HTML -->
+
+ <!--
+ Details on the composition, methods,
+ and attributes of these classes
+ are available in the A HREF="internals.html" Internals /A page.
+ -->
+
+ <!-- END HTML -->
+
+</section>
+
+
+
+<section id="sect-engine">
+ <title>Build Engine</title>
+
+ <para>
+
+ More detailed discussion of some of the
+ Build Engine's characteristics:
+
+ </para>
+
+ <section>
+ <title>Python API</title>
+
+ <para>
+
+ The Build Engine can be embedded in any other software
+ that supports embedding Python:
+ in a GUI,
+ in a wrapper script that
+ interprets classic <filename>Makefile</filename> syntax,
+ or in any other software that
+ can translate its dependency representation
+ into the appropriate calls to the Build Engine API.
+ <!--<xref linkend="chap-native">--> describes in detail
+ the specification for a "Native Python" interface
+ that will drive the &SCons; implementation effort.
+
+ </para>
+
+ </section>
+
+ <section>
+ <title>Single-image execution</title>
+
+ <para>
+
+ When building/updating the objects,
+ the Build Engine operates as a single executable
+ with a complete Directed Acyclic Graph (DAG)
+ of the dependencies in the entire build tree.
+ This is in stark contrast to the
+ commonplace recursive use of Make
+ to handle hierarchical directory-tree builds.
+
+ </para>
+
+ </section>
+
+ <section>
+ <title>Dependency analysis</title>
+
+ <para>
+
+ Dependency analysis is carried out via digital signatures
+ (a.k.a. "fingerprints").
+ Contents of object are examined and reduced
+ to a number that can be stored and compared to
+ see if the object has changed.
+ Additionally, &SCons; uses the same
+ signature technique on the command-lines that
+ are executed to update an object.
+ If the command-line has changed since the last time,
+ then the object must be rebuilt.
+
+ </para>
+
+ </section>
+
+ <section>
+ <title>Customized output</title>
+
+ <para>
+
+ The output of Build Engine is customizable
+ through user-defined functions.
+ This could be used to print additional desired
+ information about what &SCons; is doing,
+ or tailor output to a specific build analyzer,
+ GUI, or IDE.
+
+ </para>
+
+ </section>
+
+ <section>
+ <title>Build failures</title>
+
+ <para>
+
+ &SCons; detects build failures via the exit status from the tools
+ used to build the target files. By default, a failed exit status
+ (non-zero on UNIX systems) terminates the build with an appropriate
+ error message. An appropriate class from the Python library will
+ interpret build-tool failures via an OS-independent API.
+
+ </para>
+
+ <para>
+
+ If multiple tasks are executing in a parallel build, and one tool
+ returns failure, &SCons; will not initiate any further build tasks,
+ but allow the other build tasks to complete before terminating.
+
+ </para>
+
+ <para>
+
+ A <option>-k</option> command-line option may be used to ignore
+ errors and continue building other targets. In no case will a target
+ that depends on a failed build be rebuilt.
+
+ </para>
+
+ </section>
+
+</section>
+
+
+
+<section id="sect-interfaces">
+ <title>Interfaces</title>
+
+ <para>
+
+ As previously described,
+ the &SCons; Build Engine
+ is interface-independent above its Python API,
+ and can be embedded in any software system
+ that can translate its dependency requirements
+ into the necessary Python calls.
+
+ </para>
+
+ <para>
+
+ The "main" &SCons; interface
+ for implementation purposes,
+ uses Python scripts as configuration files.
+ Because this exposes the Build Engine's Python API to the user,
+ it is current called the "Native Python" interface.
+
+ </para>
+
+ <para>
+
+ This section will also discuss
+ how &SCons; will function in the context
+ of two other interfaces:
+ the &Makefile; interface of the classic &Make; utility,
+ and a hypothetical graphical user interface (GUI).
+
+ </para>
+
+ <section>
+ <title>Native Python interface</title>
+
+ <para>
+
+ The Native Python interface is intended to be the primary interface
+ by which users will know &SCons;--that is,
+ it is the interface they will use
+ if they actually type &SCons; at a command-line prompt.
+
+ </para>
+
+ <para>
+
+ In the Native Python interface, &SCons; configuration files are simply
+ Python scripts that directly invoke methods from the Build Engine's
+ Python API to specify target files to be built, rules for building
+ the target files, and dependencies. Additional methods, specific to
+ this interface, are added to handle functionality that is specific to
+ the Native Python interface: reading a subsidiary configuration file;
+ copying target files to an installation directory; etc.
+
+ </para>
+
+ <para>
+
+ Because configuration files are Python scripts, Python flow control
+ can be used to provide very flexible manipulation of objects and
+ dependencies. For example, a function could be used to invoke a common
+ set of methods on a file, and called iteratively over an array of
+ files.
+
+ </para>
+
+ <para>
+
+ As an additional advantage, syntax errors in &SCons; Native Python
+ configuration files will be caught by the Python parser. Target-building
+ does not begin until after all configuration files are read, so a syntax
+ error will not cause a build to fail half-way.
+
+ </para>
+
+ </section>
+
+ <section>
+ <title>Makefile interface</title>
+
+ <para>
+
+ An alternate &SCons; interface would provide backwards
+ compatibility with the classic &Make utility.
+ This would be done by embedding the &SCons; Build Engine
+ in a Python script that can translate existing
+ &Makefile;s into the underlying calls to the
+ Build Engine's Python API
+ for building and tracking dependencies.
+ Here are approaches to solving some of the issues
+ that arise from marrying these two pieces:
+
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ &Makefile; suffix rules can be translated
+ into an appropriate &Builder; object
+ with suffix maps from the Construction Environment.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Long lists of static dependences
+ appended to a &Makefile; by
+ various <command>"make depend"</command> schemes
+ can be preserved
+ but supplemented by
+ the more accurate dependency information
+ provided by &Scanner; objects.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Recursive invocations of &Make;
+ can be avoided by reading up
+ the subsidiary &Makefile; instead.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+
+ Lest this seem like too outlandish an undertaking,
+ there is a working example of this approach:
+ Gary Holt's &Makepp; utility
+ is a Perl script that provides
+ admirably complete parsing of complicated &Makefile;s
+ around an internal build engine inspired,
+ in part, by the classic <application>Cons</application> utility.
+
+ </para>
+
+ </section>
+
+ <section>
+ <title>Graphical interfaces</title>
+
+ <para>
+
+ The &SCons; Build Engine
+ is designed from the ground up to be embedded
+ into multiple interfaces.
+ Consequently, embedding the dependency capabilities
+ of &SCons; into graphical interface
+ would be a matter of mapping the
+ GUI's dependency representation
+ (either implicit or explicit)
+ into corresponding calls to the Python API
+ of the &SCons; Build Engine.
+
+ </para>
+
+ <para>
+
+ Note, however, that this proposal leaves the problem of
+ designed a good graphical interface
+ for representing software build dependencies
+ to people with actual GUI design experience...
+
+ </para>
+
+ </section>
+
+</section>