#!/bin/bash # cross-lfs target bash build # --------------------------- # $LastChangedBy$ # $LastChangedDate$ # $LastChangedRevision$ # $HeadURL$ # cd ${SRC} LOG=bash-target.log unpack_tarball bash-${BASH_VER} && cd ${PKGDIR} set_libdirname setup_multiarch if [ "${USE_SYSROOT}" = "Y" ]; then BUILD_PREFIX=/usr INSTALL_PREFIX="${LFS}${BUILD_PREFIX}" INSTALL_OPTIONS="DESTDIR=${LFS}" else BUILD_PREFIX=${TGT_TOOLS} INSTALL_PREFIX="${TGT_TOOLS}" INSTALL_OPTIONS="" fi case ${BASH_VER} in 2.05b ) # Apply published official patches fro bash-2.05b apply_patch bash-2.05b-gnu_fixes-2 if [ x${TGT_ARCH} = xm68k ]; then cat >config.cache <config.cache < # http://lists.gnu.org/archive/html/bug-bash/2004-09/msg00081.html apply_patch bash-3.0-fixes-1 apply_patch bash-3.0-avoid_WCONTINUED-1 ;; 3.1 ) apply_patch bash-3.1-fixes-5 cat >config.cache < Makefile.in sed "s@size \$(Program)@${TARGET}-&@g" Makefile.in-ORIG > Makefile.in max_log_init Bash ${BASH_VER} "target (shared)" ${CONFLOGS} ${LOG} CC="${TARGET}-gcc ${ARCH_CFLAGS}" \ CXX="${TARGET}-g++ ${ARCH_CFLAGS}" \ AR="${TARGET}-ar" RANLIB="${TARGET}-ranlib" \ CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \ CXXFLAGS="-O2 -pipe ${TGT_CFLAGS}" \ ./configure --prefix=${BUILD_PREFIX} \ --host=${TARGET} --with-curses --cache-file=config.cache \ --without-bash-malloc \ >> ${LOGFILE} 2>&1 && echo " o Configure OK" && # Don't build bash with parallelism, race conditions cause version.h # not to be created min_log_init ${BUILDLOGS} && make LDFLAGS="-s" \ >> ${LOGFILE} 2>&1 && echo " o Build OK" && min_log_init ${INSTLOGS} && make ${INSTALL_OPTIONS} install \ >> ${LOGFILE} 2>&1 && echo " o ALL OK" || barf ln -sf bash ${INSTALL_PREFIX}/bin/sh