From 42d9e7de0eb8c898cb0e4f13d6cef81319667c33 Mon Sep 17 00:00:00 2001 From: ddeclerck Date: Fri, 6 Sep 2024 08:53:40 +0000 Subject: [PATCH 1/5] missing changelog entry for [r4915] --- bin/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/ChangeLog b/bin/ChangeLog index acf8a135a..69bc366d7 100644 --- a/bin/ChangeLog +++ b/bin/ChangeLog @@ -9,6 +9,10 @@ * cob-config.in: echo in same order as arguments; add missing arguments (--bindir,--libdir,--datadir,--mandir,--includedir) +2023-01-02 Simon Sobisch + + * cobcrun.c: use libcob's cob_getenv_direct instead of getenv + 2022-10-18 Simon Sobisch * cobcrun.c: minor validation - check for empty parameters From 9744112d55609a6f9ac5992c49a4716db3200a29 Mon Sep 17 00:00:00 2001 From: sf-mensch Date: Sat, 7 Sep 2024 11:30:35 +0000 Subject: [PATCH 2/5] build system update build_aux: * ar-lib, config.guess, config.rpath, config.sub, texinfo.tex: updated to recent versions from https://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/ configure: re-ordered gettext/conv checks --- build_aux/ChangeLog | 12 +- build_aux/ar-lib | 14 +- build_aux/config.guess | 71 +++- build_aux/config.rpath | 89 +++- build_aux/config.sub | 935 ++++++++++++++++++++++++++++++----------- build_aux/texinfo.tex | 542 ++++++++++++++---------- configure.ac | 73 ++-- 7 files changed, 1203 insertions(+), 533 deletions(-) diff --git a/build_aux/ChangeLog b/build_aux/ChangeLog index 667d414b0..1e84a10ea 100644 --- a/build_aux/ChangeLog +++ b/build_aux/ChangeLog @@ -1,4 +1,10 @@ +2024-09-02 Simon Sobisch + + * ar-lib, config.guess, config.rpath, config.sub, texinfo.tex: updated + to recent versions from + https://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/ + 2023-06-03 Simon Sobisch * config.sub, texinfo.tex: updated to recent versions from @@ -22,13 +28,13 @@ * bootstrap: drop tarstamp.h generation, done via make * config.guess, config.sub: updated to recent versions from - git.savannah.gnu.org/gitweb/?p=config.git + https://git.savannah.gnu.org/cgit/config.git 2022-06-30 Simon Sobisch * config.guess, config.rpath, install-sh, mkinstalldirs, texinfo.tex: updated to recent versions from - git.savannah.gnu.org/gitweb/?p=config.git + https://git.savannah.gnu.org/cgit/config.git 2022-05-30 Simon Sobisch @@ -43,7 +49,7 @@ 2022-01-07 Simon Sobisch * config.sub, config.guess: updated to recent versions from - git.savannah.gnu.org/gitweb/?p=config.git to solve build issues + https://git.savannah.gnu.org/cgit/config.git to solve build issues on different machines 2021-10-11 Simon Sobisch diff --git a/build_aux/ar-lib b/build_aux/ar-lib index be8806a2f..7fbce26f0 100755 --- a/build_aux/ar-lib +++ b/build_aux/ar-lib @@ -2,9 +2,9 @@ # Wrapper for Microsoft lib.exe me=ar-lib -scriptversion=2019-07-04.01; # UTC +scriptversion=2024-06-19.01; # UTC -# Copyright (C) 2010-2019 Free Software Foundation, Inc. +# Copyright (C) 2010-2019,2024 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify @@ -105,11 +105,15 @@ case $1 in Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...] Members may be specified in a file named with @FILE. + +Report bugs to . +GNU Automake home page: . +General help using GNU software: . EOF exit $? ;; -v | --v*) - echo "$me, version $scriptversion" + echo "$me (GNU Automake) $scriptversion" exit $? ;; esac @@ -135,6 +139,10 @@ do AR="$AR $1" shift ;; + -nologo | -NOLOGO) + # We always invoke AR with -nologo, so don't need to add it again. + shift + ;; *) action=$1 shift diff --git a/build_aux/config.guess b/build_aux/config.guess index 980b02083..48a684601 100755 --- a/build_aux/config.guess +++ b/build_aux/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2022 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2022-09-17' +timestamp='2024-07-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of the system \`$me' is run on. +Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit @@ -60,13 +60,13 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2022 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -102,8 +102,8 @@ GUESS= # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. @@ -123,7 +123,7 @@ set_cc_for_build() { dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do + for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break @@ -155,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc @@ -162,6 +165,8 @@ Linux|GNU|GNU/*) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm #else #include /* First heuristic to detect musl libc. */ @@ -169,6 +174,7 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" @@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like `4.1.3-JL'. + # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; @@ -628,7 +634,8 @@ EOF sed 's/^ //' << EOF > "$dummy.c" #include - main() + int + main () { if (!__power_pc()) exit(1); @@ -712,7 +719,8 @@ EOF #include #include - int main () + int + main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -904,7 +912,7 @@ EOF fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; @@ -976,7 +984,27 @@ EOF GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be @@ -1042,6 +1070,15 @@ EOF k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; @@ -1197,7 +1234,7 @@ EOF GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility + # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; @@ -1338,7 +1375,7 @@ EOF GUESS=ns32k-sni-sysv fi ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; @@ -1560,6 +1597,9 @@ EOF *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; esac # Do we have a guess based on uname results? @@ -1583,6 +1623,7 @@ cat > "$dummy.c" <, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# -# The first argument passed to this file is the canonical host specification, -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld -# should be set by the caller. -# -# The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer @@ -25,6 +17,81 @@ # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. +# func_usage +# outputs to stdout the --help usage message. +func_usage () +{ + echo "\ +Usage: config.rpath [OPTION] HOST + +Prints shell variable assignments that describe how to hardcode a directory +for the lookup of shared libraries into a binary (executable or shared library). + +The first argument passed to this file is the canonical host specification, + CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +or + CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + +The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +should be set by the caller. + +The set of defined variables is at the end of this script. + +Options: + --help print this help and exit + --version print version information and exit + +Send patches and bug reports to ." +} + +# func_version +# outputs to stdout the --version message. +func_version () +{ + echo "config.rpath (GNU gnulib, module havelib)" + echo "Copyright (C) 2024 Free Software Foundation, Inc. +License: All-Permissive. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law." + echo + printf 'Written by %s.\n' "Bruno Haible" +} + +# func_fatal_error message +# outputs to stderr a fatal error message, and terminates the program. +func_fatal_error () +{ + echo "config.rpath: *** $1" 1>&2 + echo "config.rpath: *** Stop." 1>&2 + exit 1 +} + +# Command-line option processing. +while test $# -gt 0; do + case "$1" in + --help | --hel | --he | --h ) + func_usage + exit 0 ;; + --version | --versio | --versi | --vers | --ver | --ve | --v ) + func_version + exit 0 ;; + -- ) # Stop option processing + shift; break ;; + -* ) + func_fatal_error "unrecognized option: $1" + ;; + * ) + break ;; + esac +done + +if test $# -gt 1; then + func_fatal_error "too many arguments" +fi +if test $# -lt 1; then + func_fatal_error "too few arguments" +fi + # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a diff --git a/build_aux/config.sub b/build_aux/config.sub index de4259e40..4aaae46f6 100755 --- a/build_aux/config.sub +++ b/build_aux/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2023 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. -# shellcheck disable=SC2006,SC2268 # see below for rationale +# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale -timestamp='2023-01-21' +timestamp='2024-05-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -76,13 +76,13 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -120,7 +120,6 @@ case $# in esac # Split fields of configuration type -# shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 + echo "Invalid configuration '$1': more than four components" >&2 exit 1 ;; *-*-*-*) @@ -142,10 +141,21 @@ case $1 in # parts maybe_os=$field2-$field3 case $maybe_os in - nto-qnx* | linux-* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) + cloudabi*-eabi* \ + | kfreebsd*-gnu* \ + | knetbsd*-gnu* \ + | kopensolaris*-gnu* \ + | linux-* \ + | managarm-* \ + | netbsd*-eabi* \ + | netbsd*-gnu* \ + | nto-qnx* \ + | os2-emx* \ + | rtmk-nova* \ + | storm-chaos* \ + | uclinux-gnu* \ + | uclinux-uclibc* \ + | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; @@ -160,8 +170,12 @@ case $1 in esac ;; *-*) - # A lone config we happen to match not fitting any pattern case $field1-$field2 in + # Shorthands that happen to contain a single dash + convex-c[12] | convex-c3[248]) + basic_machine=$field2-convex + basic_os= + ;; decstation-3100) basic_machine=mips-dec basic_os= @@ -169,28 +183,88 @@ case $1 in *-*) # Second component is usually, but not always the OS case $field2 in - # Prevent following clause from handling this valid os + # Do not treat sunos as a manufacturer sun*os*) basic_machine=$field1 basic_os=$field2 ;; - zephyr*) - basic_machine=$field1-unknown - basic_os=$field2 - ;; # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* \ - | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ - | ultra | tti* | harris | dolphin | highlevel | gould \ - | cbm | ns | masscomp | apple | axis | knuth | cray \ - | microblaze* | sim | cisco \ - | oki | wec | wrs | winbond) + 3100* \ + | 32* \ + | 3300* \ + | 3600* \ + | 7300* \ + | acorn \ + | altos* \ + | apollo \ + | apple \ + | atari \ + | att* \ + | axis \ + | be \ + | bull \ + | cbm \ + | ccur \ + | cisco \ + | commodore \ + | convergent* \ + | convex* \ + | cray \ + | crds \ + | dec* \ + | delta* \ + | dg \ + | digital \ + | dolphin \ + | encore* \ + | gould \ + | harris \ + | highlevel \ + | hitachi* \ + | hp \ + | ibm* \ + | intergraph \ + | isi* \ + | knuth \ + | masscomp \ + | microblaze* \ + | mips* \ + | motorola* \ + | ncr* \ + | news \ + | next \ + | ns \ + | oki \ + | omron* \ + | pc533* \ + | rebel \ + | rom68k \ + | rombug \ + | semi \ + | sequent* \ + | siemens \ + | sgi* \ + | siemens \ + | sim \ + | sni \ + | sony* \ + | stratus \ + | sun \ + | sun[234]* \ + | tektronix \ + | tti* \ + | ultra \ + | unicom* \ + | wec \ + | winbond \ + | wrs) basic_machine=$field1-$field2 basic_os= ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; *) basic_machine=$field1 basic_os=$field2 @@ -271,26 +345,6 @@ case $1 in basic_machine=arm-unknown basic_os=cegcc ;; - convex-c1) - basic_machine=c1-convex - basic_os=bsd - ;; - convex-c2) - basic_machine=c2-convex - basic_os=bsd - ;; - convex-c32) - basic_machine=c32-convex - basic_os=bsd - ;; - convex-c34) - basic_machine=c34-convex - basic_os=bsd - ;; - convex-c38) - basic_machine=c38-convex - basic_os=bsd - ;; cray) basic_machine=j90-cray basic_os=unicos @@ -713,15 +767,26 @@ case $basic_machine in vendor=dec basic_os=tops20 ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) + delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) cpu=m68k vendor=motorola ;; - dpx2*) + # This used to be dpx2*, but that gets the RS6000-based + # DPX/20 and the x86-based DPX/2-100 wrong. See + # https://oldskool.silicium.org/stations/bull_dpx20.htm + # https://www.feb-patrimoine.com/english/bull_dpx2.htm + # https://www.feb-patrimoine.com/english/unix_and_bull.htm + dpx2 | dpx2[23]00 | dpx2[23]xx) cpu=m68k vendor=bull - basic_os=sysv3 + ;; + dpx2100 | dpx21xx) + cpu=i386 + vendor=bull + ;; + dpx20) + cpu=rs6000 + vendor=bull ;; encore | umax | mmax) cpu=ns32k @@ -836,18 +901,6 @@ case $basic_machine in next | m*-next) cpu=m68k vendor=next - case $basic_os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - basic_os=nextstep2 - ;; - *) - basic_os=nextstep3 - ;; - esac ;; np1) cpu=np1 @@ -936,14 +989,13 @@ case $basic_machine in ;; *-*) - # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 exit 1 ;; esac @@ -1306,11 +1491,12 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux @@ -1325,7 +1511,6 @@ case $basic_os in os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) - # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 + fi + ;; *) - echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) + ;; + uclinux-uclibc*- | uclinux-gnu*- ) ;; - uclinux-uclibc* ) + managarm-mlibc*- | managarm-kernel*- ) ;; - managarm-mlibc* | managarm-kernel* ) + windows*-msvc*-) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - -kernel* ) - echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2 + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; - *-kernel* ) - echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2 + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; - nto-qnx*) + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; - os2-emx) + nto-qnx*-) ;; - *-eabi* | *-gnueabi*) + os2-emx-) ;; - -*) + rtmk-nova-) + ;; + *-eabi*- | *-gnueabi*-) + ;; + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) # Blank kernel with real OS is always fine. ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac @@ -1826,7 +2273,7 @@ case $vendor in *-riscix*) vendor=acorn ;; - *-sunos*) + *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) @@ -1896,7 +2343,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/build_aux/texinfo.tex b/build_aux/texinfo.tex index a32c84197..93d592193 100644 --- a/build_aux/texinfo.tex +++ b/build_aux/texinfo.tex @@ -3,9 +3,9 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2023-03-27.21} +\def\texinfoversion{2024-02-10.22} % -% Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc. +% Copyright 1985, 1986, 1988, 1990-2024 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -275,8 +275,7 @@ % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., -% @setcolor (or @url, or @link, etc.) between @contents and the very -% first @chapter. +% @setcolor (or @url etc.) between @contents and the very first @chapter. \def\gettopheadingmarks{% \ifcase0\the\savedtopmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi @@ -427,42 +426,21 @@ } % First remove any @comment, then any @c comment. Pass the result on to -% \argcheckspaces. +% \argremovespace. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} -\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} - -% Each occurrence of `\^^M' or `\^^M' is replaced by a single space. -% -% \argremovec might leave us with trailing space, e.g., +\def\argremovec#1\c#2\ArgTerm{\argremovespace#1$ $\ArgTerm} +% \argremovec might leave us with trailing space, though; e.g., % @end itemize @c foo -% This space token undergoes the same procedure and is eventually removed -% by \finishparsearg. -% -\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} -\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} -\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% - \def\temp{#3}% - \ifx\temp\empty - % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: - \let\temp\finishparsearg - \else - \let\temp\argcheckspaces - \fi - % Put the space token in: - \temp#1 #3\ArgTerm -} +% Note that the argument cannot contain the TeX $, as its catcode is +% changed to \other when Texinfo source is read. +\def\argremovespace#1 $#2\ArgTerm{\finishparsearg#1$\ArgTerm} % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. -% We prepended an \empty token at the very beginning and we expand it now, -% just before passing the control to \argtorun. -% (Similarly, we have to think about #3 of \argcheckspacesY above: it is -% either the null string, or it ends with \^^M---thus there is no danger -% that a pair of braces would be stripped. -% -% But first, we have to remove the trailing space token. -% -\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} +% We prepended an \empty token at the very beginning and we expand it +% just before passing the control to \next. +% (But first, we have to remove the remaining $ or two.) +\def\finishparsearg#1$#2\ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef - define a command taking an argument on the line @@ -4950,6 +4928,7 @@ \commondummyword\inforef {}% \commondummyword\kbd {}% \commondummyword\key {}% + \commondummyword\link {}% \commondummyword\math {}% \commondummyword\option {}% \commondummyword\pxref {}% @@ -5259,14 +5238,14 @@ % the current value of \escapechar. \def\escapeisbackslash{\escapechar=`\\} -% Use \ in index files by default. texi2dvi didn't support @ as the escape -% character (as it checked for "\entry" in the files, and not "@entry"). When -% the new version of texi2dvi has had a chance to become more prevalent, then -% the escape character can change back to @ again. This should be an easy -% change to make now because both @ and \ are only used as escape characters in -% index files, never standing for themselves. +% Uncomment to use \ in index files by default. Old texi2dvi (before 2019) +% didn't support @ as the escape character (as it checked for "\entry" in +% the files, and not "@entry"). +% In the future we can remove this flag and simplify the code for +% index files and backslashes, once the support is no longer likely to be +% useful. % -\set txiindexescapeisbackslash +% \set txiindexescapeisbackslash % Write the entry in \indextext to the index file. % @@ -5575,6 +5554,11 @@ \newdimen\entryrightmargin \entryrightmargin=0pt +% amount to indent subsequent lines in an entry when it spans more than +% one line. +\newdimen\entrycontskip +\entrycontskip=1em + % for PDF output, whether to make the text of the entry a link to the page % number. set for @contents and @shortcontents where there is only one % page number. @@ -5668,41 +5652,17 @@ \parfillskip=0pt plus -1fill % \advance\rightskip by \entryrightmargin - % Determine how far we can stretch into the margin. - % This allows, e.g., "Appendix H GNU Free Documentation License" to - % fit on one line in @letterpaper format. - \ifdim\entryrightmargin>2.1em - \dimen@i=2.1em - \else - \dimen@i=0em - \fi - \advance \parfillskip by 0pt minus 1\dimen@i % \dimen@ii = \hsize \advance\dimen@ii by -1\leftskip \advance\dimen@ii by -1\entryrightmargin - \advance\dimen@ii by 1\dimen@i \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line \ifdim\dimen@ > 0.8\dimen@ii % due to long index text - % Try to split the text roughly evenly. \dimen@ will be the length of - % the first line. - \dimen@ = 0.7\dimen@ - \dimen@ii = \hsize - \ifnum\dimen@>\dimen@ii - % If the entry is too long (for example, if it needs more than - % two lines), use all the space in the first line. - \dimen@ = \dimen@ii - \fi \advance\leftskip by 0pt plus 1fill % ragged right - \advance \dimen@ by 1\rightskip - \parshape = 2 0pt \dimen@ 0em \dimen@ii - % Ideally we'd add a finite glue at the end of the first line only, - % instead of using \parshape with explicit line lengths, but TeX - % doesn't seem to provide a way to do such a thing. % % Indent all lines but the first one. - \advance\leftskip by 1em - \advance\parindent by -1em + \advance\leftskip by \entrycontskip + \advance\parindent by -\entrycontskip \fi\fi \indent % start paragraph \unhbox\boxA @@ -5725,12 +5685,11 @@ \newskip\thinshrinkable \skip\thinshrinkable=.15em minus .15em -% Like plain.tex's \dotfill, except uses up at least 1 em. +% Like plain.tex's \dotfill, except uses up at least 0.5 em. % The filll stretch here overpowers both the fil and fill stretch to push % the page number to the right. \def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} - + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 0.5em plus 1filll} \def\primary #1{\line{#1\hfil}} @@ -5783,7 +5742,7 @@ % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % - % We put the result in a separate register, \doublecolumhsize, so we + % We put the result in a separate register, \doublecolumnhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % @@ -6178,8 +6137,7 @@ % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% - \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 - \global\advance\unnumberedno by 1 + \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty @@ -6235,8 +6193,8 @@ % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% - \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 - \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% + \global\advance\unnumberedno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno}% } % Subsections. @@ -6259,9 +6217,8 @@ % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% - \global\subsubsecno=0 \global\advance\subsecno by 1 - \sectionheading{#1}{subsec}{Ynothing}% - {\the\unnumberedno.\the\secno.\the\subsecno}% + \global\advance\unnumberedno by 1 + \sectionheading{#1}{subsec}{Ynothing}{\the\unnumberedno}% } % Subsubsections. @@ -6285,9 +6242,8 @@ % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% - \global\advance\subsubsecno by 1 - \sectionheading{#1}{subsubsec}{Ynothing}% - {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% + \global\advance\unnumberedno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}{\the\unnumberedno}% } % These macros control what the section commands do, according @@ -6721,6 +6677,82 @@ \input \tocreadfilename } +% process toc file to find the maximum width of the section numbers for +% each chapter +\def\findsecnowidths{% + \begingroup + \setupdatafile + \activecatcodes + \secentryfonts + % Redefinitions + \def\numchapentry##1##2##3##4{% + \def\curchapname{secnowidth-##2}% + \curchapmax=0pt + }% + \let\appentry\numchapentry + % + \def\numsecentry##1##2##3##4{% + \def\cursecname{secnowidth-##2}% + \cursecmax=0pt + % + \setbox0=\hbox{##2}% + \ifdim\wd0>\curchapmax + \curchapmax=\wd0 + \expandafter\xdef\csname\curchapname\endcsname{\the\wd0}% + \fi + }% + \let\appsecentry\numsecentry + % + \def\numsubsecentry##1##2##3##4{% + \def\curssecname{secnowidth-##2}% + \curssecmax=0pt + % + \setbox0=\hbox{##2}% + \ifdim\wd0>\cursecmax + \cursecmax=\wd0 + \expandafter\xdef\csname\cursecname\endcsname{\the\wd0}% + \fi + }% + \let\appsubsecentry\numsubsecentry + % + \def\numsubsubsecentry##1##2##3##4{% + \setbox0=\hbox{##2}% + \ifdim\wd0>\curssecmax + \curssecmax=\wd0 + \expandafter\xdef\csname\curssecname\endcsname{\the\wd0}% + \fi + }% + \let\appsubsubsecentry\numsubsubsecentry + % + % Discard any output by outputting to dummy vbox, in case the toc file + % contains macros that we have not redefined above. + \setbox\dummybox\vbox\bgroup + \input \tocreadfilename\relax + \egroup + \endgroup +} +\newdimen\curchapmax +\newdimen\cursecmax +\newdimen\curssecmax + + +% set #1 to the maximum section width for #2 +\def\retrievesecnowidth#1#2{% + \expandafter\let\expandafter\savedsecnowidth \csname secnowidth-#2\endcsname + \ifx\savedsecnowidth\relax + #1=0pt + \else + #1=\savedsecnowidth + \fi +} +\newdimen\secnowidthchap +\secnowidthchap=0pt +\newdimen\secnowidthsec +\secnowidthsec=0pt +\newdimen\secnowidthssec +\secnowidthssec=0pt + + \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 @@ -6766,6 +6798,7 @@ \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else + \findsecnowidths \readtocfile \fi \vfill \eject @@ -6793,6 +6826,7 @@ \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. + \extrasecnoskip=0.4pt \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry @@ -6828,8 +6862,6 @@ % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and @@ -6839,10 +6871,15 @@ \hbox to 1em{#1\hss}% } -% These macros generate individual entries in the table of contents. -% The first argument is the chapter or section name. -% The last argument is the page number. -% The arguments in between are the chapter number, section number, ... +% These macros generate individual entries in the table of contents, +% and are read in from the *.toc file. +% +% The arguments are like: +% \def\numchapentry#1#2#3#4 +% #1 - the chapter or section name. +% #2 - section number +% #3 - level of section (e.g "chap", "sec") +% #4 - page number % Parts, in the main contents. Replace the part number, which doesn't % exist, with an empty box. Let's hope all the numbers have the same width. @@ -6855,7 +6892,7 @@ \vskip 0pt plus 5\baselineskip \penalty-300 \vskip 0pt plus -5\baselineskip - \dochapentry{\numeralbox\labelspace#1}{}% + \dochapentry{#1}{\numeralbox}{}% } % % Parts, in the short toc. @@ -6866,12 +6903,14 @@ } % Chapters, in the main contents. -\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +\def\numchapentry#1#2#3#4{% + \retrievesecnowidth\secnowidthchap{#2}% + \dochapentry{#1}{#2}{#4}% +} % Chapters, in the short toc. -% See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{#4}% + \tocentry{#1}{\shortchaplabel{#2}}{#4}% } % Appendices, in the main contents. @@ -6882,67 +6921,111 @@ \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % -\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} +\def\appentry#1#2#3#4{% + \retrievesecnowidth\secnowidthchap{#2}% + \dochapentry{\appendixbox{#2}\hskip.7em#1}{}{#4}% +} % Unnumbered chapters. -\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} -\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{#4}} +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{}{#4}} % Sections. -\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\def\numsecentry#1#2#3#4{\dosecentry{#1}{#2}{#4}} + +\def\numsecentry#1#2#3#4{% + \retrievesecnowidth\secnowidthsec{#2}% + \dosecentry{#1}{#2}{#4}% +} \let\appsecentry=\numsecentry -\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} +\def\unnsecentry#1#2#3#4{% + \retrievesecnowidth\secnowidthsec{#2}% + \dosecentry{#1}{}{#4}% +} % Subsections. -\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\def\numsubsecentry#1#2#3#4{% + \retrievesecnowidth\secnowidthssec{#2}% + \dosubsecentry{#1}{#2}{#4}% +} \let\appsubsecentry=\numsubsecentry -\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} +\def\unnsubsecentry#1#2#3#4{% + \retrievesecnowidth\secnowidthssec{#2}% + \dosubsecentry{#1}{}{#4}% +} % And subsubsections. -\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#2}{#4}} \let\appsubsubsecentry=\numsubsubsecentry -\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt -% Now for the actual typesetting. In all these, #1 is the text and #2 is the -% page number. +% Now for the actual typesetting. In all these, #1 is the text, #2 is +% a section number if present, and #3 is the page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. -\def\dochapentry#1#2{% +\def\dochapentry#1#2#3{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup % Move the page numbers slightly to the right \advance\entryrightmargin by -0.05em \chapentryfonts - \tocentry{#1}{#2}% + \extrasecnoskip=0.4em % separate chapter number more + \tocentry{#1}{#2}{#3}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } -\def\dosecentry#1#2{\begingroup +\def\dosecentry#1#2#3{\begingroup + \secnowidth=\secnowidthchap \secentryfonts \leftskip=\tocindent - \tocentry{#1}{#2}% + \tocentry{#1}{#2}{#3}% \endgroup} -\def\dosubsecentry#1#2{\begingroup +\def\dosubsecentry#1#2#3{\begingroup + \secnowidth=\secnowidthsec \subsecentryfonts \leftskip=2\tocindent - \tocentry{#1}{#2}% + \tocentry{#1}{#2}{#3}% \endgroup} -\def\dosubsubsecentry#1#2{\begingroup +\def\dosubsubsecentry#1#2#3{\begingroup + \secnowidth=\secnowidthssec \subsubsecentryfonts \leftskip=3\tocindent - \tocentry{#1}{#2}% + \tocentry{#1}{#2}{#3}% \endgroup} -% We use the same \entry macro as for the index entries. -\let\tocentry = \entry +% Used for the maximum width of a section number so we can align +% section titles. +\newdimen\secnowidth +\secnowidth=0pt +\newdimen\extrasecnoskip +\extrasecnoskip=0pt -% Space between chapter (or whatever) number and the title. -\def\labelspace{\hskip1em \relax} +% \tocentry{TITLE}{SEC NO}{PAGE} +% +\def\tocentry#1#2#3{% + \def\secno{#2}% + \ifx\empty\secno + \entry{#1}{#3}% + \else + \ifdim 0pt=\secnowidth + \setbox0=\hbox{#2\hskip\labelspace\hskip\extrasecnoskip}% + \else + \advance\secnowidth by \labelspace + \advance\secnowidth by \extrasecnoskip + \setbox0=\hbox to \secnowidth{% + #2\hskip\labelspace\hskip\extrasecnoskip\hfill}% + \fi + \entrycontskip=\wd0 + \entry{\box0 #1}{#3}% + \fi +} +\newdimen\labelspace +\labelspace=0.6em \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} @@ -7593,9 +7676,13 @@ \def\deflineheader#1 #2 #3\endheader{% \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}% } + \def\deftypeline{% \doingtypefntrue - \parseargusing\activeparens{\printdefunline\deflineheader}% + \parseargusing\activeparens{\printdefunline\deftypelineheader}% +} +\def\deftypelineheader#1 #2 #3 #4\endheader{% + \printdefname{#1}{#2}{#3}\magicamp\defunargs{#4\unskip}% } % \makedefun{deffoo} (\deffooheader parameters) { (\deffooheader expansion) } @@ -7787,6 +7874,8 @@ \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% + \def\^^M{}% for line continuation + % % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's @@ -7819,6 +7908,7 @@ % Print arguments. Use slanted for @def*, typewriter for @deftype*. \def\defunargs#1{% \bgroup + \def\^^M{}% for line continuation \df \ifdoingtypefn \tt \else \sl \fi \ifflagclear{txicodevaristt}{}% {\def\var##1{{\setregularquotes \ttsl ##1}}}% @@ -8112,8 +8202,6 @@ \let\commondummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup - \else - \errmessage{Macro #1 not defined}% \fi } @@ -8180,7 +8268,7 @@ % Read recursive and nonrecursive macro bodies. (They're different since % rec and nonrec macros end differently.) % -% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro +% We are in \macrobodyctxt, and the \xdef causes backslashes in the macro % body to be transformed. % Set \macrobody to the body of the macro, and call \macrodef. % @@ -8727,6 +8815,11 @@ \fi } +% @nodedescription, @nodedescriptionblock - do nothing for TeX +\parseargdef\nodedescription{} +\def\nodedescriptionblock{\doignore{nodedescriptionblock}} + + % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister @@ -8808,109 +8901,11 @@ \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces % - % Get args without leading/trailing spaces. - \def\printedrefname{\ignorespaces #3}% - \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% - % + \getprintedrefname{#1}{#3}{#5}% \def\infofilename{\ignorespaces #4}% \setbox\infofilenamebox = \hbox{\infofilename\unskip}% % - \def\printedmanual{\ignorespaces #5}% - \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% - % - % If the printed reference name (arg #3) was not explicitly given in - % the @xref, figure out what we want to use. - \ifdim \wd\printedrefnamebox = 0pt - % No printed node name was explicitly given. - \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax - % Not auto section-title: use node name inside the square brackets. - \def\printedrefname{\ignorespaces #1}% - \else - % Auto section-title: use chapter/section title inside - % the square brackets if we have it. - \ifdim \wd\printedmanualbox > 0pt - % It is in another manual, so we don't have it; use node name. - \def\printedrefname{\ignorespaces #1}% - \else - \ifhavexrefs - % We (should) know the real title if we have the xref values. - \def\printedrefname{\refx{#1-title}}% - \else - % Otherwise just copy the Info node name. - \def\printedrefname{\ignorespaces #1}% - \fi% - \fi - \fi - \fi - % - % Make link in pdf output. - \ifpdf - % For pdfTeX and LuaTeX - {\indexnofonts - \makevalueexpandable - \turnoffactive - % This expands tokens, so do it after making catcode changes, so _ - % etc. don't get their TeX definitions. This ignores all spaces in - % #4, including (wrongly) those in the middle of the filename. - \getfilename{#4}% - % - % This (wrongly) does not take account of leading or trailing - % spaces in #1, which should be ignored. - \setpdfdestname{#1}% - % - \ifx\pdfdestname\empty - \def\pdfdestname{Top}% no empty targets - \fi - % - \leavevmode - \startlink attr{/Border [0 0 0]}% - \ifnum\filenamelength>0 - goto file{\the\filename.pdf} name{\pdfdestname}% - \else - goto name{\pdfmkpgn{\pdfdestname}}% - \fi - }% - \setcolor{\linkcolor}% - \else - \ifx\XeTeXrevision\thisisundefined - \else - % For XeTeX - {\indexnofonts - \makevalueexpandable - \turnoffactive - % This expands tokens, so do it after making catcode changes, so _ - % etc. don't get their TeX definitions. This ignores all spaces in - % #4, including (wrongly) those in the middle of the filename. - \getfilename{#4}% - % - % This (wrongly) does not take account of leading or trailing - % spaces in #1, which should be ignored. - \setpdfdestname{#1}% - % - \ifx\pdfdestname\empty - \def\pdfdestname{Top}% no empty targets - \fi - % - \leavevmode - \ifnum\filenamelength>0 - % With default settings, - % XeTeX (xdvipdfmx) replaces link destination names with integers. - % In this case, the replaced destination names of - % remote PDFs are no longer known. In order to avoid a replacement, - % you can use xdvipdfmx's command line option `-C 0x0010'. - % If you use XeTeX 0.99996+ (TeX Live 2016+), - % this command line option is no longer necessary - % because we can use the `dvipdfmx:config' special. - \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A - << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% - \else - \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A - << /S /GoTo /D (\pdfdestname) >> >>}% - \fi - }% - \setcolor{\linkcolor}% - \fi - \fi + \startxreflink{#1}{#4}% {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. @@ -8991,6 +8986,93 @@ \endlink \endgroup} +% \getprintedrefname{NODE}{LABEL}{MANUAL} +% - set \printedrefname and \printedmanual +% +\def\getprintedrefname#1#2#3{% + % Get args without leading/trailing spaces. + \def\printedrefname{\ignorespaces #2}% + \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% + % + \def\printedmanual{\ignorespaces #3}% + \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% + % + % If the printed reference name (arg #2) was not explicitly given in + % the @xref, figure out what we want to use. + \ifdim \wd\printedrefnamebox = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax + % Not auto section-title: use node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Auto section-title: use chapter/section title inside + % the square brackets if we have it. + \ifdim \wd\printedmanualbox > 0pt + % It is in another manual, so we don't have it; use node name. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We (should) know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi +} + +% \startxreflink{NODE}{FILE} - start link in pdf output. +\def\startxreflink#1#2{% + \ifpdforxetex + % For pdfTeX and LuaTeX + {\indexnofonts + \makevalueexpandable + \turnoffactive + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #2, including (wrongly) those in the middle of the filename. + \getfilename{#2}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets + \fi + % + \leavevmode + \ifpdf + \startlink attr{/Border [0 0 0]}% + \ifnum\filenamelength>0 + goto file{\the\filename.pdf} name{\pdfdestname}% + \else + goto name{\pdfmkpgn{\pdfdestname}}% + \fi + \else % XeTeX + \ifnum\filenamelength>0 + % With default settings, + % XeTeX (xdvipdfmx) replaces link destination names with integers. + % In this case, the replaced destination names of + % remote PDFs are no longer known. In order to avoid a replacement, + % you can use xdvipdfmx's command line option `-C 0x0010'. + % If you use XeTeX 0.99996+ (TeX Live 2016+), + % this command line option is no longer necessary + % because we can use the `dvipdfmx:config' special. + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% + \else + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoTo /D (\pdfdestname) >> >>}% + \fi + \fi + }% + \setcolor{\linkcolor}% + \fi +} + % can be overridden in translation files \def\putpageref#1{% \space\putwordpage\tie\refx{#1-pg}} @@ -9028,6 +9110,21 @@ % \def\xrefprintnodename#1{[#1]} +% @link{NODENAME, LABEL, MANUAL} - create a "plain" link, with no +% page number. Not useful if printed on paper. +% +\def\link#1{\linkX[#1,,,]} +\def\linkX[#1,#2,#3,#4]{% + \begingroup + \unsepspaces + \getprintedrefname{#1}{#2}{#3}% + \startxreflink{#1}{#3}% + \printedrefname + \endlink + \endgroup +} + + % Things referred to by \setref. % \def\Ynothing{} @@ -11736,9 +11833,13 @@ \def\c{\loadconf\c}% % Definition for the first newline read in the file \def ^^M{\loadconf}% - % In case the first line has a whole-line command on it + % In case the first line has a whole-line or environment command on it \let\originalparsearg\parsearg% \def\parsearg{\loadconf\originalparsearg}% + % + % \startenvironment is in the expansion of commands defined with \envdef + \let\originalstartenvironment\startenvironment% + \def\startenvironment{\loadconf\startenvironment}% }} @@ -11766,6 +11867,7 @@ \enableemergencynewline \let\c=\comment \let\parsearg\originalparsearg + \let\startenvironment\originalstartenvironment % % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. diff --git a/configure.ac b/configure.ac index d8719b571..9d9f387fd 100644 --- a/configure.ac +++ b/configure.ac @@ -908,6 +908,42 @@ AC_CHECK_LIB([$with_math], [__gmp_get_memory_functions], LIBS="$curr_libs" CPPFLAGS="$curr_cppflags" +# Checks for gettext. + +case $host_os in + darwin* | rhapsody*) + ;; + *) + gt_cv_func_CFPreferencesCopyAppValue=no + gt_cv_func_CFLocaleCopyCurrent=no + ;; +esac + +dnl Simon: removed, use --disable-nls instead +dnl # Disable for Cygwin +dnl AC_MSG_CHECKING([for __CYGWIN__]) +dnl AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +dnl #ifndef __CYGWIN__ +dnl # error macro not defined +dnl #endif]])], +dnl [enable_nls=no +dnl AC_MSG_RESULT([yes])], +dnl [AC_MSG_RESULT([no])]) + +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION([0.19.8]) +if test "x$LTLIBINTL" != x; then + if test "x$PROGRAMS_LIBS" != x; then + PROGRAMS_LIBS="$PROGRAMS_LIBS $LTLIBINTL" + else + PROGRAMS_LIBS="$LTLIBINTL" + fi + LIBCOB_LIBS="$LIBCOB_LIBS $LTLIBINTL" +fi + +# Checks for internationalization stuff +AM_LANGINFO_CODESET + AC_ARG_WITH([iconv], [AS_HELP_STRING([--with-iconv], [(GnuCOBOL) Use iconv for character set conversion (default: check)])], @@ -1275,17 +1311,6 @@ AC_CHECK_FUNCS([fdatasync sigaction fmemopen]) AC_CHECK_DECLS([fdatasync]) # also check for declaration, missing on MacOS... AC_CHECK_DECLS([fmemopen]) # also check for declaration, missing on AIX... -# Checks for gettext. - -case $host_os in - darwin* | rhapsody*) - ;; - *) - gt_cv_func_CFPreferencesCopyAppValue=no - gt_cv_func_CFLocaleCopyCurrent=no - ;; -esac - # Checks for ncurses/pdcurses/curses. AC_MSG_NOTICE([Checks for curses ...]) AC_ARG_VAR([CURSES_LIBS], [linker flags for curses lookup, overriding automatic lookup, to be used with explicit selection via --with-curses=arg]) @@ -1975,32 +2000,6 @@ if test "$gc_cv_attribute_constructor" = yes; then fi CFLAGS="$curr_cflags" -dnl Simon: removed, use --disable-nls instead -dnl # Disable for Cygwin -dnl AC_MSG_CHECKING([for __CYGWIN__]) -dnl AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ -dnl #ifndef __CYGWIN__ -dnl # error macro not defined -dnl #endif]])], -dnl [enable_nls=no -dnl AC_MSG_RESULT([yes])], -dnl [AC_MSG_RESULT([no])]) - -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.19.8]) -if test "x$LTLIBINTL" != x; then - if test "x$PROGRAMS_LIBS" != x; then - PROGRAMS_LIBS="$PROGRAMS_LIBS $LTLIBINTL" - else - PROGRAMS_LIBS="$LTLIBINTL" - fi - LIBCOB_LIBS="$LIBCOB_LIBS $LTLIBINTL" -fi - -# Checks for internationalization stuff -dnl currently not directly used: AM_ICONV -AM_LANGINFO_CODESET - # Check for perl, used for "make test" #AM_MISSING_PROG(PERL, perl) --> only use for tools that generate something AC_CHECK_PROG(PERL, perl, perl) From 97668518028eda1174b2235cbe5c22d61fe9cf8a Mon Sep 17 00:00:00 2001 From: sf-mensch Date: Mon, 9 Sep 2024 12:37:21 +0000 Subject: [PATCH 3/5] work on "make checkmanual" README: add documentation for "make checkmanual" tests/run_prog_manual.sh.in: * adding testrunner tmux as alternative to screen * allow to override the deduced test runner by environment variable TESTRUNNER * new option to call with parameter "attach" and "kill" for either attaching to or killing test runner sessions in screen/tmux * enhance portability and use abs_builddir * (_test_with_screen): use separate SCREENDIR to ensure using system defaults and work around WSL regressions * (_test_with_cmd): work around cmd quoting by using a dynamically created sub command file --- ChangeLog | 4 + NEWS | 4 + README | 17 +++++ README.md | 22 +++++- tests/ChangeLog | 12 +++ tests/run_prog_manual.sh.in | 144 ++++++++++++++++++++++++++++-------- 6 files changed, 171 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f9c31240..878ba0b5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ +2024-09-09 Simon Sobisch + + * README: add documentation for "make checkmanual" + 2024-08-10 Simon Sobisch * DEPENDENCIES, NEWS: document usage of libiconv diff --git a/NEWS b/NEWS index 411ca2cc0..c8d40a37f 100644 --- a/NEWS +++ b/NEWS @@ -86,6 +86,10 @@ NEWS - user visible changes -*- outline -*- ** use the "default" -shared flag to build dynamic libraries on macOS so as to fix testuite issues with recent macOS versions +** "make checkmanual" was extended to be also usable with tmux and + allows to override the test runner and to attach for screen/tmux sessions, + see README for further details + * Known issues in 3.x ** testsuite: diff --git a/README b/README index 4b32ced96..6b5ce2ede 100644 --- a/README +++ b/README @@ -145,6 +145,23 @@ Tests make checkall + You may also optionally perform a series of semi-manual tests to + verify a working extended screenio. + make checkmanual + The test execution is automatic but the user needs to check for + the expected result. See tests/run_prog_manual.sh for tweaking the + test runner used (which is otherwise deduced from the environment), + either in that script or via TESTRUNNER environment variable. + +** NOTE ** + The semi-manual tests need either "xterm", GNU "screen" or "tmux" + installed and will run within a detached "cmd" on MSYS based + systems otherwise. + For running with screen or tmux execute the following from + a separate terminal, directly after running the testsuite: + tests/run_prog_manual.sh attach + ... and leave that using "exit" at the end of the tests + ============ The following is only interesting for advanced use. diff --git a/README.md b/README.md index 7106f6948..39890f5f7 100644 --- a/README.md +++ b/README.md @@ -88,13 +88,33 @@ If the the COBOL85 testsuite is not already in the build- or source-tree, `make test` will download it. For details see tests/cobol85/README. ** NOTE ** - The language interpreter "perl" is required to run COBOL85 tests. + The language interpreter `perl` is required to run COBOL85 tests. If you want to run both testsuites you can run * `make checkall` + + You may also optionally perform a series of semi-manual tests to + verify a working extended screenio. + + * `make checkmanual` + + The test execution is automatic but the user needs to check for + the expected result. See `tests/run_prog_manual.sh` for tweaking the + test runner used (which is otherwise deduced from the environment), + either in that script or via TESTRUNNER environment variable. + +** NOTE ** + The semi-manual tests need either `xterm`, GNU `screen` or `tmux` + installed and will run within a detached `cmd.exe` on MSYS based + systems otherwise. + For running with screen or tmux execute the following from + a separate terminal, directly after running the testsuite: + `tests/run_prog_manual.sh attach` + ... and leave that using `exit` at the end of the tests + Installation ============ diff --git a/tests/ChangeLog b/tests/ChangeLog index 6c28dd67f..610283051 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,4 +1,16 @@ +2024-09-09 Simon Sobisch + + * run_prog_manual.sh.in: adding testrunner tmux as alternative + to screen; allow to override the deduced test runner by environment + variable TESTRUNNER; new option to call with parameter "attach" and + "kill" for either attaching to or killing test runner sessions in + screen/tmux; enhance portability and use abs_builddir + * run_prog_manual.sh.in (_test_with_screen): use separate SCREENDIR + to ensure using system defaults and work around WSL regressions + * run_prog_manual.sh.in (_test_with_cmd): work around cmd quoting + by using a dynamically created sub command file + 2024-08-03 David Declerck * testsuite.src/run_file.at, testsuite.src/run_misc.at: diff --git a/tests/run_prog_manual.sh.in b/tests/run_prog_manual.sh.in index 982468ea1..aad4f79f2 100755 --- a/tests/run_prog_manual.sh.in +++ b/tests/run_prog_manual.sh.in @@ -2,7 +2,7 @@ # # run_prog_manual.sh gnucobol/tests # -# Copyright (C) 2014-2022 Free Software Foundation, Inc. +# Copyright (C) 2014-2022,2024 Free Software Foundation, Inc. # Written by Edward Hart, Simon Sobisch # # This file is part of GnuCOBOL. @@ -24,14 +24,40 @@ # code to the testsuite after the terminal ends. # You may change run_prog_manual.sh according to you needs, especially -# if you want to use a different terminal/terminal manager than xterm/screen -# or different options for these. - -abs_top_builddir="@abs_top_builddir@" - +# if you want to use a different test runner than the default ones. + +# test runner evaluation, you may want to override this in the +# generated file +case "$TESTRUNNER" in + xterm | screen | tmux | cmd) + # we do as instructed... + ;; + "") + if ( command -v xterm >/dev/null 2>&1) && test -n "$DISPLAY"; then + TESTRUNNER=xterm + elif command -v screen >/dev/null 2>&1; then + TESTRUNNER=screen + elif command -v tmux >/dev/null 2>&1; then + TESTRUNNER=tmux + elif test -n "$MSYSTEM"; then + TESTRUNNER=cmd + else + (>&2 echo "don't know which test runner to use, either install" + echo "one of the default supported ones (xterm, screen, tmux) or" + echo "adjust $0") + exit 1 + fi + ;; + *) + (>&2 echo "unknown test runner '""$TESTRUNNER""'") + exit 1 +esac + + +abs_builddir="@abs_builddir@" TIMEOUT=30 # timeout in seconds -if test ! -z "$MSYSTEM"; then +if test -n "$MSYSTEM"; then SLEEP_SCALE=1 # always possible, done in MSYS to reduce number of spawned processes else SLEEP_SCALE=0.1 # needs a "modern" sleep implementation @@ -43,33 +69,72 @@ TITLE="GnuCOBOL Manual Test Run - $DESC" _test_with_xterm () { xterm -T "$TITLE" \ -fa 'Liberation Mono' -fs 14 \ - -e "bash -c \"(\$COBCRUN_DIRECT $1 2>./syserr.log && echo \$? > ./result) || echo 1 > ./result\"" + -e "sh -c \"(\$COBCRUN_DIRECT $1 2>./syserr.log && echo \$? > ./result) || echo 1 > ./result\"" } -# Note: when using screen manager you have to -# run `screen -r "GCTESTS"` in a separate terminal -# within 5 seconds after starting the tests +export SCREENDIR="${abs_builddir}/screen" + +# Note: when using the GNU screen manager you have to either call +# this script with the parameter "attach" or +# run `screen -r "GCTESTS"` with appropriate SCREENDIR +# in a separate terminal within 5 seconds after starting the tests _test_with_screen () { - # check if screen session already exists, setup if not - screen -S "GCTESTS" -X select . 2>/dev/null 1>&2 - if test $? -ne 0; then + test -d "$SCREENDIR" || mkdir -p -m 700 "$SCREENDIR" + # check if screen session already exists, setup if not + if ! screen -S "GCTESTS" -X select . 2>/dev/null 1>&2; then # Note: you may need to adjust screen's terminal to get an output matching the actual running code later - screen -dmS "GCTESTS" -t "$TITLE" + screen -dmS "GCTESTS" -t "GCTESTS" # we have a fresh environment there - source the test config once - screen -S "GCTESTS" -X stuff ". \"${abs_top_builddir}/tests/atconfig\" && . \"${abs_top_builddir}/tests/atlocal\" + screen -S "GCTESTS" -X stuff "cd \"${abs_builddir}\" && . atconfig && . atlocal; echo " sleep 5 fi # run actual test in screen session - screen -S "GCTESTS" -X title $"TITLE" - screen -S "GCTESTS" -X exec ... bash -c "cd \"$PWD\" && ($COBCRUN_DIRECT $* 2>./syserr.log && echo $? > ./result) || echo 1 > ./result" + screen -S "GCTESTS" -X title "$TITLE" + screen -S "GCTESTS" -X exec ... sh -c "cd \"$PWD\" && ($COBCRUN_DIRECT $* 2>./syserr.log && echo $? > ./result) || echo 1 > ./result" +} +_attach_to_screen () { + test -d "$SCREENDIR" && (screen -r "GCTESTS" ; true) && exit + echo "no sessions with SCREENDIR='""$SCREENDIR""'" +} +_kill_screen () { + test -d "$SCREENDIR" && (screen -S "GCTESTS" -X kill ; rm -rf "$SCREENDIR") && exit + echo "no sessions with SCREENDIR='""$SCREENDIR""'" +} + + +# Note: when using the terminal multiplexer you have to either call +# this script with the parameter "attach" or +# run `tmux attach -t "=GCTESTS:0"` in a separate terminal +# within 5 seconds after starting the tests +_test_with_tmux () { + # check if tmux session already exists, setup if not + if ! tmux has-session -t "=GCTESTS" 2>/dev/null; then + # Note: you may need to adjust screen's terminal to get an output matching the actual running code later + tmux new-session -d -s "GCTESTS" + # we have a fresh environment there - source the test config once + tmux send-keys -t "=GCTESTS:0" "cd \"${abs_builddir}\" && . atconfig && . atlocal; echo" C-m + sleep 5 + fi + # run actual test in screen session + tmux rename-window -t "=GCTESTS:0" "$TITLE" + tmux send-keys -t "=GCTESTS:0" "sh -c \"cd \\\"$PWD\\\" && ($COBCRUN_DIRECT $* 2>./syserr.log && echo $? > ./result) || echo 1 > ./result; echo\"" C-m +} +_attach_to_tmux () { + tmux attach -t "=GCTESTS:0" +} +_kill_tmux () { + tmux has-session -t "=GCTESTS" 2>/dev/null && (tmux kill-session -t "=GCTESTS:0") && exit + echo "no sessions named GCTESTS" } _test_with_cmd () { - # run cmd to start a detached cmd (via cmd's start), and execute the tests there - cmd.exe /c "start \"$TITLE\" /wait cmd /v:on /c \"$COBCRUN_DIRECT $(echo $* | tr '/' '\\') 2>syserr.log & echo !errorlevel! >result\"" + # run cmd to start a detached cmd (via cmd's start), and execute the tests there, + # to work around quoting issues we create a sub-cmd + echo "$COBCRUN_DIRECT $(echo $* | tr '/' '\\') 2>syserr.log & echo !errorlevel! >result" > run_manual.cmd + cmd.exe /c "start \"$TITLE\" /wait cmd /v:on /c run_manual.cmd" #if test -f ./syserr.log; then # dos2unix -q ./syserr.log #fi @@ -89,22 +154,39 @@ _wait_result () { } -# actual test +# special run to attach / kill +if test "$1" = attach; then + case "$TESTRUNNER" in + screen) _attach_to_screen ;; + tmux) _attach_to_tmux ;; + *) echo "no need for external attach with test runner \"$TESTRUNNER\"" ;; + esac + exit +fi +if test "$1" = kill; then + case "$TESTRUNNER" in + screen) _kill_screen ;; + tmux) _kill_tmux ;; + *) echo "no need for external kill with test runner \"$TESTRUNNER\"" ;; + esac + exit +fi + +# actual test rm -f ./result ./syserr.log -if test ! -z "$DISPLAY"; then - _test_with_xterm $* || echo $? > ./result -elif test ! -z "$MSYSTEM"; then - _test_with_cmd $* || echo $? > ./result -else - _test_with_screen $* || echo $? > ./result -fi +case "$TESTRUNNER" in + xterm) _test_with_xterm $* || echo $? > ./result ;; + screen) _test_with_screen $* || echo $? > ./result ;; + tmux) _test_with_tmux $* || echo $? > ./result ;; + cmd) _test_with_cmd $* || echo $? > ./result ;; +esac _wait_result || { (>&2 echo "No result file after waiting for $TIMEOUT seconds!") - if test ! -z "$DISPLAY"; then - screen -S "GCTESTS" -X kill - fi + case "$TESTRUNNER" in + screen | tmux) $0 kill;; + esac echo 124 > ./result } if test -f ./syserr.log; then From a234462ff94b5f5feff62f87d2f097b1e7688a69 Mon Sep 17 00:00:00 2001 From: sf-mensch Date: Fri, 13 Sep 2024 21:13:03 +0000 Subject: [PATCH 4/5] testsuite environment update tests: * atlocal.in (set_utf8_locale): new function for the testsuite enabling tests to either run with UTF8 locale or skip * atlocal.in: use configure-setup for the grep binary * atlocal_win: updated to current atlocal.in [to be used for encoding and possibly screenio tests] --- tests/ChangeLog | 4 ++++ tests/atlocal.in | 53 ++++++++++++++++++++++++++++++--------------- tests/atlocal_win | 55 +++++++++++++++++++++++++++++++---------------- 3 files changed, 77 insertions(+), 35 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index 610283051..a15ae66df 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -10,6 +10,10 @@ to ensure using system defaults and work around WSL regressions * run_prog_manual.sh.in (_test_with_cmd): work around cmd quoting by using a dynamically created sub command file + * atlocal.in (set_utf8_locale): new function for the testsuite + enabling tests to either run with UTF8 locale or skip + * atlocal.in: use configure-setup for the grep binary + * atlocal_win: updated to current atlocal.in 2024-08-03 David Declerck diff --git a/tests/atlocal.in b/tests/atlocal.in index 3d49ec140..68cb4ba1c 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,7 +1,7 @@ # # atlocal gnucobol/tests # -# Copyright (C) 2003-2012, 2014-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2012, 2014-2024 Free Software Foundation, Inc. # Written by Keisuke Nishida, Roger While, Simon Sobisch, Edward Hart # # This file is part of GnuCOBOL. @@ -204,6 +204,25 @@ _return_path () { fi } +# as we run the testsuite in plain LC_ALL=C the system runs in a plain-as-possible environment; +# in the case that we need UTF8 encoding within tests, we try to find out if a working UTF-8 +# locale is available, if not then we return with 77 which will skip the spßecific test needing it +set_utf8_locale () { + # we need the locale binary to tell us how about the locales available + if [ -z "$(which locale)" ]; then + echo "Warning: no locale binary found." + exit 77 # return code for setting + fi + unset LC_ALL + if [ -z "$LC_ALL" ]; then export LC_ALL=$(locale -a | $GREP -i -E "C\.utf.*8" | head -n1); fi + if [ -z "$LC_ALL" ]; then export LC_ALL=$(locale -a | $GREP -i -E "en_US\.utf.*8" | head -n1); fi + if [ -z "$LC_ALL" ]; then export LC_ALL=$(locale -a | $GREP -i -E ".*\.utf.*8" | head -n1); fi + if [ -z "$LC_ALL" ]; then + echo "Warning: no UTF-8 locale found." + exit 77 + fi +} + # ensure we don't execute windows paths within programs generated by cygwin # by passing a hint if test "$OSTYPE" = "cygwin"; then @@ -256,8 +275,8 @@ export COB_UNIX_LF COB_RUNTIME_CONFIG="${abs_top_srcdir}/config/runtime_empty.cfg" export COB_RUNTIME_CONFIG for cobenv in $(${LOCAL_ENV} ${ABS_COBCRUN} --runtime-conf \ - | grep " env:" | cut -d: -f2 | cut -d= -f1 \ - | grep -v "PATH" | grep -v "TERM"); \ + | $GREP " env:" | cut -d: -f2 | cut -d= -f1 \ + | $GREP -v "PATH" | $GREP -v "TERM"); \ do _unset_option $cobenv; \ done @@ -266,8 +285,8 @@ ${LOCAL_ENV} ${ABS_COBC} --verbose --info > info.out # ... and also unset for the compiler if test "$GNUCOBOL_TEST_LOCAL" != "1"; then - for cobenv in $(grep "env:" info.out | cut -d: -f2 | cut -d= -f1 \ - | grep -v "PATH"); \ + for cobenv in $($GREP "env:" info.out | cut -d: -f2 | cut -d= -f1 \ + | $GREP -v "PATH"); \ do _unset_option $cobenv; \ done fi @@ -289,20 +308,20 @@ if test "$GNUCOBOL_TEST_LOCAL" != "1"; then COB_HAS_CURSES="@COB_HAS_CURSES@" else - COB_OBJECT_EXT="$(grep COB_OBJECT_EXT info.out | cut -d: -f2 | cut -b2-)" - COB_EXE_EXT="$(grep COB_EXE_EXT info.out | cut -d: -f2 | cut -b2-)" - COB_MODULE_EXT="$(grep COB_MODULE_EXT info.out | cut -d: -f2 | cut -b2-)" + COB_OBJECT_EXT="$($GREP COB_OBJECT_EXT info.out | cut -d: -f2 | cut -b2-)" + COB_EXE_EXT="$($GREP COB_EXE_EXT info.out | cut -d: -f2 | cut -b2-)" + COB_MODULE_EXT="$($GREP COB_MODULE_EXT info.out | cut -d: -f2 | cut -b2-)" - if test $(grep -i -c "little-endian" info.out) = 0; then + if test $($GREP -i -c "little-endian" info.out) = 0; then COB_BIGENDIAN="yes" else COB_BIGENDIAN="no" fi - COB_HAS_64_BIT_POINTER=$(grep "64bit-mode" info.out | cut -d: -f2 | cut -b2-) + COB_HAS_64_BIT_POINTER=$($GREP "64bit-mode" info.out | cut -d: -f2 | cut -b2-) - cob_indexed=$(grep -i "indexed file" info.out | cut -d: -f2) + cob_indexed=$($GREP -i "indexed file" info.out | cut -d: -f2) if test "x$cob_indexed" = "x"; then - cob_indexed=$(grep ISAM info.out | cut -d: -f2) + cob_indexed=$($GREP ISAM info.out | cut -d: -f2) fi case "$cob_indexed" in " disabled") COB_HAS_ISAM="no";; @@ -314,18 +333,18 @@ else *) echo "unknown entry for indexed handler: '"$cob_indexed"' please report" && exit 1;; esac - if test $(grep -i -c "XML library.*disabled" info.out) = 0; then + if test $($GREP -i -c "XML library.*disabled" info.out) = 0; then COB_HAS_XML2="yes" else COB_HAS_XML2="no" fi - if test $(grep -i -c "JSON library.*disabled" info.out) = 0; then + if test $($GREP -i -c "JSON library.*disabled" info.out) = 0; then COB_HAS_JSON="yes" else COB_HAS_JSON="no" fi # see note below - if test $(grep -i -c " screen .*disabled" info.out) = 0; then + if test $($GREP -i -c " screen .*disabled" info.out) = 0; then COB_HAS_CURSES="yes" else COB_HAS_CURSES="no" @@ -337,7 +356,7 @@ if test "x$MSYSTEM" != "x" -o "$OSTYPE" = "cygwin"; then # "Redirection is not supported" (at least with PDCurses "wincon" port) # --> disabling the tests for this feature # ncurses is known to work as long as TERM is appropriate - if test $(grep -i -c "ncurses" info.out) != 0; then + if test $($GREP -i -c "ncurses" info.out) != 0; then if test "x$MSYSTEM" != "x"; then TERM="" else @@ -348,7 +367,7 @@ if test "x$MSYSTEM" != "x" -o "$OSTYPE" = "cygwin"; then else # manual tests are executed in separate window # and are visible - so no need to handle it there - echo "$at_help_all" | grep -q "run_manual_screen" 2>/dev/null + echo "$at_help_all" | $GREP -q "run_manual_screen" 2>/dev/null if test $? -ne 0; then COB_HAS_CURSES="no" fi diff --git a/tests/atlocal_win b/tests/atlocal_win index 910fc301f..b6dec388f 100644 --- a/tests/atlocal_win +++ b/tests/atlocal_win @@ -5,7 +5,7 @@ # a not POSIX build (OrangeC or Visual Studio build for example) # in a POSIX environment (like MinGW or Cygwin, possibly WSL). # -# Copyright (C) 2003-2012, 2014-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2012, 2014-2024 Free Software Foundation, Inc. # Written by Keisuke Nishida, Roger While, Simon Sobisch, Edward Hart # # This file is part of GnuCOBOL. @@ -48,8 +48,8 @@ export LC_ALL unset LANG # define for performance checks (running code several thousand times) -# comment manually if not needed -COBOL_FLAGS="-DCHECK-PERF ${COBOL_FLAGS}" +# uncomment manually if wanted, or set via environment +# COBOL_FLAGS="-DCHECK-PERF ${COBOL_FLAGS}" FLAGS="-debug -Wall ${COBOL_FLAGS} -fdiagnostics-plain-output" # workaround to adjust the testsuite later: @@ -92,7 +92,7 @@ _return_path () { cygpath -pm "$1" else # check for WSL / Bash on Windows; ignore error messages (file not available) - if $(grep -q "Microsoft" /proc/sys/kernel/osrelease 2>/dev/null); then + if $($GREP -q "Microsoft" /proc/sys/kernel/osrelease 2>/dev/null); then echo "$1" | sed -E 's+^/mnt/(.{1})+\1:+' | sed 's+:$+:/+1' else echo "$1" @@ -100,6 +100,25 @@ _return_path () { fi } +# as we run the testsuite in plain LC_ALL=C the system runs in a plain-as-possible environment; +# in the case that we need UTF8 encoding within tests, we try to find out if a working UTF-8 +# locale is available, if not then we return with 77 which will skip the spßecific test needing it +set_utf8_locale () { + # we need the locale binary to tell us how about the locales available + if [ -z "$(which locale)" ]; then + echo "Warning: no locale binary found." + exit 77 # return code for setting + fi + unset LC_ALL + if [ -z "$LC_ALL" ]; then export LC_ALL=$(locale -a | $GREP -i -E "C\.utf.*8" | head -n1); fi + if [ -z "$LC_ALL" ]; then export LC_ALL=$(locale -a | $GREP -i -E "en_US\.utf.*8" | head -n1); fi + if [ -z "$LC_ALL" ]; then export LC_ALL=$(locale -a | $GREP -i -E ".*\.utf.*8" | head -n1); fi + if [ -z "$LC_ALL" ]; then + echo "Warning: no UTF-8 locale found." + exit 77 + fi +} + # Note: we explicit do not set COB_ON_CYGWIN here, # as this is file is about running non-cygwin binaries @@ -123,8 +142,8 @@ export COB_UNIX_LF COB_RUNTIME_CONFIG="$(_return_path "${abs_top_srcdir}/config/runtime_empty.cfg")" export COB_RUNTIME_CONFIG for cobenv in $(${LOCAL_ENV} ${COBCRUN} --runtime-conf \ - | grep " env:" | cut -d: -f2 | cut -d= -f1 \ - | grep -v "PATH" | grep -v "TERM"); \ + | $GREP " env:" | cut -d: -f2 | cut -d= -f1 \ + | $GREP -v "PATH" | $GREP -v "TERM"); \ do _unset_option $cobenv; \ done @@ -133,8 +152,8 @@ ${LOCAL_ENV} ${COBC} --verbose --info > info.out # ... and also unset for the compiler if test "$GNUCOBOL_TEST_LOCAL" != "1"; then - for cobenv in $(grep "env:" info.out | cut -d: -f2 | cut -d= -f1 \ - | grep -v "PATH"); \ + for cobenv in $($GREP "env:" info.out | cut -d: -f2 | cut -d= -f1 \ + | $GREP -v "PATH"); \ do _unset_option $cobenv; \ done fi @@ -148,20 +167,20 @@ export COB_MSG_FORMAT # different flags checked in the testsuite # note: kept intended to ease merge from atlocal.in - COB_OBJECT_EXT="$(grep COB_OBJECT_EXT info.out | cut -d: -f2 | cut -b2-)" + COB_OBJECT_EXT="$($GREP COB_OBJECT_EXT info.out | cut -d: -f2 | cut -b2-)" COB_EXE_EXT=".exe" COB_MODULE_EXT="dll" - if test $(grep -i -c "little-endian" info.out) = 0; then + if test $($GREP -i -c "little-endian" info.out) = 0; then COB_BIGENDIAN="yes" else COB_BIGENDIAN="no" fi - COB_HAS_64_BIT_POINTER=$(grep "64bit-mode" info.out | cut -d: -f2 | cut -b2-) + COB_HAS_64_BIT_POINTER=$($GREP "64bit-mode" info.out | cut -d: -f2 | cut -b2-) - cob_indexed=$(grep -i "indexed file" info.out | cut -d: -f2) + cob_indexed=$($GREP -i "indexed file" info.out | cut -d: -f2) if test "x$cob_indexed" = "x"; then - cob_indexed=$(grep ISAM info.out | cut -d: -f2) + cob_indexed=$($GREP ISAM info.out | cut -d: -f2) fi case "$cob_indexed" in " disabled") COB_HAS_ISAM="no";; @@ -173,18 +192,18 @@ export COB_MSG_FORMAT *) echo "unknown entry for indexed handler: '"$cob_indexed"' please report" && exit 1;; esac - if test $(grep -i -c "XML library.*disabled" info.out) = 0; then + if test $($GREP -i -c "XML library.*disabled" info.out) = 0; then COB_HAS_XML2="yes" else COB_HAS_XML2="no" fi - if test $(grep -i -c "JSON library.*disabled" info.out) = 0; then + if test $($GREP -i -c "JSON library.*disabled" info.out) = 0; then COB_HAS_JSON="yes" else COB_HAS_JSON="no" fi # see note below - if test $(grep -i -c " screen .*disabled" info.out) = 0; then + if test $($GREP -i -c " screen .*disabled" info.out) = 0; then COB_HAS_CURSES="yes" else COB_HAS_CURSES="no" @@ -196,7 +215,7 @@ if test "x$MSYSTEM" != "x" -o "$OSTYPE" = "cygwin"; then # "Redirection is not supported" (at least with PDCurses "wincon" port) # --> disabling the tests for this feature # ncurses is known to work as long as TERM is appropriate - if test $(grep -i -c "ncurses" info.out) != 0; then + if test $($GREP -i -c "ncurses" info.out) != 0; then if test "x$MSYSTEM" != "x"; then TERM="" else @@ -207,7 +226,7 @@ if test "x$MSYSTEM" != "x" -o "$OSTYPE" = "cygwin"; then else # manual tests are executed in separate window # and are visible - so no need to handle it there - echo "$at_help_all" | grep -q "run_manual_screen" 2>/dev/null + echo "$at_help_all" | $GREP -q "run_manual_screen" 2>/dev/null if test $? -ne 0; then COB_HAS_CURSES="no" fi From cd346a66aab8791abd8bc821b9cd4e5c248bd7a8 Mon Sep 17 00:00:00 2001 From: sf-mensch Date: Wed, 18 Sep 2024 11:13:05 +0000 Subject: [PATCH 5/5] minor doc changes --- ABOUT-NLS | 6 +++--- DEPENDENCIES | 2 +- DEPENDENCIES.md | 2 +- doc/gnucobol.texi | 18 +++++++++++------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ABOUT-NLS b/ABOUT-NLS index 186a3c65c..3cc828658 100644 --- a/ABOUT-NLS +++ b/ABOUT-NLS @@ -110,7 +110,7 @@ people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, -'https://translationproject.org/', in the "Teams" area. +'http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. @@ -1357,7 +1357,7 @@ mere existence a PO file and its wide availability in a distribution. If Jun 2014 seems to be old, you may fetch a more recent copy of this 'ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at -'https://translationproject.org/extra/matrix.html'. +'http://translationproject.org/extra/matrix.html'. 1.5 Using 'gettext' in new packages =================================== @@ -1376,4 +1376,4 @@ Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact 'coordinator@translationproject.org' to make the '.pot' files available -to the translation teams. \ No newline at end of file +to the translation teams. diff --git a/DEPENDENCIES b/DEPENDENCIES index f0d54169b..94be483f7 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -137,7 +137,7 @@ The following libraries ARE required WHEN : JSON-C is distributed under Expat License. -5) charachter encoding support is needed and iconv is not provided +5) character encoding support is needed and iconv is not provided as part of libc BOTH runtime AND development components required. diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 289265bf5..b14b73815 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -120,7 +120,7 @@ Support for GENERATE JSON is provided by *one* of the following: JSON-C is distributed under Expat License. -charachter encoding support +character encoding support ---------------------------- Support for partial character encoding is provided directly, diff --git a/doc/gnucobol.texi b/doc/gnucobol.texi index af4eb9fd2..e1048c7b1 100644 --- a/doc/gnucobol.texi +++ b/doc/gnucobol.texi @@ -540,7 +540,8 @@ between paragraphs and sections. Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky or suggest there may have been an error. -The following options do not enable specific warnings but control the kinds of diagnostics produced by @command{cobc}. +The following options do not enable specific warnings but control the kinds of +diagnostics produced by @command{cobc}. @table @code @item -fsyntax-only @@ -615,9 +616,10 @@ and that are easy to avoid (or modify to prevent the warning).@* The list of warning flags turned on by this option is shown in @option{--help}. @item -Wextra, -W -Enable every possible warning that is not dialect specific. This includes more information -than @option{-Wall} would normally provide.@* -(This option used to be called @option{-W}. The older name is still supported, but the newer name is more descriptive.) +Enable every possible warning that is not dialect specific. This includes more +information than @option{-Wall} would normally provide.@* +(This option used to be called @option{-W}. The older name is still supported, +but the newer name is more descriptive.) @item -W@var{warning} Enable single warning @var{warning}. @@ -629,7 +631,8 @@ Disable single warning @var{warning}. Warn if archaic features are used, such as continuation lines or the @code{NEXT SENTENCE} statement. @item -Wcall-params -Warn if non-01/77-level items are used as arguments in a @code{CALL} statement. This is @emph{not} set with @option{-Wall}. +Warn if non-01/77-level items are used as arguments in a @code{CALL} statement. +This is @emph{not} set with @option{-Wall}. @item -Wcolumn-overflow Warn if text after column 72 in FIXED format. This is @emph{not} set with @option{-Wall}. @@ -781,8 +784,9 @@ Compiler uses the given @var{dialect} to determine the reserved words. User-defined dialect configuration. @item -febcdic-table=@var{cconv-table}/@var{file} -EBCDIC/ASCII translation table to use; either read from @var{file}, or one of the existing @var{cconv-table} -from the configuration directory (see @code{cobc --info}) which have a .ttbl extension, for example @option{-febcdic-table=alternate}.@* +EBCDIC/ASCII translation table to use; either read from @var{file}, or one of +the existing @var{cconv-table} from the configuration directory (see @code{cobc --info}) +which have a .ttbl extension, for example @option{-febcdic-table=alternate}.@* See the @file{default.ttbl} file for detailed information about the format. @end table