Glibc installation
The Glibc build system is very well self-contained and will install
perfectly, even though our compiler specs file and linker scripts are still
pointing at /tools. We cannot adjust the specs and
ldscripts before the Glibc install, because the Glibc autoconf tests would then
give bogus results and thus defeat our goal of achieving a clean build.
Before starting to build Glibc, remember to unpack the Glibc-linuxthreads
again inside the glibc-&glibc-version; directory, and to
unset any environment variables that override the default optimization
flags.
Then apply the same patch we used previously:
patch -Np1 -i ../glibc-2.3.2-sscanf-1.patch
The documentation that comes with Glibc recommends to build the package
not in the source directory but in a separate, dedicated directory:
mkdir ../glibc-build
cd ../glibc-build
Now prepare Glibc for compilation:
../glibc-&glibc-version;/configure --prefix=/usr \
--disable-profile --enable-add-ons \
--libexecdir=/usr/bin --with-headers=/usr/include
The meaning of the configure options:
--disable-profile: This disables the
building of the libraries with profiling information. Omit this option if you
plan to do profiling.
--enable-add-ons: This enables any
add-ons that we installed with Glibc, in our case Linuxthreads.
--libexecdir=/usr/bin: This will
cause the pt_chown program to be installed in the
/usr/bin directory.
--with-headers=/usr/include: This
ensures that the kernel headers in /usr/include are used
for this build. If you don't pass this switch then the headers from
/tools/include are used which of course is not ideal
(although they should be identical). Using the switch has the advantage
that you will be informed immediately should you have forgotten to install the
kernel headers into /usr/include.
Compile the package:
make
Test the results:
make check
And install the package:
make install
The locales that can make your system respond in a different language
weren't installed by the above command. Do it with this:
make localedata/install-locales
An alternative to running the previous command is to install only those
locales which you need or want. This can be achieved using the
localedef command. Information on this can be found in
the INSTALL file in the
glibc-&glibc-version; tree.
Finally, build the linuxthreads man pages:
make -C ../glibc-2.3.2/linuxthreads/man
And install these pages:
make -C ../glibc-2.3.2/linuxthreads/man install