1 | <sect1 id="ch-system-zlib" xreflabel="Zlib">
|
---|
2 | <title>Installing Zlib-&zlib-version;</title>
|
---|
3 | <?dbhtml filename="zlib.html" dir="chapter06"?>
|
---|
4 |
|
---|
5 | <para>The Zlib package contains compression and uncompression routines used by
|
---|
6 | some programs.</para>
|
---|
7 |
|
---|
8 | <screen>&buildtime; &zlib-time;
|
---|
9 | &diskspace; &zlib-compsize;</screen>
|
---|
10 |
|
---|
11 | &aa-zlib-down;
|
---|
12 | &aa-zlib-dep;
|
---|
13 |
|
---|
14 | <sect2><title> </title><para> </para></sect2>
|
---|
15 |
|
---|
16 | <sect2>
|
---|
17 | <title>Installation of Zlib</title>
|
---|
18 |
|
---|
19 | <note><para>Zlib is known to build its shared library incorrectly if CFLAGS is
|
---|
20 | specified in the environment. If you are using your own CFLAGS variable, be
|
---|
21 | sure to add the <emphasis>-fPIC</emphasis> directive to your CFLAGS for the
|
---|
22 | duration of the below <command>configure</command> command, then remove it
|
---|
23 | afterwards.</para></note>
|
---|
24 |
|
---|
25 | <para>Prepare Zlib for compilation:</para>
|
---|
26 |
|
---|
27 | <screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
|
---|
28 |
|
---|
29 | <para>Compile the package:</para>
|
---|
30 |
|
---|
31 | <screen><userinput>make</userinput></screen>
|
---|
32 |
|
---|
33 | <para>To have the results tested, issue:
|
---|
34 | <userinput>make check</userinput>.</para>
|
---|
35 |
|
---|
36 | <para>Install the shared library:</para>
|
---|
37 |
|
---|
38 | <screen><userinput>make install</userinput></screen>
|
---|
39 |
|
---|
40 | <para>Now also build the non-shared (static) library:</para>
|
---|
41 | <screen><userinput>make clean
|
---|
42 | ./configure --prefix=/usr
|
---|
43 | make</userinput></screen>
|
---|
44 |
|
---|
45 | <para>To have the results tested again, issue:
|
---|
46 | <userinput>make check</userinput>.</para>
|
---|
47 |
|
---|
48 | <para>Install the static library:</para>
|
---|
49 |
|
---|
50 | <screen><userinput>make install</userinput></screen>
|
---|
51 |
|
---|
52 | <para>And fix the permissions on the static library:</para>
|
---|
53 |
|
---|
54 | <screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
|
---|
55 |
|
---|
56 | <para>It is good policy and common practice to place important libraries into
|
---|
57 | the <filename class="directory">/lib</filename> directory. This matters most
|
---|
58 | in scenarios where <filename class="directory">/usr</filename> is on a
|
---|
59 | separate partition. Essentially, the run-time components of any libraries that
|
---|
60 | are used by programs in <filename class="directory">/bin</filename> or
|
---|
61 | <filename class="directory">/sbin</filename> should reside in
|
---|
62 | <filename class="directory">/lib</filename> so that they are on the root
|
---|
63 | partition and available in the event of
|
---|
64 | <filename class="directory">/usr</filename> being inaccessible.</para>
|
---|
65 |
|
---|
66 | <para>For the above reason we move the run-time components of the shared Zlib
|
---|
67 | into <filename class="directory">/lib</filename>:</para>
|
---|
68 |
|
---|
69 | <screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
|
---|
70 |
|
---|
71 | <para>Now we need to fix the <filename>/usr/lib/libz.so</filename> symlink
|
---|
72 | because we just moved the file it points to:</para>
|
---|
73 |
|
---|
74 | <screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
|
---|
75 |
|
---|
76 | </sect2>
|
---|
77 |
|
---|
78 | &aa-zlib-shortdesc;
|
---|
79 | &aa-zlib-desc;
|
---|
80 |
|
---|
81 | </sect1>
|
---|
82 |
|
---|