scripts/showSamples.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Jul 25 16:14:42 2008 +0000 (2008-07-25)
changeset 724 a30dd922ff1e
parent 723 bea5656eb1d1
child 737 f02cd568eec9
permissions -rwxr-xr-x
Also print the number of samples in the DokuWiki table.

/trunk/scripts/showSamples.sh | 6 6 0 0 ++++++
1 file changed, 6 insertions(+)
yann@74
     1
#!/bin/bash
yann@74
     2
yann@74
     3
# Parses all samples on the command line, and for each of them, prints
yann@74
     4
# the versions of the main tools
yann@74
     5
yann@560
     6
[ "$1" = "-v" ] && opt="$1" && shift
yann@560
     7
[ "$1" = "-w" ] && opt="$1" && shift
yann@474
     8
yann@74
     9
# GREP_OPTIONS screws things up.
yann@74
    10
export GREP_OPTIONS=
yann@74
    11
yann@74
    12
# Dump a single sample
yann@74
    13
dump_single_sample() {
yann@474
    14
    local verbose=0
yann@474
    15
    [ "$1" = "-v" ] && verbose=1 && shift
yann@560
    16
    [ "$1" = "-w" ] && wiki=1 && shift
yann@74
    17
    local width="$1"
yann@74
    18
    local sample="$2"
yann@182
    19
    if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
yann@182
    20
        sample_top="${CT_TOP_DIR}"
yann@182
    21
        sample_type="local"
yann@182
    22
    else
yann@182
    23
        sample_top="${CT_LIB_DIR}"
yann@182
    24
        sample_type="global"
yann@182
    25
    fi
yann@560
    26
    . "${sample_top}/samples/${sample}/crosstool.config"
yann@560
    27
    if [ -z "${wiki}" ]; then
yann@560
    28
        printf "  %-*s  (%s" ${width} "${sample}" "${sample_type}"
yann@560
    29
        [ -f "${sample_top}/samples/${sample}/broken" ] && printf ",broken"
yann@560
    30
        echo ")"
yann@560
    31
        if [ ${verbose} -ne 0 ]; then
yann@560
    32
            echo    "    OS        : ${CT_KERNEL}-${CT_KERNEL_VERSION}"
yann@560
    33
            echo    "    binutils  : binutils-${CT_BINUTILS_VERSION}"
yann@642
    34
            printf  "    C compiler: ${CT_CC}-${CT_CC_VERSION} (C"
yann@642
    35
            [ "${CT_CC_LANG_CXX}" = "y"     ] && printf ",C++"
yann@642
    36
            [ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ",Fortran"
yann@642
    37
            [ "${CT_CC_LANG_JAVA}" = "y"    ] && printf ",Java"
yann@642
    38
            [ "${CT_CC_LANG_ADA}" = "y"     ] && printf ",ADA"
yann@642
    39
            [ "${CT_CC_LANG_OBJC}" = "y"    ] && printf ",Objective-C"
yann@642
    40
            [ "${CT_CC_LANG_OBJCXX}" = "y"  ] && printf ",Objective-C++"
yann@649
    41
            [ -n "${CT_CC_LANG_OTHERS}"     ] && printf ",${CT_CC_LANG_OTHERS}"
yann@560
    42
            echo    ")"
yann@560
    43
            echo    "    C library : ${CT_LIBC}-${CT_LIBC_VERSION}"
yann@642
    44
            printf  "    Tools     :"
yann@642
    45
            [ "${CT_LIBELF}"  ] && printf " libelf-${CT_LIBELF_VERSION}"
yann@642
    46
            [ "${CT_SSTRIP}"  ] && printf " sstrip"
yann@642
    47
            [ "${CT_DMALLOC}" ] && printf " dmalloc-${CT_DMALLOC_VERSION}"
yann@642
    48
            [ "${CT_DUMA}"    ] && printf " duma-${CT_DUMA_VERSION}"
yann@642
    49
            [ "${CT_GDB}"     ] && printf " gdb-${CT_GDB_VERSION}"
yann@642
    50
            [ "${CT_LTRACE}"  ] && printf " ltrace-${CT_LTRACE_VERSION}"
yann@642
    51
            [ "${CT_STRACE}"  ] && printf " strace-${CT_STRACE_VERSION}"
yann@560
    52
            echo
yann@560
    53
        fi
yann@560
    54
    else
yann@642
    55
        printf "| ''${sample}''  "
yann@723
    56
        printf "|  ''${CT_KERNEL}''  "
yann@722
    57
        if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then
yann@722
    58
            printf "|  //custom//  "
yann@722
    59
        else
yann@723
    60
            printf "|  ${CT_KERNEL_VERSION}  "
yann@722
    61
        fi
yann@642
    62
        printf "|  ${CT_BINUTILS_VERSION}  "
yann@691
    63
        printf "|  ''${CT_CC}''  "
yann@642
    64
        printf "|  ${CT_CC_VERSION}  "
yann@642
    65
        printf "|  ''${CT_LIBC}''  "
yann@642
    66
        printf "|  ${CT_LIBC_VERSION}  "
yann@642
    67
        printf "|  ${CT_THREADS_NPTL:+NPTL}${CT_THREADS_LINUXTHREADS:+linuxthreads}${CT_THREADS_NONE:+none}  "
yann@642
    68
        printf "|  ${CT_ARCH_FLOAT_HW:+hard}${CT_ARCH_FLOAT_SW:+soft} float  "
yann@649
    69
        printf "|  C"
yann@649
    70
        [ "${CT_CC_LANG_CXX}" = "y"     ] && printf ", C++"
yann@649
    71
        [ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ", Fortran"
yann@649
    72
        [ "${CT_CC_LANG_JAVA}" = "y"    ] && printf ", Java"
yann@649
    73
        [ "${CT_CC_LANG_ADA}" = "y"     ] && printf ", ADA"
yann@649
    74
        [ "${CT_CC_LANG_OBJC}" = "y"    ] && printf ", Objective-C"
yann@649
    75
        [ "${CT_CC_LANG_OBJCXX}" = "y"  ] && printf ", Objective-C++"
yann@649
    76
        [ -n "${CT_CC_LANG_OTHERS}"     ] && printf "\\\\\\\\ Others: ${CT_CC_LANG_OTHERS}"
yann@691
    77
        printf "  "
yann@560
    78
        if [ -f "${sample_top}/samples/${sample}/reported.by" ]; then
yann@617
    79
            ( . "${sample_top}/samples/${sample}/reported.by"
yann@617
    80
              if [ -n "${reporter_url}" ]; then
yann@642
    81
                  printf "|  [[${reporter_url}|${reporter_name}]]  "
yann@617
    82
              else
yann@642
    83
                  printf "|  ${reporter_name}  "
yann@617
    84
              fi
yann@560
    85
            )
yann@560
    86
        else
yann@642
    87
            printf "|  [[http://ymorin.is-a-geek.org/|YEM]]  "
yann@560
    88
        fi
yann@560
    89
        echo "|"
yann@474
    90
    fi
yann@74
    91
}
yann@74
    92
yann@74
    93
# Get largest sample width
yann@74
    94
width=0
yann@74
    95
for sample in "${@}"; do
yann@74
    96
    [ ${#sample} -gt ${width} ] && width=${#sample}
yann@74
    97
done
yann@74
    98
yann@560
    99
if [ "${opt}" = -w ]; then
yann@691
   100
    echo "^ $(date +%Y%m%d.%H%M) ^ |||||||||||"
yann@642
   101
    printf "^ Target "
yann@691
   102
    printf "^  Kernel headers\\\\\\\\ version  ^"
yann@642
   103
    printf "^  binutils version  "
yann@691
   104
    printf "^  C compiler\\\\\\\\ version  ^"
yann@651
   105
    printf "^  C library version  ^"
yann@651
   106
    printf "^  Threading model  "
yann@651
   107
    printf "^  Floating point\\\\\\\\ support  "
yann@651
   108
    printf "^  Languages  "
yann@642
   109
    printf "^  Reported by  "
yann@642
   110
    echo   "^"
yann@560
   111
fi
yann@724
   112
yann@74
   113
for sample in "${@}"; do
yann@474
   114
    ( dump_single_sample ${opt} ${width} "${sample}" )
yann@74
   115
done
yann@724
   116
yann@724
   117
if [ "${opt}" = -w ]; then
yann@724
   118
    printf "^ Total: ${#@} samples  | |||||||||||"
yann@724
   119
    echo   ""
yann@724
   120
fi