Jump to content

SCons

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 76.87.74.5 (talk) at 05:25, 12 April 2008 (→‎Notable applications: csound5 uses scons). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

SCons
Developer(s)Steven Knight
Stable release
0.98 / March 31, 2008
Repository
Operating systemWindows, POSIX
TypeSoftware development tools
LicenseMIT License
Websitewww.scons.org

SCons is an open source software build tool. SCons is a substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. Compared to earlier tools, SCons aims to be easier to use, more reliable, and faster.

Major features

  • Configuration files are Python scripts, which means that user-written builds have access to a complete general-purpose programming language.
  • Automatic dependency analysis built-in for C, C++ and Fortran. Unlike make, no extra command like "make depend" or "make clean" is required to get all of the dependencies. Dependency analysis is easily extensible through user-defined dependency scanners for other languages or file types. Unlike autotools, gcc's built in dependency analysis is not used. Instead, a regexp scan for "#include" is done over all C/C++ source files. For a gcc based build, this means that dependency generation can be slower (i.e. an extra scan is always needed) and less reliable (in the sense that things like preprocessor flags, e.g. -DSOMETHING, are ignored), but it is more portable since the same scanner can be used for non-gcc compilers.
  • Built-in support for C, C++, D, Java, Fortran, Objective-C, Yacc, Lex, Qt and SWIG, and building TeX and LaTeX documents. Other languages or file types can be supported through user-defined Builders for other languages or file types.
  • Building from central repositories of source code and/or pre-built targets.
  • Built-in support for fetching source files from SCCS, RCS, CVS, Subversion, BitKeeper and Perforce.
  • Built-in support for Microsoft Visual Studio .NET and past Visual Studio versions, including generation of .dsp, .dsw, .sln and .vcproj files.
  • Detection of file content changes using MD5 signatures; optional, configurable support for traditional timestamps.
  • Support for parallel builds which keeps the specified number of jobs running simultaneously regardless of directory hierarchy.
  • Integrated Autoconf-like support for finding #include files, libraries, functions and typedefs.
  • Global view of all dependencies, so multiple build passes or reordering targets is not required.
  • Ability to share built files in a cache to speed up multiple builds - like ccache but for any type of target file, not just C/C++ compilation.
  • Designed from the ground up for cross-platform builds, and known to work on Linux, other POSIX systems (including AIX, *BSD systems, HP-UX, IRIX and Solaris), Windows NT, Mac OS X, and OS/2.

Sample SConstruct file

Program('main.c')

When the user runs the 'scons' command, scons will build a 'main' executable (on Linux) or 'main.exe' (on Windows).

SCons began life as the 'ScCons' build tool design which won the Software Carpentry SC Build competition in August 2000. That design was in turn based on the Cons software construction utility.

Waf, formerly known as "SCons/BKsys", is a tool inspired by SCons that emerged in the KDE community. For some time, there were plans to use it as the build tool for KDE 4 and beyond, but they were later scrapped in favor of CMake. [1]

Notable applications