X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=functions;h=79a57e1b835491bc040e3af9e5ef67b5cdefc27d;hb=e31a492ed6daa2caeb62aa9ce355c988a62672df;hp=b799c5115e93b7993d50b06930828129fbf5a7b7;hpb=f9cf3632a64429991fa5e6f556b0c4017e0e9435;p=hvlinux.git diff --git a/functions b/functions index b799c51..79a57e1 100644 --- a/functions +++ b/functions @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # This file is 'sourced' by other scripts, therefore the above line is of no # use, except when modifying the file in emacs to have syntax highlighting. @@ -22,6 +22,8 @@ BRACKET="\033[1;34m" TAR_OPTS="-b8" +HV_FONTS_PATH="/usr/share/fonts" + # It seems that when compiling bash-4.0, using # "make -j 1" is causing problems... if [ "x${MAKEJOBS}" = "x1" ]; then @@ -31,14 +33,27 @@ else fi case "${HVL_TARGET}" in + arm*) + CLFS_BUILDFLAGS="-mabi=aapcs-linux -mfloat-abi=soft" + CLFS_TARGET="arm-linux-gnueabi" + CLFS_ARCH=$(echo ${CLFS_TARGET} | sed -e 's/-.*//' -e 's/arm.*/arm/g') + CLFS_ENDIAN=$(echo ${CLFS_ARCH} | sed -e 's/armeb/BIG/' -e 's/arm/LITTLE/') + if [ "${CLFS_ENDIAN}" = "LITTLE" ]; then + CLFS_NOT_ENDIAN="BIG" + else + CLFS_NOT_ENDIAN="LITTLE" + fi + ;; "x86_64") CLFS_BUILDFLAGS="-m64" CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu" + CLFS_ARCH=${HVL_TARGET} ;; "x86") # No special flags CLFS_BUILDFLAGS="" CLFS_TARGET="i686-unknown-linux-gnu" + CLFS_ARCH=${HVL_TARGET} ;; *) echo "Unsupported target architecture: ${HVL_TARGET}" @@ -46,6 +61,11 @@ case "${HVL_TARGET}" in ;; esac +CLFS_HOST="$(echo $MACHTYPE | \ + sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")" + +export CLFS_BUILDFLAGS CLFS_TARGET CLFS_ARCH CLFS_HOST CLFS_ENDIAN CLFS_NOT_ENDIAN + CLFS=${LFS} # Extracting the version number from a complete package name. @@ -97,7 +117,7 @@ get_pkg_name() return 1 fi - echo ${1} | sed "s!^\(.*\)-.*!\1!g" + echo ${1} | sed "s!^\(.*\)-[0-9]*\.[0-9]*.*!\1!g" } # Saves the content of CFLAGS and CXXFLAGS environment variables. @@ -853,7 +873,14 @@ rcmd() # Executing command ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE} 2>&1 - eval_retval + if [ $? -ne 0 ]; then + print_status failure + if [ -n "${RCMD_NO_EXIT}" ]; then + return ${EXIT_FAILURE} + else + exit ${EXIT_FAILURE} + fi + fi # Displaying build time after the package name print_status success