xref: /netbsd-src/external/gpl2/diffutils/dist/INSTALL (revision 75f6d617e282811cb173c2ccfbf5df0dd71f7045)
1*75f6d617SchristosCopyright 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation,
2*75f6d617SchristosInc.
3*75f6d617Schristos
4*75f6d617Schristos   This file is free documentation; the Free Software Foundation gives
5*75f6d617Schristosunlimited permission to copy, distribute and modify it.
6*75f6d617Schristos
7*75f6d617SchristosBasic Installation
8*75f6d617Schristos==================
9*75f6d617Schristos
10*75f6d617Schristos   These are generic installation instructions.
11*75f6d617Schristos
12*75f6d617Schristos   The `configure' shell script attempts to guess correct values for
13*75f6d617Schristosvarious system-dependent variables used during compilation.  It uses
14*75f6d617Schristosthose values to create a `Makefile' in each directory of the package.
15*75f6d617SchristosIt may also create one or more `.h' files containing system-dependent
16*75f6d617Schristosdefinitions.  Finally, it creates a shell script `config.status' that
17*75f6d617Schristosyou can run in the future to recreate the current configuration, and a
18*75f6d617Schristosfile `config.log' containing compiler output (useful mainly for
19*75f6d617Schristosdebugging `configure').
20*75f6d617Schristos
21*75f6d617Schristos   It can also use an optional file (typically called `config.cache'
22*75f6d617Schristosand enabled with `--cache-file=config.cache' or simply `-C') that saves
23*75f6d617Schristosthe results of its tests to speed up reconfiguring.  (Caching is
24*75f6d617Schristosdisabled by default to prevent problems with accidental use of stale
25*75f6d617Schristoscache files.)
26*75f6d617Schristos
27*75f6d617Schristos   If you need to do unusual things to compile the package, please try
28*75f6d617Schristosto figure out how `configure' could check whether to do them, and mail
29*75f6d617Schristosdiffs or instructions to the address given in the `README' so they can
30*75f6d617Schristosbe considered for the next release.  If you are using the cache, and at
31*75f6d617Schristossome point `config.cache' contains results you don't want to keep, you
32*75f6d617Schristosmay remove or edit it.
33*75f6d617Schristos
34*75f6d617Schristos   The file `configure.ac' (or `configure.in') is used to create
35*75f6d617Schristos`configure' by a program called `autoconf'.  You only need
36*75f6d617Schristos`configure.ac' if you want to change it or regenerate `configure' using
37*75f6d617Schristosa newer version of `autoconf'.
38*75f6d617Schristos
39*75f6d617SchristosThe simplest way to compile this package is:
40*75f6d617Schristos
41*75f6d617Schristos  1. `cd' to the directory containing the package's source code and type
42*75f6d617Schristos     `./configure' to configure the package for your system.  If you're
43*75f6d617Schristos     using `csh' on an old version of System V, you might need to type
44*75f6d617Schristos     `sh ./configure' instead to prevent `csh' from trying to execute
45*75f6d617Schristos     `configure' itself.
46*75f6d617Schristos
47*75f6d617Schristos     Running `configure' takes awhile.  While running, it prints some
48*75f6d617Schristos     messages telling which features it is checking for.
49*75f6d617Schristos
50*75f6d617Schristos  2. Type `make' to compile the package.
51*75f6d617Schristos
52*75f6d617Schristos  3. Optionally, type `make check' to run any self-tests that come with
53*75f6d617Schristos     the package.
54*75f6d617Schristos
55*75f6d617Schristos  4. Type `make install' to install the programs and any data files and
56*75f6d617Schristos     documentation.
57*75f6d617Schristos
58*75f6d617Schristos  5. You can remove the program binaries and object files from the
59*75f6d617Schristos     source code directory by typing `make clean'.  To also remove the
60*75f6d617Schristos     files that `configure' created (so you can compile the package for
61*75f6d617Schristos     a different kind of computer), type `make distclean'.  There is
62*75f6d617Schristos     also a `make maintainer-clean' target, but that is intended mainly
63*75f6d617Schristos     for the package's developers.  If you use it, you may have to get
64*75f6d617Schristos     all sorts of other programs in order to regenerate files that came
65*75f6d617Schristos     with the distribution.
66*75f6d617Schristos
67*75f6d617SchristosCompilers and Options
68*75f6d617Schristos=====================
69*75f6d617Schristos
70*75f6d617Schristos   Some systems require unusual options for compilation or linking that
71*75f6d617Schristosthe `configure' script does not know about.  Run `./configure --help'
72*75f6d617Schristosfor details on some of the pertinent environment variables.
73*75f6d617Schristos
74*75f6d617Schristos   You can give `configure' initial values for variables by setting
75*75f6d617Schristosthem in the environment.  You can do that on the command line like this:
76*75f6d617Schristos
77*75f6d617Schristos     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
78*75f6d617Schristos
79*75f6d617Schristos   *Note Defining Variables::, for more details.
80*75f6d617Schristos
81*75f6d617SchristosCompiling For Multiple Architectures
82*75f6d617Schristos====================================
83*75f6d617Schristos
84*75f6d617Schristos   You can compile the package for more than one kind of computer at the
85*75f6d617Schristossame time, by placing the object files for each architecture in their
86*75f6d617Schristosown directory.  To do this, you must use a version of `make' that
87*75f6d617Schristossupports the `VPATH' variable, such as GNU `make'.  `cd' to the
88*75f6d617Schristosdirectory where you want the object files and executables to go and run
89*75f6d617Schristosthe `configure' script.  `configure' automatically checks for the
90*75f6d617Schristossource code in the directory that `configure' is in and in `..'.
91*75f6d617Schristos
92*75f6d617Schristos   If you have to use a `make' that does not support the `VPATH'
93*75f6d617Schristosvariable, you have to compile the package for one architecture at a
94*75f6d617Schristostime in the source code directory.  After you have installed the
95*75f6d617Schristospackage for one architecture, use `make distclean' before reconfiguring
96*75f6d617Schristosfor another architecture.
97*75f6d617Schristos
98*75f6d617SchristosInstallation Names
99*75f6d617Schristos==================
100*75f6d617Schristos
101*75f6d617Schristos   By default, `make install' will install the package's files in
102*75f6d617Schristos`/usr/local/bin', `/usr/local/man', etc.  You can specify an
103*75f6d617Schristosinstallation prefix other than `/usr/local' by giving `configure' the
104*75f6d617Schristosoption `--prefix=PATH'.
105*75f6d617Schristos
106*75f6d617Schristos   You can specify separate installation prefixes for
107*75f6d617Schristosarchitecture-specific files and architecture-independent files.  If you
108*75f6d617Schristosgive `configure' the option `--exec-prefix=PATH', the package will use
109*75f6d617SchristosPATH as the prefix for installing programs and libraries.
110*75f6d617SchristosDocumentation and other data files will still use the regular prefix.
111*75f6d617Schristos
112*75f6d617Schristos   In addition, if you use an unusual directory layout you can give
113*75f6d617Schristosoptions like `--bindir=PATH' to specify different values for particular
114*75f6d617Schristoskinds of files.  Run `configure --help' for a list of the directories
115*75f6d617Schristosyou can set and what kinds of files go in them.
116*75f6d617Schristos
117*75f6d617Schristos   If the package supports it, you can cause programs to be installed
118*75f6d617Schristoswith an extra prefix or suffix on their names by giving `configure' the
119*75f6d617Schristosoption `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
120*75f6d617Schristos
121*75f6d617SchristosOptional Features
122*75f6d617Schristos=================
123*75f6d617Schristos
124*75f6d617Schristos   Some packages pay attention to `--enable-FEATURE' options to
125*75f6d617Schristos`configure', where FEATURE indicates an optional part of the package.
126*75f6d617SchristosThey may also pay attention to `--with-PACKAGE' options, where PACKAGE
127*75f6d617Schristosis something like `gnu-as' or `x' (for the X Window System).  The
128*75f6d617Schristos`README' should mention any `--enable-' and `--with-' options that the
129*75f6d617Schristospackage recognizes.
130*75f6d617Schristos
131*75f6d617Schristos   For packages that use the X Window System, `configure' can usually
132*75f6d617Schristosfind the X include and library files automatically, but if it doesn't,
133*75f6d617Schristosyou can use the `configure' options `--x-includes=DIR' and
134*75f6d617Schristos`--x-libraries=DIR' to specify their locations.
135*75f6d617Schristos
136*75f6d617SchristosSpecifying the System Type
137*75f6d617Schristos==========================
138*75f6d617Schristos
139*75f6d617Schristos   There may be some features `configure' cannot figure out
140*75f6d617Schristosautomatically, but needs to determine by the type of host the package
141*75f6d617Schristoswill run on.  Usually `configure' can figure that out, but if it prints
142*75f6d617Schristosa message saying it cannot guess the host type, give it the
143*75f6d617Schristos`--build=TYPE' option.  TYPE can either be a short name for the system
144*75f6d617Schristostype, such as `sun4', or a canonical name which has the form:
145*75f6d617Schristos
146*75f6d617Schristos     CPU-COMPANY-SYSTEM
147*75f6d617Schristos
148*75f6d617Schristoswhere SYSTEM can have one of these forms:
149*75f6d617Schristos
150*75f6d617Schristos     OS KERNEL-OS
151*75f6d617Schristos
152*75f6d617Schristos   See the file `config.sub' for the possible values of each field.  If
153*75f6d617Schristos`config.sub' isn't included in this package, then this package doesn't
154*75f6d617Schristosneed to know the host type.
155*75f6d617Schristos
156*75f6d617Schristos   If you are _building_ compiler tools for cross-compiling, you should
157*75f6d617Schristosuse the `--target=TYPE' option to select the type of system they will
158*75f6d617Schristosproduce code for.
159*75f6d617Schristos
160*75f6d617Schristos   If you want to _use_ a cross compiler, that generates code for a
161*75f6d617Schristosplatform different from the build platform, you should specify the host
162*75f6d617Schristosplatform (i.e., that on which the generated programs will eventually be
163*75f6d617Schristosrun) with `--host=TYPE'.  In this case, you should also specify the
164*75f6d617Schristosbuild platform with `--build=TYPE', because, in this case, it may not
165*75f6d617Schristosbe possible to guess the build platform (it sometimes involves
166*75f6d617Schristoscompiling and running simple test programs, and this can't be done if
167*75f6d617Schristosthe compiler is a cross compiler).
168*75f6d617Schristos
169*75f6d617SchristosSharing Defaults
170*75f6d617Schristos================
171*75f6d617Schristos
172*75f6d617Schristos   If you want to set default values for `configure' scripts to share,
173*75f6d617Schristosyou can create a site shell script called `config.site' that gives
174*75f6d617Schristosdefault values for variables like `CC', `cache_file', and `prefix'.
175*75f6d617Schristos`configure' looks for `PREFIX/share/config.site' if it exists, then
176*75f6d617Schristos`PREFIX/etc/config.site' if it exists.  Or, you can set the
177*75f6d617Schristos`CONFIG_SITE' environment variable to the location of the site script.
178*75f6d617SchristosA warning: not all `configure' scripts look for a site script.
179*75f6d617Schristos
180*75f6d617SchristosDefining Variables
181*75f6d617Schristos==================
182*75f6d617Schristos
183*75f6d617Schristos   Variables not defined in a site shell script can be set in the
184*75f6d617Schristosenvironment passed to `configure'.  However, some packages may run
185*75f6d617Schristosconfigure again during the build, and the customized values of these
186*75f6d617Schristosvariables may be lost.  In order to avoid this problem, you should set
187*75f6d617Schristosthem in the `configure' command line, using `VAR=value'.  For example:
188*75f6d617Schristos
189*75f6d617Schristos     ./configure CC=/usr/local2/bin/gcc
190*75f6d617Schristos
191*75f6d617Schristoswill cause the specified gcc to be used as the C compiler (unless it is
192*75f6d617Schristosoverridden in the site shell script).
193*75f6d617Schristos
194*75f6d617Schristos`configure' Invocation
195*75f6d617Schristos======================
196*75f6d617Schristos
197*75f6d617Schristos   `configure' recognizes the following options to control how it
198*75f6d617Schristosoperates.
199*75f6d617Schristos
200*75f6d617Schristos`--help'
201*75f6d617Schristos`-h'
202*75f6d617Schristos     Print a summary of the options to `configure', and exit.
203*75f6d617Schristos
204*75f6d617Schristos`--version'
205*75f6d617Schristos`-V'
206*75f6d617Schristos     Print the version of Autoconf used to generate the `configure'
207*75f6d617Schristos     script, and exit.
208*75f6d617Schristos
209*75f6d617Schristos`--cache-file=FILE'
210*75f6d617Schristos     Enable the cache: use and save the results of the tests in FILE,
211*75f6d617Schristos     traditionally `config.cache'.  FILE defaults to `/dev/null' to
212*75f6d617Schristos     disable caching.
213*75f6d617Schristos
214*75f6d617Schristos`--config-cache'
215*75f6d617Schristos`-C'
216*75f6d617Schristos     Alias for `--cache-file=config.cache'.
217*75f6d617Schristos
218*75f6d617Schristos`--quiet'
219*75f6d617Schristos`--silent'
220*75f6d617Schristos`-q'
221*75f6d617Schristos     Do not print messages saying which checks are being made.  To
222*75f6d617Schristos     suppress all normal output, redirect it to `/dev/null' (any error
223*75f6d617Schristos     messages will still be shown).
224*75f6d617Schristos
225*75f6d617Schristos`--srcdir=DIR'
226*75f6d617Schristos     Look for the package's source code in directory DIR.  Usually
227*75f6d617Schristos     `configure' can determine that directory automatically.
228*75f6d617Schristos
229*75f6d617Schristos`configure' also accepts some other, not widely useful, options.  Run
230*75f6d617Schristos`configure --help' for more details.
231*75f6d617Schristos
232