lfs/chapter06/zlib-inst.xml
Jeremy Utley adc232404f removed zlib cflags munging
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2754 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
2003-09-09 19:44:47 +00:00

57 lines
2.0 KiB
XML

<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
<sect2>
<title>Installation of Zlib</title>
<para>Zlib has a potential buffer overflow in its gzprintf() function,
that, though difficult to take advantage of, should be taken care of. Do
so by applying this patch:</para>
<para><screen><userinput>patch -Np1 -i ../zlib-&zlib-patch-version;.patch</userinput></screen></para>
<para>Now prepare Zlib for compilation:</para>
<para><screen><userinput>./configure --prefix=/usr --shared</userinput></screen></para>
<para>Note: Zlib is known to build it's shared library incorrectly
if a CFLAGS is specified in the enviornment. If you are using your
own CFLAGS variables, ensure you add the <emphasis role="strong">-fPIC</emphasis>
directive during this stage, and remove it after.</para>
<para>Compile the package:</para>
<para><screen><userinput>make</userinput></screen></para>
<para>Install the shared libraries:</para>
<para><screen><userinput>make install</userinput></screen></para>
<para>Now also build and install the non-shared libraries:</para>
<para><screen><userinput>make clean
./configure --prefix=/usr
make
make test
make install</userinput></screen></para>
<para>The shared Zlib library should be installed in the
<filename>/lib</filename> directory. That way, in the event
that you must boot without the <filename>/usr</filename>
directory, vital system programs will still have access to
the library:</para>
<para><screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen></para>
<para>The <filename>/usr/lib/libz.so</filename> symlink is
linked to a file which no longer exists, because we moved
it. Create a symbolic link to the new location of the
library:</para>
<para><screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen></para>
<para>Zlib does not install its manual page. Issue the
following command to install this documentation:</para>
<para><screen><userinput>cp zlib.3 /usr/share/man/man3</userinput></screen></para>
</sect2>