<?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;

  <!ENTITY libffi-download-http " ">
  <!ENTITY libffi-download-ftp  "ftp://sourceware.org/pub/libffi/libffi-&libffi-version;.tar.gz">
  <!ENTITY libffi-md5sum        "83b89587607e3eb65c70d361f13bab43">
  <!ENTITY libffi-size          "920 KB">
  <!ENTITY libffi-buildsize     "6.1 MB (additional 1.7 MB for the tests)">
  <!ENTITY libffi-time          "less than 0.1 SBU (additional 0.4 SBU for the tests)">
]>

<sect1 id="libffi" xreflabel="libffi-&libffi-version;">
  <?dbhtml filename="libffi.html"?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2015-02-20 16:15:05 -0500 (Fri, 20 Feb 2015) $</date>
  </sect1info>

  <title>libffi-&libffi-version;</title>

  <indexterm zone="libffi">
    <primary sortas="a-libffi">libffi</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to libffi</title>

    <para>
      The <application>libffi</application> library provides a portable,
      high level programming interface to various calling conventions.  This
      allows a programmer to call any function specified by a call interface
      description at run time.
    </para>

    &lfs77_checked;

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>
          Download (HTTP): <ulink url="&libffi-download-http;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download (FTP): <ulink url="&libffi-download-ftp;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download MD5 sum: &libffi-md5sum;
        </para>
      </listitem>
      <listitem>
        <para>
          Download size: &libffi-size;
        </para>
      </listitem>
      <listitem>
        <para>
          Estimated disk space required: &libffi-buildsize;
        </para>
      </listitem>
      <listitem>
        <para>
          Estimated build time: &libffi-time;
        </para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">libffi Dependencies</bridgehead>

    <bridgehead renderas="sect4">Optional</bridgehead>
    <para role="optional">
      <xref linkend="dejagnu"/> (required to run the testsuite)
    </para>

    <para condition="html" role="usernotes">
      User Notes: <ulink url="&blfs-wiki;/libffi"/>
    </para>
  </sect2>

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

    <para>
      Install <application>libffi</application> by running the following
      commands:
    </para>

<screen><userinput>sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' \
    -i include/Makefile.in &amp;&amp;

sed -e '/^includedir/ s/=.*$/=@includedir@/' \
    -e 's/^Cflags: -I${includedir}/Cflags:/' \
    -i libffi.pc.in        &amp;&amp;

./configure --prefix=/usr --disable-static &amp;&amp;
make</userinput></screen>

    <para>
      To test the results, issue: <command>make check</command>.
    </para>

    <para>
      Now, as the <systemitem class="username">root</systemitem> user:
    </para>

<screen role="root"><userinput>make install</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <para><command>sed ... include/Makefile.in</command> and
    <command>sed ... libffi.pc.in</command>: Make package install headers into
    /usr/include instead of /usr/lib/libffi-&libffi-version;/include.</para>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
      href="../../xincludes/static-libraries.xml"/>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Library</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>
          None
        </seg>
        <seg>
          libffi.so
        </seg>
        <seg>
          None
        </seg>
      </seglistitem>
    </segmentedlist>

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

      <varlistentry id="libffi-lib">
        <term><filename class="libraryfile">libffi.so</filename></term>
        <listitem>
          <para>
            contains the <application>libffi</application> API
            functions.
          </para>
          <indexterm zone="libffi libffi-lib">
            <primary sortas="c-libffi">libffi.so</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
