1.1 --- a/scripts/crosstool.sh Sat May 19 13:10:11 2007 +0000
1.2 +++ b/scripts/crosstool.sh Tue May 22 20:36:05 2007 +0000
1.3 @@ -27,8 +27,12 @@
1.4 CT_STAR_DATE=`CT_DoDate +%s%N`
1.5 CT_STAR_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S`
1.6
1.7 -# Log to a temporary file until we have built our environment
1.8 -CT_ACTUAL_LOG_FILE="${CT_TOP_DIR}/$$.log"
1.9 +# Log policy:
1.10 +# - what goes to the log file goes to fd #1 (stdout)
1.11 +# - what goes to the screen goes to fd #6
1.12 +tmp_log_file="${CT_TOP_DIR}/$$.log"
1.13 +exec 6>&1
1.14 +exec >>"${tmp_log_file}"
1.15
1.16 # Are we configured? We'll need that later...
1.17 CT_TestOrAbort "Configuration file not found. Please create one." -f "${CT_TOP_DIR}/.config"
1.18 @@ -182,22 +186,22 @@
1.19 # It's quite understandable that the log file will be installed in the install
1.20 # directory, so we must first ensure it exists and is writeable (above) before
1.21 # we can log there
1.22 +exec >/dev/null
1.23 case "${CT_LOG_TO_FILE},${CT_LOG_FILE}" in
1.24 - ,*) rm -f "${CT_ACTUAL_LOG_FILE}"
1.25 - CT_ACTUAL_LOG_FILE=/dev/null
1.26 + ,*) rm -f "${tmp_log_file}"
1.27 ;;
1.28 y,/*) mkdir -p "`dirname \"${CT_LOG_FILE}\"`"
1.29 - mv "${CT_ACTUAL_LOG_FILE}" "${CT_LOG_FILE}"
1.30 - CT_ACTUAL_LOG_FILE="${CT_LOG_FILE}"
1.31 + mv "${tmp_log_file}" "${CT_LOG_FILE}"
1.32 + exec >>"${CT_LOG_FILE}"
1.33 ;;
1.34 y,*) mkdir -p "`pwd`/`dirname \"${CT_LOG_FILE}\"`"
1.35 - mv "${CT_ACTUAL_LOG_FILE}" "`pwd`/${CT_LOG_FILE}"
1.36 - CT_ACTUAL_LOG_FILE="`pwd`/${CT_LOG_FILE}"
1.37 + mv "${tmp_log_file}" "`pwd`/${CT_LOG_FILE}"
1.38 + exec >>"${CT_LOG_FILE}"
1.39 ;;
1.40 esac
1.41
1.42 # Determine build system if not set by the user
1.43 -CT_Test "You did not specify the build system. Guessing." -z "${CT_BUILD}"
1.44 +CT_Test "You did not specify the build system. That's OK, I can guess..." -z "${CT_BUILD}"
1.45 CT_BUILD="`${CT_TOP_DIR}/tools/config.sub \"${CT_BUILD:-\`${CT_TOP_DIR}/tools/config.guess\`}\"`"
1.46
1.47 # Arrange paths depending on wether we use sys-root or not.