2004-05-03 11:59:46 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-01-30 18:06:48 +00:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
2004-05-03 11:59:46 +01:00
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
2005-05-23 21:07:49 +01:00
|
|
|
<!ENTITY % patches-entities SYSTEM "../patches.ent">
|
2004-05-03 11:59:46 +01:00
|
|
|
%general-entities;
|
2005-05-23 21:07:49 +01:00
|
|
|
%patches-entities;
|
2004-05-03 11:59:46 +01:00
|
|
|
]>
|
2005-02-19 22:16:42 +00:00
|
|
|
<sect1 id="ch-system-flex" role="wrap">
|
2004-05-03 11:59:46 +01:00
|
|
|
<title>Flex-&flex-version;</title>
|
|
|
|
<?dbhtml filename="flex.html"?>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-flex"><primary sortas="a-Flex">Flex</primary></indexterm>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2004-05-16 01:08:42 +01:00
|
|
|
<sect2 role="package"><title/>
|
2005-02-19 22:16:42 +00:00
|
|
|
<para>The Flex package contains a utility for generating programs that
|
|
|
|
recognize patterns in text.</para>
|
2004-01-12 23:23:50 +00:00
|
|
|
|
2004-05-16 01:08:42 +01:00
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>&buildtime;</segtitle>
|
|
|
|
<segtitle>&diskspace;</segtitle>
|
2005-06-14 07:08:58 +01:00
|
|
|
<seglistitem><seg>0.1 SBU</seg><seg>22.5 MB</seg></seglistitem>
|
2004-05-16 01:08:42 +01:00
|
|
|
</segmentedlist>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2005-02-19 22:16:42 +00:00
|
|
|
<segmentedlist>
|
2005-02-24 22:26:46 +00:00
|
|
|
<segtitle>&dependencies;</segtitle>
|
2005-02-19 22:16:42 +00:00
|
|
|
<seglistitem><seg>Bash, Binutils, Bison, Coreutils, Diffutils,
|
|
|
|
GCC, Gettext, Glibc, Grep, M4, Make, and Sed</seg></seglistitem>
|
|
|
|
</segmentedlist>
|
2004-05-16 01:08:42 +01:00
|
|
|
</sect2>
|
2001-07-17 19:51:18 +01:00
|
|
|
|
2004-05-16 01:08:42 +01:00
|
|
|
<sect2 role="installation">
|
2003-11-01 22:31:50 +00:00
|
|
|
<title>Installation of Flex</title>
|
|
|
|
|
2005-02-19 22:16:42 +00:00
|
|
|
<para>Flex contains several known bugs. Fix these with the following patch:</para>
|
2004-05-03 22:28:58 +01:00
|
|
|
|
2005-05-23 21:07:49 +01:00
|
|
|
<screen><userinput>patch -Np1 -i ../&flex-fixes-patch;</userinput></screen>
|
2004-05-03 22:28:58 +01:00
|
|
|
|
2005-02-19 22:16:42 +00:00
|
|
|
<para>The GNU autotools detects that the Flex source code has been
|
2005-07-04 22:32:47 +01:00
|
|
|
modified by the previous patch and tries to update the man page
|
2005-02-19 22:16:42 +00:00
|
|
|
accordingly. This does not work correctly on many systems, and the
|
|
|
|
default page is fine, so make sure it does not get regenerated:</para>
|
2004-05-03 22:28:58 +01:00
|
|
|
|
2004-06-20 03:36:50 +01:00
|
|
|
<screen><userinput>touch doc/flex.1</userinput></screen>
|
2004-05-03 22:28:58 +01:00
|
|
|
|
2005-02-19 22:16:42 +00:00
|
|
|
<para>Prepare Flex for compilation:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<screen><userinput>./configure --prefix=/usr</userinput></screen>
|
|
|
|
|
|
|
|
<para>Compile the package:</para>
|
|
|
|
|
|
|
|
<screen><userinput>make</userinput></screen>
|
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<para>To test the results, issue:
|
2004-05-03 22:28:58 +01:00
|
|
|
<userinput>make check</userinput>.</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2005-02-19 22:16:42 +00:00
|
|
|
<para>Install the package:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<screen><userinput>make install</userinput></screen>
|
|
|
|
|
2005-02-19 22:16:42 +00:00
|
|
|
<para>There are some packages that expect to find the
|
|
|
|
<filename class="libraryfile">lex</filename> library in <filename
|
|
|
|
class="directory">/usr/lib</filename>. Create a symlink to account for
|
|
|
|
this:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2005-09-29 21:55:40 +01:00
|
|
|
<screen><userinput>ln -sv libfl.a /usr/lib/libl.a</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2005-02-19 22:16:42 +00:00
|
|
|
<para>A few programs do not know about <command>flex</command> yet and
|
|
|
|
try to run its predecessor, <command>lex</command>. To support those
|
|
|
|
programs, create a wrapper script named <filename>lex</filename> that
|
|
|
|
calls <filename>flex</filename> in <command>lex</command> emulation mode:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2005-01-30 12:51:22 +00:00
|
|
|
<screen><userinput>cat > /usr/bin/lex << "EOF"
|
|
|
|
<literal>#!/bin/sh
|
2003-11-01 22:31:50 +00:00
|
|
|
# Begin /usr/bin/lex
|
|
|
|
|
|
|
|
exec /usr/bin/flex -l "$@"
|
|
|
|
|
2005-01-30 12:51:22 +00:00
|
|
|
# End /usr/bin/lex</literal>
|
|
|
|
EOF
|
2005-09-29 21:55:40 +01:00
|
|
|
chmod -v 755 /usr/bin/lex</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
</sect2>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2004-01-12 23:23:50 +00:00
|
|
|
|
2004-05-17 22:55:01 +01:00
|
|
|
<sect2 id="contents-flex" role="content"><title>Contents of Flex</title>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2005-02-19 22:16:42 +00:00
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Installed programs</segtitle>
|
|
|
|
<segtitle>Installed library</segtitle>
|
2005-07-19 21:23:48 +01:00
|
|
|
<seglistitem><seg>flex and lex</seg>
|
2005-02-19 22:16:42 +00:00
|
|
|
<seg>libfl.a</seg></seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
|
|
<?dbfo list-presentation="list"?>
|
2005-02-24 18:32:19 +00:00
|
|
|
<?dbhtml list-presentation="table"?>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
|
|
|
<varlistentry id="flex">
|
|
|
|
<term><command>flex</command></term>
|
|
|
|
<listitem>
|
|
|
|
<para>A tool for generating programs that recognize patterns in text;
|
|
|
|
it allows for the versatility to specify the rules for
|
|
|
|
pattern-finding, eradicating the need to develop a specialized
|
|
|
|
program</para>
|
|
|
|
<indexterm zone="ch-system-flex flex"><primary sortas="b-flex">flex</primary></indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="lex">
|
|
|
|
<term><command>lex</command></term>
|
|
|
|
<listitem>
|
2005-06-30 18:53:21 +01:00
|
|
|
<para>A script that runs <command>flex</command> in <command>lex</command>
|
2005-02-19 22:16:42 +00:00
|
|
|
emulation mode</para>
|
|
|
|
<indexterm zone="ch-system-flex lex"><primary sortas="b-lex">lex</primary></indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="libfl.a">
|
|
|
|
<term><filename class="libraryfile">libfl.a</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>The <filename class="libraryfile">flex</filename> library</para>
|
|
|
|
<indexterm zone="ch-system-flex libfl.a"><primary sortas="c-libfl.a">libfl.a</primary></indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|
2005-02-19 22:16:42 +00:00
|
|
|
|