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
|
2012-01-16 22:36:42 +00:00
|
|
|
. "${CT_LIB_DIR}/paths.sh"
|
2017-11-13 22:10:44 +00:00
|
|
|
. "${CT_LIB_DIR}/scripts/functions"
|
2009-02-01 18:43:45 +00:00
|
|
|
|
2008-06-15 19:25:51 +00:00
|
|
|
[ "$1" = "-v" ] && opt="$1" && shift
|
|
|
|
[ "$1" = "-w" ] && opt="$1" && shift
|
2012-07-23 20:02:23 +00:00
|
|
|
[ "$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=
|
|
|
|
|
2017-06-12 05:14:48 +00:00
|
|
|
# Dummy version which is invoked from .config
|
|
|
|
CT_Mirrors() { :; }
|
|
|
|
|
2017-11-13 22:10:44 +00:00
|
|
|
# Dump a package version by a package name.
|
|
|
|
dump_pkg_version() {
|
|
|
|
local name=$1
|
|
|
|
local ksym=$( echo ${name} | ${awk} '{ print toupper($0) }' )
|
|
|
|
|
|
|
|
CT_GetPkgBuildVersion "${ksym}" version
|
|
|
|
printf "${version}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Dump a short package description with a name and version in a format
|
|
|
|
# " <name>[-<version>]"
|
|
|
|
dump_pkg_desc() {
|
|
|
|
local name=$1
|
|
|
|
local version=$( dump_pkg_version "$name" )
|
|
|
|
|
|
|
|
printf " ${name}${version:+-}${version}"
|
|
|
|
}
|
|
|
|
|
2007-05-08 10:57:34 +00:00
|
|
|
# Dump a single sample
|
2012-05-07 19:37:59 +00:00
|
|
|
# Note: we use the specific .config.sample config file
|
2007-05-08 10:57:34 +00:00
|
|
|
dump_single_sample() {
|
2008-05-02 21:49:43 +00:00
|
|
|
local verbose=0
|
2012-07-23 20:02:23 +00:00
|
|
|
local wiki=0
|
2010-02-17 22:47:47 +00:00
|
|
|
local complibs
|
2008-05-02 21:49:43 +00:00
|
|
|
[ "$1" = "-v" ] && verbose=1 && shift
|
2008-06-15 19:25:51 +00:00
|
|
|
[ "$1" = "-w" ] && wiki=1 && shift
|
2012-07-23 20:02:23 +00:00
|
|
|
local sample="$1"
|
2015-10-28 21:08:31 +00:00
|
|
|
. $(pwd)/.config.sample
|
2015-11-17 21:18:14 +00:00
|
|
|
|
|
|
|
# libc needs some love
|
2017-05-30 05:32:38 +00:00
|
|
|
# TBD after conversion of gen-kconfig to template, use CT_LIBC_USE as a selector for other variables
|
|
|
|
# (i.e. whether to use CT_GLIBC_VERSION or CT_MUSL_VERSION)
|
2015-11-17 21:18:14 +00:00
|
|
|
local libc_name="${CT_LIBC}"
|
2017-05-30 05:32:38 +00:00
|
|
|
local libc_ver ksym
|
|
|
|
|
|
|
|
ksym=${libc_name//[^0-9A-Za-z_]/_}
|
|
|
|
ksym=${ksym^^}
|
|
|
|
case ${ksym} in
|
|
|
|
GLIBC|NEWLIB)
|
|
|
|
if eval "[ \"\${CT_${ksym}_USE_LINARO}\" = y ]"; then
|
|
|
|
ksym="${ksym}_LINARO"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
UCLIBC)
|
2017-11-12 07:35:48 +00:00
|
|
|
if [ "${CT_UCLIBC_USE_UCLIBC_NG_ORG}" = y ]; then
|
2017-05-30 05:32:38 +00:00
|
|
|
ksym="${ksym}_NG"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2017-11-13 22:10:44 +00:00
|
|
|
CT_GetPkgBuildVersion "${ksym}" libc_ver
|
2015-11-17 21:18:14 +00:00
|
|
|
|
2010-01-31 14:57:22 +00:00
|
|
|
case "${sample}" in
|
|
|
|
current)
|
|
|
|
sample_type="l"
|
2012-05-07 19:37:59 +00:00
|
|
|
sample="$( ${CT_NG} show-tuple )"
|
2015-10-28 21:08:31 +00:00
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
|
|
|
canadian)
|
2017-11-13 22:10:44 +00:00
|
|
|
sample="${CT_HOST},${sample}"
|
2015-10-28 21:08:31 +00:00
|
|
|
;;
|
|
|
|
esac
|
2010-01-31 14:57:22 +00:00
|
|
|
;;
|
|
|
|
*) if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
|
|
|
|
sample_top="${CT_TOP_DIR}"
|
2010-04-01 22:18:26 +00:00
|
|
|
sample_type="L"
|
2010-01-31 14:57:22 +00:00
|
|
|
else
|
|
|
|
sample_top="${CT_LIB_DIR}"
|
2010-04-01 22:18:26 +00:00
|
|
|
sample_type="G"
|
2010-01-31 14:57:22 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2012-07-23 20:02:23 +00:00
|
|
|
if [ ${wiki} -eq 0 ]; then
|
|
|
|
width=14
|
|
|
|
printf "[%s" "${sample_type}"
|
|
|
|
[ -f "${sample_top}/samples/${sample}/broken" ] && printf "B" || printf "."
|
|
|
|
[ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" || printf "."
|
|
|
|
printf "] %s\n" "${sample}"
|
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)
|
2012-07-23 20:02:23 +00:00
|
|
|
printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}"
|
2009-06-26 17:09:22 +00:00
|
|
|
;;
|
|
|
|
esac
|
2017-05-30 05:32:38 +00:00
|
|
|
# TBD currently only Linux is used. General handling for single-select (compiler/binutils/libc/os) and multi-select (debug/companions) components?
|
2017-11-13 22:10:44 +00:00
|
|
|
printf " %-*s :" ${width} "OS" && dump_pkg_desc "${CT_KERNEL}" && printf "\n"
|
2010-03-17 22:59:17 +00:00
|
|
|
if [ -n "${CT_GMP}" \
|
|
|
|
-o -n "${CT_MPFR}" \
|
2015-12-08 17:09:49 +00:00
|
|
|
-o -n "${CT_ISL}" \
|
2010-03-17 22:59:17 +00:00
|
|
|
-o -n "${CT_CLOOG}" \
|
|
|
|
-o -n "${CT_MPC}" \
|
|
|
|
-o -n "${CT_LIBELF}" \
|
2015-11-07 06:15:11 +00:00
|
|
|
-o -n "${CT_EXPAT}" \
|
2015-11-08 07:31:46 +00:00
|
|
|
-o -n "${CT_NCURSES}" \
|
2010-03-19 17:46:57 +00:00
|
|
|
-o -n "${CT_GMP_TARGET}" \
|
|
|
|
-o -n "${CT_MPFR_TARGET}" \
|
2015-12-08 17:09:49 +00:00
|
|
|
-o -n "${CT_ISL_TARGET}" \
|
2010-03-19 17:46:57 +00:00
|
|
|
-o -n "${CT_CLOOG_TARGET}" \
|
|
|
|
-o -n "${CT_MPC_TARGET}" \
|
|
|
|
-o -n "${CT_LIBELF_TARGET}" \
|
2015-11-07 06:15:11 +00:00
|
|
|
-o -n "${CT_EXPAT_TARGET}" \
|
2015-11-08 07:31:46 +00:00
|
|
|
-o -n "${CT_NCURSES_TARGET}" \
|
2010-02-17 22:47:47 +00:00
|
|
|
]; then
|
2012-07-23 20:02:23 +00:00
|
|
|
printf " %-*s :" ${width} "Companion libs"
|
2010-02-17 22:47:47 +00:00
|
|
|
complibs=1
|
2009-09-07 17:03:09 +00:00
|
|
|
fi
|
2017-11-13 22:10:44 +00:00
|
|
|
[ -z "${CT_GMP}" -a -z "${CT_GMP_TARGET}" ] || dump_pkg_desc "gmp"
|
|
|
|
[ -z "${CT_MPFR}" -a -z "${CT_MPFR_TARGET}" ] || dump_pkg_desc "mpfr"
|
|
|
|
[ -z "${CT_ISL}" -a -z "${CT_ISL_TARGET}" ] || dump_pkg_desc "isl"
|
|
|
|
[ -z "${CT_CLOOG}" -a -z "${CT_CLOOG_TARGET}" ] || dump_pkg_desc "cloog"
|
|
|
|
[ -z "${CT_MPC}" -a -z "${CT_MPC_TARGET}" ] || dump_pkg_desc "mpc"
|
|
|
|
[ -z "${CT_LIBELF}" -a -z "${CT_LIBELF_TARGET}" ] || dump_pkg_desc "libelf"
|
|
|
|
[ -z "${CT_EXPAT}" -a -z "${CT_EXPAT_TARGET}" ] || dump_pkg_desc "expat"
|
|
|
|
[ -z "${CT_NCURSES}" -a -z "${CT_NCURSES_TARGET}" ] || dump_pkg_desc "ncurses"
|
2010-02-17 22:47:47 +00:00
|
|
|
[ -z "${complibs}" ] || printf "\n"
|
2017-11-13 22:10:44 +00:00
|
|
|
printf " %-*s :" ${width} "binutils" && dump_pkg_desc "binutils" && printf "\n"
|
|
|
|
printf " %-*s :" ${width} "Compilers" && dump_pkg_desc "${CT_CC}" && printf "\n"
|
|
|
|
printf " %-*s : %s" ${width} "Languages" "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++"
|
2013-11-08 14:18:09 +00:00
|
|
|
[ "${CT_CC_LANG_GOLANG}" = "y" ] && printf ",Go"
|
2008-07-13 20:45:24 +00:00
|
|
|
[ -n "${CT_CC_LANG_OTHERS}" ] && printf ",${CT_CC_LANG_OTHERS}"
|
2015-05-29 20:40:51 +00:00
|
|
|
printf "\n"
|
2015-11-17 21:18:14 +00:00
|
|
|
printf " %-*s : %s (threads: %s)\n" ${width} "C library" "${libc_name}${libc_ver:+-}${libc_ver}" "${CT_THREADS}"
|
2012-07-23 20:02:23 +00:00
|
|
|
printf " %-*s :" ${width} "Tools"
|
2017-11-13 22:10:44 +00:00
|
|
|
[ "${CT_DEBUG_DUMA}" ] && dump_pkg_desc "duma"
|
|
|
|
[ "${CT_DEBUG_GDB}" ] && dump_pkg_desc "gdb"
|
|
|
|
[ "${CT_DEBUG_LTRACE}" ] && dump_pkg_desc "ltrace"
|
|
|
|
[ "${CT_DEBUG_STRACE}" ] && dump_pkg_desc "strace"
|
2009-09-07 16:40:30 +00:00
|
|
|
printf "\n"
|
2008-06-15 19:25:51 +00:00
|
|
|
fi
|
|
|
|
else
|
2009-06-26 17:09:22 +00:00
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
2009-11-25 22:56:59 +00:00
|
|
|
cross)
|
|
|
|
printf "| ''${sample}'' | "
|
|
|
|
;;
|
|
|
|
canadian)
|
|
|
|
printf "| ''"
|
2017-02-27 03:06:35 +00:00
|
|
|
printf "${sample}" |${sed} -r -e 's/.*,//'
|
2009-11-25 22:56:59 +00:00
|
|
|
printf "'' | ${CT_HOST} "
|
|
|
|
;;
|
2009-06-26 17:09:22 +00:00
|
|
|
*) ;;
|
|
|
|
esac
|
2009-11-25 22:56:59 +00:00
|
|
|
printf "| "
|
2009-11-25 23:22:17 +00:00
|
|
|
[ "${CT_EXPERIMENTAL}" = "y" ] && printf "**X**"
|
|
|
|
[ -f "${sample_top}/samples/${sample}/broken" ] && printf "**B**"
|
2009-06-26 17:09:22 +00:00
|
|
|
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
|
2017-11-13 22:10:44 +00:00
|
|
|
printf " " && dump_pkg_version "${CT_KERNEL}" && printf " "
|
2008-11-01 16:49:00 +00:00
|
|
|
fi
|
2008-07-25 14:08:03 +00:00
|
|
|
fi
|
2017-11-13 22:10:44 +00:00
|
|
|
printf "| " && dump_pkg_version "binutils" && printf " "
|
|
|
|
printf "| ${CT_CC} | " && dump_pkg_version "${CT_CC}" && printf " "
|
2015-11-17 21:18:14 +00:00
|
|
|
printf "| ''${libc_name}'' |"
|
|
|
|
if [ "${libc_name}" != "none" ]; then
|
|
|
|
printf " ${libc_ver} "
|
2008-11-01 16:49:00 +00:00
|
|
|
fi
|
|
|
|
printf "| ${CT_THREADS:-none} "
|
2011-11-14 17:53:14 +00:00
|
|
|
printf "| ${CT_ARCH_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
|
2011-10-18 18:17:41 +00:00
|
|
|
printf "| (//unknown//) "
|
2008-10-14 21:30:27 +00:00
|
|
|
fi
|
|
|
|
)
|
2014-06-28 11:10:23 +00:00
|
|
|
sample_updated="$( git log -n1 --pretty=format:'%ci' "${sample_top}/samples/${sample}" \
|
2015-05-10 00:38:43 +00:00
|
|
|
|${awk} '{ print $1; }' )"
|
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
|
|
|
}
|
|
|
|
|
2012-07-23 20:02:23 +00:00
|
|
|
if [ "${opt}" = "-w" -a ${#} -eq 0 ]; then
|
2009-11-25 23:22:17 +00:00
|
|
|
printf "^ %s |||||||||||||||\n" "$( date "+%Y%m%d.%H%M %z" )"
|
2009-11-25 22:56:59 +00:00
|
|
|
printf "^ Target "
|
|
|
|
printf "^ Host "
|
2008-09-04 15:42:25 +00:00
|
|
|
printf "^ Status "
|
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 "^"
|
2012-07-23 20:02:23 +00:00
|
|
|
exit 0
|
|
|
|
elif [ "${opt}" = "-W" ]; then
|
|
|
|
printf "^ Total: ${#} samples || **X**: sample uses features marked as being EXPERIMENTAL.\\\\\\\\ **B**: sample is currently BROKEN. |||||||||||||"
|
|
|
|
echo ""
|
|
|
|
exit 0
|
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
|
2012-07-23 20:02:23 +00:00
|
|
|
( dump_single_sample ${opt} "${sample}" )
|
2010-01-03 17:33:23 +00:00
|
|
|
done
|