SCons: efficient software build tool in Python

SCons is an open source computer software construction tool implemented in Python with automatic detection of source code file dependencies, MD5 signatures, and built-in support for C, C++, Objective-C, D, Yacc, Java, Qt, Fortran, Lex, and SWIG, as well as TeX and LaTeX documents.

SCons software build tool in PythonSCons is an open source computer software construction tool implemented in Python. There is a big number of popular and powerful rival construction tools like CMake and waf, but SCons keeps up with them. Basically it became an improved, cross-platform substitute for the traditional GNU Build System (GBS) based on the make utility and a set of Autotools (autoconf, automake, autoheader, etc.). But it is a next-generation build system that provides faster, easier, and more reliable way to build software.

SCons is written in pure Python that is general purpose programming language. Python scripts are used for software project configurations and build process implementations. SCons has a modular build engine, solves a number of problems associated with build automation, and can be embedded in other software.

SCons has built-in support for C, C++, Objective-C, D, Yacc, Java, Qt, Fortran, Lex, and SWIG, as well as TeX and LaTeX documents. User-defined Builders help to introduce support for all other languages or file types. SCons uses MD5 signatures to reliably detect file content changes and decide whether a file is up-to-date, although configurable support for traditional file timestamps is also available.

This build tool uses a regular expression scan to detect source code file dependencies automatically and maintains a global view of all dependencies in a build tree so multiple build passes or reordering targets are not required. Dependency analysis is extensible via user-defined dependency scanners for file types or languages other than built-in C, C++, and Fortran. SCons also analyzes adaptation requirements of operating system from a software project description.

Using common command automation tools like Fabric you have to specify a name of an action to execute. Contrary to them, in build systems like SCons you specify the name of a target that you need to built (usually a file or directory) and build system does the rest. SCons starts with building a complete node dependency graph and detecting what commands each node needs. Then SCons executes the minimal set of commands to provide the desired result.

More SCons features:

  • allows building from central source code repositories and pre-built targets;
  • has built-in support for fetching source files from revision control systems (BitKeeper, Subversion, SCCS, RCS, CVS, and Perforce);
  • supports parallel builds, ensures that a specified number of jobs runs simultaneously regardless of directory hierarchy;
  • has built-in support for Microsoft Visual Studio, including generation of .dsp, .dsw, .sln and .vcproj files;
  • supports cross-platform builds, and can work on POSIX systems (including GNU/Linux, OS/2, Solaris, etc.), MS Windows, Apple OS X.

SCons is a build system with modular design that allows embedding in other applications. It is written in pure Python so it is possible to distribute tool along with project sources. Moreover, user-written builds have access to a complete general-purpose programming language. To know more about this software construction tool visit scons.org.

Connect with our experts Let's talk