xref: /freebsd/contrib/file/INSTALL (revision 28a8b562974a1424f460cb17023c2106bd0c2e26)
128a8b562SDavid E. O'BrienInstallation Instructions
228a8b562SDavid E. O'Brien*************************
328a8b562SDavid E. O'Brien
428a8b562SDavid E. O'BrienCopyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
528a8b562SDavid E. O'Brien2006 Free Software Foundation, Inc.
628a8b562SDavid E. O'Brien
728a8b562SDavid E. O'BrienThis file is free documentation; the Free Software Foundation gives
828a8b562SDavid E. O'Brienunlimited permission to copy, distribute and modify it.
928a8b562SDavid E. O'Brien
1028a8b562SDavid E. O'BrienBasic Installation
1128a8b562SDavid E. O'Brien==================
1228a8b562SDavid E. O'Brien
1328a8b562SDavid E. O'BrienBriefly, the shell commands `./configure; make; make install' should
1428a8b562SDavid E. O'Brienconfigure, build, and install this package.  The following
1528a8b562SDavid E. O'Brienmore-detailed instructions are generic; see the `README' file for
1628a8b562SDavid E. O'Brieninstructions specific to this package.
1728a8b562SDavid E. O'Brien
1828a8b562SDavid E. O'Brien   The `configure' shell script attempts to guess correct values for
1928a8b562SDavid E. O'Brienvarious system-dependent variables used during compilation.  It uses
2028a8b562SDavid E. O'Brienthose values to create a `Makefile' in each directory of the package.
2128a8b562SDavid E. O'BrienIt may also create one or more `.h' files containing system-dependent
2228a8b562SDavid E. O'Briendefinitions.  Finally, it creates a shell script `config.status' that
2328a8b562SDavid E. O'Brienyou can run in the future to recreate the current configuration, and a
2428a8b562SDavid E. O'Brienfile `config.log' containing compiler output (useful mainly for
2528a8b562SDavid E. O'Briendebugging `configure').
2628a8b562SDavid E. O'Brien
2728a8b562SDavid E. O'Brien   It can also use an optional file (typically called `config.cache'
2828a8b562SDavid E. O'Brienand enabled with `--cache-file=config.cache' or simply `-C') that saves
2928a8b562SDavid E. O'Brienthe results of its tests to speed up reconfiguring.  Caching is
3028a8b562SDavid E. O'Briendisabled by default to prevent problems with accidental use of stale
3128a8b562SDavid E. O'Briencache files.
3228a8b562SDavid E. O'Brien
3328a8b562SDavid E. O'Brien   If you need to do unusual things to compile the package, please try
3428a8b562SDavid E. O'Briento figure out how `configure' could check whether to do them, and mail
3528a8b562SDavid E. O'Briendiffs or instructions to the address given in the `README' so they can
3628a8b562SDavid E. O'Brienbe considered for the next release.  If you are using the cache, and at
3728a8b562SDavid E. O'Briensome point `config.cache' contains results you don't want to keep, you
3828a8b562SDavid E. O'Brienmay remove or edit it.
3928a8b562SDavid E. O'Brien
4028a8b562SDavid E. O'Brien   The file `configure.ac' (or `configure.in') is used to create
4128a8b562SDavid E. O'Brien`configure' by a program called `autoconf'.  You need `configure.ac' if
4228a8b562SDavid E. O'Brienyou want to change it or regenerate `configure' using a newer version
4328a8b562SDavid E. O'Brienof `autoconf'.
4428a8b562SDavid E. O'Brien
4528a8b562SDavid E. O'BrienThe simplest way to compile this package is:
4628a8b562SDavid E. O'Brien
4728a8b562SDavid E. O'Brien  1. `cd' to the directory containing the package's source code and type
4828a8b562SDavid E. O'Brien     `./configure' to configure the package for your system.
4928a8b562SDavid E. O'Brien
5028a8b562SDavid E. O'Brien     Running `configure' might take a while.  While running, it prints
5128a8b562SDavid E. O'Brien     some messages telling which features it is checking for.
5228a8b562SDavid E. O'Brien
5328a8b562SDavid E. O'Brien  2. Type `make' to compile the package.
5428a8b562SDavid E. O'Brien
5528a8b562SDavid E. O'Brien  3. Optionally, type `make check' to run any self-tests that come with
5628a8b562SDavid E. O'Brien     the package.
5728a8b562SDavid E. O'Brien
5828a8b562SDavid E. O'Brien  4. Type `make install' to install the programs and any data files and
5928a8b562SDavid E. O'Brien     documentation.
6028a8b562SDavid E. O'Brien
6128a8b562SDavid E. O'Brien  5. You can remove the program binaries and object files from the
6228a8b562SDavid E. O'Brien     source code directory by typing `make clean'.  To also remove the
6328a8b562SDavid E. O'Brien     files that `configure' created (so you can compile the package for
6428a8b562SDavid E. O'Brien     a different kind of computer), type `make distclean'.  There is
6528a8b562SDavid E. O'Brien     also a `make maintainer-clean' target, but that is intended mainly
6628a8b562SDavid E. O'Brien     for the package's developers.  If you use it, you may have to get
6728a8b562SDavid E. O'Brien     all sorts of other programs in order to regenerate files that came
6828a8b562SDavid E. O'Brien     with the distribution.
6928a8b562SDavid E. O'Brien
7028a8b562SDavid E. O'BrienCompilers and Options
7128a8b562SDavid E. O'Brien=====================
7228a8b562SDavid E. O'Brien
7328a8b562SDavid E. O'BrienSome systems require unusual options for compilation or linking that the
7428a8b562SDavid E. O'Brien`configure' script does not know about.  Run `./configure --help' for
7528a8b562SDavid E. O'Briendetails on some of the pertinent environment variables.
7628a8b562SDavid E. O'Brien
7728a8b562SDavid E. O'Brien   You can give `configure' initial values for configuration parameters
7828a8b562SDavid E. O'Brienby setting variables in the command line or in the environment.  Here
7928a8b562SDavid E. O'Brienis an example:
8028a8b562SDavid E. O'Brien
8128a8b562SDavid E. O'Brien     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
8228a8b562SDavid E. O'Brien
8328a8b562SDavid E. O'Brien   *Note Defining Variables::, for more details.
8428a8b562SDavid E. O'Brien
8528a8b562SDavid E. O'BrienCompiling For Multiple Architectures
8628a8b562SDavid E. O'Brien====================================
8728a8b562SDavid E. O'Brien
8828a8b562SDavid E. O'BrienYou can compile the package for more than one kind of computer at the
8928a8b562SDavid E. O'Briensame time, by placing the object files for each architecture in their
9028a8b562SDavid E. O'Brienown directory.  To do this, you can use GNU `make'.  `cd' to the
9128a8b562SDavid E. O'Briendirectory where you want the object files and executables to go and run
9228a8b562SDavid E. O'Brienthe `configure' script.  `configure' automatically checks for the
9328a8b562SDavid E. O'Briensource code in the directory that `configure' is in and in `..'.
9428a8b562SDavid E. O'Brien
9528a8b562SDavid E. O'Brien   With a non-GNU `make', it is safer to compile the package for one
9628a8b562SDavid E. O'Brienarchitecture at a time in the source code directory.  After you have
9728a8b562SDavid E. O'Brieninstalled the package for one architecture, use `make distclean' before
9828a8b562SDavid E. O'Brienreconfiguring for another architecture.
9928a8b562SDavid E. O'Brien
10028a8b562SDavid E. O'BrienInstallation Names
10128a8b562SDavid E. O'Brien==================
10228a8b562SDavid E. O'Brien
10328a8b562SDavid E. O'BrienBy default, `make install' installs the package's commands under
10428a8b562SDavid E. O'Brien`/usr/local/bin', include files under `/usr/local/include', etc.  You
10528a8b562SDavid E. O'Briencan specify an installation prefix other than `/usr/local' by giving
10628a8b562SDavid E. O'Brien`configure' the option `--prefix=PREFIX'.
10728a8b562SDavid E. O'Brien
10828a8b562SDavid E. O'Brien   You can specify separate installation prefixes for
10928a8b562SDavid E. O'Brienarchitecture-specific files and architecture-independent files.  If you
11028a8b562SDavid E. O'Brienpass the option `--exec-prefix=PREFIX' to `configure', the package uses
11128a8b562SDavid E. O'BrienPREFIX as the prefix for installing programs and libraries.
11228a8b562SDavid E. O'BrienDocumentation and other data files still use the regular prefix.
11328a8b562SDavid E. O'Brien
11428a8b562SDavid E. O'Brien   In addition, if you use an unusual directory layout you can give
11528a8b562SDavid E. O'Brienoptions like `--bindir=DIR' to specify different values for particular
11628a8b562SDavid E. O'Brienkinds of files.  Run `configure --help' for a list of the directories
11728a8b562SDavid E. O'Brienyou can set and what kinds of files go in them.
11828a8b562SDavid E. O'Brien
11928a8b562SDavid E. O'Brien   If the package supports it, you can cause programs to be installed
12028a8b562SDavid E. O'Brienwith an extra prefix or suffix on their names by giving `configure' the
12128a8b562SDavid E. O'Brienoption `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
12228a8b562SDavid E. O'Brien
12328a8b562SDavid E. O'BrienOptional Features
12428a8b562SDavid E. O'Brien=================
12528a8b562SDavid E. O'Brien
12628a8b562SDavid E. O'BrienSome packages pay attention to `--enable-FEATURE' options to
12728a8b562SDavid E. O'Brien`configure', where FEATURE indicates an optional part of the package.
12828a8b562SDavid E. O'BrienThey may also pay attention to `--with-PACKAGE' options, where PACKAGE
12928a8b562SDavid E. O'Brienis something like `gnu-as' or `x' (for the X Window System).  The
13028a8b562SDavid E. O'Brien`README' should mention any `--enable-' and `--with-' options that the
13128a8b562SDavid E. O'Brienpackage recognizes.
13228a8b562SDavid E. O'Brien
13328a8b562SDavid E. O'Brien   For packages that use the X Window System, `configure' can usually
13428a8b562SDavid E. O'Brienfind the X include and library files automatically, but if it doesn't,
13528a8b562SDavid E. O'Brienyou can use the `configure' options `--x-includes=DIR' and
13628a8b562SDavid E. O'Brien`--x-libraries=DIR' to specify their locations.
13728a8b562SDavid E. O'Brien
13828a8b562SDavid E. O'BrienSpecifying the System Type
13928a8b562SDavid E. O'Brien==========================
14028a8b562SDavid E. O'Brien
14128a8b562SDavid E. O'BrienThere may be some features `configure' cannot figure out automatically,
14228a8b562SDavid E. O'Brienbut needs to determine by the type of machine the package will run on.
14328a8b562SDavid E. O'BrienUsually, assuming the package is built to be run on the _same_
14428a8b562SDavid E. O'Brienarchitectures, `configure' can figure that out, but if it prints a
14528a8b562SDavid E. O'Brienmessage saying it cannot guess the machine type, give it the
14628a8b562SDavid E. O'Brien`--build=TYPE' option.  TYPE can either be a short name for the system
14728a8b562SDavid E. O'Brientype, such as `sun4', or a canonical name which has the form:
14828a8b562SDavid E. O'Brien
14928a8b562SDavid E. O'Brien     CPU-COMPANY-SYSTEM
15028a8b562SDavid E. O'Brien
15128a8b562SDavid E. O'Brienwhere SYSTEM can have one of these forms:
15228a8b562SDavid E. O'Brien
15328a8b562SDavid E. O'Brien     OS KERNEL-OS
15428a8b562SDavid E. O'Brien
15528a8b562SDavid E. O'Brien   See the file `config.sub' for the possible values of each field.  If
15628a8b562SDavid E. O'Brien`config.sub' isn't included in this package, then this package doesn't
15728a8b562SDavid E. O'Brienneed to know the machine type.
15828a8b562SDavid E. O'Brien
15928a8b562SDavid E. O'Brien   If you are _building_ compiler tools for cross-compiling, you should
16028a8b562SDavid E. O'Brienuse the option `--target=TYPE' to select the type of system they will
16128a8b562SDavid E. O'Brienproduce code for.
16228a8b562SDavid E. O'Brien
16328a8b562SDavid E. O'Brien   If you want to _use_ a cross compiler, that generates code for a
16428a8b562SDavid E. O'Brienplatform different from the build platform, you should specify the
16528a8b562SDavid E. O'Brien"host" platform (i.e., that on which the generated programs will
16628a8b562SDavid E. O'Brieneventually be run) with `--host=TYPE'.
16728a8b562SDavid E. O'Brien
16828a8b562SDavid E. O'BrienSharing Defaults
16928a8b562SDavid E. O'Brien================
17028a8b562SDavid E. O'Brien
17128a8b562SDavid E. O'BrienIf you want to set default values for `configure' scripts to share, you
17228a8b562SDavid E. O'Briencan create a site shell script called `config.site' that gives default
17328a8b562SDavid E. O'Brienvalues for variables like `CC', `cache_file', and `prefix'.
17428a8b562SDavid E. O'Brien`configure' looks for `PREFIX/share/config.site' if it exists, then
17528a8b562SDavid E. O'Brien`PREFIX/etc/config.site' if it exists.  Or, you can set the
17628a8b562SDavid E. O'Brien`CONFIG_SITE' environment variable to the location of the site script.
17728a8b562SDavid E. O'BrienA warning: not all `configure' scripts look for a site script.
17828a8b562SDavid E. O'Brien
17928a8b562SDavid E. O'BrienDefining Variables
18028a8b562SDavid E. O'Brien==================
18128a8b562SDavid E. O'Brien
18228a8b562SDavid E. O'BrienVariables not defined in a site shell script can be set in the
18328a8b562SDavid E. O'Brienenvironment passed to `configure'.  However, some packages may run
18428a8b562SDavid E. O'Brienconfigure again during the build, and the customized values of these
18528a8b562SDavid E. O'Brienvariables may be lost.  In order to avoid this problem, you should set
18628a8b562SDavid E. O'Brienthem in the `configure' command line, using `VAR=value'.  For example:
18728a8b562SDavid E. O'Brien
18828a8b562SDavid E. O'Brien     ./configure CC=/usr/local2/bin/gcc
18928a8b562SDavid E. O'Brien
19028a8b562SDavid E. O'Briencauses the specified `gcc' to be used as the C compiler (unless it is
19128a8b562SDavid E. O'Brienoverridden in the site shell script).
19228a8b562SDavid E. O'Brien
19328a8b562SDavid E. O'BrienUnfortunately, this technique does not work for `CONFIG_SHELL' due to
19428a8b562SDavid E. O'Brienan Autoconf bug.  Until the bug is fixed you can use this workaround:
19528a8b562SDavid E. O'Brien
19628a8b562SDavid E. O'Brien     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
19728a8b562SDavid E. O'Brien
19828a8b562SDavid E. O'Brien`configure' Invocation
19928a8b562SDavid E. O'Brien======================
20028a8b562SDavid E. O'Brien
20128a8b562SDavid E. O'Brien`configure' recognizes the following options to control how it operates.
20228a8b562SDavid E. O'Brien
20328a8b562SDavid E. O'Brien`--help'
20428a8b562SDavid E. O'Brien`-h'
20528a8b562SDavid E. O'Brien     Print a summary of the options to `configure', and exit.
20628a8b562SDavid E. O'Brien
20728a8b562SDavid E. O'Brien`--version'
20828a8b562SDavid E. O'Brien`-V'
20928a8b562SDavid E. O'Brien     Print the version of Autoconf used to generate the `configure'
21028a8b562SDavid E. O'Brien     script, and exit.
21128a8b562SDavid E. O'Brien
21228a8b562SDavid E. O'Brien`--cache-file=FILE'
21328a8b562SDavid E. O'Brien     Enable the cache: use and save the results of the tests in FILE,
21428a8b562SDavid E. O'Brien     traditionally `config.cache'.  FILE defaults to `/dev/null' to
21528a8b562SDavid E. O'Brien     disable caching.
21628a8b562SDavid E. O'Brien
21728a8b562SDavid E. O'Brien`--config-cache'
21828a8b562SDavid E. O'Brien`-C'
21928a8b562SDavid E. O'Brien     Alias for `--cache-file=config.cache'.
22028a8b562SDavid E. O'Brien
22128a8b562SDavid E. O'Brien`--quiet'
22228a8b562SDavid E. O'Brien`--silent'
22328a8b562SDavid E. O'Brien`-q'
22428a8b562SDavid E. O'Brien     Do not print messages saying which checks are being made.  To
22528a8b562SDavid E. O'Brien     suppress all normal output, redirect it to `/dev/null' (any error
22628a8b562SDavid E. O'Brien     messages will still be shown).
22728a8b562SDavid E. O'Brien
22828a8b562SDavid E. O'Brien`--srcdir=DIR'
22928a8b562SDavid E. O'Brien     Look for the package's source code in directory DIR.  Usually
23028a8b562SDavid E. O'Brien     `configure' can determine that directory automatically.
23128a8b562SDavid E. O'Brien
23228a8b562SDavid E. O'Brien`configure' also accepts some other, not widely useful, options.  Run
23328a8b562SDavid E. O'Brien`configure --help' for more details.
23428a8b562SDavid E. O'Brien
235