Update.
[glibc.git] / manual / install.texi
blob716c2b9f46d60ef93ba353fed4c09f7cf8346b7a
1 @c This is for making the `INSTALL' file for the distribution.
2 @c Makeinfo ignores it when processing the file from the include.
3 @setfilename INSTALL
5 @node Installation, Maintenance, Library Summary, Top
6 @appendix Installing the GNU C Library
8 @menu
9 * Tools for Installation::      We recommend using these tools to build.
10 * Supported Configurations::    What systems the GNU C library runs on.
11 * Tips for Installation::       Useful hints for the installation.
12 * Reporting Bugs::              How to report bugs (if you want to
13                                 get them fixed) and other troubles
14                                 you may have with the GNU C library.
15 @end menu
17 Installation of the GNU C library is relatively simple, but usually
18 requires several GNU tools to be installed already.
19 @iftex
20 (@pxref{Tools for Installation}, below.)
21 @end iftex
23 Before you do anything else, you should read the file @file{FAQ} found
24 at the top level of the source tree.  This file answers common questions
25 and describes problems you may experience with compilation and
26 installation.  It is updated more frequently than this manual.
28 To configure the GNU C library for your system, run the shell script
29 @file{configure} with @code{sh}.  You might use an argument which is the
30 conventional GNU name for your system configuration---for example,
31 @samp{i486-pc-linux-gnu}, for Linux running on i486.
32 @xref{Installation, Installation, Installing GNU CC, gcc.info, Using and
33 Porting GNU CC}, for a full description of standard GNU configuration
34 names.  If you omit the configuration name, @file{configure} will try to
35 guess one for you by inspecting the system it is running on.  It may or
36 may not be able to come up with a guess, and the guess might be
37 wrong.  @file{configure} will tell you the canonical name of the chosen
38 configuration before proceeding.
40 Here are some options that you should specify (if appropriate) when
41 you run @code{configure}:
43 @table @samp
44 @item --with-binutils=@var{directory}
45 Use the binutils (assembler and linker) in @file{@var{directory}}, not
46 the ones the C compiler would default to.  You could use this option if
47 the default binutils on your system cannot deal with all the constructs
48 in the GNU C library.  (@code{configure} will detect the problem and
49 suppress these constructs, so the library will still be usable, but
50 functionality may be lost---for example, you can not build a shared libc
51 with old binutils.)
53 @c extra blank line makes it look better
54 @item --without-fp
55 @itemx --nfp
57 Use this option if your computer lacks hardware floating-point support
58 and your operating system does not emulate an FPU.
60 @item --prefix=@var{directory}
61 Install machine-independent data files in subdirectories of
62 @file{@var{directory}}.  (You can also set this in @file{configparms};
63 see below.)  The default is to install in `/usr/local'.
65 @item --exec-prefix=@var{directory}
66 Install the library and other machine-dependent files in subdirectories
67 of @file{@var{directory}}.  (You can also set this in
68 @file{configparms}; see below.)  The default is to use <prefix>/bin
69 and <prefix>/sbin.
71 @item --enable-shared
72 @itemx --disable-shared
73 Enable or disable building of an ELF shared library on systems that
74 support it.  The default is to build the shared library on systems using
75 ELF when the GNU @code{binutils} are available.
77 @item --enable-profile
78 @itemx --disable-profile
79 Enable or disable building of the profiled C library, @samp{-lc_p}.  The
80 default is to build the profiled library.  You may wish to disable it if
81 you don't plan to do profiling, because it doubles the build time of
82 compiling just the unprofiled static library.
84 @item --enable-omitfp
85 Enable building a highly-optimized but possibly undebuggable C
86 library.  This causes the normal static and shared (if enabled) C
87 libraries to be compiled with maximal optimization, including the
88 @samp{-fomit-frame-pointer} switch that makes debugging impossible on
89 many machines, and without debugging information (which makes the
90 binaries substantially smaller).  An additional static library is
91 compiled with no optimization and full debugging information, and
92 installed as @samp{-lc_g}.
94 @item --enable-add-ons[=LIST]
95 Certain components of the C library are distributed separately from the
96 rest of the sources.  In particular, the @code{crypt} function and its
97 friends are separated due to US export control regulations, and the
98 threading support code for Linux is maintained separately.  You can get
99 these @dfn{add-on} packages from the same place you got the libc
100 sources.  To use them, unpack them into your source tree, and give
101 @code{configure} the @samp{--enable-add-ons} option.
103 If you do not wish to use some add-on package that you have present in
104 your source tree, give this option a list of the add-ons that you
105 @emph{do} want used, like this: @samp{--enable-add-ons=crypt,linuxthreads}
107 @item --with-headers=DIRECTORY
108 Search only DIRECTORY and the C compiler's private directory for header
109 files not found in the libc sources.  @file{/usr/include} will not be
110 searched if this option is given.  On Linux, DIRECTORY should be the
111 kernel's private include directory (usually
112 @file{/usr/src/linux/include}).
114 This option is primarily of use on a system where the headers in
115 @file{/usr/include} come from an older version of glibc.  Conflicts can
116 occasionally happen in this case.  Note that Linux libc5 qualifies as an
117 older version of glibc.  You can also use this option if you want to
118 compile glibc with a newer set of kernel headers than the ones found in
119 @file{/usr/include}.
120 @end table
122 You should not build the library in the same directory as the sources,
123 because there are bugs in @code{make clean}.  Make a directory for the
124 build, and run @code{configure} from that directory, like this:
126 @smallexample
127 mkdir linux
128 cd linux
129 ../configure
130 @end smallexample
132 @noindent
133 @code{configure} looks for the sources in whatever directory you
134 specified for finding @code{configure} itself.  It does not matter where
135 in the file system the source and build directories are---as long as you
136 specify the source directory when you run @code{configure}, you will get
137 the proper results.
139 This feature lets you keep sources and binaries in different
140 directories, and that makes it easy to build the library for several
141 different machines from the same set of sources.  Simply create a
142 build directory for each target machine, and run @code{configure} in
143 that directory specifying the target machine's configuration name.
145 The library has a number of special-purpose configuration parameters.
146 These are defined in the file @file{configparms}; see the comments in
147 that file for the details.  To change them, copy @file{configparms} into
148 your build directory and modify it as appropriate for your system.
149 @code{configure} will not notice your modifications if you change the
150 file in the source directory.
152 It is easy to configure the GNU C library for cross-compilation by
153 setting a few variables in @file{configparms}.  Set @code{CC} to the
154 cross-compiler for the target you configured the library for; it is
155 important to use this same @code{CC} value when running
156 @code{configure}, like this: @samp{CC=@var{target}-gcc configure
157 @var{target}}.  Set @code{BUILD_CC} to the compiler to use for for
158 programs run on the build system as part of compiling the library.  You
159 may need to set @code{AR} and @code{RANLIB} to cross-compiling versions
160 of @code{ar} and @code{ranlib} if the native tools are not configured to
161 work with object files for the target you configured for.
163 Some of the machine-dependent code for some machines uses extensions in
164 the GNU C compiler, so you may need to compile the library with GCC.
165 (In fact, all of the existing complete ports require GCC.)
167 To build the library and related programs, type @code{make}.  This will
168 produce a lot of output, some of which may look like errors from
169 @code{make} (but isn't).  Look for error messages from @code{make}
170 containing @samp{***}.  Those indicate that something is really wrong.
172 The compilation process takes several hours even on fast hardware;
173 expect at least two hours for the default configuration on i586 for
174 Linux.  For Hurd times are much longer.  All current releases of GCC
175 have a problem which causes them to take several minutes to compile
176 certain files in the iconvdata directory.  Do not panic if the compiler
177 appears to hang.
179 To build and run some test programs which exercise some of the library
180 facilities, type @code{make check}.  This will produce several files
181 with names like @file{@var{program}.out}.
183 To format the @cite{GNU C Library Reference Manual} for printing, type
184 @w{@code{make dvi}}.  You need a working @TeX{} installation to do this.
186 To install the library and its header files, and the Info files of the
187 manual, type @code{make install}.  This will build things if necessary,
188 before installing them.  If you want to install the files in a different
189 place than the one specified at configuration time you can specify a
190 value for the Makefile variable @code{install_root} on the command line.
191 This is useful to create chroot'ed environment or to prepare binary
192 releases.@refill
194 For now (in this alpha version, and at least on RedHat Linux), if you
195 are trying to install this as your default libraries, a different
196 installation method is recommended.  Move @file{/usr/include} out of the
197 way, create a new @file{/usr/include} directory (don't forget the
198 symlinks @file{/usr/include/asm} and @file{/usr/include/linux}, that
199 should point to @file{/usr/src/linux/include/asm} and
200 @file{/usr/src/linux/include/linux} -or wherever you keep your kernel
201 sources-respectively), build normally and install into somewhere else
202 via @code{install_root}. Then move your @code{/usr/include} back, and
203 copy the newly created stuff by hand over the old. Remember to copy
204 programs and shared libraries into @file{FILENAME.new} and then move
205 @file{FILENAME.new} to @file{FILENAME}, as the files might be in
206 use. You will have to @code{ranlib} your copies of the static libraries
207 @file{/usr/lib/libNAME.a}. You will see that @file{libbsd-compat.a},
208 @file{libieee.a}, and @file{libmcheck.a} are just object files, not
209 archives. This is normal.  Copy the new header files over the old ones
210 by something like @w{@code{cd /usr; (cd INSTALL_ROOT; tar cf - include) |
211 tar xf -}}.
213 @node Tools for Installation
214 @appendixsec Recommended Tools to Install the GNU C Library
215 @cindex installation tools
216 @cindex tools, for installing library
218 We recommend installing the following GNU tools before attempting to
219 build the GNU C library:
221 @itemize @bullet
222 @item
223 GNU @code{make} 3.75
225 You need the latest version of GNU @code{make}.  Modifying the GNU C
226 Library to work with other @code{make} programs would be so hard that we
227 recommend you port GNU @code{make} instead.  @strong{Really.}  We
228 recommend version GNU @code{make} version 3.75.  Versions 3.76 and
229 3.76.1 are known to have bugs which only show up in big projects like
230 GNU @code{libc}.
232 @item
233 GCC 2.8.1/EGCS 1.0.2
235 On most platforms, the GNU C library can only be compiled with the GNU C
236 compiler family.  We recommend GCC version 2.8.1 and EGCS version 1.0.2
237 or later versions of these two; earlier versions may have problems.
239 @item
240 GNU @code{binutils} 2.8.1.0.23
242 Using the GNU @code{binutils} (assembler, linker, and related tools) is
243 preferable when possible, and they are required to build an ELF shared C
244 library.  Version 2.1 of the library uses ELF symbol versioning
245 extensively.  Support for this feature is incomplete or buggy before
246 binutils 2.8.1.0.23, so you must use at least this version.
248 @item
249 GNU @code{texinfo} 3.11
251 To correctly translate and install the Texinfo documentation you need
252 this version of the @code{texinfo} package.  Earlier versions do not
253 understand all the tags used in the document, and the installation
254 mechanisms for the info files is not present or works differently.
256 On some Debian Linux based systems the @code{install-info} program
257 supplied with the system works differently from the one we expect.  You
258 must therefore run @code{make install} like this:
260 @smallexample
261 make INSTALL_INFO=/path/to/GNU/install-info install
262 @end smallexample
264 @item
265 GNU @code{awk} 3.0
267 Several files used during the build are generated using features of GNU
268 @code{awk} that are not found in other implementations.
269 @c XXX: Does mawk work?
270 @end itemize
272 @noindent
273 If you change any of the @file{configure.in} files you will also need
275 @itemize @bullet
276 @item
277 GNU @code{autoconf} 2.12
278 @end itemize
280 @noindent
281 and if you change any of the message translation files you will need
283 @itemize @bullet
284 @item
285 GNU @code{gettext} 0.10 or later
286 @end itemize
288 @noindent
289 You may also need these packages if you upgrade your source tree using
290 patches, although we try to avoid this.
293 @node Supported Configurations
294 @appendixsec Supported Configurations
295 @cindex configurations, all supported
297 The GNU C Library currently supports configurations that match the
298 following patterns:
300 @smallexample
301 alpha-@var{anything}-linux
302 arm-@var{anything}-linuxaout
303 arm-@var{anything}-none
304 i@var{x}86-@var{anything}-gnu
305 i@var{x}86-@var{anything}-linux
306 m68k-@var{anything}-linux
307 powerpc-@var{anything}-linux
308 sparc-@var{anything}-linux
309 sparc64-@var{anything}-linux
310 @end smallexample
312 Former releases of this library (version 1.09.1 and perhaps earlier
313 versions) used to run on the following configurations:
315 @smallexample
316 alpha-dec-osf1
317 alpha-@var{anything}-linuxecoff
318 i@var{x}86-@var{anything}-bsd4.3
319 i@var{x}86-@var{anything}-isc2.2
320 i@var{x}86-@var{anything}-isc3.@var{n}
321 i@var{x}86-@var{anything}-sco3.2
322 i@var{x}86-@var{anything}-sco3.2v4
323 i@var{x}86-@var{anything}-sysv
324 i@var{x}86-@var{anything}-sysv4
325 i@var{x}86-force_cpu386-none
326 i@var{x}86-sequent-bsd
327 i960-nindy960-none
328 m68k-hp-bsd4.3
329 m68k-mvme135-none
330 m68k-mvme136-none
331 m68k-sony-newsos3
332 m68k-sony-newsos4
333 m68k-sun-sunos4.@var{n}
334 mips-dec-ultrix4.@var{n}
335 mips-sgi-irix4.@var{n}
336 sparc-sun-solaris2.@var{n}
337 sparc-sun-sunos4.@var{n}
338 @end smallexample
340 Since no one has volunteered to test and fix these configurations,
341 they are not supported at the moment.  They probably don't compile;
342 they definitely don't work anymore.  Porting the library is not hard.
343 If you are interested in doing a port, please contact the glibc
344 maintainers by sending electronic mail to @email{bug-glibc@@gnu.org}.
346 Each case of @samp{i@var{x}86} can be @samp{i386}, @samp{i486},
347 @samp{i586}, or @samp{i686}.  All of those configurations produce a
348 library that can run on any of these processors.  The library will be
349 optimized for the specified processor, but will not use instructions not
350 available on all of them.
352 While no other configurations are supported, there are handy aliases for
353 these few.  (These aliases work in other GNU software as well.)
355 @smallexample
356 decstation
357 hp320-bsd4.3 hp300bsd
358 i486-gnu
359 i586-linux
360 i386-sco
361 i386-sco3.2v4
362 i386-sequent-dynix
363 i386-svr4
364 news
365 sun3-sunos4.@var{n} sun3
366 sun4-solaris2.@var{n} sun4-sunos5.@var{n}
367 sun4-sunos4.@var{n} sun4
368 @end smallexample
370 @node Tips for Installation
371 @appendixsec Useful hints for the installation
373 There are a some more or less obvious methods one should know when
374 compiling GNU libc:
376 @itemize @bullet
377 @item
378 Better never compile in the source directory.  Create a new directory
379 and run the @file{configure} from there.  Everything should happen
380 automagically.
382 @item
383 You can use the @code{-j} option of GNU make by changing the line
384 specifying @code{PARALLELMAKE} in the Makefile generated during the
385 configuration.
387 It is not useful to start the @code{make} process using the @code{-j}
388 option since this option is not propagated down to the sub-@code{make}s.
390 @item
391 If you made some changes after a complete build and only want to check
392 these changes run @code{make} while specifying the list of subdirs it
393 has to visit.
395 @smallexample
396 make subdirs="nss elf"
397 @end smallexample
399 The above build run will only visit the subdirectories @file{nss} and
400 @file{elf}.  Beside this it updates the @file{libc} files itself.
401 @end itemize
403 @node Reporting Bugs
404 @appendixsec Reporting Bugs
405 @cindex reporting bugs
406 @cindex bugs, reporting
408 There are probably bugs in the GNU C library.  There are certainly
409 errors and omissions in this manual.  If you report them, they will get
410 fixed.  If you don't, no one will ever know about them and they will
411 remain unfixed for all eternity, if not longer.
413 To report a bug, first you must find it.  Hopefully, this will be the
414 hard part.  Once you've found a bug, make sure it's really a bug.  A
415 good way to do this is to see if the GNU C library behaves the same way
416 some other C library does.  If so, probably you are wrong and the
417 libraries are right (but not necessarily).  If not, one of the libraries
418 is probably wrong.
420 Once you're sure you've found a bug, try to narrow it down to the
421 smallest test case that reproduces the problem.  In the case of a C
422 library, you really only need to narrow it down to one library
423 function call, if possible.  This should not be too difficult.
425 The final step when you have a simple test case is to report the bug.
426 When reporting a bug, send your test case, the results you got, the
427 results you expected, what you think the problem might be (if you've
428 thought of anything), your system type, and the version of the GNU C
429 library which you are using.  Also include the files
430 @file{config.status} and @file{config.make} which are created by running
431 @file{configure}; they will be in whatever directory was current when
432 you ran @file{configure}.
434 If you think you have found some way in which the GNU C library does not
435 conform to the ISO and POSIX standards (@pxref{Standards and
436 Portability}), that is definitely a bug.  Report it!@refill
438 Send bug reports to the Internet address @email{bug-glibc@@gnu.org}
439 using the @code{glibcbug} script which is installed by the GNU C
440 library.  If you have other problems with installation or use, please
441 report those as well.@refill
443 If you are not sure how a function should behave, and this manual
444 doesn't tell you, that's a bug in the manual.  Report that too!  If the
445 function's behavior disagrees with the manual, then either the library
446 or the manual has a bug, so report the disagreement.  If you find any
447 errors or omissions in this manual, please report them to the Internet
448 address @email{bug-glibc-manual@@gnu.org}.  If you refer to specific
449 sections when reporting on the manual, please include the section names
450 for easier identification.