Linux From Scratch: Version 5.0-pre1
Prev | Chapter 6. Installing basic system software | Next

# Installing Flex-2.5.4a

    Estimated build time:           0.1 SBU
    Estimated required disk space:  3 MB

## Contents of Flex

(Last checked against version 2.5.4a.)

The Flex package is used to generate programs which recognize patterns in text.

Flex installs the following:

### Program Files

flex, flex++ (link to flex) and lex

### Library Files

libfl.a

##

## Flex Installation Dependencies

(Last checked against version 2.5.4a.)

Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Coreutils: cat, chmod, cp, echo, hostname, install, ln, mv, rm, touch, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed

##

## Installation of Flex

Prepare Flex for compilation:

    ./configure --prefix=/usr

Compile the package:

    make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

    make bigcheck

And 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 -s libfl.a /usr/lib/libl.a

A few programs don't know about `flex` yet and try to run its predecessor `lex`. To support those programs, create a shell script named `lex` that calls `flex` in Lex emulation mode:

    cat > /usr/bin/lex << "EOF"
    #!/bin/sh
    # Begin /usr/bin/lex

    exec /usr/bin/flex -l "$@"

    # End /usr/bin/lex
    EOF
    chmod 755 /usr/bin/lex

Prev | Home | Next
Installing Sed-4.0.7 | Up | Installing Gettext-0.12.1