scripts/showSamples.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed May 21 22:00:52 2008 +0000 (2008-05-21)
changeset 527 4ac12179ef23
parent 182 223c84ec2d90
child 539 c538627f69f1
permissions -rwxr-xr-x
Introduce target-specific LDFLAGS, the same way we have CFLAGS for the target.
It seems to be helping gcc somewhat into telling the correct endianness to ld that sticks with little endian even when the target is big (eg armeb-unknown-linux-uclibcgnueabi).
There's still work to do, especially finish the gcc part that is not in this commit.

/trunk/scripts/functions | 9 7 2 0 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
     1 #!/bin/bash
     2 
     3 # Parses all samples on the command line, and for each of them, prints
     4 # the versions of the main tools
     5 
     6 opt="$1"
     7 [ "${opt}" = "-v" ] && shift || opt=
     8 
     9 # GREP_OPTIONS screws things up.
    10 export GREP_OPTIONS=
    11 
    12 # Dump a single sample
    13 dump_single_sample() {
    14     local verbose=0
    15     [ "$1" = "-v" ] && verbose=1 && shift
    16     local width="$1"
    17     local sample="$2"
    18     if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
    19         sample_top="${CT_TOP_DIR}"
    20         sample_type="local"
    21     else
    22         sample_top="${CT_LIB_DIR}"
    23         sample_type="global"
    24     fi
    25     printf "  %-*s  (%s" ${width} "${sample}" "${sample_type}"
    26     [ -f "${sample_top}/samples/${sample}/broken" ] && printf ",broken"
    27     echo ")"
    28     if [ ${verbose} -ne 0 ]; then
    29         . "${sample_top}/samples/${sample}/crosstool.config"
    30         echo    "    OS        : ${CT_KERNEL}-${CT_KERNEL_VERSION}"
    31         echo    "    binutils  : binutils-${CT_BINUTILS_VERSION}"
    32         echo -n "    C compiler: ${CT_CC}-${CT_CC_VERSION} (C"
    33         [ "${CT_CC_LANG_CXX}" = "y"     ] && echo -n ",C++"
    34         [ "${CT_CC_LANG_FORTRAN}" = "y" ] && echo -n ",Fortran"
    35         [ "${CT_CC_LANG_JAVA}" = "y"    ] && echo -n ",Java"
    36         [ "${CT_CC_LANG_ADA}" = "y"     ] && echo -n ",ADA"
    37         [ "${CT_CC_LANG_OBJC}" = "y"    ] && echo -n ",Objective-C"
    38         [ "${CT_CC_LANG_OBJCXX}" = "y"  ] && echo -n ",Objective-C++"
    39         [ -n "${CT_CC_LANG_OTHERS}"     ] && echo -n ",$CT_CC_LANG_OTHERS}"
    40         echo    ")"
    41         echo    "    C library : ${CT_LIBC}-${CT_LIBC_VERSION}"
    42         echo -n "    Tools     :"
    43         [ "${CT_LIBELF}"  ] && echo -n " libelf-${CT_LIBELF_VERSION}"
    44         [ "${CT_SSTRIP}"  ] && echo -n " sstrip"
    45         [ "${CT_DMALLOC}" ] && echo -n " dmalloc-${CT_DMALLOC_VERSION}"
    46         [ "${CT_DUMA}"    ] && echo -n " duma-${CT_DUMA_VERSION}"
    47         [ "${CT_GDB}"     ] && echo -n " gdb-${CT_GDB_VERSION}"
    48         [ "${CT_LTRACE}"  ] && echo -n " ltrace-${CT_LTRACE_VERSION}"
    49         [ "${CT_STRACE}"  ] && echo -n " strace-${CT_STRACE_VERSION}"
    50         echo
    51         echo
    52     fi
    53 }
    54 
    55 # Get largest sample width
    56 width=0
    57 for sample in "${@}"; do
    58     [ ${#sample} -gt ${width} ] && width=${#sample}
    59 done
    60 
    61 for sample in "${@}"; do
    62     ( dump_single_sample ${opt} ${width} "${sample}" )
    63 done