The log file is no longer configurable: it is always "${CT_PREFIX_DIR}/build.log".
Add an option to compress the log file upon successfull build.
Make rendering the toolchain read-only optional.
A few eye-candy fixes.
1.1 --- a/config/global.in Sun Jun 17 13:02:21 2007 +0000
1.2 +++ b/config/global.in Sun Jun 17 14:51:37 2007 +0000
1.3 @@ -9,7 +9,7 @@
1.4
1.5 menu "Paths and misc options"
1.6
1.7 -comment "Crosstool behavior"
1.8 +comment "Crosstool-ng behavior"
1.9
1.10 config EXPERIMENTAL
1.11 bool
1.12 @@ -194,6 +194,16 @@
1.13 Remove the installed documentation (man and info pages).
1.14 Gains around 8MiB for a uClibc-based, C and C++ compiler.
1.15
1.16 +config INSTALL_DIR_RO
1.17 + bool
1.18 + prompt "Render the toolchain read-only"
1.19 + default n
1.20 + help
1.21 + Render the directory of the toolchain (and its sub-directories)
1.22 + read-only.
1.23 +
1.24 + Usefull for toolchains destined for production.
1.25 +
1.26 comment "Downloading"
1.27
1.28 config FORCE_DOWNLOAD
1.29 @@ -252,7 +262,7 @@
1.30 prompt "ERROR"
1.31 help
1.32 The build will be silent.
1.33 - Only if there is an error will you see a mesage.
1.34 + Only if there is an error will you see a message.
1.35
1.36 config LOG_WARN
1.37 bool
1.38 @@ -297,17 +307,19 @@
1.39
1.40 config LOG_SEE_TOOLS_WARN
1.41 bool
1.42 - prompt "Warnings from the tool builds as CT warnings"
1.43 + prompt "Warnings from the tools' builds"
1.44 default n
1.45 depends on ! LOG_ERROR
1.46 help
1.47 - Treat warnings fron the different tools as crosstool warnings.
1.48 + Treat warnings from the different tools as crosstool-ng warnings.
1.49 If you say 'y' here, then those warnings will be prefixed with
1.50 '[WARN ]' instead of the default '[ALL ]'.
1.51
1.52 You can safely say 'n' here. Those warnings will anyway be
1.53 recorded in the log file (provided you configured one).
1.54
1.55 + Tools error will always be logged as crosstool-ng errors.
1.56 +
1.57 config LOG_PROGRESS_BAR
1.58 bool
1.59 prompt "Progress bar"
1.60 @@ -330,19 +342,20 @@
1.61 default y
1.62 help
1.63 Save *full* logs to a file. Even log levels you didn't specify above
1.64 - will be available in this file.
1.65 + will be available in this file. The log file will be named build.log
1.66 + and stored in the toolchain prefix dir (set above).
1.67
1.68 As a bonus, there is a script in tools/extractConfig.sh that is able
1.69 to extract the configuration of crosstool-NG from the log file.
1.70
1.71 Definitely, say Y.
1.72
1.73 -config LOG_FILE
1.74 - string
1.75 - prompt "Log file"
1.76 - default "${CT_PREFIX_DIR}/${CT_TARGET}.log"
1.77 +config LOG_FILE_COMPRESS
1.78 + bool
1.79 + prompt "Compress the log file"
1.80 + default n
1.81 depends on LOG_TO_FILE
1.82 help
1.83 - File name into which to put logs.
1.84 + Compress the log file once the toolchain is successfully built.
1.85
1.86 endmenu
2.1 --- a/docs/overview.txt Sun Jun 17 13:02:21 2007 +0000
2.2 +++ b/docs/overview.txt Sun Jun 17 14:51:37 2007 +0000
2.3 @@ -133,10 +133,6 @@
2.4 This is where the toolchain will be installed in (and for now, where it
2.5 will run from).
2.6
2.7 -CT_LOG_FILE:
2.8 - The file where *all* log messages will go. Keep the default, in goes in
2.9 - ${CT_PREFIX_DIR}/${CT_TARGET}.log
2.10 -
2.11 CT_TARGET_VENDOR:
2.12 An identifier for your toolchain, will take place in the vendor part of the
2.13 target triplet. It shall *not* contain spaces or dashes. Usually, keep it
3.1 --- a/samples/Makefile Sun Jun 17 13:02:21 2007 +0000
3.2 +++ b/samples/Makefile Sun Jun 17 14:51:37 2007 +0000
3.3 @@ -34,7 +34,6 @@
3.4 sed -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config && \
3.5 sed -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config && \
3.6 sed -i -r -e 's:^.*(CT_LOG_TO_FILE).*$$:\1=y:;' .config && \
3.7 - sed -i -r -e 's:^.*(CT_LOG_FILE).*$$:\1="$${CT_PREFIX_DIR}/build.log":;' .config && \
3.8 sed -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config && \
3.9 yes "" |make -C $(CT_TOP_DIR) defoldconfig >/dev/null 2>&1 && \
3.10 make -C $(CT_TOP_DIR) && \
4.1 --- a/scripts/crosstool.sh Sun Jun 17 13:02:21 2007 +0000
4.2 +++ b/scripts/crosstool.sh Sun Jun 17 14:51:37 2007 +0000
4.3 @@ -211,19 +211,14 @@
4.4 # directory, so we must first ensure it exists and is writeable (above) before
4.5 # we can log there
4.6 exec >/dev/null
4.7 -case "${CT_LOG_TO_FILE},${CT_LOG_FILE}" in
4.8 - ,*) rm -f "${tmp_log_file}"
4.9 - ;;
4.10 - y,/*) mkdir -p "`dirname \"${CT_LOG_FILE}\"`"
4.11 - cat "${tmp_log_file}" >>"${CT_LOG_FILE}"
4.12 - rm -f "${tmp_log_file}"
4.13 - exec >>"${CT_LOG_FILE}"
4.14 - ;;
4.15 - y,*) mkdir -p "`pwd`/`dirname \"${CT_LOG_FILE}\"`"
4.16 - cat "${tmp_log_file}" >>"`pwd`/${CT_LOG_FILE}"
4.17 - rm -f "${tmp_log_file}"
4.18 - exec >>"${CT_LOG_FILE}"
4.19 - ;;
4.20 +case "${CT_LOG_TO_FILE}" in
4.21 + y) CT_LOG_FILE="${CT_PREFIX_DIR}/build.log"
4.22 + cat "${tmp_log_file}" >>"${CT_LOG_FILE}"
4.23 + rm -f "${tmp_log_file}"
4.24 + exec >>"${CT_LOG_FILE}"
4.25 + ;;
4.26 + *) rm -f "${tmp_log_file}"
4.27 + ;;
4.28 esac
4.29
4.30 # Setting up the rest of the environment only is not restarting
4.31 @@ -303,7 +298,7 @@
4.32 # Ah! Recent versions of binutils need some of the build and/or host system
4.33 # (read CT_BUILD and CT_HOST) tools to be accessible (ar is but an example).
4.34 # Do that:
4.35 - CT_DoLog EXTRA "Making build system tools available"
4.36 + CT_DoLog DEBUG "Making build system tools available"
4.37 mkdir -p "${CT_PREFIX_DIR}/bin"
4.38 for tool in ar as dlltool gcc g++ gnatbind gnatmake ld nm ranlib strip windres objcopy objdump; do
4.39 if [ -n "`which ${tool}`" ]; then
4.40 @@ -455,22 +450,24 @@
4.41 rm -rf "${CT_DEBUG_INSTALL_DIR}/"{,usr/}{man,info}
4.42 fi
4.43
4.44 - CT_DoLog EXTRA "Removing access to the build system tools"
4.45 + CT_DoLog DEBUG "Removing access to the build system tools"
4.46 find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \+ |CT_DoLog DEBUG
4.47 find "${CT_PREFIX_DIR}/bin" -name "${CT_UNIQ_BUILD}-"'*' -exec rm -fv {} \+ |CT_DoLog DEBUG
4.48 find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \+ |CT_DoLog DEBUG
4.49 fi
4.50
4.51 -# OK, now we're done, set the toolchain read-only
4.52 -# Don't log, the log file may become read-only any moment...
4.53 -chmod -R a-w "${CT_INSTALL_DIR}"
4.54 -
4.55 -# We still have some small bits to log
4.56 -chmod u+w "${CT_LOG_FILE}"
4.57 -
4.58 CT_DoEnd INFO
4.59
4.60 -# All files should now be read-only, log file included
4.61 -chmod a-w "${CT_LOG_FILE}"
4.62 +if [ "${CT_LOG_FILE_COMPRESS}" = y ]; then
4.63 + CT_DoLog EXTRA "Compressing log file"
4.64 + exec >/dev/null
4.65 + bzip2 -9 "${CT_LOG_FILE}"
4.66 +fi
4.67 +
4.68 +if [ "${CT_INSTALL_DIR_RO}" = "y" ]; then
4.69 + # OK, now we're done, set the toolchain read-only
4.70 + # Don't log, the log file may become read-only any moment...
4.71 + chmod -R a-w "${CT_INSTALL_DIR}" >/dev/null 2>&1
4.72 +fi
4.73
4.74 trap - EXIT
5.1 --- a/scripts/tarball.sh Sun Jun 17 13:02:21 2007 +0000
5.2 +++ b/scripts/tarball.sh Sun Jun 17 14:51:37 2007 +0000
5.3 @@ -92,5 +92,7 @@
5.4 rm -f "${CT_PREFIX_DIR}/${topdir}.${CT_TARGET}.tar.bzip2"
5.5 rm -rf "${tempdir}"
5.6
5.7 -# Render the install directory non-writable
5.8 -chmod u-w "${CT_PREFIX_DIR}"
5.9 +if [ "${CT_INSTALL_DIR_RO}" = "y" ]; then
5.10 + # Render the install directory non-writable
5.11 + chmod u-w "${CT_PREFIX_DIR}"
5.12 +fi