<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-beyond-zlib" role="wrap">
  <?dbhtml filename="zlib.html"?>

  <title>Zlib-&zlib-version;</title>

  <indexterm zone="ch-beyond-zlib">
    <primary sortas="a-Zlib">Zlib</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>The Zlib package contains compression and decompression routines
    used by some programs.</para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of Zlib</title>

    <para os="c">Prepare Zlib for compilation and set to optimize for size:</para>

<screen os="d"><userinput>CFLAGS="-Os" ./configure --shared</userinput></screen>

    <variablelist os="aa">
      <title>The meaning of the configure options:</title>

      <varlistentry os="aa1">
        <term><parameter>--shared</parameter></term>
        <listitem>
          <para>Tells Zlib to build its shared library.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para os="c">Compile the package:</para>

<screen os="d"><userinput>make</userinput></screen>

    <para os="e">Install the package into the cross-tools:</para>

<screen os="f"><userinput>make prefix=${CLFS}/cross-tools/${CLFS_TARGET} install</userinput></screen>

    <para os="g">Copy only the shared library into the target file system and
      ensure that its symlink is present so the runtime loader can find it:</para>

    <screen os="h"><userinput>cp -v ${CLFS}/cross-tools/${CLFS_TARGET}/lib/libz.so.&zlib-version; ${CLFS}/targetfs/lib/
ln -sv libz.so.&zlib-version; ${CLFS}/targetfs/lib/libz.so.1</userinput></screen>

  </sect2>

  <sect2 id="contents-zlib" role="content">
    <title>Contents of Zlib</title>

    <segmentedlist>
      <segtitle>Installed libraries</segtitle>

      <seglistitem>
        <seg>libz.[a,so]</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="libz">
        <term><filename class="libraryfile">libz</filename></term>
        <listitem>
          <para>Contains compression and decompression
          functions used by some programs</para>
          <indexterm zone="ch-beyond-zlib libz">
            <primary sortas="c-libz">libz</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
