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
|
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
|
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-11-29 08:14:04 +00:00
|
|
|
fieldwidth=15
|
|
|
|
|
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 short package description with a name and version in a format
|
|
|
|
# " <name>[-<version>]"
|
2017-11-29 08:14:04 +00:00
|
|
|
dump_pkgs_desc()
|
|
|
|
{
|
|
|
|
local category="${1}"
|
|
|
|
local field="${2}"
|
2018-11-24 06:14:07 +00:00
|
|
|
local pkgs
|
2017-11-29 08:14:04 +00:00
|
|
|
shift 2
|
|
|
|
local show_version
|
2018-11-24 06:14:07 +00:00
|
|
|
local tmp p
|
2017-11-29 08:14:04 +00:00
|
|
|
|
2018-11-24 06:14:07 +00:00
|
|
|
eval "pkgs=\"\${CT_ALL_${category}_CHOICES}\""
|
2017-11-29 08:14:04 +00:00
|
|
|
printf " %-*s :" ${fieldwidth} "${field}"
|
2018-11-24 06:14:07 +00:00
|
|
|
for p in ${pkgs}; do
|
|
|
|
# FIXME: multiple choices use category_package; single choice
|
|
|
|
# use category_package for the primary selection and category_package_SHOW
|
|
|
|
# for all other selections enabled by the primary. Cannot unify this syntax
|
|
|
|
# without a really extensive change.
|
|
|
|
eval "tmp=\"\${CT_${category}_${p}}\${CT_${category}_${p}_SHOW}\""
|
2017-11-29 08:14:04 +00:00
|
|
|
if [ -n "${tmp}" ]; then
|
2018-11-24 06:14:07 +00:00
|
|
|
CT_GetPkgBuildVersion "${category}" "${p}" show_version
|
2017-11-29 08:14:04 +00:00
|
|
|
printf " %s" "${show_version}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
printf "\n"
|
|
|
|
}
|
|
|
|
|
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
|
2017-11-29 08:14:04 +00:00
|
|
|
dump_single_sample()
|
|
|
|
{
|
2008-05-02 21:49:43 +00:00
|
|
|
local verbose=0
|
2010-02-17 22:47:47 +00:00
|
|
|
local complibs
|
2008-05-02 21:49:43 +00:00
|
|
|
[ "$1" = "-v" ] && verbose=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
|
|
|
|
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
|
2017-11-19 08:16:21 +00:00
|
|
|
printf "[%s" "${sample_type}"
|
|
|
|
[ -f "${sample_top}/samples/${sample}/broken" ] && printf "B" || printf "."
|
|
|
|
[ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" || printf "."
|
|
|
|
printf "] %s\n" "${sample}"
|
|
|
|
if [ ${verbose} -ne 0 ]; then
|
2009-06-26 17:09:22 +00:00
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
2017-11-19 08:16:21 +00:00
|
|
|
cross) ;;
|
2009-11-25 22:56:59 +00:00
|
|
|
canadian)
|
2017-11-29 08:14:04 +00:00
|
|
|
printf " %-*s : %s\n" ${fieldwidth} "Host" "${CT_HOST}"
|
2009-11-25 22:56:59 +00:00
|
|
|
;;
|
2009-06-26 17:09:22 +00:00
|
|
|
esac
|
2017-11-29 08:14:04 +00:00
|
|
|
printf " %-*s : %s" ${fieldwidth} "Languages" "C"
|
2017-11-19 08:16:21 +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++"
|
|
|
|
[ "${CT_CC_LANG_GOLANG}" = "y" ] && printf ",Go"
|
|
|
|
[ -n "${CT_CC_LANG_OTHERS}" ] && printf ",${CT_CC_LANG_OTHERS}"
|
|
|
|
printf "\n"
|
2017-11-29 08:14:04 +00:00
|
|
|
|
2018-11-24 06:14:07 +00:00
|
|
|
dump_pkgs_desc KERNEL "OS"
|
|
|
|
dump_pkgs_desc BINUTILS "Binutils"
|
|
|
|
dump_pkgs_desc CC "Compiler"
|
|
|
|
dump_pkgs_desc LIBC "C library"
|
|
|
|
dump_pkgs_desc DEBUG "Debug tools"
|
|
|
|
dump_pkgs_desc COMP_LIBS "Companion libs"
|
|
|
|
dump_pkgs_desc COMP_TOOLS "Companion tools"
|
2008-05-02 21:49:43 +00:00
|
|
|
fi
|
2007-05-08 10:57:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for sample in "${@}"; do
|
2017-11-19 08:10:53 +00:00
|
|
|
dump_single_sample ${opt} "${sample}"
|
2010-01-03 17:33:23 +00:00
|
|
|
done
|