From 146c6814c9627a012c1a321073ac6ef2d7935d29 Mon Sep 17 00:00:00 2001 From: Sergey Korolev Date: Tue, 14 Nov 2017 01:09:41 +0300 Subject: scripts/functions: add CT_GetPkgBuildVersion This allows to get a configured custom version of a package. Signed-off-by: Sergey Korolev diff --git a/scripts/functions b/scripts/functions index 402de86..4dd5b7e 100644 --- a/scripts/functions +++ b/scripts/functions @@ -2213,3 +2213,25 @@ CT_GetPkgVersion() CT_PackageRun "${1}" __do_GetPkgVersion 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. +# Usage: CT_GetPkgBuildVersion PKG VAR +CT_GetPkgBuildVersion() +{ + local build_version + + CT_PackageRun "${1}" CT_DoGetPkgBuildVersion + eval "${2}=\"${build_version}\"" +} -- cgit v0.10.2-6-g49f6 From 5e0d62fac62450c2527b6efaccbc5c5b6aef8c0e Mon Sep 17 00:00:00 2001 From: Sergey Korolev Date: Tue, 14 Nov 2017 01:10:44 +0300 Subject: scripts/showSamples.sh: support custom package versions Signed-off-by: Sergey Korolev diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index 3ec165e..601aec3 100644 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -3,6 +3,7 @@ # Use tools discovered by ./configure . "${CT_LIB_DIR}/paths.sh" +. "${CT_LIB_DIR}/scripts/functions" [ "$1" = "-v" ] && opt="$1" && shift [ "$1" = "-w" ] && opt="$1" && shift @@ -14,6 +15,24 @@ export GREP_OPTIONS= # Dummy version which is invoked from .config 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_pkg_desc() { + local name=$1 + local version=$( dump_pkg_version "$name" ) + + printf " ${name}${version:+-}${version}" +} + # Dump a single sample # Note: we use the specific .config.sample config file dump_single_sample() { @@ -45,7 +64,7 @@ dump_single_sample() { fi ;; esac - eval "libc_ver=\"\${CT_${ksym}_VERSION}\"" + CT_GetPkgBuildVersion "${ksym}" libc_ver case "${sample}" in current) @@ -53,7 +72,7 @@ dump_single_sample() { sample="$( ${CT_NG} show-tuple )" case "${CT_TOOLCHAIN_TYPE}" in canadian) - sample="${CT_HOST},$sample" + sample="${CT_HOST},${sample}" ;; esac ;; @@ -80,7 +99,7 @@ dump_single_sample() { ;; esac # TBD currently only Linux is used. General handling for single-select (compiler/binutils/libc/os) and multi-select (debug/companions) components? - printf " %-*s : %s\n" ${width} "OS" "${CT_KERNEL}${CT_LINUX_VERSION:+-}${CT_LINUX_VERSION}" + printf " %-*s :" ${width} "OS" && dump_pkg_desc "${CT_KERNEL}" && printf "\n" if [ -n "${CT_GMP}" \ -o -n "${CT_MPFR}" \ -o -n "${CT_ISL}" \ @@ -101,23 +120,18 @@ dump_single_sample() { printf " %-*s :" ${width} "Companion libs" complibs=1 fi - [ -z "${CT_GMP}" -a -z "${CT_GMP_TARGET}" ] || printf " gmp-%s" "${CT_GMP_VERSION}" - [ -z "${CT_MPFR}" -a -z "${CT_MPFR_TARGET}" ] || printf " mpfr-%s" "${CT_MPFR_VERSION}" - [ -z "${CT_ISL}" -a -z "${CT_ISL_TARGET}" ] || printf " isl-%s" "${CT_ISL_VERSION}" - [ -z "${CT_CLOOG}" -a -z "${CT_CLOOG_TARGET}" ] || printf " cloog-%s" "${CT_CLOOG_VERSION}" - [ -z "${CT_MPC}" -a -z "${CT_MPC_TARGET}" ] || printf " mpc-%s" "${CT_MPC_VERSION}" - [ -z "${CT_LIBELF}" -a -z "${CT_LIBELF_TARGET}" ] || printf " libelf-%s" "${CT_LIBELF_VERSION}" - [ -z "${CT_EXPAT}" -a -z "${CT_EXPAT_TARGET}" ] || printf " expat-%s" "${CT_EXPAT_VERSION}" - [ -z "${CT_NCURSES}" -a -z "${CT_NCURSES_TARGET}" ] || printf " ncurses-%s" "${CT_NCURSES_VERSION}" + [ -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" [ -z "${complibs}" ] || printf "\n" - printf " %-*s : %s\n" ${width} "binutils" "binutils-${CT_BINUTILS_VERSION}" - printf " %-*s :" ${width} "C compilers" - cc=$(echo ${CT_CC} | ${awk} '{ print toupper($0)}') - version=$(eval echo \${CT_${cc}_VERSION}) - compiler=$(echo $cc | ${awk} '{print tolower($0)}') - printf " $compiler-$version" - printf "\n" - printf " %-*s : %s" ${width} "Languages" "C" + 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" [ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++" [ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ",Fortran" [ "${CT_CC_LANG_JAVA}" = "y" ] && printf ",Java" @@ -129,10 +143,10 @@ dump_single_sample() { printf "\n" printf " %-*s : %s (threads: %s)\n" ${width} "C library" "${libc_name}${libc_ver:+-}${libc_ver}" "${CT_THREADS}" printf " %-*s :" ${width} "Tools" - [ "${CT_DEBUG_DUMA}" ] && printf " duma-${CT_DUMA_VERSION}" - [ "${CT_DEBUG_GDB}" ] && printf " gdb-${CT_GDB_VERSION}" - [ "${CT_DEBUG_LTRACE}" ] && printf " ltrace-${CT_LTRACE_VERSION}" - [ "${CT_DEBUG_STRACE}" ] && printf " strace-${CT_STRACE_VERSION}" + [ "${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" printf "\n" fi else @@ -155,16 +169,11 @@ dump_single_sample() { if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then printf " //custom// " else - printf " ${CT_LINUX_VERSION} " + printf " " && dump_pkg_version "${CT_KERNEL}" && printf " " fi fi - printf "| ${CT_BINUTILS_VERSION} " - printf "| " - cc=$(echo ${CT_CC} | ${awk} '{ print toupper($0)}') - version=$(eval echo \${CT_${cc}_VERSION}) - compiler=$(echo $cc | ${awk} '{print tolower($0)}') - printf " $compiler | $version" - printf " " + printf "| " && dump_pkg_version "binutils" && printf " " + printf "| ${CT_CC} | " && dump_pkg_version "${CT_CC}" && printf " " printf "| ''${libc_name}'' |" if [ "${libc_name}" != "none" ]; then printf " ${libc_ver} " -- cgit v0.10.2-6-g49f6 From 63e91f4eba6fc9ba61be04eda3cc7fae19c827b8 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 19 Nov 2017 00:10:53 -0800 Subject: 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 diff --git a/bootstrap b/bootstrap index 52b27ed..0a7cee0 100755 --- a/bootstrap +++ b/bootstrap @@ -697,7 +697,7 @@ gen_selection() local dir="${2}" local label="${3}" - msg "Generating ${dir}.in" + msg "Generating ${dir}.in (${type})" exec >"${config_gen_dir}/${dir}.in" info=( \ [dir]=${dir} \ diff --git a/maintainer/kconfig-choice.template b/maintainer/kconfig-choice.template index b2ca217..ec66f74 100644 --- a/maintainer/kconfig-choice.template +++ b/maintainer/kconfig-choice.template @@ -25,6 +25,12 @@ config @@dir|@@ default "@@choice@@" if @@dir|@@_@@choice|@@ #!end-foreach +config @@dir|@@_KSYM + string +#!foreach choice + default "@@choice|@@" if @@dir|@@_@@choice|@@ +#!end-foreach + #!foreach choice if @@dir|@@_@@choice|@@ source "config/@@dir@@/@@choice@@.in" diff --git a/maintainer/kconfig-versions.template b/maintainer/kconfig-versions.template index e4be903..37461b7 100644 --- a/maintainer/kconfig-versions.template +++ b/maintainer/kconfig-versions.template @@ -243,6 +243,8 @@ config @@fork|@@_VERSION #!foreach version default "@@ver@@" if @@fork|@@_V_@@ver_sel|@@ #!end-foreach + default "new" if @@fork|@@_VERY_NEW + default "old" if @@fork|@@_VERY_OLD default "unknown" #!if [ "@@#version@@" -gt 0 ] diff --git a/scripts/functions b/scripts/functions index 4dd5b7e..5910619 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1,5 +1,6 @@ # -*- mode: sh; tab-width: 4 -*- # vi: ts=4:sw=4:sts=4:et +# vim: filetype=sh : # This file contains some useful common functions # Copyright 2007 Yann E. MORIN # 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^^}}" 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 # 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 @@ -2214,24 +2219,34 @@ CT_GetPkgVersion() 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. # Usage: CT_GetPkgBuildVersion PKG VAR +# where PKG may refer to a specific package (e.g. GCC) or package choice +# (e.g. LIBC). CT_GetPkgBuildVersion() { + local pkg="${1}" + local tmp local build_version - CT_PackageRun "${1}" CT_DoGetPkgBuildVersion - eval "${2}=\"${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}" + 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}\"" } diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index 601aec3..fee0d44 100644 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -15,22 +15,14 @@ export GREP_OPTIONS= # Dummy version which is invoked from .config 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_pkg_desc() { 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 @@ -44,28 +36,6 @@ dump_single_sample() { local sample="$1" . $(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 current) sample_type="l" @@ -98,39 +68,21 @@ dump_single_sample() { printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}" ;; esac - # TBD currently only Linux is used. General handling for single-select (compiler/binutils/libc/os) and multi-select (debug/companions) components? - printf " %-*s :" ${width} "OS" && dump_pkg_desc "${CT_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 + if [ "${CT_KERNEL}" != "bare-metal" ]; then + printf " %-*s :" ${width} "OS" && dump_pkg_desc KERNEL && printf "\n" fi - [ -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" - [ -z "${complibs}" ] || printf "\n" - printf " %-*s :" ${width} "binutils" && dump_pkg_desc "binutils" && printf "\n" - printf " %-*s :" ${width} "Compilers" && dump_pkg_desc "${CT_CC}" && printf "\n" + printf " %-*s :" ${width} "Companion libs" + [ -z "${CT_GMP}" ] || dump_pkg_desc GMP + [ -z "${CT_MPFR}" ] || dump_pkg_desc MPFR + [ -z "${CT_ISL}" ] || dump_pkg_desc ISL + [ -z "${CT_CLOOG}" ] || dump_pkg_desc CLOOG + [ -z "${CT_MPC}" ] || 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 + 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" [ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++" [ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ",Fortran" @@ -141,12 +93,12 @@ dump_single_sample() { [ "${CT_CC_LANG_GOLANG}" = "y" ] && printf ",Go" [ -n "${CT_CC_LANG_OTHERS}" ] && printf ",${CT_CC_LANG_OTHERS}" 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" - [ "${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" + [ "${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 printf "\n" fi else @@ -230,5 +182,5 @@ elif [ "${opt}" = "-W" ]; then fi for sample in "${@}"; do - ( dump_single_sample ${opt} "${sample}" ) + dump_single_sample ${opt} "${sample}" done -- cgit v0.10.2-6-g49f6 From f1cca2a7c2e5cf5ba3cb4f9c520e6bc5edc1a691 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 19 Nov 2017 00:16:21 -0800 Subject: Retire wiki-printer It is not used anymore and is currently broken. Signed-off-by: Alexey Neyman diff --git a/samples/samples.mk b/samples/samples.mk index ecd8a15..862dbe4 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -31,7 +31,6 @@ help-samples:: help-distrib:: @echo ' check-samples - Verify if samples need updates due to Kconfig changes' @echo ' update-samples - Regenerate sample configurations using the current Kconfig' - @echo ' wiki-samples - Print a DokuWiki table of samples' help-env:: @echo ' CT_PREFIX=dir - install samples in dir (see action "build-all", above).' @@ -110,22 +109,6 @@ check-samples: $(patsubst %,check-%,$(CT_SAMPLES)) update-samples: $(SILENT)$(MAKE) -rf $(CT_NG) check-samples CT_UPDATE_SAMPLES=yes -PHONY += wiki-samples -wiki-samples: wiki-samples-pre $(patsubst %,wiki-%,$(CT_SAMPLES)) wiki-samples-post - -wiki-samples-pre: FORCE - $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -w - -wiki-samples-post: FORCE - $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -W $(CT_SAMPLES) - -$(patsubst %,wiki-%,$(CT_SAMPLES)): wiki-%: - $(SILENT)KCONFIG_CONFIG=$$(pwd)/.config.sample \ - $(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \ - $(KCONFIG_TOP) >/dev/null - $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -w $* - $(SILENT)rm -f .config.sample - # ---------------------------------------------------------- # This part deals with saving/restoring samples diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index fee0d44..ea50102 100644 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -6,8 +6,6 @@ . "${CT_LIB_DIR}/scripts/functions" [ "$1" = "-v" ] && opt="$1" && shift -[ "$1" = "-w" ] && opt="$1" && shift -[ "$1" = "-W" ] && opt="$1" && shift # GREP_OPTIONS screws things up. export GREP_OPTIONS= @@ -29,10 +27,8 @@ dump_pkg_desc() { # Note: we use the specific .config.sample config file dump_single_sample() { local verbose=0 - local wiki=0 local complibs [ "$1" = "-v" ] && verbose=1 && shift - [ "$1" = "-w" ] && wiki=1 && shift local sample="$1" . $(pwd)/.config.sample @@ -55,132 +51,53 @@ dump_single_sample() { fi ;; esac - 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}" - if [ ${verbose} -ne 0 ]; then - case "${CT_TOOLCHAIN_TYPE}" in - cross) ;; - canadian) - printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}" - ;; - esac - if [ "${CT_KERNEL}" != "bare-metal" ]; then - printf " %-*s :" ${width} "OS" && dump_pkg_desc KERNEL && printf "\n" - fi - printf " %-*s :" ${width} "Companion libs" - [ -z "${CT_GMP}" ] || dump_pkg_desc GMP - [ -z "${CT_MPFR}" ] || dump_pkg_desc MPFR - [ -z "${CT_ISL}" ] || dump_pkg_desc ISL - [ -z "${CT_CLOOG}" ] || dump_pkg_desc CLOOG - [ -z "${CT_MPC}" ] || 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 - 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" - [ "${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" - printf " %-*s :" ${width} "C library" && dump_pkg_desc LIBC && printf " (threads: %s)\n" "${CT_THREADS}" - printf " %-*s :" ${width} "Tools" - [ "${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 - printf "\n" - fi - else + 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}" + if [ ${verbose} -ne 0 ]; then case "${CT_TOOLCHAIN_TYPE}" in - cross) - printf "| ''${sample}'' | " - ;; + cross) ;; canadian) - printf "| ''" - printf "${sample}" |${sed} -r -e 's/.*,//' - printf "'' | ${CT_HOST} " + printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}" ;; - *) ;; esac - printf "| " - [ "${CT_EXPERIMENTAL}" = "y" ] && printf "**X**" - [ -f "${sample_top}/samples/${sample}/broken" ] && printf "**B**" - printf " | ''${CT_KERNEL}'' |" - if [ "${CT_KERNEL}" != "bare-metal" ];then - if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then - printf " //custom// " - else - printf " " && dump_pkg_version "${CT_KERNEL}" && printf " " - fi + if [ "${CT_KERNEL}" != "bare-metal" ]; then + printf " %-*s :" ${width} "OS" && dump_pkg_desc KERNEL && printf "\n" fi - printf "| " && dump_pkg_version "binutils" && printf " " - printf "| ${CT_CC} | " && dump_pkg_version "${CT_CC}" && printf " " - printf "| ''${libc_name}'' |" - if [ "${libc_name}" != "none" ]; then - printf " ${libc_ver} " - fi - printf "| ${CT_THREADS:-none} " - printf "| ${CT_ARCH_FLOAT} " - 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}" - printf " " - ( . "${sample_top}/samples/${sample}/reported.by" - if [ -n "${reporter_name}" ]; then - if [ -n "${reporter_url}" ]; then - printf "| [[${reporter_url}|${reporter_name}]] " - else - printf "| ${reporter_name} " - fi - else - printf "| (//unknown//) " - fi - ) - sample_updated="$( git log -n1 --pretty=format:'%ci' "${sample_top}/samples/${sample}" \ - |${awk} '{ print $1; }' )" - printf "| ${sample_updated} " - echo "|" + printf " %-*s :" ${width} "Companion libs" + [ -z "${CT_GMP}" ] || dump_pkg_desc GMP + [ -z "${CT_MPFR}" ] || dump_pkg_desc MPFR + [ -z "${CT_ISL}" ] || dump_pkg_desc ISL + [ -z "${CT_CLOOG}" ] || dump_pkg_desc CLOOG + [ -z "${CT_MPC}" ] || 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 + 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" + [ "${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" + printf " %-*s :" ${width} "C library" && dump_pkg_desc LIBC && printf " (threads: %s)\n" "${CT_THREADS}" + printf " %-*s :" ${width} "Tools" + [ "${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 + printf "\n" fi } -if [ "${opt}" = "-w" -a ${#} -eq 0 ]; then - printf "^ %s |||||||||||||||\n" "$( date "+%Y%m%d.%H%M %z" )" - printf "^ Target " - printf "^ Host " - printf "^ Status " - printf "^ Kernel headers\\\\\\\\ version ^" - printf "^ binutils\\\\\\\\ version " - printf "^ C compiler\\\\\\\\ version ^" - printf "^ C library\\\\\\\\ version ^" - printf "^ Threading\\\\\\\\ model " - printf "^ Floating point\\\\\\\\ support " - printf "^ Languages " - printf "^ Initially\\\\\\\\ reported by " - printf "^ Last\\\\\\\\ updated " - echo "^" - 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 -fi - for sample in "${@}"; do dump_single_sample ${opt} "${sample}" done -- cgit v0.10.2-6-g49f6 From 5495a3497b54aa56e821c8aa44233345c0bd86b9 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 19 Nov 2017 00:18:59 -0800 Subject: showConfig.sh no longer has anything substituted Signed-off-by: Alexey Neyman diff --git a/Makefile.in b/Makefile.in index 33d9666..76fbd93 100644 --- a/Makefile.in +++ b/Makefile.in @@ -162,8 +162,7 @@ uninstall: real-uninstall build-bin: $(PROG_NAME) \ scripts/scripts.mk \ scripts/crosstool-NG.sh \ - scripts/saveSample.sh \ - scripts/showConfig.sh + scripts/saveSample.sh build-lib: paths.mk \ paths.sh @@ -228,7 +227,6 @@ clean-bin: $(call __silent_rm,scripts/scripts.mk) $(call __silent_rm,scripts/crosstool-NG.sh) $(call __silent_rm,scripts/saveSample.sh) - $(call __silent_rm,scripts/showConfig.sh) clean-lib: $(call __silent_rm,paths.mk paths.sh) diff --git a/scripts/.gitignore b/scripts/.gitignore index 7abc2a7..553a363 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -1,4 +1,3 @@ crosstool-NG.sh saveSample.sh -showConfig.sh scripts.mk diff --git a/scripts/showConfig.sh b/scripts/showConfig.sh new file mode 100644 index 0000000..9031b3c --- /dev/null +++ b/scripts/showConfig.sh @@ -0,0 +1,13 @@ +# What we need: +# - the .config file + +# Parse the tools' paths configuration +. "${CT_LIB_DIR}/paths.sh" + +# Parse the common functions +. "${CT_LIB_DIR}/scripts/functions" + +# Read the sample settings +CT_LoadConfig + +eval "echo \"$1\"" diff --git a/scripts/showConfig.sh.in b/scripts/showConfig.sh.in deleted file mode 100644 index 9031b3c..0000000 --- a/scripts/showConfig.sh.in +++ /dev/null @@ -1,13 +0,0 @@ -# What we need: -# - the .config file - -# Parse the tools' paths configuration -. "${CT_LIB_DIR}/paths.sh" - -# Parse the common functions -. "${CT_LIB_DIR}/scripts/functions" - -# Read the sample settings -CT_LoadConfig - -eval "echo \"$1\"" -- cgit v0.10.2-6-g49f6 From d759137c46fb7a04c4db44123ba3050afd734eef Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 19 Nov 2017 00:23:55 -0800 Subject: Align script names with the ct-ng commands Signed-off-by: Alexey Neyman diff --git a/ct-ng.in b/ct-ng.in index 0fc5499..a61637b 100644 --- a/ct-ng.in +++ b/ct-ng.in @@ -132,7 +132,7 @@ help-env:: @false show-tuple: .config - $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showConfig.sh '$${CT_TARGET}' + $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/show-tuple.sh '$${CT_TARGET}' # Actual build source: .config diff --git a/samples/samples.mk b/samples/samples.mk index 862dbe4..178e537 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -42,7 +42,7 @@ help-env:: PHONY += show-config show-config: .config @cp .config .config.sample - @$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -v current + @$(bash) $(CT_LIB_DIR)/scripts/show-config.sh -v current @rm -f .config.sample # Prints the details of a sample @@ -51,7 +51,7 @@ $(patsubst %,show-%,$(CT_SAMPLES)): show-%: @KCONFIG_CONFIG=$$(pwd)/.config.sample \ $(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \ $(KCONFIG_TOP) >/dev/null - @$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -v $* + @$(bash) $(CT_LIB_DIR)/scripts/show-config.sh -v $* @rm -f .config.sample # Prints the details of all samples @@ -75,7 +75,7 @@ $(patsubst %,list-%,$(CT_SAMPLES)): list-%: @KCONFIG_CONFIG=$$(pwd)/.config.sample \ $(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \ $(KCONFIG_TOP) >/dev/null - @$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh $* + @$(bash) $(CT_LIB_DIR)/scripts/show-config.sh $* @rm -f .config.sample PHONY += list-samples-short @@ -190,9 +190,9 @@ define build_sample mkdir -p .build-all/$$status/$(1); \ bzip2 < build.log > .build-all/$$status/$(1)/build.log.bz2; \ if [ "$$status" = PASS ]; then \ - blddir=`$(bash) $(CT_LIB_DIR)/scripts/showConfig.sh '$${CT_BUILD_TOP_DIR}'`; \ + blddir=`$(bash) $(CT_LIB_DIR)/scripts/show-tuple.sh '$${CT_BUILD_TOP_DIR}'`; \ [ -z "$(CT_PRESERVE_PASSED_BUILDS)" ] && rm -rf $${blddir}; \ - $(bash) $(CT_LIB_DIR)/scripts/showConfig.sh '$${CT_PREFIX_DIR}' > .build-all/PASS/$(1)/prefix; \ + $(bash) $(CT_LIB_DIR)/scripts/show-tuple.sh '$${CT_PREFIX_DIR}' > .build-all/PASS/$(1)/prefix; \ fi; \ : endef diff --git a/scripts/show-config.sh b/scripts/show-config.sh new file mode 100644 index 0000000..ea50102 --- /dev/null +++ b/scripts/show-config.sh @@ -0,0 +1,103 @@ +# Parses all samples on the command line, and for each of them, prints +# the versions of the main tools + +# Use tools discovered by ./configure +. "${CT_LIB_DIR}/paths.sh" +. "${CT_LIB_DIR}/scripts/functions" + +[ "$1" = "-v" ] && opt="$1" && shift + +# GREP_OPTIONS screws things up. +export GREP_OPTIONS= + +# Dummy version which is invoked from .config +CT_Mirrors() { :; } + +# Dump a short package description with a name and version in a format +# " [-]" +dump_pkg_desc() { + local name=$1 + local show_version + + CT_GetPkgBuildVersion ${1} show_version + printf " %s" "${show_version}" +} + +# Dump a single sample +# Note: we use the specific .config.sample config file +dump_single_sample() { + local verbose=0 + local complibs + [ "$1" = "-v" ] && verbose=1 && shift + local sample="$1" + . $(pwd)/.config.sample + + case "${sample}" in + current) + sample_type="l" + sample="$( ${CT_NG} show-tuple )" + case "${CT_TOOLCHAIN_TYPE}" in + canadian) + sample="${CT_HOST},${sample}" + ;; + esac + ;; + *) if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then + sample_top="${CT_TOP_DIR}" + sample_type="L" + else + sample_top="${CT_LIB_DIR}" + sample_type="G" + fi + ;; + esac + 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}" + if [ ${verbose} -ne 0 ]; then + case "${CT_TOOLCHAIN_TYPE}" in + cross) ;; + canadian) + printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}" + ;; + esac + if [ "${CT_KERNEL}" != "bare-metal" ]; then + printf " %-*s :" ${width} "OS" && dump_pkg_desc KERNEL && printf "\n" + fi + printf " %-*s :" ${width} "Companion libs" + [ -z "${CT_GMP}" ] || dump_pkg_desc GMP + [ -z "${CT_MPFR}" ] || dump_pkg_desc MPFR + [ -z "${CT_ISL}" ] || dump_pkg_desc ISL + [ -z "${CT_CLOOG}" ] || dump_pkg_desc CLOOG + [ -z "${CT_MPC}" ] || 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 + 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" + [ "${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" + printf " %-*s :" ${width} "C library" && dump_pkg_desc LIBC && printf " (threads: %s)\n" "${CT_THREADS}" + printf " %-*s :" ${width} "Tools" + [ "${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 + printf "\n" + fi +} + +for sample in "${@}"; do + dump_single_sample ${opt} "${sample}" +done diff --git a/scripts/show-tuple.sh b/scripts/show-tuple.sh new file mode 100644 index 0000000..9031b3c --- /dev/null +++ b/scripts/show-tuple.sh @@ -0,0 +1,13 @@ +# What we need: +# - the .config file + +# Parse the tools' paths configuration +. "${CT_LIB_DIR}/paths.sh" + +# Parse the common functions +. "${CT_LIB_DIR}/scripts/functions" + +# Read the sample settings +CT_LoadConfig + +eval "echo \"$1\"" diff --git a/scripts/showConfig.sh b/scripts/showConfig.sh deleted file mode 100644 index 9031b3c..0000000 --- a/scripts/showConfig.sh +++ /dev/null @@ -1,13 +0,0 @@ -# What we need: -# - the .config file - -# Parse the tools' paths configuration -. "${CT_LIB_DIR}/paths.sh" - -# Parse the common functions -. "${CT_LIB_DIR}/scripts/functions" - -# Read the sample settings -CT_LoadConfig - -eval "echo \"$1\"" diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh deleted file mode 100644 index ea50102..0000000 --- a/scripts/showSamples.sh +++ /dev/null @@ -1,103 +0,0 @@ -# Parses all samples on the command line, and for each of them, prints -# the versions of the main tools - -# Use tools discovered by ./configure -. "${CT_LIB_DIR}/paths.sh" -. "${CT_LIB_DIR}/scripts/functions" - -[ "$1" = "-v" ] && opt="$1" && shift - -# GREP_OPTIONS screws things up. -export GREP_OPTIONS= - -# Dummy version which is invoked from .config -CT_Mirrors() { :; } - -# Dump a short package description with a name and version in a format -# " [-]" -dump_pkg_desc() { - local name=$1 - local show_version - - CT_GetPkgBuildVersion ${1} show_version - printf " %s" "${show_version}" -} - -# Dump a single sample -# Note: we use the specific .config.sample config file -dump_single_sample() { - local verbose=0 - local complibs - [ "$1" = "-v" ] && verbose=1 && shift - local sample="$1" - . $(pwd)/.config.sample - - case "${sample}" in - current) - sample_type="l" - sample="$( ${CT_NG} show-tuple )" - case "${CT_TOOLCHAIN_TYPE}" in - canadian) - sample="${CT_HOST},${sample}" - ;; - esac - ;; - *) if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then - sample_top="${CT_TOP_DIR}" - sample_type="L" - else - sample_top="${CT_LIB_DIR}" - sample_type="G" - fi - ;; - esac - 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}" - if [ ${verbose} -ne 0 ]; then - case "${CT_TOOLCHAIN_TYPE}" in - cross) ;; - canadian) - printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}" - ;; - esac - if [ "${CT_KERNEL}" != "bare-metal" ]; then - printf " %-*s :" ${width} "OS" && dump_pkg_desc KERNEL && printf "\n" - fi - printf " %-*s :" ${width} "Companion libs" - [ -z "${CT_GMP}" ] || dump_pkg_desc GMP - [ -z "${CT_MPFR}" ] || dump_pkg_desc MPFR - [ -z "${CT_ISL}" ] || dump_pkg_desc ISL - [ -z "${CT_CLOOG}" ] || dump_pkg_desc CLOOG - [ -z "${CT_MPC}" ] || 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 - 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" - [ "${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" - printf " %-*s :" ${width} "C library" && dump_pkg_desc LIBC && printf " (threads: %s)\n" "${CT_THREADS}" - printf " %-*s :" ${width} "Tools" - [ "${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 - printf "\n" - fi -} - -for sample in "${@}"; do - dump_single_sample ${opt} "${sample}" -done -- cgit v0.10.2-6-g49f6 From 9fdb93cce0a05e2562522153fe5deba8a9e9ae54 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 29 Nov 2017 00:14:04 -0800 Subject: 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 diff --git a/bootstrap b/bootstrap index 0a7cee0..e497467 100755 --- a/bootstrap +++ b/bootstrap @@ -71,7 +71,7 @@ find_end() fi endline=$[endline + 1] done - error "line ${l}: '${token}' token is unpaired" + error "${template}:${l}: '${token}' token is unpaired" } set_iter() @@ -142,7 +142,7 @@ run_foreach() shift if [ "${info[iter_${var}]+set}" != "set" ]; then - error "line ${l}: iterator over '${var}' is not defined" + error "${template}:${l}: iterator over '${var}' is not defined" fi find_end "foreach" debug "Loop over '${var}', lines ${l}..${endline}" @@ -168,7 +168,7 @@ run_lines_if() fi ;; *) - error "line ${l}: unknown condition '${prev}' for loop" + error "${template}:${l}: unknown condition '${prev}' for loop" ;; esac prev= @@ -204,7 +204,7 @@ run_lines() pp="${v#${vp}}" # $vp is name of the variable proper, $pp is any postprocessing if [ "${info[${vp}]+set}" != "set" ]; then - error "line ${l}: reference to undefined variable '${vp}'" + error "${template}:${l}: reference to undefined variable '${vp}'" fi if [ "${info[${v}]+set}" != "set" ]; then # We know the base variable, need to cache postprocessed value @@ -232,7 +232,7 @@ run_lines() s="${s#*@@*@@}" ;; *@@*) - error "line ${l}: non-paired @@ markers" + error "${template}:${l}: non-paired @@ markers" ;; *) s1="${s1}${s}" @@ -254,7 +254,7 @@ run_lines() # Comment, do nothing ;; "#!"*) - error "line ${l}: unrecognized command" + error "${template}:${l}: unrecognized command" ;; *) # Not a special command @@ -273,6 +273,7 @@ run_template() if [ ! -r "${src}" ]; then error "Template '${src}' not found" fi + template="${src}" debug "Running template ${src}" mapfile -O 1 -t tlines < "${src}" run_lines 1 ${#tlines[@]} @@ -660,23 +661,39 @@ get_components() enter_choice() { local choice="${1}" - local l + local input="config/${info[dir]}/${choice}.in" + local l ln info[choice]="${choice}" + info[pkg]="${choice}" # Not local, we need these arrays be set in enter_dependency/enter_help deplines=( ) helplines=( ) + ln=0 while read l; do + ln=$[ln+1] case "${l}" in "## help "*) - helplines+=( "${l#* help }" ) + helplines+=( "${l#\#\# help }" ) ;; - "## depends "*|"## select "*) - deplines+=( "${l#* }" ) + "## depends "*|"## select "*|"## default "*) + deplines+=( "${l#\#\# }" ) + ;; + "## no-package") + info[pkg]= + ;; + "## package "*) + info[pkg]=${l#\#\# package } + ;; + "##"|"## help") + # accept empty, for formatting + ;; + "##"*) + error "${input}:${ln}: unrecognized command" ;; esac - done < "config/${info[dir]}/${choice}.in" + done < "${input}" set_iter dependency "${!deplines[@]}" set_iter help "${!helplines[@]}" } @@ -719,6 +736,7 @@ gen_selection choice binutils "Binutils" gen_selection choice libc "C library" gen_selection menu debug "Debug facilities" gen_selection menu comp_tools "Companion tools" +gen_selection menu comp_libs "Companion libraries" msg "*** Running autoconf" autoconf -Wall --force diff --git a/config/arch/alpha.in b/config/arch/alpha.in index f0d7fe0..e46772d 100644 --- a/config/arch/alpha.in +++ b/config/arch/alpha.in @@ -1,5 +1,6 @@ # Alpha specific configuration file +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_DEFAULT_32 ## select ARCH_USE_MMU diff --git a/config/arch/arm.in b/config/arch/arm.in index 72c329f..7ce7ef0 100644 --- a/config/arch/arm.in +++ b/config/arch/arm.in @@ -1,5 +1,6 @@ # ARM specific configuration file +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_SUPPORTS_64 ## select ARCH_DEFAULT_32 diff --git a/config/arch/avr.in b/config/arch/avr.in index cf8e9af..ddf0cb6 100644 --- a/config/arch/avr.in +++ b/config/arch/avr.in @@ -1,5 +1,6 @@ # AVR specific config options +## no-package ## select ARCH_SUPPORTS_8 ## select ARCH_DEFAULT_8 ## select ARCH_REQUIRES_MULTILIB diff --git a/config/arch/m68k.in b/config/arch/m68k.in index 6c76e78..60279da 100644 --- a/config/arch/m68k.in +++ b/config/arch/m68k.in @@ -1,5 +1,6 @@ # m68k specific configuration file +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_DEFAULT_32 ## select ARCH_DEFAULT_BE diff --git a/config/arch/microblaze.in b/config/arch/microblaze.in index 8c73b00..7e5ceea 100644 --- a/config/arch/microblaze.in +++ b/config/arch/microblaze.in @@ -1,5 +1,6 @@ # MicroBlaze specific config options +## no-package ## depends on EXPERIMENTAL ## ## select ARCH_SUPPORTS_WITH_CPU @@ -11,12 +12,12 @@ ## ## help The MicroBlaze architecture, as defined by: ## help http://www.xilinx.com/ -## help +## help ## help Upstream projects do not currently provide ## help full support for the microblaze architecture ## help and as such, this is marked as EXPERIMENTAL ## help for CT-NG. -## help +## help ## help Support is being added for a modern gcc, ## help binutils and gdb along with nptl threading ## help in glibc for microblaze. diff --git a/config/arch/mips.in b/config/arch/mips.in index 8cc68dc..ad8b1c6 100644 --- a/config/arch/mips.in +++ b/config/arch/mips.in @@ -1,5 +1,6 @@ # MIPS specific config options +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_SUPPORTS_64 ## select ARCH_DEFAULT_32 diff --git a/config/arch/msp430.in b/config/arch/msp430.in index e31d78b..320eca8 100644 --- a/config/arch/msp430.in +++ b/config/arch/msp430.in @@ -1,5 +1,6 @@ # MSP430 specific config options +## no-package ## select ARCH_SUPPORTS_16 ## select ARCH_DEFAULT_16 ## select ARCH_REQUIRES_MULTILIB diff --git a/config/arch/nios2.in b/config/arch/nios2.in index e024102..b3b1249 100644 --- a/config/arch/nios2.in +++ b/config/arch/nios2.in @@ -1,5 +1,6 @@ # NIOS232 specific configuration file +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_DEFAULT_32 ## select ARCH_SUPPORTS_BOTH_MMU diff --git a/config/arch/powerpc.in b/config/arch/powerpc.in index ae10e2d..40d88b9 100644 --- a/config/arch/powerpc.in +++ b/config/arch/powerpc.in @@ -1,5 +1,6 @@ # Powerpc specific configuration file +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_SUPPORTS_64 ## select ARCH_DEFAULT_32 diff --git a/config/arch/riscv.in b/config/arch/riscv.in index 1323347..e8c1297 100644 --- a/config/arch/riscv.in +++ b/config/arch/riscv.in @@ -1,5 +1,6 @@ # RISC-V specific config options +## no-package ## depends on EXPERIMENTAL ## ## select ARCH_SUPPORTS_32 diff --git a/config/arch/s390.in b/config/arch/s390.in index 00bc879..64107b6 100644 --- a/config/arch/s390.in +++ b/config/arch/s390.in @@ -1,5 +1,6 @@ # s390 specific config options +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_SUPPORTS_64 ## select ARCH_DEFAULT_32 diff --git a/config/arch/sh.in b/config/arch/sh.in index efced07..0c75e78 100644 --- a/config/arch/sh.in +++ b/config/arch/sh.in @@ -1,5 +1,6 @@ # Super-H specific configuration file +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_DEFAULT_32 ## select ARCH_USE_MMU diff --git a/config/arch/sparc.in b/config/arch/sparc.in index 27eaf9c..c5dafe0 100644 --- a/config/arch/sparc.in +++ b/config/arch/sparc.in @@ -1,5 +1,6 @@ # SPARC specific config options +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_SUPPORTS_64 ## select ARCH_DEFAULT_32 diff --git a/config/arch/x86.in b/config/arch/x86.in index 3863c02..ab89ccd 100644 --- a/config/arch/x86.in +++ b/config/arch/x86.in @@ -1,5 +1,6 @@ # x86 specific options +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_SUPPORTS_64 ## select ARCH_DEFAULT_32 diff --git a/config/arch/xtensa.in b/config/arch/xtensa.in index a376523..cf1fb64 100644 --- a/config/arch/xtensa.in +++ b/config/arch/xtensa.in @@ -1,5 +1,6 @@ # xtensa specific configuration file +## no-package ## select ARCH_SUPPORTS_32 ## select ARCH_SUPPORTS_EITHER_ENDIAN ## select ARCH_DEFAULT_LE diff --git a/config/binutils/binutils.in b/config/binutils/binutils.in index 3cb58f9..bd32bd6 100644 --- a/config/binutils/binutils.in +++ b/config/binutils/binutils.in @@ -2,8 +2,6 @@ comment "GNU binutils" -source "config/versions/binutils.in" - config BINUTILS_HAS_HASH_STYLE default y if BINUTILS_2_23_or_later bool @@ -187,7 +185,7 @@ comment "elf2flt" config ELF2FLT_REQUIRES def_bool y - select ZLIB + select ZLIB_NEEDED select BINUTILS_FORCE_LD_BFD_ONLY source "config/versions/elf2flt.in" diff --git a/config/cc/gcc.in b/config/cc/gcc.in index a11e8cd..48ec556 100644 --- a/config/cc/gcc.in +++ b/config/cc/gcc.in @@ -1,6 +1,5 @@ # GCC options -## default y ## select CC_SUPPORT_CXX if !LIBC_NONE ## select CC_SUPPORT_FORTRAN ## select CC_SUPPORT_JAVA if !GCC_7_or_later @@ -25,8 +24,6 @@ ## help gcc supports many languages, a powerful code parser, optimised binary ## help output, and lots of other features. -source "config/versions/gcc.in" - # Only enable gcc's support for plugins if binutils has it as well # They are useful only when doing LTO, but it does no harm enabling # them even without LTO. diff --git a/config/comp_libs.in b/config/comp_libs.in index 009aac8..55ca227 100644 --- a/config/comp_libs.in +++ b/config/comp_libs.in @@ -4,200 +4,146 @@ menu "Companion libraries" -config COMPLIBS_NEEDED +config COMPLIBS_CHECK bool + prompt "Check the companion libraries builds (!!! READ HELP!!!)" + help + It is highly recommended to check the newly built companion libraries. + Unfortunately, this is a very intensive task, and takes a loooong time. + + Checking the newly built companion libraries is thus disabled by default, + but it is suggested that you check them at least once on your machine, + and if they work, disable the check on subsequent builds. + + If you suspect that one (or more) of your companion libraries is the + cause for incorrectly generated code, you should answer 'Y' here. + Note however that this will take a really long time. + +source "config/gen/comp_libs.in" + +# FIXME this needs to have a list of options +# [ ] libfoo for build +# [ ] libfoo for host (if canadian) +# [ ] libfoo for target +# libfoo options --> +# +# Then have other packages *set default* for build/host +# (but not select, so that user can utilize build's or host's system library) +# and *select* the target (so that we build it if we must, and let user optionally +# build it if he wants). Upon any of these options LIBFOO_{BUILD,HOST,TARGET} +# being set, set LIBFOO_ENABLED and use that as a qualifier for submenu. +# For now, LIBFOO_NEEDED symbol may or may not user-selectable, and COMP_LIBS_LIBFOO +# determines whether it is actually built. LIBFOO_NEEDED is currently for build/host +# and LIBFOO_TARGET (if exists) is for target. config LIBICONV_NEEDED - bool - select LIBICONV - select COMPLIBS_NEEDED + bool "Build local libiconv" + default y if CANADIAN || CROSS_NATIVE + select COMP_LIBS_LIBICONV config GETTEXT_NEEDED - bool - select GETTEXT + bool "Build local gettext" + default y if CANADIAN || CROSS_NATIVE select LIBICONV_NEEDED - select COMPLIBS_NEEDED + select NCURSES_NEEDED + select COMP_LIBS_GETTEXT config GMP_NEEDED def_bool y - select GMP - select COMPLIBS_NEEDED + select COMP_LIBS_GMP config MPFR_NEEDED def_bool y - select MPFR - select COMPLIBS_NEEDED + select GMP_NEEDED + select COMP_LIBS_MPFR config ISL_NEEDED bool - select ISL - select COMPLIBS_NEEDED + select GMP_NEEDED + select COMP_LIBS_ISL config CLOOG_NEEDED bool - select CLOOG - select COMPLIBS_NEEDED + select GMP_NEEDED + select COMP_LIBS_CLOOG config MPC_NEEDED def_bool y - select MPC - select COMPLIBS_NEEDED + select GMP_NEEDED + select MPFR_NEEDED + select COMP_LIBS_MPC config LIBELF_NEEDED bool - select LIBELF - select COMPLIBS_NEEDED + select COMP_LIBS_LIBELF + +config LIBELF_TARGET + bool + select COMP_LIBS_LIBELF config EXPAT_NEEDED bool - select EXPAT - select COMPLIBS_NEEDED + select COMP_LIBS_EXPAT + +config EXPAT_TARGET + bool + select COMP_LIBS_EXPAT config NCURSES_NEEDED bool - select NCURSES - select COMPLIBS_NEEDED + select COMP_LIBS_NCURSES -config COMPLIBS +config NCURSES_TARGET bool + select COMP_LIBS_NCURSES +config ZLIB_NEEDED + bool "Build local zlib" + select COMP_LIBS_ZLIB + +# FIXME remove these legacy knobs config LIBICONV - bool "Build local libiconv" - default y if CANADIAN || CROSS_NATIVE - select COMPLIBS + def_bool y + depends on LIBICONV_NEEDED config GETTEXT - bool "Build local gettext" - default y if CANADIAN || CROSS_NATIVE - select LIBICONV_NEEDED - select NCURSES_NEEDED - select COMPLIBS + def_bool y + depends on GETTEXT_NEEDED config GMP - bool - select COMPLIBS + def_bool y + depends on GMP_NEEDED config MPFR - bool - select GMP - select COMPLIBS + def_bool y + depends on MPFR_NEEDED config ISL - bool - select GMP - select COMPLIBS + def_bool y + depends on ISL_NEEDED config CLOOG - bool - select GMP - select COMPLIBS + def_bool y + depends on CLOOG_NEEDED config MPC - bool - select GMP - select MPFR - select COMPLIBS + def_bool y + depends on MPC_NEEDED config LIBELF - bool - select COMPLIBS - -config LIBELF_TARGET - bool + def_bool y + depends on LIBELF_NEEDED config EXPAT - bool - select COMPLIBS - -config EXPAT_TARGET - bool + def_bool y + depends on EXPAT_NEEDED config NCURSES - bool - select COMPLIBS - -config NCURSES_TARGET - bool + def_bool y + depends on NCURSES_NEEDED config ZLIB - bool "Build local zlib" - -# FIXME this needs to have a list of options -# [ ] libfoo for build -# [ ] libfoo for host (if canadian) -# [ ] libfoo for target -# libfoo options --> -# -# Then have other packages *set default* for build/host -# (but not select, so that user can utilize build's or host's system library) -# and *select* the target (so that we build it if we must, and let user optionally -# build it if he wants). Upon any of these options LIBFOO_{BUILD,HOST,TARGET} -# being set, set LIBFOO_ENABLED and use that as a qualifier for submenu. -# For now, just have comments delineating the libs. -if ZLIB -comment "zlib options" -source "config/comp_libs/zlib.in" -endif -if LIBICONV -comment "libiconv options" -source "config/comp_libs/libiconv.in" -endif -if GETTEXT -comment "gettext options" -source "config/comp_libs/gettext.in" -endif -if GMP -comment "GMP options" -source "config/comp_libs/gmp.in" -endif -if MPFR -comment "MPFR options" -source "config/comp_libs/mpfr.in" -endif -if ISL -comment "ISL options" -source "config/comp_libs/isl.in" -endif -if CLOOG -comment "CLooG options" -source "config/comp_libs/cloog.in" -endif -if MPC -comment "MPC options" -source "config/comp_libs/mpc.in" -endif -if LIBELF || LIBELF_TARGET -comment "libelf options" -source "config/comp_libs/libelf.in" -endif -if EXPAT || EXPAT_TARGET -comment "expat options" -source "config/comp_libs/expat.in" -endif -if NCURSES || NCURSES_TARGET -comment "ncurses options" -source "config/comp_libs/ncurses.in" -endif - -if COMPLIBS - -comment "Companion libraries common options" - -config COMPLIBS_CHECK - bool - prompt "Check the companion libraries builds (!!! READ HELP!!!)" - help - It is highly recommended to check the newly built companion libraries. - Unfortunately, this is a very intensive task, and takes a loooong time. - - Checking the newly built companion libraries is thus disabled by default, - but it is suggested that you check them at least once on your machine, - and if they work, disable the check on subsequent builds. - - If you suspect that one (or more) of your companion libraries is the - cause for incorrectly generated code, you should answer 'Y' here. - Note however that this will take a really long time. - -endif # COMPLIBS + def_bool y + depends on ZLIB_NEEDED endmenu diff --git a/config/comp_libs/cloog.in b/config/comp_libs/cloog.in index b894de9..54cb76b 100644 --- a/config/comp_libs/cloog.in +++ b/config/comp_libs/cloog.in @@ -1,11 +1,8 @@ # CLooG options -## depends on OBSOLETE # CLooG 0.18.4 requires ISL 0.12 or newer # CLooG 0.18.1/0.18.0 requires ISL 0.12 or older -source "config/versions/cloog.in" - config CLOOG_HAS_WITH_GMP_ISL_OSL bool default y if CLOOG_0_18_or_later diff --git a/config/comp_libs/expat.in b/config/comp_libs/expat.in index a2753a4..c435757 100644 --- a/config/comp_libs/expat.in +++ b/config/comp_libs/expat.in @@ -1,3 +1 @@ # expat config file - -source "config/versions/expat.in" diff --git a/config/comp_libs/gettext.in b/config/comp_libs/gettext.in index 4928ede..df7e336 100644 --- a/config/comp_libs/gettext.in +++ b/config/comp_libs/gettext.in @@ -1,3 +1 @@ # gettext options - -source "config/versions/gettext.in" diff --git a/config/comp_libs/gmp.in b/config/comp_libs/gmp.in index 28359cd..9c7daf0 100644 --- a/config/comp_libs/gmp.in +++ b/config/comp_libs/gmp.in @@ -1,7 +1,5 @@ # GMP options -source "config/versions/gmp.in" - config GMP_HAS_MPBSD bool default y if !GMP_5_1_or_later diff --git a/config/comp_libs/isl.in b/config/comp_libs/isl.in index 9c74078..e0358ee 100644 --- a/config/comp_libs/isl.in +++ b/config/comp_libs/isl.in @@ -1,21 +1,6 @@ # ISL options -# FIXME these currently have no effect -## select CLOOG_REQUIRE_0_18_1_or_older if !ISL_0_12_or_later -## select CLOOG_REQUIRE_0_18_4_or_later if !ISL_0_14_or_older - -source "config/versions/isl.in" - -# FIXME should be auto-generated once companion libs are using gen-kconfig (and hence, ## syntax) -config ISL_CLOOG_auto_select_1 - def_bool y - depends on CLOOG_NEEDED && !ISL_0_12_or_later - select CLOOG_REQUIRE_0_18_1_or_older - -# FIXME should be auto-generated once companion libs are using gen-kconfig (and hence, ## syntax) -config ISL_CLOOG_auto_select_2 - def_bool y - depends on CLOOG_NEEDED && !ISL_0_13_or_older - select CLOOG_REQUIRE_0_18_4_or_later +## select CLOOG_REQUIRE_0_18_1_or_older if CLOOG_NEEDED && !ISL_0_12_or_later +## select CLOOG_REQUIRE_0_18_4_or_later if CLOOG_NEEDED && !ISL_0_14_or_older config ISL_NEEDS_WITH_GMP bool diff --git a/config/comp_libs/libelf.in b/config/comp_libs/libelf.in index 5b268c1..e1376c2 100644 --- a/config/comp_libs/libelf.in +++ b/config/comp_libs/libelf.in @@ -1,3 +1 @@ # libelf config file - -source "config/versions/libelf.in" diff --git a/config/comp_libs/libiconv.in b/config/comp_libs/libiconv.in index 99d3365..35cf1c4 100644 --- a/config/comp_libs/libiconv.in +++ b/config/comp_libs/libiconv.in @@ -1,3 +1 @@ # libiconv options - -source "config/versions/libiconv.in" diff --git a/config/comp_libs/mpc.in b/config/comp_libs/mpc.in index 790e755..2d948a7 100644 --- a/config/comp_libs/mpc.in +++ b/config/comp_libs/mpc.in @@ -1,3 +1 @@ # MPC options - -source "config/versions/mpc.in" diff --git a/config/comp_libs/mpfr.in b/config/comp_libs/mpfr.in index 5ed7ac8..f49d1a7 100644 --- a/config/comp_libs/mpfr.in +++ b/config/comp_libs/mpfr.in @@ -1,3 +1 @@ # GMP options - -source "config/versions/mpfr.in" diff --git a/config/comp_libs/ncurses.in b/config/comp_libs/ncurses.in index 7087fbe..c54713c 100644 --- a/config/comp_libs/ncurses.in +++ b/config/comp_libs/ncurses.in @@ -1,6 +1,4 @@ -# expat config file - -source "config/versions/ncurses.in" +# ncurses config file config NCURSES_NEW_ABI bool "ncurses 6.0 ABI support" diff --git a/config/comp_libs/zlib.in b/config/comp_libs/zlib.in index 70668e2..3481166 100644 --- a/config/comp_libs/zlib.in +++ b/config/comp_libs/zlib.in @@ -1,3 +1 @@ # Zlib options - -source "config/versions/zlib.in" diff --git a/config/comp_tools/autoconf.in b/config/comp_tools/autoconf.in index b49017d..b84d587 100644 --- a/config/comp_tools/autoconf.in +++ b/config/comp_tools/autoconf.in @@ -3,5 +3,3 @@ ## default y if !CONFIGURE_has_autoconf_2_63_or_newer ## default y if !CONFIGURE_has_autoreconf_2_63_or_newer ## help Autoconf - -source "config/versions/autoconf.in" diff --git a/config/comp_tools/automake.in b/config/comp_tools/automake.in index 455200e..6982156 100644 --- a/config/comp_tools/automake.in +++ b/config/comp_tools/automake.in @@ -2,5 +2,3 @@ ## default y if !CONFIGURE_has_automake_1_15_or_newer ## help Automake - -source "config/versions/automake.in" diff --git a/config/comp_tools/libtool.in b/config/comp_tools/libtool.in index 071b53e..253a731 100644 --- a/config/comp_tools/libtool.in +++ b/config/comp_tools/libtool.in @@ -2,5 +2,3 @@ ## default y if !CONFIGURE_has_libtool_2_4_or_newer ## default y if !CONFIGURE_has_libtoolize_2_4_or_newer - -source "config/versions/libtool.in" diff --git a/config/comp_tools/m4.in b/config/comp_tools/m4.in index 1a81a9f..de59a7f 100644 --- a/config/comp_tools/m4.in +++ b/config/comp_tools/m4.in @@ -1,5 +1,3 @@ # GNU m4 ## default y if !CONFIGURE_has_gnu_m4_1_4_12_or_newer - -source "config/versions/m4.in" diff --git a/config/comp_tools/make.in b/config/comp_tools/make.in index 07331d5..8d0ac29 100644 --- a/config/comp_tools/make.in +++ b/config/comp_tools/make.in @@ -2,8 +2,6 @@ ## default y if !CONFIGURE_has_make_3_81_or_newer -source "config/versions/make.in" - config MAKE_GMAKE_SYMLINK bool prompt "Add gmake symlink to companion gnu/make" diff --git a/config/debug/duma.in b/config/debug/duma.in index c837c65..bc69e17 100644 --- a/config/debug/duma.in +++ b/config/debug/duma.in @@ -7,8 +7,6 @@ ## help A memory bound checker, with additional features. ## help Formerly known as Electric Fence. -source "config/versions/duma.in" - config DUMA_SO bool prompt "Build a shared library" diff --git a/config/debug/gdb.in b/config/debug/gdb.in index 3fe486f..02882aa 100644 --- a/config/debug/gdb.in +++ b/config/debug/gdb.in @@ -2,8 +2,6 @@ ## help gdb is the GNU debugger -source "config/versions/gdb.in" - source "config/debug/gdb.in.cross" source "config/debug/gdb.in.native" source "config/debug/gdb.in.gdbserver" diff --git a/config/debug/ltrace.in b/config/debug/ltrace.in index 01ad147..1cdd157 100644 --- a/config/debug/ltrace.in +++ b/config/debug/ltrace.in @@ -8,8 +8,6 @@ ## help the executed process and the signals which are received by that process. ## help It can also intercept and print the system calls executed by the program. -source "config/versions/ltrace.in" - # Ltrace 0.5.3 had a unique hand-crafted configure script that has to be # run differently from any preceding or following releases. This serves # as a reminder to remove that code once 0.5.3 support is dropped. diff --git a/config/debug/strace.in b/config/debug/strace.in index 160a518..6f335b2 100644 --- a/config/debug/strace.in +++ b/config/debug/strace.in @@ -1,5 +1,3 @@ # strace ## depends on ! LIBC_BIONIC - -source "config/versions/strace.in" diff --git a/config/kernel/bare-metal.in b/config/kernel/bare-metal.in index fdccb0c..8ff875a 100644 --- a/config/kernel/bare-metal.in +++ b/config/kernel/bare-metal.in @@ -1,5 +1,6 @@ # Bare metal config options +## no-package ## select BARE_METAL ## ## help 'Bare metal' refers to those programs that run without any kernel. diff --git a/config/kernel/linux.in b/config/kernel/linux.in index b8d433a..fb16067 100644 --- a/config/kernel/linux.in +++ b/config/kernel/linux.in @@ -12,8 +12,6 @@ # (including versions in between) until the EOL dates indicated below. # Such pinned versions are indicated in version.desc files with a comment. -source "config/versions/linux.in" - choice bool prompt "Kernel verbosity:" diff --git a/config/kernel/windows.in b/config/kernel/windows.in index e649787..33ca5af 100644 --- a/config/kernel/windows.in +++ b/config/kernel/windows.in @@ -1,5 +1,6 @@ # windows config options +## no-package ## depends on ARCH_X86 ## depends on EXPERIMENTAL ## diff --git a/config/libc/avr-libc.in b/config/libc/avr-libc.in index 836fed8..f35a206 100644 --- a/config/libc/avr-libc.in +++ b/config/libc/avr-libc.in @@ -9,8 +9,6 @@ ## help Atmel AVR 8-bit RISC microcontrollers. In addition, the library ## help provides the basic startup code needed by most applications. -source "config/versions/avr-libc.in" - config LIBC_AVR_LIBC_EXTRA_CONFIG_ARRAY string prompt "Extra config for avr-libc" diff --git a/config/libc/bionic.in b/config/libc/bionic.in index 41b87a1..da663b4 100644 --- a/config/libc/bionic.in +++ b/config/libc/bionic.in @@ -1,5 +1,6 @@ # bionic options +## package android-ndk ## depends on ! WINDOWS && ! BARE_METAL ## depends on ARCH_ARM || ARCH_MIPS || ARCH_X86 ## depends on EXPERIMENTAL @@ -11,8 +12,6 @@ ## help This platform has no TLS (Thread Local Storage) support so that option must be ## help disabled in the Compiler options. -source "config/versions/android-ndk.in" - config THREADS default "posix" diff --git a/config/libc/glibc.in b/config/libc/glibc.in index c600326..fcd449d 100644 --- a/config/libc/glibc.in +++ b/config/libc/glibc.in @@ -16,7 +16,7 @@ # the kernel/libc versions of a particular target system, and LTS releases # are still using quite ancient versions. Please do not retire versions # (including versions in between) until the EOL dates indicated in version.desc. -source "config/versions/glibc.in" + if GLIBC_USE_PORTS_EXTERNAL source "config/versions/glibc-ports.in" endif diff --git a/config/libc/mingw-w64.in b/config/libc/mingw-w64.in index 34f8dbc..02b18a2 100644 --- a/config/libc/mingw-w64.in +++ b/config/libc/mingw-w64.in @@ -8,8 +8,6 @@ ## ## help The de-facto standard for Mingw distributions. -source "config/versions/mingw-w64.in" - config MINGW_W64_REQUIRES_W64_VENDOR bool default y if MINGW_W64_V4_or_later diff --git a/config/libc/musl.in b/config/libc/musl.in index e16e85a..b2ed8bf 100644 --- a/config/libc/musl.in +++ b/config/libc/musl.in @@ -9,8 +9,6 @@ ## help devices. musl is lightweight, fast, simple, free, and strives to be ## help correct in the sense of standards-conformance and safety. -source "config/versions/musl.in" - # TBD why? it claims "native", why report "musl"? config THREADS default "musl" diff --git a/config/libc/newlib.in b/config/libc/newlib.in index f43a67d..268f956 100644 --- a/config/libc/newlib.in +++ b/config/libc/newlib.in @@ -12,8 +12,6 @@ ## help array of processors, and will usually work on any architecture with ## help the addition of a few low-level routines. -source "config/versions/newlib.in" - # maybe older versions of newlib will support it too, but this # needs to be checked config NEWLIB_CXA_ATEXIT diff --git a/config/libc/none.in b/config/libc/none.in index b8860b0..713f33c 100644 --- a/config/libc/none.in +++ b/config/libc/none.in @@ -1,5 +1,6 @@ # Dummy config file to not use a C library *at all* +## no-package ## depends on BARE_METAL ## ## help Do not use a C library. diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in index e12c3fd..174dfdc 100644 --- a/config/libc/uClibc.in +++ b/config/libc/uClibc.in @@ -12,8 +12,6 @@ ## help Highly configurable, thus as feature-rich as you ## help need, without compromising for size. -source "config/versions/uClibc.in" - config THREADS default "nptl" if THREADS_NATIVE default "linuxthreads" if THREADS_LT diff --git a/maintainer/kconfig-choice.template b/maintainer/kconfig-choice.template index ec66f74..affaf65 100644 --- a/maintainer/kconfig-choice.template +++ b/maintainer/kconfig-choice.template @@ -25,7 +25,7 @@ config @@dir|@@ default "@@choice@@" if @@dir|@@_@@choice|@@ #!end-foreach -config @@dir|@@_KSYM +config @@dir|@@_CHOICE_KSYM string #!foreach choice default "@@choice|@@" if @@dir|@@_@@choice|@@ @@ -33,6 +33,14 @@ config @@dir|@@_KSYM #!foreach choice if @@dir|@@_@@choice|@@ +config @@dir|@@_@@choice|@@_PKG_KSYM + string + default "@@pkg|@@" + +#!if [ -n "@@pkg@@" ] +source "config/versions/@@pkg@@.in" +#!end-if source "config/@@dir@@/@@choice@@.in" endif + #!end-foreach diff --git a/maintainer/kconfig-menu.template b/maintainer/kconfig-menu.template index 1a7daa5..3e32e16 100644 --- a/maintainer/kconfig-menu.template +++ b/maintainer/kconfig-menu.template @@ -14,6 +14,13 @@ menuconfig @@dir|@@_@@choice|@@ #!end-foreach if @@dir|@@_@@choice|@@ +config @@dir|@@_@@choice|@@_PKG_KSYM + string + default "@@pkg|@@" + +#!if [ -n "@@pkg@@" ] +source "config/versions/@@pkg@@.in" +#!end-if source "config/@@dir@@/@@choice@@.in" endif diff --git a/scripts/functions b/scripts/functions index 5910619..d46ac36 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}" } diff --git a/scripts/show-config.sh b/scripts/show-config.sh index ea50102..9e56f07 100644 --- a/scripts/show-config.sh +++ b/scripts/show-config.sh @@ -10,22 +10,49 @@ # GREP_OPTIONS screws things up. export GREP_OPTIONS= +fieldwidth=15 + # Dummy version which is invoked from .config CT_Mirrors() { :; } # Dump a short package description with a name and version in a format # " [-]" -dump_pkg_desc() { - local name=$1 +dump_pkgs_desc() +{ + local category="${1}" + local field="${2}" + shift 2 + local show_version + local tmp + + printf " %-*s :" ${fieldwidth} "${field}" + while [ -n "${1}" ]; do + eval "tmp=\"\${CT_${category}_${1}}\"" + if [ -n "${tmp}" ]; then + CT_GetPkgBuildVersion "${category}" "${1}" show_version + printf " %s" "${show_version}" + fi + shift + done + printf "\n" +} + +# Dump a short package description with a name and version in a format +# " [-]" +dump_choice_desc() +{ + local category="${1}" + local field="${2}" local show_version - CT_GetPkgBuildVersion ${1} show_version - printf " %s" "${show_version}" + CT_GetChoicePkgBuildVersion "${category}" show_version + printf " %-*s : %s\n" ${fieldwidth} "${field}" "${show_version}" } # Dump a single sample # Note: we use the specific .config.sample config file -dump_single_sample() { +dump_single_sample() +{ local verbose=0 local complibs [ "$1" = "-v" ] && verbose=1 && shift @@ -51,7 +78,6 @@ dump_single_sample() { fi ;; esac - width=14 printf "[%s" "${sample_type}" [ -f "${sample_top}/samples/${sample}/broken" ] && printf "B" || printf "." [ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" || printf "." @@ -60,25 +86,17 @@ dump_single_sample() { case "${CT_TOOLCHAIN_TYPE}" in cross) ;; canadian) - printf " %-*s : %s\n" ${width} "Host" "${CT_HOST}" + printf " %-*s : %s\n" ${fieldwidth} "Host" "${CT_HOST}" ;; esac - if [ "${CT_KERNEL}" != "bare-metal" ]; then - printf " %-*s :" ${width} "OS" && dump_pkg_desc KERNEL && printf "\n" - fi - printf " %-*s :" ${width} "Companion libs" - [ -z "${CT_GMP}" ] || dump_pkg_desc GMP - [ -z "${CT_MPFR}" ] || dump_pkg_desc MPFR - [ -z "${CT_ISL}" ] || dump_pkg_desc ISL - [ -z "${CT_CLOOG}" ] || dump_pkg_desc CLOOG - [ -z "${CT_MPC}" ] || 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 - 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" + # FIXME get choice/menu names from generated kconfig files as well + # FIXME get the list of menu components from generated kconfig files + dump_choice_desc KERNEL "OS" + dump_pkgs_desc COMP_LIBS "Companion libs" GMP MPFR MPC ISL CLOOG LIBELF EXPAT NCURSES \ + LIBICONV GETTEXT + dump_choice_desc BINUTILS "Binutils" + dump_choice_desc CC "Compiler" + printf " %-*s : %s" ${fieldwidth} "Languages" "C" [ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++" [ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ",Fortran" [ "${CT_CC_LANG_JAVA}" = "y" ] && printf ",Java" @@ -88,13 +106,10 @@ dump_single_sample() { [ "${CT_CC_LANG_GOLANG}" = "y" ] && printf ",Go" [ -n "${CT_CC_LANG_OTHERS}" ] && printf ",${CT_CC_LANG_OTHERS}" printf "\n" - printf " %-*s :" ${width} "C library" && dump_pkg_desc LIBC && printf " (threads: %s)\n" "${CT_THREADS}" - printf " %-*s :" ${width} "Tools" - [ "${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 - printf "\n" + + dump_choice_desc LIBC "C library" + dump_pkgs_desc DEBUG "Debug tools" DUMA GDB LTRACE STRACE + dump_pkgs_desc COMP_TOOLS "Companion tools" AUTOCONF AUTOMAKE LIBTOOL M4 MAKE fi } -- cgit v0.10.2-6-g49f6