10.39. Flex-2.5.33 64 Bit

#### Cross-Compiled Linux From Scratch - Version 1.0.0rc2-x86_64-Multilib

### Chapter 10. Installing Basic System Software

- Prev

  Flex-2.5.33 32 Bit Libraries

- Next

  Gawk-3.1.5

- Up.
- Home

# 10.39. Flex-2.5.33 64 Bit

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

## 10.39.1. Installation of Flex

Prepare Flex for compilation:

    CC="gcc ${BUILD64}" ./configure --prefix=/usr \
        --libdir=/usr/lib64

Compile the package:

    make

To test the results, issue: `make check`.

Install the package:

    make install

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

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

A few programs do not know about flex yet and try to run its predecessor, lex. To support those programs, create a wrapper 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 -v 755 /usr/bin/lex

## 10.39.2. Contents of Flex

Installed programs: flex and lex
Installed library: libfl.a

### 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
lex | A script that runs flex in lex emulation mode
`libfl.a` | The `flex` library

- Prev

  Flex-2.5.33 32 Bit Libraries

- Next

  Gawk-3.1.5

- Up.
- Home.