6.35. Flex-2.5.39

The Flex package contains a utility for generating programs that recognize patterns in text.

Approximate build time: 0.3 SBU
Required disk space: 38 MB

6.35.1. Installation of Flex

First, skip running three regression tests that require Bison:

sed -i -e '/test-bison/d' tests/Makefile.in

6.35.2. 32-bit Installation

Prepare Flex for 32-bit compilation:

./configure --prefix=/usr --disable-static \
            --docdir=/usr/share/doc/flex-2.5.39 \
            --libdir=/usr/lib32 \
            CC="gcc -m32" CXX="g++ -m32"

Compile the package:

make

To test the results (about 0.5 SBU), issue:

make check

Install the package:

make install

There are some packages that expect to find the lex library in /usr/lib32. Create a symlink to account for this:

ln -sv libfl.a /usr/lib32/libl.a

Clean up the build directory before moving on to the next platform:

make mostlyclean

6.35.3. x32 ABI Installation

Prepare Flex for x32 ABI compilation:

./configure --prefix=/usr --disable-static \
            --docdir=/usr/share/doc/flex-2.5.39 \
            --libdir=/usr/libx32 \
            CC="gcc -mx32" CXX="g++ -mx32"

Compile the package:

make

To test the results (about 0.5 SBU), issue:

make check

Install the package:

make install

There are some packages that expect to find the lex library in /usr/libx32. Create a symlink to account for this:

ln -sv libfl.a /usr/libx32/libl.a

Clean up the build directory before moving on to the next platform:

make mostlyclean

6.35.4. 64-bit Installation

Prepare Flex for 64-bit compilation:

./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.5.39

Compile the package:

make

To test the results (about 0.5 SBU), issue:

make check

Install the package:

make install

There are some packages that expect to find the lex library in /usr/lib. Create a symlink to account for this:

ln -sv libfl.a /usr/lib/libl.a

A few programs do not know about flex yet and try to run its predecessor, lex. To support those programs, create a symbolic link named lex that runs flex in lex emulation mode:

ln -sv flex /usr/bin/lex

6.35.5. Contents of Flex

Installed programs: flex, flex++ (link to flex), and lex (link to flex)
Installed libraries: libfl.{a,so} and libfl_pic.{a,so}
Installed directory: /usr/share/doc/flex-2.5.39

Short Descriptions

flex

A tool for generating programs that recognize patterns in text; it allows for the versatility to specify the rules for pattern-finding, eradicating the need to develop a specialized program

flex++

An extension of flex, is used for generating C++ code and classes. It is a symbolic link to flex

lex

A script that runs flex in lex emulation mode

libfl

The flex library