[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 |
|
---|
| 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}
|
---|
| 31 | sed "s/-I@includedir@//g" Makefile.in.orig > Makefile.in</userinput></screen>
|
---|
| 32 |
|
---|
| 33 | <para os="c">Prepare Flex for compilation:</para>
|
---|
| 34 |
|
---|
[cee2ca2] | 35 | <screen os="d"><userinput>./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
|
---|
| 36 | --prefix=/usr</userinput></screen>
|
---|
[02095ae] | 37 |
|
---|
| 38 | <para os="e">Compile the package:</para>
|
---|
| 39 |
|
---|
[90272a6] | 40 | <screen os="f"><userinput>make CC="${CC} -fPIC" libfl.a
|
---|
| 41 | make</userinput></screen>
|
---|
[02095ae] | 42 |
|
---|
| 43 | <para os="g">Install the package:</para>
|
---|
| 44 |
|
---|
[586feb7] | 45 | <screen os="h"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
|
---|
[02095ae] | 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 |
|
---|
[7e336f1] | 52 | <screen os="j"><userinput>ln -sfv libfl.a ${CLFS}/usr/lib/libl.a</userinput></screen>
|
---|
[02095ae] | 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 |
|
---|
[586feb7] | 60 | <screen os="l"><userinput>cat > ${CLFS}/usr/bin/lex << "EOF"
|
---|
[02095ae] | 61 | <literal>#!/bin/sh
|
---|
| 62 | # Begin /usr/bin/lex
|
---|
| 63 |
|
---|
| 64 | exec /usr/bin/flex -l "$@"
|
---|
| 65 |
|
---|
| 66 | # End /usr/bin/lex</literal>
|
---|
| 67 | EOF
|
---|
[586feb7] | 68 | chmod -v 755 ${CLFS}/usr/bin/lex</userinput></screen>
|
---|
[02095ae] | 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>
|
---|