summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-06-29 16:51:08 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-06-29 17:08:26 -0700
commitc92f7606d6b73d4911b57f714c0cc5c64f0912bf (patch)
treec1a613a8bb019f142832420a911459f661fb7abe
parentb3eb40f9c9919e5c40762cab1196715bd8796af1 (diff)
downloadautoconf-c92f7606d6b73d4911b57f714c0cc5c64f0912bf.tar.gz
make fetch
-rw-r--r--GNUmakefile2
-rwxr-xr-xbuild-aux/announce-gen53
-rwxr-xr-xbuild-aux/config.guess846
-rwxr-xr-xbuild-aux/config.sub2616
-rwxr-xr-xbuild-aux/gendocs.sh16
-rwxr-xr-xbuild-aux/git-version-gen13
-rwxr-xr-xbuild-aux/gitlog-to-changelog52
-rwxr-xr-xbuild-aux/gnupload53
-rwxr-xr-xbuild-aux/move-if-change9
-rw-r--r--build-aux/texinfo.tex1650
-rwxr-xr-xbuild-aux/update-copyright60
-rwxr-xr-xbuild-aux/useless-if-before-free46
-rwxr-xr-xbuild-aux/vc-list-files8
-rw-r--r--doc/fdl.texi4
-rw-r--r--doc/gendocs_template14
-rw-r--r--doc/make-stds.texi6
-rw-r--r--doc/standards.texi679
-rw-r--r--lib/Autom4te/Channels.pm2
-rw-r--r--lib/Autom4te/FileUtils.pm53
-rw-r--r--lib/Autom4te/Getopt.pm19
-rw-r--r--lib/Autom4te/XFile.pm2
-rw-r--r--m4/autobuild.m42
-rw-r--r--maint.mk266
23 files changed, 3610 insertions, 2861 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 6a085498..bf052693 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -5,7 +5,7 @@
# It is necessary if you want to build targets usually of interest
# only to the maintainer.
-# Copyright (C) 2001, 2003, 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2006-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/build-aux/announce-gen b/build-aux/announce-gen
index 269f7863..ff8d4502 100755
--- a/build-aux/announce-gen
+++ b/build-aux/announce-gen
@@ -1,40 +1,54 @@
-eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
- & eval 'exec perl -wS "$0" $argv:q'
- if 0;
-# Generate a release announcement message.
-
-my $VERSION = '2017-09-13 06:45'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job. Otherwise, update this string manually.
+#!/bin/sh
+#! -*-perl-*-
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# Generate a release announcement message.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
+#
# Written by Jim Meyering
-use strict;
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line. The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name. The second line is essential for perl and is
+# also useful for editing this file in Emacs. The next two lines below
+# are valid code in both sh and perl. When executed by sh, they re-execute
+# the script through the perl program found in $PATH. The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh. When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx "$0" "$@"'
+ if 0;
+
+my $VERSION = '2020-05-10 16:13'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+use strict;
use Getopt::Long;
use POSIX qw(strftime);
(my $ME = $0) =~ s|.*/||;
my %valid_release_types = map {$_ => 1} qw (alpha beta stable);
-my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz');
+my @archive_suffixes = qw (tar.gz tar.bz2 tar.lz tar.lzma tar.xz);
my %digest_classes =
(
'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'),
@@ -357,8 +371,8 @@ sub get_tool_versions ($$)
}
{
- # Neutralize the locale, so that, for instance, "du" does not
- # issue "1,2" instead of "1.2", what confuses our regexps.
+ # Use the C locale so that, for instance, "du" does not
+ # print "1,2" instead of "1.2", which would confuse our regexps.
$ENV{LC_ALL} = "C";
my $mail_headers;
@@ -549,7 +563,8 @@ EOF
## perl-label-offset: -2
## perl-extra-newline-before-brace: t
## perl-merge-trailing-else: nil
-## eval: (add-hook 'write-file-hooks 'time-stamp)
+## eval: (add-hook 'before-save-hook 'time-stamp)
+## time-stamp-line-limit: 50
## time-stamp-start: "my $VERSION = '"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-time-zone: "UTC0"
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 8bd1095f..92bfc33e 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2017 Free Software Foundation, Inc.
+# Copyright 1992-2020 Free Software Foundation, Inc.
-timestamp='2017-09-16'
+timestamp='2020-04-26'
# 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
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2020 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."
@@ -84,8 +84,6 @@ if test $# != 0; then
exit 1
fi
-trap 'exit 1' 1 2 15
-
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,40 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ # prevent multiple calls if $tmp is already set
+ test "$tmp" && return 0
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$driver"
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
@@ -132,14 +136,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
@@ -149,13 +153,20 @@ Linux|GNU|GNU/*)
LIBC=gnu
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+ # If ldd exists, use it to detect musl libc.
+ if command -v ldd >/dev/null && \
+ ldd --version 2>&1 | grep -q ^musl
+ then
+ LIBC=musl
+ fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +180,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
- /sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || \
+ "/sbin/$sysctl" 2>/dev/null || \
+ "/usr/sbin/$sysctl" 2>/dev/null || \
echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
+ case "$UNAME_MACHINE_ARCH" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
- arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
- endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
- machine=${arch}${endian}-unknown
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine="${arch}${endian}"-unknown
;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently (or will in the future) and ABI.
- case "${UNAME_MACHINE_ARCH}" in
+ case "$UNAME_MACHINE_ARCH" in
earm*)
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@@ -208,10 +219,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# Determine ABI tags.
- case "${UNAME_MACHINE_ARCH}" in
+ case "$UNAME_MACHINE_ARCH" in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
- abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
;;
esac
# The OS release
@@ -219,48 +230,60 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
+ case "$UNAME_VERSION" in
Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}${abi}"
+ echo "$machine-${os}${release}${abi-}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
exit ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
exit ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
exit ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+ exit ;;
+ *:OS108:*:*)
+ echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:Sortix:*:*)
- echo ${UNAME_MACHINE}-unknown-sortix
+ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Twizzler:*:*)
+ echo "$UNAME_MACHINE"-unknown-twizzler
exit ;;
*:Redox:*:*)
- echo ${UNAME_MACHINE}-unknown-redox
+ echo "$UNAME_MACHINE"-unknown-redox
+ exit ;;
+ mips:OSF1:*.*)
+ echo mips-dec-osf1
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
@@ -313,7 +336,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
@@ -322,10 +345,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
+ echo "$UNAME_MACHINE"-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
+ echo "$UNAME_MACHINE"-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -337,7 +360,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
+ echo arm-acorn-riscix"$UNAME_RELEASE"
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
@@ -364,19 +387,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
exit ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
+ echo i386-pc-auroraux"$UNAME_RELEASE"
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
+ set_cc_for_build
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -389,13 +412,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
SUN_ARCH=x86_64
fi
fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
@@ -404,25 +427,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
exit ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ echo sparc-sun-sunos"$UNAME_RELEASE"
;;
esac
exit ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
@@ -433,44 +456,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
+ echo m68k-milan-mint"$UNAME_RELEASE"
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
+ echo m68k-hades-mint"$UNAME_RELEASE"
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
+ echo m68k-unknown-mint"$UNAME_RELEASE"
exit ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
+ echo m68k-apple-machten"$UNAME_RELEASE"
exit ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
+ echo powerpc-apple-machten"$UNAME_RELEASE"
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
+ echo mips-dec-ultrix"$UNAME_RELEASE"
exit ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
+ echo vax-dec-ultrix"$UNAME_RELEASE"
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -479,23 +502,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
+ echo mips-mips-riscos"$UNAME_RELEASE"
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
@@ -521,17 +544,17 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+ [ "$TARGET_BINARY_INTERFACE"x = x ]
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ echo m88k-dg-dgux"$UNAME_RELEASE"
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ echo i586-dg-dgux"$UNAME_RELEASE"
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
@@ -548,7 +571,7 @@ EOF
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
@@ -560,14 +583,14 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
main()
@@ -578,7 +601,7 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
echo "$SYSTEM_NAME"
else
@@ -592,7 +615,7 @@ EOF
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -601,18 +624,18 @@ EOF
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
@@ -627,28 +650,28 @@ EOF
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ case "$UNAME_MACHINE" in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
+ case "$sc_cpu_version" in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
+ case "$sc_kernel_bits" in
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ if [ "$HP_ARCH" = "" ]; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include <stdlib.h>
@@ -681,13 +704,13 @@ EOF
exit (0);
}
EOF
- (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = hppa2.0w ]
+ if [ "$HP_ARCH" = hppa2.0w ]
then
- eval $set_cc_for_build
+ set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -706,15 +729,15 @@ EOF
HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
exit ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
main ()
@@ -739,11 +762,11 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
@@ -752,7 +775,7 @@ EOF
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
@@ -760,9 +783,9 @@ EOF
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ echo "$UNAME_MACHINE"-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ echo "$UNAME_MACHINE"-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
@@ -787,112 +810,123 @@ EOF
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
exit ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
exit ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=`uname -p`
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+ else
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+ fi
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
+ case "$UNAME_PROCESSOR" in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
UNAME_PROCESSOR=i586 ;;
esac
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
+ echo "$UNAME_MACHINE"-pc-cygwin
exit ;;
*:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
+ echo "$UNAME_MACHINE"-pc-mingw64
exit ;;
*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
+ echo "$UNAME_MACHINE"-pc-mingw32
exit ;;
*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
+ echo "$UNAME_MACHINE"-pc-msys
exit ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
+ echo "$UNAME_MACHINE"-pc-pw32
exit ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case "$UNAME_MACHINE" in
x86)
- echo i586-pc-interix${UNAME_RELEASE}
+ echo i586-pc-interix"$UNAME_RELEASE"
exit ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
exit ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
+ echo ia64-unknown-interix"$UNAME_RELEASE"
exit ;;
esac ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
+ echo "$UNAME_MACHINE"-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
+ echo x86_64-pc-cygwin
exit ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
+ *:Minix:*:*)
+ echo "$UNAME_MACHINE"-unknown-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -903,140 +937,178 @@ EOF
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
e2k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
k1om:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
+ #undef mips
+ #undef mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
+ #else
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
+ #else
+ LIBCABI=${LIBC}
+ #endif
+ #endif
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
+ MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
+ MIPS_ENDIAN=
#else
- CPU=
+ MIPS_ENDIAN=
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
mips64el:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
openrisc*:Linux:*:*)
- echo or1k-unknown-linux-${LIBC}
+ echo or1k-unknown-linux-"$LIBC"
exit ;;
or32:Linux:*:* | or1k*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
+ echo sparc-unknown-linux-"$LIBC"
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
+ echo hppa64-unknown-linux-"$LIBC"
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+ *) echo hppa-unknown-linux-"$LIBC" ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
+ echo powerpc64-unknown-linux-"$LIBC"
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
+ echo powerpc-unknown-linux-"$LIBC"
exit ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
+ echo powerpc64le-unknown-linux-"$LIBC"
exit ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
+ echo powerpcle-unknown-linux-"$LIBC"
exit ;;
riscv32:Linux:*:* | riscv64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ set_cc_for_build
+ LIBCABI=$LIBC
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_X32 >/dev/null
+ then
+ LIBCABI="$LIBC"x32
+ fi
+ fi
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1050,34 +1122,34 @@ EOF
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
+ echo "$UNAME_MACHINE"-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
+ echo "$UNAME_MACHINE"-unknown-stop
exit ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
+ echo "$UNAME_MACHINE"-unknown-atheos
exit ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
+ echo "$UNAME_MACHINE"-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
exit ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
fi
exit ;;
i*86:*:5:[678]*)
@@ -1087,12 +1159,12 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1102,9 +1174,9 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ echo "$UNAME_MACHINE"-pc-sysv32
fi
exit ;;
pc:*:*:*)
@@ -1124,9 +1196,9 @@ EOF
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
@@ -1146,9 +1218,9 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
@@ -1157,28 +1229,28 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
+ echo mips-dde-sysv"$UNAME_RELEASE"
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
@@ -1189,7 +1261,7 @@ EOF
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ echo "$UNAME_MACHINE"-sni-sysv4
else
echo ns32k-sni-sysv
fi
@@ -1209,23 +1281,23 @@ EOF
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
+ echo "$UNAME_MACHINE"-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
+ echo m68k-apple-aux"$UNAME_RELEASE"
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv"$UNAME_RELEASE"
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv"$UNAME_RELEASE"
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
@@ -1244,67 +1316,68 @@ EOF
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
+ echo sx4-nec-superux"$UNAME_RELEASE"
exit ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
+ echo sx5-nec-superux"$UNAME_RELEASE"
exit ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
+ echo sx6-nec-superux"$UNAME_RELEASE"
exit ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
+ echo sx7-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
+ echo sx8-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
+ echo sx8r-nec-superux"$UNAME_RELEASE"
exit ;;
SX-ACE:SUPER-UX:*:*)
- echo sxace-nec-superux${UNAME_RELEASE}
+ echo sxace-nec-superux"$UNAME_RELEASE"
exit ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
+ UNAME_PROCESSOR=`uname -p`
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
- if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_PPC >/dev/null
- then
- UNAME_PROCESSOR=powerpc
- fi
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
@@ -1312,22 +1385,25 @@ EOF
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-*:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
+ echo neo-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
+ echo nse-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSR-*:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSX-*:NONSTOP_KERNEL:*:*)
- echo nsx-tandem-nsk${UNAME_RELEASE}
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
@@ -1336,18 +1412,19 @@ EOF
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
+ # shellcheck disable=SC2154
if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
- echo ${UNAME_MACHINE}-unknown-plan9
+ echo "$UNAME_MACHINE"-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
@@ -1368,14 +1445,14 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux"$UNAME_RELEASE"
exit ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
+ case "$UNAME_MACHINE" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
@@ -1384,24 +1461,176 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
exit ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
+ echo "$UNAME_MACHINE"-pc-rdos
exit ;;
i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
+ echo "$UNAME_MACHINE"-pc-aros
exit ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
+ echo "$UNAME_MACHINE"-unknown-esx
exit ;;
amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs
exit ;;
+ *:Unleashed:*:*)
+ echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
+ exit ;;
+esac
+
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
+#ifdef _SEQUENT_
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
esac
cat >&2 <<EOF
-$0: unable to guess system type
This script (version $timestamp), has failed to recognize the
operating system you are using. If your script is old, overwrite *all*
@@ -1410,6 +1639,12 @@ copies of config.guess and config.sub with the latest versions from:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+EOF
+
+year=`echo $timestamp | sed 's,-.*,,'`
+# shellcheck disable=SC2003
+if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
+ cat >&2 <<EOF
If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to
@@ -1432,16 +1667,17 @@ hostinfo = `(hostinfo) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
EOF
+fi
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/build-aux/config.sub b/build-aux/config.sub
index 95dc3d07..ce89d5c5 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2017 Free Software Foundation, Inc.
+# Copyright 1992-2020 Free Software Foundation, Inc.
-timestamp='2017-09-16'
+timestamp='2020-06-28'
# 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
@@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2020 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."
@@ -89,12 +89,12 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- echo "$me: invalid option $1$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -110,1252 +110,1164 @@ case $# in
exit 1;;
esac
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
- kopensolaris*-gnu* | cloudabi*-eabi* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -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*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
+# Separate into logical components for further validation
+case $1 in
+ *-*-*-*-*)
+ echo Invalid configuration \`"$1"\': more than four components >&2
+ exit 1
;;
- -lynx*)
- os=-lynxos
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ basic_os=$field3-$field4
;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # 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*)
+ basic_machine=$field1
+ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ basic_os=$field3
+ ;;
+ esac
;;
- -psos*)
- os=-psos
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ 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)
+ basic_machine=$field1-$field2
+ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ esac
+ ;;
+ esac
;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ basic_os=linux
+ ;;
+ cegcc)
+ 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
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ basic_os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ basic_os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ basic_os=
+ ;;
+ esac
;;
esac
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | ba \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | e2k | epiphany \
- | fido | fr30 | frv | ft32 \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia16 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pru \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | wasm32 \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
;;
- ms1)
- basic_machine=mt-unknown
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
+ ibm*)
+ cpu=i370
+ vendor=ibm
;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
+ orion105)
+ cpu=clipper
+ vendor=highlevel
;;
- xscaleeb)
- basic_machine=armeb-unknown
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
;;
-
- xscaleel)
- basic_machine=armel-unknown
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
;;
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | ba-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | e2k-* | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pru-* \
- | pyramid-* \
- | riscv32-* | riscv64-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | visium-* \
- | wasm32-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
+ cpu=m68000
+ vendor=att
;;
3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- asmjs)
- basic_machine=asmjs-unknown
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=we32k
+ vendor=att
;;
bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
+ cpu=powerpc
+ vendor=ibm
+ basic_os=cnk
;;
decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops10
;;
decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
+ cpu=m68k
+ vendor=motorola
;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- e500v[12])
- basic_machine=powerpc-unknown
- os=$os"spe"
- ;;
- e500v[12]-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=$os"spe"
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ basic_os=sysv3
;;
encore | umax | mmax)
- basic_machine=ns32k-encore
+ cpu=ns32k
+ vendor=encore
;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ basic_os=${basic_os:-bsd}
;;
fx2800)
- basic_machine=i860-alliant
+ cpu=i860
+ vendor=alliant
;;
genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
+ cpu=ns32k
+ vendor=ns
;;
h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
+ cpu=m68000
+ vendor=hp
;;
hp9k3[2-9][0-9])
- basic_machine=m68k-hp
+ cpu=m68k
+ vendor=hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
+ cpu=hppa1.0
+ vendor=hp
;;
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=solaris2
;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ basic_os=${basic_os:-unicos}
;;
iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
+ cpu=mips
+ vendor=sgi
+ case $basic_os in
+ irix*)
;;
*)
- os=-irix4
+ basic_os=irix4
;;
esac
;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
+ cpu=m68000
+ vendor=convergent
;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ basic_os=mint
;;
news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
+ cpu=mips
+ vendor=sony
+ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+ case $basic_os in
+ openstep*)
+ ;;
+ nextstep*)
;;
- -ns2*)
- os=-nextstep2
+ ns2*)
+ basic_os=nextstep2
;;
*)
- os=-nextstep3
+ basic_os=nextstep3
;;
esac
;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- nsx-tandem)
- basic_machine=nsx-tandem
+ cpu=np1
+ vendor=gould
;;
op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
+ cpu=hppa1.1
+ vendor=oki
+ basic_os=proelf
;;
pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
pbd)
- basic_machine=sparc-tti
+ cpu=sparc
+ vendor=tti
;;
pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ cpu=m68k
+ vendor=tti
;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ pc532)
+ cpu=ns32k
+ vendor=pc532
;;
pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little)
- basic_machine=powerpc64le-unknown
+ cpu=pn
+ vendor=gould
;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ power)
+ cpu=power
+ vendor=ibm
;;
ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
+ cpu=i386
+ vendor=ibm
;;
rm[46]00)
- basic_machine=mips-siemens
+ cpu=mips
+ vendor=siemens
;;
rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
+ cpu=romp
+ vendor=ibm
;;
sde)
- basic_machine=mipsisa32-sde
- os=-elf
+ cpu=mipsisa32
+ vendor=sde
+ basic_os=${basic_os:-elf}
;;
- sei)
- basic_machine=mips-sei
- os=-seiux
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ basic_os=vxworks
;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
;;
- sh5el)
- basic_machine=sh5le-unknown
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
;;
- sh64)
- basic_machine=sh64-unknown
+ w65)
+ cpu=w65
+ vendor=wdc
;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ basic_os=proelf
;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
+ none)
+ cpu=none
+ vendor=none
;;
- spur)
- basic_machine=spur-unknown
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
;;
- st2000)
- basic_machine=m68k-tandem
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=`echo "$basic_machine" | sed 's/-.*//'`
;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
+
+ *-*)
+ # shellcheck disable=SC2162
+ IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ cpu=$basic_machine
+ vendor=pc
;;
- sun2)
- basic_machine=m68000-sun
+ # These rules are duplicated from below for sake of the special case above;
+ # i.e. things that normalized to x86 arches should also default to "pc"
+ pc98)
+ cpu=i386
+ vendor=pc
;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
+ x64 | amd64)
+ cpu=x86_64
+ vendor=pc
;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
+ # Recognize the basic CPU types without company name.
+ *)
+ cpu=$basic_machine
+ vendor=unknown
;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+ basic_os=${basic_os:-unicosmp}
;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
+ c90-unknown | c90-cray)
+ vendor=cray
+ basic_os=${Basic_os:-unicos}
;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
+ fx80-unknown)
+ vendor=alliant
;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
+ romp-unknown)
+ vendor=ibm
;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
+ mmix-unknown)
+ vendor=knuth
;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
+ microblaze-unknown | microblazeel-unknown)
+ vendor=xilinx
;;
- sun4)
- basic_machine=sparc-sun
+ rs6000-unknown)
+ vendor=ibm
;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
+ vax-unknown)
+ vendor=dec
;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
+ pdp11-unknown)
+ vendor=dec
;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
+ we32k-unknown)
+ vendor=att
;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
+ cydra-unknown)
+ vendor=cydrome
;;
- t90)
- basic_machine=t90-cray
- os=-unicos
+ i370-ibm*)
+ vendor=ibm
;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
+ orion-unknown)
+ vendor=highlevel
;;
- tx39)
- basic_machine=mipstx39-unknown
+ xps-unknown | xps100-unknown)
+ cpu=xps100
+ vendor=honeywell
;;
- tx39el)
- basic_machine=mipstx39el-unknown
+
+ # Here we normalize CPU types with a missing or matching vendor
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+ basic_os=${basic_os:-bosx}
;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
+
+ # Here we normalize CPU types irrespective of the vendor
+ amd64-*)
+ cpu=x86_64
;;
- tower | tower-32)
- basic_machine=m68k-ncr
+ blackfin-*)
+ cpu=bfin
+ basic_os=linux
;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
+ c54x-*)
+ cpu=tic54x
;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
+ c55x-*)
+ cpu=tic55x
;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
+ c6x-*)
+ cpu=tic6x
;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
+ e500v[12]-*)
+ cpu=powerpc
+ basic_os=${basic_os}"spe"
;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
+ mips3*-*)
+ cpu=mips64
;;
- vms)
- basic_machine=vax-dec
- os=-vms
+ ms1-*)
+ cpu=mt
;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
+ m68knommu-*)
+ cpu=m68k
+ basic_os=linux
;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
+ openrisc-*)
+ cpu=or32
;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
+ parisc-*)
+ cpu=hppa
+ basic_os=linux
;;
- wasm32)
- basic_machine=wasm32-unknown
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
;;
- w65*)
- basic_machine=w65-wdc
- os=-none
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ cpu=i686
;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ cpu=i686
;;
- x64)
- basic_machine=x86_64-pc
+ pentium4-*)
+ cpu=i786
;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
+ pc98-*)
+ cpu=i386
;;
- xps | xps100)
- basic_machine=xps100-honeywell
+ ppc-* | ppcbe-*)
+ cpu=powerpc
;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ppcle-* | powerpclittle-*)
+ cpu=powerpcle
;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
+ ppc64-*)
+ cpu=powerpc64
;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
+ ppc64le-* | powerpc64little-*)
+ cpu=powerpc64le
;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
+ sb1-*)
+ cpu=mipsisa64sb1
;;
- none)
- basic_machine=none-none
- os=-none
+ sb1el-*)
+ cpu=mipsisa64sb1el
;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
+ sh5e[lb]-*)
+ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
;;
- op50n)
- basic_machine=hppa1.1-oki
+ spur-*)
+ cpu=spur
;;
- op60c)
- basic_machine=hppa1.1-oki
+ strongarm-* | thumb-*)
+ cpu=arm
;;
- romp)
- basic_machine=romp-ibm
+ tx39-*)
+ cpu=mipstx39
;;
- mmix)
- basic_machine=mmix-knuth
+ tx39el-*)
+ cpu=mipstx39el
;;
- rs6000)
- basic_machine=rs6000-ibm
+ x64-*)
+ cpu=x86_64
;;
- vax)
- basic_machine=vax-dec
+ xscale-* | xscalee[bl]-*)
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
+
+ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+ basic_os=${basic_os:-elf}
;;
- pdp11)
- basic_machine=pdp11-dec
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+ vendor=axis
;;
- we32k)
- basic_machine=we32k-att
+ cris-* | etrax*-*)
+ cpu=cris
+ vendor=axis
;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
+ crx-*)
+ basic_os=${basic_os:-elf}
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
+ neo-tandem)
+ cpu=neo
+ vendor=tandem
;;
- cydra)
- basic_machine=cydra-cydrome
+ nse-tandem)
+ cpu=nse
+ vendor=tandem
;;
- orion)
- basic_machine=orion-highlevel
+ nsr-tandem)
+ cpu=nsr
+ vendor=tandem
;;
- orion105)
- basic_machine=clipper-highlevel
+ nsv-tandem)
+ cpu=nsv
+ vendor=tandem
;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
+ nsx-tandem)
+ cpu=nsx
+ vendor=tandem
;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
+ mipsallegrexel-sony)
+ cpu=mipsallegrexel
+ vendor=sony
;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
+ tile*-*)
+ basic_os=${basic_os:-linux-gnu}
;;
+
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | abacus \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+ | arc | arceb \
+ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | elxsi | epiphany \
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | h8300 | h8500 \
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64eb | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mmix \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
+ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+ | riscv | riscv32 | riscv64 \
+ | rl78 | romp | rs6000 | rx \
+ | s390 | s390x \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | visium \
+ | w65 \
+ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+ | ymp \
+ | z8k | z80)
+ ;;
+
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+ digital*)
+ vendor=dec
;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ commodore*)
+ vendor=cbm
;;
*)
;;
@@ -1363,203 +1275,215 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x"$os" != x"" ]
+if [ x$basic_os != x ]
then
+
+# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'`
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'`
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ IFS="-" read kernel os <<EOF
+$basic_os
+EOF
+ ;;
+ # Default OS when just kernel was specified
+ nto*)
+ kernel=nto
+ os=`echo $basic_os | sed -e 's|nto|qnx|'`
+ ;;
+ linux*)
+ kernel=linux
+ os=`echo $basic_os | sed -e 's|linux|gnu|'`
+ ;;
+ *)
+ kernel=
+ os=$basic_os
+ ;;
+esac
+
+# Now, normalize the OS (knowing we just have one component, it's not a kernel,
+# etc.)
case $os in
# First match some system type aliases that might get confused
# with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ # solaris* is a basic system type, with this one exception.
+ auroraux)
+ os=auroraux
;;
- -solaris1 | -solaris1.*)
+ bluegene*)
+ os=cnk
+ ;;
+ solaris1 | solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
- -solaris)
- os=-solaris2
+ solaris)
+ os=solaris2
;;
- -svr4*)
- os=-sysv4
+ unixware*)
+ os=sysv4.2uw
;;
- -unixware*)
- os=-sysv4.2uw
+ # es1800 is here to avoid being matched by es* (a different OS)
+ es1800*)
+ os=ose
;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ # Some version numbers need modification
+ chorusos*)
+ os=chorusos
;;
- # Now accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST end in a * to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* | -cloudabi* | -sortix* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ isc)
+ os=isc2.2
;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ sco6)
+ os=sco5v6
;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
+ sco5)
+ os=sco3.2v5
;;
- -linux-dietlibc)
- os=-linux-dietlibc
+ sco4)
+ os=sco3.2v4
;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ sco*v* | scout)
+ # Don't match below
;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ sco*)
+ os=sco3.2v2
;;
- -opened*)
- os=-openedition
+ psos*)
+ os=psos
;;
- -os400*)
- os=-os400
+ qnx*)
+ case $cpu in
+ x86 | i*86)
+ ;;
+ *)
+ os=nto-$os
+ ;;
+ esac
;;
- -wince*)
- os=-wince
+ hiux*)
+ os=hiuxwe2
;;
- -osfrose*)
- os=-osfrose
+ lynx*178)
+ os=lynxos178
;;
- -osf*)
- os=-osf
+ lynx*5)
+ os=lynxos5
;;
- -utek*)
- os=-bsd
+ lynxos*)
+ # don't get caught up in next wildcard
;;
- -dynix*)
- os=-bsd
+ lynx*)
+ os=lynxos
;;
- -acis*)
- os=-aos
+ mac[0-9]*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
;;
- -atheos*)
- os=-atheos
+ opened*)
+ os=openedition
;;
- -syllable*)
- os=-syllable
+ os400*)
+ os=os400
;;
- -386bsd)
- os=-bsd
+ sunos5*)
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
;;
- -ctix* | -uts*)
- os=-sysv
+ sunos6*)
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
;;
- -nova*)
- os=-rtmk-nova
+ wince*)
+ os=wince
;;
- -ns2 )
- os=-nextstep2
+ utek*)
+ os=bsd
;;
- -nsk*)
- os=-nsk
+ dynix*)
+ os=bsd
;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
+ acis*)
+ os=aos
;;
- -sinix*)
- os=-sysv4
+ atheos*)
+ os=atheos
;;
- -tpf*)
- os=-tpf
+ syllable*)
+ os=syllable
;;
- -triton*)
- os=-sysv3
+ 386bsd)
+ os=bsd
;;
- -oss*)
- os=-sysv3
+ ctix* | uts*)
+ os=sysv
;;
- -svr4)
- os=-sysv4
+ nova*)
+ os=rtmk-nova
;;
- -svr3)
- os=-sysv3
+ ns2)
+ os=nextstep2
;;
- -sysvr4)
- os=-sysv4
+ # Preserve the version number of sinix5.
+ sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
;;
- # This must come after -sysvr4.
- -sysv*)
+ sinix*)
+ os=sysv4
;;
- -ose*)
- os=-ose
+ tpf*)
+ os=tpf
;;
- -es1800*)
- os=-ose
+ triton*)
+ os=sysv3
;;
- -xenix)
- os=-xenix
+ oss*)
+ os=sysv3
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ svr4*)
+ os=sysv4
;;
- -aros*)
- os=-aros
+ svr3)
+ os=sysv3
;;
- -zvmoe)
- os=-zvmoe
+ sysvr4)
+ os=sysv4
;;
- -dicos*)
- os=-dicos
+ ose*)
+ os=ose
;;
- -nacl*)
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ os=mint
;;
- -ios)
+ dicos*)
+ os=dicos
;;
- -none)
+ pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $cpu in
+ arm*)
+ os=eabi
+ ;;
+ *)
+ os=elf
+ ;;
+ esac
;;
*)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
+ # No normalization, but not necessarily accepted, that comes below.
;;
esac
+
else
# Here we handle the default operating systems that come with various machines.
@@ -1572,264 +1496,352 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
-case $basic_machine in
+kernel=
+case $cpu-$vendor in
score-*)
- os=-elf
+ os=elf
;;
spu-*)
- os=-elf
+ os=elf
;;
*-acorn)
- os=-riscix1.2
+ os=riscix1.2
;;
arm*-rebel)
- os=-linux
+ kernel=linux
+ os=gnu
;;
arm*-semi)
- os=-aout
+ os=aout
;;
c4x-* | tic4x-*)
- os=-coff
+ os=coff
;;
c8051-*)
- os=-elf
+ os=elf
+ ;;
+ clipper-intergraph)
+ os=clix
;;
hexagon-*)
- os=-elf
+ os=elf
;;
tic54x-*)
- os=-coff
+ os=coff
;;
tic55x-*)
- os=-coff
+ os=coff
;;
tic6x-*)
- os=-coff
+ os=coff
;;
# This must come before the *-dec entry.
pdp10-*)
- os=-tops20
+ os=tops20
;;
pdp11-*)
- os=-none
+ os=none
;;
*-dec | vax-*)
- os=-ultrix4.2
+ os=ultrix4.2
;;
m68*-apollo)
- os=-domain
+ os=domain
;;
i386-sun)
- os=-sunos4.0.2
+ os=sunos4.0.2
;;
m68000-sun)
- os=-sunos3
+ os=sunos3
;;
m68*-cisco)
- os=-aout
+ os=aout
;;
mep-*)
- os=-elf
+ os=elf
;;
mips*-cisco)
- os=-elf
+ os=elf
;;
mips*-*)
- os=-elf
+ os=elf
;;
or32-*)
- os=-coff
+ os=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
+ os=sysv3
;;
sparc-* | *-sun)
- os=-sunos4.1.1
+ os=sunos4.1.1
;;
pru-*)
- os=-elf
+ os=elf
;;
*-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
+ os=beos
;;
*-ibm)
- os=-aix
+ os=aix
;;
*-knuth)
- os=-mmixware
+ os=mmixware
;;
*-wec)
- os=-proelf
+ os=proelf
;;
*-winbond)
- os=-proelf
+ os=proelf
;;
*-oki)
- os=-proelf
+ os=proelf
;;
*-hp)
- os=-hpux
+ os=hpux
;;
*-hitachi)
- os=-hiux
+ os=hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
+ os=sysv
;;
*-cbm)
- os=-amigaos
+ os=amigaos
;;
*-dg)
- os=-dgux
+ os=dgux
;;
*-dolphin)
- os=-sysv3
+ os=sysv3
;;
m68k-ccur)
- os=-rtu
+ os=rtu
;;
m88k-omron*)
- os=-luna
+ os=luna
;;
- *-next )
- os=-nextstep
+ *-next)
+ os=nextstep
;;
*-sequent)
- os=-ptx
+ os=ptx
;;
*-crds)
- os=-unos
+ os=unos
;;
*-ns)
- os=-genix
+ os=genix
;;
i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
+ os=mvs
;;
*-gould)
- os=-sysv
+ os=sysv
;;
*-highlevel)
- os=-bsd
+ os=bsd
;;
*-encore)
- os=-bsd
+ os=bsd
;;
*-sgi)
- os=-irix
+ os=irix
;;
*-siemens)
- os=-sysv4
+ os=sysv4
;;
*-masscomp)
- os=-rtu
+ os=rtu
;;
f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
+ os=uxpv
;;
*-rom68k)
- os=-coff
+ os=coff
;;
*-*bug)
- os=-coff
+ os=coff
;;
*-apple)
- os=-macos
+ os=macos
;;
*-atari*)
- os=-mint
+ os=mint
+ ;;
+ *-wrs)
+ os=vxworks
;;
*)
- os=-none
+ os=none
;;
esac
+
fi
+# Now, validate our (potentially fixed-up) OS.
+case $os in
+ # Sometimes we do "kernel-abi", so those need to count as OSes.
+ musl* | newlib* | uclibc*)
+ ;;
+ # Likewise for "kernel-libc"
+ eabi | eabihf | gnueabi | gnueabihf)
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
+ | hiux* | abug | nacl* | netware* | windows* \
+ | os9* | macos* | osx* | ios* \
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* \
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | mint* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix* | genode* | zvmoe* )
+ ;;
+ # This one is extra strict with allowed versions
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ none)
+ ;;
+ *)
+ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 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-uclibc* )
+ ;;
+ -dietlibc* | -newlib* | -musl* | -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
+ exit 1
+ ;;
+ kfreebsd*-gnu* | kopensolaris*-gnu*)
+ ;;
+ nto-qnx*)
+ ;;
+ *-eabi* | *-gnueabi*)
+ ;;
+ -*)
+ # Blank kernel with real OS is always fine.
+ ;;
+ *-*)
+ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+ exit 1
+ ;;
+esac
+
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
+case $vendor in
+ unknown)
+ case $cpu-$os in
+ *-riscix*)
vendor=acorn
;;
- -sunos*)
+ *-sunos*)
vendor=sun
;;
- -cnk*|-aix*)
+ *-cnk* | *-aix*)
vendor=ibm
;;
- -beos*)
+ *-beos*)
vendor=be
;;
- -hpux*)
+ *-hpux*)
vendor=hp
;;
- -mpeix*)
+ *-mpeix*)
vendor=hp
;;
- -hiux*)
+ *-hiux*)
vendor=hitachi
;;
- -unos*)
+ *-unos*)
vendor=crds
;;
- -dgux*)
+ *-dgux*)
vendor=dg
;;
- -luna*)
+ *-luna*)
vendor=omron
;;
- -genix*)
+ *-genix*)
vendor=ns
;;
- -mvs* | -opened*)
+ *-clix*)
+ vendor=intergraph
+ ;;
+ *-mvs* | *-opened*)
+ vendor=ibm
+ ;;
+ *-os400*)
vendor=ibm
;;
- -os400*)
+ s390-* | s390x-*)
vendor=ibm
;;
- -ptx*)
+ *-ptx*)
vendor=sequent
;;
- -tpf*)
+ *-tpf*)
vendor=ibm
;;
- -vxsim* | -vxworks* | -windiss*)
+ *-vxsim* | *-vxworks* | *-windiss*)
vendor=wrs
;;
- -aux*)
+ *-aux*)
vendor=apple
;;
- -hms*)
+ *-hms*)
vendor=hitachi
;;
- -mpw* | -macos*)
+ *-mpw* | *-macos*)
vendor=apple
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
vendor=atari
;;
- -vos*)
+ *-vos*)
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 76b5de65..dec8eb9a 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,9 +2,9 @@
# gendocs.sh -- generate a GNU manual in many formats. This script is
# mentioned in maintain.texi. See the help message below for usage details.
-scriptversion=2017-09-12.23
+scriptversion=2020-01-01.00
-# Copyright 2003-2017 Free Software Foundation, Inc.
+# Copyright 2003-2020 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -59,6 +59,7 @@ commonarg= # passed to all makeinfo/texi2html invcations.
dirargs= # passed to all tools (-I dir).
dirs= # -I directories.
htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
+default_htmlarg=true
infoarg=--no-split
generate_ascii=true
generate_html=true
@@ -72,7 +73,7 @@ texarg="-t @finalout"
version="gendocs.sh $scriptversion
-Copyright 2017 Free Software Foundation, Inc.
+Copyright 2020 Free Software Foundation, Inc.
There is NO warranty. You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
@@ -163,7 +164,7 @@ while test $# -gt 0; do
--common) shift; commonarg=$1;;
--docbook) docbook=yes;;
--email) shift; EMAIL=$1;;
- --html) shift; htmlarg=$1;;
+ --html) shift; default_htmlarg=false; htmlarg=$1;;
--info) shift; infoarg=$1;;
--no-ascii) generate_ascii=false;;
--no-html) generate_ascii=false;;
@@ -199,6 +200,11 @@ commonarg=" $dirargs $commonarg"
# For most of the following, the base name is just $PACKAGE
base=$PACKAGE
+if $default_htmlarg && test -n "$use_texi2html"; then
+ # The legacy texi2html doesn't support TOP_NODE_UP_URL
+ htmlarg="--css-ref=/software/gnulib/manual.css"
+fi
+
if test -n "$srcfile"; then
# but here, we use the basename of $srcfile
base=`basename "$srcfile"`
@@ -497,7 +503,7 @@ $GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
echo "Done, see $outdir/ subdirectory for new files."
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 0e254f4b..f4e85924 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -1,8 +1,8 @@
#!/bin/sh
# Print a version string.
-scriptversion=2017-09-13.06; # UTC
+scriptversion=2019-10-13.15; # UTC
-# Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# Copyright (C) 2007-2020 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -72,9 +72,10 @@ scriptversion=2017-09-13.06; # UTC
me=$0
+year=`expr "$scriptversion" : '\([^-]*\)'`
version="git-version-gen $scriptversion
-Copyright 2011 Free Software Foundation, Inc.
+Copyright $year Free Software Foundation, Inc.
There is NO warranty. You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
@@ -141,11 +142,9 @@ then
v=`cat $tarball_version_file` || v=
case $v in
*$nl*) v= ;; # reject multi-line output
- [0-9]*) ;;
- *) v= ;;
esac
test "x$v" = x \
- && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
+ && echo "$0: WARNING: $tarball_version_file is damaged" 1>&2
fi
if test "x$v" != x
@@ -219,7 +218,7 @@ fi
printf %s "$v"
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 3c94bd56..be8082e7 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -1,31 +1,46 @@
-eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
- & eval 'exec perl -wS "$0" $argv:q'
- if 0;
-# Convert git log output to ChangeLog format.
-
-my $VERSION = '2017-09-13 06:45'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job. Otherwise, update this string manually.
+#!/bin/sh
+#! -*-perl-*-
-# Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# Convert git log output to ChangeLog format.
+# Copyright (C) 2008-2020 Free Software Foundation, Inc.
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
+#
# Written by Jim Meyering
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line. The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name. The second line is essential for perl and is
+# also useful for editing this file in Emacs. The next two lines below
+# are valid code in both sh and perl. When executed by sh, they re-execute
+# the script through the perl program found in $PATH. The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh. When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx "$0" "$@"'
+ if 0;
+
+my $VERSION = '2020-04-04 15:07'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
use strict;
use warnings;
use Getopt::Long;
@@ -174,7 +189,7 @@ sub parse_amend_file($)
if (!$in_code)
{
- $line =~ /^([0-9a-fA-F]{40})$/
+ $line =~ /^([[:xdigit:]]{40})$/
or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
$fail = 1, next;
$sha = lc $1;
@@ -288,7 +303,7 @@ sub git_dir_option($)
my ($sha, $rest) = split ':', $log, 2;
defined $sha
or die "$ME:$.: malformed log entry\n";
- $sha =~ /^[0-9a-fA-F]{40}$/
+ $sha =~ /^[[:xdigit:]]{40}$/
or die "$ME:$.: invalid SHA1: $sha\n";
my $skipflag = 0;
@@ -376,7 +391,7 @@ sub git_dir_option($)
@skipshas = ();
next;
}
- if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
+ if ($found && $_ =~ /^([[:xdigit:]]{7,}) [^ ]/)
{
push ( @skipshas, $1 );
}
@@ -491,7 +506,8 @@ sub git_dir_option($)
# Local Variables:
# mode: perl
# indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-line-limit: 50
# time-stamp-start: "my $VERSION = '"
# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
# time-stamp-time-zone: "UTC0"
diff --git a/build-aux/gnupload b/build-aux/gnupload
index ba781a16..fb873348 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -1,9 +1,9 @@
#!/bin/sh
# Sign files and upload them.
-scriptversion=2017-09-13.06; # UTC
+scriptversion=2018-05-19.18; # UTC
-# Copyright (C) 2004-2017 Free Software Foundation, Inc.
+# Copyright (C) 2004-2020 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,7 +24,30 @@ scriptversion=2017-09-13.06; # UTC
set -e
-GPG='gpg --batch --no-tty'
+GPG=gpg
+# Choose the proper version of gpg, so as to avoid a
+# "gpg-agent is not available in this session" error
+# when gpg-agent is version 2 but gpg is still version 1.
+# FIXME-2020: remove, once all major distros ship gpg version 2 as /usr/bin/gpg
+gpg_agent_version=`(gpg-agent --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
+case "$gpg_agent_version" in
+ 2.*)
+ gpg_version=`(gpg --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
+ case "$gpg_version" in
+ 1.*)
+ if (type gpg2) >/dev/null 2>/dev/null; then
+ # gpg2 is present.
+ GPG=gpg2
+ else
+ # gpg2 is missing. Ubuntu users should install the package 'gnupg2'.
+ echo "WARNING: Using 'gpg', which is too old. You should install 'gpg2'." 1>&2
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+GPG="${GPG} --batch --no-tty"
conffile=.gnuploadrc
to=
dry_run=false
@@ -54,10 +77,10 @@ Options:
--user NAME sign with key NAME
--replace allow replacements of existing files
--symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names
- --dry-run do nothing, show what would have been done
+ -n, --dry-run do nothing, show what would have been done
(including the constructed directive file)
--version output version information and exit
- --help print this help text and exit
+ -h, --help print this help text and exit
If --symlink-regex is given without EXPR, then the link target name
is created by replacing the version information with '-latest', e.g.:
@@ -93,12 +116,22 @@ Examples:
--symlink-regex \\
foobar-1.0.tar.gz foobar-1.0.tar.xz
-4. Upload foobar-0.9.90.tar.gz to two sites:
+4. Create a symbolic link foobar-latest.tar.gz -> foobar-1.0.tar.gz
+ and likewise for the corresponding .sig file:
+ gnupload --to ftp.gnu.org:foobar \\
+ --symlink foobar-1.0.tar.gz foobar-latest.tar.gz \\
+ foobar-1.0.tar.gz.sig foobar-latest.tar.gz.sig
+ or (equivalent):
+ gnupload --to ftp.gnu.org:foobar \\
+ --symlink foobar-1.0.tar.gz foobar-latest.tar.gz \\
+ --symlink foobar-1.0.tar.gz.sig foobar-latest.tar.gz.sig
+
+5. Upload foobar-0.9.90.tar.gz to two sites:
gnupload --to alpha.gnu.org:foobar \\
--to sources.redhat.com:~ftp/pub/foobar \\
foobar-0.9.90.tar.gz
-5. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
+6. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
(the -- terminates the list of files to delete):
gnupload --to alpha.gnu.org:foobar \\
--to sources.redhat.com:~ftp/pub/foobar \\
@@ -125,7 +158,7 @@ while test -n "$1"; do
-*)
collect_var=
case $1 in
- --help)
+ -h | --help)
echo "$usage"
exit $?
;;
@@ -171,7 +204,7 @@ while test -n "$1"; do
--symlink)
collect_var=symlink_files
;;
- --dry-run|-n)
+ -n | --dry-run)
dry_run=:
;;
--version)
@@ -432,7 +465,7 @@ done
exit 0
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
diff --git a/build-aux/move-if-change b/build-aux/move-if-change
index 4a651455..653dc981 100755
--- a/build-aux/move-if-change
+++ b/build-aux/move-if-change
@@ -2,13 +2,13 @@
# Like mv $1 $2, but if the files are the same, just delete $1.
# Status is zero if successful, nonzero otherwise.
-VERSION='2017-09-13 06:45'; # UTC
+VERSION='2018-03-07 03:47'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually.
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -36,9 +36,10 @@ The variable CMPPROG can be used to specify an alternative to 'cmp'.
Report bugs to <bug-gnulib@gnu.org>."
+year=`expr "$VERSION" : '\([^-]*\)'`
version=`expr "$VERSION" : '\([^ ]*\)'`
version="move-if-change (gnulib) $version
-Copyright (C) 2011 Free Software Foundation, Inc.
+Copyright $year Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
@@ -75,7 +76,7 @@ else
fi
## Local Variables:
-## eval: (add-hook 'write-file-hooks 'time-stamp)
+## eval: (add-hook 'before-save-hook 'time-stamp)
## time-stamp-start: "VERSION='"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-time-zone: "UTC0"
diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex
index 9bd75b91..d3136db3 100644
--- a/build-aux/texinfo.tex
+++ b/build-aux/texinfo.tex
@@ -1,14 +1,11 @@
% texinfo.tex -- TeX macros to handle Texinfo files.
-%
+%
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2017-09-16.10}
+\def\texinfoversion{2020-05-22.11}
%
-% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
-% Free Software Foundation, Inc.
+% Copyright 1985, 1986, 1988, 1990-2020 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
@@ -36,7 +33,7 @@
% The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check.
%
-% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% Send bug reports to bug-texinfo@gnu.org. Please include a
% complete document in each bug report with which we can reproduce the
% problem. Patches are, of course, greatly appreciated.
%
@@ -221,7 +218,7 @@
% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
% aren't perfect, it's not the end of the world, being an error message,
% after all.
-%
+%
\def\errormsg{\begingroup \indexnofonts \doerrormsg}
\def\doerrormsg#1{\errmessage{#1}}
@@ -244,17 +241,7 @@
%
\def\finalout{\overfullrule=0pt }
-% Do @cropmarks to get crop marks.
-%
-\newif\ifcropmarks
-\let\cropmarks = \cropmarkstrue
-%
-% Dimensions to add cropmarks at corners.
-% Added by P. A. MacKay, 12 Nov. 1986
-%
\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
-\newdimen\cornerlong \cornerlong=1pc
-\newdimen\cornerthick \cornerthick=.3pt
\newdimen\topandbottommargin \topandbottommargin=.75in
% Output a mark which sets \thischapter, \thissection and \thiscolor.
@@ -270,8 +257,8 @@
% \domark is called twice inside \chapmacro, to add one
% mark before the section break, and one after.
-% In the second call \prevchapterdefs is the same as \lastchapterdefs,
-% and \prevsectiondefs is the same as \lastsectiondefs.
+% In the second call \prevchapterdefs is the same as \currentchapterdefs,
+% and \prevsectiondefs is the same as \currentsectiondefs.
% Then if the page is not broken at the mark, some of the previous
% section appears on the page, and we can get the name of this section
% from \firstmark for @everyheadingmarks top.
@@ -279,11 +266,11 @@
%
% See page 260 of The TeXbook.
\def\domark{%
- \toks0=\expandafter{\lastchapterdefs}%
- \toks2=\expandafter{\lastsectiondefs}%
+ \toks0=\expandafter{\currentchapterdefs}%
+ \toks2=\expandafter{\currentsectiondefs}%
\toks4=\expandafter{\prevchapterdefs}%
\toks6=\expandafter{\prevsectiondefs}%
- \toks8=\expandafter{\lastcolordefs}%
+ \toks8=\expandafter{\currentcolordefs}%
\mark{%
\the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
\noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
@@ -300,19 +287,19 @@
% @setcolor (or @url, or @link, etc.) between @contents and the very
% first @chapter.
\def\gettopheadingmarks{%
- \ifcase0\topmark\fi
+ \ifcase0\the\savedtopmark\fi
\ifx\thischapter\empty \ifcase0\firstmark\fi \fi
}
\def\getbottomheadingmarks{\ifcase1\botmark\fi}
-\def\getcolormarks{\ifcase2\topmark\fi}
+\def\getcolormarks{\ifcase2\the\savedtopmark\fi}
% Avoid "undefined control sequence" errors.
-\def\lastchapterdefs{}
-\def\lastsectiondefs{}
-\def\lastsection{}
+\def\currentchapterdefs{}
+\def\currentsectiondefs{}
+\def\currentsection{}
\def\prevchapterdefs{}
\def\prevsectiondefs{}
-\def\lastcolordefs{}
+\def\currentcolordefs{}
% Margin to add to right of even pages, to left of odd pages.
\newdimen\bindingoffset
@@ -322,51 +309,61 @@
% Main output routine.
%
\chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
+\newtoks\defaultoutput
+\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
+\output=\expandafter{\the\defaultoutput}
\newbox\headlinebox
\newbox\footlinebox
+% When outputting the double column layout for indices, an output routine
+% is run several times, which hides the original value of \topmark. This
+% can lead to a page heading being output and duplicating the chapter heading
+% of the index. Hence, save the contents of \topmark at the beginning of
+% the output routine. The saved contents are valid until we actually
+% \shipout a page.
+%
+% (We used to run a short output routine to actually set \topmark and
+% \firstmark to the right values, but if this was called with an empty page
+% containing whatsits for writing index entries, the whatsits would be thrown
+% away and the index auxiliary file would remain empty.)
+%
+\newtoks\savedtopmark
+\newif\iftopmarksaved
+\topmarksavedtrue
+\def\savetopmark{%
+ \iftopmarksaved\else
+ \global\savedtopmark=\expandafter{\topmark}%
+ \global\topmarksavedtrue
+ \fi
+}
+
% \onepageout takes a vbox as an argument.
-% \shipout a vbox for a single page, adding an optional header, footer,
-% cropmarks, and footnote. This also causes index entries for this page
-% to be written to the auxiliary files.
+% \shipout a vbox for a single page, adding an optional header, footer
+% and footnote. This also causes index entries for this page to be written
+% to the auxiliary files.
%
\def\onepageout#1{%
- \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ \hoffset=\normaloffset
%
\ifodd\pageno \advance\hoffset by \bindingoffset
\else \advance\hoffset by -\bindingoffset\fi
%
- % Common context changes for both heading and footing.
- % Do this outside of the \shipout so @code etc. will be expanded in
- % the headline as they should be, not taken literally (outputting ''code).
- \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
+ \checkchapterpage
%
% Retrieve the information for the headings from the marks in the page,
% and call Plain TeX's \makeheadline and \makefootline, which use the
% values in \headline and \footline.
%
- % This is used to check if we are on the first page of a chapter.
- \ifcase1\topmark\fi
- \let\prevchaptername\thischaptername
- \ifcase0\firstmark\fi
- \let\curchaptername\thischaptername
+ % Common context changes for both heading and footing.
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
%
\ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+ \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
\ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
- %
- \ifx\curchaptername\prevchaptername
- \let\thischapterheading\thischapter
- \else
- % \thischapterheading is the same as \thischapter except it is blank
- % for the first page of a chapter. This is to prevent the chapter name
- % being shown twice.
- \def\thischapterheading{}%
- \fi
- %
- \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
- \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
+ \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
%
{%
% Set context for writing to auxiliary files like index files.
@@ -374,37 +371,12 @@
% take effect in \write's, yet the group defined by the \vbox ends
% before the \shipout runs.
%
- \indexdummies % don't expand commands in the output.
- \normalturnoffactive % \ in index entries must not stay \, e.g., if
- % the page break happens to be in the middle of an example.
- % We don't want .vr (or whatever) entries like this:
- % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}}
- % "\acronym" won't work when it's read back in;
- % it needs to be
- % {\code {{\backslashcurfont }acronym}
+ \atdummies % don't expand commands in the output.
+ \turnoffactive
\shipout\vbox{%
% Do this early so pdf references go to the beginning of the page.
\ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
%
- \ifcropmarks \vbox to \outervsize\bgroup
- \hsize = \outerhsize
- \vskip-\topandbottommargin
- \vtop to0pt{%
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
- \vss}%
- \vskip\topandbottommargin
- \line\bgroup
- \hfil % center the page within the outer (page) hsize.
- \ifodd\pageno\hskip\bindingoffset\fi
- \vbox\bgroup
- \fi
- %
\unvbox\headlinebox
\pagebody{#1}%
\ifdim\ht\footlinebox > 0pt
@@ -415,24 +387,9 @@
\unvbox\footlinebox
\fi
%
- \ifcropmarks
- \egroup % end of \vbox\bgroup
- \hfil\egroup % end of (centering) \line\bgroup
- \vskip\topandbottommargin plus1fill minus1fill
- \boxmaxdepth = \cornerthick
- \vbox to0pt{\vss
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
- }%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
- }%
- \egroup % \vbox from first cropmarks clause
- \fi
- }% end of \shipout\vbox
- }% end of group with \indexdummies
+ }%
+ }%
+ \global\topmarksavedfalse
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
@@ -451,17 +408,22 @@
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}
-% Here are the rules for the cropmarks. Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
+% Check if we are on the first page of a chapter. Used for printing headings.
+\newif\ifchapterpage
+\def\checkchapterpage{%
+ % Get the chapter that was current at the end of the last page
+ \ifcase1\the\savedtopmark\fi
+ \let\prevchaptername\thischaptername
+ %
+ \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+ \let\curchaptername\thischaptername
+ %
+ \ifx\curchaptername\prevchaptername
+ \chapterpagefalse
+ \else
+ \chapterpagetrue
+ \fi
+}
% Argument parsing
@@ -487,11 +449,10 @@
}%
}
-% First remove any @comment, then any @c comment. Also remove a @texinfoc
-% comment (see \scanmacro for details). Pass the result on to \argcheckspaces.
+% First remove any @comment, then any @c comment. Pass the result on to
+% \argcheckspaces.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
-\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm}
-\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
%
@@ -1050,7 +1011,7 @@ where each line of input produces a line of output.}
\let\setfilename=\comment
% @bye.
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+\outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend}
\message{pdf,}
@@ -1092,7 +1053,7 @@ where each line of input produces a line of output.}
tex.sprint(
string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
string.char(0x5c) .. string.char(0x25) .. '03o',
- (c / 256), (c % 256)))
+ math.floor(c / 256), math.floor(c % 256)))
else
c = c - 0x10000
local c_hi = c / 1024 + 0xd800
@@ -1102,8 +1063,8 @@ where each line of input produces a line of output.}
string.char(0x5c) .. string.char(0x25) .. '03o' ..
string.char(0x5c) .. string.char(0x25) .. '03o' ..
string.char(0x5c) .. string.char(0x25) .. '03o',
- (c_hi / 256), (c_hi % 256),
- (c_lo / 256), (c_lo % 256)))
+ math.floor(c_hi / 256), math.floor(c_hi % 256),
+ math.floor(c_lo / 256), math.floor(c_lo % 256)))
end
end
end
@@ -1116,15 +1077,19 @@ where each line of input produces a line of output.}
function PDFescstr(str)
for c in string.bytes(str) do
if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
- tex.sprint(
+ tex.sprint(-2,
string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
c))
else
- tex.sprint(string.char(c))
+ tex.sprint(-2, string.char(c))
end
end
end
}
+ % The -2 in the arguments here gives all the input to TeX catcode 12
+ % (other) or 10 (space), preventing undefined control sequence errors. See
+ % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
+ %
\endgroup
\def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
\ifnum\luatexversion>84
@@ -1163,11 +1128,60 @@ where each line of input produces a line of output.}
\fi
\fi
+\newif\ifpdforxetex
+\pdforxetexfalse
+\ifpdf
+ \pdforxetextrue
+\fi
+\ifx\XeTeXrevision\thisisundefined\else
+ \pdforxetextrue
+\fi
+
+
+% Output page labels information.
+% See PDF reference v.1.7 p.594, section 8.3.1.
+\ifpdf
+\def\pagelabels{%
+ \def\title{0 << /P (T-) /S /D >>}%
+ \edef\roman{\the\romancount << /S /r >>}%
+ \edef\arabic{\the\arabiccount << /S /D >>}%
+ %
+ % Page label ranges must be increasing. Remove any duplicates.
+ % (There is a slight chance of this being wrong if e.g. there is
+ % a @contents but no @titlepage, etc.)
+ %
+ \ifnum\romancount=0 \def\roman{}\fi
+ \ifnum\arabiccount=0 \def\title{}%
+ \else
+ \ifnum\romancount=\arabiccount \def\roman{}\fi
+ \fi
+ %
+ \ifnum\romancount<\arabiccount
+ \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax
+ \else
+ \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax
+ \fi
+}
+\else
+ \let\pagelabels\relax
+\fi
+
+\newcount\pagecount \pagecount=0
+\newcount\romancount \romancount=0
+\newcount\arabiccount \arabiccount=0
+\ifpdf
+ \let\ptxadvancepageno\advancepageno
+ \def\advancepageno{%
+ \ptxadvancepageno\global\advance\pagecount by 1
+ }
+\fi
+
+
% PDF uses PostScript string constants for the names of xref targets,
% for display in the outlines, and in other places. Thus, we have to
% double any backslashes. Otherwise, a name like "\node" will be
% interpreted as a newline (\n), followed by o, d, e. Not good.
-%
+%
% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
% related messages. The final outcome is that it is up to the TeX user
% to double the backslashes and otherwise make the string valid, so
@@ -1219,7 +1233,7 @@ output) for that.)}
% Set color, and create a mark which defines \thiscolor accordingly,
% so that \makeheadline knows which color to restore.
\def\setcolor#1{%
- \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
\domark
\pdfsetcolor{#1}%
}
@@ -1227,7 +1241,7 @@ output) for that.)}
\def\maincolor{\rgbBlack}
\pdfsetcolor{\maincolor}
\edef\thiscolor{\maincolor}
- \def\lastcolordefs{}
+ \def\currentcolordefs{}
%
\def\makefootline{%
\baselineskip24pt
@@ -1453,7 +1467,13 @@ output) for that.)}
% subentries, which we calculated on our first read of the .toc above.
%
% We use the node names as the destinations.
+ %
+ % Currently we prefix the section name with the section number
+ % for chapter and appendix headings only in order to avoid too much
+ % horizontal space being required in the PDF viewer.
\def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+ \def\unnchapentry##1##2##3##4{%
\dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
\def\numsecentry##1##2##3##4{%
\dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
@@ -1472,7 +1492,7 @@ output) for that.)}
% their "best" equivalent, based on the @documentencoding. Too
% much work for too little return. Just use the ASCII equivalents
% we use for the index sort strings.
- %
+ %
\indexnofonts
\setupdatafile
% We can have normal brace characters in the PDF outlines, unlike
@@ -1528,6 +1548,9 @@ output) for that.)}
\startlink attr{/Border [0 0 0]}%
user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
\endgroup}
+ % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may
+ % be a simple number, or a list of numbers in the case of an index
+ % entry.
\def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
\def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
@@ -1602,7 +1625,7 @@ output) for that.)}
% Set color, and create a mark which defines \thiscolor accordingly,
% so that \makeheadline knows which color to restore.
\def\setcolor#1{%
- \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
\domark
\pdfsetcolor{#1}%
}
@@ -1610,7 +1633,7 @@ output) for that.)}
\def\maincolor{\rgbBlack}
\pdfsetcolor{\maincolor}
\edef\thiscolor{\maincolor}
- \def\lastcolordefs{}
+ \def\currentcolordefs{}
%
\def\makefootline{%
\baselineskip24pt
@@ -1692,9 +1715,13 @@ output) for that.)}
% Therefore, we read toc only once.
%
% We use node names as destinations.
+ %
+ % Currently we prefix the section name with the section number
+ % for chapter and appendix headings only in order to avoid too much
+ % horizontal space being required in the PDF viewer.
\def\partentry##1##2##3##4{}% ignore parts in the outlines
\def\numchapentry##1##2##3##4{%
- \dopdfoutline{##1}{1}{##3}{##4}}%
+ \dopdfoutline{##2 ##1}{1}{##3}{##4}}%
\def\numsecentry##1##2##3##4{%
\dopdfoutline{##1}{2}{##3}{##4}}%
\def\numsubsecentry##1##2##3##4{%
@@ -1706,7 +1733,8 @@ output) for that.)}
\let\appsecentry\numsecentry%
\let\appsubsecentry\numsubsecentry%
\let\appsubsubsecentry\numsubsubsecentry%
- \let\unnchapentry\numchapentry%
+ \def\unnchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{1}{##3}{##4}}%
\let\unnsecentry\numsecentry%
\let\unnsubsecentry\numsubsecentry%
\let\unnsubsubsecentry\numsubsubsecentry%
@@ -2202,7 +2230,7 @@ end
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstep1}{OT1}
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
-\setfont\defsl\slshape{10}{\magstep1}{OT1TT}
+\setfont\defsl\slshape{10}{\magstep1}{OT1}
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
\def\df{\let\ttfont=\deftt \let\bffont = \defbf
\let\ttslfont=\defttsl \let\slfont=\defsl \bf}
@@ -2235,6 +2263,20 @@ end
\font\smallersy=cmsy8
\def\smallerecsize{0800}
+% Fonts for math mode superscripts (7pt).
+\def\sevennominalsize{7pt}
+\setfont\sevenrm\rmshape{7}{1000}{OT1}
+\setfont\seventt\ttshape{10}{700}{OT1TT}
+\setfont\sevenbf\bfshape{10}{700}{OT1}
+\setfont\sevenit\itshape{7}{1000}{OT1IT}
+\setfont\sevensl\slshape{10}{700}{OT1}
+\setfont\sevensf\sfshape{10}{700}{OT1}
+\setfont\sevensc\scshape{10}{700}{OT1}
+\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+\font\seveni=cmmi7
+\font\sevensy=cmsy7
+\def\sevenecsize{0700}
+
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
@@ -2336,7 +2378,7 @@ end
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
-\setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
+\setfont\defsl\slshape{10}{\magstephalf}{OT1}
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
\def\df{\let\ttfont=\deftt \let\bffont = \defbf
\let\slfont=\defsl \let\ttslfont=\defttsl \bf}
@@ -2369,6 +2411,20 @@ end
\font\smallersy=cmsy8
\def\smallerecsize{0800}
+% Fonts for math mode superscripts (7pt).
+\def\sevennominalsize{7pt}
+\setfont\sevenrm\rmshape{7}{1000}{OT1}
+\setfont\seventt\ttshape{10}{700}{OT1TT}
+\setfont\sevenbf\bfshape{10}{700}{OT1}
+\setfont\sevenit\itshape{7}{1000}{OT1IT}
+\setfont\sevensl\slshape{10}{700}{OT1}
+\setfont\sevensf\sfshape{10}{700}{OT1}
+\setfont\sevensc\scshape{10}{700}{OT1}
+\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+\font\seveni=cmmi7
+\font\sevensy=cmsy7
+\def\sevenecsize{0700}
+
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
@@ -2491,7 +2547,7 @@ end
\def\it{\fam=\itfam \setfontstyle{it}}
\def\sl{\fam=\slfam \setfontstyle{sl}}
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
-\def\tt{\fam=\ttfam \setfontstyle{tt}}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt}
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf.
@@ -2503,13 +2559,20 @@ end
% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families. We don't
-% bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
+% we have to define the \textfont of the standard families.
+% We don't bother to reset \scriptscriptfont; awaiting user need.
%
\def\resetmathfonts{%
\textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
\textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
\textfont\ttfam=\ttfont \textfont\sffam=\sffont
+ %
+ % Fonts for superscript. Note that the 7pt fonts are used regardless
+ % of the current font size.
+ \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
+ \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
+ \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
+ \scriptfont\sffam=\sevensf
}
%
@@ -2519,6 +2582,9 @@ end
% to also set the current \fam for math mode. Our \STYLE (e.g., \rm)
% commands hardwire \STYLEfont to set the current font.
%
+% The fonts used for \ifont are for "math italics" (\itfont is for italics
+% in regular text). \syfont is also used in math mode only.
+%
% Each font-changing command also sets the names \lsize (one size lower)
% and \lllsize (three sizes lower). These relative commands are used
% in, e.g., the LaTeX logo and acronyms.
@@ -2619,26 +2685,11 @@ end
% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
% define and register \INITMACRO to be called on markup style changes.
% \INITMACRO can check \currentmarkupstyle for the innermost
-% style and the set of \ifmarkupSTYLE switches for all styles
-% currently in effect.
-\newif\ifmarkupvar
-\newif\ifmarkupsamp
-\newif\ifmarkupkey
-%\newif\ifmarkupfile % @file == @samp.
-%\newif\ifmarkupoption % @option == @samp.
-\newif\ifmarkupcode
-\newif\ifmarkupkbd
-%\newif\ifmarkupenv % @env == @code.
-%\newif\ifmarkupcommand % @command == @code.
-\newif\ifmarkuptex % @tex (and part of @math, for now).
-\newif\ifmarkupexample
-\newif\ifmarkupverb
-\newif\ifmarkupverbatim
+% style.
\let\currentmarkupstyle\empty
\def\setupmarkupstyle#1{%
- \csname markup#1true\endcsname
\def\currentmarkupstyle{#1}%
\markupstylesetup
}
@@ -2700,11 +2751,15 @@ end
% lilypond developers report. xpdf does work with the regular 0x27.
%
\def\codequoteright{%
- \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
- \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
- '%
+ \ifmonospace
+ \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else \char'15 \fi
\else \char'15 \fi
- \else \char'15 \fi
+ \else
+ '%
+ \fi
}
%
% and a similar option for the left quote char vs. a grave accent.
@@ -2712,17 +2767,21 @@ end
% the code environments to do likewise.
%
\def\codequoteleft{%
- \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
- \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
- % [Knuth] pp. 380,381,391
- % \relax disables Spanish ligatures ?` and !` of \tt font.
- \relax`%
+ \ifmonospace
+ \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+ \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+ % [Knuth] pp. 380,381,391
+ % \relax disables Spanish ligatures ?` and !` of \tt font.
+ \relax`%
+ \else \char'22 \fi
\else \char'22 \fi
- \else \char'22 \fi
+ \else
+ \relax`%
+ \fi
}
% Commands to set the quote options.
-%
+%
\parseargdef\codequoteundirected{%
\def\temp{#1}%
\ifx\temp\onword
@@ -2763,7 +2822,7 @@ end
% If we are in a monospaced environment, however, 1) always use \ttsl,
% and 2) do not add an italic correction.
\def\dosmartslant#1#2{%
- \ifusingtt
+ \ifusingtt
{{\ttsl #2}\let\next=\relax}%
{\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
\next
@@ -2842,7 +2901,7 @@ end
% @t, explicit typewriter.
\def\t#1{%
- {\tt \rawbackslash \plainfrenchspacing #1}%
+ {\tt \plainfrenchspacing #1}%
\null
}
@@ -2869,7 +2928,6 @@ end
% Turn off hyphenation.
\nohyphenation
%
- \rawbackslash
\plainfrenchspacing
#1%
}%
@@ -2911,14 +2969,14 @@ end
\gdef\codedash{\futurelet\next\codedashfinish}
\gdef\codedashfinish{%
\normaldash % always output the dash character itself.
- %
+ %
% Now, output a discretionary to allow a line break, unless
% (a) the next character is a -, or
% (b) the preceding character is a -.
% E.g., given --posix, we do not want to allow a break after either -.
% Given --foo-bar, we do want to allow a break between the - and the b.
\ifx\next\codedash \else
- \ifx\codedashprev\codedash
+ \ifx\codedashprev\codedash
\else \discretionary{}{}{}\fi
\fi
% we need the space after the = for the case when \next itself is a
@@ -3000,7 +3058,7 @@ end
% For pdfTeX and LuaTeX
\ifurefurlonlylink
% PDF plus option to not display url, show just arg
- \unhbox0
+ \unhbox0
\else
% PDF, normally display both arg and url for consistency,
% visibility, if the pdf is eventually used to print, etc.
@@ -3013,7 +3071,7 @@ end
% For XeTeX
\ifurefurlonlylink
% PDF plus option to not display url, show just arg
- \unhbox0
+ \unhbox0
\else
% PDF, normally display both arg and url for consistency,
% visibility, if the pdf is eventually used to print, etc.
@@ -3056,41 +3114,33 @@ end
\global\def/{\normalslash}
}
-% we put a little stretch before and after the breakable chars, to help
-% line breaking of long url's. The unequal skips make look better in
-% cmtt at least, especially for dots.
-\def\urefprestretchamount{.13em}
-\def\urefpoststretchamount{.1em}
-\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
-\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
-%
-\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
-\def\urefcodedot{\urefprestretch .\urefpoststretch}
-\def\urefcodehash{\urefprestretch \#\urefpoststretch}
-\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeamp{\urefprebreak \&\urefpostbreak}
+\def\urefcodedot{\urefprebreak .\urefpostbreak}
+\def\urefcodehash{\urefprebreak \#\urefpostbreak}
+\def\urefcodequest{\urefprebreak ?\urefpostbreak}
\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
{
\catcode`\/=\active
\global\def\urefcodeslashfinish{%
- \urefprestretch \slashChar
+ \urefprebreak \slashChar
% Allow line break only after the final / in a sequence of
% slashes, to avoid line break between the slashes in http://.
- \ifx\next/\else \urefpoststretch \fi
+ \ifx\next/\else \urefpostbreak \fi
}
}
-% One more complication: by default we'll break after the special
-% characters, but some people like to break before the special chars, so
-% allow that. Also allow no breaking at all, for manual control.
-%
+% By default we'll break after the special characters, but some people like to
+% break before the special chars, so allow that. Also allow no breaking at
+% all, for manual control.
+%
\parseargdef\urefbreakstyle{%
\def\txiarg{#1}%
\ifx\txiarg\wordnone
\def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
\else\ifx\txiarg\wordbefore
- \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+ \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
\else\ifx\txiarg\wordafter
- \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
\else
\errhelp = \EMsimple
\errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
@@ -3100,6 +3150,19 @@ end
\def\wordbefore{before}
\def\wordnone{none}
+% Allow a ragged right output to aid breaking long URL's. There can
+% be a break at the \allowbreak with no extra glue (if the existing stretch in
+% the line is sufficient), a break at the \penalty100 with extra glue added
+% at the end of the line, or no break at all here.
+% Changing the value of the penalty and/or the amount of stretch affects how
+% preferable one choice is over the other.
+\def\urefallowbreak{%
+ \allowbreak
+ \hskip 0pt plus 2 em\relax
+ \penalty300
+ \hskip 0pt plus -2 em\relax
+}
+
\urefbreakstyle after
% @url synonym for @uref, since that's how everyone uses it.
@@ -3110,7 +3173,7 @@ end
% So now @email is just like @uref, unless we are pdf.
%
%\def\email#1{\angleleft{\tt #1}\angleright}
-\ifpdf
+\ifpdforxetex
\def\email#1{\doemail#1,,\finish}
\def\doemail#1,#2,#3\finish{\begingroup
\unsepspaces
@@ -3120,18 +3183,7 @@ end
\endlink
\endgroup}
\else
- \ifx\XeTeXrevision\thisisundefined
- \let\email=\uref
- \else
- \def\email#1{\doemail#1,,\finish}
- \def\doemail#1,#2,#3\finish{\begingroup
- \unsepspaces
- \pdfurl{mailto:#1}%
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
- \endlink
- \endgroup}
- \fi
+ \let\email=\uref
\fi
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
@@ -3307,7 +3359,7 @@ end
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
% except specified as a normal braced arg, so no newlines to worry about.
-%
+%
\def\outfmtnametex{tex}
%
\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
@@ -3315,7 +3367,7 @@ end
\def\inlinefmtname{#1}%
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
}
-%
+%
% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
% FMTNAME is tex, else ELSE-TEXT.
\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
@@ -3331,7 +3383,7 @@ end
% *right* brace they would have to use a command anyway, so they may as
% well use a command to get a left brace too. We could re-use the
% delimiter character idea from \verb, but it seems like overkill.
-%
+%
\long\def\inlineraw{\tex \doinlineraw}
\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
\def\doinlinerawtwo#1,#2,\finish{%
@@ -3508,7 +3560,7 @@ end
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
%
-\def\pounds{{\it\$}}
+\def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi}
% @euro{} comes from a separate font, depending on the current style.
% We use the free feym* fonts from the eurosym package by Henrik
@@ -3608,7 +3660,7 @@ end
% for non-CM glyphs. That is ec* for regular text and tc* for the text
% companion symbols (LaTeX TS1 encoding). Both are part of the ec
% package and follow the same conventions.
-%
+%
\def\ecfont{\etcfont{e}}
\def\tcfont{\etcfont{t}}
%
@@ -3657,11 +3709,19 @@ end
\fi
% Quotes.
-\chardef\quotedblleft="5C
-\chardef\quotedblright=`\"
\chardef\quoteleft=`\`
\chardef\quoteright=`\'
+% only change font for tt for correct kerning and to avoid using
+% \ecfont unless necessary.
+\def\quotedblleft{%
+ \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi
+}
+
+\def\quotedblright{%
+ \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi
+}
+
\message{page headings,}
@@ -3680,7 +3740,7 @@ end
after the title page.}}%
\def\setshortcontentsaftertitlepage{%
\errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
- command; move your @shortcontents and @contents commands if you
+ command; move your @shortcontents and @contents commands if you
want the contents after the title page.}}%
\parseargdef\shorttitlepage{%
@@ -3735,7 +3795,7 @@ end
% don't worry much about spacing, ragged right. This should be used
% inside a \vbox, and fonts need to be set appropriately first. \par should
% be specified before the end of the \vbox, since a vbox is a group.
-%
+%
\def\raggedtitlesettings{%
\rm
\hyphenpenalty=10000
@@ -3783,12 +3843,19 @@ end
\newtoks\evenheadline % headline on even pages
\newtoks\oddheadline % headline on odd pages
+\newtoks\evenchapheadline% headline on even pages with a new chapter
+\newtoks\oddchapheadline % headline on odd pages with a new chapter
\newtoks\evenfootline % footline on even pages
\newtoks\oddfootline % footline on odd pages
% Now make \makeheadline and \makefootline in Plain TeX use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
- \else \the\evenheadline \fi}}
+\headline={{\textfonts\rm
+ \ifchapterpage
+ \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi
+ \else
+ \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
+ \fi}}
+
\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
\else \the\evenfootline \fi}\HEADINGShook}
\let\HEADINGShook=\relax
@@ -3804,12 +3871,14 @@ end
\def\evenheading{\parsearg\evenheadingxxx}
\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+ \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
+ \global\evenchapheadline=\evenheadline}
\def\oddheading{\parsearg\oddheadingxxx}
\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+ \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ \global\oddchapheadline=\oddheadline}
\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
@@ -3876,37 +3945,34 @@ end
\parseargdef\headings{\csname HEADINGS#1\endcsname}
\def\headingsoff{% non-global headings elimination
- \evenheadline={\hfil}\evenfootline={\hfil}%
- \oddheadline={\hfil}\oddfootline={\hfil}%
+ \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}%
+ \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}%
}
\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
\HEADINGSoff % it's the default
% When we turn headings on, set the page number to 1.
+\def\pageone{
+ \global\pageno=1
+ \global\arabiccount = \pagecount
+}
+
% For double-sided printing, put current file name in lower left corner,
% chapter name on inside top of right hand pages, document
% title on inside top of left hand pages, and page numbers on outside top
% edge of all pages.
\def\HEADINGSdouble{%
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapterheading\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
+\pageone
+\HEADINGSdoublex
}
\let\contentsalignmacro = \chappager
% For single-sided printing, chapter title goes across top left of page,
% page number on top right.
\def\HEADINGSsingle{%
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapterheading\hfil\folio}}
-\global\oddheadline={\line{\thischapterheading\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
+\pageone
+\HEADINGSsinglex
}
\def\HEADINGSon{\HEADINGSdouble}
@@ -3916,7 +3982,9 @@ end
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapterheading\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\evenchapheadline={\line{\folio\hfil}}
+\global\oddchapheadline={\line{\hfil\folio}}
\global\let\contentsalignmacro = \chapoddpage
}
@@ -3924,8 +3992,22 @@ end
\def\HEADINGSsinglex{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapterheading\hfil\folio}}
-\global\oddheadline={\line{\thischapterheading\hfil\folio}}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\evenchapheadline={\line{\hfil\folio}}
+\global\oddchapheadline={\line{\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% for @setchapternewpage off
+\def\HEADINGSsinglechapoff{%
+\pageone
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\evenchapheadline=\evenheadline
+\global\oddchapheadline=\oddheadline
\global\let\contentsalignmacro = \chappager
}
@@ -4358,7 +4440,7 @@ end
}
% multitable-only commands.
-%
+%
% @headitem starts a heading row, which we typeset in bold. Assignments
% have to be global since we are inside the implicit group of an
% alignment entry. \everycr below resets \everytab so we don't have to
@@ -4665,19 +4747,6 @@ end
}
}
-% We have this subroutine so that we can handle at least some @value's
-% properly in indexes (we call \makevalueexpandable in \indexdummies).
-% The command has to be fully expandable (if the variable is set), since
-% the result winds up in the index file. This means that if the
-% variable's value contains other Texinfo commands, it's almost certain
-% it will fail (although perhaps we could fix that with sufficient work
-% to do a one-level expansion on the result, instead of complete).
-%
-% Unfortunately, this has the consequence that when _ is in the *value*
-% of an @set, it does not print properly in the roman fonts (get the cmr
-% dot accent at position 126 instead). No fix comes to mind, and it's
-% been this way since 2003 or earlier, so just ignore it.
-%
\def\expandablevalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
{[No value for ``#1'']}%
@@ -4690,13 +4759,13 @@ end
% Like \expandablevalue, but completely expandable (the \message in the
% definition above operates at the execution level of TeX). Used when
% writing to auxiliary files, due to the expansion that \write does.
-% If flag is undefined, pass through an unexpanded @value command: maybe it
+% If flag is undefined, pass through an unexpanded @value command: maybe it
% will be set by the time it is read back in.
%
% NB flag names containing - or _ may not work here.
\def\dummyvalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- \noexpand\value{#1}%
+ \string\value{#1}%
\else
\csname SET#1\endcsname
\fi
@@ -4706,7 +4775,7 @@ end
% if possible, otherwise sort late.
\def\indexnofontsvalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- ZZZZZZZ
+ ZZZZZZZ%
\else
\csname SET#1\endcsname
\fi
@@ -4714,7 +4783,7 @@ end
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
-%
+%
% To get the special treatment we need for `@end ifset,' we call
% \makecond and then redefine.
%
@@ -4747,7 +4816,7 @@ end
% without the @) is in fact defined. We can only feasibly check at the
% TeX level, so something like `mathcode' is going to considered
% defined even though it is not a Texinfo command.
-%
+%
\makecond{ifcommanddefined}
\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
%
@@ -4855,30 +4924,16 @@ end
\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
-
-% Used when writing an index entry out to an index file to prevent
-% expansion of Texinfo commands that can appear in an index entry.
-%
-\def\indexdummies{%
- \escapechar = `\\ % use backslash in output files.
- \definedummyletter\@%
- \definedummyletter\ %
- %
- % For texindex which always views { and } as separators.
- \def\{{\lbracechar{}}%
- \def\}{\rbracechar{}}%
- %
- % Do the redefinitions.
- \definedummies
-}
-% Used for the aux and toc files, where @ is the escape character.
+% Used for the aux, toc and index files to prevent expansion of Texinfo
+% commands.
%
\def\atdummies{%
\definedummyletter\@%
\definedummyletter\ %
\definedummyletter\{%
\definedummyletter\}%
+ \definedummyletter\&%
%
% Do the redefinitions.
\definedummies
@@ -4902,8 +4957,7 @@ end
\def\definedummyletter#1{\def#1{\string#1}}%
\let\definedummyaccent\definedummyletter
-% Called from \indexdummies and \atdummies, to effectively prevent
-% the expansion of commands.
+% Called from \atdummies to prevent the expansion of commands.
%
\def\definedummies{%
%
@@ -4950,8 +5004,10 @@ end
\definedummyword\TeX
%
% Assorted special characters.
+ \definedummyword\ampchar
\definedummyword\atchar
\definedummyword\arrow
+ \definedummyword\backslashchar
\definedummyword\bullet
\definedummyword\comma
\definedummyword\copyright
@@ -4988,6 +5044,8 @@ end
\definedummyword\sup
\definedummyword\textdegree
%
+ \definedummyword\subentry
+ %
% We want to disable all macros so that they are not expanded by \write.
\macrolist
\let\value\dummyvalue
@@ -5068,11 +5126,10 @@ end
\commondummyword\xref
}
-% For testing: output @{ and @} in index sort strings as \{ and \}.
-\newif\ifusebracesinindexes
-
\let\indexlbrace\relax
\let\indexrbrace\relax
+\let\indexatchar\relax
+\let\indexbackslash\relax
{\catcode`\@=0
\catcode`\\=13
@@ -5106,10 +5163,8 @@ end
}
\gdef\indexnonalnumreappear{%
- \useindexbackslash
\let-\normaldash
\let<\normalless
- \def\@{@}%
}
}
@@ -5143,64 +5198,66 @@ end
\let\lbracechar\{%
\let\rbracechar\}%
%
+ %
+ \let\do\indexnofontsdef
+ %
% Non-English letters.
- \def\AA{AA}%
- \def\AE{AE}%
- \def\DH{DZZ}%
- \def\L{L}%
- \def\OE{OE}%
- \def\O{O}%
- \def\TH{TH}%
- \def\aa{aa}%
- \def\ae{ae}%
- \def\dh{dzz}%
- \def\exclamdown{!}%
- \def\l{l}%
- \def\oe{oe}%
- \def\ordf{a}%
- \def\ordm{o}%
- \def\o{o}%
- \def\questiondown{?}%
- \def\ss{ss}%
- \def\th{th}%
- %
- \def\LaTeX{LaTeX}%
- \def\TeX{TeX}%
- %
- % Assorted special characters. \defglyph gives the control sequence a
- % definition that removes the {} that follows its use.
- \defglyph\atchar{@}%
- \defglyph\arrow{->}%
- \defglyph\bullet{bullet}%
- \defglyph\comma{,}%
- \defglyph\copyright{copyright}%
- \defglyph\dots{...}%
- \defglyph\enddots{...}%
- \defglyph\equiv{==}%
- \defglyph\error{error}%
- \defglyph\euro{euro}%
- \defglyph\expansion{==>}%
- \defglyph\geq{>=}%
- \defglyph\guillemetleft{<<}%
- \defglyph\guillemetright{>>}%
- \defglyph\guilsinglleft{<}%
- \defglyph\guilsinglright{>}%
- \defglyph\leq{<=}%
- \defglyph\lbracechar{\{}%
- \defglyph\minus{-}%
- \defglyph\point{.}%
- \defglyph\pounds{pounds}%
- \defglyph\print{-|}%
- \defglyph\quotedblbase{"}%
- \defglyph\quotedblleft{"}%
- \defglyph\quotedblright{"}%
- \defglyph\quoteleft{`}%
- \defglyph\quoteright{'}%
- \defglyph\quotesinglbase{,}%
- \defglyph\rbracechar{\}}%
- \defglyph\registeredsymbol{R}%
- \defglyph\result{=>}%
- \defglyph\textdegree{o}%
+ \do\AA{AA}%
+ \do\AE{AE}%
+ \do\DH{DZZ}%
+ \do\L{L}%
+ \do\OE{OE}%
+ \do\O{O}%
+ \do\TH{TH}%
+ \do\aa{aa}%
+ \do\ae{ae}%
+ \do\dh{dzz}%
+ \do\exclamdown{!}%
+ \do\l{l}%
+ \do\oe{oe}%
+ \do\ordf{a}%
+ \do\ordm{o}%
+ \do\o{o}%
+ \do\questiondown{?}%
+ \do\ss{ss}%
+ \do\th{th}%
+ %
+ \do\LaTeX{LaTeX}%
+ \do\TeX{TeX}%
+ %
+ % Assorted special characters.
+ \do\atchar{@}%
+ \do\arrow{->}%
+ \do\bullet{bullet}%
+ \do\comma{,}%
+ \do\copyright{copyright}%
+ \do\dots{...}%
+ \do\enddots{...}%
+ \do\equiv{==}%
+ \do\error{error}%
+ \do\euro{euro}%
+ \do\expansion{==>}%
+ \do\geq{>=}%
+ \do\guillemetleft{<<}%
+ \do\guillemetright{>>}%
+ \do\guilsinglleft{<}%
+ \do\guilsinglright{>}%
+ \do\leq{<=}%
+ \do\lbracechar{\{}%
+ \do\minus{-}%
+ \do\point{.}%
+ \do\pounds{pounds}%
+ \do\print{-|}%
+ \do\quotedblbase{"}%
+ \do\quotedblleft{"}%
+ \do\quotedblright{"}%
+ \do\quoteleft{`}%
+ \do\quoteright{'}%
+ \do\quotesinglbase{,}%
+ \do\rbracechar{\}}%
+ \do\registeredsymbol{R}%
+ \do\result{=>}%
+ \do\textdegree{o}%
%
% We need to get rid of all macros, leaving only the arguments (if present).
% Of course this is not nearly correct, but it is the best we can do for now.
@@ -5215,41 +5272,24 @@ end
\macrolist
\let\value\indexnofontsvalue
}
-\def\defglyph#1#2{\def#1##1{#2}} % see above
-
-
+% Give the control sequence a definition that removes the {} that follows
+% its use, e.g. @AA{} -> AA
+\def\indexnofontsdef#1#2{\def#1##1{#2}}%
-\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-% Most index entries go through here, but \dosubind is the general case.
-% #1 is the index name, #2 is the entry text.
-\def\doind#1#2{\dosubind{#1}{#2}{}}
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-% TODO: Two-level index? Operation index?
-% Workhorse for all indexes.
-% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% empty if called from \doind, as we usually are (the main exception
-% is with most defuns, which call us directly).
-%
-\def\dosubind#1#2#3{%
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{%
\iflinks
{%
- \requireopenindexfile{#1}%
- % Store the main index entry text (including the third arg).
- \toks0 = {#2}%
- % If third arg is present, precede it with a space.
- \def\thirdarg{#3}%
- \ifx\thirdarg\empty \else
- \toks0 = \expandafter{\the\toks0 \space #3}%
- \fi
%
+ \requireopenindexfile{#1}%
\edef\writeto{\csname#1indfile\endcsname}%
%
- \safewhatsit\dosubindwrite
+ \def\indextext{#2}%
+ \safewhatsit\doindwrite
}%
\fi
}
@@ -5264,28 +5304,14 @@ end
\ifx\suffix\indexisfl\def\suffix{f1}\fi
% Open the file
\immediate\openout\csname#1indfile\endcsname \jobname.\suffix
- % Using \immediate above here prevents an object entering into the current
+ % Using \immediate above here prevents an object entering into the current
% box, which could confound checks such as those in \safewhatsit for
% preceding skips.
\typeout{Writing index file \jobname.\suffix}%
\fi}
\def\indexisfl{fl}
-% Output \ as {\indexbackslash}, because \ is an escape character in
-% the index files.
-\let\indexbackslash=\relax
-{\catcode`\@=0 \catcode`\\=\active
- @gdef@useindexbackslash{@def\{{@indexbackslash}}}
-}
-
-% Definition for writing index entry text.
-\def\sortas#1{\ignorespaces}%
-
-% Definition for writing index entry sort key. Should occur at the at
-% the beginning of the index entry, like
-% @cindex @sortas{september} \september
-% The \ignorespaces takes care of following space, but there's no way
-% to remove space before it.
+% Definition for writing index entry sort key.
{
\catcode`\-=13
\gdef\indexwritesortas{%
@@ -5296,51 +5322,150 @@ end
\xdef\indexsortkey{#1}\endgroup}
}
+\def\indexwriteseealso#1{
+ \gdef\pagenumbertext{\string\seealso{#1}}%
+}
+\def\indexwriteseeentry#1{
+ \gdef\pagenumbertext{\string\seeentry{#1}}%
+}
-% Write the entry in \toks0 to the index file.
+% The default definitions
+\def\sortas#1{}%
+\def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
+\def\putwordSeeAlso{See also}
+\def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
+
+
+% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
+% * Set \bracedtext to "{aaa}{bbb}"
+% * Set \fullindexsortkey to "aaa @subentry ZZZ"
+% * If @seealso occurs, set \pagenumbertext
%
-\def\dosubindwrite{%
- % Put the index entry in the margin if desired.
- \ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+\def\splitindexentry#1{%
+ \gdef\fullindexsortkey{}%
+ \xdef\bracedtext{}%
+ \def\sep{}%
+ \def\seealso##1{}%
+ \def\seeentry##1{}%
+ \expandafter\doindexsegment#1\subentry\finish\subentry
+}
+
+% append the results from the next segment
+\def\doindexsegment#1\subentry{%
+ \def\segment{#1}%
+ \ifx\segment\isfinish
+ \else
+ %
+ % Fully expand the segment, throwing away any @sortas directives, and
+ % trim spaces.
+ \edef\trimmed{\segment}%
+ \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
+ %
+ \xdef\bracedtext{\bracedtext{\trimmed}}%
+ %
+ % Get the string to sort by. Process the segment with all
+ % font commands turned off.
+ \bgroup
+ \let\sortas\indexwritesortas
+ \let\seealso\indexwriteseealso
+ \let\seeentry\indexwriteseeentry
+ \indexnofonts
+ % The braces around the commands are recognized by texindex.
+ \def\lbracechar{{\string\indexlbrace}}%
+ \def\rbracechar{{\string\indexrbrace}}%
+ \let\{=\lbracechar
+ \let\}=\rbracechar
+ \def\@{{\string\indexatchar}}%
+ \def\atchar##1{\@}%
+ \def\backslashchar{{\string\indexbackslash}}%
+ \uccode`\~=`\\ \uppercase{\let~\backslashchar}%
+ %
+ \let\indexsortkey\empty
+ \global\let\pagenumbertext\empty
+ % Execute the segment and throw away the typeset output. This executes
+ % any @sortas or @seealso commands in this segment.
+ \setbox\dummybox = \hbox{\segment}%
+ \ifx\indexsortkey\empty{%
+ \indexnonalnumdisappear
+ \xdef\trimmed{\segment}%
+ \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
+ \xdef\indexsortkey{\trimmed}%
+ \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
+ }\fi
+ %
+ % Append to \fullindexsortkey.
+ \edef\tmp{\gdef\noexpand\fullindexsortkey{%
+ \fullindexsortkey\sep\indexsortkey}}%
+ \tmp
+ \egroup
+ \def\sep{\subentry}%
+ %
+ \expandafter\doindexsegment
+ \fi
+}
+\def\isfinish{\finish}%
+\newbox\dummybox % used above
+
+\let\subentry\relax
+
+% Use \ instead of @ in index files. To support old texi2dvi and texindex.
+% This works without changing the escape character used in the toc or aux
+% files because the index entries are fully expanded here, and \string uses
+% 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.
+%
+\set txiindexescapeisbackslash
+
+% Write the entry in \indextext to the index file.
+%
+\def\doindwrite{%
+ \maybemarginindex
+ %
+ \atdummies
+ %
+ \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else
+ \escapeisbackslash
\fi
%
- % Remember, we are within a group.
- \indexdummies % Must do this here, since \bf, etc expand at this stage
- \useindexbackslash % \indexbackslash isn't defined now so it will be output
- % as is; and it will print as backslash.
- % The braces around \indexbrace are recognized by texindex.
- %
- % Get the string to sort by, by processing the index entry with all
- % font commands turned off.
- {\indexnofonts
- \def\lbracechar{{\indexlbrace}}%
- \def\rbracechar{{\indexrbrace}}%
- \let\{=\lbracechar
- \let\}=\rbracechar
- \indexnonalnumdisappear
- \xdef\indexsortkey{}%
- \let\sortas=\indexwritesortas
- \edef\temp{\the\toks0}%
- \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
- \ifx\indexsortkey\empty
- \xdef\indexsortkey{\temp}%
- \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
- \fi
- }%
+ % For texindex which always views { and } as separators.
+ \def\{{\lbracechar{}}%
+ \def\}{\rbracechar{}}%
+ \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
+ %
+ % Split the entry into primary entry and any subentries, and get the index
+ % sort key.
+ \splitindexentry\indextext
%
% Set up the complete index entry, with both the sort key and
% the original text, including any font commands. We write
% three arguments to \entry to the .?? file (four in the
% subentry case), texindex reduces to two when writing the .??s
% sorted result.
+ %
\edef\temp{%
\write\writeto{%
- \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
+ \string\entry{\fullindexsortkey}%
+ {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
+ \bracedtext}%
}%
\temp
}
-\newbox\dummybox % used above
+
+% Put the index entry in the margin if desired (undocumented).
+\def\maybemarginindex{%
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
+ \fi
+}
+\let\SETmarginindex=\relax
+
% Take care of unwanted page breaks/skips around a whatsit:
%
@@ -5428,9 +5553,14 @@ end
% \entry {topic}{pagelist}
% for a topic that is used without subtopics
% \primary {topic}
+% \entry {topic}{}
% for the beginning of a topic that is used with subtopics
% \secondary {subtopic}{pagelist}
% for each subtopic.
+% \secondary {subtopic}{}
+% for a subtopic with sub-subtopics
+% \tertiary {subtopic}{subsubtopic}{pagelist}
+% for each sub-subtopic.
% Define the user-accessible indexing commands
% @findex, @vindex, @kindex, @cindex.
@@ -5442,11 +5572,6 @@ end
\def\tindex {\tpindex}
\def\pindex {\pgindex}
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
% Define the macros used in formatting output of the sorted index material.
% @printindex causes a particular index (the ??s file) to get printed.
@@ -5460,14 +5585,10 @@ end
\plainfrenchspacing
\everypar = {}% don't want the \kern\-parindent from indentation suppression.
%
- % See if the index file exists and is nonempty.
- % Change catcode of @ here so that if the index file contains
- % \initial {@}
- % as its first line, TeX doesn't complain about mismatched braces
- % (because it thinks @} is a control sequence).
- \catcode`\@ = 12
% See comment in \requireopenindexfile.
\def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
+ %
+ % See if the index file exists and is nonempty.
\openin 1 \jobname.\indexname s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
@@ -5477,8 +5598,6 @@ end
\putwordIndexNonexistent
\typeout{No file \jobname.\indexname s.}%
\else
- \catcode`\\ = 0
- %
% If the index file exists but is empty, then \openin leaves \ifeof
% false. We have to make TeX try to read something from the file, so
% it can discover if there is anything in it.
@@ -5486,47 +5605,51 @@ end
\ifeof 1
\putwordIndexIsEmpty
\else
- % Index files are almost Texinfo source, but we use \ as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- \def\indexbackslash{\ttbackslash}%
- \let\indexlbrace\{ % Likewise, set these sequences for braces
- \let\indexrbrace\} % used in the sort key.
- \begindoublecolumns
- \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty
- %
- % Read input from the index file line by line.
- \loopdo
- \ifeof1 \else
- \read 1 to \nextline
- \fi
- %
- \indexinputprocessing
- \thisline
- %
- \ifeof1\else
- \let\thisline\nextline
- \repeat
- %%
- \enddoublecolumns
+ \expandafter\printindexzz\thisline\relax\relax\finish%
\fi
\fi
\closein 1
\endgroup}
-\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
-\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
-\def\indexinputprocessing{%
- \ifeof1
- \let\firsttoken\relax
+% If the index file starts with a backslash, forgo reading the index
+% file altogether. If somebody upgrades texinfo.tex they may still have
+% old index files using \ as the escape character. Reading this would
+% at best lead to typesetting garbage, at worst a TeX syntax error.
+\def\printindexzz#1#2\finish{%
+ \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax
+ \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
+ \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax
+\errmessage{%
+ERROR: A sorted index file in an obsolete format was skipped.
+To fix this problem, please upgrade your version of 'texi2dvi'
+or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
+If you are using an old version of 'texindex' (part of the Texinfo
+distribution), you may also need to upgrade to a newer version (at least 6.0).
+You may be able to typeset the index if you run
+'texindex \jobname.\indexname' yourself.
+You could also try setting the 'txiindexescapeisbackslash' flag by
+running a command like
+'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
+this, Texinfo will try to use index files in the old format.
+If you continue to have problems, deleting the index files and starting again
+might help (with 'rm \jobname.?? \jobname.??s')%
+}%
+ \else
+ (Skipped sorted index file in obsolete format)
+ \fi
+ \else
+ \begindoublecolumns
+ \input \jobname.\indexname s
+ \enddoublecolumns
+ \fi
\else
- \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
- \act
+ \begindoublecolumns
+ \catcode`\\=0\relax
+ \catcode`\@=12\relax
+ \input \jobname.\indexname s
+ \enddoublecolumns
\fi
}
-\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
-\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
-
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
@@ -5535,12 +5658,19 @@ end
\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
\catcode`\$=3
\gdef\initialglyphs{%
+ % special control sequences used in the index sort key
+ \let\indexlbrace\{%
+ \let\indexrbrace\}%
+ \let\indexatchar\@%
+ \def\indexbackslash{\math{\backslash}}%
+ %
% Some changes for non-alphabetic characters. Using the glyphs from the
% math fonts looks more consistent than the typewriter font used elsewhere
% for these characters.
- \def\indexbackslash{\math{\backslash}}%
- \let\\=\indexbackslash
+ \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
%
+ % In case @\ is used for backslash
+ \uppercase{\let\\=~}
% Can't get bold backslash so don't use bold forward slash
\catcode`\/=13
\def/{{\secrmnotbold \normalslash}}%
@@ -5570,7 +5700,7 @@ end
% bottom of a column to reduce an increase in inter-line spacing.
\nobreak
\vskip 0pt plus 5\baselineskip
- \penalty -300
+ \penalty -300
\vskip 0pt plus -5\baselineskip
%
% Typeset the initial. Making this add up to a whole number of
@@ -5600,12 +5730,6 @@ end
\def\entry{%
\begingroup
%
- % For pdfTeX and XeTeX.
- % The redefinition of \domark stops marks being added in \pdflink to
- % preserve coloured links across page boundaries. Otherwise the marks
- % would get in the way of \lastbox in \insertentrybox.
- \let\domark\relax
- %
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
\par
@@ -5638,35 +5762,31 @@ end
\gdef\finishentry#1{%
\egroup % end box A
\dimen@ = \wd\boxA % Length of text of entry
- \global\setbox\boxA=\hbox\bgroup\unhbox\boxA
- % #1 is the page number.
- %
- % Get the width of the page numbers, and only use
- % leaders if they are present.
- \global\setbox\boxB = \hbox{#1}%
- \ifdim\wd\boxB = 0pt
- \null\nobreak\hfill\ %
- \else
- %
- \null\nobreak\indexdotfill % Have leaders before the page number.
+ \global\setbox\boxA=\hbox\bgroup
+ \unhbox\boxA
+ % #1 is the page number.
%
- \ifpdf
- \pdfgettoks#1.%
- \hskip\skip\thinshrinkable\the\toksA
+ % Get the width of the page numbers, and only use
+ % leaders if they are present.
+ \global\setbox\boxB = \hbox{#1}%
+ \ifdim\wd\boxB = 0pt
+ \null\nobreak\hfill\ %
\else
- \ifx\XeTeXrevision\thisisundefined
- \hskip\skip\thinshrinkable #1%
- \else
+ %
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ \ifpdforxetex
\pdfgettoks#1.%
\hskip\skip\thinshrinkable\the\toksA
+ \else
+ \hskip\skip\thinshrinkable #1%
\fi
\fi
- \fi
\egroup % end \boxA
\ifdim\wd\boxB = 0pt
- \global\setbox\entrybox=\vbox{\unhbox\boxA}%
- \else
- \global\setbox\entrybox=\vbox\bgroup
+ \noindent\unhbox\boxA\par
+ \nobreak
+ \else\bgroup
% We want the text of the entries to be aligned to the left, and the
% page numbers to be aligned to the right.
%
@@ -5696,7 +5816,7 @@ end
\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
+ % Try to split the text roughly evenly. \dimen@ will be the length of
% the first line.
\dimen@ = 0.7\dimen@
\dimen@ii = \hsize
@@ -5732,55 +5852,11 @@ end
\egroup % The \vbox
\fi
\endgroup
- \dotheinsertentrybox
}}
\newskip\thinshrinkable
\skip\thinshrinkable=.15em minus .15em
-\newbox\entrybox
-\def\insertentrybox{%
- \ourunvbox\entrybox
-}
-
-% default definition
-\let\dotheinsertentrybox\insertentrybox
-
-% Use \lastbox to take apart vbox box by box, and add each sub-box
-% to the current vertical list.
-\def\ourunvbox#1{%
-\bgroup % for local binding of \delayedbox
- % Remove the last box from box #1
- \global\setbox#1=\vbox{%
- \unvbox#1%
- \unskip % remove any glue
- \unpenalty
- \global\setbox\interbox=\lastbox
- }%
- \setbox\delayedbox=\box\interbox
- \ifdim\ht#1=0pt\else
- \ourunvbox#1 % Repeat on what's left of the box
- \nobreak
- \fi
- \box\delayedbox
-\egroup
-}
-\newbox\delayedbox
-\newbox\interbox
-
-% Used from \printindex. \firsttoken should be the first token
-% after the \entry. If it's not another \entry, we are at the last
-% line of a group of index entries, so insert a penalty to discourage
-% widowed index entries.
-\def\dotheinsertentryboxwithpenalty{%
- \ifx\firsttoken\isentry
- \else
- \penalty 9000
- \fi
- \insertentrybox
-}
-\def\isentry{\entry}%
-
% Like plain.tex's \dotfill, except uses up at least 1 em.
% The filll stretch here overpowers both the fil and fill stretch to push
% the page number to the right.
@@ -5790,24 +5866,15 @@ end
\def\primary #1{\line{#1\hfil}}
-\newskip\secondaryindent \secondaryindent=0.5cm
-\def\secondary#1#2{{%
- \parfillskip=0in
- \parskip=0in
- \hangindent=1in
- \hangafter=1
- \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
- \ifpdf
- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
- \else
- \ifx\XeTeXrevision\thisisundefined
- #2
- \else
- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
- \fi
- \fi
- \par
-}}
+\def\secondary{\indententry{0.5cm}}
+\def\tertiary{\indententry{1cm}}
+
+\def\indententry#1#2#3{%
+ \bgroup
+ \leftskip=#1
+ \entry{#2}{#3}%
+ \egroup
+}
% Define two-column mode, which we use to typeset indexes.
% Adapted from the TeXbook, page 416, which is to say,
@@ -5817,60 +5884,21 @@ end
\newbox\partialpage
\newdimen\doublecolumnhsize
-% Use inside an output routine to save \topmark and \firstmark
-\def\savemarks{%
- \global\savedtopmark=\expandafter{\topmark }%
- \global\savedfirstmark=\expandafter{\firstmark }%
-}
-\newtoks\savedtopmark
-\newtoks\savedfirstmark
-
-% Set \topmark and \firstmark for next time \output runs.
-% Can't be run from withinside \output (because any material
-% added while an output routine is active, including
-% penalties, is saved for after it finishes). The page so far
-% should be empty, otherwise what's on it will be thrown away.
-\def\restoremarks{%
- \mark{\the\savedtopmark}%
- \bgroup\output = {%
- \setbox\dummybox=\box\PAGE
- }abc\eject\egroup
- % "abc" because output routine doesn't fire for a completely empty page.
- \mark{\the\savedfirstmark}%
-}
-
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
% If not much space left on page, start a new page.
\ifdim\pagetotal>0.8\vsize\vfill\eject\fi
%
% Grab any single-column material above us.
\output = {%
- %
- % Here is a possibility not foreseen in manmac: if we accumulate a
- % whole lot of material, we might end up calling this \output
- % routine twice in a row (see the doublecol-lose test, which is
- % essentially a couple of indexes with @setchapternewpage off). In
- % that case we just ship out what is in \partialpage with the normal
- % output routine. Generally, \partialpage will be empty when this
- % runs and this will be a no-op. See the indexspread.tex test case.
- \ifvoid\partialpage \else
- \onepageout{\pagecontents\partialpage}%
- \fi
+ \savetopmark
%
\global\setbox\partialpage = \vbox{%
% Unvbox the main output page.
\unvbox\PAGE
\kern-\topskip \kern\baselineskip
}%
- \savemarks
}%
\eject % run that output routine to set \partialpage
- \restoremarks
- %
- % We recover the two marks that the last output routine saved in order
- % to propagate the information in marks added around a chapter heading,
- % which could be otherwise be lost by the time the final page is output.
- %
%
% Use the double-column output routine for subsequent pages.
\output = {\doublecolumnout}%
@@ -5896,7 +5924,9 @@ end
\divide\doublecolumnhsize by 2
\hsize = \doublecolumnhsize
%
- % Double the \vsize as well.
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
\advance\vsize by -\ht\partialpage
\vsize = 2\vsize
%
@@ -5909,17 +5939,15 @@ end
%
\def\doublecolumnout{%
%
+ \savetopmark
\splittopskip=\topskip \splitmaxdepth=\maxdepth
- % Get the available space for the double columns -- the normal
- % (undoubled) page height minus any material left over from the
- % previous page.
\dimen@ = \vsize
\divide\dimen@ by 2
%
% box0 will be the left-hand column, box2 the right.
\setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
\global\advance\vsize by 2\ht\partialpage
- \onepageout\pagesofar
+ \onepageout\pagesofar % empty except for the first time we are called
\unvbox\PAGE
\penalty\outputpenalty
}
@@ -5935,7 +5963,7 @@ end
}
-% Finished with with double columns.
+% Finished with double columns.
\def\enddoublecolumns{%
% The following penalty ensures that the page builder is exercised
% _before_ we change the output routine. This is necessary in the
@@ -5967,41 +5995,48 @@ end
%
\output = {%
% Split the last of the double-column material.
- \savemarks
+ \savetopmark
\balancecolumns
- %
+ }%
+ \eject % call the \output just set
+ \ifdim\pagetotal=0pt
% Having called \balancecolumns once, we do not
% want to call it again. Therefore, reset \output to its normal
% definition right away.
- \global\output = {\onepageout{\pagecontents\PAGE}}%
- }%
- \eject
- \endgroup % started in \begindoublecolumns
- \restoremarks
- % Leave the double-column material on the current page, no automatic
- % page break.
- \box\balancedcolumns
- %
- % \pagegoal was set to the doubled \vsize above, since we restarted
- % the current page. We're now back to normal single-column
- % typesetting, so reset \pagegoal to the normal \vsize.
- \global\vsize = \txipageheight %
- \pagegoal = \txipageheight %
+ \global\output=\expandafter{\the\defaultoutput}
+ %
+ \endgroup % started in \begindoublecolumns
+ % Leave the double-column material on the current page, no automatic
+ % page break.
+ \box\balancedcolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize.
+ \global\vsize = \txipageheight %
+ \pagegoal = \txipageheight %
+ \else
+ % We had some left-over material. This might happen when \doublecolumnout
+ % is called in \balancecolumns. Try again.
+ \expandafter\enddoublecolumns
+ \fi
}
\newbox\balancedcolumns
\setbox\balancedcolumns=\vbox{shouldnt see this}%
%
-% Only called for the last of the double column material. \doublecolumnout
+% Only called for the last of the double column material. \doublecolumnout
% does the others.
\def\balancecolumns{%
\setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
\dimen@ = \ht0
- \advance\dimen@ by \topskip
- \advance\dimen@ by-\baselineskip
- \ifdim\dimen@<5\baselineskip
+ \ifdim\dimen@<7\baselineskip
% Don't split a short final column in two.
\setbox2=\vbox{}%
+ \global\setbox\balancedcolumns=\vbox{\pagesofar}%
\else
+ % double the leading vertical space
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
\divide\dimen@ by 2 % target to split to
\dimen@ii = \dimen@
\splittopskip = \topskip
@@ -6016,15 +6051,15 @@ end
\repeat
}%
% Now the left column is in box 1, and the right column in box 3.
- % Check whether the left column has come out higher than the page itself.
+ %
+ % Check whether the left column has come out higher than the page itself.
% (Note that we have doubled \vsize for the double columns, so
% the actual height of the page is 0.5\vsize).
\ifdim2\ht1>\vsize
- % Just split the last of the double column material roughly in half.
- \setbox2=\box0
- \setbox0 = \vsplit2 to \dimen@ii
- \setbox0=\vbox to \dimen@ii {\unvbox0\vfill}%
- \setbox2=\vbox to \dimen@ii {\unvbox2\vfill}%
+ % It appears that we have been called upon to balance too much material.
+ % Output some of it with \doublecolumnout, leaving the rest on the page.
+ \setbox\PAGE=\box0
+ \doublecolumnout
\else
% Compare the heights of the two columns.
\ifdim4\ht1>5\ht3
@@ -6037,10 +6072,10 @@ end
\setbox2=\vbox to\ht1{\unvbox3\unskip}%
\setbox0=\vbox to\ht1{\unvbox1\unskip}%
\fi
+ \global\setbox\balancedcolumns=\vbox{\pagesofar}%
\fi
\fi
%
- \global\setbox\balancedcolumns=\vbox{\pagesofar}%
}
\catcode`\@ = \other
@@ -6136,11 +6171,9 @@ end
% @raisesections: treat @section as chapter, @subsection as section, etc.
\def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
% @lowersections: treat @chapter as section, @section as subsection, etc.
\def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
% we only have subsub.
\chardef\maxseclevel = 3
@@ -6316,7 +6349,7 @@ end
\let\top\unnumbered
% Sections.
-%
+%
\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
\def\seczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
@@ -6339,7 +6372,7 @@ end
}
% Subsections.
-%
+%
% normally calls numberedsubseczzz:
\outer\parseargdef\numberedsubsec{\numhead2{#1}}
\def\numberedsubseczzz#1{%
@@ -6364,7 +6397,7 @@ end
}
% Subsubsections.
-%
+%
% normally numberedsubsubseczzz:
\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
\def\numberedsubsubseczzz#1{%
@@ -6454,18 +6487,16 @@ end
\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
+\global\def\HEADINGSon{\HEADINGSsinglechapoff}}
\def\CHAPPAGon{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager
\global\def\HEADINGSon{\HEADINGSsingle}}
\def\CHAPPAGodd{%
\global\let\contentsalignmacro = \chapoddpage
\global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage
\global\def\HEADINGSon{\HEADINGSdouble}}
\CHAPPAGon
@@ -6485,27 +6516,22 @@ end
\expandafter\ifx\thisenv\titlepage\else
\checkenv{}% chapters, etc., should not start inside an environment.
\fi
- % FIXME: \chapmacro is currently called from inside \titlepage when
- % \setcontentsaftertitlepage to print the "Table of Contents" heading, but
- % this should probably be done by \sectionheading with an option to print
- % in chapter size.
- %
% Insert the first mark before the heading break (see notes for \domark).
- \let\prevchapterdefs=\lastchapterdefs
- \let\prevsectiondefs=\lastsectiondefs
- \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+ \let\prevchapterdefs=\currentchapterdefs
+ \let\prevsectiondefs=\currentsectiondefs
+ \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
\gdef\thissection{}}%
%
\def\temptype{#2}%
\ifx\temptype\Ynothingkeyword
- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
\gdef\thischapter{\thischaptername}}%
\else\ifx\temptype\Yomitfromtockeyword
- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
\gdef\thischapter{}}%
\else\ifx\temptype\Yappendixkeyword
\toks0={#1}%
- \xdef\lastchapterdefs{%
+ \xdef\currentchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\appendixletter}%
% \noexpand\putwordAppendix avoids expanding indigestible
@@ -6516,7 +6542,7 @@ end
}%
\else
\toks0={#1}%
- \xdef\lastchapterdefs{%
+ \xdef\currentchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\the\chapno}%
% \noexpand\putwordChapter avoids expanding indigestible
@@ -6536,18 +6562,18 @@ end
%
% Now the second mark, after the heading break. No break points
% between here and the heading.
- \let\prevchapterdefs=\lastchapterdefs
- \let\prevsectiondefs=\lastsectiondefs
+ \let\prevchapterdefs=\currentchapterdefs
+ \let\prevsectiondefs=\currentsectiondefs
\domark
%
{%
\chapfonts \rm
\let\footnote=\errfootnoteheading % give better error message
%
- % Have to define \lastsection before calling \donoderef, because the
+ % Have to define \currentsection before calling \donoderef, because the
% xref code eventually uses it. On the other hand, it has to be called
% after \pchapsepmacro, or the headline will change too soon.
- \gdef\lastsection{#1}%
+ \gdef\currentsection{#1}%
%
% Only insert the separating space if we have a chapter/appendix
% number, and don't print the unnumbered ``number''.
@@ -6636,10 +6662,10 @@ end
\csname #2fonts\endcsname \rm
%
% Insert first mark before the heading break (see notes for \domark).
- \let\prevsectiondefs=\lastsectiondefs
+ \let\prevsectiondefs=\currentsectiondefs
\ifx\temptype\Ynothingkeyword
\ifx\sectionlevel\seckeyword
- \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+ \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
\gdef\thissection{\thissectionname}}%
\fi
\else\ifx\temptype\Yomitfromtockeyword
@@ -6647,7 +6673,7 @@ end
\else\ifx\temptype\Yappendixkeyword
\ifx\sectionlevel\seckeyword
\toks0={#1}%
- \xdef\lastsectiondefs{%
+ \xdef\currentsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
% \noexpand\putwordSection avoids expanding indigestible
@@ -6660,7 +6686,7 @@ end
\else
\ifx\sectionlevel\seckeyword
\toks0={#1}%
- \xdef\lastsectiondefs{%
+ \xdef\currentsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
% \noexpand\putwordSection avoids expanding indigestible
@@ -6686,28 +6712,28 @@ end
%
% Now the second mark, after the heading break. No break points
% between here and the heading.
- \global\let\prevsectiondefs=\lastsectiondefs
+ \global\let\prevsectiondefs=\currentsectiondefs
\domark
%
% Only insert the space after the number if we have a section number.
\ifx\temptype\Ynothingkeyword
\setbox0 = \hbox{}%
\def\toctype{unn}%
- \gdef\lastsection{#1}%
+ \gdef\currentsection{#1}%
\else\ifx\temptype\Yomitfromtockeyword
% for @headings -- no section number, don't include in toc,
- % and don't redefine \lastsection.
+ % and don't redefine \currentsection.
\setbox0 = \hbox{}%
\def\toctype{omit}%
\let\sectionlevel=\empty
\else\ifx\temptype\Yappendixkeyword
\setbox0 = \hbox{#4\enspace}%
\def\toctype{app}%
- \gdef\lastsection{#1}%
+ \gdef\currentsection{#1}%
\else
\setbox0 = \hbox{#4\enspace}%
\def\toctype{num}%
- \gdef\lastsection{#1}%
+ \gdef\currentsection{#1}%
\fi\fi\fi
%
% Write the toc entry (before \donoderef). See comments in \chapmacro.
@@ -6797,13 +6823,8 @@ end
% 1 and 2 (the page numbers aren't printed), and so are the first
% two pages of the document. Thus, we'd have two destinations named
% `1', and two named `2'.
- \ifpdf
+ \ifpdforxetex
\global\pdfmakepagedesttrue
- \else
- \ifx\XeTeXrevision\thisisundefined
- \else
- \global\pdfmakepagedesttrue
- \fi
\fi
}
@@ -6840,9 +6861,7 @@ end
%
\def\startcontents#1{%
% If @setchapternewpage on, and @headings double, the contents should
- % start on an odd page, unlike chapters. Thus, we maintain
- % \contentsalignmacro in parallel with \pagealignmacro.
- % From: Torbjorn Granlund <tege@matematik.su.se>
+ % start on an odd page, unlike chapters.
\contentsalignmacro
\immediate\closeout\tocfile
%
@@ -6857,6 +6876,9 @@ end
%
% Roman numerals for page numbers.
\ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+ \def\thistitle{}% no title in double-sided headings
+ % Record where the Roman numerals started.
+ \ifnum\romancount=0 \global\romancount=\pagecount \fi
}
% redefined for the two-volume lispref. We always output on
@@ -6879,8 +6901,7 @@ end
\fi
\closein 1
\endgroup
- \lastnegativepageno = \pageno
- \global\pageno = \savepageno
+ \contentsendroman
}
% And just the chapters.
@@ -6915,10 +6936,20 @@ end
\vfill \eject
\contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
+ \contentsendroman
+}
+\let\shortcontents = \summarycontents
+
+% Get ready to use Arabic numerals again
+\def\contentsendroman{%
\lastnegativepageno = \pageno
\global\pageno = \savepageno
+ %
+ % If \romancount > \arabiccount, the contents are at the end of the
+ % document. Otherwise, advance where the Arabic numerals start for
+ % the page numbers.
+ \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi
}
-\let\shortcontents = \summarycontents
% Typeset the label for a chapter or appendix for the short contents.
% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
@@ -7166,11 +7197,7 @@ end
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
% environment contents.
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
+
%
\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
\def\ctr{{\hskip 6pt\circle\char'010}}
@@ -7185,7 +7212,18 @@ end
%
\newskip\lskip\newskip\rskip
+% only require the font if @cartouche is actually used
+\def\cartouchefontdefs{%
+ \font\circle=lcircle10\relax
+ \circthick=\fontdimen8\circle
+}
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+
+
\envdef\cartouche{%
+ \cartouchefontdefs
\ifhmode\par\fi % can't be in the midst of a paragraph.
\startsavinginserts
\lskip=\leftskip \rskip=\rightskip
@@ -7364,13 +7402,9 @@ end
% @raggedright does more-or-less normal line breaking but no right
-% justification. From plain.tex. Don't stretch around special
-% characters in urls in this environment, since the stretch at the right
-% should be enough.
+% justification. From plain.tex.
\envdef\raggedright{%
\rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
- \def\urefprestretchamount{0pt}%
- \def\urefpoststretchamount{0pt}%
}
\let\Eraggedright\par
@@ -7429,7 +7463,7 @@ end
% @indentedblock is like @quotation, but indents only on the left and
% has no optional argument.
-%
+%
\makedispenvdef{indentedblock}{\indentedblockstart}
%
\def\indentedblockstart{%
@@ -7504,13 +7538,9 @@ end
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
%
% We typeset each line of the verbatim in an \hbox, so we can handle
-% tabs. The \global is in case the verbatim line starts with an accent,
-% or some other command that starts with a begin-group. Otherwise, the
-% entire \verbbox would disappear at the corresponding end-group, before
-% it is typeset. Meanwhile, we can't have nested verbatim commands
-% (can we?), so the \global won't be overwriting itself.
+% tabs.
\newbox\verbbox
-\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
+\def\starttabbox{\setbox\verbbox=\hbox\bgroup}
%
\begingroup
\catcode`\^^I=\active
@@ -7521,7 +7551,8 @@ end
\divide\dimen\verbbox by\tabw
\multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
\advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
- \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
+ \wd\verbbox=\dimen\verbbox
+ \leavevmode\box\verbbox \starttabbox
}%
}
\endgroup
@@ -7531,9 +7562,7 @@ end
\let\nonarrowing = t%
\nonfillstart
\tt % easiest (and conventionally used) font for verbatim
- % The \leavevmode here is for blank lines. Otherwise, we would
- % never \starttabox and the \egroup would end verbatim mode.
- \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
+ \def\par{\egroup\box\verbbox\endgraf\starttabbox}%
\tabexpand
\setupmarkupstyle{verbatim}%
% Respect line breaks,
@@ -7541,7 +7570,6 @@ end
% make each space count.
% Must do in this order:
\obeylines \uncatcodespecials \sepspaces
- \everypar{\starttabbox}%
}
% Do the @verb magic: verbatim text is quoted by unique
@@ -7576,9 +7604,12 @@ end
% ignore everything up to the first ^^M, that's the newline at the end
% of the @verbatim input line itself. Otherwise we get an extra blank
% line in the output.
- \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+ \xdef\doverbatim#1^^M#2@end verbatim{%
+ \starttabbox#2\egroup\noexpand\end\gobble verbatim}%
% We really want {...\end verbatim} in the body of the macro, but
% without the active space; thus we have to use \xdef and \gobble.
+ % The \egroup ends the \verbbox started at the end of the last line in
+ % the block.
\endgroup
%
\envdef\verbatim{%
@@ -7595,9 +7626,12 @@ end
{%
\makevalueexpandable
\setupverbatim
- \indexnofonts % Allow `@@' and other weird things in file names.
- \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
- \input #1
+ {%
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
+ \edef\tmp{\noexpand\input #1 }
+ \expandafter
+ }\expandafter\starttabbox\tmp\egroup
\afterenvbreak
}%
}
@@ -7726,7 +7760,7 @@ end
% @deftypefnnewline on|off says whether the return type of typed functions
% are printed on their own line. This affects @deftypefn, @deftypefun,
% @deftypeop, and @deftypemethod.
-%
+%
\parseargdef\deftypefnnewline{%
\def\temp{#1}%
\ifx\temp\onword
@@ -7742,6 +7776,21 @@ end
\fi\fi
}
+% \dosubind {index}{topic}{subtopic}
+%
+% If SUBTOPIC is present, precede it with a space, and call \doind.
+% (At some time during the 20th century, this made a two-level entry in an
+% index such as the operation index. Nobody seemed to notice the change in
+% behaviour though.)
+\def\dosubind#1#2#3{%
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty
+ \doind{#1}{#2}%
+ \else
+ \doind{#1}{#2\space#3}%
+ \fi
+}
+
% Untyped functions:
% @deffn category name args
@@ -7756,7 +7805,6 @@ end
% \deffngeneral {subind}category name args
%
\def\deffngeneral#1#2 #3 #4\endheader{%
- % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
\dosubind{fn}{\code{#3}}{#1}%
\defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
}
@@ -7907,7 +7955,7 @@ end
\tclose{\temp}% typeset the return type
\ifrettypeownline
% put return type on its own line; prohibit line break following:
- \hfil\vadjust{\nobreak}\break
+ \hfil\vadjust{\nobreak}\break
\else
\space % type on same line, so just followed by a space
\fi
@@ -7963,6 +8011,7 @@ end
\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
\gdef\magicamp{\let&=\amprm}
}
+\let\ampchar\&
\newcount\parencount
@@ -8043,36 +8092,18 @@ end
}
\fi
-% alias because \c means cedilla in @tex or @math
-\let\texinfoc=\c
-
-\newcount\savedcatcodeone
-\newcount\savedcatcodetwo
-
% Used at the time of macro expansion.
% Argument is macro body with arguments substituted
\def\scanmacro#1{%
\newlinechar`\^^M
\def\xeatspaces{\eatspaces}%
%
- % Temporarily undo catcode changes of \printindex. Set catcode of @ to
- % 0 so that @-commands in macro expansions aren't printed literally when
- % formatting an index file, where \ is used as the escape character.
- \savedcatcodeone=\catcode`\@
- \savedcatcodetwo=\catcode`\\
- \catcode`\@=0
- \catcode`\\=\active
- %
% Process the macro body under the current catcode regime.
- \scantokens{#1@texinfoc}%
- %
- \catcode`\@=\savedcatcodeone
- \catcode`\\=\savedcatcodetwo
+ \scantokens{#1@comment}%
%
- % The \texinfoc is to remove the \newlinechar added by \scantokens, and
- % can be noticed by \parsearg.
- % We avoid surrounding the call to \scantokens with \bgroup and \egroup
- % to allow macros to open or close groups themselves.
+ % The \comment is to remove the \newlinechar added by \scantokens, and
+ % can be noticed by \parsearg. Note \c isn't used because this means cedilla
+ % in math mode.
}
% Used for copying and captions
@@ -8173,12 +8204,14 @@ end
\def\macroargctxt{%
\scanctxt
\catcode`\ =\active
+ \catcode`\@=\other
\catcode`\^^M=\other
\catcode`\\=\active
}
\def\macrolineargctxt{% used for whole-line arguments without braces
\scanctxt
+ \catcode`\@=\other
\catcode`\{=\other
\catcode`\}=\other
}
@@ -8270,7 +8303,7 @@ end
% list to some hook where the argument is to be expanded. If there are
% less than 10 arguments that hook is to be replaced by ##N where N
% is the position in that list, that is to say the macro arguments are to be
-% defined `a la TeX in the macro body.
+% defined `a la TeX in the macro body.
%
% That gets used by \mbodybackslash (above).
%
@@ -8301,8 +8334,8 @@ end
%
% 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 backslashshes in the macro
% body to be transformed.
% Set \macrobody to the body of the macro, and call \defmacro.
%
@@ -8336,7 +8369,7 @@ end
% twice the \macarg.BLAH macros does not cost too much processing power.
\def\parsemmanyargdef@@#1,{%
\if#1;\let\next=\relax
- \else
+ \else
\let\next=\parsemmanyargdef@@
\edef\tempb{\eatspaces{#1}}%
\expandafter\def\expandafter\tempa
@@ -8421,7 +8454,7 @@ end
% Replace arguments by their values in the macro body, and place the result
% in macro \@tempa.
-%
+%
\def\macvalstoargs@{%
% To do this we use the property that token registers that are \the'ed
% within an \edef expand only once. So we are going to place all argument
@@ -8445,9 +8478,9 @@ end
\expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
}
-% Define the named-macro outside of this group and then close this group.
-%
-\def\macargexpandinbody@{%
+% Define the named-macro outside of this group and then close this group.
+%
+\def\macargexpandinbody@{%
\expandafter
\endgroup
\macargdeflist@
@@ -8485,7 +8518,7 @@ end
}
% Trailing missing arguments are set to empty.
-%
+%
\def\setemptyargvalues@{%
\ifx\paramlist\nilm@
\let\next\macargexpandinbody@
@@ -8562,7 +8595,7 @@ end
\else % at most 9
\ifnum\paramno<10\relax
% @MACNAME sets the context for reading the macro argument
- % @MACNAME@@ gets the argument, processes backslashes and appends a
+ % @MACNAME@@ gets the argument, processes backslashes and appends a
% comma.
% @MACNAME@@@ removes braces surrounding the argument list.
% @MACNAME@@@@ scans the macro body with arguments substituted.
@@ -8606,11 +8639,11 @@ end
% Call #1 with a list of tokens #2, with any doubled backslashes in #2
% compressed to one.
%
-% This implementation works by expansion, and not execution (so we cannot use
-% \def or similar). This reduces the risk of this failing in contexts where
-% complete expansion is done with no execution (for example, in writing out to
+% This implementation works by expansion, and not execution (so we cannot use
+% \def or similar). This reduces the risk of this failing in contexts where
+% complete expansion is done with no execution (for example, in writing out to
% an auxiliary file for an index entry).
-%
+%
% State is kept in the input stream: the argument passed to
% @look_ahead, @gobble_and_check_finish and @add_segment is
%
@@ -8632,11 +8665,11 @@ end
% #3 - NEXT_TOKEN
% #4 used to look ahead
%
-% If the next token is not a backslash, process the rest of the argument;
+% If the next token is not a backslash, process the rest of the argument;
% otherwise, remove the next token.
@gdef@look_ahead#1!#2#3#4{%
@ifx#4\%
- @expandafter@gobble_and_check_finish
+ @expandafter@gobble_and_check_finish
@else
@expandafter@add_segment
@fi#1!{#2}#4#4%
@@ -8660,9 +8693,9 @@ end
% #3 - NEXT_TOKEN
% #4 is input stream until next backslash
%
-% Input stream is either at the start of the argument, or just after a
-% backslash sequence, either a lone backslash, or a doubled backslash.
-% NEXT_TOKEN contains the first token in the input stream: if it is \finish,
+% Input stream is either at the start of the argument, or just after a
+% backslash sequence, either a lone backslash, or a doubled backslash.
+% NEXT_TOKEN contains the first token in the input stream: if it is \finish,
% finish; otherwise, append to ARG_RESULT the segment of the argument up until
% the next backslash. PENDING_BACKSLASH contains a backslash to represent
% a backslash just before the start of the input stream that has not been
@@ -8674,13 +8707,13 @@ end
% append the pending backslash to the result, followed by the next segment
@expandafter@is_fi@look_ahead#1#2#4!{\}@fi
% this @fi is discarded by @look_ahead.
- % we can't get rid of it with \expandafter because we don't know how
+ % we can't get rid of it with \expandafter because we don't know how
% long #4 is.
}
% #1 - THE_MACRO
% #2 - ARG_RESULT
-% #3 discards the res of the conditional in @add_segment, and @is_fi ends the
+% #3 discards the res of the conditional in @add_segment, and @is_fi ends the
% conditional.
@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
@@ -8692,7 +8725,7 @@ end
% for reading the argument (slightly different in the two cases). Then,
% to read the argument, in the whole-line case, it then calls the regular
% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
-%
+%
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorlinexxx{%
\ifx\nchar\bgroup
@@ -8742,9 +8775,29 @@ end
% also remove a trailing comma, in case of something like this:
% @node Help-Cross, , , Cross-refs
\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
-\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
+
+% Used so that the @top node doesn't have to be wrapped in an @ifnottex
+% conditional.
+% \doignore goes to more effort to skip nested conditionals but we don't need
+% that here.
+\def\omittopnode{%
+ \ifx\lastnode\wordTop
+ \expandafter\ignorenode\fi
+}
+\def\wordTop{Top}
+
+% Until the next @node or @bye command, divert output to a box that is not
+% output.
+\def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}%
+\ignorenodebye
+}
+
+{\let\bye\relax
+\gdef\ignorenodebye{\let\bye\ignorenodebyedef}
+\gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
+% The redefinition of \bye here is because it is declared \outer
-\let\nwnode=\node
\let\lastnode=\empty
% Write a cross-reference definition for the current node. #1 is the
@@ -8767,7 +8820,7 @@ end
% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
% anchor), which consists of three parts:
-% 1) NAME-title - the current sectioning name taken from \lastsection,
+% 1) NAME-title - the current sectioning name taken from \currentsection,
% or the anchor name.
% 2) NAME-snt - section number and type, passed as the SNT arg, or
% empty for anchors.
@@ -8789,7 +8842,7 @@ end
\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
##1}{##2}}% these are parameters of \writexrdef
}%
- \toks0 = \expandafter{\lastsection}%
+ \toks0 = \expandafter{\currentsection}%
\immediate \writexrdef{title}{\the\toks0 }%
\immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
\safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
@@ -8801,7 +8854,7 @@ end
% automatically in xrefs, if the third arg is not explicitly specified.
% This was provided as a "secret" @set xref-automatic-section-title
% variable, now it's official.
-%
+%
\parseargdef\xrefautomaticsectiontitle{%
\def\temp{#1}%
\ifx\temp\onword
@@ -8817,7 +8870,7 @@ end
\fi\fi
}
-%
+%
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
% the node name, #2 the name of the Info cross-reference, #3 the printed
% node name, #4 the name of the Info file, #5 the name of the printed
@@ -8970,40 +9023,34 @@ end
\fi
\else
% node/anchor (non-float) references.
- %
+ %
% If we use \unhbox to print the node names, TeX does not insert
% empty discretionaries after hyphens, which means that it will not
% find a line break at a hyphen in a node names. Since some manuals
% are best written with fairly long node names, containing hyphens,
% this is a loss. Therefore, we give the text of the node name
% again, so it is as if TeX is seeing it for the first time.
- %
+ %
\ifdim \wd\printedmanualbox > 0pt
% Cross-manual reference with a printed manual name.
- %
+ %
\crossmanualxref{\cite{\printedmanual\unskip}}%
%
\else\ifdim \wd\infofilenamebox > 0pt
% Cross-manual reference with only an info filename (arg 4), no
% printed manual name (arg 5). This is essentially the same as
% the case above; we output the filename, since we have nothing else.
- %
+ %
\crossmanualxref{\code{\infofilename\unskip}}%
%
\else
% Reference within this manual.
%
- % _ (for example) has to be the character _ for the purposes of the
- % control sequence corresponding to the node, but it has to expand
- % into the usual \leavevmode...\vrule stuff for purposes of
- % printing. So we \turnoffactive for the \refx-snt, back on for the
- % printing, back off for the \refx-pg.
- {\turnoffactive
- % Only output a following space if the -snt ref is nonempty; for
- % @unnumbered and @anchor, it won't be.
- \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
- \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
- }%
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ %
% output the `[mynode]' via the macro below so it can be overridden.
\xrefprintnodename\printedrefname
%
@@ -9027,20 +9074,20 @@ end
\endgroup}
% Output a cross-manual xref to #1. Used just above (twice).
-%
+%
% Only include the text "Section ``foo'' in" if the foo is neither
% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
% "see The Foo Manual", the idea being to refer to the whole manual.
-%
+%
% But, this being TeX, we can't easily compare our node name against the
% string "Top" while ignoring the possible spaces before and after in
% the input. By adding the arbitrary 7sp below, we make it much less
% likely that a real node name would have the same width as "Top" (e.g.,
% in a monospaced font). Hopefully it will never happen in practice.
-%
+%
% For the same basic reason, we retypeset the "Top" at every
% reference, since the current font is indeterminate.
-%
+%
\def\crossmanualxref#1{%
\setbox\toprefbox = \hbox{Top\kern7sp}%
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
@@ -9087,13 +9134,13 @@ end
\fi\fi\fi
}
-% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX
+% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX
% is output afterwards if non-empty.
\def\refx#1#2{%
\requireauxfile
{%
\indexnofonts
- \otherbackslash
+ \turnoffactive
\def\value##1{##1}%
\expandafter\global\expandafter\let\expandafter\thisrefX
\csname XR#1\endcsname
@@ -9119,9 +9166,9 @@ end
#2% Output the suffix in any case.
}
-% This is the macro invoked by entries in the aux file. Define a control
-% sequence for a cross-reference target (we prepend XR to the control sequence
-% name to avoid collisions). The value is the page number. If this is a float
+% This is the macro invoked by entries in the aux file. Define a control
+% sequence for a cross-reference target (we prepend XR to the control sequence
+% name to avoid collisions). The value is the page number. If this is a float
% type, we have more work to do.
%
\def\xrdef#1#2{%
@@ -9137,10 +9184,10 @@ end
\bgroup
\expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
\egroup
- % We put the \gdef inside a group to avoid the definitions building up on
- % TeX's save stack, which can cause it to run out of space for aux files with
+ % We put the \gdef inside a group to avoid the definitions building up on
+ % TeX's save stack, which can cause it to run out of space for aux files with
% thousands of lines. \gdef doesn't use the save stack, but \csname does
- % when it defines an unknown control sequence as \relax.
+ % when it defines an unknown control sequence as \relax.
%
% Was that xref control sequence that we just defined for a float?
\expandafter\iffloat\csname XR\safexrefname\endcsname
@@ -9219,19 +9266,6 @@ end
\catcode`\^^]=\other
\catcode`\^^^=\other
\catcode`\^^_=\other
- % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
- % in xref tags, i.e., node names. But since ^^e4 notation isn't
- % supported in the main text, it doesn't seem desirable. Furthermore,
- % that is not enough: for node names that actually contain a ^
- % character, we would end up writing a line like this: 'xrdef {'hat
- % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
- % argument, and \hat is not an expandable control sequence. It could
- % all be worked out, but why? Either we support ^^ or we don't.
- %
- % The other change necessary for this was to define \auxhat:
- % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
- % and then to call \auxhat in \setq.
- %
\catcode`\^=\other
%
% Special characters. Should be turned off anyway, but...
@@ -9249,14 +9283,7 @@ end
\catcode`\%=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
%
- % This is to support \ in node names and titles, since the \
- % characters end up in a \csname. It's easier than
- % leaving it active and making its active definition an actual \
- % character. What I don't understand is why it works in the *value*
- % of the xrdef. Seems like it should be a catcode12 \, and that
- % should not typeset properly. But it works, so I'm moving on for
- % now. --karl, 15jan04.
- \catcode`\\=\other
+ \catcode`\\=\active
%
% @ is our escape character in .aux files, and we need braces.
\catcode`\{=1
@@ -9519,7 +9546,7 @@ end
%
\ifimagevmode
\medskip % space after a standalone image
- \fi
+ \fi
\ifx\centersub\centerV \egroup \fi
\endgroup}
@@ -9587,13 +9614,13 @@ end
\global\advance\floatno by 1
%
{%
- % This magic value for \lastsection is output by \setref as the
+ % This magic value for \currentsection is output by \setref as the
% XREFLABEL-title value. \xrefX uses it to distinguish float
% labels (which have a completely different output format) from
% node and anchor labels. And \xrdef uses it to construct the
% lists of floats.
%
- \edef\lastsection{\floatmagic=\safefloattype}%
+ \edef\currentsection{\floatmagic=\safefloattype}%
\setref{\floatlabel}{Yfloat}%
}%
\fi
@@ -9716,7 +9743,7 @@ end
% #1 is the control sequence we are passed; we expand into a conditional
% which is true if #1 represents a float ref. That is, the magic
-% \lastsection value which we \setref above.
+% \currentsection value which we \setref above.
%
\def\iffloat#1{\expandafter\doiffloat#1==\finish}
%
@@ -10350,7 +10377,7 @@ directory should work if nowhere else does.}
\uppercase{.}
\endgroup
\else
- \errhelp = \EMsimple
+ \errhelp = \EMsimple
\errmessage{Unicode character U+#1 not supported, sorry}%
\fi
\else
@@ -10383,7 +10410,7 @@ directory should work if nowhere else does.}
\countUTFz = "#1\relax
\begingroup
\parseXMLCharref
-
+
% Give \u8:... its definition. The sequence of seven \expandafter's
% expands after the \gdef three times, e.g.
%
@@ -10395,7 +10422,7 @@ directory should work if nowhere else does.}
\expandafter\expandafter
\expandafter\expandafter
\expandafter\gdef \UTFviiiTmp{#2}%
- %
+ %
\expandafter\ifx\csname uni:#1\endcsname \relax \else
\message{Internal error, already defined: #1}%
\fi
@@ -10434,7 +10461,7 @@ directory should work if nowhere else does.}
\divide\countUTFz by 64
\countUTFy = \countUTFz % Save to be the future value of \countUTFz.
\multiply\countUTFz by 64
-
+
% \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
% in order to get the last five bits.
\advance\countUTFx by -\countUTFz
@@ -10469,7 +10496,7 @@ directory should work if nowhere else does.}
% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
-%
+%
% Many of our renditions are less than wonderful, and all the missing
% characters are available somewhere. Loading the necessary fonts
% awaits user request. We can't truly support Unicode without
@@ -10770,6 +10797,8 @@ directory should work if nowhere else does.}
\DeclareUnicodeCharacter{0233}{\=y}%
\DeclareUnicodeCharacter{0237}{\dotless{j}}%
%
+ \DeclareUnicodeCharacter{02BC}{'}%
+ %
\DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
%
% Greek letters upper case
@@ -11204,21 +11233,14 @@ directory should work if nowhere else does.}
\relax
}
-% define all Unicode characters we know about, for the sake of @U.
+% Define all Unicode characters we know about. This makes UTF-8 the default
+% input encoding and allows @U to work.
\iftxinativeunicodecapable
\nativeunicodechardefsatu
\else
\utfeightchardefs
\fi
-
-% Make non-ASCII characters printable again for compatibility with
-% existing Texinfo documents that may use them, even without declaring a
-% document encoding.
-%
-\setnonasciicharscatcode \other
-
-
\message{formatting,}
\newdimen\defaultparindent \defaultparindent = 15pt
@@ -11425,9 +11447,11 @@ directory should work if nowhere else does.}
%
\dimen0 = #1\relax
\advance\dimen0 by \voffset
+ \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page
%
\dimen2 = \hsize
\advance\dimen2 by \normaloffset
+ \advance\dimen2 by 1in % reference point is 1 inch from left edge of page
%
\internalpagesizes{#1}{\hsize}%
{\voffset}{\normaloffset}%
@@ -11512,9 +11536,9 @@ directory should work if nowhere else does.}
\def\texinfochars{%
\let< = \activeless
\let> = \activegtr
- \let~ = \activetilde
+ \let~ = \activetilde
\let^ = \activehat
- \markupsetuplqdefault \markupsetuprqdefault
+ \markupsetuplqdefault \markupsetuprqdefault
\let\b = \strong
\let\i = \smartitalic
% in principle, all other definitions in \tex have to be undone too.
@@ -11532,11 +11556,9 @@ directory should work if nowhere else does.}
% \backslashcurfont outputs one backslash character in current font,
% as in \char`\\.
\global\chardef\backslashcurfont=`\\
-\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
-% \realbackslash is an actual character `\' with catcode other, and
-% \doublebackslash is two of them (for the pdf outlines).
-{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+% \realbackslash is an actual character `\' with catcode other.
+{\catcode`\\=\other @gdef@realbackslash{\}}
% In Texinfo, backslash is an active character; it prints the backslash
% in fixed width font.
@@ -11554,10 +11576,8 @@ directory should work if nowhere else does.}
@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
-% \rawbackslash defines an active \ to do \backslashcurfont.
% \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other. We switch back and forth between these.
-@gdef@rawbackslash{@let\=@backslashcurfont}
+% catcode other.
@gdef@otherbackslash{@let\=@realbackslash}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
@@ -11629,7 +11649,7 @@ directory should work if nowhere else does.}
@ifx\@eatinput @let\ = @ttbackslash @fi
@catcode13=5 % regular end of line
@enableemergencynewline
- @let@c=@texinfoc
+ @let@c=@comment
@let@parsearg@originalparsearg
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
@@ -11675,7 +11695,7 @@ directory should work if nowhere else does.}
@markupsetuprqdefault
@c Local variables:
-@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c eval: (add-hook 'before-save-hook 'time-stamp)
@c page-delimiter: "^\\\\message\\|emacs-page"
@c time-stamp-start: "def\\\\texinfoversion{"
@c time-stamp-format: "%:y-%02m-%02d.%02H"
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index 63455c37..d9b7f683 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -1,11 +1,9 @@
-eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
- & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
- if 0;
-# Update an FSF copyright year list to include the current year.
+#!/bin/sh
+#! -*-perl-*-
-my $VERSION = '2017-09-13.06:45'; # UTC
+# Update an FSF copyright year list to include the current year.
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,9 +17,12 @@ my $VERSION = '2017-09-13.06:45'; # UTC
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
+#
# Written by Jim Meyering and Joel E. Denny
+# This script updates an FSF copyright year list to include the current year.
+# Usage: update-copyright [FILE...]
+#
# The arguments to this script should be names of files that contain
# copyright statements to be updated. The copyright holder's name
# defaults to "Free Software Foundation, Inc." but may be changed to
@@ -81,6 +82,7 @@ my $VERSION = '2017-09-13.06:45'; # UTC
# B. (c)
# C. @copyright{}
# D. &copy;
+# E. ©
#
# 4. The "Copyright" appears at the beginning of a line, except that it
# may be prefixed by any sequence (e.g., a comment) of no more than
@@ -96,7 +98,7 @@ my $VERSION = '2017-09-13.06:45'; # UTC
# 6. Blank lines, even if preceded by the prefix, do not appear
# within the FSF copyright statement.
# 7. Each copyright year is 2 or 4 digits, and years are separated by
-# commas or dashes. Whitespace may appear after commas.
+# commas, "-", or "--". Whitespace may appear after commas.
#
# Environment variables:
#
@@ -120,11 +122,32 @@ my $VERSION = '2017-09-13.06:45'; # UTC
# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
# than "Free Software Foundation, Inc.".
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line. The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name. The second line is essential for perl and is
+# also useful for editing this file in Emacs. The next two lines below
+# are valid code in both sh and perl. When executed by sh, they re-execute
+# the script through the perl program found in $PATH. The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh. When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx -0777 -pi "$0" "$@"'
+ if 0;
+
+my $VERSION = '2020-04-04.15:07'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
use strict;
use warnings;
my $copyright_re = 'Copyright';
-my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;)';
+my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;|©)';
my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
$holder ||= 'Free Software Foundation, Inc.';
my $prefix_max = 5;
@@ -169,7 +192,7 @@ while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
$holder_re =~ s/\s/$ws_re/g;
my $stmt_remainder_re =
"(?:$ws_re$circle_c_re)?"
- . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
+ . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|--?))*"
. "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
if (/\G$stmt_remainder_re/)
{
@@ -208,26 +231,28 @@ if (defined $stmt_re)
# Make the use of intervals consistent.
if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
{
- $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
+ $stmt =~ s/(\d{4})--?(\d{4})/join(', ', $1..$2)/eg;
}
else
{
+ my $ndash = $ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" : "-";
+
$stmt =~
s/
(\d{4})
(?:
- (,\ |-)
+ (,\ |--?)
((??{
- if ($2 eq '-') { '\d{4}'; }
+ if ($2 ne ', ') { '\d{4}'; }
elsif (!$3) { $1 + 1; }
else { $3 + 1; }
}))
)+
- /$1-$3/gx;
+ /$1$ndash$3/gx;
# When it's 2, emit a single range encompassing all year numbers.
$ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
- and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
+ and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1$ndash$2/;
}
# Format within margin.
@@ -263,10 +288,13 @@ else
print STDERR "$ARGV: warning: copyright statement not found\n";
}
+# Hey Emacs!
# Local variables:
+# coding: utf-8
# mode: perl
# indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-line-limit: 200
# time-stamp-start: "my $VERSION = '"
# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
# time-stamp-time-zone: "UTC0"
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index e1ed749b..c9a168f2 100755
--- a/build-aux/useless-if-before-free
+++ b/build-aux/useless-if-before-free
@@ -1,32 +1,47 @@
-eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"'
- & eval 'exec perl -wST "$0" $argv:q'
- if 0;
+#!/bin/sh
+#! -*-perl-*-
+
# Detect instances of "if (p) free (p);".
# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
-my $VERSION = '2017-09-13 06:45'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job. Otherwise, update this string manually.
-
-# Copyright (C) 2008-2017 Free Software Foundation, Inc.
-
+# Copyright (C) 2008-2020 Free Software Foundation, Inc.
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
+#
# Written by Jim Meyering
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line. The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name. The second line is essential for perl and is
+# also useful for editing this file in Emacs. The next two lines below
+# are valid code in both sh and perl. When executed by sh, they re-execute
+# the script through the perl program found in $PATH. The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh. When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx "$0" "$@"'
+ if 0;
+
+my $VERSION = '2020-04-04 15:07'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
use strict;
use warnings;
use Getopt::Long;
@@ -202,7 +217,8 @@ EOF
## Local Variables:
## mode: perl
## indent-tabs-mode: nil
-## eval: (add-hook 'write-file-hooks 'time-stamp)
+## eval: (add-hook 'before-save-hook 'time-stamp)
+## time-stamp-line-limit: 50
## time-stamp-start: "my $VERSION = '"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-time-zone: "UTC0"
diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
index 9ea6f19f..a8b8d9ab 100755
--- a/build-aux/vc-list-files
+++ b/build-aux/vc-list-files
@@ -2,9 +2,9 @@
# List version-controlled file names.
# Print a version string.
-scriptversion=2017-09-13.06; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2006-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ scriptversion=2017-09-13.06; # UTC
# list the version-controlled files in that directory.
# If there's an argument, it must be a single, "."-relative directory name.
-# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
+# cvsu is part of the cvsutils package: https://www.red-bean.com/cvsutils/
postprocess=
case $1 in
@@ -105,7 +105,7 @@ do
done
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
diff --git a/doc/fdl.texi b/doc/fdl.texi
index 9c3bbe56..542edaad 100644
--- a/doc/fdl.texi
+++ b/doc/fdl.texi
@@ -6,7 +6,7 @@
@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
-@uref{http://fsf.org/}
+@uref{https://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -414,7 +414,7 @@ The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
-@uref{http://www.gnu.org/copyleft/}.
+@uref{https://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
diff --git a/doc/gendocs_template b/doc/gendocs_template
index b45e5e63..ee26d331 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -1,5 +1,15 @@
<!--#include virtual="/server/header.html" -->
-<!-- Parent-Version: 1.77 -->
+<!-- Parent-Version: 1.78 -->
+
+<!--
+Copyright (C) 2006-2020 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without any warranty.
+-->
+
<title>%%TITLE%% - GNU Project - Free Software Foundation</title>
<!--#include virtual="/server/banner.html" -->
<h2>%%TITLE%%</h2>
@@ -77,7 +87,7 @@ the FSF. Broken links and other corrections or suggestions can be sent
to <a href="mailto:%%EMAIL%%">&lt;%%EMAIL%%&gt;</a>.</p>
</div>
-<p>Copyright &copy; 2017 Free Software Foundation, Inc.</p>
+<p>Copyright &copy; 2020 Free Software Foundation, Inc.</p>
<p>This page is licensed under a <a rel="license"
href="https://creativecommons.org/licenses/by-nd/3.0/us/">Creative
diff --git a/doc/make-stds.texi b/doc/make-stds.texi
index d37b2441..b0745a8a 100644
--- a/doc/make-stds.texi
+++ b/doc/make-stds.texi
@@ -549,15 +549,15 @@ should normally be @file{/usr/local/include}, but write it as
Most compilers other than GCC do not look for header files in directory
@file{/usr/local/include}. So installing the header files this way is
-only useful with GCC. Sometimes this is not a problem because some
-libraries are only really intended to work with GCC. But some libraries
+only useful with GCC@. Sometimes this is not a problem because some
+libraries are only really intended to work with GCC@. But some libraries
are intended to work with other compilers. They should install their
header files in two places, one specified by @code{includedir} and one
specified by @code{oldincludedir}.
@item oldincludedir
The directory for installing @samp{#include} header files for use with
-compilers other than GCC. This should normally be @file{/usr/include}.
+compilers other than GCC@. This should normally be @file{/usr/include}.
(If you are using Autoconf, you can write it as @samp{@@oldincludedir@@}.)
The Makefile commands should check whether the value of
diff --git a/doc/standards.texi b/doc/standards.texi
index b2c1ae91..f07bf623 100644
--- a/doc/standards.texi
+++ b/doc/standards.texi
@@ -3,7 +3,7 @@
@setfilename standards.info
@settitle GNU Coding Standards
@c This date is automagically updated when you save this file:
-@set lastupdate July 25, 2016
+@set lastupdate June 12, 2020
@c %**end of header
@dircategory GNU organization
@@ -28,7 +28,8 @@ The GNU coding standards, last updated @value{lastupdate}.
Copyright @copyright{} 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc.
+2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Free
+Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -87,7 +88,7 @@ If you did not obtain this file directly from the GNU project and
recently, please check for a newer version. You can get the GNU
Coding Standards from the GNU web server in many
different formats, including the Texinfo source, PDF, HTML, DVI, plain
-text, and more, at: @uref{http://www.gnu.org/prep/standards/}.
+text, and more, at: @uref{https://www.gnu.org/prep/standards/}.
If you are maintaining an official GNU package, in addition to this
document, please read and follow the GNU maintainer information
@@ -98,7 +99,7 @@ Software}).
If you want to receive diffs for every change to these GNU documents,
join the mailing list @code{gnustandards-commit@@gnu.org}, via the web
interface at
-@url{http://lists.gnu.org/mailman/listinfo/gnustandards-commit}.
+@url{https://lists.gnu.org/mailman/listinfo/gnustandards-commit}.
Archives are also available there.
@cindex @code{bug-standards@@gnu.org} email address
@@ -111,7 +112,7 @@ suggestion efficiently. We prefer a context diff to the Texinfo
source, but if that's difficult for you, you can make a context diff
for some other version of this document, or propose it in any way that
makes it clear. The source repository for this document can be found
-at @url{http://savannah.gnu.org/projects/gnustandards}.
+at @url{https://savannah.gnu.org/projects/gnustandards}.
These standards cover the minimum of what is important when writing a
GNU package. Likely, the need for additional standards will come up.
@@ -127,7 +128,7 @@ more maintainable by others.
The GNU Hello program serves as an example of how to follow the GNU
coding standards for a trivial program.
-@uref{http://www.gnu.org/software/hello/hello.html}.
+@uref{https://www.gnu.org/software/hello/hello.html}.
This release of the GNU Coding Standards was last updated
@value{lastupdate}.
@@ -234,12 +235,12 @@ Information for GNU Maintainers}.
@section Trademarks
@cindex trademarks
-Please do not include any trademark acknowledgements in GNU software
+Please do not include any trademark acknowledgments in GNU software
packages or documentation.
-Trademark acknowledgements are the statements that such-and-such is a
+Trademark acknowledgments are the statements that such-and-such is a
trademark of so-and-so. The GNU Project has no objection to the basic
-idea of trademarks, but these acknowledgements feel like kowtowing,
+idea of trademarks, but these acknowledgments feel like kowtowing,
and there is no legal requirement for them, so we don't use them.
What is legally required, as regards other people's trademarks, is to
@@ -254,12 +255,10 @@ C'' as a label for the compiler rather than for the language.
Please don't use ``win'' as an abbreviation for Microsoft Windows in
GNU software or documentation. In hacker terminology, calling
-something a ``win'' is a form of praise. If you wish to praise
-Microsoft Windows when speaking on your own, by all means do so, but
-not in GNU software. Usually we write the name ``Windows'' in full,
-but when brevity is very important (as in file names and sometimes
-symbol names), we abbreviate it to ``w''. For instance, the files and
-functions in Emacs that deal with Windows start with @samp{w32}.
+something a ``win'' is a form of praise. You're free to praise
+Microsoft Windows on your own if you want, but please don't do so in
+GNU packages. Please write ``Windows'' in full, or abbreviate it to
+``w.'' @xref{System Portability}.
@node Design Advice
@chapter General Program Design
@@ -291,7 +290,7 @@ account when designing your program.
@cindex programming languages
When you want to use a language that gets compiled and runs at high
-speed, the best language to use is C. C++ is ok too, but please don't
+speed, the best language to use is C@. C++ is ok too, but please don't
make heavy use of templates. So is Java, if you compile it.
When highest efficiency is not required, other languages commonly used
@@ -304,14 +303,14 @@ the more users are able to extend and combine them (@pxref{The Emacs
Thesis,,, guile, GNU Guile Reference Manual}).
Many programs are designed to be extensible: they include an interpreter
-for a language that is higher level than C. Often much of the program
+for a language that is higher level than C@. Often much of the program
is written in that language, too. The Emacs editor pioneered this
technique.
@cindex Guile
@cindex GNOME and Guile
The standard extensibility interpreter for GNU software is Guile
-(@uref{http://www.gnu.org/@/software/@/guile/}), which implements the
+(@uref{https://www.gnu.org/@/software/@/guile/}), which implements the
language Scheme (an especially clean and simple dialect of Lisp).
Guile also includes bindings for GTK+/GNOME, making it practical to
write modern GUI functionality within Guile. We don't reject programs
@@ -533,6 +532,8 @@ command line interface, and how libraries should behave.
* Libraries:: Library behavior.
* Errors:: Formatting error messages.
* User Interfaces:: Standards about interfaces generally.
+* Finding Program Files:: How to find the program's executable
+ and other files that go with it.
* Graphical Interfaces:: Standards for graphical interfaces.
* Command-Line Interfaces:: Standards for command line interfaces.
* Dynamic Plug-In Interfaces:: Standards for dynamic plug-in interfaces.
@@ -817,13 +818,16 @@ end with a period.
@cindex program name and its behavior
@cindex behavior, dependent on program's name
-Please don't make the behavior of a utility depend on the name used
-to invoke it. It is useful sometimes to make a link to a utility
-with a different name, and that should not change what it does.
+Please don't make the behavior of a utility depend on the name used to
+invoke it. It is useful sometimes to make a link to a utility with a
+different name, and that should not change what it does. Thus, if you
+make @file{foo} a link to @file{ls}, the program should behave the
+same regardless of which of those names is used to invoke it.
Instead, use a run time option or a compilation switch or both to
select among the alternate behaviors. You can also build two versions
-of the program, with different names and different default behaviors.
+of the program, with different default behaviors, and install them
+under two different names.
@cindex output device and program's behavior
Likewise, please don't make the behavior of a command-line program
@@ -856,6 +860,72 @@ output device type. For example, we provide a @code{dir} program much
like @code{ls} except that its default output format is always
multi-column format.
+@node Finding Program Files
+@section Finding the Program's Executable and Associated Files
+
+A program may need to find the executable file it was started with, so
+as to relaunch the same program. It may need to find associated
+files, either source files or files constructed by building, that
+it uses at run time.
+
+The way to find them starts with looking at @code{argv[0]}.
+
+If that string contains a slash, it is by convention the file name of
+the executable and its directory part is the directory that contained
+the executable. This is the case when the program was not found
+through @env{PATH}, which normally means it was built but not
+installed, and run from the build directory. The program can use the
+@code{argv[0]} file name to relaunch itself, and can look in its
+directory part for associated files. If that file name is not
+absolute, then it is relative to the working directory in which the
+program started.
+
+If @code{argv[0]} does not contain a slash, it is a command name whose
+executable was found via @env{PATH}. The program should search for
+that name in the directories in @env{PATH}, interpreting @file{.} as
+the working directory that was current when the program started.
+
+If this procedure finds the executable, we call the directory it was
+found in the @dfn{invocation directory}. The program should check
+for the presence in that directory of the associated files it needs.
+
+If the program's executable is normally built in a subdirectory of the
+main build directory, and the main build directory contains associated
+files (perhaps including subdirectories), the program should look at
+the parent of the invocation directory, checking for the associated
+files and subdirectories the main build directory should contain.
+
+If the invocation directory doesn't contain what's needed, but the
+executable file name is a symbolic link, the program should try using
+the link target's containing directory as the invocation directory.
+
+If this procedure doesn't come up with an invocation directory that is
+valid---normally the case for an installed program that was found via
+@env{PATH}---the program should look for the associated files in the
+directories where the program's makefile installs them.
+@xref{Directory Variables}.
+
+Providing valid information in @code{argv[0]} is a convention, not
+guaranteed. Well-behaved programs that launch other programs, such as
+shells, follow the convention; your code should follow it too, when
+launching other programs. But it is always possible to launch the
+program and give a nonsensical value in @code{argv[0]}.
+
+Therefore, any program that needs to know the location of its
+executable, or that of of other associated files, should offer the
+user environment variables to specify those locations explicitly.
+
+@strong{Don't give special privilege, such as with the @code{setuid}
+bit, to programs that will search heuristically for associated files
+or for their own executables when invoked that way.} Limit that
+privilege to programs that find associated files in hard-coded
+installed locations such as under @file{/usr} and @file{/etc}.
+
+@c ??? Is even that safe, in a setuid program?
+
+@xref{Bourne Shell Variables,,, bash, Bash Reference Manual},
+for more information about @env{PATH}.
+
@node Graphical Interfaces
@section Standards for Graphical Interfaces
@cindex graphical user interface
@@ -881,7 +951,7 @@ so that the same jobs can be done from scripts.
@cindex keyboard interface
@cindex library interface
Please also consider providing a D-bus interface for use from other
-running programs, such as within GNOME. (GNOME used to use CORBA
+running programs, such as within GNOME@. (GNOME used to use CORBA
for this, but that is being phased out.) In addition, consider
providing a library interface (for use from C), and perhaps a
keyboard-driven console interface (for use by users from console
@@ -890,7 +960,7 @@ the graphical interface, these won't be much extra work.
Please make your program interoperate with access technology such as
screen readers (see
-@url{http://www.gnu.org/accessibility/accessibility.html}). This should
+@url{https://www.gnu.org/accessibility/accessibility.html}). This should
be automatic if you use GTK+.
@node Command-Line Interfaces
@@ -1009,7 +1079,7 @@ Here's an example of output that follows these rules:
@smallexample
GNU hello 2.3
Copyright (C) 2007 Free Software Foundation, Inc.
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@end smallexample
@@ -1054,58 +1124,59 @@ abbreviation as usual, as in the examples below.
@table @asis
@item GPL
-GNU General Public License, @url{http://www.gnu.org/@/licenses/@/gpl.html}.
+GNU General Public License, @url{https://www.gnu.org/@/licenses/@/gpl.html}.
@item LGPL
-GNU Lesser General Public License, @url{http://www.gnu.org/@/licenses/@/lgpl.html}.
+GNU Lesser General Public License, @url{https://www.gnu.org/@/licenses/@/lgpl.html}.
@item GPL/Ada
GNU GPL with the exception for Ada.
@item Apache
The Apache Software Foundation license,
-@url{http://www.apache.org/@/licenses}.
+@url{https://directory.fsf.org/@/wiki/@/License:Apache2.0}.
@item Artistic
-The Artistic license used for Perl, @url{http://dev.perl.org/licenses/artistic.html}.
+The Artistic license used for Perl,
+@url{https://directory.fsf.org/@/wiki/@/License:ArtisticLicense2.0}.
@item Expat
-The Expat license, @url{http://www.jclark.com/@/xml/@/copying.txt}.
+The Expat license, @url{https://directory.fsf.org/@/wiki/@/License:Expat}.
@item MPL
-The Mozilla Public License, @url{http://www.mozilla.org/@/MPL/}.
+The Mozilla Public License, @url{https://directory.fsf.org/@/wiki/@/License:MPLv2.0}.
@item OBSD
-The original (4-clause) BSD license, incompatible with the GNU GPL
-@url{http://www.xfree86.org/@/3.3.6/@/COPYRIGHT2.html#6}.
+The original (4-clause) BSD license, incompatible with the GNU GPL,@*
+@url{https://directory.fsf.org/@/wiki/@/License:BSD_4Clause}.
@item PHP
-The license used for PHP, @url{http://www.php.net/@/license/}.
+The license used for PHP, @url{https://directory.fsf.org/@/wiki/@/License:PHPv3.01}.
@item public domain
-The non-license that is being in the public domain,
-@url{http://www.gnu.org/@/licenses/@/license-list.html#PublicDomain}.
+The non-license that is being in the public domain,@*
+@url{https://www.gnu.org/@/licenses/@/license-list.html#PublicDomain}.
@item Python
The license for Python,
-@url{http://directory.fsf.org/wiki?title=License:Python2.0.1}.
+@url{https://directory.fsf.org/@/wiki/@/License:Python2.0.1}.
@item RBSD
The revised (3-clause) BSD, compatible with the GNU GPL,@*
-@url{http://www.xfree86.org/@/3.3.6/@/COPYRIGHT2.html#5}.
+@url{https://directory.fsf.org/@/wiki/@/License:BSD_3Clause}.
@item X11
The simple non-copyleft license used for most versions of the X Window
-System, @url{http://www.xfree86.org/@/3.3.6/@/COPYRIGHT2.html#3}.
+System, @url{https://directory.fsf.org/@/wiki/@/License:X11}.
@item Zlib
-The license for Zlib, @url{http://www.gzip.org/@/zlib/@/zlib_license.html}.
+The license for Zlib, @url{https://directory.fsf.org/@/wiki/@/License:Zlib}.
@end table
More information about these licenses and many more are on the GNU
licensing web pages,
-@url{http://www.gnu.org/@/licenses/@/license-list.html}.
+@url{https://www.gnu.org/@/licenses/@/license-list.html}.
@node --help
@@ -1122,13 +1193,13 @@ is seen, and the program should not perform its normal function.
@cindex bug reports
Near the end of the @samp{--help} option's output, please place lines
giving the email address for bug reports, the package's home page
-(normally @indicateurl{http://www.gnu.org/software/@var{pkg}}, and the
+(normally @indicateurl{https://www.gnu.org/software/@var{pkg}}, and the
general page for help using GNU programs. The format should be like this:
@example
Report bugs to: @var{mailing-address}
-@var{pkg} home page: <http://www.gnu.org/software/@var{pkg}/>
-General help using GNU software: <http://www.gnu.org/gethelp/>
+@var{pkg} home page: <https://www.gnu.org/software/@var{pkg}/>
+General help using GNU software: <https://www.gnu.org/gethelp/>
@end example
It is ok to mention other appropriate mailing lists and web pages.
@@ -2301,7 +2372,7 @@ Print the version number.
The OID (object identifier) 1.3.6.1.4.1.11591 has been assigned to the
GNU Project (thanks to Sergey Poznyakoff). These are used for SNMP,
LDAP, X.509 certificates, and so on. The web site
-@url{http://www.alvestrand.no/objectid} has a (voluntary) listing of
+@url{https://www.alvestrand.no/objectid} has a (voluntary) listing of
many OID assignments.
If you need a new slot for your GNU package, write
@@ -2865,7 +2936,7 @@ versions. For a GNU program, this kind of portability is desirable, but
not paramount.
The primary purpose of GNU software is to run on top of the GNU kernel,
-compiled with the GNU C compiler, on various types of CPU. So the
+compiled with the GNU C compiler, on various types of CPU@. So the
kinds of portability that are absolutely necessary are quite limited.
But it is important to support Linux-based GNU systems, since they
are the form of GNU that is popular.
@@ -2888,20 +2959,21 @@ Avoid using the format of semi-internal data bases (e.g., directories)
when there is a higher-level alternative (@code{readdir}).
@cindex non-POSIX systems, and portability
-As for systems that are not like Unix, such as MSDOS, Windows, VMS, MVS,
+As for systems that are not like Unix, such as MS-DOS, Windows, VMS, MVS,
and older Macintosh systems, supporting them is often a lot of work.
When that is the case, it is better to spend your time adding features
that will be useful on GNU and GNU/Linux, rather than on supporting
other incompatible systems.
-If you do support Windows, please do not abbreviate it as ``win''. In
-hacker terminology, calling something a ``win'' is a form of praise.
-You're free to praise Microsoft Windows on your own if you want, but
-please don't do this in GNU packages. Instead of abbreviating
-``Windows'' to ``win'', you can write it in full or abbreviate it to
-``woe'' or ``w''. In GNU Emacs, for instance, we use @samp{w32} in
-file names of Windows-specific files, but the macro for Windows
-conditionals is called @code{WINDOWSNT}.
+If you do support Windows, please do not abbreviate it as ``win''.
+@xref{Trademarks}.
+
+Usually we write the name ``Windows'' in full, but when brevity is
+very important (as in file names and some symbol names), we abbreviate
+it to ``w''. In GNU Emacs, for instance, we use @samp{w32} in file
+names of Windows-specific files, but the macro for Windows
+conditionals is called @code{WINDOWSNT}. In principle there could
+also be @samp{w64}.
It is a good idea to define the ``feature test macro''
@code{_GNU_SOURCE} when compiling your C files. When you compile on GNU
@@ -2927,19 +2999,23 @@ However, don't make any effort to cater to the possibility that an
@code{int} will be less than 32 bits. We don't support 16-bit machines
in GNU.
-Similarly, don't make any effort to cater to the possibility that
-@code{long} will be smaller than predefined types like @code{size_t}.
-For example, the following code is ok:
+You need not cater to the possibility that @code{long} will be smaller
+than pointers and @code{size_t}. We know of one such platform: 64-bit
+programs on Microsoft Windows. If you care about making your package
+run on Windows using Mingw64, you would need to deal with 8-byte
+pointers and 4-byte @code{long}, which would break this code:
@example
printf ("size = %lu\n", (unsigned long) sizeof array);
printf ("diff = %ld\n", (long) (pointer2 - pointer1));
@end example
-1989 Standard C requires this to work, and we know of only one
-counterexample: 64-bit programs on Microsoft Windows. We will leave
-it to those who want to port GNU programs to that environment to
-figure out how to do it.
+Whether to support Mingw64, and Windows in general, in your package is
+your choice. The GNU Project doesn't say you have any responsibility to
+do so. Our goal is to replace proprietary systems, including Windows,
+not to enhance them. If people pressure you to make your program run
+on Windows, and you are not interested, you can respond with, ``Switch
+to GNU/Linux --- your freedom depends on it.''
Predefined file-size types like @code{off_t} are an exception: they are
longer than @code{long} on many platforms, so code like the above won't
@@ -3023,7 +3099,7 @@ On Windows, @code{errno} is not set on failure.
@end table
@cindex Gnulib
-@uref{http://www.gnu.org/software/gnulib/, Gnulib} is a big help in
+@uref{https://www.gnu.org/software/gnulib/, Gnulib} is a big help in
this regard. Gnulib provides implementations of standard interfaces
on many of the systems that lack them, including portable
implementations of enhanced GNU interfaces, thereby making their use
@@ -3310,6 +3386,33 @@ topic and reads it straight through. This means covering basic topics
at the beginning, and advanced topics only later. This also means
defining every specialized term when it is first used.
+Remember that the audience for a GNU manual (and other GNU
+documentation) is global, and that it will be used for years, maybe
+decades. This means that the reader could have very different cultural
+reference points. Decades from now, all but old folks will have very
+different cultural reference points; many things that "everyone knows
+about" today may be mostly forgotten.
+
+For this reason, try to avoid writing in a way that depends on
+cultural reference points for proper understanding, or that refers to them in
+ways that would impede reading for someone that doesn't recognize them.
+
+Likewise, be conservative in your choice of words (aside from technical
+terms), linguistic constructs, and spelling: aim to make them
+intelligible to readers from ten years ago. In any contest for
+trendiness, GNU writing should not even qualify to enter.
+
+It is ok to refer once in a rare while to spatially or temporally
+localized reference points or facts, if it is directly pertinent or as
+an aside. Changing these few things (which in any case stand out) when
+they no longer make sense will not be a lot of work.
+
+By contrast, it is always proper to refer to concepts of GNU and the
+free software movement, when they are pertinent. These are a central
+part of our message, so we should take advantage of opportunities to
+mention them. They are fundamental moral positions, so they will
+rarely if ever change.
+
Programmers tend to carry over the structure of the program as the
structure for its documentation. But this structure is not
necessarily good for explaining how to use the program; it may be
@@ -3399,7 +3502,7 @@ it is a function. @code{foo ()} is not a function, it is a function
call with no arguments.
Whenever possible, please stick to the active voice, avoiding the
-passive, and use the present tense, not the future teste. For
+passive, and use the present tense, not the future tense. For
instance, write ``The function @code{foo} returns a list containing
@var{a} and @var{b}'' rather than ``A list containing @var{a} and
@var{b} will be returned.'' One advantage of the active voice is it
@@ -3476,11 +3579,11 @@ documents---you only need one copy of the GNU FDL for the whole
collection. For a single short document, you can use a very permissive
non-copyleft license, to avoid taking up space with a long license.
-See @uref{http://www.gnu.org/copyleft/fdl-howto.html} for more explanation
+See @uref{https://www.gnu.org/copyleft/fdl-howto.html} for more explanation
of how to employ the GFDL.
Note that it is not obligatory to include a copy of the GNU GPL or GNU
-LGPL in a manual whose license is neither the GPL nor the LGPL. It can
+LGPL in a manual whose license is neither the GPL nor the LGPL@. It can
be a good idea to include the program's license in a large manual; in a
short manual, whose size would be increased considerably by including
the program's license, it is probably better not to include it.
@@ -3501,7 +3604,7 @@ The FSF publishes some GNU manuals in printed form. To encourage sales
of these manuals, the on-line versions of the manual should mention at
the very start that the printed manual is available and should point at
information for getting it---for instance, with a link to the page
-@url{http://www.gnu.org/order/order.html}. This should not be included
+@url{https://www.gnu.org/order/order.html}. This should not be included
in the printed manual, though, because there it is redundant.
It is also useful to explain in the on-line forms of the manual how the
@@ -3532,7 +3635,76 @@ future will know about the changes that might have introduced the bug.
Often a new bug can be found by looking at what was recently changed.
More importantly, change logs can help you eliminate conceptual
inconsistencies between different parts of a program, by giving you a
-history of how the conflicting concepts arose and who they came from.
+history of how the conflicting concepts arose, who they came from, and
+why the conflicting changes were made.
+
+@cindex software forensics, and change logs
+Therefore, change logs should be detailed enough and accurate enough
+to provide the information commonly required for such @dfn{software
+forensics}. Specifically, change logs should make finding answers to
+the following questions easy:
+
+@itemize @bullet
+@item
+What changes affected a particular source file?
+
+@item
+Was a particular source file renamed or moved, and if so, as part of
+what change?
+
+@item
+What changes affected a given function or macro or definition of a
+data structure?
+
+@item
+Was a function (or a macro or the definition of a data structure)
+renamed or moved from another file, and if so, as part of which
+change?
+
+@item
+What changes deleted a function (or macro or data structure)?
+
+@item
+What was the rationale for a given change, and what were its main
+ideas?
+
+@item
+Is there any additional information regarding the change, and if so,
+where can it be found?
+@end itemize
+
+@cindex VCS
+@cindex version control system, for keeping change logs
+Historically, change logs were maintained on specially formatted
+files. Nowadays, projects commonly keep their source files under a
+@dfn{version control system} (@acronym{VCS}), such as Git,
+Subversion, or Mercurial. If the @acronym{VCS} repository is publicly
+accessible, and changes are committed to it separately (one commit for
+each logical changeset) and record the authors of each change, then
+the information recorded by the @acronym{VCS} can be used to produce
+the change logs out of @acronym{VCS} logs, and to answer the above
+questions by using the suitable @acronym{VCS} commands. (However, the
+@acronym{VCS} log messages still need to provide some supporting
+information, as described below.) Projects that maintain such
+@acronym{VCS} repositories can decide not to maintain separate change
+log files, and instead rely on the @acronym{VCS} to keep the change
+logs.
+
+If you decide not to maintain separate change log files, you should
+still consider providing them in the release tarballs, for the benefit
+of users who'd like to review the change logs without accessing the
+project's @acronym{VCS} repository. Scripts exist that can produce
+@file{ChangeLog} files from the @acronym{VCS} logs; for example, the
+@file{gitlog-to-changelog} script, which is part of Gnulib, can do
+that for Git repositories. In Emacs, the command @kbd{C-x v a}
+(@code{vc-update-change-log}) does the job of incrementally updating a
+@file{ChangeLog} file from the @acronym{VCS} logs.
+
+If separate change log files @emph{are} maintained, they are normally
+called @file{ChangeLog}, and each such file covers an entire
+directory. Each directory can have its own change log file, or a
+directory can use the change log of its parent directory---it's up to
+you.
@menu
* Change Log Concepts::
@@ -3543,59 +3715,127 @@ history of how the conflicting concepts arose and who they came from.
@end menu
@node Change Log Concepts
-@subsection Change Log Concepts
+@subsection Change Log Concepts and Conventions
-@cindex change set
-@cindex batch of changes
+@cindex changeset, in a change log
+@cindex batch of changes, in a change log
You can think of the change log as a conceptual ``undo list'' which
-explains how earlier versions were different from the current version.
+states how earlier versions were different from the current version.
People can see the current version; they don't need the change log to
tell them what is in it. What they want from a change log is a clear
explanation of how the earlier version differed. Each @dfn{entry} in
a change log describes either an individual change or the smallest
-batch of changes that belong together, also known as a @dfn{change
-set}.
-@cindex title, change log entry
-@cindex description, change log entry
-For later reference or for summarizing, sometimes it is useful to
-start the entry with a one-line description (sometimes called a
-@dfn{title}) to describe its overall purpose.
-
-In the past, we recommended not mentioning changes in non-software
-files (manuals, help files, media files, etc.)@: in change logs.
-However, we've been advised that it is a good idea to include them,
-for the sake of copyright records.
-
-The change log file is normally called @file{ChangeLog} and covers an
-entire directory. Each directory can have its own change log, or a
-directory can use the change log of its parent directory---it's up to
-you.
-
-Another alternative is to record change log information with a version
-control system such as RCS or CVS. This can be converted automatically
-to a @file{ChangeLog} file using @code{rcs2log}; in Emacs, the command
-@kbd{C-x v a} (@code{vc-update-change-log}) does the job.
+batch of changes that belong together, also known as a @dfn{changeset}.
-For changes to code, there's no need to describe the full purpose of
-the changes or how they work together. If you think that a change
-calls for explanation, you're probably right. Please do explain
-it---but please put the full explanation in comments in the code,
-where people will see it whenever they see the code. For example,
-``New function'' is enough for the change log when you add a function,
-because there should be a comment before the function definition to
-explain what it does, how to call it, and so on.
-
-For changes to files that do not support a comment syntax (e.g., media
-files), it is ok to include the full explanation in the change log file,
-after the title and before the list of individual changes.
+@cindex title, change log entry
+@cindex header line, change log entry
+It is a good idea to start the change log entry with a @dfn{header
+line}: a single line that is a complete sentence which summarizes the
+changeset. If you keep the change log in a @acronym{VCS}, this
+should be a requirement, as @acronym{VCS} commands that show the
+change log in abbreviated form, such as @kbd{git log --oneline}, treat
+the header line specially. (In a @file{ChangeLog} file, the header
+line follows a line that says who was the author of the change and
+when it was installed.)
-The easiest way to add an entry to @file{ChangeLog} is with the Emacs
-command @kbd{M-x add-change-log-entry}. An individual change should
-have an asterisk, the name of the changed file, and then in
-parentheses the name of the changed functions, variables or whatever,
-followed by a colon. Then describe the changes you made to that
-function or variable.
+@cindex description, change log entry
+Follow the change log entry's header line with a description of the
+overall change. This should be as long as needed to give a clear
+description. Pay special attention to aspects of the changeset not
+easily gleaned from the diffs or from the names of modified files and
+functions: the overall idea of the change and the need for it, and the
+relations, if any, between changes made to different files/functions.
+If the change or its reasons were discussed on some public forum, such
+as the project's issue tracker or mailing list, it is a good idea to
+summarize the main points of that discussion in the change's
+description, and include a pointer to that discussion or the issue ID
+for those who'd like to read it in full.
+
+The best place to explain how parts of the new code work with other code
+is in comments in the code, not in the change log.
+
+If you think that a change calls for explanation of @emph{why} the
+change was needed---that is, what problem the old code had such that
+it required this change---you're probably right. Please put the
+explanation in comments in the code, where people will see it whenever
+they see the code. An example of such an explanation is, ``This
+function used to be iterative, but that failed when MUMBLE was a
+tree.'' (Though such a simple reason would not need this kind of
+explanation.)
+
+The best place for other kinds of explanation of the change is in the
+change log entry. In particular, comments usually will not say why
+some code was deleted or moved to another place---that belongs to the
+description of the change which did that.
+
+Following the free-text description of the change, it is a good idea
+to give a list of names of the entities or definitions that you
+changed, according to the files they are in, and what was changed in
+each one. @xref{Style of Change Logs}. If a project uses a modern
+@acronym{VCS} to keep the change log information, as described in
+@ref{Change Logs}, explicitly listing the files and functions that
+were changed is not strictly necessary, and in some cases (like
+identical mechanical changes in many places) even tedious. It is up
+to you to decide whether to allow your project's developers to omit
+the list of changed files and functions from the log entries, and
+whether to allow such omissions under some specific conditions.
+However, while making this decision, please consider the following
+benefits of providing the list of changed entities with each change:
+
+@itemize @bullet
+@item
+Generation of useful @file{ChangeLog} files from @acronym{VCS} logs
+becomes more difficult if the change log entries don't list the
+modified functions/macros, because @acronym{VCS} commands cannot
+reliably reproduce their names from the commit information alone. For
+example, when there is a change in the header part of a function
+definition, the heading of the diff hunk as shown in the VCS log
+commands will name the wrong function as being modified (usually, the
+function defined before the one being modified), so using those diffs
+to glean the names of the modified functions will produce inaccurate
+results. You will need to use specialized scripts, such as gnulib's
+@file{vcs-to-changelog.py}, mentioned below, to solve these
+difficulties, and make sure it supports the source languages used by
+your project.
+
+@item
+While modern @acronym{VCS} commands, such as Git's @kbd{git log -L}
+and @kbd{git log -G}, provide powerful means for finding changes that
+affected a certain function or macro or data structure (and thus might
+make @file{ChangeLog} files unnecessary if you have the repository
+available), they can sometimes fail. For example, @kbd{git log -L}
+doesn't support syntax of some programming languages out of the box.
+Mentioning the modified functions/macros explicitly allows finding the
+related changes simply and reliably.
+
+@item
+Some @acronym{VCS} commands have difficulties or limitations when
+tracking changes across file moves or renames. Again, if the entities
+are mentioned explicitly, those difficulties can be overcome.
+
+@item
+Users that review changes using the generated @file{ChangeLog} files
+may not have the repository and the @acronym{VCS} commands available
+to them. Naming the modified entities alleviates that problem.
+@end itemize
+@noindent
+For these reasons, providing lists of modified files and functions
+with each change makes the change logs more useful, and we therefore
+recommend to include them whenever possible and practical.
+
+It is also possible to generate the lists naming the modified entities
+by running a script. One such script is @file{mklog.py} (written in
+Python 3); it is used by the @code{GCC} project. Gnulib provides
+another variant of such a script, called @file{vcs-to-changelog.py},
+part of the @code{vcs-to-changelog} module. Note that these scripts
+currently support fewer programming languages than the manual commands
+provided by Emacs (@pxref{Style of Change Logs}). Therefore, the
+above mentioned method of generating the @code{ChangeLog} file from
+the @acronym{VCS} commit history, for instance via the
+@code{gitlog-to-changelog} script, usually gives better
+results---provided that the contributors stick to providing good
+commit messages.
@node Style of Change Logs
@subsection Style of Change Logs
@@ -3604,30 +3844,47 @@ function or variable.
Here are some simple examples of change log entries, starting with the
header line that says who made the change and when it was installed,
followed by descriptions of specific changes. (These examples are
-drawn from Emacs and GCC.)
+drawn from Emacs.) Keep in mind that the line which shows the date of
+the change and the author's name and email address is needed only in a
+separate @file{ChangeLog} file, not when the change logs are kept in a
+@acronym{VCS}.
@example
-1998-08-17 Richard Stallman <rms@@gnu.org>
+2019-08-29 Noam Postavsky <npostavs@@gmail.com>
+
+ Handle completely undecoded input in term (Bug#29918)
+
+ * lisp/term.el (term-emulate-terminal): Avoid errors if the whole
+ decoded string is eight-bit characters. Don't attempt to save the
+ string for next iteration in that case.
+ * test/lisp/term-tests.el (term-decode-partial)
+ (term-undecodable-input): New tests.
-* register.el (insert-register): Return nil.
-(jump-to-register): Likewise.
+2019-06-15 Paul Eggert <eggert@@cs.ucla.edu>
-* sort.el (sort-subr): Return nil.
+ Port to platforms where tputs is in libtinfow
-* tex-mode.el (tex-bibtex-file, tex-file, tex-region):
-Restart the tex shell if process is gone or stopped.
-(tex-shell-running): New function.
+ * configure.ac (tputs_library): Also try tinfow, ncursesw (Bug#33977).
-* expr.c (store_one_arg): Round size up for move_block_to_reg.
-(expand_call): Round up when emitting USE insns.
-* stmt.c (assign_parms): Round size up for move_block_from_reg.
+2019-02-08 Eli Zaretskii <eliz@@gnu.org>
+
+ Improve documentation of 'date-to-time' and 'parse-time-string'
+
+ * doc/lispref/os.texi (Time Parsing): Document
+ 'parse-time-string', and refer to it for the description of
+ the argument of 'date-to-time'.
+
+ * lisp/calendar/time-date.el (date-to-time): Refer in the doc
+ string to 'parse-time-string' for more information about the
+ format of the DATE argument. (Bug#34303)
@end example
-It's important to name the changed function or variable in full. Don't
-abbreviate function or variable names, and don't combine them.
-Subsequent maintainers will often search for a function name to find all
-the change log entries that pertain to it; if you abbreviate the name,
-they won't find it when they search.
+If you mention the names of the modified functions or variables, it's
+important to name them in full. Don't abbreviate function or variable
+names, and don't combine them. Subsequent maintainers will often
+search for a function name to find all the change log entries that
+pertain to it; if you abbreviate the name, they won't find it when
+they search.
For example, some people are tempted to abbreviate groups of function
names by writing @samp{* register.el (@{insert,jump-to@}-register)};
@@ -3641,13 +3898,22 @@ the same file.
Break long lists of function names by closing continued lines with
@samp{)}, rather than @samp{,}, and opening the continuation with
-@samp{(} as in this example:
+@samp{(}. This makes highlighting in Emacs work better.
+Here is an example:
@example
-* keyboard.c (menu_bar_items, tool_bar_items)
+* src/keyboard.c (menu_bar_items, tool_bar_items)
(Fexecute_extended_command): Deal with 'keymap' property.
@end example
+The easiest way to add an entry to @file{ChangeLog} is with the Emacs
+command @kbd{M-x add-change-log-entry}, or its variant @kbd{C-x 4 a}
+(@code{add-change-log-entry-other-window}). This automatically
+collects the name of the changed file and the changed function or
+variable, and formats a change log entry according to the conventions
+described above, leaving it up to you to describe the changes you made
+to that function or variable.
+
When you install someone else's changes, put the contributor's name in
the change log entry rather than in the text of the entry. In other
words, write this:
@@ -3667,7 +3933,24 @@ rather than this:
* sewing.c: Make it sew. Patch by jdoe@@gnu.org.
@end example
+When committing someone else's changes into a @acronym{VCS}, use the
+@acronym{VCS} features to specify the author. For example, with Git,
+use @kbd{git commit --author=@var{author}}.
+
As for the date, that should be the date you applied the change.
+(With a @acronym{VCS}, use the appropriate command-line switches,
+e.g., @kbd{git commit --date=@var{date}}.)
+
+Modern @acronym{VCS} have commands to apply changes sent via email
+(e.g., Git has @kbd{git am}); in that case the author of the changeset
+and the date it was made will be automatically gleaned from the email
+message and recorded in the repository. If the patches are prepared
+with suitable @acronym{VCS} commands, such as @kbd{git format-patch},
+the email message body will also have the original author of the
+changeset, so resending or forwarding the message will not interfere
+with attributing the changes to their author. Thus, we recommend that
+you request your contributors to use commands such as @kbd{git
+format-patch} to prepare the patches.
@node Simple Changes
@subsection Simple Changes
@@ -3675,6 +3958,15 @@ As for the date, that should be the date you applied the change.
Certain simple kinds of changes don't need much detail in the change
log.
+If the description of the change is short enough, it can serve as its
+own header line:
+
+@example
+2019-08-29 Eli Zaretskii <eliz@@gnu.org>
+
+ * lisp/simple.el (kill-do-not-save-duplicates): Doc fix. (Bug#36827)
+@end example
+
When you change the calling sequence of a function in a simple fashion,
and you change all the callers of the function to use the new calling
sequence, there is no need to make individual entries for all the
@@ -3690,17 +3982,33 @@ When you change just comments or doc strings, it is enough to write an
entry for the file, without mentioning the functions. Just ``Doc
fixes'' is enough for the change log.
-There's no technical need to make change log entries for documentation
-files. This is because documentation is not susceptible to bugs that
-are hard to fix. Documentation does not consist of parts that must
-interact in a precisely engineered fashion. To correct an error, you
-need not know the history of the erroneous passage; it is enough to
-compare what the documentation says with the way the program actually
-works.
+When you make changes in many files that follow mechanically from one
+underlying change, it is enough to describe the underlying change.
+Here's an example of a change that affects all of the files in the
+repository:
-However, you should keep change logs for documentation files when the
+@example
+2019-01-07 Paul Eggert <eggert@@cs.ucla.edu>
+
+ Update copyright year to 2019
+
+ Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
+@end example
+
+Test suite files are part of the software, so we recommend treating
+them as code for change-log purposes.
+
+There's no technical need to make change log entries for non-software
+files (manuals, help files, media files, etc.). This is because they
+are not susceptible to bugs that are hard to understand. To correct
+an error, you need not know the history of the erroneous passage; it
+is enough to compare what the file says with the actual facts.
+
+However, you should keep change logs for non-software files when the
project gets copyright assignments from its contributors, so as to
-make the records of authorship more accurate.
+make the records of authorship more accurate. For that reason, we
+recommend to keep change logs for Texinfo sources of your project's
+manuals.
@node Conditional Changes
@subsection Conditional Changes
@@ -3808,7 +4116,7 @@ distribution until someone else agrees to update it.
When a program changes only a little, you may feel that the
discrepancies are small enough that the man page remains useful without
updating. If so, put a prominent note near the beginning of the man
-page explaining that you don't maintain it and that the Texinfo manual
+page stating that you don't maintain it and that the Texinfo manual
is more authoritative. The note should say how to access the Texinfo
documentation.
@@ -3822,7 +4130,7 @@ they can be considered true manuals, use the GFDL (@pxref{License for
Manuals}).
Finally, the GNU help2man program
-(@uref{http://www.gnu.org/software/help2man/}) is one way to automate
+(@uref{https://www.gnu.org/software/help2man/}) is one way to automate
generation of a man page, in this case from @option{--help} output.
This is sufficient in many cases.
@@ -3846,7 +4154,7 @@ with the FSF about the individual case.
@cindex releasing
Making a release is more than just bundling up your source files in a
-tar file and putting it up for FTP. You should set up your software so
+tar file and putting it up for FTP@. You should set up your software so
that it can be configured to run on a variety of systems. Your Makefile
should conform to the GNU standards described below, and your directory
layout should also conform to the standards discussed below. Doing so
@@ -3898,7 +4206,7 @@ time. The files that @code{configure} reads should be listed as
dependencies of @file{Makefile}.
All the files which are output from the @code{configure} script should
-have comments at the beginning explaining that they were generated
+have comments at the beginning stating that they were generated
automatically using @code{configure}. This is so that users won't think
of trying to edit them by hand.
@@ -3952,7 +4260,7 @@ The @code{configure} script needs to be able to decode all plausible
alternatives for how to describe a machine. Thus,
@samp{athlon-pc-gnu/linux} would be a valid alias. There is a shell
script called
-@uref{http://git.savannah.gnu.org/@/gitweb/@/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD,
+@uref{https://git.savannah.gnu.org/@/gitweb/@/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD,
@file{config.sub}} that you can use as a subroutine to validate system
types and canonicalize aliases.
@@ -3963,7 +4271,7 @@ plain @var{buildtype} argument. For example, @samp{configure
i686-pc-linux-gnu}. When the build type is not specified by an option
or argument, the @code{configure} script should normally guess it using
the shell script
-@uref{http://git.savannah.gnu.org/@/gitweb/@/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD,
+@uref{https://git.savannah.gnu.org/@/gitweb/@/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD,
@file{config.guess}}.
@cindex optional features, configure-time
@@ -4149,7 +4457,7 @@ names for one file in different directories, because certain file
systems cannot handle this and that prevents unpacking the
distribution.
-Try to make sure that all the file names will be unique on MS-DOS. A
+Try to make sure that all the file names will be unique on MS-DOS@. A
name on MS-DOS consists of up to 8 characters, optionally followed by a
period and up to three characters. MS-DOS will truncate extra
characters both before and after the period. Thus,
@@ -4177,16 +4485,16 @@ ethical problem, and our aim is to put an end to that problem. We
can't stop some people from writing proprietary programs, or stop
other people from using them, but we can and should refuse to
advertise them to new potential customers, or to give the public the
-idea that their existence is ethical.
+impression that their existence is legitimate.
The GNU definition of free software is found on the GNU web site at
-@url{http://www.gnu.org/@/philosophy/@/free-sw.html}, and the definition
+@url{https://www.gnu.org/@/philosophy/@/free-sw.html}, and the definition
of free documentation is found at
-@url{http://www.gnu.org/@/philosophy/@/free-doc.html}. The terms ``free''
+@url{https://www.gnu.org/@/philosophy/@/free-doc.html}. The terms ``free''
and ``non-free'', used in this document, refer to those definitions.
A list of important licenses and whether they qualify as free is in
-@url{http://www.gnu.org/@/licenses/@/license-list.html}. If it is not
+@url{https://www.gnu.org/@/licenses/@/license-list.html}. If it is not
clear whether a license qualifies as free, please ask the GNU Project
by writing to @email{licensing@@gnu.org}. We will answer, and if the
license is an important one, we will add it to the list.
@@ -4196,7 +4504,8 @@ passing---that is harmless, since users who might want to use it
probably already know about it. For instance, it is fine to explain
how to build your package on top of some widely used non-free
operating system, or how to use it together with some widely used
-non-free program.
+non-free program, after first explaining how to use it on the GNU
+system.
However, you should give only the necessary information to help those
who already use the non-free program to use your program with
@@ -4209,6 +4518,11 @@ program with it, while people who don't already use the proprietary
program will not see anything likely to lead them to take an interest
in it.
+You shouldn't recommend any non-free add-ons for the non-free program,
+but it is ok to mention free add-ons that help it to work with your
+program, and how to install the free add-ons even if that requires
+running some non-free program.
+
If a non-free program or system is obscure in your program's domain,
your program should not mention or support it at all, since doing so
would tend to popularize the non-free program more than it popularizes
@@ -4217,17 +4531,18 @@ program among the users of Foobar, if the existence of Foobar is not
generally known among people who might want to use your program.)
Sometimes a program is free software in itself but depends on a
-non-free platform in order to run. For instance, many Java programs
-depend on some non-free Java libraries. To recommend or promote such
-a program is to promote the other programs it needs. This is why we
-are careful about listing Java programs in the Free Software
-Directory: we don't want to promote the non-free Java libraries.
-
-We hope this particular problem with Java will be gone by and by, as
-we replace the remaining non-free standard Java libraries with free
-software, but the general principle will remain the same: don't
-recommend, promote or legitimize programs that depend on non-free
-software to run.
+non-free platform in order to run. For instance, it used to be the
+case that many Java programs depended on some non-free Java libraries.
+(See @uref{https://www.gnu.org/philosophy/java-trap.html}.)
+To recommend or promote such a program is to promote the other
+programs it needs; therefore, judge mentions of the former as if they
+were mentions of the latter. For this reason, we were careful about
+listing Java programs in the Free Software Directory: we wanted to
+avoid promoting the non-free Java libraries.
+
+Java no longer has this problem, but the general principle will remain
+the same: don't recommend, promote or legitimize programs that depend
+on non-free software to run.
Some free programs strongly encourage the use of non-free software. A
typical example is @command{mplayer}. It is free software in itself,
@@ -4261,25 +4576,25 @@ program is promoting that program, so please do not make links to (or
mention by name) web sites that contain such material. This policy is
relevant particularly for the web pages for a GNU package.
-Following links from nearly any web site can lead eventually to
-non-free software; this is inherent in the nature of the web. So it
-makes no sense to criticize a site for having such links. As long as
-the site does not itself recommend a non-free program, there is no
-need to consider the question of the sites that it links to for other
-reasons.
-
-Thus, for example, you should not refer to AT&T's web site if that
-recommends AT&T's non-free software packages; you should not refer to
-a page @var{p} that links to AT&T's site presenting it as a place to get
-some non-free program, because that part of the page @var{p} itself
-recommends and legitimizes the non-free program. However, that @var{p}
-contains a link to AT&T's web site for some other purpose (such as
-long-distance telephone service) is not an objection against it.
-
-A web page recommends a program in a particularly strong way if it
-requires users to run that program in order to use the page. Many
-pages contain Javascript code which they recommend in this way. This
-Javascript code may be free or nonfree, but nonfree is the usual case.
+What about chains of links? Following links from nearly any web site
+can lead eventually to promotion of non-free software; this is
+inherent in the nature of the web. Here's how we treat that.
+
+You should not refer to AT&T's web site if that recommends AT&T's
+non-free software packages; you should not refer to a page @var{p}
+that links to AT&T's site presenting it as a place to get some
+non-free program, because that part of the page @var{p} itself
+recommends and legitimizes the non-free program.
+
+However, if @var{p} contains a link to AT&T's web site for some other
+purpose (such as long-distance telephone service), that is no reason
+you should not link to @var{p}.
+
+A web page recommends a program in an implicit but particularly strong
+way if it requires users to run that program in order to use the page.
+Many pages contain Javascript code which they recommend in this way.
+This Javascript code may be free or nonfree, but nonfree is the usual
+case.
If the purpose for which you would refer to the page cannot be carried
out without running nonfree Javascript code, then you should not refer
@@ -4312,7 +4627,7 @@ or find another place to refer to that information.
@bye
Local variables:
-eval: (add-hook 'write-file-hooks 'time-stamp)
+eval: (add-hook 'before-save-hook 'time-stamp)
time-stamp-start: "@set lastupdate "
time-stamp-end: "$"
time-stamp-format: "%:b %:d, %:y"
diff --git a/lib/Autom4te/Channels.pm b/lib/Autom4te/Channels.pm
index 4383ab17..345fc357 100644
--- a/lib/Autom4te/Channels.pm
+++ b/lib/Autom4te/Channels.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm
index 16b2de97..3920fd0b 100644
--- a/lib/Autom4te/FileUtils.pm
+++ b/lib/Autom4te/FileUtils.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2017 Free Software Foundation, Inc.
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -47,11 +47,13 @@ use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
@EXPORT = qw (&contents
&find_file &mtime
- &update_file &up_to_date_p
+ &update_file
&xsystem &xsystem_hint &xqx
&dir_has_case_matching_file &reset_dir_cache
&set_dir_cache_file);
+=over 4
+
=item C<find_file ($file_name, @include)>
Return the first path for a C<$file_name> in the C<include>s.
@@ -161,48 +163,21 @@ sub update_file ($$;$)
return
}
- my $exists = (-f "$to");
- if ($exists)
+ if (-f "$to")
{
- # Back up any existing destination.
+ # Back up and install the new one.
move ("$to", "$to$SIMPLE_BACKUP_SUFFIX")
or fatal "cannot backup $to: $!";
+ move ("$from", "$to")
+ or fatal "cannot rename $from as $to: $!";
+ msg 'note', "'$to' is updated";
}
-
- # Do not use move ("$from", "$to"), as it truncates file timestamps.
- rename ("$from", "$to")
- or system ("mv", "$from", "$to") == 0
- or fatal "cannot rename $from as $to: $!";
-
- msg 'note', ($exists ? "'$to' is updated" : "'$to is created")
-}
-
-
-=item C<up_to_date_p ($file, @dep)>
-
-Is C<$file> more recent than C<@dep>?
-
-=cut
-
-# $BOOLEAN
-# &up_to_date_p ($FILE, @DEP)
-# ---------------------------
-sub up_to_date_p ($@)
-{
- my ($file, @dep) = @_;
- my $mtime = mtime ($file);
-
- foreach my $dep (@dep)
+ else
{
- if ($mtime < mtime ($dep))
- {
- verb "up_to_date ($file): outdated: $dep";
- return 0;
- }
+ move ("$from", "$to")
+ or fatal "cannot rename $from as $to: $!";
+ msg 'note', "'$to' is created";
}
-
- verb "up_to_date ($file): up to date";
- return 1;
}
@@ -404,4 +379,6 @@ sub set_dir_cache_file ($$)
if exists $_directory_cache{$dirname};
}
+=back
+
1; # for require
diff --git a/lib/Autom4te/Getopt.pm b/lib/Autom4te/Getopt.pm
index 1de3fcbf..42133e32 100644
--- a/lib/Autom4te/Getopt.pm
+++ b/lib/Autom4te/Getopt.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2017, 2020 Free Software Foundation, Inc.
+# Copyright (C) 2012-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -96,20 +96,3 @@ L<Getopt::Long>
=cut
1; # for require
-
-### Setup "GNU" style for perl-mode and cperl-mode.
-## Local Variables:
-## perl-indent-level: 2
-## perl-continued-statement-offset: 2
-## perl-continued-brace-offset: 0
-## perl-brace-offset: 0
-## perl-brace-imaginary-offset: 0
-## perl-label-offset: -2
-## cperl-indent-level: 2
-## cperl-brace-offset: 0
-## cperl-continued-brace-offset: 0
-## cperl-label-offset: -2
-## cperl-extra-newline-before-brace: t
-## cperl-merge-trailing-else: nil
-## cperl-continued-statement-offset: 2
-## End:
diff --git a/lib/Autom4te/XFile.pm b/lib/Autom4te/XFile.pm
index d57c723c..feebce0e 100644
--- a/lib/Autom4te/XFile.pm
+++ b/lib/Autom4te/XFile.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/m4/autobuild.m4 b/m4/autobuild.m4
index f5f2a189..fd1ed879 100644
--- a/m4/autobuild.m4
+++ b/m4/autobuild.m4
@@ -1,5 +1,5 @@
# autobuild.m4 serial 7
-dnl Copyright (C) 2004, 2006-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/maint.mk b/maint.mk
index 80c726ec..2a0d2b4c 100644
--- a/maint.mk
+++ b/maint.mk
@@ -2,7 +2,7 @@
# This Makefile fragment tries to be general-purpose enough to be
# used by many projects via the gnulib maintainer-makefile module.
-## Copyright (C) 2001-2017, 2020 Free Software Foundation, Inc.
+## Copyright (C) 2001-2020 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -21,6 +21,13 @@
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
ME := maint.mk
+# These variables ought to be defined through the configure.ac section
+# of the module description. But some packages import this file directly,
+# ignoring the module description.
+AWK ?= awk
+GREP ?= grep
+SED ?= sed
+
# Helper variables.
_empty =
_sp = $(_empty) $(_empty)
@@ -46,7 +53,7 @@ member-check = \
# Do not save the original name or timestamp in the .tar.gz file.
# Use --rsyncable if available.
gzip_rsyncable := \
- $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \
+ $(shell gzip --help 2>/dev/null|$(GREP) rsyncable >/dev/null \
&& printf %s --rsyncable)
GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
@@ -83,9 +90,9 @@ _sc_excl = \
$(or $(exclude_file_name_regexp--$@),^$$)
VC_LIST_EXCEPT = \
$(VC_LIST) | $(SED) 's|^$(_dot_escaped_srcdir)/||' \
- | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
- else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
- | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
+ | if test -f $(srcdir)/.x-$@; then $(GREP) -vEf $(srcdir)/.x-$@; \
+ else $(GREP) -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
+ | $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
$(_prepend_srcdir_prefix)
ifeq ($(origin prev_version_file), undefined)
@@ -184,7 +191,7 @@ $(sc_z_rules_): %.z: %
@end=$$(date +%s.%N); \
start=$$(cat .sc-start-$*); \
rm -f .sc-start-$*; \
- awk -v s=$$start -v e=$$end \
+ $(AWK) -v s=$$start -v e=$$end \
'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null
# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper
@@ -292,42 +299,56 @@ define _sc_search_regexp
\
: Filter by file name; \
if test -n "$$in_files"; then \
- files=$$(find $(srcdir) | grep -E "$$in_files" \
- | grep -Ev '$(_sc_excl)'); \
+ files=$$(find $(srcdir) | $(GREP) -E "$$in_files" \
+ | $(GREP) -Ev '$(_sc_excl)'); \
else \
files=$$($(VC_LIST_EXCEPT)); \
if test -n "$$in_vc_files"; then \
- files=$$(echo "$$files" | grep -E "$$in_vc_files"); \
+ files=$$(echo "$$files" | $(GREP) -E "$$in_vc_files"); \
fi; \
fi; \
\
: Filter by content; \
- test -n "$$files" && test -n "$$containing" \
- && { files=$$(grep -l "$$containing" $$files); } || :; \
- test -n "$$files" && test -n "$$non_containing" \
- && { files=$$(grep -vl "$$non_containing" $$files); } || :; \
+ test -n "$$files" \
+ && test -n "$$containing" \
+ && { files=$$(echo "$$files" | xargs $(GREP) -l "$$containing"); } \
+ || :; \
+ test -n "$$files" \
+ && test -n "$$non_containing" \
+ && { files=$$(echo "$$files" | xargs $(GREP) -vl "$$non_containing"); } \
+ || :; \
\
: Check for the construct; \
if test -n "$$files"; then \
if test -n "$$prohibit"; then \
- grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \
- | grep -vE "$${exclude:-^$$}" \
- && { msg="$$halt" $(_sc_say_and_exit) } || :; \
+ echo "$$files" \
+ | xargs $(GREP) $$with_grep_options $(_ignore_case) -nE \
+ "$$prohibit" /dev/null \
+ | $(GREP) -vE "$${exclude:-^$$}" \
+ && { msg="$$halt" $(_sc_say_and_exit) } \
+ || :; \
else \
- grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \
- | grep . \
- && { msg="$$halt" $(_sc_say_and_exit) } || :; \
+ echo "$$files" \
+ | xargs \
+ $(GREP) $$with_grep_options $(_ignore_case) -LE "$$require" \
+ | $(GREP) . \
+ && { msg="$$halt" $(_sc_say_and_exit) } \
+ || :; \
fi \
else :; \
fi || :;
endef
sc_avoid_if_before_free:
- @$(srcdir)/$(_build-aux)/useless-if-before-free \
- $(useless_free_options) \
- $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) && \
- { echo '$(ME): found useless "if" before "free" above' 1>&2; \
- exit 1; } || :
+ @$(VC_LIST_EXCEPT) \
+ | $(GREP) -v useless-if-before-free \
+ | xargs \
+ $(srcdir)/$(_build-aux)/useless-if-before-free \
+ $(useless_free_options) \
+ && { printf '$(ME): found useless "if"' \
+ ' before "free" above\n' 1>&2; \
+ exit 1; } \
+ || :
sc_cast_of_argument_to_free:
@prohibit='\<free *\( *\(' halt="don't cast free argument" \
@@ -388,6 +409,43 @@ sc_prohibit_magic_number_exit:
halt='use EXIT_* values rather than magic number' \
$(_sc_search_regexp)
+# Check that we don't use $< in non-implicit Makefile rules.
+#
+# To find the Makefiles, trace AC_CONFIG_FILES. Using VC_LIST would
+# miss the Makefiles that are not under VC control (e.g., symlinks
+# installed for gettext). "Parsing" (recursive) uses of SUBDIRS seems
+# too delicate.
+#
+# Use GNU Make's --print-data-base to normalize the rules into some
+# easy to parse format: they are separated by two \n. Look for the
+# "section" about non-pattern rules (marked with "# Files") inside
+# which there are still the POSIX Make like implicit rules (".c.o").
+sc_prohibit_gnu_make_extensions_awk_ = \
+ BEGIN { \
+ RS = "\n\n"; \
+ in_rules = 0; \
+ } \
+ /^\# Files/ { \
+ in_rules = 1; \
+ } \
+ /\$$</ && in_rules && $$0 !~ /^(.*\n)*\.\w+(\.\w+)?:/ { \
+ print "Error: " file ": $$< in a non implicit rule\n" $$0; \
+ status = 1; \
+ } \
+ END { \
+ exit status; \
+ }
+sc_prohibit_gnu_make_extensions:
+ @if $(AWK) --version | grep GNU >/dev/null 2>&1; then \
+ (cd $(srcdir) && autoconf --trace AC_CONFIG_FILES:'$$1') | \
+ tr ' ' '\n' | \
+ $(SED) -ne '/Makefile/{s/\.in$$//;p;}' | \
+ while read m; do \
+ $(MAKE) -qp -f $$m .DUMMY-TARGET 2>/dev/null | \
+ $(AWK) -v file=$$m -e '$($@_awk_)' || exit 1; \
+ done; \
+ fi
+
# Using EXIT_SUCCESS as the first argument to error is misleading,
# since when that parameter is 0, error does not exit. Use '0' instead.
sc_error_exit_success:
@@ -399,28 +457,35 @@ sc_error_exit_success:
# "FATAL:" should be fully upper-cased in error messages
# "WARNING:" should be fully upper-cased, or fully lower-cased
sc_error_message_warn_fatal:
- @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
- | grep -E '"Warning|"Fatal|"fatal' && \
- { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \
- exit 1; } || :
+ @$(VC_LIST_EXCEPT) \
+ | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \
+ | $(GREP) -E '"Warning|"Fatal|"fatal' \
+ && { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \
+ exit 1; } \
+ || :
# Error messages should not start with a capital letter
sc_error_message_uppercase:
- @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
- | grep -E '"[A-Z]' \
- | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \
- { echo '$(ME): found capitalized error message' 1>&2; \
- exit 1; } || :
+ @$(VC_LIST_EXCEPT) \
+ | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \
+ | $(GREP) -E '"[A-Z]' \
+ | $(GREP) -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' \
+ && { echo '$(ME): found capitalized error message' 1>&2; \
+ exit 1; } \
+ || :
# Error messages should not end with a period
sc_error_message_period:
- @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
- | grep -E '[^."]\."' && \
- { echo '$(ME): found error message ending in period' 1>&2; \
- exit 1; } || :
+ @$(VC_LIST_EXCEPT) \
+ | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \
+ | $(GREP) -E '[^."]\."' \
+ && { echo '$(ME): found error message ending in period' 1>&2; \
+ exit 1; } \
+ || :
sc_file_system:
@prohibit=file''system \
+ exclude='/proc/filesystems' \
ignore_case=1 \
halt='found use of "file''system"; spell it "file system"' \
$(_sc_search_regexp)
@@ -458,8 +523,8 @@ perl_config_h_first_ = \
# You must include <config.h> before including any other header file.
# This can possibly be via a package-specific header, if given by cfg.mk.
sc_require_config_h_first:
- @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
- files=$$($(VC_LIST_EXCEPT) | grep '\.c$$') && \
+ @if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \
+ files=$$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$') && \
perl -n $(perl_config_h_first_) $$files || \
{ echo '$(ME): the above files include some other header' \
'before <config.h>' 1>&2; exit 1; } || :; \
@@ -477,10 +542,10 @@ sc_prohibit_HAVE_MBRTOWC:
define _sc_header_without_use
dummy=; : so we do not need a semicolon before each use; \
h_esc=`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`; \
- if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
- files=$$(grep -l '^# *include '"$$h_esc" \
- $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
- grep -LE "$$re" $$files | grep . && \
+ if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \
+ files=$$($(GREP) -l '^# *include '"$$h_esc" \
+ $$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$')) && \
+ $(GREP) -LE "$$re" $$files | $(GREP) . && \
{ echo "$(ME): the above files include $$h but don't use it" \
1>&2; exit 1; } || :; \
else :; \
@@ -510,7 +575,7 @@ sc_prohibit_quote_without_use:
# Don't include this header unless you use one of its functions.
sc_prohibit_long_options_without_use:
- @h='long-options.h' re='\<parse_long_options *\(' \
+ @h='long-options.h' re='\<parse_(long_options|gnu_standard_options_only) *\(' \
$(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
@@ -571,7 +636,7 @@ sc_prohibit_posixver_without_use:
@h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use)
sc_prohibit_same_without_use:
- @h='same.h' re='\<same_name *\(' $(_sc_header_without_use)
+ @h='same.h' re='\<same_name(at)? *\(' $(_sc_header_without_use)
sc_prohibit_hash_pjw_without_use:
@h='hash-pjw.h' \
@@ -584,7 +649,7 @@ sc_prohibit_safe_read_without_use:
sc_prohibit_argmatch_without_use:
@h='argmatch.h' \
- re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
+ re='(\<(ARGMATCH_DEFINE_GROUP|ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
$(_sc_header_without_use)
sc_prohibit_canonicalize_without_use:
@@ -734,9 +799,9 @@ Exit_base := $(notdir $(Exit_witness_file))
sc_require_test_exit_idiom:
@if test -f $(srcdir)/$(Exit_witness_file); then \
die=0; \
- for i in $$(grep -l -F 'srcdir/$(Exit_base)' \
+ for i in $$($(GREP) -l -F 'srcdir/$(Exit_base)' \
$$($(VC_LIST) tests)); do \
- tail -n1 $$i | grep '^Exit .' > /dev/null \
+ tail -n1 $$i | $(GREP) '^Exit .' > /dev/null \
&& : || { die=1; echo $$i; } \
done; \
test $$die = 1 && \
@@ -841,18 +906,23 @@ endef
# Don't define macros that we already get from gnulib header files.
sc_prohibit_always-defined_macros:
@if test -d $(gnulib_dir); then \
- case $$(echo all: | grep -l -f - Makefile) in Makefile);; *) \
+ case $$(echo all: | $(GREP) -l -f - Makefile) in Makefile);; *) \
echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
esac; \
- $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT)) \
- && { echo '$(ME): define the above via some gnulib .h file' \
- 1>&2; exit 1; } || :; \
+ regex=$$($(def_sym_regex)); export regex; \
+ $(VC_LIST_EXCEPT) \
+ | xargs sh -c 'echo $$regex | $(GREP) -E -f - "$$@"' \
+ dummy /dev/null \
+ && { printf '$(ME): define the above' \
+ ' via some gnulib .h file\n' 1>&2; \
+ exit 1; } \
+ || :; \
fi
# ==================================================================
# Prohibit checked in backup files.
sc_prohibit_backup_files:
- @$(VC_LIST) | grep '~$$' && \
+ @$(VC_LIST) | $(GREP) '~$$' && \
{ echo '$(ME): found version controlled backup file' 1>&2; \
exit 1; } || :
@@ -871,7 +941,7 @@ sc_GFDL_version:
$(_sc_search_regexp)
# Don't use Texinfo's @acronym{}.
-# https://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html
+# https://lists.gnu.org/r/bug-gnulib/2010-03/msg00321.html
texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$
sc_texinfo_acronym:
@prohibit='@acronym\{' \
@@ -926,9 +996,11 @@ require_exactly_one_NL_at_EOF_ = \
} \
END { exit defined $$fail }
sc_prohibit_empty_lines_at_EOF:
- @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \
- || { echo '$(ME): empty line(s) or no newline at EOF' \
- 1>&2; exit 1; } || :
+ @$(VC_LIST_EXCEPT) \
+ | xargs perl -le '$(require_exactly_one_NL_at_EOF_)' \
+ || { echo '$(ME): empty line(s) or no newline at EOF' 1>&2; \
+ exit 1; } \
+ || :
# Make sure we don't use st_blocks. Use ST_NBLOCKS instead.
# This is a bit of a kludge, since it prevents use of the string
@@ -971,9 +1043,12 @@ prohibit_doubled_word_ = \
ignore_doubled_word_match_RE_ ?= ^$$
sc_prohibit_doubled_word:
- @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \
- | grep -vE '$(ignore_doubled_word_match_RE_)' \
- | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || :
+ @$(VC_LIST_EXCEPT) \
+ | xargs perl -n -0777 $(prohibit_doubled_word_) \
+ | $(GREP) -vE '$(ignore_doubled_word_match_RE_)' \
+ | $(GREP) . \
+ && { echo '$(ME): doubled words' 1>&2; exit 1; } \
+ || :
# A regular expression matching undesirable combinations of words like
# "can not"; this matches them even when the two words appear on different
@@ -997,10 +1072,12 @@ prohibit_undesirable_word_seq_ = \
ignore_undesirable_word_sequence_RE_ ?= ^$$
sc_prohibit_undesirable_word_seq:
- @perl -n -0777 $(prohibit_undesirable_word_seq_) \
- $$($(VC_LIST_EXCEPT)) \
- | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \
- && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || :
+ @$(VC_LIST_EXCEPT) \
+ | xargs perl -n -0777 $(prohibit_undesirable_word_seq_) \
+ | $(GREP) -vE '$(ignore_undesirable_word_sequence_RE_)' \
+ | $(GREP) . \
+ && { echo '$(ME): undesirable word sequence' >&2; exit 1; } \
+ || :
# Except for shell files and for loops, double semicolon is probably a mistake
sc_prohibit_double_semicolon:
@@ -1032,7 +1109,8 @@ sc_prohibit_test_double_equal:
# definition of LDADD from the appropriate Makefile.am and exits 0
# when it contains "ICONV".
sc_proper_name_utf8_requires_ICONV:
- @progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
+ @progs=$$($(VC_LIST_EXCEPT) \
+ | xargs $(GREP) -l 'proper_name_utf8 ''("'); \
if test "x$$progs" != x; then \
fail=0; \
for p in $$progs; do \
@@ -1041,7 +1119,7 @@ sc_proper_name_utf8_requires_ICONV:
-ne 'exit !(/^LDADD =(.+?[^\\]\n)/ms && $$1 =~ /ICONV/)' \
$$dir/Makefile.am && continue; \
base=$$(basename "$$p" .c); \
- grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
+ $(GREP) "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
|| { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
done; \
test $$fail = 1 && \
@@ -1102,12 +1180,12 @@ sc_makefile_at_at_check:
-e ' && !/(\w+)\s+=.*\@\1\@$$/' \
-e ''$(_makefile_at_at_check_exceptions) \
-e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \
- $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
+ $$($(VC_LIST_EXCEPT) | $(GREP) -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
&& { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
news-check: NEWS
$(AM_V_GEN)if $(SED) -n $(news-check-lines-spec)p $< \
- | grep -E $(news-check-regexp) >/dev/null; then \
+ | $(GREP) -E $(news-check-regexp) >/dev/null; then \
:; \
else \
echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2; \
@@ -1152,12 +1230,13 @@ generated_files ?= $(srcdir)/lib/*.[ch]
_gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$)
sc_po_check:
@if test -f $(po_file); then \
- grep -E -v '^(#|$$)' $(po_file) \
- | grep -v '^src/false\.c$$' | sort > $@-1; \
- files=$$(perl $(perl_translatable_files_list_) \
- $$($(VC_LIST_EXCEPT)) $(generated_files)); \
- grep -E -l '$(_gl_translatable_string_re)' $$files \
- | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \
+ $(GREP) -E -v '^(#|$$)' $(po_file) \
+ | $(GREP) -v '^src/false\.c$$' | sort > $@-1; \
+ { $(VC_LIST_EXCEPT); echo $(generated_files); } \
+ | xargs perl $(perl_translatable_files_list_) \
+ | xargs $(GREP) -E -l '$(_gl_translatable_string_re)' \
+ | $(SED) 's|^$(_dot_escaped_srcdir)/||' \
+ | sort -u > $@-2; \
diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \
|| { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \
rm -f $@-1 $@-2; \
@@ -1221,18 +1300,21 @@ _hv_regex_weak ?= ^ *\. .*/init\.sh"
_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
sc_cross_check_PATH_usage_in_tests:
@if test -f $(_hv_file); then \
- grep -l 'VERSION mismatch' $(_hv_file) >/dev/null \
+ $(GREP) -l 'VERSION mismatch' $(_hv_file) >/dev/null \
|| { echo "$@: skipped: no such file: $(_hv_file)" 1>&2; \
exit 0; }; \
- grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null \
+ $(GREP) -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null \
|| { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \
exit 1; }; \
- good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file)); \
- grep -LFx "$$good" \
- $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT))) \
- | grep . && \
- { echo "$(ME): the above files use path_prepend_ inconsistently" \
- 1>&2; exit 1; } || :; \
+ good=$$($(GREP) -E '$(_hv_regex_strong)' $(_hv_file)); \
+ $(VC_LIST_EXCEPT) \
+ | xargs $(GREP) -lE '$(_hv_regex_weak)' \
+ | xargs $(GREP) -LFx "$$good" \
+ | $(GREP) . \
+ && { printf "$(ME): the above files use" \
+ " path_prepend_ inconsistently\n" 1>&2; \
+ exit 1; } \
+ || :; \
fi
# BRE regex of file contents to identify a test script.
@@ -1304,7 +1386,7 @@ gpg_key_ID ?= \
$$(cd $(srcdir) \
&& git cat-file tag v$(VERSION) \
| $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null \
- | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
+ | $(AWK) '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
translation_project_ ?= coordinator@translationproject.org
@@ -1425,7 +1507,7 @@ check: $(gl_public_submodule_commit)
ALL_RECURSIVE_TARGETS += alpha beta stable
alpha beta stable: $(local-check) writable-files $(submodule-checks)
$(AM_V_GEN)test $@ = stable \
- && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
+ && { echo $(VERSION) | $(GREP) -E '^[0-9]+(\.[0-9]+)+$$' \
|| { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
|| :
$(AM_V_at)$(MAKE) vc-diff-check
@@ -1523,7 +1605,7 @@ refresh-gnulib-patches:
-e 'END{defined $$d and print $$d}' bootstrap.conf); \
test -n "$$t" && gl=$$t; \
fi; \
- for diff in $$(cd $$gl; git ls-files | grep '\.diff$$'); do \
+ for diff in $$(cd $$gl; git ls-files | $(GREP) '\.diff$$'); do \
b=$$(printf %s "$$diff"|$(SED) 's/\.diff$$//'); \
VERSION_CONTROL=none \
patch "$(gnulib_dir)/$$b" "$$gl/$$diff" || exit 1; \
@@ -1566,7 +1648,7 @@ update-copyright-env ?=
# in the file .x-update-copyright.
.PHONY: update-copyright
update-copyright:
- $(AM_V_GEN)grep -l -w Copyright \
+ $(AM_V_GEN)$(GREP) -l -w Copyright \
$$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \
| $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@
@@ -1580,9 +1662,9 @@ _gl_TS_dir ?= src
ALL_RECURSIVE_TARGETS += sc_tight_scope
sc_tight_scope: tight-scope.mk
@fail=0; \
- if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk \
+ if ! $(GREP) '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk \
> /dev/null \
- && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
+ && ! $(GREP) -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
> /dev/null 2>&1; then \
echo '$(ME): skipping $@'; \
else \
@@ -1654,12 +1736,12 @@ _gl_tight_scope: $(bin_PROGRAMS)
hdr=`for f in $(_gl_TS_headers); do \
test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
( printf '%s\n' '__.*' $(_gl_TS_unmarked_extern_functions); \
- grep -h -A1 '^extern .*[^;]$$' $$src \
- | grep -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \
+ $(GREP) -h -A1 '^extern .*[^;]$$' $$src \
+ | $(GREP) -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \
perl -lne \
'$(_gl_TS_function_match) and print $$1' $$hdr; \
) | sort -u | $(SED) "$$sed_wrap" > $$t; \
- nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \
+ nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|$(GREP) -Ev -f $$t \
&& { echo the above functions should have static scope >&2; \
exit 1; } || : ; \
( printf '%s\n' '__.*' main $(_gl_TS_unmarked_extern_vars); \
@@ -1667,7 +1749,7 @@ _gl_tight_scope: $(bin_PROGRAMS)
$$hdr $(_gl_TS_other_headers) \
) | sort -u | $(SED) "$$sed_wrap" > $$t; \
nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \
- | sort -u | grep -Ev -f $$t \
+ | sort -u | $(GREP) -Ev -f $$t \
&& { echo the above variables should have static scope >&2; \
exit 1; } || :
# TS-end