[3be4d97] | 1 | <sect1 id="ch-system-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 |
|
---|
[69276a94] | 8 | <screen>&buildtime; &zlib-time;
|
---|
| 9 | &diskspace; &zlib-compsize;</screen>
|
---|
[24380c7] | 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 |
|
---|
[bcd0ce7] | 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
|
---|
[4248b0e] | 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
|
---|
[bcd0ce7] | 23 | afterwards.</para></note>
|
---|
[73aedd1d] | 24 |
|
---|
[4248b0e] | 25 | <para>Prepare Zlib for compilation:</para>
|
---|
| 26 |
|
---|
| 27 | <screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
|
---|
| 28 |
|
---|
[73aedd1d] | 29 | <para>Compile the package:</para>
|
---|
| 30 |
|
---|
| 31 | <screen><userinput>make</userinput></screen>
|
---|
| 32 |
|
---|
[8a5f906] | 33 | <para>To have the results tested, issue:
|
---|
| 34 | <userinput>make check</userinput>.</para>
|
---|
[dfddb12] | 35 |
|
---|
| 36 | <screen><userinput>make check</userinput></screen>
|
---|
| 37 |
|
---|
| 38 | <para>Install the shared library:</para>
|
---|
[73aedd1d] | 39 |
|
---|
| 40 | <screen><userinput>make install</userinput></screen>
|
---|
| 41 |
|
---|
[dfddb12] | 42 | <para>Now also build the non-shared (static) library:</para>
|
---|
[73aedd1d] | 43 | <screen><userinput>make clean
|
---|
| 44 | ./configure --prefix=/usr
|
---|
| 45 | make</userinput></screen>
|
---|
| 46 |
|
---|
[8a5f906] | 47 | <para>To have the results tested, issue:
|
---|
| 48 | <userinput>make check</userinput>.</para>
|
---|
[73aedd1d] | 49 |
|
---|
[84e4cae] | 50 | <para>Install the static library:</para>
|
---|
[73aedd1d] | 51 |
|
---|
| 52 | <screen><userinput>make install</userinput></screen>
|
---|
| 53 |
|
---|
[84e4cae] | 54 | <para>And fix the permissions on the static library:</para>
|
---|
| 55 |
|
---|
| 56 | <screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
|
---|
| 57 |
|
---|
[dfddb12] | 58 | <para>It is good policy and common practice to place important libraries into
|
---|
| 59 | the <filename class="directory">/lib</filename> directory. This matters most
|
---|
| 60 | in scenarios where <filename class="directory">/usr</filename> is on a
|
---|
| 61 | separate partition. Essentially, the run-time components of any libraries
|
---|
| 62 | depended upon by programs in <filename class="directory">/bin</filename> or
|
---|
| 63 | <filename class="directory">/sbin</filename> should reside in
|
---|
| 64 | <filename class="directory">/lib</filename> so that they are on the root
|
---|
| 65 | partition and available in the event of
|
---|
| 66 | <filename class="directory">/usr</filename> being inaccessible.</para>
|
---|
| 67 |
|
---|
| 68 | <para>Therefore we move the run-time components of the shared Zlib into
|
---|
| 69 | <filename class="directory">/lib</filename> by issuing the following
|
---|
| 70 | command:</para>
|
---|
[73aedd1d] | 71 |
|
---|
| 72 | <screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
|
---|
| 73 |
|
---|
[dfddb12] | 74 | <para>Now we need to fix up the <filename>/usr/lib/libz.so</filename> symlink
|
---|
| 75 | because we just moved the location of the file it points to:</para>
|
---|
[73aedd1d] | 76 |
|
---|
| 77 | <screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
|
---|
| 78 |
|
---|
| 79 | </sect2>
|
---|
[24380c7] | 80 |
|
---|
[5888299] | 81 | &aa-zlib-shortdesc;
|
---|
| 82 | &aa-zlib-desc;
|
---|
| 83 |
|
---|
[24380c7] | 84 | </sect1>
|
---|
| 85 |
|
---|