|
Next
Previous
Contents
5. Installing as the primary C library.
This section covers installing glibc 2 as your primary C library. Any new programs you compile will be linked with this library, unless you use special compile options to link with another version. If you are are using Redhat or Debian and have downloaded the appropriate rpm or deb files, see the Redhat or Debian installion instructions. You can then skip this section.
5.1 Building the library from source.
This section explains how to compile glibc 2 and add-ons from the sources. You must compile the library if you want to change optimization or configuration options or use a package you do not have the binaries for.
Prerequisites.
On an i586@133 with 64 MB of RAM, it takes about 3 hours to compile with full libraries with add-ons. On a loaded i686@200, it takes about half an hour.
Extracting the source.
You need to extract the source from the archives so you can compile it. The best way to do this is:
This will put linuxthreads, crypt, and localedata directories in the
glibc-2.0.6 directory where configure can find these add-ons.
Configuring.
In the
Run ../configure. To use the add-on packages, you need to specify
them with --enable-add-ons, such as --enable-add-ons=linuxthreads,crypt,localedata.
You probably will also want to specify paths where it will be installed.
To match the standard linux distributions, specify --prefix=/usr. (When
a prefix of /usr is specified on a linux system, configure knows to
adjust other paths to place libc.so and other important libraries in
/lib.) The whole configure line would be:
Compiling.
To compile and verify, run:
5.2 Preparing for installation.
Now you need to move some files around to prepare for the new library, whether you are installing from source or binaries. Any new program compiled will be linked to glibc, but old programs which are not statically linked will still depend on libc 5, so you can not just overwrite the old version.
5.3 Installing from the binary package.
If you are installing glibc from precompiled binaries, you first want to check what is in the package before you install the binaries:
If you are happy with that, you can install glibc with:
If you have a different architecture or version, substitute the proper
file names.
The most recent glibc version is generally not available as a binary package, and it is strongly recommended that you run the most recent version to avoid bugs. If you can not build the library yourself, grab a binary package of glibc from one of the distributions that is based on glibc (e.g. RedHat) and install this.
5.4 Installing from the source.
To install the library from source, run as root from the
5.5 Updating the gcc specs.
The final step of the installation (for both binary and source installs)
is to update the gcc
In this case, i486-unknown-linux is the system, and 2.7.2.2 is the version.
You need to copy the
Change into the original directory and version directory
and edit the file
5.6 Testing your installation.
To test the installation, create the following program in a file glibc.c:
and compile the program.
Use ldd to verify the program was linked with glibc2, and not your old libc:
If this compiles and generates "hello world!" when run, the
installation was successful.
Next Previous Contents Linux HOWTO full list |
|
This document, LDP HOWTO-INDEX, is copyrighted (c) 1995 - 2002 by Tim Bynum, Guylhem Aznar, Joshua Drake and Greg Ferguson. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html. If you have questions, please contact the LDP.
Web Design Copyright © 1999-2003. Chrisranjana Software Solutions Pvt Ltd. syndicate rss feed |