Installation of the GNU C library is relatively simple, but usually requires several GNU tools to be installed already. (see section Recommended Tools to Install the GNU C Library, below.)
To configure the GNU C library for your system, run the shell script
sh. Use an argument which is the
conventional GNU name for your system configuration--for example,
`sparc-sun-sunos4.1', for a Sun 4 running SunOS 4.1.
See section `Installing GNU CC' in Using and Porting GNU CC, for a full description of standard GNU configuration
names. If you omit the configuration name, `configure' will try to
guess one for you by inspecting the system it is running on. It may or
may not be able to come up with a guess, and the its guess might be
wrong. `configure' will tell you the canonical name of the chosen
configuration before proceeding.
Here are some options that you should specify (if appropriate) when
ldto link programs with the GNU C Library. (We strongly recommend that you do.) This option enables use of features that exist only in GNU
ld; so if you configure for GNU
ldyou must use GNU
ldevery time you link with the GNU C Library, and when building it.
gas, when building the GNU C Library. On some systems, the library may not build properly if you do not use
The simplest way to run
configure is to do it in the directory
that contains the library sources. This prepares to build the library
in that very directory.
You can prepare to build the library in some other directory by going
to that other directory to run
configure. In order to run
configure, you will have to specify a directory for it, like this:
mkdir sun4 cd sun4 ../configure sparc-sun-sunos4.1
configure looks for the sources in whatever directory you
specified for finding
configure itself. It does not matter where
in the file system the source and build directories are--as long as you
specify the source directory when you run
configure, you will get
the proper results.
This feature lets you keep sources and binaries in different
directories, and that makes it easy to build the library for several
different machines from the same set of sources. Simply create a
build directory for each target machine, and run
that directory specifying the target machine's configuration name.
The library has a number of special-purpose configuration parameters. These are defined in the file `Makeconfig'; see the comments in that file for the details.
But don't edit the file `Makeconfig' yourself--instead, create a file `configparms' in the directory where you are building the library, and define in that file the parameters you want to specify. `configparms' should not be an edited copy of `Makeconfig'; specify only the parameters that you want to override. To see how to set these parameters, find the section of `Makeconfig' that says "These are the configuration variables." Then for each parameter that you want to change, copy the definition from `Makeconfig' to your new `configparms' file, and change the value as appropriate for your system.
It is easy to configure the GNU C library for cross-compilation by
setting a few variables in `configparms'. Set
CC to the
cross-compiler for the target you configured the library for; it is
important to use this same
CC value when running
configure, like this: `CC=target-gcc configure
BUILD_CC to the compiler to use for for
programs run on the build system as part of compiling the library. You
may need to set
RANLIB to cross-compiling versions
ranlib if the native tools are not configured to
work with object files for the target you configured for.
Some of the machine-dependent code for some machines uses extensions in the GNU C compiler, so you may need to compile the library with GCC. (In fact, all of the existing complete ports require GCC.)
To build the library and related programs, type
make. This will
produce a lot of output, some of which may look like errors from
make (but isn't). Look for error messages from
containing `***'. Those indicate that something is really wrong.
To build and run some test programs which exercise some of the library
make check. This will produce several files
with names like `program.out'.
To format the GNU C Library Reference Manual for printing, type
make dvi. You need a working TeX installation to do this.
To install the library and its header files, and the Info files of the
make install. This will build things if necessary,
before installing them. If you want to install the files in a different
place than the one specified at configuration time you can specify a
value for the Makefile variable
install_root on the command line.
This is useful to create chroot'ed environment or to prepare binary
Go to the first, previous, next, last section, table of contents.