source: clfs-sysroot/BOOK/final-system/common/flex.xml@ 90272a6

Last change on this file since 90272a6 was 90272a6, checked in by Joe Ciccone <jciccone@…>, 17 years ago

Build a PIC libfl.a with flex.

  • Property mode set to 100644
File size: 3.9 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="a">Make sure that Flex doesn't try to include headers from /usr/include.</para>
29
30<screen os="b"><userinput>cp -v Makefile.in{,.orig}
31sed "s/-I@includedir@//g" Makefile.in.orig &gt; Makefile.in</userinput></screen>
32
33 <para os="c">Prepare Flex for compilation:</para>
34
35<screen os="d"><userinput>./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
36 --prefix=/usr</userinput></screen>
37
38 <para os="e">Compile the package:</para>
39
40<screen os="f"><userinput>make CC="${CC} -fPIC" libfl.a
41make</userinput></screen>
42
43 <para os="g">Install the package:</para>
44
45<screen os="h"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
46
47 <para os="i">There are some packages that expect to find the
48 <filename class="libraryfile">lex</filename> library in <filename
49 class="directory">/usr/lib</filename>. Create a symlink to account for
50 this:</para>
51
52<screen os="j"><userinput>ln -sfv libfl.a ${CLFS}/usr/lib/libl.a</userinput></screen>
53
54 <para os="k">A few programs do not know about <command>flex</command> yet and
55 try to run its predecessor, <command>lex</command>. To support those
56 programs, create a wrapper script named <filename>lex</filename> that
57 calls <filename>flex</filename> in <command>lex</command> emulation
58 mode:</para>
59
60<screen os="l"><userinput>cat &gt; ${CLFS}/usr/bin/lex &lt;&lt; "EOF"
61<literal>#!/bin/sh
62# Begin /usr/bin/lex
63
64exec /usr/bin/flex -l "$@"
65
66# End /usr/bin/lex</literal>
67EOF
68chmod -v 755 ${CLFS}/usr/bin/lex</userinput></screen>
69
70 </sect2>
71
72 <sect2 id="contents-flex" role="content">
73 <title>Contents of Flex</title>
74
75 <segmentedlist>
76 <segtitle>Installed programs</segtitle>
77 <segtitle>Installed library</segtitle>
78
79 <seglistitem>
80 <seg>flex and lex</seg>
81 <seg>libfl.a</seg>
82 </seglistitem>
83 </segmentedlist>
84
85 <variablelist>
86 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
87 <?dbfo list-presentation="list"?>
88 <?dbhtml list-presentation="table"?>
89
90 <varlistentry id="flex">
91 <term><command>flex</command></term>
92 <listitem>
93 <para>A tool for generating programs that recognize patterns in text;
94 it allows for the versatility to specify the rules for pattern-finding,
95 eradicating the need to develop a specialized program</para>
96 <indexterm zone="ch-system-flex flex">
97 <primary sortas="b-flex">flex</primary>
98 </indexterm>
99 </listitem>
100 </varlistentry>
101
102 <varlistentry id="lex">
103 <term><command>lex</command></term>
104 <listitem>
105 <para>A script that runs <command>flex</command> in
106 <command>lex</command> emulation mode</para>
107 <indexterm zone="ch-system-flex lex">
108 <primary sortas="b-lex">lex</primary>
109 </indexterm>
110 </listitem>
111 </varlistentry>
112
113 <varlistentry id="libfl.a">
114 <term><filename class="libraryfile">libfl.a</filename></term>
115 <listitem>
116 <para>The <filename class="libraryfile">flex</filename> library</para>
117 <indexterm zone="ch-system-flex libfl.a">
118 <primary sortas="c-libfl.a">libfl.a</primary>
119 </indexterm>
120 </listitem>
121 </varlistentry>
122
123 </variablelist>
124
125 </sect2>
126
127</sect1>
Note: See TracBrowser for help on using the repository browser.