Installing Flex-2.5.4a

Estimated build time:           0.05 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

 

Flex Installation Dependencies

Last checked against version 2.5.4a.

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

 

Installation of Flex

Prepare Flex to be compiled:

./configure --prefix=/usr

Continue with compiling the package:

make

Install the package:

make install

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

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

Some programs don't know about flex and try to find the lex program (flex is a (better) alternative for lex). To please those programs, create a shell script named lex which calls flex in 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