scripts/crosstool.sh
changeset 195 1ee5aab4c728
parent 174 75f3f975e2ad
child 197 9383bf4a2e2e
     1.1 --- a/scripts/crosstool.sh	Sun Jun 17 14:51:37 2007 +0000
     1.2 +++ b/scripts/crosstool.sh	Mon Jul 02 17:51:19 2007 +0000
     1.3 @@ -12,17 +12,8 @@
     1.4  # options. It also checks the existing environment for un-friendly variables,
     1.5  # and builds the tools.
     1.6  
     1.7 -# CT_TOP_DIR is set by the makefile. If we don't have it, something's gone horribly wrong...
     1.8 -if [ -z "${CT_TOP_DIR}" -o ! -d "${CT_TOP_DIR}" ]; then
     1.9 -    # We don't have the functions right now, because we don't have CT_TOP_DIR.
    1.10 -    # Do the print stuff by hand:
    1.11 -    echo "CT_TOP_DIR not set, or not a directory. Something's gone horribly wrong."
    1.12 -    echo "Please send a bug report (see README)"
    1.13 -    exit 1
    1.14 -fi
    1.15 -
    1.16  # Parse the common functions
    1.17 -. "${CT_TOP_DIR}/scripts/functions"
    1.18 +. "${CT_LIB_DIR}/scripts/functions"
    1.19  
    1.20  CT_STAR_DATE=`CT_DoDate +%s%N`
    1.21  CT_STAR_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S`
    1.22 @@ -41,7 +32,7 @@
    1.23  CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
    1.24  
    1.25  CT_DoStep DEBUG "Dumping crosstool-NG configuration"
    1.26 -cat ${CT_TOP_DIR}/.config |egrep '^(# |)CT_' |CT_DoLog DEBUG
    1.27 +cat "${CT_TOP_DIR}/.config" |egrep '^(# |)CT_' |CT_DoLog DEBUG
    1.28  CT_EndStep
    1.29  
    1.30  # Some sanity checks in the environment and needed tools
    1.31 @@ -143,7 +134,7 @@
    1.32  CT_SYS_MACHINE=`uname -m`
    1.33  CT_SYS_PROCESSOR=`uname -p`
    1.34  CT_SYS_GCC=`gcc -dumpversion`
    1.35 -CT_SYS_TARGET=`${CT_TOP_DIR}/tools/config.guess`
    1.36 +CT_SYS_TARGET=`CT_DoConfigGuess`
    1.37  CT_TOOLCHAIN_ID="crosstool-${CT_VERSION} build ${CT_STAR_DATE_HUMAN} by ${CT_SYS_USER}@${CT_SYS_HOSTNAME}"
    1.38  
    1.39  CT_DoLog EXTRA "Preparing working directories"
    1.40 @@ -225,7 +216,8 @@
    1.41  if [ -z "${CT_RESTART}" ]; then
    1.42      # Determine build system if not set by the user
    1.43      CT_Test "You did not specify the build system. That's OK, I can guess..." -z "${CT_BUILD}"
    1.44 -    CT_BUILD="`${CT_TOP_DIR}/tools/config.sub \"${CT_BUILD:-\`${CT_TOP_DIR}/tools/config.guess\`}\"`"
    1.45 +    CT_BUILD="${CT_BUILD:-`CT_DoConfigGuess`}"
    1.46 +    CT_BUILD=`CT_DoConfigSub "${CT_BUILD}"`
    1.47  
    1.48      # Arrange paths depending on wether we use sys-root or not.
    1.49      if [ "${CT_USE_SYSROOT}" = "y" ]; then
    1.50 @@ -345,14 +337,14 @@
    1.51  
    1.52  # Include sub-scripts instead of calling them: that way, we do not have to
    1.53  # export any variable, nor re-parse the configuration and functions files.
    1.54 -. "${CT_TOP_DIR}/scripts/build/kernel_${CT_KERNEL}.sh"
    1.55 -. "${CT_TOP_DIR}/scripts/build/binutils.sh"
    1.56 -. "${CT_TOP_DIR}/scripts/build/libfloat.sh"
    1.57 -. "${CT_TOP_DIR}/scripts/build/libc_${CT_LIBC}.sh"
    1.58 -. "${CT_TOP_DIR}/scripts/build/cc_core_${CT_CC_CORE}.sh"
    1.59 -. "${CT_TOP_DIR}/scripts/build/cc_${CT_CC}.sh"
    1.60 -. "${CT_TOP_DIR}/scripts/build/debug.sh"
    1.61 -. "${CT_TOP_DIR}/scripts/build/tools.sh"
    1.62 +. "${CT_LIB_DIR}/scripts/build/kernel_${CT_KERNEL}.sh"
    1.63 +. "${CT_LIB_DIR}/scripts/build/binutils.sh"
    1.64 +. "${CT_LIB_DIR}/scripts/build/libfloat.sh"
    1.65 +. "${CT_LIB_DIR}/scripts/build/libc_${CT_LIBC}.sh"
    1.66 +. "${CT_LIB_DIR}/scripts/build/cc_core_${CT_CC_CORE}.sh"
    1.67 +. "${CT_LIB_DIR}/scripts/build/cc_${CT_CC}.sh"
    1.68 +. "${CT_LIB_DIR}/scripts/build/debug.sh"
    1.69 +. "${CT_LIB_DIR}/scripts/build/tools.sh"
    1.70  
    1.71  if [ -z "${CT_RESTART}" ]; then
    1.72      CT_DoStep INFO "Retrieving needed toolchain components' tarballs"