source: BOOK/final-system/common/flex.xml@ 213aa8a9

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 213aa8a9 was c51839c, checked in by Joe Ciccone <jciccone@…>, 17 years ago

Build a PIC libfl.a with flex.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-flex" role="wrap">
9 <?dbhtml filename="flex.html"?>
10
11 <title>Flex-&flex-version;</title>
12
13 <indexterm zone="ch-system-flex">
14 <primary sortas="a-Flex">Flex</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Flex package contains a utility for generating programs that
21 recognize patterns in text.</para>
22
23 </sect2>
24
25 <sect2 role="installation">
26 <title>Installation of Flex</title>
27
28 <para os="e">Prepare Flex for compilation:</para>
29
30<screen os="f"><userinput>./configure --prefix=/usr</userinput></screen>
31
32 <para os="g">Compile the package:</para>
33
34<screen os="h"><userinput>make CC="gcc -fPIC" libfl.a
35make</userinput></screen>
36
37 <para os="i">To test the results, issue:
38 <userinput>make check</userinput>.</para>
39
40 <para os="j">Install the package:</para>
41
42<screen os="k"><userinput>make install</userinput></screen>
43
44 <para os="l">There are some packages that expect to find the
45 <filename class="libraryfile">lex</filename> library in <filename
46 class="directory">/usr/lib</filename>. Create a symlink to account for
47 this:</para>
48
49<screen os="m"><userinput>ln -sv libfl.a /usr/lib/libl.a</userinput></screen>
50
51 <para os="n">A few programs do not know about <command>flex</command> yet and
52 try to run its predecessor, <command>lex</command>. To support those
53 programs, create a wrapper script named <filename>lex</filename> that
54 calls <filename>flex</filename> in <command>lex</command> emulation
55 mode:</para>
56
57<screen os="o"><userinput>cat &gt; /usr/bin/lex &lt;&lt; "EOF"
58<literal>#!/bin/sh
59# Begin /usr/bin/lex
60
61exec /usr/bin/flex -l "$@"
62
63# End /usr/bin/lex</literal>
64EOF
65chmod -v 755 /usr/bin/lex</userinput></screen>
66
67 </sect2>
68
69 <sect2 id="contents-flex" role="content">
70 <title>Contents of Flex</title>
71
72 <segmentedlist>
73 <segtitle>Installed programs</segtitle>
74 <segtitle>Installed library</segtitle>
75
76 <seglistitem>
77 <seg>flex and lex</seg>
78 <seg>libfl.a</seg>
79 </seglistitem>
80 </segmentedlist>
81
82 <variablelist>
83 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
84 <?dbfo list-presentation="list"?>
85 <?dbhtml list-presentation="table"?>
86
87 <varlistentry id="flex">
88 <term><command>flex</command></term>
89 <listitem>
90 <para>A tool for generating programs that recognize patterns in text;
91 it allows for the versatility to specify the rules for pattern-finding,
92 eradicating the need to develop a specialized program</para>
93 <indexterm zone="ch-system-flex flex">
94 <primary sortas="b-flex">flex</primary>
95 </indexterm>
96 </listitem>
97 </varlistentry>
98
99 <varlistentry id="lex">
100 <term><command>lex</command></term>
101 <listitem>
102 <para>A script that runs <command>flex</command> in
103 <command>lex</command> emulation mode</para>
104 <indexterm zone="ch-system-flex lex">
105 <primary sortas="b-lex">lex</primary>
106 </indexterm>
107 </listitem>
108 </varlistentry>
109
110 <varlistentry id="libfl.a">
111 <term><filename class="libraryfile">libfl.a</filename></term>
112 <listitem>
113 <para>The <filename class="libraryfile">flex</filename> library</para>
114 <indexterm zone="ch-system-flex libfl.a">
115 <primary sortas="c-libfl.a">libfl.a</primary>
116 </indexterm>
117 </listitem>
118 </varlistentry>
119
120 </variablelist>
121
122 </sect2>
123
124</sect1>
Note: See TracBrowser for help on using the repository browser.