Added a few comments here and there
[linux_from_scratch.git] / newxml / chapter06 / flex.xml
blobe0773643dcecc5bcc86855c4e88728979529ef3d
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3CR2//EN" "http://www.docbook.org/xml/4.3CR2/docbookx.dtd" [
3   <!ENTITY % flex-entities SYSTEM "../ent/flex.ent">
4   %flex-entities;
5 ]>
6 <sect1 id="ch06-flex">
7 <title>Installing Flex-&flex-version;</title>
8 <?dbhtml filename="flex.html"?>
10 <screen>Estimated build time:           0.1 SBU
11 Estimated required disk space:  3.4 MB</screen>
13 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../appendixa/flex-contents.xml"/>
17 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../appendixa/flex-deps.xml"/>
21 <sect2>
22 <title>Installation of Flex</title>
24 <para>Prepare Flex for compilation:</para>
26 <screen><userinput>./configure --prefix=/usr</userinput></screen>
28 <para>Compile the package:</para>
30 <screen><userinput>make</userinput></screen>
32 <para>This package has a test suite available which can perform a number of
33 checks to ensure it built correctly.  Should you choose to run it, the 
34 following command will do so:</para>
36 <screen><userinput>make bigcheck</userinput></screen>
38 <para>And install the package:</para>
40 <screen><userinput>make install</userinput></screen>
42 <para>There are some packages that expect to find the Lex library in
43 <filename>/usr/lib</filename>. Create a symlink to account for this:</para>
45 <screen><userinput>ln -s libfl.a /usr/lib/libl.a</userinput></screen>
47 <para>A few programs don't know about <userinput>flex</userinput> yet and try
48 to run its predecessor <userinput>lex</userinput>. To support those programs,
49 create a shell script named <filename>lex</filename> that calls
50 <userinput>flex</userinput> in Lex emulation mode:</para>
52 <screen><userinput>cat &gt; /usr/bin/lex &lt;&lt; "EOF"</userinput>
53 #!/bin/sh
54 # Begin /usr/bin/lex
56 exec /usr/bin/flex -l "$@"
58 # End /usr/bin/lex
59 <userinput>EOF
60 chmod 755 /usr/bin/lex</userinput></screen>
62 </sect2>
64 </sect1>