scripts/crosstool.sh
changeset 174 75f3f975e2ad
parent 165 a291bfa17715
child 182 223c84ec2d90
     1.1 --- a/scripts/crosstool.sh	Sat Jun 16 22:23:53 2007 +0000
     1.2 +++ b/scripts/crosstool.sh	Sun Jun 17 14:51:37 2007 +0000
     1.3 @@ -211,19 +211,14 @@
     1.4  # directory, so we must first ensure it exists and is writeable (above) before
     1.5  # we can log there
     1.6  exec >/dev/null
     1.7 -case "${CT_LOG_TO_FILE},${CT_LOG_FILE}" in
     1.8 -    ,*)   rm -f "${tmp_log_file}"
     1.9 -          ;;
    1.10 -    y,/*) mkdir -p "`dirname \"${CT_LOG_FILE}\"`"
    1.11 -          cat "${tmp_log_file}" >>"${CT_LOG_FILE}"
    1.12 -          rm -f "${tmp_log_file}"
    1.13 -          exec >>"${CT_LOG_FILE}"
    1.14 -          ;;
    1.15 -    y,*)  mkdir -p "`pwd`/`dirname \"${CT_LOG_FILE}\"`"
    1.16 -          cat "${tmp_log_file}" >>"`pwd`/${CT_LOG_FILE}"
    1.17 -          rm -f "${tmp_log_file}"
    1.18 -          exec >>"${CT_LOG_FILE}"
    1.19 -          ;;
    1.20 +case "${CT_LOG_TO_FILE}" in
    1.21 +    y)  CT_LOG_FILE="${CT_PREFIX_DIR}/build.log"
    1.22 +        cat "${tmp_log_file}" >>"${CT_LOG_FILE}"
    1.23 +        rm -f "${tmp_log_file}"
    1.24 +        exec >>"${CT_LOG_FILE}"
    1.25 +        ;;
    1.26 +    *)  rm -f "${tmp_log_file}"
    1.27 +        ;;
    1.28  esac
    1.29  
    1.30  # Setting up the rest of the environment only is not restarting
    1.31 @@ -303,7 +298,7 @@
    1.32      # Ah! Recent versions of binutils need some of the build and/or host system
    1.33      # (read CT_BUILD and CT_HOST) tools to be accessible (ar is but an example).
    1.34      # Do that:
    1.35 -    CT_DoLog EXTRA "Making build system tools available"
    1.36 +    CT_DoLog DEBUG "Making build system tools available"
    1.37      mkdir -p "${CT_PREFIX_DIR}/bin"
    1.38      for tool in ar as dlltool gcc g++ gnatbind gnatmake ld nm ranlib strip windres objcopy objdump; do
    1.39          if [ -n "`which ${tool}`" ]; then
    1.40 @@ -455,22 +450,24 @@
    1.41          rm -rf "${CT_DEBUG_INSTALL_DIR}/"{,usr/}{man,info}
    1.42      fi
    1.43  
    1.44 -    CT_DoLog EXTRA "Removing access to the build system tools"
    1.45 +    CT_DoLog DEBUG "Removing access to the build system tools"
    1.46      find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \+ |CT_DoLog DEBUG
    1.47      find "${CT_PREFIX_DIR}/bin" -name "${CT_UNIQ_BUILD}-"'*' -exec rm -fv {} \+ |CT_DoLog DEBUG
    1.48      find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \+ |CT_DoLog DEBUG
    1.49  fi
    1.50  
    1.51 -# OK, now we're done, set the toolchain read-only
    1.52 -# Don't log, the log file may become read-only any moment...
    1.53 -chmod -R a-w "${CT_INSTALL_DIR}"
    1.54 -
    1.55 -# We still have some small bits to log
    1.56 -chmod u+w "${CT_LOG_FILE}"
    1.57 -
    1.58  CT_DoEnd INFO
    1.59  
    1.60 -# All files should now be read-only, log file included
    1.61 -chmod a-w "${CT_LOG_FILE}"
    1.62 +if [ "${CT_LOG_FILE_COMPRESS}" = y ]; then
    1.63 +    CT_DoLog EXTRA "Compressing log file"
    1.64 +    exec >/dev/null
    1.65 +    bzip2 -9 "${CT_LOG_FILE}"
    1.66 +fi
    1.67 +
    1.68 +if [ "${CT_INSTALL_DIR_RO}" = "y" ]; then
    1.69 +    # OK, now we're done, set the toolchain read-only
    1.70 +    # Don't log, the log file may become read-only any moment...
    1.71 +    chmod -R a-w "${CT_INSTALL_DIR}" >/dev/null 2>&1
    1.72 +fi
    1.73  
    1.74  trap - EXIT