SCons
Template:Redirect-distinguish {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other SCons is a software development tool that analyzes source code 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 similar to the more popular GNU build system.
The tool generates Python scripts for project configuration and build logic.
HistoryEdit
The Cons software construction utility, written in the Perl, was created by Bob Sidebotham in 1999.<ref>Template:Citation.</ref> It served as a base for the ScCons build tool, a design which won the Software Carpentry project SC Build competition in August 2000.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> ScCons was the foundation for SCons.
SCons inspired the creation of Waf, formerly known as SCons/BKsys, which emerged in the KDE 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.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
Notable projects that use SCons (or used it at one time) include: The Battle for Wesnoth,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Battlefield 1942,Template:Citation needed Doom 3,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> FCEUX,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> gem5,<ref>Template:Citation.</ref> gpsd,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> GtkRadiant,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Madagascar,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Mixxx,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> MongoDB,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Nullsoft Scriptable Install System,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> OpenNebula,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> VMware,Template:Citation needed, Wolfenstein: Enemy Territory,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> XORP and MCA2,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> openpilot<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> and Godot.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
.csig is the SCons Content Signature file format.
FeaturesEdit
Major features include:
- Configuration files are Python; user-written builds can leverage a general-purpose, cross-platform programming language
- Dependency analysis for C, C++ and Fortran
- Dependency analysis is extensible through user-defined scanners for other languages or file types; unlike GNU Compiler Collection (GCC) dependency analysis, SCons uses a regular expression scan for included source files
- Built-in support for C, C++, D, Java, Fortran, Objective-C, Yacc, Lex, Qt and SWIG, as well as TeX and LaTeX documents
- Support for other languages via custom builders
- Building from central repositories of source code and pre-built targets
- Ability to use Visual Studio, including the generation of Template:Not a typo, Template:Not a typo, Template:Not a typo and Template:Not a typo files
- Detection of file content changes using MD5 signatures; optional, configurable ability to use traditional timestamps
- Ability to do parallel builds, maintaining a specified number of jobs running simultaneously regardless of directory hierarchy
- Autoconf-like support for finding #include files, libraries, functions and typedefs
- Global view of 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; known to work on POSIX systems (including Linux, AIX and OS/2, *BSD Unices, HP-UX, SGI IRIX, Solaris, illumos), Windows NT, OS X
ExamplesEdit
The following is an SConstruct file that builds a hello world C program using the default platform compiler:
<syntaxhighlight lang="python"> Program("hello-world.c") </syntaxhighlight>
The following is a SConstruct file for a project that includes two source files and specifies build tool options:
<syntaxhighlight lang="python"> env = Environment() env.Append(CPPFLAGS=["-Wall", "-g"]) env.Program("hello", ["hello.c", "main.c"]) </syntaxhighlight>
See alsoEdit
- Template:Annotated link
- Template:Annotated link
- Template:Annotated link
- Template:Annotated link
- Template:Annotated link