[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
[a001133] | 6 | <sect1 id="ch-system-flex" xreflabel="Flex" role="wrap">
|
---|
[673b0d8] | 7 | <title>Flex-&flex-version;</title>
|
---|
| 8 | <?dbhtml filename="flex.html"?>
|
---|
| 9 |
|
---|
| 10 | <indexterm zone="ch-system-flex"><primary sortas="a-Flex">Flex</primary></indexterm>
|
---|
[6370fa6] | 11 |
|
---|
[a001133] | 12 | <sect2 role="package"><title/>
|
---|
[5888299] | 13 | <para>The Flex package contains a utility for generating programs that
|
---|
| 14 | recognize patterns in text.</para>
|
---|
| 15 |
|
---|
[a001133] | 16 | <segmentedlist>
|
---|
| 17 | <segtitle>&buildtime;</segtitle>
|
---|
| 18 | <segtitle>&diskspace;</segtitle>
|
---|
| 19 | <seglistitem><seg>0.1 SBU</seg><seg>3.4 MB</seg></seglistitem>
|
---|
| 20 | </segmentedlist>
|
---|
[673b0d8] | 21 |
|
---|
[a001133] | 22 | <segmentedlist>
|
---|
| 23 | <segtitle>Flex installation depends on</segtitle>
|
---|
| 24 | <seglistitem><seg>Bash, Binutils, Bison, Coreutils, Diffutils,
|
---|
| 25 | GCC, Gettext, Glibc, Grep, M4, Make, Sed</seg></seglistitem>
|
---|
| 26 | </segmentedlist>
|
---|
| 27 | </sect2>
|
---|
[3554fa3a] | 28 |
|
---|
[a001133] | 29 | <sect2 role="installation">
|
---|
[73aedd1d] | 30 | <title>Installation of Flex</title>
|
---|
| 31 |
|
---|
[9dfc02f] | 32 | <para>Flex contains several known bugs. Fix these with the following patch:</para>
|
---|
| 33 |
|
---|
[71bbe67] | 34 | <screen><userinput>patch -Np1 -i ../flex-&flex-version;-debian_fixes-2.patch</userinput></screen>
|
---|
[9dfc02f] | 35 |
|
---|
| 36 | <para>The GNU autotools detects that the Flex source code has been modified by the patch,
|
---|
| 37 | and tries to update the man pages to include those changes, but this breaks on many
|
---|
| 38 | systems, and the default pages are fine, so make sure they don't get renegerated:</para>
|
---|
| 39 |
|
---|
| 40 | <screen><userinput>touch doc/*.1</userinput></screen>
|
---|
| 41 |
|
---|
| 42 | <para>Now prepare Flex for compilation:</para>
|
---|
[73aedd1d] | 43 |
|
---|
| 44 | <screen><userinput>./configure --prefix=/usr</userinput></screen>
|
---|
| 45 |
|
---|
| 46 | <para>Compile the package:</para>
|
---|
| 47 |
|
---|
| 48 | <screen><userinput>make</userinput></screen>
|
---|
| 49 |
|
---|
[673b0d8] | 50 | <para>To test the results, issue:
|
---|
[9dfc02f] | 51 | <userinput>make check</userinput>.</para>
|
---|
[73aedd1d] | 52 |
|
---|
[673b0d8] | 53 | <para>Now install the package:</para>
|
---|
[73aedd1d] | 54 |
|
---|
| 55 | <screen><userinput>make install</userinput></screen>
|
---|
| 56 |
|
---|
[4248b0e] | 57 | <para>There are some packages that expect to find the <emphasis>lex</emphasis>
|
---|
| 58 | library in <filename>/usr/lib</filename>. Create a symlink to account for
|
---|
| 59 | this:</para>
|
---|
[73aedd1d] | 60 |
|
---|
| 61 | <screen><userinput>ln -s libfl.a /usr/lib/libl.a</userinput></screen>
|
---|
| 62 |
|
---|
[90e3cb3] | 63 | <para>A few programs don't know about <command>flex</command> yet and try
|
---|
| 64 | to run its predecessor <command>lex</command>. To support those programs,
|
---|
[4248b0e] | 65 | create a wrapper script named <filename>lex</filename> that calls
|
---|
| 66 | <command>flex</command> in <emphasis>lex</emphasis> emulation mode:</para>
|
---|
[73aedd1d] | 67 |
|
---|
| 68 | <screen><userinput>cat > /usr/bin/lex << "EOF"</userinput>
|
---|
| 69 | #!/bin/sh
|
---|
| 70 | # Begin /usr/bin/lex
|
---|
| 71 |
|
---|
| 72 | exec /usr/bin/flex -l "$@"
|
---|
| 73 |
|
---|
| 74 | # End /usr/bin/lex
|
---|
| 75 | <userinput>EOF
|
---|
| 76 | chmod 755 /usr/bin/lex</userinput></screen>
|
---|
| 77 |
|
---|
| 78 | </sect2>
|
---|
[6370fa6] | 79 |
|
---|
[5888299] | 80 |
|
---|
[c6cb3aa] | 81 | <sect2 id="contents-flex" role="content"><title>Contents of Flex</title>
|
---|
[673b0d8] | 82 |
|
---|
[c6cb3aa] | 83 | <segmentedlist>
|
---|
| 84 | <segtitle>Installed programs</segtitle>
|
---|
| 85 | <segtitle>Installed library</segtitle>
|
---|
| 86 | <seglistitem><seg>flex, flex++ (link to flex) and lex</seg>
|
---|
| 87 | <seg>libfl.a</seg></seglistitem>
|
---|
| 88 | </segmentedlist>
|
---|
[673b0d8] | 89 |
|
---|
[c6cb3aa] | 90 | <variablelist><title>Short descriptions</title>
|
---|
[73aedd1d] | 91 |
|
---|
[b8a819f] | 92 | <varlistentry id="flex">
|
---|
| 93 | <term><command>flex</command></term>
|
---|
[c6cb3aa] | 94 | <listitem>
|
---|
[673b0d8] | 95 | <indexterm zone="ch-system-flex flex"><primary sortas="b-flex">flex</primary></indexterm>
|
---|
[c6cb3aa] | 96 | <para>is a tool for generating programs that
|
---|
[673b0d8] | 97 | recognize patterns in text. Pattern recognition is useful in many applications.
|
---|
[bb55064] | 98 | From a set of rules on what to look for, <command>flex</command> makes a program that looks for
|
---|
| 99 | those patterns. The reason to use <command>flex</command> is that it is much easier to specify
|
---|
[673b0d8] | 100 | the rules for a pattern-finding program than to write the program.</para>
|
---|
[c6cb3aa] | 101 | </listitem>
|
---|
| 102 | </varlistentry>
|
---|
[673b0d8] | 103 |
|
---|
[b8a819f] | 104 | <varlistentry id="flex-">
|
---|
| 105 | <term><command>flex++</command></term>
|
---|
[c6cb3aa] | 106 | <listitem>
|
---|
[673b0d8] | 107 | <indexterm zone="ch-system-flex flex-"><primary sortas="b-flex++">flex++</primary></indexterm>
|
---|
[bb55064] | 108 | <para>invokes a version of <command>flex</command> that is used exclusively for C++ scanners.</para>
|
---|
[c6cb3aa] | 109 | </listitem>
|
---|
| 110 | </varlistentry>
|
---|
[673b0d8] | 111 |
|
---|
[b8a819f] | 112 | <varlistentry id="libfl.a">
|
---|
[bb55064] | 113 | <term><filename class="libraryfile">libfl.a</filename></term>
|
---|
[c6cb3aa] | 114 | <listitem>
|
---|
[673b0d8] | 115 | <indexterm zone="ch-system-flex libfl.a"><primary sortas="c-libfl.a">libfl.a</primary></indexterm>
|
---|
[c6cb3aa] | 116 | <para>is the flex library.</para>
|
---|
| 117 | </listitem>
|
---|
| 118 | </varlistentry>
|
---|
| 119 | </variablelist>
|
---|
[673b0d8] | 120 |
|
---|
| 121 | </sect2>
|
---|
| 122 |
|
---|
| 123 | </sect1>
|
---|