6.25. Bison-2.3

The Bison package contains a parser generator.

User Notes: http://wiki.linuxfromscratch.org/hlfs/wiki/bison

6.25.1. Installation of Bison

Prepare Bison for compilation:

./configure --prefix=/usr

Compile the package:

make

To test the results, issue: make check.

Install the package:

make install

Bison installs the static library liby.a. We can replace this with a shared version with the following commands:

cd lib/
gcc -shared -Wl,-soname,liby.so.2.3 -o liby.so.2.3 -fPIC main.o yyerror.o
rm -v /usr/lib/liby.a
install -v liby.so.2.3 /usr/lib/liby.so.2.3
ln -vsf liby.so.2.3 /usr/lib/liby.so

6.25.2. Contents of Bison

Installed programs: bison and yacc
Installed library: liby.so

Short Descriptions

bison

Generates, from a series of rules, a program for analyzing the structure of text files; Bison is a replacement for Yacc (Yet Another Compiler Compiler)

yacc

A wrapper for bison, meant for programs that still call yacc instead of bison; it calls bison with the -y option

liby.so

The Yacc library containing implementations of Yacc-compatible yyerror and main functions; this library is normally not very useful, but POSIX requires it