6.28. Bash-4.0

The Bash package contains the Bourne-Again SHell.

6.28.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.28.2. Installation of Bash

The following patch contains updates from the maintainer. The maintainer of Bash only releases these patches to fix serious issues:

patch -Np1 -i ../bash-4.0-branch_update-6.patch

When bBsh is cross-compiled, it cannot test for the presence of named pipes, among other things. If you used su to become an unprivileged user, this combination will cause Bash to build without process substitution, which will break one of the C++ test scripts in eglibc. The following prevents future problems by skipping the check for named pipes, as well as other tests that can not run while cross-compiling or that do not run properly:

cat > config.cache << "EOF"
ac_cv_func_mmap_fixed_mapped=yes
ac_cv_func_strcoll_works=yes
ac_cv_func_working_mktime=yes
bash_cv_func_sigsetjmp=present
bash_cv_getcwd_malloc=yes
bash_cv_job_control_missing=present
bash_cv_printf_a_format=yes
bash_cv_sys_named_pipes=present
bash_cv_ulimit_maxfds=yes
bash_cv_under_sys_siglist=yes
bash_cv_unusable_rtsigs=no
gt_cv_int_divbyzero_sigfpe=yes
EOF

Prepare Bash for compilation:

./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --prefix=/usr --bindir=/bin --cache-file=config.cache \
    --without-bash-malloc --with-installed-readline

The meaning of the configure option:

--with-installed-readline

This option tells Bash to use the readline library that is already installed on the system rather than using its own readline version.

Compile the package:

make

Install the package:

make DESTDIR=${CLFS} htmldir=/usr/share/doc/bash-4.0 install

Create /bin/sh:

ln -sfv bash ${CLFS}/bin/sh

6.28.3. Contents of Bash

Installed programs: bash, bashbug, and sh (link to bash)

Short Descriptions

bash

A widely-used command interpreter; it performs many types of expansions and substitutions on a given command line before executing it, thus making this interpreter a powerful tool

bashbug

A shell script to help the user compose and mail standard formatted bug reports concerning bash

sh

A symlink to the bash program; when invoked as sh, bash tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well