Python 1.5.2, you may not have distutils installed. If you are running
Python version 1.6 or later, you should be fine.
-NOTE TO RED HAT USERS: All Red Hat Linux versions as late as 7.3
-still ship Python 1.5.2 as the default, so you probably do *not* have
-distutils installed, unless you have already done so manually.
+NOTE TO RED HAT USERS: All Red Hat Linux versions as late as 7.3 (at
+least) still ship Python 1.5.2 as the default, so you probably do *not*
+have distutils installed, unless you have already done so manually.
In this case, your options are:
If you don't have SCons version 0.07 or later already installed on your
system, you can use SCons itself to populate the build/scons/ directory
-with a little more work:
+with a little more typing:
$ SCONS_LIB_DIR=`pwd`/src/engine python src/script/scons.py build/scons
-Either command populates the build/scons/ directory with the necessary
-files and directory structure to use the Python-standard setup script as
-follows:
+Either command will populate the build/scons/ directory with the
+necessary files and directory structure to use the Python-standard setup
+script as follows:
# cd build/scons
# python setup.py install
engine in an appropriate SCons library directory (/usr/lib/scons or
C:\Python*\SCons, for example).
-You should have system installation privileges (that is, "root" or
-"Administrator") when running the setup.py script to install SCons in
-the default system directories.
+You should have system installation privileges (that is, "root" on POSIX
+or "Administrator" on Windows) when running the setup.py script to
+install SCons in the default system directories.
If you don't have system installation privileges, you can use the
--prefix option to specify an alternate installation location, such as
Tests are run by the runtest.py script in this directory.
-There are two types of tests in this package. Unit tests for individual
-SCons modules live underneath the src/engine/ subdirectory and are the
-same base name as the module with "Tests.py" appended--for example,
-the unit test for the Builder.py module is the BuilderTests.py script.
-End-to-end tests of SCons live in the test/ subdirectory.
+There are two types of tests in this package:
+
+ Unit tests for individual SCons modules live underneath the
+ src/engine/ subdirectory and are the same base name as the module
+ with "Tests.py" appended--for example, the unit test for the
+ Builder.py module is the BuilderTests.py script.
+
+ End-to-end tests of SCons live in the test/ subdirectory.
You may specifically list one or more tests to be run:
If you don't have SCons version 0.07 or later already installed on your
system, you can build this version of SCons with itself with a little
-more work:
+more typing:
$ SCONS_LIB_DIR=`pwd`/src/engine python src/script/scons.py
should just not build the .deb package, not fail the build.
If you receive a build error, please report it to the scons-devel
-mailing list.
+mailing list and open a bug report on the SCons bug tracker.
Note that in addition to creating the above packages, the default build
will also unpack one or more of the packages for testing.
$ python runtest.py -p zip
-(The canonical invocation is to specify the runtest.py -a option so that
-all tests are run against the specified package.)
+(The canonical invocation is to also use the runtest.py -a option so
+that all tests are run against the specified package.)
CONTENTS OF THIS PACKAGE
(aeb) before running tests.
SConstruct
- The "Makefile" for the SCons distribution. (It has been
- pointed out that it's hard to find the SCons API in here, and
- it looks a lot more like a straight Python script than a build
- configuration file, but that's mainly because all of the magick
- we have to do to deal with a variety of packaging formats
- requires a lot of straight Python manipulation.)
+ The "Makefile" for the SCons distribution.
+
+ (It has been pointed out that it's hard to find the SCons API in
+ this SConstruct file, and that it looks a lot more like a pure
+ Python script than a build configuration file. That's mainly
+ because all of the magick we have to perform to deal with all of
+ the different packaging formats requires a lot of pure Python
+ manipulation.)
src/
Where the actual source code is kept, of course.
#
# SConstruct file to build scons packages during development.
#
+# See the README file for an overview of how SCons is built and tested.
+#
#
# Copyright (c) 2001, 2002 Steven Knight
Default('.')
#
-# An internal "whereis" routine to figure out if we have a
-# given program available. Put it in the "cons::" package
-# so subsidiary Conscript files can get at it easily, too.
+# An internal "whereis" routine to figure out if a given program
+# is available on this system.
#
-
def whereis(file):
for dir in string.split(os.environ['PATH'], os.pathsep):
f = os.path.join(dir, file)
#
# We let the presence or absence of various utilities determine
# whether or not we bother to build certain pieces of things.
-# This will allow people to still do SCons work even if they
+# This should allow people to still do SCons work even if they
# don't have Aegis or RPM installed, for example.
#
aegis = whereis('aegis')
zip = whereis('zip')
#
-# Now grab the information that we "build" into the files (using sed).
+# Now grab the information that we "build" into the files.
#
try:
date = ARGUMENTS['date']
elif os.environ.has_key('USER'):
developer = os.environ['USER']
-try:
+if ARGUMENTS.has_key('build_system'):
+ build_system = ARGUMENTS['build_system']
+else:
+ build_system = string.split(os.uname()[1], '.')[0]
+
+if ARGUMENTS.has_key('version'):
revision = ARGUMENTS['version']
-except:
- if aesub:
- revision = os.popen(aesub + " \\$version", "r").read()[:-1]
- else:
- revision = default_version
+elif aesub:
+ revision = os.popen(aesub + " \\$version", "r").read()[:-1]
+else:
+ revision = default_version
a = string.split(revision, '.')
arr = [a[0]]
#version = string.join(arr, '.')
version = default_version
-try:
+build_id = string.replace(revision, version + '.', '')
+
+if ARGUMENTS.has_key('change'):
change = ARGUMENTS['change']
-except:
- if aesub:
- change = os.popen(aesub + " \\$change", "r").read()[:-1]
- else:
- change = default_version
+elif aesub:
+ change = os.popen(aesub + " \\$change", "r").read()[:-1]
+else:
+ change = default_version
python_ver = sys.version[0:3]
lib_project = os.path.join("lib", project)
-unpack_tar_gz_dir = os.path.join(os.getcwd(), "build", "unpack-tar-gz")
-
-unpack_zip_dir = os.path.join(os.getcwd(), "build", "unpack-zip")
-
-test_tar_gz_dir = os.path.join(os.getcwd(), "build", "test-tar-gz")
-test_src_tar_gz_dir = os.path.join(os.getcwd(), "build", "test-src-tar-gz")
-
-test_zip_dir = os.path.join(os.getcwd(), "build", "test-zip")
-test_src_zip_dir = os.path.join(os.getcwd(), "build", "test-src-zip")
+cwd_build = os.path.join(os.getcwd(), "build")
-test_rpm_dir = os.path.join(os.getcwd(), "build", "test-rpm")
+test_deb_dir = os.path.join(cwd_build, "test-deb")
+test_rpm_dir = os.path.join(cwd_build, "test-rpm")
+test_tar_gz_dir = os.path.join(cwd_build, "test-tar-gz")
+test_src_tar_gz_dir = os.path.join(cwd_build, "test-src-tar-gz")
+test_zip_dir = os.path.join(cwd_build, "test-zip")
+test_src_zip_dir = os.path.join(cwd_build, "test-src-zip")
-test_deb_dir = os.path.join(os.getcwd(), "build", "test-deb")
+unpack_tar_gz_dir = os.path.join(cwd_build, "unpack-tar-gz")
+unpack_zip_dir = os.path.join(cwd_build, "unpack-zip")
if platform == "win32":
tar_hflag = ''
# Note: We construct the __*__ substitution strings here
# so that they don't get replaced when this file gets
# copied into the tree for packaging.
- line = string.replace(line, '_' + '_DATE__', env['DATE'])
- line = string.replace(line, '_' + '_DEVELOPER__', env['DEVELOPER'])
- line = string.replace(line, '_' + '_FILE__', s)
- line = string.replace(line, '_' + '_REVISION__', env['REVISION'])
- line = string.replace(line, '_' + '_VERSION__', version)
+ line = string.replace(line, '__BUILD' + '__', env['BUILD'])
+ line = string.replace(line, '__BUILDSYS' + '__', env['BUILDSYS'])
+ line = string.replace(line, '__DATE' + '__', env['DATE'])
+ line = string.replace(line, '__DEVELOPER' + '__', env['DEVELOPER'])
+ line = string.replace(line, '__FILE' + '__', s)
+ line = string.replace(line, '__REVISION' + '__', env['REVISION'])
+ line = string.replace(line, '__VERSION' + '__', version)
outf.write(line)
inf.close()
outf.close()
env = Environment(
ENV = ENV,
+ BUILD = build_id,
+ BUILDSYS = build_system,
DATE = date,
DEVELOPER = developer,
REVISION = revision,
- Fix C #include scanning to detect file names with characters like
'-' in them.
+ - Add more specific version / build output to the -v option.
+
From Jeff Petkau:
- Fix --implicit-cache if the scanner returns an empty list.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-__version__ = "__VERSION__"
-
import imp
import os
import sys
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-__version__ = "__VERSION__"
-
import SCons.Node.FS
import SCons.Util
# "SCons" package. Replace it with our own version directory so, if
# if they're there, we pick up the right version of the build engine
# modules.
-sys.path = [os.path.join(sys.prefix, 'lib', 'scons-__VERSION__')] + sys.path[1:]
+#sys.path = [os.path.join(sys.prefix,
+# 'lib',
+# 'scons-%d' % SCons.__version__)] + sys.path[1:]
import SCons.Node
import SCons.Node.FS
"build Default() targets from local SConscript."])
def option_v(opt, arg):
+ import __main__
import SCons
print "SCons by Steven Knight et al.:"
- print "\tscript version __VERSION__"
- print "\tbuild engine version %s" % SCons.__version__
+ print "\tscript: v%s.%s, %s, by %s on %s" % (__main__.__version__,
+ __main__.__build__,
+ __main__.__date__,
+ __main__.__developer__,
+ __main__.__buildsys__)
+ print "\tengine: v%s.%s, %s, by %s on %s" % (SCons.__version__,
+ SCons.__build__,
+ SCons.__date__,
+ SCons.__developer__,
+ SCons.__buildsys__)
print "Copyright 2001, 2002 Steven Knight"
sys.exit(0)
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
__version__ = "__VERSION__"
+
+__build__ = "__BUILD__"
+
+__buildsys__ = "__BUILDSYS__"
+
+__date__ = "__DATE__"
+
+__developer__ = "__DEVELOPER__"
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+__version__ = "__VERSION__"
+
+__build__ = "__BUILD__"
+
+__buildsys__ = "__BUILDSYS__"
+
+__date__ = "__DATE__"
+
+__developer__ = "__DEVELOPER__"
+
import sys
import os.path
import os
libs.append(os.environ["SCONS_LIB_DIR"])
if sys.platform == 'win32':
- libs.extend([ os.path.join(sys.prefix, 'SCons-__VERSION__'),
+ libs.extend([ os.path.join(sys.prefix, 'SCons-%s' % __version__),
os.path.join(sys.prefix, 'SCons') ])
else:
prefs = []
else:
prefs.append(sys.prefix)
- libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons-__VERSION__'), prefs))
+ libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons-%s' % __version__), prefs))
libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons'), prefs))
sys.path = libs + sys.path[1:]
test.write('SConstruct', "")
expect = r"""SCons by Steven Knight et al.:
-\tscript version \S+
-\tbuild engine version \S+
+\tscript: v\d\.\d\d\.\S+, \d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d, by \S+ on \S+
+\tengine: v\d\.\d\d\.\S+, \d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d, by \S+ on \S+
Copyright 2001, 2002 Steven Knight
"""