5.5. Installing Bash-2.05a

Estimated build time:           1 SBU 
Estimated required disk space:  24 MB

5.5.1. Installation of Bash

Before you attempt to install Bash, you have to check to make sure your distribution has the /usr/lib/libcurses.a and /usr/lib/libncurses.a files. If your host distribution is an LFS system, all files will be present if you followed the instructions of the book version you read exactly.

If both of the files are missing, you have to install the Ncurses development package. This package is often called something like ncurses-dev. If this package is already installed, or you just installed it, check for the two files again. Often the libcurses.a file is (still) missing. If so, then create libcurses.a as a symlink by running the following commands as user root:

ln -s libncurses.a /usr/lib/libcurses.a

Now we can continue. Install Bash by running the following commands:

./configure --enable-static-link \
    --prefix=$LFS/static --with-curses &&
make &&
make install

If the make install phase ends with something along the lines of this:

install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir' 
usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn] 
	[--section regexp title] [--infodir=xxx] [--align=nnn] 
	[--calign=nnn] [--quiet] [--menuentry=xxx]
	[--keep-old] [--description=xxx] [--test]
	[--remove] [--] filename 
make[1]: *** [install] Error 1 
make[1]: Leaving directory `/mnt/lfs/usr/src/bash-2.05a/doc' 
make: [install] Error 2 (ignored)

then that means that you are probably using Debian-2.2 (potato), and that you have an old version of the texinfo package. This error is not severe by any means: the info pages will be installed when we recompile bash dynamically in Chapter 6, so you can ignore it. It is reported that the current release of Debian (3.0; also known as Woody) doesn't have this problem.

5.5.2. Command explanations

--enable-static-link: This configure option causes bash to be linked statically.

--prefix=$LFS/static: This configure option installs all of Bash's files under the $LFS/static directory, which becomes the /static directory when chroot'ed or reboot'ed into LFS.

--with-curses: This causes bash to be linked against the curses library instead of the default termcap library which is becoming obsolete.

It is not strictly necessary for the static bash to be linked against libncurses (it can link against a static termcap for the time being just fine because we will reinstall Bash in Chapter 6 anyways, where we will use libncurses), but it's a good test to make sure that the Ncurses package has been installed properly. If not, you will get in trouble later on in this chapter when you install the Texinfo package. That package requires ncurses, and termcap can't reliably be used there.

The &&'s at the end of every line cause the next command to be executed only if the previous command exits with a return value of 0 indicating success. In case all of these commands are copy & pasted on the shell, it is important to ensure that if ./configure fails, make isn't executed and, likewise, if make fails, that make install isn't executed, and so forth.

5.5.3. Contents of Bash

Last checked against version 2.05a.

5.5.4. Bash Installation Dependencies

Last checked against version 2.05a.

Bash: bash, sh
Binutils: ar, as, ld, ranlib, size
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr, uniq