8.8. bc 7.0.3

Build and install bc in the final target environment for standards-compatible calculator functionality.

Input assumption: bc-7.0.3.tar.xz is already present in /sources from the chapter 4 source staging step.

Source URL: https://github.com/gavinhoward/bc/releases/download/7.0.3/bc-7.0.3.tar.xz

Upstream build note: this package uses its own configure.sh build system and upstream documents ./configure.sh + make + make install for POSIX-compatible systems.

Licenses:

Dependencies:

bc is a POSIX arbitrary-precision calculator implementation with integrated dc mode. we need it to provide a standards-compatible calculator for scripts and interactive numeric work in chapter 8.

Extract and Enter the Source Tree

cd /sources
tar -xf bc-7.0.3.tar.xz
cd bc-7.0.3

Configure bc

bc does not use autotools configure, so lbi_configure is not applicable here.
CC="cc -std=c99" ./configure.sh \
    --prefix=/system \
    --bindir=/system/binaries \
    --libdir=/system/libraries \
    --datarootdir=/system/documentation \
    --datadir=/system/documentation \
    --mandir=/system/documentation/man-pages \
    --man1dir=/system/documentation/man-pages/man1 \
    --man3dir=/system/documentation/man-pages/man3 \
    --disable-nls

Build bc

make $LWI_MAKE_FLAGS

Install bc

make install
After this step is complete, you can remove the extracted source directory and source tarball from /sources if you do not plan to rebuild bc again.

Command Explanations