SCons
Encyclopedia
SCons is a computer software
Computer software
Computer software, or just software, is a collection of computer programs and related data that provide the instructions for telling a computer what to do and how to do it....

 construction tool that automatically analyzes source code file dependencies and operating system adaptation requirements from a software project description and generates final binary executables for installation on the target operating system platform. Its function is analogous to the traditional GNU build system
GNU build system
The GNU build system, also known as the Autotools, is a suite of programming tools designed to assist in making source-code packages portable to many Unix-like systems....

 based on the make utility and the autoconf
Autoconf
GNU Autoconf is a tool for producing configure scripts for building, installing and packaging software on computer systems where a Bourne shell is available....

tools.

Scons uses the Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

 general purpose programming language as a foundation, so that all software project configurations and build process implementations are Python scripts.

Major features

  • Configuration files are Python
    Python (programming language)
    Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

     scripts, which means that user-written builds have access to a complete general-purpose programming language.
  • Automatic dependency analysis built-in for C, C++
    C++
    C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

     and Fortran
    Fortran
    Fortran is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing...

    . Dependency analysis is extensible through user-defined dependency scanners for other languages or file types. Unlike the GNU Compiler Collection
    GNU Compiler Collection
    The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain...

    's (GCC) built-in dependency analysis, it uses a regular expression
    Regular expression
    In computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...

     scan for included source files.
  • Built-in support for C, C++
    C++
    C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

    , D, Java
    Java (programming language)
    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

    , Fortran
    Fortran
    Fortran is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing...

    , Objective-C
    Objective-C
    Objective-C is a reflective, object-oriented programming language that adds Smalltalk-style messaging to the C programming language.Today, it is used primarily on Apple's Mac OS X and iOS: two environments derived from the OpenStep standard, though not compliant with it...

    , Yacc
    Yacc
    The computer program yacc is a parser generator developed by Stephen C. Johnson at AT&T for the Unix operating system. The name is an acronym for "Yet Another Compiler Compiler." It generates a parser based on an analytic grammar written in a notation similar to BNF.Yacc used to be available as...

    , Lex
    Lex programming tool
    Lex is a computer program that generates lexical analyzers . Lex is commonly used with the yacc parser generator. Lex, originally written by Mike Lesk and Eric Schmidt, is the standard lexical analyzer generator on many Unix systems, and a tool exhibiting its behavior is specified as part of the...

    , Qt
    Qt (toolkit)
    Qt is a cross-platform application framework that is widely used for developing application software with a graphical user interface , and also used for developing non-GUI programs such as command-line tools and consoles for servers...

     and SWIG
    SWIG
    SWIG is an open source software tool used to connect computer programs or libraries written in C or C++ with scripting languages such as Lua, Perl, PHP, Python, R, Ruby, Tcl, and other languages like C#, Java, Modula-3, Objective Caml, Octave, and Scheme...

    . As well as building TeX
    TeX
    TeX is a typesetting system designed and mostly written by Donald Knuth and released in 1978. Within the typesetting system, its name is formatted as ....

     and LaTeX
    LaTeX
    LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as . The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to...

     documents. Other languages or file types can be supported through user-defined Builders.
  • Building from central repositories of source code and pre-built targets.
  • Built-in support for fetching source files from revision control
    Revision control
    Revision control, also known as version control and source control , is the management of changes to documents, programs, and other information stored as computer files. It is most commonly used in software development, where a team of people may change the same files...

     systems, such as SCCS
    Source Code Control System
    Source Code Control System is an early revision control system, geared toward program source code and other text files. It was originally developed in SNOBOL at Bell Labs in 1972 by Marc J. Rochkind for an IBM System/370 computer running OS/360 MVT...

    , RCS
    Revision Control System
    The Revision Control System is a software implementation of revision control that automates the storing, retrieval, logging, identification, and merging of revisions. RCS is useful for text that is revised frequently, for example programs, documentation, procedural graphics, papers, and form...

    , CVS
    Concurrent Versions System
    The Concurrent Versions System , also known as the Concurrent Versioning System, is a client-server free software revision control system in the field of software development. Version control system software keeps track of all work and all changes in a set of files, and allows several developers ...

    , Subversion, BitKeeper
    BitKeeper
    BitKeeper is a software tool for distributed revision control of computer source code. A distributed system, BitKeeper competes largely against other systems such as Git and Mercurial...

     and Perforce
    Perforce
    Perforce is a commercial, proprietary, centralized revision control system developed by Perforce Software, Inc.-Architecture:Perforce is a client/server system.The server manages a central database and a master repository of file versions....

    .
  • Built-in support for Microsoft Visual Studio
    Microsoft Visual Studio
    Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

    , including generation of .dsp, .dsw, .sln and .vcproj files.
  • Detection of file content changes using MD5
    MD5
    The MD5 Message-Digest Algorithm is a widely used cryptographic hash function that produces a 128-bit hash value. Specified in RFC 1321, MD5 has been employed in a wide variety of security applications, and is also commonly used to check data integrity...

     signatures; optional, configurable support for traditional timestamps.
  • Support for parallel builds which maintains a 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
    Ccache
    ccache is a software development tool that caches the output of C/C++ compilation so that the next time, the same compilation can be avoided and the results can be taken from the cache. This can greatly speed up recompiling time...

     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 POSIX
    POSIX
    POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...

     systems (including Linux
    Linux
    Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

    , AIX
    AIX operating system
    AIX AIX AIX (Advanced Interactive eXecutive, pronounced "a i ex" is a series of proprietary Unix operating systems developed and sold by IBM for several of its computer platforms...

    , *BSD systems
    BSD/OS
    BSD/OS was a proprietary version of the BSD operating system developed by Berkeley Software Design, Inc. ....

    , HP-UX
    HP-UX
    HP-UX is Hewlett-Packard's proprietary implementation of the Unix operating system, based on UNIX System V and first released in 1984...

    , IRIX
    IRIX
    IRIX is a computer operating system developed by Silicon Graphics, Inc. to run natively on their 32- and 64-bit MIPS architecture workstations and servers. It was based on UNIX System V with BSD extensions. IRIX was the first operating system to include the XFS file system.The last major version...

     and Solaris), Windows NT
    Windows NT
    Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

    , Mac OS X
    Mac OS X
    Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

    , and OS/2
    OS/2
    OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

    .

History and related projects

SCons software history started with the Cons software construction utility created by Bob Sidebotham in 1999. Cons was written in the Perl programming language. It served as a base for the ScCons build tool, a design which won the Software Carpentry
Software Carpentry
Software Carpentry was originally a project funded in 2000-2001 by Los Alamos National Laboratory to create easy-to-use open source replacements for basic software engineering tools aimed at programmers working in computational science. The project was started by Gregory V...

 project SC Build competition in August 2000. ScCons was the foundation for Scons.

SCons inspired the creation of Waf
Waf
Waf is a Build automation tool - a program that assists in the automatic compilation and installation of other programs or libraries.-General:* Portable to Unix and non-Unix systems* Lightweight...

, formerly known as SCons/BKsys, which emerged in the KDE
KDE
KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...

 community. For some time, there were plans to use it as the build tool for KDE 4 and beyond, but that effort was abandoned in favor of CMake
CMake
CMake is a cross-platform, open-source system for managing the build process of software using a compiler-independent method. It is designed to support directory hierarchies and applications that depend on multiple libraries, and for use in conjunction with native build environments such as Make,...

.

Example scons file

The following very simple SConstruct file compiles the c-program file hello-world.c using the default platform compiler.

Program('hello-world.c')


The following is a more complex example that creates an environment that it uses to build the program hello.

env = Environment
env.Append(CPPFLAGS=['-Wall','-g'])
env.Program('hello',
['hello.c', 'main.c'])

Notable applications using Scons

The Battle for Wesnoth, Battlefield 1942
Battlefield 1942
Battlefield 1942 is a 3D World War II first-person shooter computer game developed by Swedish company Digital Illusions CE and published by Electronic Arts for Microsoft Windows and Apple Macintosh . The game can be played in singleplayer mode against the computer game AI or in multiplayer mode...

, Blender
Blender (software)
Blender is a free and open-source 3D computer graphics software product used for creating animated films, visual effects, interactive 3D applications or video games. The current release version is 2.60, and was released on October 19, 2011...

, Csound
Csound
Csound is a computer programming language for dealing with sound, also known as a sound compiler or an audio programming language, or more precisely, a C-based audio DSL. It is called Csound because it is written in C, as opposed to some of its predecessors...

, Doom 3
Doom 3
Doom 3 is a science fiction horror video game developed by id Software and published by Activision. An example of the first-person shooter genre, Doom 3 was first released for Microsoft Windows on August 3, 2004. The game was later adapted for Linux, as well as being ported by Aspyr Media for Mac...

, Wolfenstein: Enemy Territory
Wolfenstein: Enemy Territory
Wolfenstein: Enemy Territory is a free and open source multiplayer first-person shooter video game set during World War II...

, gpsd
Gpsd
gpsd is a daemon that receives data from a GPS receiver, and provides the data back to multiple applications such as Kismet or GPS navigation software....

, GtkRadiant
GtkRadiant
GtkRadiant is a level design program developed by id Software and Loki Software. It is used to create maps for a number of video games. It is maintained by id Software together with a number of volunteers.-History:...

, M5, Madagascar
Madagascar (software)
Madagascar is a software package for multidimensional data analysis and reproducible computational experiments. Its mission is to provide* a convenient and powerful environment* a convenient technology transfer tool...

,
MongoDB
MongoDB
MongoDB is an open source, high-performance, schema-free, document-oriented database written in the C++ programming language...

, Nullsoft Scriptable Install System
Nullsoft Scriptable Install System
Nullsoft Scriptable Install System is a script-driven Windows installation system with minimal overhead backed by Nullsoft, the creators of Winamp...

, NumPy and SciPy
SciPy
SciPy is an open source library of algorithms and mathematical tools for the Python programming language.SciPy contains modules for optimization, linear algebra, integration, interpolation, special functions, FFT, signal and image processing, ODE solvers and other tasks common in science and...

, OpenNebula
OpenNebula
OpenNebula is an open-source cloud computing toolkit for managing heterogeneous distributed data center infrastructures. The OpenNebula toolkit manages a data center's virtual infrastructure to build private, public and hybrid IaaS clouds...

, SuperCollider
Supercollider
A Supercollider is a high energy particle accelerator. The term may refer to:* Superconducting Super Collider, planned 80 km project in Texas, canceled in 1993...

, VMware
VMware
VMware, Inc. is a company providing virtualization software founded in 1998 and based in Palo Alto, California, USA. The company was acquired by EMC Corporation in 2004, and operates as a separate software subsidiary ....

, XORP
XORP
XORP is an open source Internet Protocol routing software suite originally designed at the International Computer Science Institute in Berkeley, California...

, MCA2, V8 (JavaScript engine)
V8 (JavaScript engine)
The Google V8 JavaScript Engine is an open source JavaScript engine developed by Google and ships with the Google Chrome web browser. Lars Bak is the head programmer....

, Mixxx
Mixxx
Mixxx is open source digital DJ'ing software that allows an individual to mix music using a personal computer, as a DJ would with a pair of physical turntables. It is specifically suited to the style of mixing known as beatmatching. - Overview :...


See also

  • Buildout
    Buildout
    Buildout is an open source software build tool. Buildout is created using Python programming language. It implements a principle of separation of configuration from the scripts that do the setting up....

  • GNU build system
    GNU build system
    The GNU build system, also known as the Autotools, is a suite of programming tools designed to assist in making source-code packages portable to many Unix-like systems....

  • CMake
    CMake
    CMake is a cross-platform, open-source system for managing the build process of software using a compiler-independent method. It is designed to support directory hierarchies and applications that depend on multiple libraries, and for use in conjunction with native build environments such as Make,...

  • Waf
    Waf
    Waf is a Build automation tool - a program that assists in the automatic compilation and installation of other programs or libraries.-General:* Portable to Unix and non-Unix systems* Lightweight...



External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK