mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-06-05 01:00:51 +00:00
A few fixes for showSamples
- Use fork's name, not the master package name - Allow to use a choice selector when printing a package - Consider complibs always present (they are, gcc does require gmp/...) Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
parent
5e0d62fac6
commit
63e91f4eba
@ -697,7 +697,7 @@ gen_selection()
|
|||||||
local dir="${2}"
|
local dir="${2}"
|
||||||
local label="${3}"
|
local label="${3}"
|
||||||
|
|
||||||
msg "Generating ${dir}.in"
|
msg "Generating ${dir}.in (${type})"
|
||||||
exec >"${config_gen_dir}/${dir}.in"
|
exec >"${config_gen_dir}/${dir}.in"
|
||||||
info=( \
|
info=( \
|
||||||
[dir]=${dir} \
|
[dir]=${dir} \
|
||||||
|
@ -25,6 +25,12 @@ config @@dir|@@
|
|||||||
default "@@choice@@" if @@dir|@@_@@choice|@@
|
default "@@choice@@" if @@dir|@@_@@choice|@@
|
||||||
#!end-foreach
|
#!end-foreach
|
||||||
|
|
||||||
|
config @@dir|@@_KSYM
|
||||||
|
string
|
||||||
|
#!foreach choice
|
||||||
|
default "@@choice|@@" if @@dir|@@_@@choice|@@
|
||||||
|
#!end-foreach
|
||||||
|
|
||||||
#!foreach choice
|
#!foreach choice
|
||||||
if @@dir|@@_@@choice|@@
|
if @@dir|@@_@@choice|@@
|
||||||
source "config/@@dir@@/@@choice@@.in"
|
source "config/@@dir@@/@@choice@@.in"
|
||||||
|
@ -243,6 +243,8 @@ config @@fork|@@_VERSION
|
|||||||
#!foreach version
|
#!foreach version
|
||||||
default "@@ver@@" if @@fork|@@_V_@@ver_sel|@@
|
default "@@ver@@" if @@fork|@@_V_@@ver_sel|@@
|
||||||
#!end-foreach
|
#!end-foreach
|
||||||
|
default "new" if @@fork|@@_VERY_NEW
|
||||||
|
default "old" if @@fork|@@_VERY_OLD
|
||||||
default "unknown"
|
default "unknown"
|
||||||
|
|
||||||
#!if [ "@@#version@@" -gt 0 ]
|
#!if [ "@@#version@@" -gt 0 ]
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# -*- mode: sh; tab-width: 4 -*-
|
# -*- mode: sh; tab-width: 4 -*-
|
||||||
# vi: ts=4:sw=4:sts=4:et
|
# vi: ts=4:sw=4:sts=4:et
|
||||||
|
# vim: filetype=sh :
|
||||||
# This file contains some useful common functions
|
# This file contains some useful common functions
|
||||||
# Copyright 2007 Yann E. MORIN
|
# Copyright 2007 Yann E. MORIN
|
||||||
# Licensed under the GPL v2. See COPYING in the root of this package
|
# Licensed under the GPL v2. See COPYING in the root of this package
|
||||||
@ -1891,6 +1892,10 @@ CT_PackageRun()
|
|||||||
eval "local ${v}=\${CT_${use}_${v^^}}"
|
eval "local ${v}=\${CT_${use}_${v^^}}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -z "${pkg_name}" ]; then
|
||||||
|
CT_Abort "Internal ct-ng error: '${sym}' not defined, please report a bug"
|
||||||
|
fi
|
||||||
|
|
||||||
for v in archive_filename archive_dirname; do
|
for v in archive_filename archive_dirname; do
|
||||||
# kconfig and shell have different quoting rules, so it seems impossible to make
|
# kconfig and shell have different quoting rules, so it seems impossible to make
|
||||||
# kconfig quote '$' properly for eval (i.e. not have it expanded when loading the
|
# kconfig quote '$' properly for eval (i.e. not have it expanded when loading the
|
||||||
@ -2214,24 +2219,34 @@ CT_GetPkgVersion()
|
|||||||
eval "${2}=\"${rv}\""
|
eval "${2}=\"${rv}\""
|
||||||
}
|
}
|
||||||
|
|
||||||
# Closure of a build version selector.
|
|
||||||
CT_DoGetPkgBuildVersion()
|
|
||||||
{
|
|
||||||
if [ "${src_release}" = "y" ]; then
|
|
||||||
build_version="${version}"
|
|
||||||
elif [ -z "${devel_revision}" ]; then
|
|
||||||
build_version="${devel_branch}"
|
|
||||||
else
|
|
||||||
build_version="${devel_revision}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get a package version selected to build. May return an empty string.
|
# Get a package version selected to build. May return an empty string.
|
||||||
# Usage: CT_GetPkgBuildVersion PKG VAR
|
# Usage: CT_GetPkgBuildVersion PKG VAR
|
||||||
|
# where PKG may refer to a specific package (e.g. GCC) or package choice
|
||||||
|
# (e.g. LIBC).
|
||||||
CT_GetPkgBuildVersion()
|
CT_GetPkgBuildVersion()
|
||||||
{
|
{
|
||||||
|
local pkg="${1}"
|
||||||
|
local tmp
|
||||||
local build_version
|
local build_version
|
||||||
|
|
||||||
CT_PackageRun "${1}" CT_DoGetPkgBuildVersion
|
# If it is a choice selector, switch to whatever specific package it selects
|
||||||
eval "${2}=\"${build_version}\""
|
eval "tmp=\${CT_${pkg}_KSYM}"
|
||||||
|
if [ -n "${tmp}" ]; then
|
||||||
|
pkg="${tmp}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
__do_GetPkgBuildVersion() {
|
||||||
|
tmp="${pkg_name}-${version}"
|
||||||
|
if [ "${src_devel}" = "y" ]; then
|
||||||
|
tmp+="-${devel_vcs}"
|
||||||
|
if [ -n "${devel_revision}" ]; then
|
||||||
|
tmp+="-${devel_revision}"
|
||||||
|
fi
|
||||||
|
elif [ "${src_custom}" = "y" ]; then
|
||||||
|
tmp+="-custom"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
CT_PackageRun "${pkg}" __do_GetPkgBuildVersion
|
||||||
|
eval "${2}=\"${tmp}\""
|
||||||
}
|
}
|
||||||
|
@ -15,22 +15,14 @@ export GREP_OPTIONS=
|
|||||||
# Dummy version which is invoked from .config
|
# Dummy version which is invoked from .config
|
||||||
CT_Mirrors() { :; }
|
CT_Mirrors() { :; }
|
||||||
|
|
||||||
# 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
|
# Dump a short package description with a name and version in a format
|
||||||
# " <name>[-<version>]"
|
# " <name>[-<version>]"
|
||||||
dump_pkg_desc() {
|
dump_pkg_desc() {
|
||||||
local name=$1
|
local name=$1
|
||||||
local version=$( dump_pkg_version "$name" )
|
local show_version
|
||||||
|
|
||||||
printf " ${name}${version:+-}${version}"
|
CT_GetPkgBuildVersion ${1} show_version
|
||||||
|
printf " %s" "${show_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Dump a single sample
|
# Dump a single sample
|
||||||
@ -44,28 +36,6 @@ dump_single_sample() {
|
|||||||
local sample="$1"
|
local sample="$1"
|
||||||
. $(pwd)/.config.sample
|
. $(pwd)/.config.sample
|
||||||
|
|
||||||
# libc needs some love
|
|
||||||
# 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)
|
|
||||||
local libc_name="${CT_LIBC}"
|
|
||||||
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)
|
|
||||||
if [ "${CT_UCLIBC_USE_UCLIBC_NG_ORG}" = y ]; then
|
|
||||||
ksym="${ksym}_NG"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
CT_GetPkgBuildVersion "${ksym}" libc_ver
|
|
||||||
|
|
||||||
case "${sample}" in
|
case "${sample}" in
|
||||||
current)
|
current)
|
||||||
sample_type="l"
|
sample_type="l"
|
||||||
@ -98,39 +68,21 @@ dump_single_sample() {
|
|||||||
printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}"
|
printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# TBD currently only Linux is used. General handling for single-select (compiler/binutils/libc/os) and multi-select (debug/companions) components?
|
if [ "${CT_KERNEL}" != "bare-metal" ]; then
|
||||||
printf " %-*s :" ${width} "OS" && dump_pkg_desc "${CT_KERNEL}" && printf "\n"
|
printf " %-*s :" ${width} "OS" && dump_pkg_desc KERNEL && printf "\n"
|
||||||
if [ -n "${CT_GMP}" \
|
|
||||||
-o -n "${CT_MPFR}" \
|
|
||||||
-o -n "${CT_ISL}" \
|
|
||||||
-o -n "${CT_CLOOG}" \
|
|
||||||
-o -n "${CT_MPC}" \
|
|
||||||
-o -n "${CT_LIBELF}" \
|
|
||||||
-o -n "${CT_EXPAT}" \
|
|
||||||
-o -n "${CT_NCURSES}" \
|
|
||||||
-o -n "${CT_GMP_TARGET}" \
|
|
||||||
-o -n "${CT_MPFR_TARGET}" \
|
|
||||||
-o -n "${CT_ISL_TARGET}" \
|
|
||||||
-o -n "${CT_CLOOG_TARGET}" \
|
|
||||||
-o -n "${CT_MPC_TARGET}" \
|
|
||||||
-o -n "${CT_LIBELF_TARGET}" \
|
|
||||||
-o -n "${CT_EXPAT_TARGET}" \
|
|
||||||
-o -n "${CT_NCURSES_TARGET}" \
|
|
||||||
]; then
|
|
||||||
printf " %-*s :" ${width} "Companion libs"
|
|
||||||
complibs=1
|
|
||||||
fi
|
fi
|
||||||
[ -z "${CT_GMP}" -a -z "${CT_GMP_TARGET}" ] || dump_pkg_desc "gmp"
|
printf " %-*s :" ${width} "Companion libs"
|
||||||
[ -z "${CT_MPFR}" -a -z "${CT_MPFR_TARGET}" ] || dump_pkg_desc "mpfr"
|
[ -z "${CT_GMP}" ] || dump_pkg_desc GMP
|
||||||
[ -z "${CT_ISL}" -a -z "${CT_ISL_TARGET}" ] || dump_pkg_desc "isl"
|
[ -z "${CT_MPFR}" ] || dump_pkg_desc MPFR
|
||||||
[ -z "${CT_CLOOG}" -a -z "${CT_CLOOG_TARGET}" ] || dump_pkg_desc "cloog"
|
[ -z "${CT_ISL}" ] || dump_pkg_desc ISL
|
||||||
[ -z "${CT_MPC}" -a -z "${CT_MPC_TARGET}" ] || dump_pkg_desc "mpc"
|
[ -z "${CT_CLOOG}" ] || dump_pkg_desc CLOOG
|
||||||
[ -z "${CT_LIBELF}" -a -z "${CT_LIBELF_TARGET}" ] || dump_pkg_desc "libelf"
|
[ -z "${CT_MPC}" ] || dump_pkg_desc MPC
|
||||||
[ -z "${CT_EXPAT}" -a -z "${CT_EXPAT_TARGET}" ] || dump_pkg_desc "expat"
|
[ -z "${CT_LIBELF}" -a -z "${CT_LIBELF_TARGET}" ] || dump_pkg_desc LIBELF
|
||||||
[ -z "${CT_NCURSES}" -a -z "${CT_NCURSES_TARGET}" ] || dump_pkg_desc "ncurses"
|
[ -z "${CT_EXPAT}" -a -z "${CT_EXPAT_TARGET}" ] || dump_pkg_desc EXPAT
|
||||||
[ -z "${complibs}" ] || printf "\n"
|
[ -z "${CT_NCURSES}" -a -z "${CT_NCURSES_TARGET}" ] || dump_pkg_desc NCURSES
|
||||||
printf " %-*s :" ${width} "binutils" && dump_pkg_desc "binutils" && printf "\n"
|
printf "\n"
|
||||||
printf " %-*s :" ${width} "Compilers" && dump_pkg_desc "${CT_CC}" && printf "\n"
|
printf " %-*s :" ${width} "Binutils" && dump_pkg_desc BINUTILS && printf "\n"
|
||||||
|
printf " %-*s :" ${width} "Compilers" && dump_pkg_desc CC && printf "\n"
|
||||||
printf " %-*s : %s" ${width} "Languages" "C"
|
printf " %-*s : %s" ${width} "Languages" "C"
|
||||||
[ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++"
|
[ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++"
|
||||||
[ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ",Fortran"
|
[ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ",Fortran"
|
||||||
@ -141,12 +93,12 @@ dump_single_sample() {
|
|||||||
[ "${CT_CC_LANG_GOLANG}" = "y" ] && printf ",Go"
|
[ "${CT_CC_LANG_GOLANG}" = "y" ] && printf ",Go"
|
||||||
[ -n "${CT_CC_LANG_OTHERS}" ] && printf ",${CT_CC_LANG_OTHERS}"
|
[ -n "${CT_CC_LANG_OTHERS}" ] && printf ",${CT_CC_LANG_OTHERS}"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf " %-*s : %s (threads: %s)\n" ${width} "C library" "${libc_name}${libc_ver:+-}${libc_ver}" "${CT_THREADS}"
|
printf " %-*s :" ${width} "C library" && dump_pkg_desc LIBC && printf " (threads: %s)\n" "${CT_THREADS}"
|
||||||
printf " %-*s :" ${width} "Tools"
|
printf " %-*s :" ${width} "Tools"
|
||||||
[ "${CT_DEBUG_DUMA}" ] && dump_pkg_desc "duma"
|
[ "${CT_DEBUG_DUMA}" ] && dump_pkg_desc DUMA
|
||||||
[ "${CT_DEBUG_GDB}" ] && dump_pkg_desc "gdb"
|
[ "${CT_DEBUG_GDB}" ] && dump_pkg_desc GDB
|
||||||
[ "${CT_DEBUG_LTRACE}" ] && dump_pkg_desc "ltrace"
|
[ "${CT_DEBUG_LTRACE}" ] && dump_pkg_desc LTRACE
|
||||||
[ "${CT_DEBUG_STRACE}" ] && dump_pkg_desc "strace"
|
[ "${CT_DEBUG_STRACE}" ] && dump_pkg_desc STRACE
|
||||||
printf "\n"
|
printf "\n"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@ -230,5 +182,5 @@ elif [ "${opt}" = "-W" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for sample in "${@}"; do
|
for sample in "${@}"; do
|
||||||
( dump_single_sample ${opt} "${sample}" )
|
dump_single_sample ${opt} "${sample}"
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user