Debian Codegraph @

doc/install.texi

raw
1 @c This file is included by autoconf.texi and is used to produce
2 @c the INSTALL file.
3
4 @node Basic Installation
5 @section Basic Installation
6
7 These are generic installation instructions.
8
9 The @code{configure} shell script attempts to guess correct values for
10 various system-dependent variables used during compilation. It uses
11 those values to create a @file{Makefile} in each directory of the
12 package. It may also create one or more @file{.h} files containing
13 system-dependent definitions. Finally, it creates a shell script
14 @file{config.status} that you can run in the future to recreate the
15 current configuration, and a file @file{config.log} containing compiler
16 output (useful mainly for debugging @code{configure}).
17
18 It can also use an optional file (typically called @file{config.cache}
19 and enabled with @option{--cache-file=config.cache} or simply
20 @option{-C}) that saves the results of its tests to speed up
21 reconfiguring. (Caching is disabled by default to prevent problems with
22 accidental use of stale cache files.)
23
24 If you need to do unusual things to compile the package, please try to
25 figure out how @code{configure} could check whether to do them, and mail
26 diffs or instructions to the address given in the @file{README} so they
27 can be considered for the next release. If you are using the cache, and
28 at some point @file{config.cache} contains results you don't want to
29 keep, you may remove or edit it.
30
31 The file @file{configure.ac} (or @file{configure.in}) is used to create
32 @file{configure} by a program called @code{autoconf}. You only need
33 @file{configure.ac} if you want to change it or regenerate
34 @file{configure} using a newer version of @code{autoconf}.
35
36 @noindent
37 The simplest way to compile this package is:
38
39 @enumerate
40 @item
41 @code{cd} to the directory containing the package's source code and type
42 @samp{./configure} to configure the package for your system. If you're
43 using @code{csh} on an old version of System V, you might need to type
44 @samp{sh ./configure} instead to prevent @code{csh} from trying to
45 execute @code{configure} itself.
46
47 Running @code{configure} takes awhile. While running, it prints some
48 messages telling which features it is checking for.
49
50 @item
51 Type @samp{make} to compile the package.
52
53 @item
54 Optionally, type @samp{make check} to run any self-tests that come with
55 the package.
56
57 @item
58 Type @samp{make install} to install the programs and any data files and
59 documentation.
60
61 @item
62 You can remove the program binaries and object files from the source code
63 directory by typing @samp{make clean}. To also remove the files that
64 @code{configure} created (so you can compile the package for a different
65 kind of computer), type @samp{make distclean}. There is also a
66 @samp{make maintainer-clean} target, but that is intended mainly for the
67 package's developers. If you use it, you may have to get all sorts of
68 other programs in order to regenerate files that came with the distribution.
69 @end enumerate
70
71 @node Compilers and Options
72 @section Compilers and Options
73
74 Some systems require unusual options for compilation or linking that the
75 @code{configure} script does not know about. Run @samp{./configure
76 --help} for details on some of the pertinent environment variables.
77
78 You can give @code{configure} initial values for variables by setting
79 them in the environment. You can do that on the command line like this:
80
81 @example
82 ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
83 @end example
84
85 @xref{Environment Variables}, for more details.
86
87
88 @node Multiple Architectures
89 @section Compiling For Multiple Architectures
90
91 You can compile the package for more than one kind of computer at the
92 same time, by placing the object files for each architecture in their
93 own directory. To do this, you must use a version of @code{make} that
94 supports the @code{VPATH} variable, such as GNU @code{make}. @code{cd}
95 to the directory where you want the object files and executables to go
96 and run the @code{configure} script. @code{configure} automatically
97 checks for the source code in the directory that @code{configure} is in
98 and in @file{..}.
99
100 If you have to use a @code{make} that does not support the @code{VPATH}
101 variable, you have to compile the package for one architecture at a time
102 in the source code directory. After you have installed the package for
103 one architecture, use @samp{make distclean} before reconfiguring for
104 another architecture.
105
106 @node Installation Names
107 @section Installation Names
108
109 By default, @samp{make install} will install the package's files in
110 @file{/usr/local/bin}, @file{/usr/local/man}, etc. You can specify an
111 installation prefix other than @file{/usr/local} by giving
112 @code{configure} the option @option{--prefix=@var{path}}.
113
114 You can specify separate installation prefixes for architecture-specific
115 files and architecture-independent files. If you give @code{configure}
116 the option @option{--exec-prefix=@var{path}}, the package will use
117 @var{path} as the prefix for installing programs and libraries.
118 Documentation and other data files will still use the regular prefix.
119
120 In addition, if you use an unusual directory layout you can give options
121 like @option{--bindir=@var{path}} to specify different values for
122 particular kinds of files. Run @samp{configure --help} for a list of
123 the directories you can set and what kinds of files go in them.
124
125 If the package supports it, you can cause programs to be installed with
126 an extra prefix or suffix on their names by giving @code{configure} the
127 option @option{--program-prefix=@var{PREFIX}} or
128 @option{--program-suffix=@var{SUFFIX}}.
129
130 @node Optional Features
131 @section Optional Features
132
133 Some packages pay attention to @option{--enable-@var{feature}} options
134 to @code{configure}, where @var{feature} indicates an optional part of
135 the package. They may also pay attention to
136 @option{--with-@var{package}} options, where @var{package} is something
137 like @samp{gnu-as} or @samp{x} (for the X Window System). The
138 @file{README} should mention any @option{--enable-} and @option{--with-}
139 options that the package recognizes.
140
141 For packages that use the X Window System, @code{configure} can usually
142 find the X include and library files automatically, but if it doesn't,
143 you can use the @code{configure} options @option{--x-includes=@var{dir}}
144 and @option{--x-libraries=@var{dir}} to specify their locations.
145
146 @node System Type
147 @section Specifying the System Type
148
149 There may be some features @code{configure} cannot figure out
150 automatically, but needs to determine by the type of host the package
151 will run on. Usually @code{configure} can figure that out, but if it
152 prints a message saying it cannot guess the host type, give it the
153 @option{--build=@var{type}} option. @var{type} can either be a short
154 name for the system type, such as @samp{sun4}, or a canonical name which
155 has the form:
156
157 @example
158 @var{cpu}-@var{company}-@var{system}
159 @end example
160
161 @noindent
162 where @var{system} can have one of these forms:
163
164 @example
165 @var{os}
166 @var{kernel}-@var{os}
167 @end example
168
169 See the file @file{config.sub} for the possible values of each field.
170 If @file{config.sub} isn't included in this package, then this package
171 doesn't need to know the host type.
172
173 If you are @emph{building} compiler tools for cross-compiling, you should
174 use the @option{--target=@var{type}} option to select the type of system
175 they will produce code for.
176
177 If you want to @emph{use} a cross compiler, that generates code for a
178 platform different from the build platform, you should specify the host
179 platform (i.e., that on which the generated programs will eventually be
180 run) with @option{--host=@var{type}}. In this case, you should also
181 specify the build platform with @option{--build=@var{type}}, because, in
182 this case, it may not be possible to guess the build platform (it
183 sometimes involves compiling and running simple test programs, and this
184 can't be done if the compiler is a cross compiler).
185
186 @node Sharing Defaults
187 @section Sharing Defaults
188
189 If you want to set default values for @code{configure} scripts to share,
190 you can create a site shell script called @file{config.site} that gives
191 default values for variables like @code{CC}, @code{cache_file}, and
192 @code{prefix}. @code{configure} looks for
193 @file{@var{prefix}/share/config.site} if it exists, then
194 @file{@var{prefix}/etc/config.site} if it exists. Or, you can set the
195 @code{CONFIG_SITE} environment variable to the location of the site
196 script. A warning: not all @code{configure} scripts look for a site
197 script.
198
199 @node Environment Variables
200 @section Environment Variables
201
202 Variables not defined in a site shell script can be set in the
203 environment passed to configure. However, some packages may run
204 configure again during the build, and the customized values of these
205 variables may be lost. In order to avoid this problem, you should set
206 them in the @code{configure} command line, using @samp{VAR=value}. For
207 example:
208
209 @example
210 ./configure CC=/usr/local2/bin/gcc
211 @end example
212
213 @noindent
214 will cause the specified gcc to be used as the C compiler (unless it is
215 overridden in the site shell script).
216
217
218 @node configure Invocation
219 @section @code{configure} Invocation
220
221 @code{configure} recognizes the following options to control how it
222 operates.
223
224 @table @option
225 @item --help
226 @itemx -h
227 Print a summary of the options to @code{configure}, and exit.
228
229 @item --version
230 @itemx -V
231 Print the version of Autoconf used to generate the @code{configure}
232 script, and exit.
233
234 @item --cache-file=@var{file}
235 @cindex Cache, enabling
236 Enable the cache: use and save the results of the tests in @var{file},
237 traditionally @file{config.cache}. @var{file} defaults to
238 @file{/dev/null} to disable caching.
239
240 @item --config-cache
241 @itemx -C
242 Alias for @option{--cache-file=config.cache}.
243
244 @item --quiet
245 @itemx --silent
246 @itemx -q
247 Do not print messages saying which checks are being made. To suppress
248 all normal output, redirect it to @file{/dev/null} (any error messages
249 will still be shown).
250
251 @item --srcdir=@var{dir}
252 Look for the package's source code in directory @var{dir}. Usually
253 @code{configure} can determine that directory automatically.
254 @end table
255
256 @noindent
257 @code{configure} also accepts some other, not widely useful, options.
258 Run @samp{configure --help} for more details.