aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb@gnu.org>2021-06-16 23:13:33 -0500
committerJacob Bachmeyer <jcb@gnu.org>2021-06-16 23:13:33 -0500
commitbe4c9afb6075676822cd5d921281347876e85509 (patch)
tree6d8d388f993334f1ef324ab02794feef911ecf6d
parent96d3794213fbfb1705861e235b76642f3a42a66d (diff)
parent54bf1d8028c41f9cd2e840475404f6c4aa4b9736 (diff)
Merge fixes from 1.6.3 release branch
Conflicts: ChangeLog configure configure.ac doc/version.texi runtest.exp
-rw-r--r--ChangeLog216
-rw-r--r--Makefile.am8
-rw-r--r--Makefile.in84
-rw-r--r--NEWS4
-rw-r--r--aclocal.m467
-rw-r--r--commands/help.sh37
-rw-r--r--commands/report-card.awk6
-rwxr-xr-xconfig.guess1214
-rwxr-xr-xconfigure29
-rw-r--r--configure.ac6
-rwxr-xr-xdejagnu129
-rw-r--r--doc/version.texi4
-rw-r--r--lib/dejagnu.exp2
-rwxr-xr-xruntest34
-rw-r--r--runtest.exp51
-rw-r--r--testsuite/launcher.all/command.exp13
-rw-r--r--testsuite/launcher.all/help.exp6
-rw-r--r--testsuite/lib/launcher.exp4
-rw-r--r--testsuite/lib/runtest.exp15
-rw-r--r--testsuite/report-card.all/onetest.exp14
-rw-r--r--testsuite/runtest.libs/utils.test8
-rw-r--r--testsuite/runtest.main/nested/testsuite/bug.test/pr42399-sub.exp3
-rw-r--r--testsuite/runtest.main/nested/testsuite/stat.test/unit-sub.exp4
-rw-r--r--testsuite/runtest.main/pr42399.exp10
-rwxr-xr-xtestsuite/runtest.main/pr48155-csh.sh8
-rw-r--r--testsuite/runtest.main/pr48155.exp102
-rw-r--r--testsuite/runtest.main/stats.exp1
27 files changed, 1334 insertions, 745 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f4f1f4..3f3a31d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,223 @@
+2021-05-22 Jacob Bachmeyer <jcb@gnu.org>
+
+ * Makefile.am (TESTSUITE_FILES): Correct oversight.
+
+ * configure, Makefile.in, aclocal.m4: Regenerate.
+
+ * runtest.exp, configure.ac, doc/version.texi: Update version.
+
+ * dejagnu: Fix error message.
+
+ * config.guess: Import patched version; patches sent upstream.
+
+ * commands/help.sh: Add test mode in which man(1) is never
+ actually invoked. The ability to reference a manpage by absolute
+ file name seems to be unique to Free systems.
+ * testsuite/launcher.all/help.exp: Amend test list to use new
+ testing mode in "dejagnu help" command. This mode should also
+ work on Solaris, so the logic for skipping the tests is removed.
+
+2021-05-20 Jacob Bachmeyer <jcb@gnu.org>
+
+ * dejagnu: Search for a POSIX Awk and validate that at least a
+ simple Awk program actually works.
+ * testsuite/launcher.all/command.exp: Add tests for error produced
+ when no Awk is found and a help message is requested.
+
+ * lib/dejagnu.exp: Avoid reporting next test as UNRESOLVED when
+ reporting error due to missing size(1) while loading file.
+
+ * testsuite/lib/runtest.exp (runtest_copy_nested_testsuite_log):
+ New procedure. Dumps log from nested run into main test log.
+
+ * testsuite/runtest.libs/utils.test: Change test for [which make]
+ to [which sh] because make(1) is not always available on non-GNU
+ systems but sh(1) exists on any Unix. GNU make is often installed
+ as "gmake" on non-GNU systems and may be the only "make" utility.
+
+ * testsuite/runtest.main/pr42399.exp (test_pr42399): Revise to
+ ensure that a failure to produce any output at all in the inner
+ test will be detected. This was discovered on Solaris 10.
+
+ * testsuite/runtest.main/stats.exp: Copy stat.log from nested
+ testsuite run to the main test log upon test failure.
+
+ * testsuite/runtest.main/nested/testsuite/stat.test/unit-sub.exp:
+ Explicitly pass /dev/null to unit-sub.awk because /usr/bin/awk on
+ Solaris 10 does not seem to recognize assignment to ARGV.
+ * testsuite/runtest.main/nested/testsuite/bug.test/pr42399-sub.exp:
+ Likewise.
+
+2021-05-18 Jacob Bachmeyer <jcb@gnu.org>
+
+ * dejagnu: Redirect input from /dev/null when testing if awk is
+ GNU Awk; this avoids a hang on Solaris 10 where awk treats
+ --version as an Awk program and attempts to read input.
+ (command): Rework the initial setting of this variable to avoid
+ limitations in Solaris 10 awk.
+
+ * testsuite/report-card.all/onetest.exp: Avoid Tcl error when item
+ and totals lines are missing entirely.
+
+ * testsuite/runtest.main/pr48155.exp: Fix assumption about exit
+ code from /bin/false, which is different on Solaris.
+
+2021-05-05 Jacob Bachmeyer <jcb@gnu.org>
+
+ PR48155
+
+ * Makefile.am (TESTSUITE_FILES): Update.
+ (CLEANFILES): Add special init file for PR48155 nested tests.
+
+ * testsuite/runtest.main/pr48155.exp: New file.
+ * testsuite/runtest.main/pr48155-csh.sh: New trivial file. This
+ script emulates the behavior of the C shell if an attempt is made
+ to use it to run the config.guess script.
+
+2021-05-04 Jacob Bachmeyer <jcb@gnu.org>
+
+ PR48155
+
+ * runtest.exp: Tighten regexp used to validate output from
+ config.guess. The previous regexp would accept an error produced
+ if config.guess was incorrectly run using the C shell.
+
+2021-04-28 Jacob Bachmeyer <jcb@gnu.org>
+
+ * configure, Makefile.in: Regenerate.
+
+ * runtest.exp, configure.ac, doc/version.texi: Update version.
+
+ * Makefile.am (TAR_OPTIONS): Explicitly select v7 tarball format
+ to work around Automake limitation of assuming that v7 is default.
+
+2021-04-20 Jacob Bachmeyer <jcb@gnu.org>
+
+ * configure.ac: Set Automake options to use the ancient and
+ universal V7 format when building distribution tarballs. The
+ limitations of this format are not expected to impact DejaGnu; the
+ "ustar" format will be used instead if this is proved wrong.
+
+ * Makefile.am (TAR_OPTIONS): Add exported environment variable to
+ set options when building distribution tarballs. Ensure that all
+ files in distribution tarballs will be recorded as owned by root.
+
+2021-04-16 Jacob Bachmeyer <jcb@gnu.org>
+
+ PR47382
+
+ * dejagnu (command): Use Awk instead of non-portable basename(1)
+ and a non-portable sed(1) pattern to initially set this variable.
+
+ * dejagnu: Use shell "case" pattern match instead of non-portable
+ "grep -q" to determine if "awk" is GNU Awk.
+
+ * dejagnu: Use Awk instead of non-portable "grep -q" to verify
+ that a file contains a help message. Also use Awk to extract help
+ messages from files, instead of a complex dynamic sed(1) program.
+
+ * configure.ac: Remove experimental support for propagating
+ CONFIG_SHELL to scripts in the source directory.
+
+ * runtest.exp: Use CONFIG_SHELL or SHELL environment variable when
+ running config.guess. Check the result carefully and stop with an
+ error immediately if running config.guess does not produce
+ something that plausibly resembles a triplet. Advise the user
+ that SHELL or CONFIG_SHELL may need to be set in the environment.
+
+2021-04-15 Jacob Bachmeyer <jcb@gnu.org>
+
+ PR47382
+
+ * dejagnu: Avoid using $? for an exit code; it is convenient until
+ the tests fail because the script is run on Solaris where false
+ returns 255 instead of 1 and the test harness expects exit code 1.
+
+2021-04-14 Jacob Bachmeyer <jcb@gnu.org>
+
+ PR47382
+
+ * dejagnu: Replace use of "expr :" with shell "case" pattern
+ match to avoid limitations of Solaris 10 expr(1).
+
2021-04-14 Jacob Bachmeyer <jcb@gnu.org>
* lib/specs.exp, testsuite/runtest.libs/specs.test: New files.
+2021-04-08 Jacob Bachmeyer <jcb@gnu.org>
+
+ * configure: Regenerate.
+
+ * runtest.exp, configure.ac, doc/version.texi: Update version.
+
+ * configure.ac: Change "dnl" comments that should appear in
+ configure to regular comments.
+ Add experimental support for propagating CONFIG_SHELL to the
+ config.sub and config.guess scripts in the source directory.
+
+2021-04-01 Jacob Bachmeyer <jcb@gnu.org>
+
+ PR47533
+
+ * dejagnu, commands/help.sh, commands/report-card.awk: Revise help
+ message to better fit GNU conventions, with thanks to Tom Tromey
+ for the reporting this issue.
+
+ PR47382
+
+ * runtest: Remove use of non-portable "if !" that causes problems
+ with /bin/sh on Solaris 10.
+
+ * dejagnu (Variants): Split the declaration of this read-only
+ variable into an assignment followed by marking it read-only,
+ instead of doing both in one statement. The Solaris 10 /bin/sh
+ does not accept the combined form.
+
+2021-03-30 Jacob Bachmeyer <jcb@gnu.org>
+
+ * configure: Regenerate.
+
+ * runtest.exp, configure.ac, doc/version.texi: Update version.
+
+2021-03-26 Jacob Bachmeyer <jcb@gnu.org>
+
+ PR47386
+
+ * testsuite/launcher.all/help.exp: Skip the tests on Solaris,
+ since Solaris man(1) does not accept explicit filenames. The
+ manpages will be installed as usual, and the "dejagnu help"
+ command should work after installation.
+
+ Also set PAGER for testing, since other systems might also ignore
+ MANPAGER and that would cause the test to hang.
+
+ * testsuite/lib/launcher.exp (dejagnu_run): Send commands run and
+ copies of the output produced to the log.
+
+ * commands/help.sh: Extend PR47382 fix (below) to this file.
+
+ PR47385
+
+ * testsuite/lib/runtest.exp: Remove support for automatically
+ locating an Expect executable in the old Cygnus tree layout.
+
+2021-03-25 Jacob Bachmeyer <jcb@gnu.org>
+
+ PR47382
+
+ * dejagnu, runtest: Remove use of "$()" command substitution and
+ "$(())" arithmetic substitution shell constructs. The /bin/sh on
+ Solaris 10 does not support them. They were replaced with the
+ traditional backticks for command substitution and backticks and
+ the expr command for arithmetic substitution.
+
+ Also add markers to explicitly disable shellcheck warnings that
+ would lead to reintroducing these problems.
+
+ Also avoid the non-portable "`..."..."...`" construct on a warning
+ in the GNU Autoconf manual, section "Shell Substitutions",
+ although this introduces additional variables.
+
2021-03-22 Jacob Bachmeyer <jcb@gnu.org>
* configure: Regenerate.
diff --git a/Makefile.am b/Makefile.am
index bd05a53..4c0bb60 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,12 +21,16 @@
AUTOMAKE_OPTIONS = dejagnu
export DEJAGNU
+# record all files in the distribution tarball as owned by root
+TAR_OPTIONS = --format=v7 --owner=0 --group=0
+export TAR_OPTIONS
+
EXTRA_DIST = ChangeLog-1992 MAINTAINERS dejagnu runtest \
$(pkgdata_DATA) $(config_DATA) $(baseboard_DATA) \
$(commands_DATA) $(TESTSUITE_FILES) $(TEXINFO_TEX)\
$(CONTRIB)
-CLEANFILES = dbg.log nested-init.exp
+CLEANFILES = dbg.log nested-init.exp pr48155-init.exp
clean-local: clean-local-check
.PHONY: clean-local-check
@@ -204,6 +208,8 @@ TESTSUITE_FILES = \
testsuite/runtest.main/pr42399.exp \
testsuite/runtest.main/nested/testsuite/bug.test/pr42399.awk \
testsuite/runtest.main/nested/testsuite/bug.test/pr42399-sub.exp \
+ testsuite/runtest.main/pr48155-csh.sh \
+ testsuite/runtest.main/pr48155.exp \
testsuite/lib/bohman_ssd.exp \
testsuite/lib/launcher.exp \
testsuite/lib/libdejagnu.exp \
diff --git a/Makefile.in b/Makefile.in
index c2ff53b..4a2f613 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,17 @@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -100,17 +110,13 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
check_PROGRAMS = unit$(EXEEXT)
subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
- $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) depcomp \
- $(doc_dejagnu_TEXINFOS) mdate-sh $(srcdir)/doc/version.texi \
- $(srcdir)/doc/stamp-vti $(dist_man_MANS) $(include_HEADERS) \
- COPYING TODO compile config.guess config.sub install-sh \
- missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(srcdir)/doc/version.texi \
+ $(srcdir)/doc/stamp-vti $(include_HEADERS) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -258,6 +264,10 @@ CSCOPE = cscope
AM_RECURSIVE_TARGETS = cscope
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
EXPECT = expect
+am__DIST_COMMON = $(dist_man_MANS) $(doc_dejagnu_TEXINFOS) \
+ $(srcdir)/Makefile.in AUTHORS COPYING ChangeLog INSTALL NEWS \
+ README TODO compile config.guess config.sub depcomp install-sh \
+ mdate-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -357,6 +367,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -366,12 +377,15 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = dejagnu
+
+# record all files in the distribution tarball as owned by root
+TAR_OPTIONS = --format=v7 --owner=0 --group=0
EXTRA_DIST = ChangeLog-1992 MAINTAINERS dejagnu runtest \
$(pkgdata_DATA) $(config_DATA) $(baseboard_DATA) \
$(commands_DATA) $(TESTSUITE_FILES) $(TEXINFO_TEX)\
$(CONTRIB)
-CLEANFILES = dbg.log nested-init.exp
+CLEANFILES = dbg.log nested-init.exp pr48155-init.exp
bin_SCRIPTS = dejagnu runtest
include_HEADERS = dejagnu.h
pkgdata_DATA = \
@@ -534,6 +548,8 @@ TESTSUITE_FILES = \
testsuite/runtest.main/pr42399.exp \
testsuite/runtest.main/nested/testsuite/bug.test/pr42399.awk \
testsuite/runtest.main/nested/testsuite/bug.test/pr42399-sub.exp \
+ testsuite/runtest.main/pr48155-csh.sh \
+ testsuite/runtest.main/pr48155.exp \
testsuite/lib/bohman_ssd.exp \
testsuite/lib/launcher.exp \
testsuite/lib/libdejagnu.exp \
@@ -579,7 +595,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -764,15 +779,16 @@ $(srcdir)/doc/stamp-vti: doc/dejagnu.texi $(top_srcdir)/configure
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
- echo "@set VERSION $(VERSION)") > vti.tmp
- @cmp -s vti.tmp $(srcdir)/doc/version.texi \
- || (echo "Updating $(srcdir)/doc/version.texi"; \
- cp vti.tmp $(srcdir)/doc/version.texi)
- -@rm -f vti.tmp
+ echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
+ (cmp -s vti.tmp$$$$ $(srcdir)/doc/version.texi \
+ || (echo "Updating $(srcdir)/doc/version.texi" && \
+ cp vti.tmp$$$$ $(srcdir)/doc/version.texi.tmp$$$$ && \
+ mv $(srcdir)/doc/version.texi.tmp$$$$ $(srcdir)/doc/version.texi)) && \
+ rm -f vti.tmp$$$$ $(srcdir)/doc/version.texi.$$$$
@cp $(srcdir)/doc/version.texi $@
mostlyclean-vti:
- -rm -f vti.tmp
+ -rm -f vti.tmp* $(srcdir)/doc/version.texi.tmp*
maintainer-clean-vti:
@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi
@@ -1157,8 +1173,13 @@ distdir: $(DISTFILES)
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
+ @if test -z "$(am__skip_length_check)" && find "$(distdir)" -type f -print | \
+ grep '^...................................................................................................' 1>&2; then \
+ echo 'error: the above filenames are too long' 1>&2; \
+ exit 1; \
+ else :; fi
dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@@ -1174,17 +1195,17 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@@ -1202,7 +1223,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -1212,23 +1233,23 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -1528,7 +1549,10 @@ uninstall-man: uninstall-man1
uninstall-man1 uninstall-pdf-am uninstall-pkgdataDATA \
uninstall-ps-am
+.PRECIOUS: Makefile
+
export DEJAGNU
+export TAR_OPTIONS
clean-local: clean-local-check
.PHONY: clean-local-check
diff --git a/NEWS b/NEWS
index d42be38..245669a 100644
--- a/NEWS
+++ b/NEWS
@@ -53,6 +53,10 @@ Changes since 1.6.2:
The Tcl namespace ::dejagnu and all child namespaces are entirely
internal and should not be mentioned in testsuite code. Its contents
are subject to change without notice, even on point releases.
+21. The DejaGnu testsuite no longer searches for a nearby Expect executable
+ in the location where it would have been located in the old Cygnus tree
+ layout. If you want to use a special Expect other than the system
+ Expect, specify EXPECT=/name/of/expect to "runtest" or "make check".
Changes since 1.6.1:
diff --git a/aclocal.m4 b/aclocal.m4
index 0d3fc74..93cf701 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -103,15 +103,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -142,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -333,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -409,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -499,8 +498,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -573,7 +572,11 @@ to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -602,7 +605,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -613,7 +616,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -623,7 +626,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -645,7 +648,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -680,7 +683,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -730,7 +733,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -769,7 +772,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -798,7 +801,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -845,7 +848,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -864,7 +867,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -945,7 +948,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1005,7 +1008,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1033,7 +1036,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1052,7 +1055,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/commands/help.sh b/commands/help.sh
index 7da4d5f..b811780 100644
--- a/commands/help.sh
+++ b/commands/help.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# help.sh -- "dejagnu help" command
#
-# Copyright (C) 2018 Free Software Foundation, Inc.
+# Copyright (C) 2018, 2021 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -20,20 +20,39 @@
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
# ##help
-# #Usage: dejagnu help [options...] <command>
+# #Usage: dejagnu help [ OPTIONS... ] COMMAND
# # --verbose, -v Emit additional messages
# # --path, -w Passed to man(1)
# # -W Passed to man(1)
# ##end
+# shellcheck disable=SC2003
+# The shellcheck tool complains about use of expr and recommends using
+# newer shell features instead. Solaris 10 /bin/sh does not support the
+# newer features, so we must use expr in this script.
+
+# shellcheck disable=SC2006
+# The shellcheck tool complains about the old style backtick command
+# substitution. Solaris 10 /bin/sh does not support the new style $()
+# command substitution and the usage of command substitution in this script
+# is simple enough to work. Most notably, nesting backtick command
+# substitution is tricky, but we do not do that.
+
# This script was written by Jacob Bachmeyer.
+# For testing and development
+in_test_mode=false
+if test x"$1" = x--DGTest ; then
+ in_test_mode=true
+ shift
+fi
+
args=
command=dejagnu
verbose=0
for a in "$@"; do
case $a in
- -v|--v|-verb*|--verb*) verbose=$((verbose + 1)) ;;
+ -v|--v|-verb*|--verb*) verbose=`expr $verbose + 1` ;;
-w|-W|--path) args="${args} ${a}" ;;
-*) echo Unrecognized option "\"$a\"" ;;
*) command="${command}-${a}" ;;
@@ -45,8 +64,8 @@ if expr "$verbose" \> 0 > /dev/null ; then
fi
## Get the location of this script and check for nearby "doc" dir.
-commdir="$(echo "$0" | sed -e 's@/[^/]*$@@')"
-docdir="$(echo "$commdir" | sed -e 's@/[^/]*$@@')/doc"
+commdir=`echo "$0" | sed -e 's@/[^/]*$@@'`
+docdir=`echo "$commdir" | sed -e 's@/[^/]*$@@'`/doc
if expr "$verbose" \> 0 > /dev/null ; then
echo Running from "$commdir"
@@ -72,7 +91,11 @@ if expr "$verbose" \> 0 > /dev/null ; then
echo Forwarding to man $args "\"$command\""
fi
-#shellcheck disable=SC2086
-exec man $args "$command"
+if $in_test_mode ; then
+ echo man "$args $command"
+else
+ #shellcheck disable=SC2086
+ exec man $args "$command"
+fi
#EOF
diff --git a/commands/report-card.awk b/commands/report-card.awk
index b04c0e9..dc5c4e9 100644
--- a/commands/report-card.awk
+++ b/commands/report-card.awk
@@ -1,5 +1,5 @@
# report-card.awk -- Test summary tool
-# Copyright (C) 2018 Free Software Foundation, Inc.
+# Copyright (C) 2018, 2021 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -20,8 +20,8 @@
# This file was written by Jacob Bachmeyer.
# ##help
-# #Usage: dejagnu report card [<option>|<tool>|<file>]...
-# #Usage: dejagnu report-card [<option>|<tool>|<file>]...
+# #Usage: dejagnu report card [ OPTION | TOOL | FILE ]...
+# #Usage: dejagnu report-card [ OPTION | TOOL | FILE ]...
# # --verbose, -v Emit additional messages
# ##end
diff --git a/config.guess b/config.guess
index 1972fda..d7ebc2a 100755
--- a/config.guess
+++ b/config.guess
@@ -2,7 +2,9 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2021 Free Software Foundation, Inc.
-timestamp='2021-01-25'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2021-05-20'
# 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
@@ -32,7 +34,15 @@ timestamp='2021-01-25'
# Please send patches to <config-patches@gnu.org>.
-me=$(echo "$0" | sed -e 's,.*/,,')
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
@@ -84,6 +94,11 @@ if test $# != 0; then
exit 1
fi
+# just in case it came from the environment
+if test x${GUESS+set} != xset; then
+ GUESS=
+fi
+
# 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
@@ -102,8 +117,8 @@ 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" ; } ||
+ # shellcheck disable=SC2039,SC3028
+ { 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 ; }
@@ -112,7 +127,7 @@ set_cc_for_build() {
,,) 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"
+ CC_FOR_BUILD=$driver
break
fi
done
@@ -131,12 +146,12 @@ if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
-UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
-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
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+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/*)
LIBC=unknown
@@ -157,7 +172,8 @@ Linux|GNU|GNU/*)
#endif
#endif
EOF
- eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
+ cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "$cc_set_libc"
# Second heuristic to detect musl libc.
if [ "$LIBC" = unknown ] &&
@@ -176,7 +192,7 @@ 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*,
@@ -188,11 +204,11 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
- UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
/usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
- echo unknown))
- case "$UNAME_MACHINE_ARCH" in
+ echo unknown)`
+ case $UNAME_MACHINE_ARCH in
aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
@@ -200,15 +216,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
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
;;
@@ -229,10 +245,9 @@ 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 's/^earmv[0-9]/-eabi/;s/eb$//'`
;;
esac
# The OS release
@@ -240,76 +255,80 @@ 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-}"
- exit ;;
+ GUESS=$machine-${os}${release}${abi-}
+ ;;
*:Bitrig:*:*)
- UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
- echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
- exit ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
+ ;;
*:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
- echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
- exit ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
+ ;;
+ *:SecBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
+ ;;
*:LibertyBSD:*:*)
- UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
- echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
- exit ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
+ ;;
*:MidnightBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
+ ;;
*:ekkoBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
+ ;;
*:SolidBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
+ ;;
*:OS108:*:*)
- echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
+ ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
+ ;;
*:MirBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
+ ;;
*:Sortix:*:*)
- echo "$UNAME_MACHINE"-unknown-sortix
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-sortix
+ ;;
*:Twizzler:*:*)
- echo "$UNAME_MACHINE"-unknown-twizzler
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-twizzler
+ ;;
*:Redox:*:*)
- echo "$UNAME_MACHINE"-unknown-redox
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-redox
+ ;;
mips:OSF1:*.*)
- echo mips-dec-osf1
- exit ;;
+ GUESS=mips-dec-osf1
+ ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
- UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1)
- case "$ALPHA_CPU_TYPE" in
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case $ALPHA_CPU_TYPE in
"EV4 (21064)")
UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
@@ -346,68 +365,73 @@ 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)"
+ OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ echo "$UNAME_MACHINE"-dec-osf"$OSF_REL"
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
+ GUESS=m68k-unknown-sysv4
+ ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo "$UNAME_MACHINE"-unknown-amigaos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-amigaos
+ ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo "$UNAME_MACHINE"-unknown-morphos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-morphos
+ ;;
*:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
+ GUESS=i370-ibm-openedition
+ ;;
*:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
+ GUESS=s390-ibm-zvmoe
+ ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
+ GUESS=powerpc-ibm-os400
+ ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix"$UNAME_RELEASE"
- exit ;;
+ GUESS=arm-acorn-riscix$UNAME_RELEASE
+ ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
+ GUESS=arm-unknown-riscos
+ ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
+ GUESS=hppa1.1-hitachi-hiuxmpp
+ ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "$( (/bin/universe) 2>/dev/null)" = att ; then
- echo pyramid-pyramid-sysv3
+ PYRAMID_UNIVERSE=`(/bin/universe) 2>/dev/null`
+ if test x"$PYRAMID_UNIVERSE" = xatt ; then
+ GUESS=pyramid-pyramid-sysv3
else
- echo pyramid-pyramid-bsd
+ GUESS=pyramid-pyramid-bsd
fi
- exit ;;
+ ;;
NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
+ GUESS=pyramid-pyramid-svr4
+ ;;
DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
+ GUESS=sparc-icl-nx6
+ ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case $(/usr/bin/uname -p) in
+ case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
- echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
+ ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-hal-solaris2$SUN_REL
+ ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris2$SUN_REL
+ ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux"$UNAME_RELEASE"
- exit ;;
+ GUESS=i386-pc-auroraux$UNAME_RELEASE
+ ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
set_cc_for_build
SUN_ARCH=i386
@@ -422,41 +446,44 @@ 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/[^.]*//')"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
+ ;;
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/[^.]*//')"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris3$SUN_REL
+ ;;
sun4*:SunOS:*:*)
- case "$(/usr/bin/arch -k)" in
+ case `/usr/bin/arch -k` in
Series*|S4*)
- UNAME_RELEASE=$(uname -v)
+ UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
+ GUESS=sparc-sun-sunos$SUN_REL
+ ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
+ ;;
sun*:*:4.2BSD:*)
- UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
- case "$(/bin/arch)" in
+ case `/bin/arch` in
sun3)
- echo m68k-sun-sunos"$UNAME_RELEASE"
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
- echo sparc-sun-sunos"$UNAME_RELEASE"
+ GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
- exit ;;
+ ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos"$UNAME_RELEASE"
- exit ;;
+ GUESS=sparc-auspex-sunos$UNAME_RELEASE
+ ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -466,41 +493,41 @@ 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"
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-milan-mint$UNAME_RELEASE
+ ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-hades-mint$UNAME_RELEASE
+ ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-unknown-mint$UNAME_RELEASE
+ ;;
m68k:machten:*:*)
- echo m68k-apple-machten"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-apple-machten$UNAME_RELEASE
+ ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten"$UNAME_RELEASE"
- exit ;;
+ GUESS=powerpc-apple-machten$UNAME_RELEASE
+ ;;
RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
+ GUESS=mips-dec-mach_bsd4.3
+ ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix"$UNAME_RELEASE"
- exit ;;
+ GUESS=mips-dec-ultrix$UNAME_RELEASE
+ ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix"$UNAME_RELEASE"
- exit ;;
+ GUESS=vax-dec-ultrix$UNAME_RELEASE
+ ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix"$UNAME_RELEASE"
- exit ;;
+ GUESS=clipper-intergraph-clix$UNAME_RELEASE
+ ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
@@ -525,78 +552,79 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
- dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
- SYSTEM_NAME=$("$dummy" "$dummyarg") &&
+ 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"
- exit ;;
+ GUESS=mips-mips-riscos$UNAME_RELEASE
+ ;;
Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
+ GUESS=powerpc-motorola-powermax
+ ;;
Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
+ GUESS=powerpc-harris-powerunix
+ ;;
m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
+ GUESS=m88k-harris-cxux7
+ ;;
m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
+ GUESS=m88k-motorola-sysv4
+ ;;
m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=$(/usr/bin/uname -p)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
test "$TARGET_BINARY_INTERFACE"x = x
then
- echo m88k-dg-dgux"$UNAME_RELEASE"
+ GUESS=m88k-dg-dgux$UNAME_RELEASE
else
- echo m88k-dg-dguxbcs"$UNAME_RELEASE"
+ GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
- echo i586-dg-dgux"$UNAME_RELEASE"
+ GUESS=i586-dg-dgux$UNAME_RELEASE
fi
- exit ;;
+ ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
+ GUESS=m88k-dolphin-sysv3
+ ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
+ GUESS=m88k-tektronix-sysv3
+ ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
+ GUESS=m68k-tektronix-bsd
+ ;;
*:IRIX*:*:*)
- echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
- exit ;;
+ IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
+ GUESS=mips-sgi-irix$IRIX_REL
+ ;;
????????: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
- exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX '
+ GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
+ GUESS=i386-ibm-aix
+ ;;
ia64:AIX:*:*)
if test -x /usr/bin/oslevel ; then
- IBM_REV=$(/usr/bin/oslevel)
+ 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"
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
+ ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
set_cc_for_build
@@ -611,68 +639,68 @@ 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"
+ GUESS=$SYSTEM_NAME
else
- echo rs6000-ibm-aix3.2.5
+ GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
+ GUESS=rs6000-ibm-aix3.2.4
else
- echo rs6000-ibm-aix3.2
+ GUESS=rs6000-ibm-aix3.2
fi
- exit ;;
+ ;;
*:AIX:*:[4567])
- IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }')
+ 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
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if test -x /usr/bin/lslpp ; then
- IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
- awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
+ 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"
- exit ;;
+ GUESS=$IBM_ARCH-ibm-aix$IBM_REV
+ ;;
*:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
+ GUESS=rs6000-ibm-aix
+ ;;
ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
+ GUESS=romp-ibm-bsd4.4
+ ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
+ GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
+ ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
+ GUESS=rs6000-bull-bosx
+ ;;
DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
+ GUESS=m68k-bull-sysv3
+ ;;
9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
+ GUESS=m68k-hp-bsd
+ ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
+ GUESS=m68k-hp-bsd4.4
+ ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
- case "$UNAME_MACHINE" in
+ 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 test -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
+ 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
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
@@ -714,7 +742,7 @@ 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
@@ -739,12 +767,12 @@ EOF
HP_ARCH=hppa64
fi
fi
- echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
- exit ;;
+ GUESS=$HP_ARCH-hp-hpux$HPUX_REV
+ ;;
ia64:HP-UX:*:*)
- HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
- echo ia64-hp-hpux"$HPUX_REV"
- exit ;;
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ GUESS=ia64-hp-hpux$HPUX_REV
+ ;;
3050*:HI-UX:*:*)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
@@ -772,38 +800,38 @@ 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 ;;
+ GUESS=unknown-hitachi-hiuxwe2
+ ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
- echo hppa1.1-hp-bsd
- exit ;;
+ GUESS=hppa1.1-hp-bsd
+ ;;
9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
+ GUESS=hppa1.0-hp-bsd
+ ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
+ GUESS=hppa1.0-hp-mpeix
+ ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
- echo hppa1.1-hp-osf
- exit ;;
+ GUESS=hppa1.1-hp-osf
+ ;;
hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-osf
+ ;;
i*86:OSF1:*:*)
if test -x /usr/sbin/sysversion ; then
- echo "$UNAME_MACHINE"-unknown-osf1mk
+ GUESS=$UNAME_MACHINE-unknown-osf1mk
else
- echo "$UNAME_MACHINE"-unknown-osf1
+ GUESS=$UNAME_MACHINE-unknown-osf1
fi
- exit ;;
+ ;;
parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
+ GUESS=hppa1.1-hp-lites
+ ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
+ GUESS=c1-convex-bsd
+ ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
@@ -811,17 +839,18 @@ EOF
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
+ GUESS=c34-convex-bsd
+ ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
+ GUESS=c38-convex-bsd
+ ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
+ GUESS=c4-convex-bsd
+ ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=ymp-cray-unicos$CRAY_REL
+ ;;
CRAY*[A-Z]90:*:*:*)
echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
@@ -829,114 +858,126 @@ EOF
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=t90-cray-unicos$CRAY_REL
+ ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=alphaev5-cray-unicosmk$CRAY_REL
+ ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=sv1-cray-unicos$CRAY_REL
+ ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=craynv-cray-unicosmp$CRAY_REL
+ ;;
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/ /_/')
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ 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/ /_/'`
+ GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
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/ /_/')
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
+ ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi"$UNAME_RELEASE"
- exit ;;
+ GUESS=sparc-unknown-bsdi$UNAME_RELEASE
+ ;;
*:BSD/OS:*:*)
- echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
+ ;;
arm:FreeBSD:*:*)
- UNAME_PROCESSOR=$(uname -p)
+ 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
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=${UNAME_PROCESSOR}-unknown-freebsd$FREEBSD_REL-gnueabi
else
- echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=${UNAME_PROCESSOR}-unknown-freebsd$FREEBSD_REL-gnueabihf
fi
- exit ;;
+ ;;
*:FreeBSD:*:*)
- UNAME_PROCESSOR=$(/usr/bin/uname -p)
- case "$UNAME_PROCESSOR" in
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ 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/[-(].*//')"
- exit ;;
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
+ ;;
i*:CYGWIN*:*)
- echo "$UNAME_MACHINE"-pc-cygwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-cygwin
+ ;;
*:MINGW64*:*)
- echo "$UNAME_MACHINE"-pc-mingw64
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw64
+ ;;
*:MINGW*:*)
- echo "$UNAME_MACHINE"-pc-mingw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw32
+ ;;
*:MSYS*:*)
- echo "$UNAME_MACHINE"-pc-msys
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-msys
+ ;;
i*:PW*:*)
- echo "$UNAME_MACHINE"-pc-pw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-pw32
+ ;;
*:Interix*:*)
- case "$UNAME_MACHINE" in
+ case $UNAME_MACHINE in
x86)
- echo i586-pc-interix"$UNAME_RELEASE"
- exit ;;
+ GUESS=i586-pc-interix$UNAME_RELEASE
+ ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix"$UNAME_RELEASE"
- exit ;;
+ GUESS=x86_64-unknown-interix$UNAME_RELEASE
+ ;;
IA64)
- echo ia64-unknown-interix"$UNAME_RELEASE"
- exit ;;
+ GUESS=ia64-unknown-interix$UNAME_RELEASE
+ ;;
esac ;;
i*:UWIN*:*)
- echo "$UNAME_MACHINE"-pc-uwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-uwin
+ ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-pc-cygwin
- exit ;;
+ GUESS=x86_64-pc-cygwin
+ ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=powerpcle-unknown-solaris2$SUN_REL
+ ;;
*:GNU:*:*)
# the GNU system
- echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')"
- exit ;;
+ GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
+ GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
+ ;;
*: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"
- exit ;;
+ GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
+ ;;
*:Minix:*:*)
- echo "$UNAME_MACHINE"-unknown-minix
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-minix
+ ;;
aarch64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
alpha:Linux:*:*)
- case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) 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 ;;
@@ -947,63 +988,63 @@ 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"
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
arm*:Linux:*:*)
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"
+ GUESS=$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
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
- exit ;;
+ ;;
avr32*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
cris:Linux:*:*)
- echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
crisv32:Linux:*:*)
- echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
e2k:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
frv:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
hexagon:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:Linux:*:*)
- echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBC
+ ;;
ia64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
k1om:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m32r*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m68*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
mips:Linux:*:* | mips64:Linux:*:*)
set_cc_for_build
IS_GLIBC=0
@@ -1048,65 +1089,66 @@ EOF
#endif
#endif
EOF
- eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')"
+ cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
+ eval "$cc_set_vars"
test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
mips64el:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
openrisc*:Linux:*:*)
- echo or1k-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=or1k-unknown-linux-$LIBC
+ ;;
or32:Linux:*:* | or1k*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=sparc-unknown-linux-$LIBC
+ ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=hppa64-unknown-linux-$LIBC
+ ;;
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" ;;
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
+ PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
+ *) GUESS=hppa-unknown-linux-$LIBC ;;
esac
- exit ;;
+ ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=powerpc64-unknown-linux-$LIBC
+ ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=powerpc-unknown-linux-$LIBC
+ ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=powerpc64le-unknown-linux-$LIBC
+ ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=powerpcle-unknown-linux-$LIBC
+ ;;
riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
+ ;;
sh64*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sh*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
tile*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
vax:Linux:*:*)
- echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-dec-linux-$LIBC
+ ;;
x86_64:Linux:*:*)
set_cc_for_build
LIBCABI=$LIBC
@@ -1115,83 +1157,83 @@ EOF
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_X32 >/dev/null
then
- LIBCABI="$LIBC"x32
+ LIBCABI=${LIBC}x32
fi
fi
- echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
+ ;;
xtensa*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
+ GUESS=i386-sequent-sysv4
+ ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# 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"
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
+ ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo "$UNAME_MACHINE"-pc-os2-emx
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-os2-emx
+ ;;
i*86:XTS-300:*:STOP)
- echo "$UNAME_MACHINE"-unknown-stop
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-stop
+ ;;
i*86:atheos:*:*)
- echo "$UNAME_MACHINE"-unknown-atheos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-atheos
+ ;;
i*86:syllable:*:*)
- echo "$UNAME_MACHINE"-pc-syllable
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-syllable
+ ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=i386-unknown-lynxos$UNAME_RELEASE
+ ;;
i*86:*DOS:*:*)
- echo "$UNAME_MACHINE"-pc-msdosdjgpp
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-msdosdjgpp
+ ;;
i*86:*:4.*:*)
- UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//')
+ 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"
+ GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
- echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
+ GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
- exit ;;
+ ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
- case $(/bin/uname -X | grep "^Machine") in
+ case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ ;;
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"
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ GUESS=$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
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
- echo "$UNAME_MACHINE"-pc-sysv32
+ GUESS=$UNAME_MACHINE-pc-sysv32
fi
- exit ;;
+ ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -1199,37 +1241,37 @@ EOF
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
+ GUESS=i586-pc-msdosdjgpp
+ ;;
Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
+ GUESS=i386-pc-mach3
+ ;;
paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
+ GUESS=i860-intel-osf1
+ ;;
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
+ GUESS=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
+ GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
- exit ;;
+ ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
- echo m68010-convergent-sysv
- exit ;;
+ GUESS=m68010-convergent-sysv
+ ;;
mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
+ GUESS=m68k-convergent-sysv
+ ;;
M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
+ GUESS=m68k-diab-dnix
+ ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
- && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /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; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
@@ -1240,7 +1282,7 @@ EOF
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
- && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /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; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
@@ -1248,118 +1290,118 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-unknown-lynxos$UNAME_RELEASE
+ ;;
mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
+ GUESS=m68k-atari-sysv4
+ ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=sparc-unknown-lynxos$UNAME_RELEASE
+ ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
+ ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
+ ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv"$UNAME_RELEASE"
- exit ;;
+ GUESS=mips-dde-sysv$UNAME_RELEASE
+ ;;
RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=$( (uname -p) 2>/dev/null)
- echo "$UNAME_MACHINE"-sni-sysv4
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ GUESS=$UNAME_MACHINE-sni-sysv4
else
- echo ns32k-sni-sysv
+ GUESS=ns32k-sni-sysv
fi
- exit ;;
+ ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ GUESS=i586-unisys-sysv4
+ ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
+ GUESS=hppa1.1-stratus-sysv4
+ ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
+ GUESS=i860-stratus-sysv4
+ ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo "$UNAME_MACHINE"-stratus-vos
- exit ;;
+ GUESS=$UNAME_MACHINE-stratus-vos
+ ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
+ GUESS=hppa1.1-stratus-vos
+ ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-apple-aux$UNAME_RELEASE
+ ;;
news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
+ GUESS=mips-sony-newsos6
+ ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if test -d /usr/nec; then
- echo mips-nec-sysv"$UNAME_RELEASE"
+ GUESS=mips-nec-sysv$UNAME_RELEASE
else
- echo mips-unknown-sysv"$UNAME_RELEASE"
+ GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
- exit ;;
+ ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
+ GUESS=powerpc-be-beos
+ ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
+ GUESS=powerpc-apple-beos
+ ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
+ GUESS=i586-pc-beos
+ ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
+ GUESS=i586-pc-haiku
+ ;;
x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
+ GUESS=x86_64-unknown-haiku
+ ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx4-nec-superux$UNAME_RELEASE
+ ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx5-nec-superux$UNAME_RELEASE
+ ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx6-nec-superux$UNAME_RELEASE
+ ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx7-nec-superux$UNAME_RELEASE
+ ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx8-nec-superux$UNAME_RELEASE
+ ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx8r-nec-superux$UNAME_RELEASE
+ ;;
SX-ACE:SUPER-UX:*:*)
- echo sxace-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sxace-nec-superux$UNAME_RELEASE
+ ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody"$UNAME_RELEASE"
- exit ;;
+ GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
+ ;;
*:Rhapsody:*:*)
- echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
+ ;;
arm64:Darwin:*:*)
- echo aarch64-apple-darwin"$UNAME_RELEASE"
- exit ;;
+ GUESS=aarch64-apple-darwin$UNAME_RELEASE
+ ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=$(uname -p)
+ UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
@@ -1393,43 +1435,43 @@ EOF
# uname -m returns i386 or x86_64
UNAME_PROCESSOR=$UNAME_MACHINE
fi
- echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
+ ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=$(uname -p)
+ UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
+ ;;
*:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
+ GUESS=i386-pc-qnx
+ ;;
NEO-*:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=neo-tandem-nsk$UNAME_RELEASE
+ ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=nse-tandem-nsk$UNAME_RELEASE
+ ;;
NSR-*:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=nsr-tandem-nsk$UNAME_RELEASE
+ ;;
NSV-*:NONSTOP_KERNEL:*:*)
- echo nsv-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=nsv-tandem-nsk$UNAME_RELEASE
+ ;;
NSX-*:NONSTOP_KERNEL:*:*)
- echo nsx-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=nsx-tandem-nsk$UNAME_RELEASE
+ ;;
*:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
+ GUESS=mips-compaq-nonstopux
+ ;;
BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
+ GUESS=bs2000-siemens-sysv
+ ;;
DS/*:UNIX_System_V:*:*)
- echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
+ ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
@@ -1438,64 +1480,72 @@ EOF
if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
- UNAME_MACHINE="$cputype"
+ UNAME_MACHINE=$cputype
fi
- echo "$UNAME_MACHINE"-unknown-plan9
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-plan9
+ ;;
*:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
+ GUESS=pdp10-unknown-tops10
+ ;;
*:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
+ GUESS=pdp10-unknown-tenex
+ ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
+ GUESS=pdp10-dec-tops20
+ ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
+ GUESS=pdp10-xkl-tops20
+ ;;
*:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
+ GUESS=pdp10-unknown-tops20
+ ;;
*:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
+ GUESS=pdp10-unknown-its
+ ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux"$UNAME_RELEASE"
- exit ;;
+ GUESS=mips-sei-seiux$UNAME_RELEASE
+ ;;
*:DragonFly:*:*)
- echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
- exit ;;
+ DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
+ ;;
*:*VMS:*:*)
- UNAME_MACHINE=$( (uname -p) 2>/dev/null)
- case "$UNAME_MACHINE" in
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case $UNAME_MACHINE in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
+ GUESS=i386-pc-xenix
+ ;;
i*86:skyos:*:*)
- echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')"
- exit ;;
+ SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
+ GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
+ ;;
i*86:rdos:*:*)
- echo "$UNAME_MACHINE"-pc-rdos
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-rdos
+ ;;
*:AROS:*:*)
- echo "$UNAME_MACHINE"-unknown-aros
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-aros
+ ;;
x86_64:VMkernel:*:*)
- echo "$UNAME_MACHINE"-unknown-esx
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-esx
+ ;;
amd64:Isilon\ OneFS:*:*)
- echo x86_64-unknown-onefs
- exit ;;
+ GUESS=x86_64-unknown-onefs
+ ;;
*:Unleashed:*:*)
- echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
+ ;;
esac
+# Do we have a guess based on uname results?
+if test "x$GUESS" != x; then
+ echo "$GUESS"
+ exit 0
+fi
+
# No uname command or uname output not recognized.
set_cc_for_build
cat > "$dummy.c" <<EOF
@@ -1535,7 +1585,7 @@ main ()
#define __ARCHITECTURE__ "m68k"
#endif
int version;
- version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null);
+ 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
@@ -1627,7 +1677,7 @@ main ()
}
EOF
-$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) &&
+$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.
@@ -1635,7 +1685,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
echo "$0: unable to guess system type" >&2
-case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+case $UNAME_MACHINE:$UNAME_SYSTEM in
mips:Linux | mips64:Linux)
# If we got here on MIPS GNU/Linux, output extra information.
cat >&2 <<EOF
@@ -1657,9 +1707,11 @@ and
https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
EOF
-year=$(echo $timestamp | sed 's,-.*,,')
+our_year=`echo $timestamp | sed 's,-.*,,'`
+thisyear=`date +%Y`
# shellcheck disable=SC2003
-if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then
+script_age=`expr "$thisyear" - "$our_year"`
+if test "$script_age" -lt 3 ; then
cat >&2 <<EOF
If $0 has already been updated, send the following data and any
@@ -1668,20 +1720,20 @@ provide the necessary information to handle your system.
config.guess timestamp = $timestamp
-uname -m = $( (uname -m) 2>/dev/null || echo unknown)
-uname -r = $( (uname -r) 2>/dev/null || echo unknown)
-uname -s = $( (uname -s) 2>/dev/null || echo unknown)
-uname -v = $( (uname -v) 2>/dev/null || echo unknown)
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
-/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null)
-/bin/uname -X = $( (/bin/uname -X) 2>/dev/null)
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-hostinfo = $( (hostinfo) 2>/dev/null)
-/bin/universe = $( (/bin/universe) 2>/dev/null)
-/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null)
-/bin/arch = $( (/bin/arch) 2>/dev/null)
-/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null)
-/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null)
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 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"
diff --git a/configure b/configure
index 57c5f09..d9b2447 100755
--- a/configure
+++ b/configure
@@ -661,6 +661,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -736,6 +737,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -988,6 +990,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1125,7 +1136,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1278,6 +1289,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1842,7 +1854,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-am__api_version='1.14'
+am__api_version='1.15'
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2043,8 +2055,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@@ -2063,7 +2075,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -2391,8 +2403,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@@ -2450,6 +2462,7 @@ END
fi
fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
@@ -3977,11 +3990,13 @@ if test -z "$AWK"; then
as_fn_error $? "AWK not installed" "$LINENO" 5
fi
+# Provide an empty global site file (/dev/null) as default.
if test x"$DEJAGNU" = x
then
DEJAGNU="/dev/null"
fi
+# Makefile.am arranges for DEJAGNU to be exported in the environment.
ac_config_files="$ac_config_files Makefile"
diff --git a/configure.ac b/configure.ac
index e975b93..ff87579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ dnl Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
AC_PREREQ([2.69])
AC_INIT([GNU DejaGnu],[1.6.4-git],[bug-dejagnu@gnu.org])
-AM_INIT_AUTOMAKE([1.14 subdir-objects])
+AM_INIT_AUTOMAKE([1.14 subdir-objects tar-v7 filename-length-max=99])
AM_MAINTAINER_MODE
AC_PROG_MAKE_SET
@@ -34,13 +34,13 @@ if test -z "$AWK"; then
AC_MSG_ERROR([AWK not installed])
fi
-dnl Provide an empty global site file (/dev/null) as default.
+# Provide an empty global site file (/dev/null) as default.
if test x"$DEJAGNU" = x
then
DEJAGNU="/dev/null"
fi
AC_SUBST(DEJAGNU)
-dnl Makefile.am arranges for DEJAGNU to be exported in the environment.
+# Makefile.am arranges for DEJAGNU to be exported in the environment.
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/dejagnu b/dejagnu
index 7e75940..8ddc59b 100755
--- a/dejagnu
+++ b/dejagnu
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2018 Free Software Foundation, Inc.
+# Copyright (C) 2018, 2021 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -28,12 +28,24 @@
# either be run with a command name as the first (few) argument(s), via a
# link from the command name, or some combination of those.
+# shellcheck disable=SC2003
+# The shellcheck tool complains about use of expr and recommends using
+# newer shell features instead. Solaris 10 /bin/sh does not support the
+# newer features, so we must use expr in this script.
+
+# shellcheck disable=SC2006
+# The shellcheck tool complains about the old style backtick command
+# substitution. Solaris 10 /bin/sh does not support the new style $()
+# command substitution and the usage of command substitution in this script
+# is simple enough to work. Most notably, nesting backtick command
+# substitution is tricky, but we do not do that.
+
# shellcheck disable=SC2209
# The shellcheck tool complains about assigning certain constant strings to
# variables. In this script, the intended meaning is obvious in context.
# ##help
-# #Usage: dejagnu <command> [--help|options...]
+# #Usage: dejagnu COMMAND [ --help | OPTIONS... ]
# #Usage: dejagnu --help
# #Usage: dejagnu --version
# # --help Print help text
@@ -41,7 +53,8 @@
# ##end
# list of extensions supported for commands in priority order
-readonly Variants="gawk awk tcl exp bash sh"
+Variants='gawk awk tcl exp bash sh'
+readonly Variants
## Recognize options
@@ -57,19 +70,19 @@ want_version=false
verbose=0
for a in "$@"; do
case $a in
- --help) want_help=true ;;
- -v|--v|-verbose|--verbose) verbose=$((verbose + 1)) ;;
- -V|--V|-version|--version) want_version=true ;;
+ --help) want_help=true ;;
+ -v|--v|-verbose|--verbose) verbose=`expr $verbose + 1` ;;
+ -V|--V|-version|--version) want_version=true ;;
esac
done
if expr "$verbose" \> 0 > /dev/null ; then
- echo Verbose level is $verbose
+ echo Verbose level is "$verbose"
fi
## Get the file name of this script and deduce @bindir@.
-bindir="$(echo "$0" | sed -e 's@/[^/]*$@@')"
+bindir=`echo "$0" | sed -e 's@/[^/]*$@@'`
if expr "$verbose" \> 0 > /dev/null ; then
echo Running launcher from "$bindir"
fi
@@ -97,9 +110,10 @@ elif test -d "${bindir}/commands" && test -f "${bindir}/runtest.exp" ; then
datadir="${bindir}"
else
commdir=
+ bindir1up_check=`echo "$bindir" | sed -e 's@/[^/]*$@/share/dejagnu@'`
+ bindir2up_check=`echo "$bindir" | sed -e 's@/[^/]*/[^/]*$@/share/dejagnu@'`
for i in \
- "$(echo "$bindir" | sed -e 's@/[^/]*$@/share/dejagnu@')" \
- "$(echo "$bindir" | sed -e 's@/[^/]*/[^/]*$@/share/dejagnu@')" \
+ "${bindir1up_check}" "${bindir2up_check}" \
/usr/share/dejagnu /usr/local/share/dejagnu
do
if expr "$verbose" \> 1 > /dev/null ; then
@@ -126,21 +140,34 @@ fi
# Are we just looking for version information?
if $want_version ; then
- frame_version=$(grep '^set frame_version' "${datadir}/runtest.exp" \
- | sed 's/^[^0-9]*//')
+ frame_version=`grep '^set frame_version' "${datadir}/runtest.exp" \
+ | sed 's/^[^0-9]*//'`
echo 'dejagnu auxiliary launcher (DejaGnu)' "$frame_version"
exit 0
fi
# Remove any leading autoconf platform prefix and the "dejagnu" prefix.
-command="$(basename "$0" | sed -e 's/^.*-\?dejagnu-\?//')"
+# command=`basename "$0" | sed -e 's/^.*-\?dejagnu-\?//'`
+
+# The above simple solution is not portable, so we use Awk and two steps:
+command=`echo "$0" | awk 'BEGIN { FS = "/" } { print $NF }'`
+# First, we use a simple Awk program to perform the role of basename.
+command=`echo "$command" | awk 'BEGIN { OFS = FS = "-" }
+ { for (i = 1; i <= NF; i++) if ($i ~ /dejagnu/) break;
+ i++; for (out = ""; i <= NF; i++) out = out OFS $i;
+ print substr(out,2) }'`
+# Second, we split on "-" and search for a field matching /dejagnu/ to
+# identify the other prefixes, then skip that field and the second loop
+# collects any following fields. The spurious leading "-" is then removed
+# using substr() and the result is returned to the shell.
+
+# This roundabout approach maintains compatibility with Solaris 10, where
+# awk allows only limited manipulation of the record structure.
while expr $# \> 0 > /dev/null
do
if test -z "${command}" ; then
- if expr "$1" : - > /dev/null ; then
- break
- fi
+ case $1 in -*) break;; esac
command="$1"
shift
fi
@@ -153,9 +180,7 @@ do
break 2
fi
done
- if expr "$1" : - > /dev/null ; then
- break
- fi
+ case $1 in -*) break;; esac
if test -n "$1" ; then
command="${command}-$1"
shift
@@ -197,7 +222,14 @@ if test -n "$AWK" ; then
elif test -x "${bindir}/awk" ; then
awkbin="${bindir}/awk"
else
- awkbin=awk
+ # find what might be a usable awk
+ # on Solaris 10, POSIX awk is in /usr/xpg4/bin
+ for awktest in mawk /usr/xpg4/bin/awk nawk awk ; do
+ if command -v "$awktest" > /dev/null 2>&1 ; then
+ awkbin=$awktest
+ break;
+ fi
+ done
fi
if test -n "$GAWK" ; then
gawkbin="$GAWK"
@@ -206,7 +238,8 @@ elif test -x "${bindir}/gawk" ; then
else
gawkbin=gawk
fi
-if command -v "$awkbin" > /dev/null 2>&1 ; then
+# The non-POSIX awk in /usr/bin on Solaris 10 fails this test
+if echo | "$awkbin" '1 && 1 {exit 0}' > /dev/null 2>&1 ; then
have_awk=true
else
have_awk=false
@@ -225,11 +258,10 @@ if $have_gawk ; then
fi
# is "awk" actually GNU Awk?
if $have_awk ; then
- if "$awkbin" --version | sed 1q | grep -qi 'GNU Awk' ; then
- have_gawk_as_awk=true
- else
- have_gawk_as_awk=false
- fi
+ case `"$awkbin" --version </dev/null 2>&1 | sed 1q` in
+ *'GNU Awk'*) have_gawk_as_awk=true ;;
+ *) have_gawk_as_awk=false ;;
+ esac
fi
if expr "$verbose" \> 2 > /dev/null ; then
if $have_awk ; then
@@ -243,6 +275,15 @@ if expr "$verbose" \> 2 > /dev/null ; then
echo GNU Awk interpreter was not found
fi
fi
+# export chosen Awk and GNU Awk
+if $have_awk ; then
+ AWK=$awkbin
+ export AWK
+fi
+if $have_gawk ; then
+ GAWK=$gawkbin
+ export GAWK
+fi
# Bash
@@ -386,6 +427,10 @@ fi
# Are we just looking for a usage message?
if $want_help ; then
+ if $have_awk; then : ; else
+ echo ERROR: extracting help message requires POSIX Awk
+ exit 2
+ fi
if test -z "$command" ; then
# want help on the launcher itself
help_file=$0
@@ -396,33 +441,27 @@ if $want_help ; then
echo ERROR: file "'$help_file'" is not readable
exit 2
fi
- if grep -q '#help' "$help_file" \
- && grep -q '#end' "$help_file"; then : ; else
+ if "$AWK" '/#help$/ { pfxlen = length($0) - 4 }
+ pfxlen && substr($0, pfxlen) == "#end" { exit 1 }
+ ' "$help_file" ; then
echo ERROR: file "'$help_file'" does not contain a help message
exit 2
fi
- help_prefix_pat=$(grep '#help' "$help_file" \
- | sed -e 's/#help.*$//' -e '1q' | tr '[:print:][:blank:]' .)
- if expr "$verbose" \> 1 > /dev/null ; then
- echo Extracting help from "'$help_file'" with prefix "'$help_prefix_pat'"
- fi
- sed -n < "$help_file" \
- -e '1,/#help/d' \
- -e '/^'"$help_prefix_pat"'#end/q' \
- -e 's/^'"$help_prefix_pat"'//;p'
- exit 0
+ exec "$AWK" '/#help$/ { pfxlen = length($0) - 4 }
+ pfxlen && substr($0, pfxlen) == "#end" { exit 0 }
+ pfxlen { print substr($0, pfxlen) }' "$help_file"
fi
if test -z "$command" ; then
if test -n "$override_ext" ; then
case $selected_ext in
- awk) $have_awk; exit $? ;;
- bash) $have_bash; exit $? ;;
- exp) $have_expect; exit $? ;;
- gawk) $have_gawk; exit $? ;;
- tcl) $have_tcl; exit $? ;;
- sh) $have_sh; exit $? ;;
- *) exit 2 ;;
+ awk) if $have_awk; then exit 0; else exit 1; fi ;;
+ bash) if $have_bash; then exit 0; else exit 1; fi ;;
+ exp) if $have_expect; then exit 0; else exit 1; fi ;;
+ gawk) if $have_gawk; then exit 0; else exit 1; fi ;;
+ tcl) if $have_tcl; then exit 0; else exit 1; fi ;;
+ sh) if $have_sh; then exit 0; else exit 1; fi ;;
+ *) exit 2 ;;
esac
else
echo ERROR: no command given
diff --git a/doc/version.texi b/doc/version.texi
index 7f5c62c..349464f 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
-@set UPDATED 22 March 2021
-@set UPDATED-MONTH March 2021
+@set UPDATED 28 December 2020
+@set UPDATED-MONTH December 2020
@set EDITION 1.6.4-git
@set VERSION 1.6.4-git
diff --git a/lib/dejagnu.exp b/lib/dejagnu.exp
index 7b2e5c4..3fdca76 100644
--- a/lib/dejagnu.exp
+++ b/lib/dejagnu.exp
@@ -23,7 +23,7 @@ set text "\[- A-Za-z0-9\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*<>]"
set SIZE size
if { [which $SIZE] == 0 } {
- perror "Can't find $SIZE."
+ perror "Can't find $SIZE." 0
}
# Get the size of the various section in OBJECT.
diff --git a/runtest b/runtest
index ee6880c..807a6ae 100755
--- a/runtest
+++ b/runtest
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 1992-2016 Free Software Foundation, Inc.
+# Copyright (C) 1992-2016, 2021 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -21,6 +21,18 @@
# This script was written by Rob Savoye. The script finds the proper
# expect shell and then starts DejaGnu.
+# shellcheck disable=SC2003
+# The shellcheck tool complains about use of expr and recommends using
+# newer shell features instead. Solaris 10 /bin/sh does not support the
+# newer features, so we must use expr in this script.
+
+# shellcheck disable=SC2006
+# The shellcheck tool complains about the old style backtick command
+# substitution. Solaris 10 /bin/sh does not support the new style $()
+# command substitution and the usage of command substitution in this script
+# is simple enough to work. Most notably, nesting backtick command
+# substitution is tricky, but we do not do that.
+
# Get the execution path to this script and the current directory.
mypath=${0-.}
@@ -40,13 +52,13 @@ else
done
IFS="$save_ifs"
fi
-execpath=$(echo "$mypath" | sed -e 's@/[^/]*$@@')
+execpath=`echo "$mypath" | sed -e 's@/[^/]*$@@'`
# Get the name by which runtest was invoked and extract the config
# triplet.
-runtest=$(echo "$mypath" | sed -e 's@^.*/@@')
-target=$(echo "$runtest" | sed -e 's/-runtest$//')
+runtest=`echo "$mypath" | sed -e 's@^.*/@@'`
+target=`echo "$runtest" | sed -e 's/-runtest$//'`
if [ "$target" != runtest ] ; then
target="--target ${target}"
else
@@ -86,7 +98,7 @@ verbose=0
debug=""
for a in "$@" ; do
case $a in
- -v|--v|-verb*|--verb*) verbose=$((verbose + 1)) ;;
+ -v|--v|-verb*|--verb*) verbose=`expr $verbose + 1` ;;
-D0|--D0) debug="-D 0" ;;
-D1|--D1) debug="-D 1" ;;
esac
@@ -108,10 +120,11 @@ fi
#
# .. which is a very weak assumption
+bindir1up_check=`echo "$execpath" | sed -e 's@/[^/]*$@/share/dejagnu@'`
+bindir2up_check=`echo "$execpath" | sed -e 's@/[^/]*/[^/]*$@/share/dejagnu@'`
+
for i in \
- $(echo "$execpath" | sed -e 's@/[^/]*$@/share/dejagnu@') \
- $(echo "$execpath" | sed -e 's@/[^/]*/[^/]*$@/share/dejagnu@') \
- "$execpath" \
+ "${bindir1up_check}" "${bindir2up_check}" "$execpath" \
/usr/share/dejagnu \
/usr/local/share/dejagnu ; do
if expr "$verbose" \> 1 > /dev/null ; then
@@ -139,9 +152,12 @@ if [ -z "$runpath" ] ; then
exit 1
fi
-if ! command -v "$expectbin" > /dev/null ; then
+if command -v "$expectbin" > /dev/null ; then :; else
echo "ERROR: unable to find expect in the PATH"
exit 1
fi
+# The `debug' and `target' variables are _intended_ to contain zero or two
+# words each. Word splitting is desired here.
+# shellcheck disable=SC2086
exec "$expectbin" $debug -- "$runpath"/runtest.exp $target ${1+"$@"}
diff --git a/runtest.exp b/runtest.exp
index e731fec..f513222 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -823,13 +823,52 @@ if {[expr {$build_triplet eq "" && $host_triplet eq ""}]} {
send_error "ERROR: Couldn't find config.guess program.\n"
exit 1
}
- catch "exec $config_guess" build_triplet
- switch -- $build_triplet {
- "No uname command or uname output not recognized" -
- "Unable to guess system type" {
- verbose "WARNING: Uname output not recognized"
- set build_triplet unknown
+ if { [info exists ::env(CONFIG_SHELL)] } {
+ if { [catch {exec $::env(CONFIG_SHELL) $config_guess} build_triplet] } {
+ if { [lindex $::errorCode 0] eq "CHILDSTATUS" } {
+ send_error "ERROR: Running config.guess with\
+ CONFIG_SHELL=$::env(CONFIG_SHELL)\
+ exited on code\
+ [lindex $::errorCode 2].\n"
+ } else {
+ send_error "ERROR: Running config.guess with\
+ CONFIG_SHELL=$::env(CONFIG_SHELL)\
+ produced error:\n"
+ send_error " $::errorCode\n"
+ }
+ }
+ } elseif { [info exists ::env(SHELL)] } {
+ if { [catch {exec $::env(SHELL) $config_guess} build_triplet] } {
+ if { [lindex $::errorCode 0] eq "CHILDSTATUS" } {
+ send_error "ERROR: Running config.guess with\
+ SHELL=$::env(SHELL)\
+ exited on code\
+ [lindex $::errorCode 2].\n"
+ } else {
+ send_error "ERROR: Running config.guess with\
+ SHELL=$::env(SHELL)\
+ produced error:\n"
+ send_error " $::errorCode\n"
+ }
}
+ } else {
+ if { [catch {exec $config_guess} build_triplet] } {
+ if { [lindex $::errorCode 0] eq "CHILDSTATUS" } {
+ send_error "ERROR: Running config.guess exited on code\
+ [lindex $::errorCode 2].\n"
+ } else {
+ send_error "ERROR: Running config.guess produced error:\n"
+ send_error " $::errorCode\n"
+ }
+ }
+ }
+ if { ![regexp -- {^[[:alnum:]_.]+(-[[:alnum:]_.]+)+$} $build_triplet] } {
+ send_error "ERROR: Running config.guess produced bogus build triplet:\n"
+ send_error " $build_triplet\n"
+ send_error " (Perhaps you need to set CONFIG_SHELL or\
+ SHELL in your environment\n"
+ send_error " to the absolute file name of a POSIX shell?)\n"
+ exit 1
}
verbose "Assuming build host is $build_triplet"
if { $host_triplet eq "" } {
diff --git a/testsuite/launcher.all/command.exp b/testsuite/launcher.all/command.exp
index 6c400f0..c461b6a 100644
--- a/testsuite/launcher.all/command.exp
+++ b/testsuite/launcher.all/command.exp
@@ -103,6 +103,19 @@ set tests {
{ "dejagnu foo --help fails if Tcl variant selected"
{foo --help} {EXPECT=true TCLSH=true } 2
"does not contain a help message" }
+
+ { "dejagnu foo --help fails if no POSIX Awk available"
+ {foo --help} {EXPECT=bogus TCLSH=bogus AWK=bogus GAWK=bogus} 2
+ "requires POSIX Awk" }
+ { "dejagnu foo --help recognizes dummy GNU Awk as Awk"
+ {foo --help} {EXPECT=bogus TCLSH=bogus AWK=bogus GAWK=true } 2
+ "does not contain a help message" }
+ {
+ # The above still fails, because true(1) does not actually
+ # evaluate Awk programs and the Awk program that tests if a help
+ # message is present returns true if the launcher should abort.
+ }
+
}
{ dejagnu-foo
diff --git a/testsuite/launcher.all/help.exp b/testsuite/launcher.all/help.exp
index 34eb68d..3f989f8 100644
--- a/testsuite/launcher.all/help.exp
+++ b/testsuite/launcher.all/help.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Free Software Foundation, Inc.
+# Copyright (C) 2018, 2021 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -21,10 +21,10 @@
# each element: { name args envars exit_code output_re... }
set tests {
{ "dejagnu help selects dejagnu(1) manpage"
- {help -v} {MANPAGER=echo} 0
+ {help --DGTest -v} {} 0
"Forwarding to man \".*doc/dejagnu\\.1\"" }
{ "dejagnu help help selects dejagnu-help(1) manpage"
- {help -v help} {MANPAGER=echo} 0
+ {help --DGTest -v help} {} 0
"Forwarding to man \".*doc/dejagnu-help\\.1\"" }
}
diff --git a/testsuite/lib/launcher.exp b/testsuite/lib/launcher.exp
index c9a40e7..6b4136a 100644
--- a/testsuite/lib/launcher.exp
+++ b/testsuite/lib/launcher.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Free Software Foundation, Inc.
+# Copyright (C) 2018, 2021 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -44,7 +44,9 @@ proc dejagnu_run { launcher arglist envlist } {
# reset errorCode
catch { error }
+ verbose -log "Running \"[lrange $exec_cmd 1 end] $arglist\" ..."
catch { eval $exec_cmd $arglist } output
+ verbose -log $output
if { [lindex $errorCode 0] eq "CHILDSTATUS" } {
return [list $output [lindex $errorCode 2]]
diff --git a/testsuite/lib/runtest.exp b/testsuite/lib/runtest.exp
index bbb541b..299cb0a 100644
--- a/testsuite/lib/runtest.exp
+++ b/testsuite/lib/runtest.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-2016, 2018, 2020 Free Software Foundation, Inc.
+# Copyright (C) 1992-2016, 2018, 2020, 2021 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -23,7 +23,11 @@ if { ![info exists RUNTEST] } {
}
if { ![info exists EXPECT] } {
- set EXPECT [findfile $base_dir/../../expect/expect $base_dir/../../expect/expect expect]
+ if { [info exists ::env(EXPECT)] } {
+ set EXPECT $::env(EXPECT)
+ } else {
+ set EXPECT expect
+ }
verbose "EXPECT defaulting to $EXPECT" 2
}
@@ -66,6 +70,13 @@ proc runtest_setup_nested_testsuite {} {
}
}
+proc runtest_copy_nested_testsuite_log { tool } {
+ verbose -log -- "---- ${tool}.log from failed test ----"
+ spawn -open [open [testsuite file -object -top tmpdir "${tool}.log"]]
+ expect { .+ { exp_continue } }
+ verbose -log -- "---- end ${tool}.log ----"
+}
+
proc runtest_cleanup_nested_testsuite {} {
upvar 1 tmpdir tmpdir
diff --git a/testsuite/report-card.all/onetest.exp b/testsuite/report-card.all/onetest.exp
index b2ae814..fcebdf7 100644
--- a/testsuite/report-card.all/onetest.exp
+++ b/testsuite/report-card.all/onetest.exp
@@ -193,11 +193,17 @@ foreach name $test_names {
}
# skip the footer
expect -re {.+} { exp_continue }
- # do the item and totals lines match?
- if { $item_line eq $totals_line } {
- pass "verify total for $name"
+ # were item and totals lines even produced?
+ if { [info exists item_line] && [info exists totals_line] } {
+ # do the item and totals lines match?
+ if { $item_line eq $totals_line } {
+ pass "verify total for $name"
+ } else {
+ fail "verify total for $name"
+ }
} else {
- fail "verify total for $name"
+ # either an item line or the totals line was not seen
+ unresolved "verify total for $name"
}
if { $separator_count == 2 } {
pass "expected separator lines for $name"
diff --git a/testsuite/runtest.libs/utils.test b/testsuite/runtest.libs/utils.test
index f4b13dd..8be6a2e 100644
--- a/testsuite/runtest.libs/utils.test
+++ b/testsuite/runtest.libs/utils.test
@@ -139,12 +139,12 @@ if {[which [file join $objdir .. config.status]] != 0} {
fail "which, absolute path to config.status"
}
-# Test 'which make'.
+# Test 'which sh'.
#
-if {[which make] != 0} {
- pass "which, make"
+if {[which sh] != 0} {
+ pass "which, sh"
} else {
- fail "which, make"
+ fail "which, sh"
}
### Do not adjust the comment on the next line. The grep test case
diff --git a/testsuite/runtest.main/nested/testsuite/bug.test/pr42399-sub.exp b/testsuite/runtest.main/nested/testsuite/bug.test/pr42399-sub.exp
index 331e043..d3f2b32 100644
--- a/testsuite/runtest.main/nested/testsuite/bug.test/pr42399-sub.exp
+++ b/testsuite/runtest.main/nested/testsuite/bug.test/pr42399-sub.exp
@@ -21,5 +21,6 @@
load_lib dejagnu.exp
if {[info exists N]} {
- host_execute [which awk] -f [testsuite file -source -test pr42399.awk] N=$N
+ host_execute [which awk] -f [testsuite file -source -test pr42399.awk] \
+ N=$N /dev/null
}
diff --git a/testsuite/runtest.main/nested/testsuite/stat.test/unit-sub.exp b/testsuite/runtest.main/nested/testsuite/stat.test/unit-sub.exp
index 96f8ac3..f3aece8 100644
--- a/testsuite/runtest.main/nested/testsuite/stat.test/unit-sub.exp
+++ b/testsuite/runtest.main/nested/testsuite/stat.test/unit-sub.exp
@@ -22,5 +22,7 @@ load_lib dejagnu.exp
if { [info exists STATS_TEST] } {
host_execute [which awk] -f [testsuite file -source -test unit-sub.awk] \
- UNIT_RESULT=$STATS_TEST
+ UNIT_RESULT=$STATS_TEST /dev/null
}
+# Solaris 10 /usr/bin/awk needs /dev/null actually passed on the command
+# line, but will run unit-sub.awk without problems if that is done.
diff --git a/testsuite/runtest.main/pr42399.exp b/testsuite/runtest.main/pr42399.exp
index 1782231..f1d3abe 100644
--- a/testsuite/runtest.main/pr42399.exp
+++ b/testsuite/runtest.main/pr42399.exp
@@ -33,7 +33,7 @@ proc test_pr42399 {} {
foreach test_count {5 5000} {
set result pass
- set failures [list]
+ set eof_reached 0
set want_num 1
set cmd_args [list --local_init nested-init.exp --tool bug \
-a pr42399-sub.exp N=$test_count]
@@ -49,9 +49,15 @@ proc test_pr42399 {} {
exp_continue
}
eof {
- $result "PR42399 test with $test_count inner tests"
+ set eof_reached 1
}
}
+ # Were any results at all produced?
+ if { $want_num == 1 } { set result unresolved }
+ # Did Expect report eof?
+ if { ! $eof_reached } { set result unresolved }
+ # emit test result
+ $result "PR42399 test with $test_count inner tests"
}
}
diff --git a/testsuite/runtest.main/pr48155-csh.sh b/testsuite/runtest.main/pr48155-csh.sh
new file mode 100755
index 0000000..08bc039
--- /dev/null
+++ b/testsuite/runtest.main/pr48155-csh.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+cat <<EOF 1>&2
+timestamp=2021-01-25: Command not found.
+Illegal variable name.
+EOF
+
+exit 1
diff --git a/testsuite/runtest.main/pr48155.exp b/testsuite/runtest.main/pr48155.exp
new file mode 100644
index 0000000..8b152cf
--- /dev/null
+++ b/testsuite/runtest.main/pr48155.exp
@@ -0,0 +1,102 @@
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# This file is part of DejaGnu.
+#
+# DejaGnu 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.
+#
+# DejaGnu 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 DejaGnu; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+# This file is a regression test for PR48155, where running with the
+# environment variable SHELL set to a C shell could cause an error running
+# config.guess that would not be properly detected.
+
+load_lib util-defs.exp
+
+runtest_setup_nested_testsuite
+
+# We need a modified local init file for this test; the regular
+# nested-init.exp will set host_triplet, which will cause runtest to assume
+# that that is the build_triplet and avoid attempting to run config.guess.
+exec sed -e /_triplet/d < nested-init.exp > pr48155-init.exp
+
+proc test_pr48155_setup {} {
+ upvar 1 envlist envlist
+ upvar 1 save_env save_env
+ upvar 1 unset_env unset_env
+
+ set unset_env [list]
+ foreach {name value} $envlist {
+ if { [info exists ::env($name)] } {
+ set save_env($name) $::env($name)
+ } else {
+ lappend unset_env $name
+ }
+ }
+ foreach name {CONFIG_SHELL SHELL} {
+ if { [info exists ::env($name)] } {
+ set save_env($name) $::env($name)
+ unset ::env($name)
+ }
+ }
+ array set ::env $envlist
+}
+proc test_pr48155_cleanup {} {
+ upvar 1 save_env save_env
+ upvar 1 unset_env unset_env
+
+ foreach name $unset_env { unset ::env($name) }
+ unset -nocomplain ::env(CONFIG_SHELL) ::env(SHELL)
+ array set ::env [array get save_env]
+}
+
+proc test_pr48155_error { name envlist output } {
+ global RUNTEST
+
+ test_pr48155_setup
+
+ if { [util_test $RUNTEST \
+ "--local_init pr48155-init.exp --tool null" \
+ "" \
+ $output] } {
+ fail $name
+ } else {
+ pass $name
+ }
+
+ test_pr48155_cleanup
+}
+
+test_pr48155_error "bogus CONFIG_SHELL as false" \
+ [list CONFIG_SHELL [which false]] \
+ "exited on code .*produced bogus build triplet:"
+test_pr48155_error "bogus CONFIG_SHELL as true" \
+ [list CONFIG_SHELL [which true]] \
+ "produced bogus build triplet:"
+test_pr48155_error "bogus CONFIG_SHELL as simulated C shell" \
+ [list CONFIG_SHELL [testsuite file -source -test pr48155-csh.sh]] \
+ "exited on code 1.*produced bogus build triplet:"
+
+# The following tests may change if planned future enhancements to reject
+# unusable values of SHELL are implemented.
+
+test_pr48155_error "bogus SHELL as false" \
+ [list SHELL [which false]] \
+ "exited on code .*produced bogus build triplet:"
+test_pr48155_error "bogus SHELL as true" \
+ [list SHELL [which true]] \
+ "produced bogus build triplet:"
+test_pr48155_error "bogus SHELL as simulated C shell" \
+ [list SHELL [testsuite file -source -test pr48155-csh.sh]] \
+ "exited on code 1.*produced bogus build triplet:"
+
+runtest_cleanup_nested_testsuite
diff --git a/testsuite/runtest.main/stats.exp b/testsuite/runtest.main/stats.exp
index 7f4f5be..a380751 100644
--- a/testsuite/runtest.main/stats.exp
+++ b/testsuite/runtest.main/stats.exp
@@ -50,6 +50,7 @@ foreach t $tests {
"" \
[lindex $t 2]] } {
fail "[lindex $t 0]/[lindex $t 1]"
+ runtest_copy_nested_testsuite_log stat
} else {
pass "[lindex $t 0]/[lindex $t 1]"
}