Add a `--clean' option for autoconf, autoheader, autoreconf and autom4te.
[autoconf/tsuna.git] / doc / install.texi
blobad67b920ddf5cef28a021abaf03b65d84353925d
1 @c This file is included by autoconf.texi and is used to produce
2 @c the INSTALL file.
4 @ifclear autoconf
6 @unnumbered Installation Instructions
8 Copyright @copyright{} 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004,
9 2005, 2006 Free Software Foundation, Inc.
11 This file is free documentation; the Free Software Foundation gives
12 unlimited permission to copy, distribute and modify it.
14 @end ifclear
16 @node Basic Installation
17 @section Basic Installation
19 Briefly, the shell commands @samp{./configure; make; make install}
20 should configure, build, and install this package.  The following
21 more-detailed instructions are generic; see the @file{README} file for
22 instructions specific to this package.
24 The @command{configure} shell script attempts to guess correct values
25 for various system-dependent variables used during compilation.  It uses
26 those values to create a @file{Makefile} in each directory of the
27 package.  It may also create one or more @file{.h} files containing
28 system-dependent definitions.  Finally, it creates a shell script
29 @file{config.status} that you can run in the future to recreate the
30 current configuration, and a file @file{config.log} containing compiler
31 output (useful mainly for debugging @command{configure}).
33 It can also use an optional file (typically called @file{config.cache}
34 and enabled with @option{--cache-file=config.cache} or simply
35 @option{-C}) that saves the results of its tests to speed up
36 reconfiguring.  Caching is disabled by default to prevent problems with
37 accidental use of stale cache files.
39 If you need to do unusual things to compile the package, please try to
40 figure out how @command{configure} could check whether to do them, and
41 mail diffs or instructions to the address given in the @file{README} so
42 they can be considered for the next release.  If you are using the
43 cache, and at some point @file{config.cache} contains results you don't
44 want to keep, you may remove or edit it.
46 The file @file{configure.ac} (or @file{configure.in}) is used to create
47 @file{configure} by a program called @code{autoconf}.  You need
48 @file{configure.ac} if you want to change it or regenerate
49 @file{configure} using a newer version of @code{autoconf}.
51 @noindent
52 The simplest way to compile this package is:
54 @enumerate
55 @item
56 @code{cd} to the directory containing the package's source code and type
57 @samp{./configure} to configure the package for your system.
59 Running @command{configure} might take a while.  While running, it prints some
60 messages telling which features it is checking for.
62 @item
63 Type @samp{make} to compile the package.
65 @item
66 Optionally, type @samp{make check} to run any self-tests that come with
67 the package.
69 @item
70 Type @samp{make install} to install the programs and any data files and
71 documentation.
73 @item
74 You can remove the program binaries and object files from the source
75 code directory by typing @samp{make clean}.  To also remove the files
76 that @command{configure} created (so you can compile the package for a
77 different kind of computer), type @samp{make distclean}.  There is also
78 a @samp{make maintainer-clean} target, but that is intended mainly for
79 the package's developers.  If you use it, you may have to get all sorts
80 of other programs in order to regenerate files that came with the
81 distribution.
83 @item
84 Often, you can also type @samp{make uninstall} to remove the installed
85 files again.
86 @end enumerate
88 @node Compilers and Options
89 @section Compilers and Options
91 Some systems require unusual options for compilation or linking that the
92 @command{configure} script does not know about.  Run @samp{./configure
93 --help} for details on some of the pertinent environment variables.
95 You can give @command{configure} initial values for configuration
96 parameters by setting variables in the command line or in the environment.
97 Here is an example:
99 @example
100 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
101 @end example
103 @xref{Defining Variables}, for more details.
106 @node Multiple Architectures
107 @section Compiling For Multiple Architectures
109 You can compile the package for more than one kind of computer at the
110 same time, by placing the object files for each architecture in their
111 own directory.  To do this, you can use @acronym{GNU} @command{make}.
112 @command{cd} to the directory where you want the object files and
113 executables to go and run the @command{configure} script.
114 @command{configure} automatically checks for the source code in the
115 directory that @command{configure} is in and in @file{..}.
117 With a non-@acronym{GNU} @command{make},
118 it is safer to compile the package for one
119 architecture at a time in the source code directory.  After you have
120 installed the package for one architecture, use @samp{make distclean}
121 before reconfiguring for another architecture.
123 @node Installation Names
124 @section Installation Names
126 By default, @samp{make install} installs the package's commands under
127 @file{/usr/local/bin}, include files under @file{/usr/local/include}, etc.
128 You can specify an
129 installation prefix other than @file{/usr/local} by giving
130 @command{configure} the option @option{--prefix=@var{prefix}}.
132 You can specify separate installation prefixes for architecture-specific
133 files and architecture-independent files.  If you pass the option
134 @option{--exec-prefix=@var{prefix}} to @command{configure}, the
135 package uses @var{prefix} as the prefix for installing programs and
136 libraries.  Documentation and other data files still use the
137 regular prefix.
139 In addition, if you use an unusual directory layout you can give options
140 like @option{--bindir=@var{dir}} to specify different values for
141 particular kinds of files.  Run @samp{configure --help} for a list of
142 the directories you can set and what kinds of files go in them.
144 If the package supports it, you can cause programs to be installed with
145 an extra prefix or suffix on their names by giving @command{configure}
146 the option @option{--program-prefix=@var{PREFIX}} or
147 @option{--program-suffix=@var{SUFFIX}}.
149 @node Optional Features
150 @section Optional Features
152 Some packages pay attention to @option{--enable-@var{feature}} options
153 to @command{configure}, where @var{feature} indicates an optional part
154 of the package.  They may also pay attention to
155 @option{--with-@var{package}} options, where @var{package} is something
156 like @samp{gnu-as} or @samp{x} (for the X Window System).  The
157 @file{README} should mention any @option{--enable-} and @option{--with-}
158 options that the package recognizes.
160 For packages that use the X Window System, @command{configure} can
161 usually find the X include and library files automatically, but if it
162 doesn't, you can use the @command{configure} options
163 @option{--x-includes=@var{dir}} and @option{--x-libraries=@var{dir}} to
164 specify their locations.
166 @node System Type
167 @section Specifying the System Type
169 There may be some features @command{configure} cannot figure out
170 automatically, but needs to determine by the type of machine the package
171 will run on.  Usually, assuming the package is built to be run on the
172 @emph{same} architectures, @command{configure} can figure that out, but
173 if it prints a message saying it cannot guess the machine type, give it
174 the @option{--build=@var{type}} option.  @var{type} can either be a
175 short name for the system type, such as @samp{sun4}, or a canonical name
176 which has the form:
178 @example
179 @var{cpu}-@var{company}-@var{system}
180 @end example
182 @noindent
183 where @var{system} can have one of these forms:
185 @example
186 @var{os} @var{kernel}-@var{os}
187 @end example
189 See the file @file{config.sub} for the possible values of each field.
190 If @file{config.sub} isn't included in this package, then this package
191 doesn't need to know the machine type.
193 If you are @emph{building} compiler tools for cross-compiling, you
194 should use the option @option{--target=@var{type}} to select the type of
195 system they will produce code for.
197 If you want to @emph{use} a cross compiler, that generates code for a
198 platform different from the build platform, you should specify the
199 @dfn{host} platform (i.e., that on which the generated programs will
200 eventually be run) with @option{--host=@var{type}}.
202 @node Sharing Defaults
203 @section Sharing Defaults
205 If you want to set default values for @command{configure} scripts to
206 share, you can create a site shell script called @file{config.site} that
207 gives default values for variables like @code{CC}, @code{cache_file},
208 and @code{prefix}.  @command{configure} looks for
209 @file{@var{prefix}/share/config.site} if it exists, then
210 @file{@var{prefix}/etc/config.site} if it exists.  Or, you can set the
211 @code{CONFIG_SITE} environment variable to the location of the site
212 script.  A warning: not all @command{configure} scripts look for a site
213 script.
215 @node Defining Variables
216 @section Defining Variables
218 Variables not defined in a site shell script can be set in the
219 environment passed to @command{configure}.  However, some packages may
220 run configure again during the build, and the customized values of these
221 variables may be lost.  In order to avoid this problem, you should set
222 them in the @command{configure} command line, using @samp{VAR=value}.
223 For example:
225 @example
226 ./configure CC=/usr/local2/bin/gcc
227 @end example
229 @noindent
230 causes the specified @command{gcc} to be used as the C compiler (unless it is
231 overridden in the site shell script).
233 @noindent
234 Unfortunately, this technique does not work for @env{CONFIG_SHELL} due
235 to an Autoconf bug.  Until the bug is fixed you can use this
236 workaround:
238 @example
239 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
240 @end example
242 @node configure Invocation
243 @section @command{configure} Invocation
245 @command{configure} recognizes the following options to control how it
246 operates.
248 @table @option
249 @item --help
250 @itemx -h
251 Print a summary of the options to @command{configure}, and exit.
253 @item --version
254 @itemx -V
255 Print the version of Autoconf used to generate the @command{configure}
256 script, and exit.
258 @item --cache-file=@var{file}
259 @cindex Cache, enabling
260 Enable the cache: use and save the results of the tests in @var{file},
261 traditionally @file{config.cache}.  @var{file} defaults to
262 @file{/dev/null} to disable caching.
264 @item --config-cache
265 @itemx -C
266 Alias for @option{--cache-file=config.cache}.
268 @item --quiet
269 @itemx --silent
270 @itemx -q
271 Do not print messages saying which checks are being made.  To suppress
272 all normal output, redirect it to @file{/dev/null} (any error messages
273 will still be shown).
275 @item --srcdir=@var{dir}
276 Look for the package's source code in directory @var{dir}.  Usually
277 @command{configure} can determine that directory automatically.
278 @end table
280 @noindent
281 @command{configure} also accepts some other, not widely useful, options.
282 Run @samp{configure --help} for more details.