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

Last change on this file since e3d9d33 was a2d5ff5, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Fix flex compilation issue.
fix iproute2 formatting.

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