SCons User Guide 0.96 | ||
---|---|---|
<<< Previous | Building and Installing SCons | Next >>> |
If a pre-built SCons package is not available for your system, then you can still easily build and install SCons using the native Python distutils package.
The first step is to download either the scons-0.96.tar.gz or scons-0.96.zip, which are available from the SCons download page at http://www.scons.org/download.html.
Unpack the archive you downloaded, using a utility like tar on Linux or UNIX, or WinZip on Windows. This will create a directory called scons-0.96, usually in your local directory. Then change your working directory to that directory and install SCons by executing the following commands:
# cd scons-0.96 # python setup.py install |
This will build SCons, install the scons script in the default system scripts directory (/usr/local/bin or C:\Python2.2\Scripts), and will install the SCons build engine in an appropriate stand-alone library directory (/usr/local/lib/scons or C:\Python2.2\scons). Because these are system directories, you may need root (on Linux or UNIX) or Administrator (on Windows) privileges to install SCons like this.
If you don't have the right privileges to install SCons in a system location, you can install it in a location of your choosing by specifying the --prefix= option:
# python setup.py install --prefix=$HOME |
This would install SCons in appropriate locations relative to the user's $HOME directory, the scons script in $HOME/bin and the build engine in $HOME/lib/scons. You may, of course, specify any other location you prefer.
The SCons setup.py script has some extensions that support easy installation of multiple versions of SCons in side-by-side locations. This makes it easier to download and experiment with different versions of SCons before moving your official build process to a new version, for example.
To install SCons in a version-specific location, add the --version-lib option when you call setup.py:
# python setup.py install --version-lib |
This will install the SCons build engine in the /usr/lib/scons-0.96 or C:\Python2.2\scons-0.96 directory, for example. You can also specify --prefix=, in which case setup.py will install the build engine in a version-specific directory relative to the specified prefix.
If you use the --version-lib option the first time you install SCons, you do not need to specify it each time you install a new version. The SCons setup.py script will detect the version-specific directory name(s) and assume you want to install all versions in version-specific directories. You can override that assumption in the future by explicitly specifying the --standalone-lib option.
<<< Previous | Home | Next >>> |
Installing SCons From Pre-Built Packages | Up | Simple Builds |