6.19. Bison-2.4.1

The Bison package contains a parser generator.

6.19.1. Environment Settings

This package requires compiler variables to be set for the target in the environment.

export CC="${CLFS_TARGET}-gcc"
export CXX="${CLFS_TARGET}-g++"
export AR="${CLFS_TARGET}-ar"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
export LD="${CLFS_TARGET}-ld"
export STRIP="${CLFS_TARGET}-strip"

6.19.2. Installation of Bison

Prepare Bison for compilation:

./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --prefix=/usr

The configure system causes Bison to be built without support for internationalization of error messages if a bison program is not already in ${PATH}. The following addition will correct this:

cat >> config.h << "EOF"
#define YYENABLE_NLS 1
EOF

Compile the package:

make

Install the package:

make DESTDIR=${CLFS} install

6.19.3. Contents of Bison

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

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.a

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