<?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 pcre2-download-http "&sourceforge-dl;/pcre/pcre2-&pcre2-version;.tar.bz2">
  <!ENTITY pcre2-download-ftp  "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-&pcre2-version;.tar.bz2">
  <!ENTITY pcre2-md5sum        "e0b91c891a3c49050f7fd15de33d0ba4">
  <!ENTITY pcre2-size          "1.6 MB">
  <!ENTITY pcre2-buildsize     "19 MB (with tests)">
  <!ENTITY pcre2-time          "0.3 SBU (with tests)">
]>

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

  <sect1info>
    <othername>$LastChangedBy$</othername>
    <date>$Date$</date>
  </sect1info>

  <title>PCRE2-&pcre2-version;</title>

  <indexterm zone="pcre2">
    <primary sortas="a-pcre2">PCRE2</primary>
  </indexterm>

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

    <para>
      The <application>PCRE2</application> package contains a new generation of
      the <application>Perl Compatible Regular Expression</application>
      libraries. These are useful for implementing regular expression pattern
      matching using the same syntax and semantics as <application>Perl</application>.
    </para>

    &lfs82_checked;

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

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

    <bridgehead renderas="sect4">Optional</bridgehead>
    <para role="optional">
      <xref linkend="valgrind"/>
    </para>

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

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

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

<screen><userinput>./configure --prefix=/usr                       \
            --docdir=/usr/share/doc/pcre2-&pcre2-version; \
            --enable-unicode                    \
            --enable-jit                        \
            --enable-pcre2-16                   \
            --enable-pcre2-32                   \
            --enable-pcre2grep-libz             \
            --enable-pcre2grep-libbz2           \
            --enable-pcre2test-libreadline      \
            --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>
      <parameter>--enable-unicode</parameter>: This switch enables Unicode 
      support and includes the functions for handling UTF-8/16/32 character 
      strings in the library.
    </para>

    <para>
      <parameter>--enable-pcre2-16</parameter>: This switch enables 16 bit
      character support.
    </para>

    <para>
      <parameter>--enable-pcre2-32</parameter>: This switch enables 32 bit
      character support.
    </para>

    <para>
      <parameter>--enable-pcre2grep-libz</parameter>: This switch adds support
      for reading .gz compressed files to <application>pcre2grep</application>.
    </para>

    <para>
      <parameter>--enable-pcre2grep-libbz2</parameter>: This switch adds
      support for reading .bz2 compressed files to 
      <application>pcre2grep</application>.
    </para>

    <para>
      <parameter>--enable-pcre2test-libreadline</parameter>: This switch adds
      line editing and history features to the
      <application>pcre2test</application> program.
    </para>

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

    <para>
      <option>--enable-jit</option>: this option enables Just-in-time compiling,
      which can greatly speed up pattern matching.
    </para>

  </sect2>

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

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Libraries</segtitle>
      <segtitle>Installed Directory</segtitle>

      <seglistitem>
        <seg>
          pcre2-config,
          pcre2grep,
          and pcre2test.
        </seg>
        <seg>
          libpcre2-8.so,
          libpcre2-16.so,
          libpcre2-32.so,
          and libpcre2-posix.so
        </seg>
        <seg>
          /usr/share/doc/pcre2-&pcre2-version;
        </seg>
      </seglistitem>
    </segmentedlist>

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

      <varlistentry id="pcre2grep">
        <term><command>pcre2grep</command></term>
        <listitem>
          <para>
            is a version of <application>grep</application>
            that understands 
            <application>Perl compatible regular expressions.</application>.
          </para>
          <indexterm zone="pcre2 pcre2grep">
            <primary sortas="b-pcre2grep">pcre2grep</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pcre2test">
        <term><command>pcre2test</command></term>
        <listitem>
          <para>
            can test a 
            <application>Perl compatible regular expression.</application>
          </para>
          <indexterm zone="pcre2 pcre2test">
            <primary sortas="b-pcre2test">pcre2</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pcre2-config">
        <term><command>pcre2-config</command></term>
        <listitem>
          <para>
            outputs compilation information to programs linking against the
            <application>PCRE2</application> libraries.
          </para>
          <indexterm zone="pcre2 pcre2-config">
            <primary sortas="b-pcre2-config">pcre2-config</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>