2007-05-08 10:57:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Parses all samples on the command line, and for each of them, prints
|
|
|
|
# the versions of the main tools
|
|
|
|
|
2008-06-15 19:25:51 +00:00
|
|
|
[ "$1" = "-v" ] && opt="$1" && shift
|
|
|
|
[ "$1" = "-w" ] && opt="$1" && shift
|
2008-05-02 21:49:43 +00:00
|
|
|
|
2007-05-08 10:57:34 +00:00
|
|
|
# GREP_OPTIONS screws things up.
|
|
|
|
export GREP_OPTIONS=
|
|
|
|
|
|
|
|
# Dump a single sample
|
|
|
|
dump_single_sample() {
|
2008-05-02 21:49:43 +00:00
|
|
|
local verbose=0
|
|
|
|
[ "$1" = "-v" ] && verbose=1 && shift
|
2008-06-15 19:25:51 +00:00
|
|
|
[ "$1" = "-w" ] && wiki=1 && shift
|
2007-05-08 10:57:34 +00:00
|
|
|
local width="$1"
|
|
|
|
local sample="$2"
|
2007-07-01 19:04:20 +00:00
|
|
|
if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
|
|
|
|
sample_top="${CT_TOP_DIR}"
|
|
|
|
sample_type="local"
|
|
|
|
else
|
|
|
|
sample_top="${CT_LIB_DIR}"
|
|
|
|
sample_type="global"
|
|
|
|
fi
|
2008-06-15 19:25:51 +00:00
|
|
|
. "${sample_top}/samples/${sample}/crosstool.config"
|
|
|
|
if [ -z "${wiki}" ]; then
|
|
|
|
printf " %-*s (%s" ${width} "${sample}" "${sample_type}"
|
|
|
|
[ -f "${sample_top}/samples/${sample}/broken" ] && printf ",broken"
|
|
|
|
echo ")"
|
|
|
|
if [ ${verbose} -ne 0 ]; then
|
|
|
|
echo " OS : ${CT_KERNEL}-${CT_KERNEL_VERSION}"
|
|
|
|
echo " binutils : binutils-${CT_BINUTILS_VERSION}"
|
2008-07-07 21:25:57 +00:00
|
|
|
printf " C compiler: ${CT_CC}-${CT_CC_VERSION} (C"
|
|
|
|
[ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++"
|
|
|
|
[ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ",Fortran"
|
|
|
|
[ "${CT_CC_LANG_JAVA}" = "y" ] && printf ",Java"
|
|
|
|
[ "${CT_CC_LANG_ADA}" = "y" ] && printf ",ADA"
|
|
|
|
[ "${CT_CC_LANG_OBJC}" = "y" ] && printf ",Objective-C"
|
|
|
|
[ "${CT_CC_LANG_OBJCXX}" = "y" ] && printf ",Objective-C++"
|
|
|
|
[ -n "${CT_CC_LANG_OTHERS}" ] && printf ",$CT_CC_LANG_OTHERS}"
|
2008-06-15 19:25:51 +00:00
|
|
|
echo ")"
|
|
|
|
echo " C library : ${CT_LIBC}-${CT_LIBC_VERSION}"
|
2008-07-07 21:25:57 +00:00
|
|
|
printf " Tools :"
|
|
|
|
[ "${CT_LIBELF}" ] && printf " libelf-${CT_LIBELF_VERSION}"
|
|
|
|
[ "${CT_SSTRIP}" ] && printf " sstrip"
|
|
|
|
[ "${CT_DMALLOC}" ] && printf " dmalloc-${CT_DMALLOC_VERSION}"
|
|
|
|
[ "${CT_DUMA}" ] && printf " duma-${CT_DUMA_VERSION}"
|
|
|
|
[ "${CT_GDB}" ] && printf " gdb-${CT_GDB_VERSION}"
|
|
|
|
[ "${CT_LTRACE}" ] && printf " ltrace-${CT_LTRACE_VERSION}"
|
|
|
|
[ "${CT_STRACE}" ] && printf " strace-${CT_STRACE_VERSION}"
|
2008-06-15 19:25:51 +00:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
else
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "| ''${sample}'' "
|
|
|
|
printf "| ${CT_KERNEL_VERSION} "
|
|
|
|
printf "| ${CT_BINUTILS_VERSION} "
|
|
|
|
printf "| ${CT_CC_VERSION} "
|
|
|
|
printf "| ''${CT_LIBC}'' "
|
|
|
|
printf "| ${CT_LIBC_VERSION} "
|
|
|
|
printf "| ${CT_THREADS_NPTL:+NPTL}${CT_THREADS_LINUXTHREADS:+linuxthreads}${CT_THREADS_NONE:+none} "
|
|
|
|
printf "| ${CT_ARCH_FLOAT_HW:+hard}${CT_ARCH_FLOAT_SW:+soft} float "
|
|
|
|
printf "| "
|
2008-06-15 19:25:51 +00:00
|
|
|
if [ -f "${sample_top}/samples/${sample}/reported.by" ]; then
|
2008-06-25 08:53:17 +00:00
|
|
|
( . "${sample_top}/samples/${sample}/reported.by"
|
|
|
|
if [ -n "${reporter_url}" ]; then
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "| [[${reporter_url}|${reporter_name}]] "
|
2008-06-25 08:53:17 +00:00
|
|
|
else
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "| ${reporter_name} "
|
2008-06-25 08:53:17 +00:00
|
|
|
fi
|
2008-06-15 19:25:51 +00:00
|
|
|
)
|
|
|
|
else
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "| [[http://ymorin.is-a-geek.org/|YEM]] "
|
2008-06-15 19:25:51 +00:00
|
|
|
fi
|
|
|
|
echo "|"
|
2008-05-02 21:49:43 +00:00
|
|
|
fi
|
2007-05-08 10:57:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Get largest sample width
|
|
|
|
width=0
|
|
|
|
for sample in "${@}"; do
|
|
|
|
[ ${#sample} -gt ${width} ] && width=${#sample}
|
|
|
|
done
|
|
|
|
|
2008-06-15 19:25:51 +00:00
|
|
|
if [ "${opt}" = -w ]; then
|
2008-06-18 13:20:14 +00:00
|
|
|
echo "^ $(date +%Y%m%d.%H%M) ^ |||||||||"
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "^ Target "
|
|
|
|
printf "^ kernel headers\\\\ version "
|
|
|
|
printf "^ binutils version "
|
|
|
|
printf "^ gcc version "
|
|
|
|
printf "^ libc "
|
|
|
|
printf "^ libc version "
|
|
|
|
printf "^ threading model "
|
|
|
|
printf "^ float support "
|
|
|
|
printf "^ Misc "
|
|
|
|
printf "^ Reported by "
|
|
|
|
echo "^"
|
2008-06-15 19:25:51 +00:00
|
|
|
fi
|
2007-05-08 10:57:34 +00:00
|
|
|
for sample in "${@}"; do
|
2008-05-02 21:49:43 +00:00
|
|
|
( dump_single_sample ${opt} ${width} "${sample}" )
|
2007-05-08 10:57:34 +00:00
|
|
|
done
|