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

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

Added a sysroot wrapper.
Updated the build variables section of the book, each package uses its own.

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