[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
[3be4d97] | 6 | <sect1 id="ch-system-zlib" xreflabel="Zlib">
|
---|
[673b0d8] | 7 | <title>Zlib-&zlib-version;</title>
|
---|
| 8 | <?dbhtml filename="zlib.html"?>
|
---|
[24380c7] | 9 |
|
---|
[673b0d8] | 10 | <indexterm zone="ch-system-zlib"><primary sortas="a-Zlib">Zlib</primary></indexterm>
|
---|
| 11 |
|
---|
| 12 | <para>The Zlib package contains compression and un-compression routines used by
|
---|
[5888299] | 13 | some programs.</para>
|
---|
| 14 |
|
---|
[673b0d8] | 15 | <screen>&buildtime; 0.1 SBU
|
---|
| 16 | &diskspace; 1.5 MB</screen>
|
---|
| 17 |
|
---|
| 18 | <para>Zlib installation depends on: Binutils, Coreutils, GCC, Glibc, Make, Sed.</para>
|
---|
[24380c7] | 19 |
|
---|
[73aedd1d] | 20 |
|
---|
| 21 |
|
---|
| 22 | <sect2>
|
---|
| 23 | <title>Installation of Zlib</title>
|
---|
| 24 |
|
---|
[bcd0ce7] | 25 | <note><para>Zlib is known to build its shared library incorrectly if CFLAGS is
|
---|
| 26 | specified in the environment. If you are using your own CFLAGS variable, be
|
---|
[4248b0e] | 27 | sure to add the <emphasis>-fPIC</emphasis> directive to your CFLAGS for the
|
---|
| 28 | duration of the below <command>configure</command> command, then remove it
|
---|
[bcd0ce7] | 29 | afterwards.</para></note>
|
---|
[73aedd1d] | 30 |
|
---|
[4248b0e] | 31 | <para>Prepare Zlib for compilation:</para>
|
---|
| 32 |
|
---|
| 33 | <screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
|
---|
| 34 |
|
---|
[73aedd1d] | 35 | <para>Compile the package:</para>
|
---|
| 36 |
|
---|
| 37 | <screen><userinput>make</userinput></screen>
|
---|
| 38 |
|
---|
[673b0d8] | 39 | <para>To test the results, issue:
|
---|
[8a5f906] | 40 | <userinput>make check</userinput>.</para>
|
---|
[dfddb12] | 41 |
|
---|
| 42 | <para>Install the shared library:</para>
|
---|
[73aedd1d] | 43 |
|
---|
| 44 | <screen><userinput>make install</userinput></screen>
|
---|
| 45 |
|
---|
[dfddb12] | 46 | <para>Now also build the non-shared (static) library:</para>
|
---|
[73aedd1d] | 47 | <screen><userinput>make clean
|
---|
| 48 | ./configure --prefix=/usr
|
---|
| 49 | make</userinput></screen>
|
---|
| 50 |
|
---|
[673b0d8] | 51 | <para>To again test the results, issue:
|
---|
[8a5f906] | 52 | <userinput>make check</userinput>.</para>
|
---|
[73aedd1d] | 53 |
|
---|
[84e4cae] | 54 | <para>Install the static library:</para>
|
---|
[73aedd1d] | 55 |
|
---|
| 56 | <screen><userinput>make install</userinput></screen>
|
---|
| 57 |
|
---|
[84e4cae] | 58 | <para>And fix the permissions on the static library:</para>
|
---|
| 59 |
|
---|
| 60 | <screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
|
---|
| 61 |
|
---|
[dfddb12] | 62 | <para>It is good policy and common practice to place important libraries into
|
---|
| 63 | the <filename class="directory">/lib</filename> directory. This matters most
|
---|
| 64 | in scenarios where <filename class="directory">/usr</filename> is on a
|
---|
[db9d773c] | 65 | separate partition. Essentially, the run-time components of any libraries that
|
---|
| 66 | are used by programs in <filename class="directory">/bin</filename> or
|
---|
[dfddb12] | 67 | <filename class="directory">/sbin</filename> should reside in
|
---|
| 68 | <filename class="directory">/lib</filename> so that they are on the root
|
---|
| 69 | partition and available in the event of
|
---|
| 70 | <filename class="directory">/usr</filename> being inaccessible.</para>
|
---|
| 71 |
|
---|
[db9d773c] | 72 | <para>For the above reason we move the run-time components of the shared Zlib
|
---|
| 73 | into <filename class="directory">/lib</filename>:</para>
|
---|
[73aedd1d] | 74 |
|
---|
| 75 | <screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
|
---|
| 76 |
|
---|
[db9d773c] | 77 | <para>Now we need to fix the <filename>/usr/lib/libz.so</filename> symlink
|
---|
| 78 | because we just moved 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 |
|
---|
[673b0d8] | 85 | <sect2 id="contents-zlib"><title>Contents of Zlib</title>
|
---|
| 86 |
|
---|
| 87 | <para><emphasis>Installed libraries</emphasis>: libz[a,so]</para>
|
---|
| 88 |
|
---|
| 89 | </sect2>
|
---|
| 90 |
|
---|
[24380c7] | 91 |
|
---|
[673b0d8] | 92 | <sect2><title>Short description</title>
|
---|
| 93 |
|
---|
| 94 | <indexterm zone="ch-system-zlib libz"><primary sortas="c-libz*">libz*</primary></indexterm>
|
---|
| 95 | <para id="libz"><command>libz*</command> contains compression and un-compression
|
---|
| 96 | functions used by some programs.</para>
|
---|
| 97 |
|
---|
| 98 | </sect2>
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 |
|
---|
| 102 | </sect1>
|
---|