2009-02-01 18:43:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Yes, this is supposed to be a POSIX-compliant shell script.
|
2007-05-08 10:57:34 +00:00
|
|
|
|
|
|
|
# Parses all samples on the command line, and for each of them, prints
|
|
|
|
# the versions of the main tools
|
|
|
|
|
2009-02-01 18:43:45 +00:00
|
|
|
# Use tools discovered by ./configure
|
|
|
|
. "${CT_LIB_DIR}/paths.mk"
|
|
|
|
|
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}"
|
2008-09-02 12:43:11 +00:00
|
|
|
sample_type="l"
|
2007-07-01 19:04:20 +00:00
|
|
|
else
|
|
|
|
sample_top="${CT_LIB_DIR}"
|
2008-09-02 12:43:11 +00:00
|
|
|
sample_type="g"
|
2007-07-01 19:04:20 +00:00
|
|
|
fi
|
2008-06-15 19:25:51 +00:00
|
|
|
. "${sample_top}/samples/${sample}/crosstool.config"
|
|
|
|
if [ -z "${wiki}" ]; then
|
2009-09-07 16:40:30 +00:00
|
|
|
t_width=10
|
2008-10-31 18:28:12 +00:00
|
|
|
printf " %-*s [%s" ${width} "${sample}" "${sample_type}"
|
2008-09-02 21:14:47 +00:00
|
|
|
[ -f "${sample_top}/samples/${sample}/broken" ] && printf "B" || printf " "
|
|
|
|
[ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" || printf " "
|
|
|
|
echo "]"
|
2008-06-15 19:25:51 +00:00
|
|
|
if [ ${verbose} -ne 0 ]; then
|
2009-06-26 17:09:22 +00:00
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
|
|
|
cross) ;;
|
|
|
|
canadian)
|
2009-09-07 16:40:30 +00:00
|
|
|
printf " %-*s : %s\n" ${t_width} "Host" "${CT_HOST}"
|
2009-06-26 17:09:22 +00:00
|
|
|
;;
|
|
|
|
esac
|
2009-09-07 16:40:30 +00:00
|
|
|
printf " %-*s : %s\n" ${t_width} "OS" "${CT_KERNEL}${CT_KERNEL_VERSION:+-}${CT_KERNEL_VERSION}"
|
2008-08-25 21:42:34 +00:00
|
|
|
if [ "${CT_GMP_MPFR}" = "y" ]; then
|
2009-09-07 16:40:30 +00:00
|
|
|
printf " %-*s : %s\n" ${t_width} "GMP/MPFR" "gmp-${CT_GMP_VERSION} / mpfr-${CT_MPFR_VERSION}"
|
2008-08-25 21:42:34 +00:00
|
|
|
fi
|
2009-09-07 16:40:30 +00:00
|
|
|
printf " %-*s : %s\n" ${t_width} "binutils" "binutils-${CT_BINUTILS_VERSION}"
|
|
|
|
printf " %-*s : %s" ${t_width} "C compiler" "${CT_CC}-${CT_CC_VERSION} (C"
|
2008-07-07 21:25:57 +00:00
|
|
|
[ "${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++"
|
2008-07-13 20:45:24 +00:00
|
|
|
[ -n "${CT_CC_LANG_OTHERS}" ] && printf ",${CT_CC_LANG_OTHERS}"
|
2009-09-07 16:40:30 +00:00
|
|
|
printf ")\n"
|
|
|
|
printf " %-*s : %s\n" ${t_width} "C library" "${CT_LIBC}${CT_LIBC_VERSION:+-}${CT_LIBC_VERSION}"
|
|
|
|
printf " %-*s :" ${t_width} "Tools"
|
2008-07-07 21:25:57 +00:00
|
|
|
[ "${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}"
|
2009-09-07 16:40:30 +00:00
|
|
|
printf "\n"
|
2008-06-15 19:25:51 +00:00
|
|
|
fi
|
|
|
|
else
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "| ''${sample}'' "
|
2008-09-04 15:42:25 +00:00
|
|
|
printf "| "
|
|
|
|
[ "${CT_EXPERIMENTAL}" = "y" ] && printf "X"
|
|
|
|
[ -f "${sample_top}/samples/${sample}/broken" ] && printf "B"
|
2009-06-26 17:09:22 +00:00
|
|
|
printf ' | '
|
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
|
|
|
cross) ;;
|
|
|
|
canadian) printf "${CT_HOST}";;
|
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
printf " | ''${CT_KERNEL}'' |"
|
2008-11-01 16:49:00 +00:00
|
|
|
if [ "${CT_KERNEL}" != "bare-metal" ];then
|
|
|
|
if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then
|
|
|
|
printf " //custom// "
|
|
|
|
else
|
|
|
|
printf " ${CT_KERNEL_VERSION} "
|
|
|
|
fi
|
2008-07-25 14:08:03 +00:00
|
|
|
fi
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "| ${CT_BINUTILS_VERSION} "
|
2008-07-19 18:12:35 +00:00
|
|
|
printf "| ''${CT_CC}'' "
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "| ${CT_CC_VERSION} "
|
2008-11-01 16:49:00 +00:00
|
|
|
printf "| ''${CT_LIBC}'' |"
|
|
|
|
if [ "${CT_LIBC}" != "none" ]; then
|
|
|
|
printf " ${CT_LIBC_VERSION} "
|
|
|
|
fi
|
|
|
|
printf "| ${CT_THREADS:-none} "
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "| ${CT_ARCH_FLOAT_HW:+hard}${CT_ARCH_FLOAT_SW:+soft} float "
|
2008-07-13 20:45:24 +00:00
|
|
|
printf "| 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 "\\\\\\\\ Others: ${CT_CC_LANG_OTHERS}"
|
2008-07-19 18:12:35 +00:00
|
|
|
printf " "
|
2008-10-14 21:30:27 +00:00
|
|
|
( . "${sample_top}/samples/${sample}/reported.by"
|
|
|
|
if [ -n "${reporter_name}" ]; then
|
2008-06-25 08:53:17 +00:00
|
|
|
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-10-14 21:30:27 +00:00
|
|
|
else
|
|
|
|
printf "| [[http://ymorin.is-a-geek.org/|YEM]] "
|
|
|
|
fi
|
|
|
|
)
|
2009-06-26 17:09:22 +00:00
|
|
|
sample_updated="$( hg log -l 1 --template '{date|shortdate}' "${sample_top}/samples/${sample}" )"
|
2008-07-29 16:48:20 +00:00
|
|
|
printf "| ${sample_updated} "
|
2008-06-15 19:25:51 +00:00
|
|
|
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-09-04 15:42:25 +00:00
|
|
|
echo "^ @@DATE@@ ^ |||||||||||||"
|
2008-07-07 21:25:57 +00:00
|
|
|
printf "^ Target "
|
2008-09-04 15:42:25 +00:00
|
|
|
printf "^ Status "
|
2009-06-26 17:09:22 +00:00
|
|
|
printf "^ Host "
|
2008-07-19 18:12:35 +00:00
|
|
|
printf "^ Kernel headers\\\\\\\\ version ^"
|
2008-09-14 16:54:12 +00:00
|
|
|
printf "^ binutils\\\\\\\\ version "
|
2008-07-19 18:12:35 +00:00
|
|
|
printf "^ C compiler\\\\\\\\ version ^"
|
2008-09-14 16:54:12 +00:00
|
|
|
printf "^ C library\\\\\\\\ version ^"
|
|
|
|
printf "^ Threading\\\\\\\\ model "
|
2008-07-13 21:35:09 +00:00
|
|
|
printf "^ Floating point\\\\\\\\ support "
|
|
|
|
printf "^ Languages "
|
2008-07-29 16:48:20 +00:00
|
|
|
printf "^ Initially\\\\\\\\ reported by "
|
|
|
|
printf "^ Last\\\\\\\\ updated "
|
2008-07-07 21:25:57 +00:00
|
|
|
echo "^"
|
2008-06-15 19:25:51 +00:00
|
|
|
fi
|
2008-07-25 16:14:42 +00:00
|
|
|
|
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
|
2008-07-25 16:14:42 +00:00
|
|
|
|
|
|
|
if [ "${opt}" = -w ]; then
|
2008-09-14 16:21:07 +00:00
|
|
|
printf "^ Total: ${#@} samples | ''X'': sample uses features marked as being EXPERIMENTAL.\\\\\\\\ ''B'': sample is curently BROKEN. |||||||||||||"
|
2008-07-25 16:14:42 +00:00
|
|
|
echo ""
|
2008-09-02 12:43:11 +00:00
|
|
|
elif [ -z "${opt}" ]; then
|
|
|
|
echo ' l (local) : sample was found in current directory'
|
|
|
|
echo ' g (global) : sample was installed with crosstool-NG'
|
|
|
|
echo ' X (EXPERIMENTAL): sample may use EXPERIMENTAL features'
|
2008-10-27 18:19:08 +00:00
|
|
|
echo ' B (BROKEN) : sample is currently broken'
|
2008-07-25 16:14:42 +00:00
|
|
|
fi
|