LDP/LDP/retired/LFS/chapter06/glibc-inst.xml

73 lines
3.2 KiB
XML

<sect2>
<title>Installation of Glibc</title>
<para>This package requires its patch to be applied before you can
install it. Make sure it's unpacked before running the installation
commands.</para>
<para>Before starting to install glibc, you must cd into the
glibc-&glibc-version; directory and unpack glibc-linuxthreads inside
the glibc-&glibc-version; directory, not in /usr/src as you normally
would do.</para>
<para>This package is known to behave badly when you have changed its
default optimization flags (including the -march and -mcpu options). Glibc
is best left alone. Therefore, if you have defined any environment variables
that override default optimizations, such as CFLAGS and CXXFLAGS, we
recommend unsetting or modifying them when building Glibc. You have
been warned.</para>
<para>Also, don't pass the --enable-kernel option to the configure
script. It's known to cause segmentation faults when other packages like
fileutils, make and tar are linked against it.</para>
<para>Basically, compiling Glibc in any other way than the book suggests
is putting your system at very high risk.</para>
<para>Install Glibc by running the following commands:</para>
<para><screen><userinput>patch -Np1 -i ../glibc-&glibc-patch-version;.patch &amp;&amp;
touch /etc/ld.so.conf &amp;&amp;
mkdir ../glibc-build &amp;&amp;
cd ../glibc-build &amp;&amp;
../glibc-&glibc-version;/configure --prefix=/usr --disable-profile \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-add-ons --libexecdir=/usr/bin &amp;&amp;
echo "cross-compiling = no" &gt; configparms &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
make localedata/install-locales &amp;&amp;
exec /static/bin/bash --login</userinput></screen></para>
<para>An alternative to running <userinput>make
localedata/install-locales</userinput> is to only install 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. One thing to note is that the
<userinput>localedef</userinput> program assumes that the <filename
class="directory">/usr/lib/locale</filename> directory exists, so you need
to create it first.</para>
<para>The Linux Threads man pages are not going to be installed at this
point because it requires a working Perl installation. We'll install Perl
later on in this chapter, so we'll come back to the Linux Threads man page
installation after that.</para>
<para>During the configure stage you will see the following warning:</para>
<blockquote><screen>configure: warning:
*** These auxiliary programs are missing or too old: msgfmt
*** some features will be disabled.
*** Check the INSTALL file for required versions.</screen></blockquote>
<para>The missing msgfmt (from the gettext package which we will install
later in this chapter) won't cause any problems. msgfmt is used to generate
the binary translation files that are used to make your system talk in a
different language. Because these translation files have already been
generated for you, there is no need for msgfmt. You'd only need msgfmt if
you change the translation source files (the <filename>*.po</filename>
files in the <filename class="directory">po</filename> subdirectory) which
would require you to re-generate the binary files.</para>
</sect2>