# HG changeset patch # User "Yann E. MORIN" # Date 1177360234 0 # Node ID 7e2539937b6e22f876dc92080c4a8c19d2632827 # Parent 1c22b060eb4dbb4327c83ea7420307a9c9dd2ea5 Second shot at merging from the MIPS branch: - log level boost for warnings and errors - option re-ordering - help updating diff -r 1c22b060eb4d -r 7e2539937b6e config/global.in --- a/config/global.in Mon Apr 23 20:27:40 2007 +0000 +++ b/config/global.in Mon Apr 23 20:30:34 2007 +0000 @@ -240,6 +240,18 @@ default "EXTRA" if LOG_EXTRA default "DEBUG" if LOG_DEBUG +config LOG_SEE_TOOLS_WARN + bool + prompt "See warnings from the tool builds" + default n + depends on ! LOG_ERROR + help + If you say Y here, then you will have see the warning lines from + the components builds. + + It should suffice to say N here, as those will anyway be visible + in the log file (if you want one). + config LOG_PROGRESS_BAR bool prompt "Progress bar" @@ -271,6 +283,11 @@ Save *full* logs to a file. Even log levels you didn't specify above will be available in this file. + As a bonus, there is a script in tools/extractConfig.sh that is able + to extract the configuration of crosstool-NG from the log file. + + Definitely, say Y. + config LOG_FILE string prompt "Log file" diff -r 1c22b060eb4d -r 7e2539937b6e config/target.in --- a/config/target.in Mon Apr 23 20:27:40 2007 +0000 +++ b/config/target.in Mon Apr 23 20:30:34 2007 +0000 @@ -4,6 +4,13 @@ comment "General target options" +config ARCH + string + default "arm" if ARCH_ARM + default "mips" if ARCH_MIPS + default "x86" if ARCH_x86 + default "x86_64" if ARCH_x86_64 + choice bool prompt "Target architecture:" @@ -59,6 +66,25 @@ comment "Target optimisations" +config ARCH_ARCH + string + prompt "Achitecture level" + default "" + help + GCC uses this name to determine what kind of instructions it can emit + when generating assembly code. This option can be used in conjunction + with or instead of the ARCH_CPU option (above), or a (command-line) + -mcpu= option. + + This is the configuration flag --with-arch=XXXX, and the runtime flag + -march=XXX. + + Pick a value from the gcc manual for your choosen gcc version and your + target CPU. + + Leave blank if you don't know, or if your target architecture does not + offer this option. + config ARCH_ABI string prompt "Generate code for the specific ABI" @@ -66,6 +92,9 @@ help Generate code for the given ABI. + This is the configuration flag --with-abi=XXXX, and the runtime flag + -mabi=XXX. + Pick a value from the gcc manual for your choosen gcc version and your target CPU. @@ -81,6 +110,9 @@ to determine what kind of instructions it can emit when generating assembly code. + This is the configuration flag --with-cpu=XXXX, and the runtime flag + -mcpu=XXX. + Pick a value from the gcc manual for your choosen gcc version and your target CPU. @@ -100,21 +132,8 @@ will generate based on the cpu specified by the ARCH_CPU option (above), or a (command-line) -mcpu= option. - Pick a value from the gcc manual for your choosen gcc version and your - target CPU. - - Leave blank if you don't know, or if your target architecture does not - offer this option. - -config ARCH_ARCH - string - prompt "Achitecture level" - default "" - help - GCC uses this name to determine what kind of instructions it can emit - when generating assembly code. This option can be used in conjunction - with or instead of the ARCH_CPU option (above), or a (command-line) - -mcpu= option. + This is the configuration flag --with-tune=XXXX, and the runtime flag + -mtune=XXX. Pick a value from the gcc manual for your choosen gcc version and your target CPU. @@ -124,11 +143,14 @@ config ARCH_FPU string - prompt "Use FPU" + prompt "Use specific FPU" default "" help On some targets (eg. ARM), you can specify the kind of FPU to emit code for. + + This is the configuration flag --with-fpu=XXX, and the runtime flag + -mfpu=XXX. See below wether to actually emit FP opcodes, or to emulate them. diff -r 1c22b060eb4d -r 7e2539937b6e config/toolchain.in --- a/config/toolchain.in Mon Apr 23 20:27:40 2007 +0000 +++ b/config/toolchain.in Mon Apr 23 20:30:34 2007 +0000 @@ -69,13 +69,6 @@ You shouldn't need to enter anything here, unless you plan to manually call the tools (autotools-based ./configure will use the standard name). -config ARCH - string - default "arm" if ARCH_ARM - default "mips" if ARCH_MIPS - default "x86" if ARCH_x86 - default "x86_64" if ARCH_x86_64 - comment "Toolchain type" choice diff -r 1c22b060eb4d -r 7e2539937b6e scripts/functions --- a/scripts/functions Mon Apr 23 20:27:40 2007 +0000 +++ b/scripts/functions Mon Apr 23 20:30:34 2007 +0000 @@ -59,14 +59,13 @@ # Usage: CT_DoLog [message] # If message is empty, then stdin will be logged. CT_DoLog() { - local max_level - local level + local max_level LEVEL level cur_l cur_L + local l eval max_level="\${CT_LOG_LEVEL_${CT_LOG_LEVEL_MAX}}" # Set the maximum log level to DEBUG if we have none [ -z ${max_level} ] && max_level=${CT_LOG_LEVEL_DEBUG} - local LEVEL="$1" - shift + LEVEL="$1"; shift eval level="\${CT_LOG_LEVEL_${LEVEL}}" if [ $# -eq 0 ]; then @@ -77,12 +76,18 @@ cpt=0 indent=$((2*CT_STEP_COUNT)) while read line; do - l="`printf \"[%-5s]%*s%s%s\" \"${LEVEL}\" \"${indent}\" \" \" \"${line}\"`" + case "${CT_LOG_SEE_TOOLS_WARN},${line}" in + y,*"warning:"*) cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};; + *"error:"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; + "make["?*"]:"*"Stop.") cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; + *) cur_L="${LEVEL}"; cur_l="${level}";; + esac + l="`printf \"[%-5s]%*s%s%s\" \"${cur_L}\" \"${indent}\" \" \" \"${line}\"`" # There will always be a log file, be it /dev/null echo -e "${l}" >>"${CT_ACTUAL_LOG_FILE}" - color="CT_${LEVEL}_COLOR" + color="CT_${cur_L}_COLOR" normal="CT_NORMAL_COLOR" - if [ ${level} -le ${max_level} ]; then + if [ ${cur_l} -le ${max_level} ]; then echo -e "${!color}${l}${!normal}" else ${CT_PROG_BAR}