HOME

TheInfoList



OR:

A configure script is an executable script designed to aid in developing a program to be run on a wide number of different computers. It matches the
libraries A library is a collection of Document, materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or electronic media, digital access (soft copies) materials, and may be a ...
on the user's computer, with those required by the program before
compiling In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
it from its
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the w ...
. 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 Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, an ...
computers, and generally involves the following three steps: configuring the
makefile In software development, Make is a build automation tool that automatically builds executable programs and libraries from source code by reading files called ''Makefiles'' which specify how to derive the target program. Though integrated devel ...
, 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 In software development, Make is a build automation tool that automatically builds executable programs and libraries from source code by reading files called ''Makefiles'' which specify how to derive the target program. Though integrated devel ...
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: ./configure make make install One must type ./configure rather than simply configure to indicate to the shell that the script is in the current directory. This is because, as a security precaution,
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, an ...
configurations don't search the current directory for executables. So, to execute programs in that directory, one must explicitly specify their location. Upon its completion, configure prints a report to config.log. Running ./configure --help gives a list of command line arguments, for enabling or disabling additional features such as: ./configure --libs="-lmpfr -lgmp" ./configure --prefix=/home/user/local The first line includes the mpfr and gmp libraries. The second line tells
make Make or MAKE may refer to: * Make (magazine), a tech DIY periodical *Make (software), a software build tool *Make, Botswana, in the Kalahari Desert *Make Architects Make Architects is an international architecture practice headquartered in Londo ...
to install the final version in /home/user/local. Often, a document with instructions is included. This can be helpful if configure fails. This file is commonly named INSTALL.


Generating configure

Software developers simplify the challenge of
cross-platform In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software ...
software development by using
GNU Autotools The GNU Autotools, also known as the GNU Build System, is a suite of programming tools designed to assist in making source code packages portable to many Unix-like systems. It can be difficult to make a software program portable: the C compiler ...
. 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 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 pkg-config is a computer program that defines and supports a unified interface for querying installed library (computer science), libraries for the purpose of Compiler, compiling software that depends on them. It allows programmers and installati ...
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 Larry Arnold Wall (born September 27, 1954) is an American computer programmer and author. He created the Perl programming language. Personal life Wall grew up in Los Angeles and then Bremerton, Washington, before starting higher education at ...
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. 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 GNU Autoconf is a tool for producing configure scripts for building, installing, and packaging software on computer systems where a Bourne shell is available. Autoconf is agnostic about the programming languages used, but it is often used for ...
system.


See also

*
Autoconf GNU Autoconf is a tool for producing configure scripts for building, installing, and packaging software on computer systems where a Bourne shell is available. Autoconf is agnostic about the programming languages used, but it is often used for ...
*
Software build In software development, a build is the process of converting source code files into standalone software artifact(s) that can be run on a computer, or the result of doing so. Functions Building software is an end-to-end process that involves m ...
*
GNU Build System The GNU Autotools, also known as the GNU Build System, is a suite of programming tools designed to assist in making source code packages portable to many Unix-like systems. It can be difficult to make a software program portable: the C compile ...


References

{{Reflist Compiling tools Linux configuration utilities Unix programming tools configure