Configure script: Difference between revisions

Content deleted Content added
m clean up; http->https (see this RfC) using AWB
undo wrong em dash fix
Line 5:
As a common practice, all configure scripts are named "configure". Usually, configure scripts are written for the [[Bourne shell]], but they may be written for execution in any desired shell.
 
== Usage ==
Obtaining software directly from the source code is a common procedure on [[Unix]] computers, and generally involves the following three steps: configuring the [[makefile]], compiling the code, and finally installing the executable to standard locations. A configure script accomplishes the first of these steps. Using configure scripts is an automated method of generating [[makefile]]s before compilation to tailor the software to the system on which the executable is to be compiled and run. The final executable software is most commonly obtained by executing the following commands in a shell that is currently pointing to the directory containing the source code:
 
Line 16:
Upon its completion, <code>configure</code> prints a report to <code>config.log</code>. Running <code>./configure --help</code> gives a list of command line arguments, for enabling or disabling additional features such as:
 
./configure—libsconfigure --libs="-lmpfr -lgmp"
./configure—prefixconfigure --prefix=/home/myname/apps
 
The first line includes the <code>mpfr</code> and <code>gmp</code> libraries. The second line tells [[make (software)|make]] to install the final version in <code>/home/myname/apps</code>. The <code>INSTALL</code> file contains instructions should the prescribed steps fail.
 
== Generating <code>configure</code> ==
Software developers simplify the challenge of [[cross-platform]] software development by using GNU's [[Autotools]].<ref>{{cite web |url=https://www.gnu.org/software/autoconf/ |title=Autoconf - GNU Project - Free Software Foundation (FSF) |publisher=GNU Operating System |accessdate=20 November 2010}}</ref> These scripts query the system on which they run 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.
 
Line 27:
In new development, library dependency checking has been done in great part using [[pkg-config]] via the [[M4 (computer language)|m4]] macro, PKG_CHECK_MODULES. Before pkg-config's gained popularity, separate m4 macros were created to locate files known to be included in the distribution of libraries depended upon.
 
== History ==
The first program to come with a configure script was [[rn (newsreader)|rn]] by [[Larry Wall]] in 1984. The script was written by hand and produced a jocular running commentary when executed. It still survives as part of the build system of the '''trn''' program.{{Citation needed|date=January 2016}}