source: chapter06/flex.xml@ 1fe35e1

Last change on this file since 1fe35e1 was 1fe35e1, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • (chapter06/*.xml) RELAX NG validation fixes

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/LFS-RNG/BOOK@4356 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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