3 SCons - a software construction tool
5 Welcome to the SCons development tree. The real purpose of this tree is
6 to package SCons for production distribution in a variety of formats,
7 not just to hack SCons code.
9 To that extent, the normal development cycle (enforced by Aegis) is not
10 to test the code directly, but to package SCons, unpack the package,
11 "install" SCons in a test subdirectory, and then to run the tests
12 against the unpacked and installed software. This helps eliminate
13 problems caused by, for example, failure to update the list of files to
16 Note that if all you want to do is install and run SCons, it
17 will probably be easier for you to download and install the
18 scons-{version}.tar.gz or scons-{version}.zip package rather than to
19 work with the packaging logic in this tree.
25 Before going further, you can check that this package you have is the
26 latest version at the SCons download page:
28 http://www.scons.org/download.html
31 EXECUTION REQUIREMENTS
32 ======================
34 Running SCons requires Python version 1.5.2 or later. There should be
35 no other dependencies or requirements to run SCons.
37 The default SCons configuration assumes use of the Microsoft Visual C++
38 compiler suite on WIN32 systems, and assumes a C compiler named 'cc',
39 a C++ compiler named 'c++', and a Fortran compiler named 'g77' (such
40 as found in the GNU C compiler suite) on any other type of system.
41 You may, of course, override these default values by appropriate
42 configuration of Environment construction variables.
44 By default, SCons knows how to search for available programming tools
45 on various systems--see the SCons man page for details. You may,
46 of course, override the default SCons choices made by appropriate
47 configuration of Environment construction variables.
50 INSTALLATION REQUIREMENTS
51 =========================
53 Building and installing SCons from this package requires the Python
54 distutils package. The distutils package was not shipped as a standard
55 part of Python until Python version 1.6, so if your system is running
56 Python 1.5.2, you may not have distutils installed. If you are running
57 Python version 1.6 or later, you should be fine.
59 NOTE TO RED HAT USERS: Red Hat shipped Python 1.5.2 as the default all
60 the way up to Red Hat Linux 7.3, so you probably do *not* have distutils
61 installed, unless you have already done so manually or are running Red
64 In this case, your options are:
66 -- (Optional.) Install from a pre-packaged SCons package that
67 does not require distutils:
69 Red Hat Linux scons-0.96.noarch.rpm
71 Debian GNU/Linux scons_0.96_all.deb
74 Windows scons-0.96.win32.exe
76 -- (Recommended.) Download the latest distutils package from the
79 http://www.python.org/sigs/distutils-sig/download.html
81 Install the distutils according to the instructions on the page.
82 You can then proceed to the next section to install SCons from
89 Assuming your system satisfies the installation requirements in the
90 previous section, install SCons from this package by first populating
91 the build/scons/ subdirectory. (For an easier way to install SCons,
92 without having to populate this directory, use the scons-{version}.tar.gz
93 or scons-{version}.zip package.)
95 If you already have an appropriate version of SCons installed on your
96 system, populate the build/scons/ directory by running:
100 If you don't have SCons version 0.96 or later already installed on your
101 system, you can use SCons itself to populate the build/scons/ directory
102 with a little more typing. You must first set the SCONS_LIB_DIR
103 environment variable to the local src/engine subdirectory, and then
104 execute the local src/script/scons.py script to populate the build/scons/
105 subdirectory. You would do this as follows on a Linux or UNIX system
106 (using sh or a derivative like bash or ksh):
108 $ export SCONS_LIB_DIR=`pwd`/src/engine
109 $ python src/script/scons.py build/scons
111 Or as follows on Windows:
113 C:\scons\>set SCONS_LIB_DIR=%cd%\src\engine
114 C:\scons\>python src/script/scons.py build/scons
116 Either command will populate the build/scons/ directory with the necessary
117 files and directory structure to use the Python-standard setup script
118 as follows on Linux or UNIX:
121 # python setup.py install
125 C:\scons\>cd build\scons
126 C:\scons\build\scons>python setup.py install
128 By default, the above commands will do the following:
130 -- Install the version-numbered "scons-0.96" and "sconsign-0.96"
131 scripts in the default system script directory (/usr/bin or
132 C:\Python*\Scripts, for example). This can be disabled by
133 specifying the "--no-version-script" option on the command
136 -- Install scripts named "scons" and "sconsign" scripts in the
137 default system script directory (/usr/bin or C:\Python*\Scripts,
138 for example). This can be disabled by specifying the
139 "--no-scons-script" option on the command line, which is useful
140 if you want to install and experiment with a new version before
141 making it the default on your system. On UNIX or Linux systems,
142 you can have the "scons" and "sconsign" scripts be hard links or
143 symbolic links to the "scons-0.96" and "sconsign-0.96" scripts
144 by specifying the "--hardlink-scons" or "--symlink-scons"
145 options on the command line.
147 -- Install "scons-0.96.bat" and "scons.bat" wrapper scripts in the
148 Python prefix directory on Windows (C:\Python*, for example).
149 This can be disabled by specifying the "--no-install-bat" option
150 on the command line. On UNIX or Linux systems, the
151 "--install-bat" option may be specified to have "scons-0.96.bat"
152 and "scons.bat" files installed in the default system script
153 directory, which is useful if you want to install SCons in a
154 shared file system directory that can be used to execute SCons
155 from both UNIX/Linux and Windows systems.
157 -- Install the SCons build engine (a Python module) in an
158 appropriate version-numbered SCons library directory
159 (/usr/lib/scons-0.96 or C:\Python*\scons-0.96, for example).
160 See below for more options related to installing the build
163 -- Install the troff-format man pages in an appropriate directory
164 on UNIX or Linux systems (/usr/share/man/man1 or /usr/man/man1,
165 for example). This can be disabled by specifying the
166 "--no-install-man" option on the command line. The man pages
167 can be installed on Windows systems by specifying the
168 "--install-man" option on the command line.
170 Note that, by default, SCons does not install its build engine library
171 in the standard Python library directories. If you want to be able to
172 use the SCons library modules (the build engine) in other Python
173 scripts, specify the "--standard-lib" option on the command line, as
176 # python setup.py install --standard-lib
178 This will install the build engine in the standard Python library
179 directory (/usr/lib/python*/site-packages or
180 C:\Python*\Lib\site-packages).
182 Alternatively, you can have SCons install its build engine library in a
183 hard-coded standalone library directory, instead of the default
184 version-numbered directory, by specifying the "--standalone-lib" option
185 on the command line, as follows:
187 # python setup.py install --standalone-lib
189 This is usually not recommended, however.
191 Note that, to install SCons in any of the above system directories,
192 you should have system installation privileges (that is, "root" or
193 "Administrator") when running the setup.py script. If you don't have
194 system installation privileges, you can use the --prefix option to
195 specify an alternate installation location, such as your home directory:
197 $ python setup.py install --prefix=$HOME
199 This will install SCons in the appropriate locations relative to
200 $HOME--that is, the scons script itself $HOME/bin and the associated
201 library in $HOME/lib/scons, for example.
207 Tests are run by the runtest.py script in this directory.
209 There are two types of tests in this package:
211 Unit tests for individual SCons modules live underneath the
212 src/engine/ subdirectory and are the same base name as the module
213 with "Tests.py" appended--for example, the unit test for the
214 Builder.py module is the BuilderTests.py script.
216 End-to-end tests of SCons live in the test/ subdirectory.
218 You may specifically list one or more tests to be run:
220 $ python runtest.py src/engine/SCons/BuilderTests.py
222 $ python runtest.py test/option-j.py test/Program.py
224 Alternatively, the runtest.py script takes a -a option that searches
225 the tree for all of the tests and runs them:
227 $ python runtest.py -a
229 If more than one test is run, the runtest.py script prints a summary
230 of how many tests passed, failed, or yielded no result, and lists any
233 The above invocations all test directly the files underneath the src/
234 subdirectory, and do not require that a build be performed first. The
235 runtest.py script supports additional options to run tests against
236 unpacked packages in the build/test-*/ subdirectories. See the "TESTING
237 PACKAGES" section below.
243 We use SCons (version 0.96 or later) to build its own packages. If you
244 already have an appropriate version of SCons installed on your system,
245 you can build everything by simply running it:
249 If you don't have SCons version 0.96 or later already installed on your
250 system, you can build this version of SCons with itself with a little more
251 typing. On UNIX or Linux (using sh or a derivative like bash or ksh):
253 $ export SCONS_LIB_DIR=`pwd`/src/engine
254 $ python src/script/scons.py
258 C:\scons\>set SCONS_LIB_DIR=%cd%\src\engine
259 C:\scons\>python src/script/scons.py
261 Depending on the utilities installed on your system, any or all of the
262 following packages will be built:
264 build/dist/scons-0.96-1.noarch.rpm
265 build/dist/scons-0.96-1.src.rpm
266 build/dist/scons-0.96.linux-i686.tar.gz
267 build/dist/scons-0.96.tar.gz
268 build/dist/scons-0.96.win32.exe
269 build/dist/scons-0.96.zip
270 build/dist/scons-doc-0.96.tar.gz
271 build/dist/scons-local-0.96.tar.gz
272 build/dist/scons-local-0.96.zip
273 build/dist/scons-src-0.96.tar.gz
274 build/dist/scons-src-0.96.zip
275 build/dist/scons_0.96-1_all.deb
277 The SConstruct file is supposed to be smart enough to avoid trying to
278 build packages for which you don't have the proper utilities installed.
279 For example, if you don't have Debian packaging tools installed, it
280 should just not build the .deb package, not fail the build.
282 If you receive a build error, please report it to the scons-devel
283 mailing list and open a bug report on the SCons bug tracker.
285 Note that in addition to creating the above packages, the default build
286 will also unpack one or more of the packages for testing.
292 A full build will unpack and/or install any .deb, .rpm., .local.tar.gz,
293 .local.zip, .src.tar.gz, .src.zip, .tar.gz, and .zip packages into
294 separate build/test-*/ subdirectories. (Of course, if a package was
295 not built on your system, it should not try to install it.) The
296 runtest.py script supports a -p option that will run the specified tests
297 (individually or collectively via the -a option) against the unpacked
298 build/test-/* subdirectory:
300 $ python runtest.py -p deb
302 $ python runtest.py -p rpm
304 $ python runtest.py -p local-tar-gz
306 $ python runtest.py -p local-zip
308 $ python runtest.py -p src-tar-gz
310 $ python runtest.py -p src-zip
312 $ python runtest.py -p tar-gz
314 $ python runtest.py -p zip
316 (The canonical invocation is to also use the runtest.py -a option so
317 that all tests are run against the specified package.)
320 CONTENTS OF THIS PACKAGE
321 ========================
323 Not guaranteed to be up-to-date (but better than nothing):
326 A subdirectory for benchmarking scripts, used to perform timing
327 tests to decide what specific idioms are most efficient for
328 various parts of the code base. We check these in so they're
329 available in case we have to revisit any of these decisions in
333 Miscellaneous utilities used in SCons development. Right now,
334 some of the stuff here includes:
336 -- a copy of the script we use to translate an Aegis change
338 -- a script that runs pychecker on our source tree
339 -- a script that counts source and test files and numbers
341 -- a script for synchronizing the Aegis tree to SourceForge
342 -- a prototype script for capturing sample SCons output
344 -- a script that can profile and time a packaging build of
346 -- a copy of xml_export, which can retrieve project data
350 A build script for use with Aegis. This collects a current copy
351 of SCons from the Aegis baseline directories in a bootstrap/
352 subdirectory, and then executes SCons with the supplied
353 command-line arguments.
356 This doesn't exist yet if you're looking at a vanilla source
357 tree. This is generated as part of our build process, and it's
358 where, believe it or not, we *build* everything.
361 The Aegis configuration, governing much of how we use Aegis to
362 build, test, control source, etc.
365 Files needed to construct a Debian package. The contents of this
366 directory are dictated by the Debian Policy Manual
367 (http://www.debian.org/doc/debian-policy). The package will not be
368 accepted into the Debian distribution unless the contents of this
369 directory satisfy the relevant Debian policies.
372 SCons documentation. A variety of things here, in various
373 stages of (in)completeness.
376 A subdirectory for miscellaneous things that we need. Right
377 now, it has copies of Python modules that we use for testing,
378 and which we don't want to force people to have to install on
379 their own just to help out with SCons development.
382 Stuff to generate files for Gentoo Linux.
385 Documentation of SCons administrative procedures (making a
386 change, releasing a new version). Maybe other administrative
390 A copy of the copyright and terms under which SCons is
391 distributed (the Open Source Initiative-approved MIT license).
394 A copy of the copyright and terms under which SCons is
395 distributed for inclusion in the scons-local-{version} packages.
396 This is the same as LICENSE with a preamble that specifies
397 the licensing terms are for SCons itself, not any other
398 package that includes SCons.
401 What you're looking at right now.
404 A README file for inclusion in the scons-local-{version}
405 packages. Similar to this file, but stripped down and modified
406 for people looking at including SCons in their shipped software.
409 The .spec file for building our RPM packages.
412 Script for running SCons tests. By default, this will run a
413 test against the code in the local src/ tree, so you don't
414 have to do a build before testing your changes. Aegis uses
415 it with an option that requires that you've done a build
416 (aeb) before running tests.
419 The "Makefile" for the SCons distribution.
421 (It has been pointed out that it's hard to find the SCons API
422 in this SConstruct file, and that it looks a lot more like a
423 pure Python script than a build configuration file. That's
424 mainly because all of the magick we have to perform to deal with
425 all of the different packaging formats requires a lot of pure
426 Python manipulation. In other words, don't look at this file
427 for an example of how easy it is to use SCons to build "normal"
431 Where the actual source code is kept, of course.
434 Template files, used by Aegis to give you a head start when you
435 aenf or aent a new file.
438 End-to-end tests of the SCons utility itself. These are
439 separate from the individual module unit tests, which live
440 side-by-side with the modules under src/.
446 See the src/RELEASE.txt file for notes about this specific release,
447 including known problems. See the src/CHANGES.txt file for a list of
448 changes since the previous release.
450 The doc/man/scons.1 man page is included in this package, and contains a
451 section of small examples for getting started using SCons.
453 Additional documentation for SCons is available at:
455 http://www.scons.org/doc.html
461 SCons is distributed under the MIT license, a full copy of which is
462 available in the LICENSE file. The MIT license is an approved Open
463 Source license, which means:
465 This software is OSI Certified Open Source Software. OSI
466 Certified is a certification mark of the Open Source Initiative.
468 More information about OSI certifications and Open Source software is
471 http://www.opensource.org/
477 Please report bugs by following the "Tracker - Bugs" link on the SCons
478 project page and filling out the form:
480 http://sourceforge.net/projects/scons/
482 You can also send mail to the SCons developers mailing list:
484 scons-devel@lists.sourceforge.net
486 But please make sure that you also submit a bug report to the project
487 page bug tracker, because bug reports in email can sometimes get lost
488 in the general flood of messages.
494 An active mailing list for developers of SCons is available. You may
495 send questions or comments to the list at:
499 You may request a subscription to the developer's mailing list by sending
502 dev-subscribe@scons.tigris.org
504 Subscription to the developer's mailing list is by approval. In practice,
505 no one is refused list membership, but we reserve the right to limit
506 membership in the future and/or weed out lurkers.
508 There is also a low-volume mailing list available for announcements
509 about SCons. Subscribe by sending email to:
511 announce-subscribe@scons.tigris.org
513 There are other mailing lists available for SCons users, for notification
514 of SCons code changes, and for notification of updated bug reports and
515 project documents. Please see our mailing lists page for details.
521 If you find SCons helpful, please consider making a donation (of cash,
522 software, or hardware) to support continued work on the project.
523 Information is available at:
525 http://www.scons.org/donate.html
531 Check the SCons web site at:
533 http://www.scons.org/
540 knight at baldmt dot com
541 http://www.baldmt.com/~knight/
543 With plenty of help from the SCons Development team: