diff options
author | Alexey Neyman <stilor@att.net> | 2017-11-29 00:14:04 -0800 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-11-29 23:44:49 -0800 |
commit | 9fdb93cce0a05e2562522153fe5deba8a9e9ae54 (patch) | |
tree | 54a6aab24418d733f750853f44a5bf74dd5056a1 /scripts/functions | |
parent | d759137c46fb7a04c4db44123ba3050afd734eef (diff) | |
download | crosstool-ng-9fdb93cce0a05e2562522153fe5deba8a9e9ae54.tar.gz crosstool-ng-9fdb93cce0a05e2562522153fe5deba8a9e9ae54.tar.bz2 crosstool-ng-9fdb93cce0a05e2562522153fe5deba8a9e9ae54.zip |
Make comp.libs use generated templates, too
This allows us to include the component-to-package relation in the
generated kconfig files and make use of that information in the
show-config.sh script.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/scripts/functions b/scripts/functions index 59106191..d46ac361 100644 --- a/scripts/functions +++ b/scripts/functions @@ -2225,14 +2225,23 @@ CT_GetPkgVersion() # (e.g. LIBC). CT_GetPkgBuildVersion() { - local pkg="${1}" - local tmp - local build_version - - # If it is a choice selector, switch to whatever specific package it selects - eval "tmp=\${CT_${pkg}_KSYM}" - if [ -n "${tmp}" ]; then - pkg="${tmp}" + local category="${1}" + local component="${2}" + local var="${3}" + local choicename tmp pkg build_version + + # If it is for a choice, not a menu, get the choice name + eval "choicename=\${CT_${category}}" + + # Find the associated package + eval "pkg=\${CT_${category}_${component}_PKG_KSYM}" + if [ -z "${pkg}" ]; then + # This component does not have an associated package, + # return the component name. + if [ -n "${choicename}" ]; then + eval "${var}=\"${choicename}\"" + fi + return fi __do_GetPkgBuildVersion() { @@ -2245,8 +2254,23 @@ CT_GetPkgBuildVersion() elif [ "${src_custom}" = "y" ]; then tmp+="-custom" fi + if [ -n "${choicename}" -a "${pkg}" != "${component}" ]; then + tmp+=" (${choicename})" + fi } CT_PackageRun "${pkg}" __do_GetPkgBuildVersion - eval "${2}=\"${tmp}\"" + eval "${var}=\"${tmp}\"" +} + +# Get a package version as selected by a generated choice in kconfig. +CT_GetChoicePkgBuildVersion() +{ + local choice="${1}" + local var="${2}" + local component + + # Find the selected component + eval "component=\${CT_${choice}_CHOICE_KSYM}" + CT_GetPkgBuildVersion "${choice}" "${component}" "${var}" } |