Fix over-zealous common prefix matching when generating Visual Studio project files...
[scons.git] / README
1 # __COPYRIGHT__
2
3                  SCons - a software construction tool
4
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.
8
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
14 be packaged.
15
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.
20
21
22 LATEST VERSION
23 ==============
24
25 Before going further, you can check that this package you have is the
26 latest version at the SCons download page:
27
28         http://www.scons.org/download.html
29
30
31 EXECUTION REQUIREMENTS
32 ======================
33
34 Running SCons requires Python version 1.5.2 or later.  There should be
35 no other dependencies or requirements to run SCons.
36
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.
43
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.
48
49
50 INSTALLATION REQUIREMENTS
51 =========================
52
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.
58
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
62 Hat 8.0 or later.
63
64 In this case, your options are:
65
66     --  (Optional.)  Install from a pre-packaged SCons package that
67         does not require distutils:
68
69             Red Hat Linux       scons-0.96.noarch.rpm
70
71             Debian GNU/Linux    scons_0.96_all.deb
72                                 (or use apt-get)
73
74             Windows             scons-0.96.win32.exe
75
76     --  (Recommended.)  Download the latest distutils package from the
77         following URL:
78
79             http://www.python.org/sigs/distutils-sig/download.html
80
81         Install the distutils according to the instructions on the page.
82         You can then proceed to the next section to install SCons from
83         this package.
84
85
86 INSTALLATION
87 ============
88
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.)
94
95 If you already have an appropriate version of SCons installed on your
96 system, populate the build/scons/ directory by running:
97
98         $ scons build/scons
99
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):
107
108         $ export SCONS_LIB_DIR=`pwd`/src/engine
109         $ python src/script/scons.py build/scons
110
111 Or as follows on Windows:
112         
113         C:\scons\>set SCONS_LIB_DIR=%cd%\src\engine
114         C:\scons\>python src/script/scons.py build/scons
115
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:
119
120         # cd build/scons
121         # python setup.py install
122
123 And on Windows:
124
125         C:\scons\>cd build\scons
126         C:\scons\build\scons>python setup.py install
127
128 By default, the above commands will do the following:
129
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
134         line.
135
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.
146
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.
156
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
161         engine library.
162
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.
169
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
174 follows:
175
176         # python setup.py install --standard-lib
177
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).
181
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:
186
187         # python setup.py install --standalone-lib
188
189 This is usually not recommended, however.
190
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:
196
197         $ python setup.py install --prefix=$HOME
198
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.
202
203
204 TESTING
205 =======
206
207 Tests are run by the runtest.py script in this directory.
208
209 There are two types of tests in this package:
210
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.
215
216     End-to-end tests of SCons live in the test/ subdirectory.
217
218 You may specifically list one or more tests to be run:
219
220         $ python runtest.py src/engine/SCons/BuilderTests.py
221
222         $ python runtest.py test/option-j.py test/Program.py
223
224 Alternatively, the runtest.py script takes a -a option that searches
225 the tree for all of the tests and runs them:
226
227         $ python runtest.py -a
228
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
231 unsuccessful tests.
232
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.
238
239
240 BUILDING PACKAGES
241 =================
242
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:
246
247         $ scons
248
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):
252
253         $ export SCONS_LIB_DIR=`pwd`/src/engine
254         $ python src/script/scons.py
255
256 On Windows:
257         
258         C:\scons\>set SCONS_LIB_DIR=%cd%\src\engine
259         C:\scons\>python src/script/scons.py
260
261 Depending on the utilities installed on your system, any or all of the
262 following packages will be built:
263
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
276
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.
281
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.
284
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.
287
288
289 TESTING PACKAGES
290 ================
291
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:
299
300         $ python runtest.py -p deb
301
302         $ python runtest.py -p rpm
303
304         $ python runtest.py -p local-tar-gz
305
306         $ python runtest.py -p local-zip
307
308         $ python runtest.py -p src-tar-gz
309
310         $ python runtest.py -p src-zip
311
312         $ python runtest.py -p tar-gz
313
314         $ python runtest.py -p zip
315
316 (The canonical invocation is to also use the runtest.py -a option so
317 that all tests are run against the specified package.)
318
319
320 CONTENTS OF THIS PACKAGE
321 ========================
322
323 Not guaranteed to be up-to-date (but better than nothing):
324
325 bench/
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
330         the future.
331
332 bin/
333         Miscellaneous utilities used in SCons development.  Right now,
334         some of the stuff here includes:
335
336             --  a copy of the script we use to translate an Aegis change
337                 into a CVS checkin
338             --  a script that runs pychecker on our source tree
339             --  a script that counts source and test files and numbers
340                 of lines in each
341             --  a script for synchronizing the Aegis tree to SourceForge
342             --  a prototype script for capturing sample SCons output
343                 in sgml files
344             --  a script that can profile and time a packaging build of
345                 SCons itself
346             --  a copy of xml_export, which can retrieve project data
347                 from SourceForge
348
349 bootstrap.py
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.
354
355 build/
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.
359
360 config
361         The Aegis configuration, governing much of how we use Aegis to
362         build, test, control source, etc.
363
364 debian/
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.
370
371 doc/
372         SCons documentation.  A variety of things here, in various
373         stages of (in)completeness.
374
375 etc/
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.
380
381 gentoo/
382         Stuff to generate files for Gentoo Linux.
383
384 HOWTO/
385         Documentation of SCons administrative procedures (making a
386         change, releasing a new version).  Maybe other administrative
387         stuff in the future.
388
389 LICENSE
390         A copy of the copyright and terms under which SCons is
391         distributed (the Open Source Initiative-approved MIT license).
392
393 LICENSE-local
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.
399
400 README
401         What you're looking at right now.
402
403 README-local
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.
407
408 rpm/
409         The .spec file for building our RPM packages.
410
411 runtest.py
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.
417
418 SConstruct
419         The "Makefile" for the SCons distribution.
420
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"
428         software.)
429
430 src/
431         Where the actual source code is kept, of course.
432
433 template/
434         Template files, used by Aegis to give you a head start when you
435         aenf or aent a new file.
436
437 test/
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/.
441
442
443 DOCUMENTATION
444 =============
445
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.
449
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.
452
453 Additional documentation for SCons is available at:
454
455         http://www.scons.org/doc.html
456
457
458 LICENSING
459 =========
460
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:
464
465         This software is OSI Certified Open Source Software.  OSI
466         Certified is a certification mark of the Open Source Initiative.
467
468 More information about OSI certifications and Open Source software is
469 available at:
470
471         http://www.opensource.org/
472
473
474 REPORTING BUGS
475 ==============
476
477 Please report bugs by following the "Tracker - Bugs" link on the SCons
478 project page and filling out the form:
479
480         http://sourceforge.net/projects/scons/
481
482 You can also send mail to the SCons developers mailing list:
483
484         scons-devel@lists.sourceforge.net
485
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.
489
490
491 MAILING LISTS
492 =============
493
494 An active mailing list for developers of SCons is available.  You may
495 send questions or comments to the list at:
496
497         dev@scons.tigris.org
498
499 You may request a subscription to the developer's mailing list by sending
500 email to:
501
502         dev-subscribe@scons.tigris.org
503
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.
507
508 There is also a low-volume mailing list available for announcements
509 about SCons.  Subscribe by sending email to:
510
511         announce-subscribe@scons.tigris.org
512
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.
516
517
518 DONATIONS
519 =========
520
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:
524
525         http://www.scons.org/donate.html
526
527
528 FOR MORE INFORMATION
529 ====================
530
531 Check the SCons web site at:
532
533         http://www.scons.org/
534
535
536 AUTHOR INFO
537 ===========
538
539 Steven Knight
540 knight at baldmt dot com
541 http://www.baldmt.com/~knight/
542
543 With plenty of help from the SCons Development team:
544         Chad Austin
545         Charles Crain
546         Steve Leblanc
547         Gary Oberbrunner
548         Anthony Roach
549         Greg Spencer
550         Christoph Wiedemann
551