The Readline package is a set of libraries that offers command-line editing and history capabilities.
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"
      The following patch contains updates from the maintainer. The maintainer of Readline only releases these patches to fix serious issues:
patch -Np1 -i ../readline-6.0-branch_update-1.patch
          This option forces Readline to link against the libncursesw library:
        
sed -i 's:^SHLIB_LIBS=:SHLIB_LIBS=-lncursesw:' support/shobj-conf
Prepare Readline for compilation:
./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --prefix=/usr --libdir=/lib
        Compile the package:
make
Install the package:
make DESTDIR=${CLFS} install
        Install the documentation:
make DESTDIR=${CLFS} install-doc
        Now move the static libraries to a more appropriate location:
mv -v ${CLFS}/lib/lib{readline,history}.a ${CLFS}/usr/lib
        
          Next, remove the .so files in
          /lib and relink them into
          /usr/lib.
        
rm -v ${CLFS}/lib/lib{readline,history}.so
ln -sfv ../../lib/libreadline.so.6 ${CLFS}/usr/lib/libreadline.so
ln -sfv ../../lib/libhistory.so.6 ${CLFS}/usr/lib/libhistory.so