Linux HOWTOs

About | Home | Search


HOWTO: bc
Description: An arbitrary precision numeric processing language
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# GNU bc 1.06
# ===========
# Slackware 8.1, 9.0, 9.1, 10.0, 10.1, and 10.2's 'bc' packages include
# version 1.06

# If ftp.gnu.org is busy, use ibiblio instead

# Prerequisites:
# grep
# flex
# bison
# ncurses
# readline
# autoconf (for the patch below)
# automake (")

cd
test -f installed/bc-1.06.tar.gz && mv installed/bc-1.06.tar.gz .
test ! -f bc-1.06.tar.gz && wget http://ftp.gnu.org/gnu/bc/bc-1.06.tar.gz

# Verify tarball w/ md5sum:
echo "d44b5dddebd8a7a7309aea6c36fda117  bc-1.06.tar.gz" | md5sum -c

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "bc-*" -exec rm -r {} \;
tar xzvf ~/bc-1.06.tar.gz
cd bc-1.06
test $UID = 0 && chown -R root:root .

# Patch it so building readline support works:
wget -nc http://englanders.cc/pub/linux/patches/bc-1.06.patch &&
 patch -p1 < bc-1.06.patch
autoreconf -f -i

./configure --prefix=/usr --with-readline
make

# Become root to install it
su

removepkg bc
make install-strip

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/bc-*.tar.*
mv bc-1.06.tar.gz installed/

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>