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>
This commit is contained in:
Alexey Neyman 2017-11-29 00:14:04 -08:00
parent d759137c46
commit 9fdb93cce0
54 changed files with 274 additions and 310 deletions

View File

@ -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

View File

@ -1,5 +1,6 @@
# Alpha specific configuration file
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_DEFAULT_32
## select ARCH_USE_MMU

View File

@ -1,5 +1,6 @@
# ARM specific configuration file
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_SUPPORTS_64
## select ARCH_DEFAULT_32

View File

@ -1,5 +1,6 @@
# AVR specific config options
## no-package
## select ARCH_SUPPORTS_8
## select ARCH_DEFAULT_8
## select ARCH_REQUIRES_MULTILIB

View File

@ -1,5 +1,6 @@
# m68k specific configuration file
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_DEFAULT_32
## select ARCH_DEFAULT_BE

View File

@ -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.

View File

@ -1,5 +1,6 @@
# MIPS specific config options
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_SUPPORTS_64
## select ARCH_DEFAULT_32

View File

@ -1,5 +1,6 @@
# MSP430 specific config options
## no-package
## select ARCH_SUPPORTS_16
## select ARCH_DEFAULT_16
## select ARCH_REQUIRES_MULTILIB

View File

@ -1,5 +1,6 @@
# NIOS232 specific configuration file
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_DEFAULT_32
## select ARCH_SUPPORTS_BOTH_MMU

View File

@ -1,5 +1,6 @@
# Powerpc specific configuration file
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_SUPPORTS_64
## select ARCH_DEFAULT_32

View File

@ -1,5 +1,6 @@
# RISC-V specific config options
## no-package
## depends on EXPERIMENTAL
##
## select ARCH_SUPPORTS_32

View File

@ -1,5 +1,6 @@
# s390 specific config options
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_SUPPORTS_64
## select ARCH_DEFAULT_32

View File

@ -1,5 +1,6 @@
# Super-H specific configuration file
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_DEFAULT_32
## select ARCH_USE_MMU

View File

@ -1,5 +1,6 @@
# SPARC specific config options
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_SUPPORTS_64
## select ARCH_DEFAULT_32

View File

@ -1,5 +1,6 @@
# x86 specific options
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_SUPPORTS_64
## select ARCH_DEFAULT_32

View File

@ -1,5 +1,6 @@
# xtensa specific configuration file
## no-package
## select ARCH_SUPPORTS_32
## select ARCH_SUPPORTS_EITHER_ENDIAN
## select ARCH_DEFAULT_LE

View File

@ -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"

View File

@ -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.

View File

@ -4,185 +4,6 @@
menu "Companion libraries"
config COMPLIBS_NEEDED
bool
config LIBICONV_NEEDED
bool
select LIBICONV
select COMPLIBS_NEEDED
config GETTEXT_NEEDED
bool
select GETTEXT
select LIBICONV_NEEDED
select COMPLIBS_NEEDED
config GMP_NEEDED
def_bool y
select GMP
select COMPLIBS_NEEDED
config MPFR_NEEDED
def_bool y
select MPFR
select COMPLIBS_NEEDED
config ISL_NEEDED
bool
select ISL
select COMPLIBS_NEEDED
config CLOOG_NEEDED
bool
select CLOOG
select COMPLIBS_NEEDED
config MPC_NEEDED
def_bool y
select MPC
select COMPLIBS_NEEDED
config LIBELF_NEEDED
bool
select LIBELF
select COMPLIBS_NEEDED
config EXPAT_NEEDED
bool
select EXPAT
select COMPLIBS_NEEDED
config NCURSES_NEEDED
bool
select NCURSES
select COMPLIBS_NEEDED
config COMPLIBS
bool
config LIBICONV
bool "Build local libiconv"
default y if CANADIAN || CROSS_NATIVE
select COMPLIBS
config GETTEXT
bool "Build local gettext"
default y if CANADIAN || CROSS_NATIVE
select LIBICONV_NEEDED
select NCURSES_NEEDED
select COMPLIBS
config GMP
bool
select COMPLIBS
config MPFR
bool
select GMP
select COMPLIBS
config ISL
bool
select GMP
select COMPLIBS
config CLOOG
bool
select GMP
select COMPLIBS
config MPC
bool
select GMP
select MPFR
select COMPLIBS
config LIBELF
bool
select COMPLIBS
config LIBELF_TARGET
bool
config EXPAT
bool
select COMPLIBS
config EXPAT_TARGET
bool
config NCURSES
bool
select COMPLIBS
config NCURSES_TARGET
bool
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!!!)"
@ -198,6 +19,131 @@ config COMPLIBS_CHECK
cause for incorrectly generated code, you should answer 'Y' here.
Note however that this will take a really long time.
endif # COMPLIBS
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 "Build local libiconv"
default y if CANADIAN || CROSS_NATIVE
select COMP_LIBS_LIBICONV
config GETTEXT_NEEDED
bool "Build local gettext"
default y if CANADIAN || CROSS_NATIVE
select LIBICONV_NEEDED
select NCURSES_NEEDED
select COMP_LIBS_GETTEXT
config GMP_NEEDED
def_bool y
select COMP_LIBS_GMP
config MPFR_NEEDED
def_bool y
select GMP_NEEDED
select COMP_LIBS_MPFR
config ISL_NEEDED
bool
select GMP_NEEDED
select COMP_LIBS_ISL
config CLOOG_NEEDED
bool
select GMP_NEEDED
select COMP_LIBS_CLOOG
config MPC_NEEDED
def_bool y
select GMP_NEEDED
select MPFR_NEEDED
select COMP_LIBS_MPC
config LIBELF_NEEDED
bool
select COMP_LIBS_LIBELF
config LIBELF_TARGET
bool
select COMP_LIBS_LIBELF
config EXPAT_NEEDED
bool
select COMP_LIBS_EXPAT
config EXPAT_TARGET
bool
select COMP_LIBS_EXPAT
config NCURSES_NEEDED
bool
select COMP_LIBS_NCURSES
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
def_bool y
depends on LIBICONV_NEEDED
config GETTEXT
def_bool y
depends on GETTEXT_NEEDED
config GMP
def_bool y
depends on GMP_NEEDED
config MPFR
def_bool y
depends on MPFR_NEEDED
config ISL
def_bool y
depends on ISL_NEEDED
config CLOOG
def_bool y
depends on CLOOG_NEEDED
config MPC
def_bool y
depends on MPC_NEEDED
config LIBELF
def_bool y
depends on LIBELF_NEEDED
config EXPAT
def_bool y
depends on EXPAT_NEEDED
config NCURSES
def_bool y
depends on NCURSES_NEEDED
config ZLIB
def_bool y
depends on ZLIB_NEEDED
endmenu

View File

@ -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

View File

@ -1,3 +1 @@
# expat config file
source "config/versions/expat.in"

View File

@ -1,3 +1 @@
# gettext options
source "config/versions/gettext.in"

View File

@ -1,7 +1,5 @@
# GMP options
source "config/versions/gmp.in"
config GMP_HAS_MPBSD
bool
default y if !GMP_5_1_or_later

View File

@ -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

View File

@ -1,3 +1 @@
# libelf config file
source "config/versions/libelf.in"

View File

@ -1,3 +1 @@
# libiconv options
source "config/versions/libiconv.in"

View File

@ -1,3 +1 @@
# MPC options
source "config/versions/mpc.in"

View File

@ -1,3 +1 @@
# GMP options
source "config/versions/mpfr.in"

View File

@ -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"

View File

@ -1,3 +1 @@
# Zlib options
source "config/versions/zlib.in"

View File

@ -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"

View File

@ -2,5 +2,3 @@
## default y if !CONFIGURE_has_automake_1_15_or_newer
## help Automake
source "config/versions/automake.in"

View File

@ -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"

View File

@ -1,5 +1,3 @@
# GNU m4
## default y if !CONFIGURE_has_gnu_m4_1_4_12_or_newer
source "config/versions/m4.in"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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.

View File

@ -1,5 +1,3 @@
# strace
## depends on ! LIBC_BIONIC
source "config/versions/strace.in"

View File

@ -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.

View File

@ -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:"

View File

@ -1,5 +1,6 @@
# windows config options
## no-package
## depends on ARCH_X86
## depends on EXPERIMENTAL
##

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -2225,14 +2225,23 @@ CT_GetPkgVersion()
# (e.g. LIBC).
CT_GetPkgBuildVersion()
{
local pkg="${1}"
local tmp
local build_version
local category="${1}"
local component="${2}"
local var="${3}"
local choicename tmp pkg 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}"
# 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}"
}

View File

@ -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
# " <name>[-<version>]"
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
# " <name>[-<version>]"
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
}