Go to the first, previous, next, last section, table of contents.

Using Configure

The choices and options available at configuration time generally have valid defaults, but the defaults do not cover all cases. The choices available include install locations, build directories, host, target, and local conventions.

Install Locations

Using the default configuration, make install creates a single tree of files, some of which are programs. The location of this tree is determined by the value of the variable prefix. The default value of prefix is `/usr/local'. This is often correct for native tools installed on only one host.

Changing the default install directory

In the default configuration, all files are installed in subdirectories of `/usr/local'. The location is determined by the value of the configure variable prefix; in turn, this determines the value of the Makefile variable of the same name (prefix).

You can also set the value of the Makefile variable prefix explicitly each time you invoke make if you are so inclined; but because many programs have this location compiled in, you must specify the prefix value consistently on each invocation of make, or you will end up with a broken installation.

To make this easier, the value of the configure variable prefix can be set on the command line to configure using the option -prefix=.

Installing for multiple hosts

By default, host dependent files are installed in subdirectories of `exec_prefix'. The location is determined by the value of the configure variable exec_prefix, which determines the value of the Makefile variable exec_prefix. This makes it simpler to install for a single host, and simplifies changing the default location for the install tree; but the default doesn't allow for multiple hosts to effectively share host independent files.

To configure so that multiple hosts can share common files, use something like:

configure host1 -prefix=/usr/gnu -exec_prefix=/usr/gnu/H-host1
make all info install install-info clean

configure host2 -prefix=/usr/gnu -exec_prefix=/usr/gnu/H-host2
make all info install install-info

The first line configures the source for host1 to place host specific programs in subdirectories of `/usr/gnu/H-host1'.

The second line builds and installs all programs for host1, including both host independent and host specific files.

The third line reconfigures the source for host2 to place host specific programs in subdirectories of `/usr/gnu/H-host2'.

The fourth line builds and installs all programs for host2. Host specific files are installed in new directories, but the host independent files are installed on top of the host independent files installed for host1. This results in a single copy of the host independent files, suitable for use by both hosts.

Full descriptions of all installation subdirectories

During any install, a number of standard directories are created. Their names are determined by Makefile variables. Some of the defaults for Makefile variables can be changed at configure time using command line options to configure. For more information on the standard directories or the Makefile variables, please refer to standards.text.

Note that configure does not create the directory srcdir at any time. srcdir is not an installation directory.

You can override all makefile variables on the command line to make. (See section `Overriding Variables' in Make.) If you do so, you will need to specify the value precisely the same way for each invocation of make, or you risk ending up with a broken installation. This is because many programs have the locations of other programs or files compiled into them. If you find yourself overriding any of the variables frequently, you should consider site dependent Makefile fragments. See also section Adding site info.

During make install, a number of standard directories are created and populated. The following Makefile variables define them. Those whose defaults are set by corresponding configure variables are marked "Makefile and configure".

Makefile and configure: prefix
The root of the installation tree. You can set its Makefile default with the -prefix= command line option to configure. (section Invoking.) The default value for prefix is `/usr/local'.

Makefile: bindir
A directory for binary programs that users can run. The default value for bindir depends on prefix; bindir is normally changed only indirectly through prefix. The default value for bindir is `$(prefix)/bin'.

Makefile and configure: exec_prefix
A directory for host dependent files. You can specify the Makefile default value by using the -exec_prefix= option to configure. (See also section Invoking.) The default value for exec_prefix is `$(prefix)'.

Makefile: libdir
A directory for libraries and support programs. The default value for libdir depends on prefix; libdir is normally changed only indirectly through prefix. The default value for libdir is `$(prefix)/lib'.

Makefile: mandir
A directory for man format documentation ("man pages"). The default value for mandir depends on prefix; mandir is normally changed only indirectly through prefix. The default value for mandir is `$(prefix)/man'.

Makefile: manNdir
There are eight variables named man1dir, man2dir, etc. They name the specific directories for each man page section. For example, man1dir holds `emacs.1' (the man page for the emacs program), while man5dir holds `rcsfile.5' (the man page describing the rcs data file format). The default value for any of the manNdir variables depends indirectly on prefix, and is normally changed only through prefix. The default value for manNdir is `$(mandir)/manN'.

Makefile: manext
Not supported by configure. The GNU coding standards do not call for man1ext, man2ext, so the intended use for manext is apparently not parallel to mandir. Its use is not clear. (See also section Extensions to the GNU coding standards.)

Makefile: infodir
A directory for info format documentation. The default value for infodir depends indirectly on prefix; infodir is normally changed only through prefix. The default value for infodir is `$(prefix)/info'.

Makefile: docdir
A directory for any documentation that is in a format other than those used by info or man. The default value for docdir depends indirectly on prefix; docdir is normally changed only through prefix. The default value for docdir is `$(datadir)/doc'. This variable is an extension to the GNU coding standards. (See also section Extensions to the GNU coding standards.)

Makefile: includedir
A directory for the header files accompanying the libraries installed in libdir. The default value for includedir depends on prefix; includedir is normally changed only indirectly through prefix. The default value for includedir is `$(prefix)/include'.

Build Directories

Normally, configure builds a `Makefile' and symbolic links in the same directory as the source files. This is the typical UN*X way to build programs, but it has limitations. For instance, using this approach, you can only build for one host at a time.

We refer to the directories where configure builds a Makefile as the build directories or sometimes as objdir because these are the directories in which make will build object files, among other things.

The default build directory is the same as the source directory. You can use a different build directory with a sequence like the following:

mkdir builddir
cd builddir
configure host -srcdir=sourcedirectory

where builddir is the directory where you wish to build, host is the host for which you want to build, and sourcedirectory is the directory containing the source files.

If you were to do this twice with different values for builddir and host, then you could make for both at the same time.

Host

The arguments to configure are hosts. By host we mean the environment in which the source will be compiled. This need not necessarily be the same as the physical machine involved, although it usually is.

For example, if some obscure machine running an operating system other than UN*X had the GNU POSIX emulation libraries available, it would be possible to configure most GNU source for a POSIX system and build it on the obscure host.

For more on this topic, see section `Host Environments' in On Configuring Development Tools.

Target

For building native development tools, or most of the other GNU tools, you need not worry about the target. The target of a configuration defaults to the same as the host.

For building cross development tools, please see section `Building Development Environments' in On Configuring Development Tools.

Local Conventions

If you find that a tool does not get configured to your liking, or if configure's conventions differ from your local conventions, you should probably consider site specific Makefile fragments. See also section Adding site info.

These are probably not the right choice for options that can be set from the configure command line or for differences that are host or target dependent.


Go to the first, previous, next, last section, table of contents.