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