scripts/wrapper.in
author Javier Viguera <javier.viguera@digi.com>
Thu Apr 07 11:52:23 2011 +0200 (2011-04-07)
branch1.10
changeset 2398 9bafe9c8f0b3
parent 1434 7e7290acccc1
permissions -rw-r--r--
functions: avoid CR when progress bar is not enabled

Using CT-NG with progress bar disabled, still prints CR ('\r') characters
on the output. When you capture the output to a file as part of an
automated build, it shows extra empty lines.

For example:

------------------------------------------------------------
[INFO ] Performing some trivial sanity checks

[INFO ] Build started 20110404.113619

[INFO ] Building environment variables

[EXTRA] Preparing working directories

[EXTRA] Installing user-supplied crosstool-NG configuration
------------------------------------------------------------

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
(transplanted from cbd07f3dd6e3689a6b971e999aa82d09fb94d515)
     1 #!/bin/sh
     2 
     3 # this wrapper will not work under BSD systems or others
     4 # not containig the GNU readlink.
     5 # Under those, wrapper.c will forcibly be used
     6 # regardless of the config file setting.
     7 
     8 canonicalizedname=$(readlink -nm "${0}")
     9 dirname="$(dirname "${canonicalizedname}")"
    10 basename="$(basename "${canonicalizedname}")"
    11 
    12 ld_lib_path="$(dirname "${dirname}")/lib"
    13 
    14 case ":${LD_LIBRARY_PATH}:" in
    15     *":${ld_lib_path}:"*)   ;;
    16     *)  LD_LIBRARY_PATH="${ld_lib_path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}";;
    17 esac
    18 
    19 export LD_LIBRARY_PATH
    20 exec "${dirname}/.${basename}" "$@"