Overide locale to C so as to have readable logs.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Nov 20 17:48:10 2008 +0000 (2008-11-20)
changeset 1064492d939dbb19
parent 1063 1b4b6359a329
child 1065 3be98fc8a9a7
Overide locale to C so as to have readable logs.
Offer a DEBUG & EXPERIMENTAL setting to not overide locale.

/trunk/scripts/crosstool.sh | 10 7 3 0 +++++++---
/trunk/config/global/ct-behave.in | 17 17 0 0 +++++++++++++++++
2 files changed, 24 insertions(+), 3 deletions(-)
config/global/ct-behave.in
scripts/crosstool.sh
     1.1 --- a/config/global/ct-behave.in	Thu Nov 20 17:10:09 2008 +0000
     1.2 +++ b/config/global/ct-behave.in	Thu Nov 20 17:48:10 2008 +0000
     1.3 @@ -71,4 +71,21 @@
     1.4        further doesn't gain much, and takes far more time (believe me, I've
     1.5        got figures here! :-) ).
     1.6  
     1.7 +config NO_OVERIDE_LC_MESSAGES
     1.8 +    bool
     1.9 +    prompt "Do *not* overide LC_MESSAGES (EXPERIMENTAL)"
    1.10 +    depends on EXPERIMENTAL
    1.11 +    default n
    1.12 +    help
    1.13 +      By default, crosstool-NG sets and exports LC_ALL=C so that the
    1.14 +      build.log file contains english messages, that can be read by
    1.15 +      people most likely to help interpret the logs. If you say N here,
    1.16 +      and your locale is not an english language, then dissecting your
    1.17 +      log file will be difficult for most people but you.
    1.18 +      
    1.19 +      If you say Y here, then your current locale settings will be used
    1.20 +      to print messages, instead of plain english.
    1.21 +      
    1.22 +      Say N, please.
    1.23 +
    1.24  endif
     2.1 --- a/scripts/crosstool.sh	Thu Nov 20 17:10:09 2008 +0000
     2.2 +++ b/scripts/crosstool.sh	Thu Nov 20 17:48:10 2008 +0000
     2.3 @@ -20,13 +20,17 @@
     2.4  #  - initialise logging.
     2.5  . "${CT_LIB_DIR}/scripts/functions"
     2.6  
     2.7 -CT_STAR_DATE=$(CT_DoDate +%s%N)
     2.8 -CT_STAR_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S)
     2.9 -
    2.10  # Parse the configuration file
    2.11  # It has some info about the logging facility, so include it early
    2.12  . .config
    2.13  
    2.14 +# Overide the locale early, in case we ever translate crosstool-NG messages
    2.15 +[ -z "${CT_NO_OVERIDE_LC_MESSAGES}" ] && export LC_ALL=C
    2.16 +
    2.17 +# Start date. Can't be done until we know the locale
    2.18 +CT_STAR_DATE=$(CT_DoDate +%s%N)
    2.19 +CT_STAR_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S)
    2.20 +
    2.21  # Yes! We can do full logging from now on!
    2.22  CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
    2.23