Configure script: Difference between revisions

Content deleted Content added
Generalize to include more than autotools
Kuromedayo (talk | contribs)
m delete unnecessary newline
 
(2 intermediate revisions by one other user not shown)
Line 1:
{{Short description|Shell script for generating build configuration files on a Unix-like environment}}
{{Lowercase title}}
[[Image:Autoconf-automake-process.svg|thumb|280px|Flow diagram including configure, [[autoconf]] and [[automake]], three tools in the GNU Build System]]
 
When installing a package on a [[Unix]] or [[Unix-like]] environment, a '''configure script''' is a [[shell script]] that generates [[software build|build]] configuration files for a [[codebase]] to facilitate cross-platform support. It generates files tailoring for the host system {{endash}} the environment on which the codebase is built and run.
 
Even though there are no standards for such a script, the pattern is so ubiquitous that many developers are familiar with and even expect a script named ''configure'' that has this functionality. The script can be and originally was hand-coded. Today, multiple tools are available for generating a configure script based on special configuration files. One commonly used tool is the [[GNU Build SystemAutotools]] which generates a [[Bash (Unix shell)|Bash]] script.
 
Obtaining a software package as [[source code]] and [[compiler|compiling]] it locally is a common scenario on [[Unix]] and [[Unix-like]] environments. Typically, this process involves the following steps:
Line 25 ⟶ 23:
</syntaxhighlight>
 
For the GNU build systemAutotools, the configure script logs status and errors to file ''config.log'', and the command <code>./configure --help</code> outputs command line help information.
 
Often, a document with instructions is included with the codebase; often in a file named <code>INSTALL</code>. It can be helpful if the configure script fails.
Line 31 ⟶ 29:
== Generating ==
 
[[GNU Build System]]Autotools simplifies some of the challenges of [[cross-platform software]] development.<ref>{{cite web |url=https://www.gnu.org/software/autoconf/ |title=Autoconf - GNU Project - Free Software Foundation (FSF) |publisher=GNU Operating System |access-date=20 November 2010}}</ref> These tools query the host system for environment settings, platform architecture, and the existence and ___location of required build and runtime dependencies. They store the gathered information in <code>configure.ac</code> to be read by <code>configure</code> during the installation phase.
 
In new development, library dependency checking can be accomplished via [[pkg-config]] via the [[M4 (computer language)|m4]] macro, PKG_CHECK_MODULES. Before pkg-config gained popularity, separate m4 macros were created to locate files known to be included in the distribution of libraries depended upon.