flex.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-flex" role="wrap">
  7. <title>Flex-&flex-version;</title>
  8. <?dbhtml filename="flex.html"?>
  9. <indexterm zone="ch-system-flex"><primary sortas="a-Flex">Flex</primary></indexterm>
  10. <sect2 role="package"><title/>
  11. <para>The Flex package contains a utility for generating programs that
  12. recognize patterns in text.</para>
  13. <segmentedlist>
  14. <segtitle>&buildtime;</segtitle>
  15. <segtitle>&diskspace;</segtitle>
  16. <seglistitem><seg>0.1 SBU</seg><seg>22.5 MB</seg></seglistitem>
  17. </segmentedlist>
  18. <segmentedlist>
  19. <segtitle>&dependencies;</segtitle>
  20. <seglistitem><seg>Bash, Binutils, Bison, Coreutils, Diffutils,
  21. GCC, Gettext, Glibc, Grep, M4, Make, and Sed</seg></seglistitem>
  22. </segmentedlist>
  23. </sect2>
  24. <sect2 role="installation">
  25. <title>Installation of Flex</title>
  26. <para>Flex contains several known bugs. Fix these with the following patch:</para>
  27. <screen><userinput>patch -Np1 -i ../&flex-fixes-patch;</userinput></screen>
  28. <para>The GNU autotools detects that the Flex source code has been
  29. modified by the previous patch and tries to update the man page
  30. accordingly. This does not work correctly on many systems, and the
  31. default page is fine, so make sure it does not get regenerated:</para>
  32. <screen><userinput>touch doc/flex.1</userinput></screen>
  33. <para>Prepare Flex for compilation:</para>
  34. <screen><userinput>./configure --prefix=/usr</userinput></screen>
  35. <para>Compile the package:</para>
  36. <screen><userinput>make</userinput></screen>
  37. <para>To test the results, issue:
  38. <userinput>make check</userinput>.</para>
  39. <para>Install the package:</para>
  40. <screen><userinput>make install</userinput></screen>
  41. <para>There are some packages that expect to find the
  42. <filename class="libraryfile">lex</filename> library in <filename
  43. class="directory">/usr/lib</filename>. Create a symlink to account for
  44. this:</para>
  45. <screen><userinput>ln -sv libfl.a /usr/lib/libl.a</userinput></screen>
  46. <para>A few programs do not know about <command>flex</command> yet and
  47. try to run its predecessor, <command>lex</command>. To support those
  48. programs, create a wrapper script named <filename>lex</filename> that
  49. calls <filename>flex</filename> in <command>lex</command> emulation mode:</para>
  50. <screen><userinput>cat &gt; /usr/bin/lex &lt;&lt; "EOF"
  51. <literal>#!/bin/sh
  52. # Begin /usr/bin/lex
  53. exec /usr/bin/flex -l "$@"
  54. # End /usr/bin/lex</literal>
  55. EOF
  56. chmod -v 755 /usr/bin/lex</userinput></screen>
  57. </sect2>
  58. <sect2 id="contents-flex" role="content"><title>Contents of Flex</title>
  59. <segmentedlist>
  60. <segtitle>Installed programs</segtitle>
  61. <segtitle>Installed library</segtitle>
  62. <seglistitem><seg>flex and lex</seg>
  63. <seg>libfl.a</seg></seglistitem>
  64. </segmentedlist>
  65. <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
  66. <?dbfo list-presentation="list"?>
  67. <?dbhtml list-presentation="table"?>
  68. <varlistentry id="flex">
  69. <term><command>flex</command></term>
  70. <listitem>
  71. <para>A tool for generating programs that recognize patterns in text;
  72. it allows for the versatility to specify the rules for
  73. pattern-finding, eradicating the need to develop a specialized
  74. program</para>
  75. <indexterm zone="ch-system-flex flex"><primary sortas="b-flex">flex</primary></indexterm>
  76. </listitem>
  77. </varlistentry>
  78. <varlistentry id="lex">
  79. <term><command>lex</command></term>
  80. <listitem>
  81. <para>A script that runs <command>flex</command> in <command>lex</command>
  82. emulation mode</para>
  83. <indexterm zone="ch-system-flex lex"><primary sortas="b-lex">lex</primary></indexterm>
  84. </listitem>
  85. </varlistentry>
  86. <varlistentry id="libfl.a">
  87. <term><filename class="libraryfile">libfl.a</filename></term>
  88. <listitem>
  89. <para>The <filename class="libraryfile">flex</filename> library</para>
  90. <indexterm zone="ch-system-flex libfl.a"><primary sortas="c-libfl.a">libfl.a</primary></indexterm>
  91. </listitem>
  92. </varlistentry>
  93. </variablelist>
  94. </sect2>
  95. </sect1>