As the number of UNIX variants increased, it became harder to write programs which could run on all variants. Developers frequently did not have access to every system, and the characteristics of some systems changed from version to version. The GNU configure and build system simplifies the building of programs distributed as source code. All programs are built using a simple, standardised, two step process. The program builder need not install any special tools in order to build the program.
The configure shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a Makefile in each directory of the package.
The simplest way to compile a package is:
- cd to the directory containing the package's source code.
- Type ./configure to configure the package for your system.
- Type make to compile the package.
- Optionally, type make check to run any self-tests that come with the package.
- Type make install to install the programs and any data files and documentation.
- Optionally, type make clean to remove the program binaries and object files from the source code directory
The configure utility supports a wide variety of options. You can usually use the --help option to get a list of interesting options for a particular configure script.
The only generic options you are likely to use are the --prefix and --exec-prefix options. These options are used to specify the installation directories.
The directory named by the --prefix option will hold machine independent files such as documentation, data and configuration files.
The directory named by the --exec-prefix option, (which is normally a subdirectory of the --prefix directory), will hold machine dependent files such as executables.