flex.xml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <sect1 id="ch-system-flex" xreflabel="Flex">
  2. <title>Installing Flex-&flex-version;</title>
  3. <?dbhtml filename="flex.html" dir="chapter06"?>
  4. <para>The Flex package contains a utility for generating programs that
  5. recognize patterns in text.</para>
  6. <screen>&buildtime; &flex-time;
  7. &diskspace; &flex-compsize;</screen>
  8. &aa-flex-down;
  9. &aa-flex-dep;
  10. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  11. <sect2>
  12. <title>Installation of Flex</title>
  13. <para>Prepare Flex for compilation:</para>
  14. <screen><userinput>./configure --prefix=/usr</userinput></screen>
  15. <para>Compile the package:</para>
  16. <screen><userinput>make</userinput></screen>
  17. <para>This package has a test suite available which can perform a number of
  18. checks to ensure it built correctly. Should you choose to run it, the
  19. following command will do so:</para>
  20. <screen><userinput>make bigcheck</userinput></screen>
  21. <para>And install the package:</para>
  22. <screen><userinput>make install</userinput></screen>
  23. <para>There are some packages that expect to find the Lex library in
  24. <filename>/usr/lib</filename>. Create a symlink to account for this:</para>
  25. <screen><userinput>ln -s libfl.a /usr/lib/libl.a</userinput></screen>
  26. <para>A few programs don't know about <userinput>flex</userinput> yet and try
  27. to run its predecessor <userinput>lex</userinput>. To support those programs,
  28. create a shell script named <filename>lex</filename> that calls
  29. <userinput>flex</userinput> in Lex emulation mode:</para>
  30. <screen><userinput>cat &gt; /usr/bin/lex &lt;&lt; "EOF"</userinput>
  31. #!/bin/sh
  32. # Begin /usr/bin/lex
  33. exec /usr/bin/flex -l "$@"
  34. # End /usr/bin/lex
  35. <userinput>EOF
  36. chmod 755 /usr/bin/lex</userinput></screen>
  37. </sect2>
  38. &aa-flex-shortdesc;
  39. &aa-flex-desc;
  40. </sect1>