flex.xml 4.5 KB

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