zlib.xml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. <screen><userinput>make check</userinput></screen>
  25. <para>Install the shared library:</para>
  26. <screen><userinput>make install</userinput></screen>
  27. <para>Now also build the non-shared (static) library:</para>
  28. <screen><userinput>make clean
  29. ./configure --prefix=/usr
  30. make</userinput></screen>
  31. <para>To have the results tested, issue:
  32. <userinput>make check</userinput>.</para>
  33. <para>Install the static library:</para>
  34. <screen><userinput>make install</userinput></screen>
  35. <para>And fix the permissions on the static library:</para>
  36. <screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
  37. <para>It is good policy and common practice to place important libraries into
  38. the <filename class="directory">/lib</filename> directory. This matters most
  39. in scenarios where <filename class="directory">/usr</filename> is on a
  40. separate partition. Essentially, the run-time components of any libraries
  41. depended upon by programs in <filename class="directory">/bin</filename> or
  42. <filename class="directory">/sbin</filename> should reside in
  43. <filename class="directory">/lib</filename> so that they are on the root
  44. partition and available in the event of
  45. <filename class="directory">/usr</filename> being inaccessible.</para>
  46. <para>Therefore we move the run-time components of the shared Zlib into
  47. <filename class="directory">/lib</filename> by issuing the following
  48. command:</para>
  49. <screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
  50. <para>Now we need to fix up the <filename>/usr/lib/libz.so</filename> symlink
  51. because we just moved the location of the file it points to:</para>
  52. <screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
  53. </sect2>
  54. &aa-zlib-shortdesc;
  55. &aa-zlib-desc;
  56. </sect1>