<?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-system-gmp" role="wrap">
  <?dbhtml filename="gmp.html"?>

  <title>GMP-&gmp-version;</title>

  <indexterm zone="ch-system-gmp">
    <primary sortas="a-GMP">GMP</primary>
  </indexterm>

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

    <para>GMP is a library for arithmetic on arbitrary precision integers,
    rational numbers, and floating-point numbers.</para>

  </sect2>

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

<!--
    <para os="p1">The following patch contains a number of updates to the
    &gmp-version; branch by the GMP developers:</para>

<screen os="p2"><userinput>patch -Np1 -i ../&gmp-branch_update-patch;</userinput></screen>

-->

    <note os="n1">
      <para>If you are compiling this package on a different CPU than you plan
      to run the CLFS system on, you must replace GMP's
      <filename>config.guess</filename> and <filename>config.sub</filename>
      wrappers with the originals. This will prevent GMP from optimizing for
      the wrong CPU. You can make this change with the following command:</para>

<screen>mv -v config{fsf,}.guess
mv -v config{fsf,}.sub</screen>

    </note>

    <para os="a">Prepare GMP for compilation:</para>

<screen os="b"><userinput>CC="gcc -isystem /usr/include" \
CXX="g++ -isystem /usr/include" \
LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib" \
  ./configure --prefix=/usr --enable-cxx \
  --docdir=/usr/share/doc/gmp-&gmp-version;</userinput></screen>

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

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

    <para os="e">Build the HTML documentation:</para>

<screen os="f"><userinput>make html</userinput></screen>

    <para os="g">Test the results:</para>

<screen os="h"><userinput remap="test">make check</userinput></screen>

    <para os="i">Install the package:</para>

<screen os="j"><userinput>make install</userinput></screen>

    <para os="k">Install the documentation:</para>

<screen os="l"><userinput>make install-html</userinput></screen>

  </sect2>

  <sect2 id="contents-gmp" role="content">
    <title>Contents of GMP</title>

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

      <seglistitem>
        <seg>libgmp.[a,so], libgmpxx.[a,so]</seg>
        <seg>/usr/share/doc/gmp-&gmp-version;</seg>
      </seglistitem>
    </segmentedlist>

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

      <varlistentry id="libgmp">
        <term><filename class="libraryfile">libgmp</filename></term>
        <listitem>
          <para>Contains the definitions for GNU multiple precision functions.</para>
          <indexterm zone="ch-system-gmp libgmp">
            <primary sortas="c-libgmp">libgmp</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libgmpxx">
        <term><filename class="libraryfile">libgmpxx</filename></term>
        <listitem>
          <para>Contains a C++ class wrapper for GMP types.</para>
          <indexterm zone="ch-system-gmp libgmpxx">
            <primary sortas="c-libgmpxx">libgmpxx</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
