SCons

From Wikipedia, the free encyclopedia

Jump to: navigation, search
SCons
Developed by Steven Knight
Latest release 1.2.0 / December 20, 2008
Operating system Windows, POSIX
Type Software development tools
License MIT License
Website www.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 and more reliable.

Contents

[edit] 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"[1] 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.
  • 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.

[edit] 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).

[edit] History and related projects

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]

[edit] Notable applications

[edit] External links

[edit] References

  1. ^ In most cases, "depend" and "clean" targets are generated by autotools or written by user. Make is just a tool, that executes them.
  2. ^ http://code.google.com/p/v8/source/browse/trunk/SConstruct
Personal tools