zlib.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. ]>
  6. <sect1 id="ch-system-zlib" xreflabel="Zlib" role="wrap">
  7. <title>Zlib-&zlib-version;</title>
  8. <?dbhtml filename="zlib.html"?>
  9. <indexterm zone="ch-system-zlib"><primary sortas="a-Zlib">Zlib</primary></indexterm>
  10. <sect2 role="package"><title/>
  11. <para>The Zlib package contains compression and un-compression routines used by
  12. some programs.</para>
  13. <segmentedlist>
  14. <segtitle>&buildtime;</segtitle>
  15. <segtitle>&diskspace;</segtitle>
  16. <seglistitem><seg>0.1 SBU</seg><seg>1.5 MB</seg></seglistitem>
  17. </segmentedlist>
  18. <segmentedlist>
  19. <segtitle>Zlib installation depends on</segtitle>
  20. <seglistitem><seg>Binutils, Coreutils, GCC, Glibc, Make, Sed</seg></seglistitem>
  21. </segmentedlist>
  22. </sect2>
  23. <sect2 role="installation">
  24. <title>Installation of Zlib</title>
  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
  27. sure to add the <parameter>-fPIC</parameter> directive to your CFLAGS for the
  28. duration of the below <command>configure</command> command, then remove it
  29. afterwards.</para></note>
  30. <para>Prepare Zlib for compilation:</para>
  31. <screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
  32. <para>Compile the package:</para>
  33. <screen><userinput>make</userinput></screen>
  34. <para>To test the results, issue:
  35. <userinput>make check</userinput>.</para>
  36. <para>Install the shared library:</para>
  37. <screen><userinput>make install</userinput></screen>
  38. <para>Now also build the non-shared (static) library:</para>
  39. <screen><userinput>make clean
  40. ./configure --prefix=/usr
  41. make</userinput></screen>
  42. <para>To again test the results, issue:
  43. <userinput>make check</userinput>.</para>
  44. <para>Install the static library:</para>
  45. <screen><userinput>make install</userinput></screen>
  46. <para>And fix the permissions on the static library:</para>
  47. <screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
  48. <para>It is good policy and common practice to place important libraries into
  49. the <filename class="directory">/lib</filename> directory. This matters most
  50. in scenarios where <filename class="directory">/usr</filename> is on a
  51. separate partition. Essentially, the run-time components of any libraries that
  52. are used by programs in <filename class="directory">/bin</filename> or
  53. <filename class="directory">/sbin</filename> should reside in
  54. <filename class="directory">/lib</filename> so that they are on the root
  55. partition and available in the event of
  56. <filename class="directory">/usr</filename> being inaccessible.</para>
  57. <para>For the above reason we move the run-time components of the shared Zlib
  58. into <filename class="directory">/lib</filename>:</para>
  59. <screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
  60. <para>Now we need to fix the <filename class="symlink">/usr/lib/libz.so</filename> symlink
  61. because we just moved the file it points to:</para>
  62. <screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
  63. </sect2>
  64. <sect2 id="contents-zlib" role="content"><title>Contents of Zlib</title>
  65. <segmentedlist>
  66. <segtitle>Installed libraries</segtitle>
  67. <seglistitem><seg>libz[a,so]</seg></seglistitem>
  68. </segmentedlist>
  69. <variablelist><title>Short description</title>
  70. <varlistentry id="libz">
  71. <term><filename class="libraryfile">libz*</filename></term>
  72. <listitem>
  73. <indexterm zone="ch-system-zlib libz"><primary sortas="c-libz*">libz*</primary></indexterm>
  74. <para>contains compression and un-compression
  75. functions used by some programs.</para>
  76. </listitem>
  77. </varlistentry>
  78. </variablelist>
  79. </sect2>
  80. </sect1>