zlib.xml 2.9 KB

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