#!/bin/bash # build-cross-2.4.4.sh # # Master script for cross building LFS chapter 5. # # Authors: Ryan Oliver &2 echo " Check plfs-config" 1>&2 exit 1 fi # Get package version information . ${SCRIPTS}/plfs-packages # Source Functions and definitions . ${SCRIPTS}/build-init.sh set +x unset LD_LIBRARY_PATH unset LD_PRELOAD export LDFLAGS="-s" # Setup PATH #export PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH=${HST_TOOLS}/bin:${HST_TOOLS}/sbin:${PATH} # If using distcc, expect that user has set up their own symlinks #export DISTCC_HOSTS="localhost sirius" #DISTCCDIR=/usr/distcc/bin #export PATH=${DISTCCDIR}:${PATH} # If ${SRC} does not exist, create it test -d ${SRC} || mkdir -p ${SRC} # If ${LFS} directory doesn't exist, create it test -d ${LFS} || mkdir -p ${LFS} if [ ! "${USE_SYSROOT}" = "Y" ]; then # If ${LFS}${TGT_TOOLS} directory doesn't exist, create it test -d ${LFS}${TGT_TOOLS} || mkdir -p ${LFS}${TGT_TOOLS} # create it ${TGT_TOOLS} symlink if [ ! -d `dirname ${TGT_TOOLS}` ]; then mkdir -p `dirname ${TGT_TOOLS}` ; fi ln -sf ${LFS}${TGT_TOOLS} `dirname ${TGT_TOOLS}` fi mkdir -p ${CONFLOGS} mkdir -p ${BUILDLOGS} mkdir -p ${INSTLOGS} mkdir -p ${TESTLOGS} cd ${SRC} #scripts_dir="cross-scripts-${VERSION}" scripts_dir="cross-scripts" test "Y" = "${USE_SANITISED_HEADERS}" && { script_list="cross-kern-hdrs.sh cross-san-kern-hdrs.sh" } || { script_list="cross-kern-hdrs.sh" } test "Y" = "${MULTIARCH}" && { script_list="${script_list} cross-binutils.sh cross-gcc-static-no-thread.sh cross-glibc-hdrs.sh cross-gcc-static.sh cross-glibc-crtobjs-32.sh cross-glibc-crtobjs-n32.sh cross-glibc-crtobjs-64.sh cross-gcc-shared.sh" test "N" = "${DEFAULT_64}" && { script_list="${script_list} cross-glibc-full-64.sh cross-glibc-full-32.sh cross-gcc-final.sh" } || { script_list="${script_list} cross-glibc-full-32.sh cross-glibc-full-n32.sh cross-glibc-full-64.sh cross-gcc-final.sh" } } || { script_list="${script_list} cross-binutils.sh cross-gcc-static-no-thread.sh cross-glibc-hdrs.sh cross-gcc-static.sh cross-glibc-crtobjs.sh cross-gcc-shared.sh cross-glibc-full.sh cross-gcc-final.sh" } SCRIPTLIST=`echo "${script_list}" | \ sed "s@\(.*\)@${scripts_dir}/\1@"` # Check if we are resuming from a particular script test ! -z "${1}" && { SCRIPTLIST=`echo ${SCRIPTLIST} | sed "s@.*\(${1}.*\)@\1@g"` } echo ' o Checking for needed sources and tarballs' check_tarballs ${SCRIPTLIST} for script in ${SCRIPTLIST}; do echo "Running ${SCRIPTS}/${script}" # HACK: export SELF to be the script we are running # (keeps logfile output correct) export SELF=${script} ${SCRIPTS}/${script} test 0 = ${?} || { echo echo "Failed script was ${script}" echo "Please fix the error above from" echo " ${SCRIPTS}/${script}" echo "and rerun the build with the command" echo echo " ${0} $script" echo echo "to resume the build." exit 1 } done