zlib.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. <note><para>Zlib is known to build its shared library incorrectly if CFLAGS is
  14. specified in the environment. If you are using your own CFLAGS variable, be
  15. sure to add the <emphasis>-fPIC</emphasis> directive to your CFLAGS for the
  16. duration of the below <command>configure</command> command, then remove it
  17. afterwards.</para></note>
  18. <para>Prepare Zlib for compilation:</para>
  19. <screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
  20. <para>Compile the package:</para>
  21. <screen><userinput>make</userinput></screen>
  22. <para>To have the results tested, issue:
  23. <userinput>make check</userinput>.</para>
  24. <para>Install the shared library:</para>
  25. <screen><userinput>make install</userinput></screen>
  26. <para>Now also build the non-shared (static) library:</para>
  27. <screen><userinput>make clean
  28. ./configure --prefix=/usr
  29. make</userinput></screen>
  30. <para>To have the results tested again, issue:
  31. <userinput>make check</userinput>.</para>
  32. <para>Install the static library:</para>
  33. <screen><userinput>make install</userinput></screen>
  34. <para>And fix the permissions on the static library:</para>
  35. <screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
  36. <para>It is good policy and common practice to place important libraries into
  37. the <filename class="directory">/lib</filename> directory. This matters most
  38. in scenarios where <filename class="directory">/usr</filename> is on a
  39. separate partition. Essentially, the run-time components of any libraries that
  40. are used by programs in <filename class="directory">/bin</filename> or
  41. <filename class="directory">/sbin</filename> should reside in
  42. <filename class="directory">/lib</filename> so that they are on the root
  43. partition and available in the event of
  44. <filename class="directory">/usr</filename> being inaccessible.</para>
  45. <para>For the above reason we move the run-time components of the shared Zlib
  46. into <filename class="directory">/lib</filename>:</para>
  47. <screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
  48. <para>Now we need to fix the <filename>/usr/lib/libz.so</filename> symlink
  49. because we just moved the file it points to:</para>
  50. <screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
  51. </sect2>
  52. &aa-zlib-shortdesc;
  53. &aa-zlib-desc;
  54. </sect1>