Configure script: Difference between revisions

Content deleted Content added
History: More encylopedic
Kuromedayo (talk | contribs)
m delete unnecessary newline
 
(4 intermediate revisions by one other user not shown)
Line 1:
{{Short description|GNU Build SystemShell script for generating build configuration files on a Unix-like environment}}
{{Lowercase title}}
AsWhen generatedinstalling bya thepackage on a [[GNUUnix]] Buildor System[[Unix-like]] environment, a '''configure script''' is ana [[Bash (Unix shell)|Bash shellscript]] script that generates [[software build|build]] configuration files for a [[codebase]] to facilitate cross-platform support. It matchesgenerates thefiles [[Librarytailoring (computer science)|libraries]] onfor the build host computersystem with{{endash}} thosethe requiredenvironment byon which the codebase beforeis thebuilt [[sourceand code]] is [[compiler|compiled]]run.
[[Image:Autoconf-automake-process.svg|thumb|280px|Flow diagram including configure, [[autoconf]] and [[automake]], three tools in the GNU Build System]]
 
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 [[Autotools]] which generates a [[Bash (Unix shell)|Bash]] script.
As generated by the [[GNU Build System]], a '''configure script''' is an [[Bash (Unix shell)|Bash shell]] script that generates [[software build|build]] configuration files for a [[codebase]] to facilitate cross-platform support. It matches the [[Library (computer science)|libraries]] on the build host computer with those required by the codebase before the [[source code]] is [[compiler|compiled]].
 
Obtaining softwarea directlysoftware frompackage theas [[source code]] and [[compiler|compiling]] it locally is a common procedurescenario on [[Unix]] and [[Unix-like]] environementsenvironments. ItTypically, this generallyprocess involves the following steps:
== Use ==
 
# Generate build configuration files
Obtaining software directly from the source code is a common procedure on [[Unix]] and [[Unix-like]] environements. It generally involves the following steps:
# CompileBuild the code
 
# Generate a [[makefile]]
# Compile the code
# Install the result to an accessible ___location
 
A configure script accomplishes the first step. The script automatesby generating a [[makefile]]; allowingthat foris tailoringconfigured it andfor the resultinghost softwaresystem. toThis includes using the system[[Library on(computer whichscience)|libraries]] itof isthe compiledhost andas run.required by the codebase.
 
== Use ==
After navigating a terminal to the directory that contains the source code, the following commands are typically executed:<ref>{{cite web |url=http://www.control-escape.com/linux/lx-swinstall-tar.html |title=Compiling Linux Software from Source Code |publisher=Control-Escape's Linux Help Engine |access-date=20 November 2010}}</ref>
 
After navigating a terminalcommand-line [[Shell (computing)|shell]] to the directory that contains the source code, the following commands are typically executed:<ref>{{cite web |url=http://www.control-escape.com/linux/lx-swinstall-tar.html |title=Compiling Linux Software from Source Code |publisher=Control-Escape's Linux Help Engine |access-date=20 November 2010}}</ref>
 
<syntaxhighlight lang="sh">
Line 23:
</syntaxhighlight>
 
AFor reportthe ofAutotools, the configurationconfigure operationscript canlogs bestatus foundand inerrors to file ''config.log''., Runningand the command <code>./configure --help</code> outputs command line syntaxhelp optionsinformation.
 
Often, a document with instructions is included with the codebase; often in a file named <code>INSTALL</code>. ThisIt can be helpful if <code>the configure</code> script fails.
 
== Generating ==
[[GNU Build System]] simplifies some of the the challenge 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> or the now deprecated <code>configure.in</code> to be read by <code>configure</code> during the installation phase.
 
[[GNU Build System]]Autotools simplifies some of the the challengechallenges 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> or the now deprecated <code>configure.in</code> to be read by <code>configure</code> during the installation phase.
== Dependency checking ==
 
In new development, library dependency checking hascan beenbe doneaccomplished in great part usingvia [[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.
 
== History ==