6.6. Bash-3.1

The Bash package contains the Bourne-Again SHell.

6.6.1. Installation of Bash

Remove a test that causes the build to fail:

echo "ac_cv_func_setvbuf_reversed=no" >> config.cache

When bash is cross-compiled, it cannot test for the presence of named pipes. 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 glibc. Prevent that by forcing the following definition:

echo "bash_cv_sys_named_pipes=yes" >> config.cache

Prepare Bash for compilation:

CC="${CC} ${BUILD64}" CXX="${CXX} ${BUILD64}" \
   ./configure --prefix=/tools \
   --build=${CLFS_HOST} --host=${CLFS_TARGET} \
   --without-bash-malloc --cache-file=config.cache

The meaning of the configure option:

--without-bash-malloc

This option turns off the use of Bash's memory allocation (malloc) function which is known to cause segmentation faults. By turning this option off, Bash will use the malloc functions from Glibc which are more stable.

Compile the package:

make

Install the package:

make install

Make a link for programs that use sh for a shell:

ln -sv bash /tools/bin/sh

Details on this package are located in Section 10.26.2, “Contents of Bash.”