<?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 pth-download-http
  "http://ftp.gnu.org/gnu/pth/pth-&pth-version;.tar.gz">
  <!ENTITY pth-download-ftp
  "ftp://ftp.gnu.org/gnu/pth/pth-&pth-version;.tar.gz">
  <!ENTITY pth-md5sum        "9cb4a25331a4c4db866a31cbe507c793">
  <!ENTITY pth-size          "652 KB">
  <!ENTITY pth-buildsize     "5 MB">
  <!ENTITY pth-time          "0.2 SBU">
]>

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

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2015-02-20 19:04:13 -0500 (Fri, 20 Feb 2015) $</date>
  </sect1info>

  <title>Pth-&pth-version;</title>

  <indexterm zone="pth">
    <primary sortas="a-Pth">Pth</primary>
  </indexterm>

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

    <para>The <application>Pth</application> package contains a very portable
    POSIX/ANSI-C based library for Unix platforms which provides non-preemptive
    priority-based scheduling for multiple threads of execution (multithreading)
    inside event-driven applications. All threads run in the same address space
    of the server application, but each thread has its own individual
    program-counter, run-time stack, signal mask and errno variable. </para>

    &lfs77_checked;

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

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

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

    <caution>
      <para>Don't add the <option>--enable-pthread</option> parameter to the
      <command>configure</command> command below else you will overwrite the
      pthread library and interface header installed by the
      <application>Glibc</application> package in LFS.</para>
    </caution>

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

<screen><userinput>sed -i 's#$(LOBJS): Makefile#$(LOBJS): pth_p.h Makefile#' Makefile.in &amp;&amp;
./configure --prefix=/usr           \
            --disable-static        \
            --mandir=/usr/share/man &amp;&amp;
make</userinput></screen>

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

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

<screen role="root"><userinput>make install &amp;&amp;
install -v -m755 -d /usr/share/doc/pth-&pth-version; &amp;&amp;
install -v -m644    README PORTING SUPPORT TESTS \
                    /usr/share/doc/pth-&pth-version;</userinput></screen>
  </sect2>

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

    <para><command>sed -i 's#$(LOBJS) ...</command>: This <command>sed</command>
    fixes a race condition in the <filename>Makefile</filename>. It allows you
    to run <command>make</command> with multiple jobs (e.g., <command>make -j4</command>)
    <!-- how ironic that a package for using multiple threads has this bug in
    its Makefile -->.</para>

    <para><option>--disable-static</option>: This option stops it compiling a
    static version of the library.</para>

    <para><option>--mandir=/usr/share/man</option>: This option puts the man
    pages in <filename class="directory">/usr/share/man</filename> and not
    <filename class="directory">/usr/man</filename>.</para>
  </sect2>

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

    <segmentedlist>
      <segtitle>Installed Program</segtitle>
      <segtitle>Installed Library</segtitle>
      <segtitle>Installed Directory</segtitle>

      <seglistitem>
        <seg>pth-config</seg>
        <seg>libpth.so</seg>
        <seg>/usr/share/doc/pth-&pth-version;</seg>
      </seglistitem>
    </segmentedlist>

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

      <varlistentry id="pth-config">
        <term><command>pth-config</command></term>
        <listitem>
          <para>is a utility used to configure and build applications based on
          the pth(3) library. It can be used to query the C compiler and
          linker flags which are required to correctly compile and link the
          application against the pth(3) library.</para>
          <indexterm zone="pth pth-config">
            <primary sortas="b-pth-config">pth-config</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libpth">
        <term><filename class="libraryfile">libpth.so</filename></term>
        <listitem>
          <para>contains the API functions used by the GNU Portable Threads
          Library.</para>
          <indexterm zone="pth libpth">
            <primary sortas="c-libpth">libpth.so</primary>
          </indexterm>
        </listitem>
      </varlistentry>
    </variablelist>
  </sect2>
</sect1>
