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