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