configure script

As generated by the GNU Build System, a configure script is an Bash shell script that generates build configuration files for a codebase to facilitate cross-platform support. It matches the libraries on the build host computer with those required by the codebase before the source code is compiled.
Use
Obtaining software directly from the source code is a common procedure on Unix and Unix-like environements. It generally involves the following steps:
- Generate a makefile
- Compile the code
- Install the result to an accessible location
A configure script accomplishes the first step. The script automates generating a makefile; allowing for tailoring it and the resulting software to the system on which it is compiled and run.
After navigating a terminal to the directory that contains the source code, the following commands are typically executed:[1]
./configure
make
make install
A report of the configuration operation can be found in file config.log. Running ./configure --help
outputs command line syntax options.
Often, a document with instructions is included; often in a file named INSTALL
. This can be helpful if configure
fails.
Generating
GNU Build System simplifies some of the the challenge of cross-platform software development.[2] 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 configure.ac
or the now deprecated configure.in
to be read by configure
during the installation phase.
Dependency checking
In new development, library dependency checking has been done in great part using pkg-config via the 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
The first program to come with a configure script was 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.[3]
Since then, an ecosystem of programs has grown up to automate the creation of configure scripts as far as possible, of which the most common is the GNU Autoconf system.
References
- ^ "Compiling Linux Software from Source Code". Control-Escape's Linux Help Engine. Retrieved 20 November 2010.
- ^ "Autoconf - GNU Project - Free Software Foundation (FSF)". GNU Operating System. Retrieved 20 November 2010.
- ^ "Configure script of trn". GitHub. Retrieved 10 December 2020.