Add missing module dependencies.
[gnulib.git] / doc / install.texi
1 @c This file is included by autoconf.texi and is used to produce
2 @c the INSTALL file.
3
4 @ifclear autoconf
5 @firstparagraphindent insert
6
7 @unnumbered Installation Instructions
8
9 Copyright @copyright{} 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004,
10 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
11
12 This file is free documentation; the Free Software Foundation gives
13 unlimited permission to copy, distribute and modify it.
14
15 @end ifclear
16
17 @node Basic Installation
18 @section Basic Installation
19
20 Briefly, the shell commands @samp{./configure; make; make install}
21 should configure, build, and install this package.  The following
22 more-detailed instructions are generic; see the @file{README} file for
23 instructions specific to this package.
24
25 The @command{configure} shell script attempts to guess correct values
26 for various system-dependent variables used during compilation.  It uses
27 those values to create a @file{Makefile} in each directory of the
28 package.  It may also create one or more @file{.h} files containing
29 system-dependent definitions.  Finally, it creates a shell script
30 @file{config.status} that you can run in the future to recreate the
31 current configuration, and a file @file{config.log} containing compiler
32 output (useful mainly for debugging @command{configure}).
33
34 It can also use an optional file (typically called @file{config.cache}
35 and enabled with @option{--cache-file=config.cache} or simply
36 @option{-C}) that saves the results of its tests to speed up
37 reconfiguring.  Caching is disabled by default to prevent problems with
38 accidental use of stale cache files.
39
40 If you need to do unusual things to compile the package, please try to
41 figure out how @command{configure} could check whether to do them, and
42 mail diffs or instructions to the address given in the @file{README} so
43 they can be considered for the next release.  If you are using the
44 cache, and at some point @file{config.cache} contains results you don't
45 want to keep, you may remove or edit it.
46
47 The file @file{configure.ac} (or @file{configure.in}) is used to create
48 @file{configure} by a program called @code{autoconf}.  You need
49 @file{configure.ac} if you want to change it or regenerate
50 @file{configure} using a newer version of @code{autoconf}.
51
52 @noindent
53 The simplest way to compile this package is:
54
55 @enumerate
56 @item
57 @code{cd} to the directory containing the package's source code and type
58 @samp{./configure} to configure the package for your system.
59
60 Running @command{configure} might take a while.  While running, it prints some
61 messages telling which features it is checking for.
62
63 @item
64 Type @samp{make} to compile the package.
65
66 @item
67 Optionally, type @samp{make check} to run any self-tests that come with
68 the package.
69
70 @item
71 Type @samp{make install} to install the programs and any data files and
72 documentation.
73
74 @item
75 You can remove the program binaries and object files from the source
76 code directory by typing @samp{make clean}.  To also remove the files
77 that @command{configure} created (so you can compile the package for a
78 different kind of computer), type @samp{make distclean}.  There is also
79 a @samp{make maintainer-clean} target, but that is intended mainly for
80 the package's developers.  If you use it, you may have to get all sorts
81 of other programs in order to regenerate files that came with the
82 distribution.
83
84 @item
85 Often, you can also type @samp{make uninstall} to remove the installed
86 files again.
87 @end enumerate
88
89 @node Compilers and Options
90 @section Compilers and Options
91
92 Some systems require unusual options for compilation or linking that the
93 @command{configure} script does not know about.  Run @samp{./configure
94 --help} for details on some of the pertinent environment variables.
95
96 You can give @command{configure} initial values for configuration
97 parameters by setting variables in the command line or in the environment.
98 Here is an example:
99
100 @example
101 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
102 @end example
103
104 @xref{Defining Variables}, for more details.
105
106
107 @node Multiple Architectures
108 @section Compiling For Multiple Architectures
109
110 You can compile the package for more than one kind of computer at the
111 same time, by placing the object files for each architecture in their
112 own directory.  To do this, you can use @acronym{GNU} @command{make}.
113 @command{cd} to the directory where you want the object files and
114 executables to go and run the @command{configure} script.
115 @command{configure} automatically checks for the source code in the
116 directory that @command{configure} is in and in @file{..}.
117
118 With a non-@acronym{GNU} @command{make},
119 it is safer to compile the package for one
120 architecture at a time in the source code directory.  After you have
121 installed the package for one architecture, use @samp{make distclean}
122 before reconfiguring for another architecture.
123
124 On MacOS X 10.5 and later systems, you can create libraries and
125 executables that work on multiple system types---known as @dfn{fat} or
126 @dfn{universal} binaries---by specifying multiple @option{-arch} options
127 to the compiler but only a single @option{-arch} option to the
128 preprocessor.  Like this:
129
130 @example
131 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
132             CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
133             CPP="gcc -E" CXXCPP="g++ -E"
134 @end example
135
136 This is not guaranteed to produce working output in all cases, you may
137 have to build one architecture at a time and combine the results
138 using the @command{lipo} tool if you have problems.
139
140 @node Installation Names
141 @section Installation Names
142
143 By default, @samp{make install} installs the package's commands under
144 @file{/usr/local/bin}, include files under @file{/usr/local/include}, etc.
145 You can specify an
146 installation prefix other than @file{/usr/local} by giving
147 @command{configure} the option @option{--prefix=@var{prefix}}.
148
149 You can specify separate installation prefixes for architecture-specific
150 files and architecture-independent files.  If you pass the option
151 @option{--exec-prefix=@var{prefix}} to @command{configure}, the
152 package uses @var{prefix} as the prefix for installing programs and
153 libraries.  Documentation and other data files still use the
154 regular prefix.
155
156 In addition, if you use an unusual directory layout you can give options
157 like @option{--bindir=@var{dir}} to specify different values for
158 particular kinds of files.  Run @samp{configure --help} for a list of
159 the directories you can set and what kinds of files go in them.
160
161 If the package supports it, you can cause programs to be installed with
162 an extra prefix or suffix on their names by giving @command{configure}
163 the option @option{--program-prefix=@var{PREFIX}} or
164 @option{--program-suffix=@var{SUFFIX}}.
165
166 @node Optional Features
167 @section Optional Features
168
169 Some packages pay attention to @option{--enable-@var{feature}} options
170 to @command{configure}, where @var{feature} indicates an optional part
171 of the package.  They may also pay attention to
172 @option{--with-@var{package}} options, where @var{package} is something
173 like @samp{gnu-as} or @samp{x} (for the X Window System).  The
174 @file{README} should mention any @option{--enable-} and @option{--with-}
175 options that the package recognizes.
176
177 For packages that use the X Window System, @command{configure} can
178 usually find the X include and library files automatically, but if it
179 doesn't, you can use the @command{configure} options
180 @option{--x-includes=@var{dir}} and @option{--x-libraries=@var{dir}} to
181 specify their locations.
182
183 @node Particular Systems
184 @section Particular systems
185
186 On HP-UX, the default C compiler is not ANSI C compatible.  If GNU CC is
187 not installed, it is recommended to use the following options in order to
188 use an ANSI C compiler:
189
190 @example
191 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
192 @end example
193
194 @noindent
195 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
196
197 On OSF/1 a.k.a.@: Tru64, some versions of the default C compiler cannot
198 parse its @code{<wchar.h>} header file.  The option @option{-nodtk} can be
199 used as a workaround.  If GNU CC is not installed, it is therefore
200 recommended to try
201
202 @example
203 ./configure CC="cc"
204 @end example
205
206 @noindent
207 and if that doesn't work, try
208
209 @example
210 ./configure CC="cc -nodtk"
211 @end example
212
213 On Solaris, don't put @code{/usr/ucb} early in your @env{PATH}.  This
214 directory contains several dysfunctional programs; working variants
215 of these programs are available in @code{/usr/bin}.  So, if you need
216 @code{/usr/ucb} in your @env{PATH}, put it @emph{after} @code{/usr/bin}.
217
218 On Haiku, software installed for all users goes in @file{/boot/common},
219 not @file{/usr/local}.  It is recommended to use the following options:
220
221 @example
222 ./configure --prefix=/boot/common
223 @end example
224
225 @node System Type
226 @section Specifying the System Type
227
228 There may be some features @command{configure} cannot figure out
229 automatically, but needs to determine by the type of machine the package
230 will run on.  Usually, assuming the package is built to be run on the
231 @emph{same} architectures, @command{configure} can figure that out, but
232 if it prints a message saying it cannot guess the machine type, give it
233 the @option{--build=@var{type}} option.  @var{type} can either be a
234 short name for the system type, such as @samp{sun4}, or a canonical name
235 which has the form:
236
237 @example
238 @var{cpu}-@var{company}-@var{system}
239 @end example
240
241 @noindent
242 where @var{system} can have one of these forms:
243
244 @example
245 @var{os} @var{kernel}-@var{os}
246 @end example
247
248 See the file @file{config.sub} for the possible values of each field.
249 If @file{config.sub} isn't included in this package, then this package
250 doesn't need to know the machine type.
251
252 If you are @emph{building} compiler tools for cross-compiling, you
253 should use the option @option{--target=@var{type}} to select the type of
254 system they will produce code for.
255
256 If you want to @emph{use} a cross compiler, that generates code for a
257 platform different from the build platform, you should specify the
258 @dfn{host} platform (i.e., that on which the generated programs will
259 eventually be run) with @option{--host=@var{type}}.
260
261 @node Sharing Defaults
262 @section Sharing Defaults
263
264 If you want to set default values for @command{configure} scripts to
265 share, you can create a site shell script called @file{config.site} that
266 gives default values for variables like @code{CC}, @code{cache_file},
267 and @code{prefix}.  @command{configure} looks for
268 @file{@var{prefix}/share/config.site} if it exists, then
269 @file{@var{prefix}/etc/config.site} if it exists.  Or, you can set the
270 @code{CONFIG_SITE} environment variable to the location of the site
271 script.  A warning: not all @command{configure} scripts look for a site
272 script.
273
274 @node Defining Variables
275 @section Defining Variables
276
277 Variables not defined in a site shell script can be set in the
278 environment passed to @command{configure}.  However, some packages may
279 run configure again during the build, and the customized values of these
280 variables may be lost.  In order to avoid this problem, you should set
281 them in the @command{configure} command line, using @samp{VAR=value}.
282 For example:
283
284 @example
285 ./configure CC=/usr/local2/bin/gcc
286 @end example
287
288 @noindent
289 causes the specified @command{gcc} to be used as the C compiler (unless it is
290 overridden in the site shell script).
291
292 @noindent
293 Unfortunately, this technique does not work for @env{CONFIG_SHELL} due
294 to an Autoconf bug.  Until the bug is fixed you can use this
295 workaround:
296
297 @example
298 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
299 @end example
300
301 @node configure Invocation
302 @section @command{configure} Invocation
303
304 @command{configure} recognizes the following options to control how it
305 operates.
306
307 @table @option
308 @item --help
309 @itemx -h
310 Print a summary of all of the options to @command{configure}, and exit.
311
312 @item --help=short
313 @itemx --help=recursive
314 Print a summary of the options unique to this package's
315 @command{configure}, and exit.  The @code{short} variant lists options
316 used only in the top level, while the @code{recursive} variant lists
317 options also present in any nested packages.
318
319 @item --version
320 @itemx -V
321 Print the version of Autoconf used to generate the @command{configure}
322 script, and exit.
323
324 @item --cache-file=@var{file}
325 @cindex Cache, enabling
326 Enable the cache: use and save the results of the tests in @var{file},
327 traditionally @file{config.cache}.  @var{file} defaults to
328 @file{/dev/null} to disable caching.
329
330 @item --config-cache
331 @itemx -C
332 Alias for @option{--cache-file=config.cache}.
333
334 @item --quiet
335 @itemx --silent
336 @itemx -q
337 Do not print messages saying which checks are being made.  To suppress
338 all normal output, redirect it to @file{/dev/null} (any error messages
339 will still be shown).
340
341 @item --srcdir=@var{dir}
342 Look for the package's source code in directory @var{dir}.  Usually
343 @command{configure} can determine that directory automatically.
344
345 @item --prefix=@var{dir}
346 Use @var{dir} as the installation prefix.  @ref{Installation Names}
347 for more details, including other options available for fine-tuning
348 the installation locations.
349
350 @item --no-create
351 @itemx -n
352 Run the configure checks, but stop before creating any output files.
353 @end table
354
355 @noindent
356 @command{configure} also accepts some other, not widely useful, options.
357 Run @samp{configure --help} for more details.
358
359 @c Local Variables:
360 @c fill-column: 72
361 @c ispell-local-dictionary: "american"
362 @c indent-tabs-mode: nil
363 @c whitespace-check-buffer-indent: nil
364 @c End: