source: chapter06/zlib.xml@ 1caa48e

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 12.2 12.2-rc1 6.0 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk v5_1 v5_1_1 xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 1caa48e was dfddb12, checked in by Greg Schafer <greg@…>, 21 years ago

Upgraded to Lfs-Utils-0.4.2, Tcl-8.4.5 and Zlib-1.2.1. Obsoletes the Zlib Vsnprintf patch.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3128 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.7 KB
Line 
1<sect1 id="ch06-zlib">
2<title>Installing Zlib-&zlib-version;</title>
3<?dbhtml filename="zlib.html" dir="chapter06"?>
4
5<screen>Estimated build time: &zlib-time;
6Estimated required disk space: &zlib-compsize;</screen>
7
8&aa-zlib-shortdesc;
9&aa-zlib-dep;
10
11<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
12
13<sect2>
14<title>Installation of Zlib</title>
15
16<para>Prepare Zlib for compilation:</para>
17
18<screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
19
20<note><para>Zlib is known to build its shared library incorrectly if CFLAGS is
21specified in the environment. If you are using your own CFLAGS variable, be
22sure to add the <emphasis role="strong">-fPIC</emphasis> directive to your
23CFLAGS for the duration of the above command, then remove it
24afterwards.</para></note>
25
26<para>Compile the package:</para>
27
28<screen><userinput>make</userinput></screen>
29
30<para>This package has a test suite available which can perform a number of
31checks to ensure it built correctly. The test suite for Zlib is quick and
32painless so we recommend it be run. The following command will test the shared
33library:</para>
34
35<screen><userinput>make check</userinput></screen>
36
37<para>Install the shared library:</para>
38
39<screen><userinput>make install</userinput></screen>
40
41<para>Now also build the non-shared (static) library:</para>
42<screen><userinput>make clean
43./configure --prefix=/usr
44make</userinput></screen>
45
46<para>The following command will test the static library:</para>
47
48<screen><userinput>make check</userinput></screen>
49
50<para>And install the package:</para>
51
52<screen><userinput>make install</userinput></screen>
53
54<para>It is good policy and common practice to place important libraries into
55the <filename class="directory">/lib</filename> directory. This matters most
56in scenarios where <filename class="directory">/usr</filename> is on a
57separate partition. Essentially, the run-time components of any libraries
58depended upon by programs in <filename class="directory">/bin</filename> or
59<filename class="directory">/sbin</filename> should reside in
60<filename class="directory">/lib</filename> so that they are on the root
61partition and available in the event of
62<filename class="directory">/usr</filename> being inaccessible.</para>
63
64<para>Therefore we move the run-time components of the shared Zlib into
65<filename class="directory">/lib</filename> by issuing the following
66command:</para>
67
68<screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
69
70<para>Now we need to fix up the <filename>/usr/lib/libz.so</filename> symlink
71because we just moved the location of the file it points to:</para>
72
73<screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
74
75</sect2>
76
77</sect1>
78
Note: See TracBrowser for help on using the repository browser.