nokogiri 1.11.2 → 1.11.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 452bb1cd5efd099165d1c7e0e6239fdafc0b2e3620f715ceda57b23f620cc1d0
4
- data.tar.gz: 7776d8ab7ed9b0b528d48f0cd7882e5672cfab18671f146c5f67708ec9abf99c
3
+ metadata.gz: 26502f1ceffcb70db4821bae32463f59a8f50b2901010fa516c00dcfeba9d794
4
+ data.tar.gz: 22b116583b2d0313f6517478c8c970d0af2d283ae239a568f57ae26b89938426
5
5
  SHA512:
6
- metadata.gz: ca1b3d69c4653d4b5cbf0f46d1241897981196f0515c11b871e6502562da7241856dc567de19fac0f1e71a854aefcc6ec9bd8beac5a764368c53fc636677c7f4
7
- data.tar.gz: b524df68b46b37ad5e5e09451ed808f6e0f68ca06e4a7e3e7b483c97d6e595cfe668de5a539c776e0ceb7c49eaa45d5cc6bcda9c835548c6e5633f0f410330fa
6
+ metadata.gz: fa4dbd117a666fef11fe169ac8afb9ec98c5fc10f1f35bc87e95490ebf317c2ac5af938bea77de2a1451d8d8c9dac3a6b31ac84b965c1ae163d0f62efbac4d1e
7
+ data.tar.gz: 50a25639ff7ef0ea13d82eac230c8f901ca8baa03fc311b2d694ea07b1dffb7202f0f7d0776b09403b8101c435b8894b98dfa6884cb7d7ee2062d7b15969df55
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright 2008 -- 2020 by Mike Dalessio, Aaron Patterson, Yoko Harada, Akinori MUSHA, John Shahid, Karol Bucek, Lars Kanis, Sergio Arbeo, Timothy Elliott, Nobuyoshi Nakada, Charles Nutter, Patrick Mahoney.
3
+ Copyright 2008 -- 2021 by Mike Dalessio, Aaron Patterson, Yoko Harada, Akinori MUSHA, John Shahid, Karol Bucek, Lars Kanis, Sergio Arbeo, Timothy Elliott, Nobuyoshi Nakada, Charles Nutter, Patrick Mahoney.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
data/README.md CHANGED
@@ -57,7 +57,7 @@ Your first stops for learning more about Nokogiri should be:
57
57
 
58
58
  There are a few ways to ask exploratory questions:
59
59
 
60
- - The Discord chat channel is `#nokogiri-💎` at https://discord.gg/UyQnKrT
60
+ - The Ruby Discord chat server is active at https://discord.gg/UyQnKrT
61
61
  - The Nokogiri mailing list is active at https://groups.google.com/group/nokogiri-talk
62
62
  - Open an issue using the "Help Request" template at https://github.com/sparklemotion/nokogiri/issues
63
63
 
@@ -141,42 +141,41 @@ url(VALUE self)
141
141
  * Set the root element on this document
142
142
  */
143
143
  static VALUE
144
- set_root(VALUE self, VALUE root)
144
+ rb_xml_document_root_set(VALUE self, VALUE rb_new_root)
145
145
  {
146
- xmlDocPtr doc;
147
- xmlNodePtr new_root;
148
- xmlNodePtr old_root;
149
-
150
- Data_Get_Struct(self, xmlDoc, doc);
146
+ xmlDocPtr c_document;
147
+ xmlNodePtr c_new_root = NULL, c_current_root;
151
148
 
152
- old_root = NULL;
153
-
154
- if (NIL_P(root)) {
155
- old_root = xmlDocGetRootElement(doc);
156
-
157
- if (old_root) {
158
- xmlUnlinkNode(old_root);
159
- noko_xml_document_pin_node(old_root);
160
- }
149
+ Data_Get_Struct(self, xmlDoc, c_document);
161
150
 
162
- return root;
151
+ c_current_root = xmlDocGetRootElement(c_document);
152
+ if (c_current_root) {
153
+ xmlUnlinkNode(c_current_root);
154
+ noko_xml_document_pin_node(c_current_root);
163
155
  }
164
156
 
165
- Data_Get_Struct(root, xmlNode, new_root);
157
+ if (!NIL_P(rb_new_root)) {
158
+ if (!rb_obj_is_kind_of(rb_new_root, cNokogiriXmlNode)) {
159
+ rb_raise(rb_eArgError,
160
+ "expected Nokogiri::XML::Node but received %"PRIsVALUE,
161
+ rb_obj_class(rb_new_root));
162
+ }
166
163
 
164
+ Data_Get_Struct(rb_new_root, xmlNode, c_new_root);
167
165
 
168
- /* If the new root's document is not the same as the current document,
169
- * then we need to dup the node in to this document. */
170
- if (new_root->doc != doc) {
171
- old_root = xmlDocGetRootElement(doc);
172
- if (!(new_root = xmlDocCopyNode(new_root, doc, 1))) {
173
- rb_raise(rb_eRuntimeError, "Could not reparent node (xmlDocCopyNode)");
166
+ /* If the new root's document is not the same as the current document,
167
+ * then we need to dup the node in to this document. */
168
+ if (c_new_root->doc != c_document) {
169
+ c_new_root = xmlDocCopyNode(c_new_root, c_document, 1);
170
+ if (!c_new_root) {
171
+ rb_raise(rb_eRuntimeError, "Could not reparent node (xmlDocCopyNode)");
172
+ }
174
173
  }
175
174
  }
176
175
 
177
- xmlDocSetRootElement(doc, new_root);
178
- if (old_root) { noko_xml_document_pin_node(old_root); }
179
- return root;
176
+ xmlDocSetRootElement(c_document, c_new_root);
177
+
178
+ return rb_new_root;
180
179
  }
181
180
 
182
181
  /*
@@ -186,17 +185,19 @@ set_root(VALUE self, VALUE root)
186
185
  * Get the root node for this document.
187
186
  */
188
187
  static VALUE
189
- root(VALUE self)
188
+ rb_xml_document_root(VALUE self)
190
189
  {
191
- xmlDocPtr doc;
192
- xmlNodePtr root;
190
+ xmlDocPtr c_document;
191
+ xmlNodePtr c_root;
193
192
 
194
- Data_Get_Struct(self, xmlDoc, doc);
193
+ Data_Get_Struct(self, xmlDoc, c_document);
195
194
 
196
- root = xmlDocGetRootElement(doc);
195
+ c_root = xmlDocGetRootElement(c_document);
196
+ if (!c_root) {
197
+ return Qnil;
198
+ }
197
199
 
198
- if (!root) { return Qnil; }
199
- return noko_xml_node_wrap(Qnil, root) ;
200
+ return noko_xml_node_wrap(Qnil, c_root) ;
200
201
  }
201
202
 
202
203
  /*
@@ -666,8 +667,8 @@ noko_init_xml_document()
666
667
  rb_define_singleton_method(cNokogiriXmlDocument, "read_io", read_io, 4);
667
668
  rb_define_singleton_method(cNokogiriXmlDocument, "new", new, -1);
668
669
 
669
- rb_define_method(cNokogiriXmlDocument, "root", root, 0);
670
- rb_define_method(cNokogiriXmlDocument, "root=", set_root, 1);
670
+ rb_define_method(cNokogiriXmlDocument, "root", rb_xml_document_root, 0);
671
+ rb_define_method(cNokogiriXmlDocument, "root=", rb_xml_document_root_set, 1);
671
672
  rb_define_method(cNokogiriXmlDocument, "encoding", encoding, 0);
672
673
  rb_define_method(cNokogiriXmlDocument, "encoding=", set_encoding, 1);
673
674
  rb_define_method(cNokogiriXmlDocument, "version", version, 0);
@@ -2,7 +2,7 @@
2
2
 
3
3
  VALUE cNokogiriXmlNode ;
4
4
 
5
- static ID decorate, decorate_bang;
5
+ static ID id_decorate, id_decorate_bang;
6
6
 
7
7
  #ifdef DEBUG
8
8
  static void
@@ -357,7 +357,7 @@ ok:
357
357
 
358
358
  reparented_obj = noko_xml_node_wrap(Qnil, reparented);
359
359
 
360
- rb_funcall(reparented_obj, decorate_bang, 0);
360
+ rb_funcall(reparented_obj, id_decorate_bang, 0);
361
361
 
362
362
  return reparented_obj ;
363
363
  }
@@ -1443,6 +1443,7 @@ add_namespace_definition(VALUE rb_node, VALUE rb_prefix, VALUE rb_href)
1443
1443
  * Create a new node with +name+ sharing GC lifecycle with +document+.
1444
1444
  * @param name [String]
1445
1445
  * @param document [Nokogiri::XML::Document]
1446
+ * @yieldparam node [Nokogiri::XML::Node]
1446
1447
  * @return [Nokogiri::XML::Node]
1447
1448
  * @see Nokogiri::XML::Node#initialize
1448
1449
  */
@@ -1655,85 +1656,83 @@ in_context(VALUE self, VALUE _str, VALUE _options)
1655
1656
 
1656
1657
 
1657
1658
  VALUE
1658
- noko_xml_node_wrap(VALUE klass, xmlNodePtr node)
1659
+ noko_xml_node_wrap(VALUE rb_class, xmlNodePtr c_node)
1659
1660
  {
1660
- VALUE document = Qnil ;
1661
- VALUE node_cache = Qnil ;
1662
- VALUE rb_node = Qnil ;
1661
+ VALUE rb_document, rb_node_cache, rb_node;
1663
1662
  nokogiriTuplePtr node_has_a_document;
1664
- xmlDocPtr doc;
1663
+ xmlDocPtr c_doc;
1665
1664
  void (*mark_method)(xmlNodePtr) = NULL ;
1666
1665
 
1667
- assert(node);
1666
+ assert(c_node);
1668
1667
 
1669
- if (node->type == XML_DOCUMENT_NODE || node->type == XML_HTML_DOCUMENT_NODE) {
1670
- return DOC_RUBY_OBJECT(node->doc);
1668
+ if (c_node->type == XML_DOCUMENT_NODE || c_node->type == XML_HTML_DOCUMENT_NODE) {
1669
+ return DOC_RUBY_OBJECT(c_node->doc);
1671
1670
  }
1672
1671
 
1673
1672
  /* It's OK if the node doesn't have a fully-realized document (as in XML::Reader). */
1674
1673
  /* see https://github.com/sparklemotion/nokogiri/issues/95 */
1675
1674
  /* and https://github.com/sparklemotion/nokogiri/issues/439 */
1676
- doc = node->doc;
1677
- if (doc->type == XML_DOCUMENT_FRAG_NODE) { doc = doc->doc; }
1678
- node_has_a_document = DOC_RUBY_OBJECT_TEST(doc);
1675
+ c_doc = c_node->doc;
1676
+ if (c_doc->type == XML_DOCUMENT_FRAG_NODE) { c_doc = c_doc->doc; }
1677
+ node_has_a_document = DOC_RUBY_OBJECT_TEST(c_doc);
1679
1678
 
1680
- if (node->_private && node_has_a_document) {
1681
- return (VALUE)node->_private;
1679
+ if (c_node->_private && node_has_a_document) {
1680
+ return (VALUE)c_node->_private;
1682
1681
  }
1683
1682
 
1684
- if (!RTEST(klass)) {
1685
- switch (node->type) {
1683
+ if (!RTEST(rb_class)) {
1684
+ switch (c_node->type) {
1686
1685
  case XML_ELEMENT_NODE:
1687
- klass = cNokogiriXmlElement;
1686
+ rb_class = cNokogiriXmlElement;
1688
1687
  break;
1689
1688
  case XML_TEXT_NODE:
1690
- klass = cNokogiriXmlText;
1689
+ rb_class = cNokogiriXmlText;
1691
1690
  break;
1692
1691
  case XML_ATTRIBUTE_NODE:
1693
- klass = cNokogiriXmlAttr;
1692
+ rb_class = cNokogiriXmlAttr;
1694
1693
  break;
1695
1694
  case XML_ENTITY_REF_NODE:
1696
- klass = cNokogiriXmlEntityReference;
1695
+ rb_class = cNokogiriXmlEntityReference;
1697
1696
  break;
1698
1697
  case XML_COMMENT_NODE:
1699
- klass = cNokogiriXmlComment;
1698
+ rb_class = cNokogiriXmlComment;
1700
1699
  break;
1701
1700
  case XML_DOCUMENT_FRAG_NODE:
1702
- klass = cNokogiriXmlDocumentFragment;
1701
+ rb_class = cNokogiriXmlDocumentFragment;
1703
1702
  break;
1704
1703
  case XML_PI_NODE:
1705
- klass = cNokogiriXmlProcessingInstruction;
1704
+ rb_class = cNokogiriXmlProcessingInstruction;
1706
1705
  break;
1707
1706
  case XML_ENTITY_DECL:
1708
- klass = cNokogiriXmlEntityDecl;
1707
+ rb_class = cNokogiriXmlEntityDecl;
1709
1708
  break;
1710
1709
  case XML_CDATA_SECTION_NODE:
1711
- klass = cNokogiriXmlCData;
1710
+ rb_class = cNokogiriXmlCData;
1712
1711
  break;
1713
1712
  case XML_DTD_NODE:
1714
- klass = cNokogiriXmlDtd;
1713
+ rb_class = cNokogiriXmlDtd;
1715
1714
  break;
1716
1715
  case XML_ATTRIBUTE_DECL:
1717
- klass = cNokogiriXmlAttributeDecl;
1716
+ rb_class = cNokogiriXmlAttributeDecl;
1718
1717
  break;
1719
1718
  case XML_ELEMENT_DECL:
1720
- klass = cNokogiriXmlElementDecl;
1719
+ rb_class = cNokogiriXmlElementDecl;
1721
1720
  break;
1722
1721
  default:
1723
- klass = cNokogiriXmlNode;
1722
+ rb_class = cNokogiriXmlNode;
1724
1723
  }
1725
1724
  }
1726
1725
 
1727
1726
  mark_method = node_has_a_document ? mark : NULL ;
1728
1727
 
1729
- rb_node = Data_Wrap_Struct(klass, mark_method, debug_node_dealloc, node) ;
1730
- node->_private = (void *)rb_node;
1728
+ rb_node = Data_Wrap_Struct(rb_class, mark_method, debug_node_dealloc, c_node) ;
1729
+ c_node->_private = (void *)rb_node;
1731
1730
 
1732
1731
  if (node_has_a_document) {
1733
- document = DOC_RUBY_OBJECT(doc);
1734
- node_cache = DOC_NODE_CACHE(doc);
1735
- rb_ary_push(node_cache, rb_node);
1736
- rb_funcall(document, decorate, 1, rb_node);
1732
+ rb_document = DOC_RUBY_OBJECT(c_doc);
1733
+ rb_node_cache = DOC_NODE_CACHE(c_doc);
1734
+ rb_ary_push(rb_node_cache, rb_node);
1735
+ rb_funcall(rb_document, id_decorate, 1, rb_node);
1737
1736
  }
1738
1737
 
1739
1738
  return rb_node ;
@@ -1818,8 +1817,8 @@ noko_init_xml_node()
1818
1817
  rb_define_private_method(cNokogiriXmlNode, "set_namespace", set_namespace, 1);
1819
1818
  rb_define_private_method(cNokogiriXmlNode, "compare", compare, 1);
1820
1819
 
1821
- decorate = rb_intern("decorate");
1822
- decorate_bang = rb_intern("decorate!");
1820
+ id_decorate = rb_intern("decorate");
1821
+ id_decorate_bang = rb_intern("decorate!");
1823
1822
  }
1824
1823
 
1825
1824
  /* vim: set noet sw=4 sws=4 */
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Nokogiri
3
3
  # The version of Nokogiri you are using
4
- VERSION = "1.11.2"
4
+ VERSION = "1.11.3"
5
5
  end
@@ -14,11 +14,12 @@ module Nokogiri
14
14
  # Nokogiri::XML::Searchable#xpath
15
15
  #
16
16
  class Document < Nokogiri::XML::Node
17
- # I'm ignoring unicode characters here.
18
- # See http://www.w3.org/TR/REC-xml-names/#ns-decl for more details.
17
+ # See http://www.w3.org/TR/REC-xml-names/#ns-decl for more details. Note that we're not
18
+ # attempting to handle unicode characters partly because libxml2 doesn't handle unicode
19
+ # characters in NCNAMEs.
19
20
  NCNAME_START_CHAR = "A-Za-z_"
20
- NCNAME_CHAR = NCNAME_START_CHAR + "\\-.0-9"
21
- NCNAME_RE = /^xmlns(:[#{NCNAME_START_CHAR}][#{NCNAME_CHAR}]*)?$/
21
+ NCNAME_CHAR = NCNAME_START_CHAR + "\\-\\.0-9"
22
+ NCNAME_RE = /^xmlns(?::([#{NCNAME_START_CHAR}][#{NCNAME_CHAR}]*))?$/
22
23
 
23
24
  ##
24
25
  # Parse an XML file.
@@ -118,33 +119,58 @@ module Nokogiri
118
119
  end
119
120
 
120
121
  ##
121
- # Create an element with +name+, and optionally setting the content and attributes.
122
+ # Create a new +Element+ with +name+ sharing GC lifecycle with the document, optionally
123
+ # setting contents or attributes.
122
124
  #
123
- # doc.create_element "div" # <div></div>
124
- # doc.create_element "div", :class => "container" # <div class='container'></div>
125
- # doc.create_element "div", "contents" # <div>contents</div>
126
- # doc.create_element "div", "contents", :class => "container" # <div class='container'>contents</div>
127
- # doc.create_element "div" { |node| node['class'] = "container" } # <div class='container'></div>
125
+ # Arguments may be passed to initialize the element:
126
+ # - a +Hash+ argument will be used to set attributes
127
+ # - a non-Hash object that responds to +#to_s+ will be used to set the new node's contents
128
128
  #
129
- def create_element name, *args, &block
129
+ # A block may be passed to mutate the node.
130
+ #
131
+ # @param name [String]
132
+ # @param contents_or_attrs [#to_s,Hash]
133
+ # @yieldparam node [Nokogiri::XML::Element]
134
+ # @return [Nokogiri::XML::Element]
135
+ #
136
+ # @example An empty element without attributes
137
+ # doc.create_element("div")
138
+ # # => <div></div>
139
+ #
140
+ # @example An element with contents
141
+ # doc.create_element("div", "contents")
142
+ # # => <div>contents</div>
143
+ #
144
+ # @example An element with attributes
145
+ # doc.create_element("div", {"class" => "container"})
146
+ # # => <div class='container'></div>
147
+ #
148
+ # @example An element with contents and attributes
149
+ # doc.create_element("div", "contents", {"class" => "container"})
150
+ # # => <div class='container'>contents</div>
151
+ #
152
+ # @example Passing a block to mutate the element
153
+ # doc.create_element("div") { |node| node["class"] = "blue" if before_noon? }
154
+ #
155
+ def create_element(name, *contents_or_attrs, &block)
130
156
  elm = Nokogiri::XML::Element.new(name, self, &block)
131
- args.each do |arg|
157
+ contents_or_attrs.each do |arg|
132
158
  case arg
133
159
  when Hash
134
- arg.each { |k,v|
160
+ arg.each do |k, v|
135
161
  key = k.to_s
136
162
  if key =~ NCNAME_RE
137
- ns_name = key.split(":", 2)[1]
138
- elm.add_namespace_definition ns_name, v
163
+ ns_name = Regexp.last_match(1)
164
+ elm.add_namespace_definition(ns_name, v)
139
165
  else
140
166
  elm[k.to_s] = v.to_s
141
167
  end
142
- }
168
+ end
143
169
  else
144
170
  elm.content = arg
145
171
  end
146
172
  end
147
- if ns = elm.namespace_definitions.find { |n| n.prefix.nil? or n.prefix == '' }
173
+ if ns = elm.namespace_definitions.find { |n| n.prefix.nil? || (n.prefix == '') }
148
174
  elm.namespace = ns
149
175
  end
150
176
  elm
@@ -93,6 +93,7 @@ module Nokogiri
93
93
  # Create a new node with +name+ sharing GC lifecycle with +document+.
94
94
  # @param name [String]
95
95
  # @param document [Nokogiri::XML::Document]
96
+ # @yieldparam node [Nokogiri::XML::Node]
96
97
  # @return [Nokogiri::XML::Node]
97
98
  # @see Nokogiri::XML::Node.new
98
99
  def initialize(name, document)
@@ -0,0 +1,2511 @@
1
+ Update config.guess and config.sub to the versions present in automake v1.16.3, so that users on
2
+ aarch64/arm64/M1 can compile.
3
+
4
+ --- a/config.sub
5
+ +++ b/config.sub
6
+ @@ -1,8 +1,8 @@
7
+ #! /bin/sh
8
+ # Configuration validation subroutine script.
9
+ -# Copyright 1992-2018 Free Software Foundation, Inc.
10
+ +# Copyright 1992-2020 Free Software Foundation, Inc.
11
+
12
+ -timestamp='2018-08-29'
13
+ +timestamp='2020-11-07'
14
+
15
+ # This file is free software; you can redistribute it and/or modify it
16
+ # under the terms of the GNU General Public License as published by
17
+ @@ -50,7 +50,7 @@
18
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
19
+ # It is wrong to echo any other type of specification.
20
+
21
+ -me=`echo "$0" | sed -e 's,.*/,,'`
22
+ +me=$(echo "$0" | sed -e 's,.*/,,')
23
+
24
+ usage="\
25
+ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
26
+ @@ -67,7 +67,7 @@
27
+ version="\
28
+ GNU config.sub ($timestamp)
29
+
30
+ -Copyright 1992-2018 Free Software Foundation, Inc.
31
+ +Copyright 1992-2020 Free Software Foundation, Inc.
32
+
33
+ This is free software; see the source for copying conditions. There is NO
34
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
35
+ @@ -89,7 +89,7 @@
36
+ - ) # Use stdin as input.
37
+ break ;;
38
+ -* )
39
+ - echo "$me: invalid option $1$help"
40
+ + echo "$me: invalid option $1$help" >&2
41
+ exit 1 ;;
42
+
43
+ *local*)
44
+ @@ -111,7 +111,8 @@
45
+ esac
46
+
47
+ # Split fields of configuration type
48
+ -IFS="-" read -r field1 field2 field3 field4 <<EOF
49
+ +# shellcheck disable=SC2162
50
+ +IFS="-" read field1 field2 field3 field4 <<EOF
51
+ $1
52
+ EOF
53
+
54
+ @@ -123,37 +124,36 @@
55
+ ;;
56
+ *-*-*-*)
57
+ basic_machine=$field1-$field2
58
+ - os=$field3-$field4
59
+ + basic_os=$field3-$field4
60
+ ;;
61
+ *-*-*)
62
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
63
+ # parts
64
+ maybe_os=$field2-$field3
65
+ case $maybe_os in
66
+ - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
67
+ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
68
+ + nto-qnx* | linux-* | uclinux-uclibc* \
69
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
70
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
71
+ | storm-chaos* | os2-emx* | rtmk-nova*)
72
+ basic_machine=$field1
73
+ - os=$maybe_os
74
+ + basic_os=$maybe_os
75
+ ;;
76
+ android-linux)
77
+ basic_machine=$field1-unknown
78
+ - os=linux-android
79
+ + basic_os=linux-android
80
+ ;;
81
+ *)
82
+ basic_machine=$field1-$field2
83
+ - os=$field3
84
+ + basic_os=$field3
85
+ ;;
86
+ esac
87
+ ;;
88
+ *-*)
89
+ - # A lone config we happen to match not fitting any patern
90
+ + # A lone config we happen to match not fitting any pattern
91
+ case $field1-$field2 in
92
+ decstation-3100)
93
+ basic_machine=mips-dec
94
+ - os=
95
+ + basic_os=
96
+ ;;
97
+ *-*)
98
+ # Second component is usually, but not always the OS
99
+ @@ -161,7 +161,7 @@
100
+ # Prevent following clause from handling this valid os
101
+ sun*os*)
102
+ basic_machine=$field1
103
+ - os=$field2
104
+ + basic_os=$field2
105
+ ;;
106
+ # Manufacturers
107
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
108
+ @@ -174,11 +174,11 @@
109
+ | microblaze* | sim | cisco \
110
+ | oki | wec | wrs | winbond)
111
+ basic_machine=$field1-$field2
112
+ - os=
113
+ + basic_os=
114
+ ;;
115
+ *)
116
+ basic_machine=$field1
117
+ - os=$field2
118
+ + basic_os=$field2
119
+ ;;
120
+ esac
121
+ ;;
122
+ @@ -190,450 +190,451 @@
123
+ case $field1 in
124
+ 386bsd)
125
+ basic_machine=i386-pc
126
+ - os=bsd
127
+ + basic_os=bsd
128
+ ;;
129
+ a29khif)
130
+ basic_machine=a29k-amd
131
+ - os=udi
132
+ + basic_os=udi
133
+ ;;
134
+ adobe68k)
135
+ basic_machine=m68010-adobe
136
+ - os=scout
137
+ + basic_os=scout
138
+ ;;
139
+ alliant)
140
+ basic_machine=fx80-alliant
141
+ - os=
142
+ + basic_os=
143
+ ;;
144
+ altos | altos3068)
145
+ basic_machine=m68k-altos
146
+ - os=
147
+ + basic_os=
148
+ ;;
149
+ am29k)
150
+ basic_machine=a29k-none
151
+ - os=bsd
152
+ + basic_os=bsd
153
+ ;;
154
+ amdahl)
155
+ basic_machine=580-amdahl
156
+ - os=sysv
157
+ + basic_os=sysv
158
+ ;;
159
+ amiga)
160
+ basic_machine=m68k-unknown
161
+ - os=
162
+ + basic_os=
163
+ ;;
164
+ amigaos | amigados)
165
+ basic_machine=m68k-unknown
166
+ - os=amigaos
167
+ + basic_os=amigaos
168
+ ;;
169
+ amigaunix | amix)
170
+ basic_machine=m68k-unknown
171
+ - os=sysv4
172
+ + basic_os=sysv4
173
+ ;;
174
+ apollo68)
175
+ basic_machine=m68k-apollo
176
+ - os=sysv
177
+ + basic_os=sysv
178
+ ;;
179
+ apollo68bsd)
180
+ basic_machine=m68k-apollo
181
+ - os=bsd
182
+ + basic_os=bsd
183
+ ;;
184
+ aros)
185
+ basic_machine=i386-pc
186
+ - os=aros
187
+ + basic_os=aros
188
+ ;;
189
+ aux)
190
+ basic_machine=m68k-apple
191
+ - os=aux
192
+ + basic_os=aux
193
+ ;;
194
+ balance)
195
+ basic_machine=ns32k-sequent
196
+ - os=dynix
197
+ + basic_os=dynix
198
+ ;;
199
+ blackfin)
200
+ basic_machine=bfin-unknown
201
+ - os=linux
202
+ + basic_os=linux
203
+ ;;
204
+ cegcc)
205
+ basic_machine=arm-unknown
206
+ - os=cegcc
207
+ + basic_os=cegcc
208
+ ;;
209
+ convex-c1)
210
+ basic_machine=c1-convex
211
+ - os=bsd
212
+ + basic_os=bsd
213
+ ;;
214
+ convex-c2)
215
+ basic_machine=c2-convex
216
+ - os=bsd
217
+ + basic_os=bsd
218
+ ;;
219
+ convex-c32)
220
+ basic_machine=c32-convex
221
+ - os=bsd
222
+ + basic_os=bsd
223
+ ;;
224
+ convex-c34)
225
+ basic_machine=c34-convex
226
+ - os=bsd
227
+ + basic_os=bsd
228
+ ;;
229
+ convex-c38)
230
+ basic_machine=c38-convex
231
+ - os=bsd
232
+ + basic_os=bsd
233
+ ;;
234
+ cray)
235
+ basic_machine=j90-cray
236
+ - os=unicos
237
+ + basic_os=unicos
238
+ ;;
239
+ crds | unos)
240
+ basic_machine=m68k-crds
241
+ - os=
242
+ + basic_os=
243
+ ;;
244
+ da30)
245
+ basic_machine=m68k-da30
246
+ - os=
247
+ + basic_os=
248
+ ;;
249
+ decstation | pmax | pmin | dec3100 | decstatn)
250
+ basic_machine=mips-dec
251
+ - os=
252
+ + basic_os=
253
+ ;;
254
+ delta88)
255
+ basic_machine=m88k-motorola
256
+ - os=sysv3
257
+ + basic_os=sysv3
258
+ ;;
259
+ dicos)
260
+ basic_machine=i686-pc
261
+ - os=dicos
262
+ + basic_os=dicos
263
+ ;;
264
+ djgpp)
265
+ basic_machine=i586-pc
266
+ - os=msdosdjgpp
267
+ + basic_os=msdosdjgpp
268
+ ;;
269
+ ebmon29k)
270
+ basic_machine=a29k-amd
271
+ - os=ebmon
272
+ + basic_os=ebmon
273
+ ;;
274
+ es1800 | OSE68k | ose68k | ose | OSE)
275
+ basic_machine=m68k-ericsson
276
+ - os=ose
277
+ + basic_os=ose
278
+ ;;
279
+ gmicro)
280
+ basic_machine=tron-gmicro
281
+ - os=sysv
282
+ + basic_os=sysv
283
+ ;;
284
+ go32)
285
+ basic_machine=i386-pc
286
+ - os=go32
287
+ + basic_os=go32
288
+ ;;
289
+ h8300hms)
290
+ basic_machine=h8300-hitachi
291
+ - os=hms
292
+ + basic_os=hms
293
+ ;;
294
+ h8300xray)
295
+ basic_machine=h8300-hitachi
296
+ - os=xray
297
+ + basic_os=xray
298
+ ;;
299
+ h8500hms)
300
+ basic_machine=h8500-hitachi
301
+ - os=hms
302
+ + basic_os=hms
303
+ ;;
304
+ harris)
305
+ basic_machine=m88k-harris
306
+ - os=sysv3
307
+ + basic_os=sysv3
308
+ ;;
309
+ - hp300)
310
+ + hp300 | hp300hpux)
311
+ basic_machine=m68k-hp
312
+ + basic_os=hpux
313
+ ;;
314
+ hp300bsd)
315
+ basic_machine=m68k-hp
316
+ - os=bsd
317
+ - ;;
318
+ - hp300hpux)
319
+ - basic_machine=m68k-hp
320
+ - os=hpux
321
+ + basic_os=bsd
322
+ ;;
323
+ hppaosf)
324
+ basic_machine=hppa1.1-hp
325
+ - os=osf
326
+ + basic_os=osf
327
+ ;;
328
+ hppro)
329
+ basic_machine=hppa1.1-hp
330
+ - os=proelf
331
+ + basic_os=proelf
332
+ ;;
333
+ i386mach)
334
+ basic_machine=i386-mach
335
+ - os=mach
336
+ - ;;
337
+ - vsta)
338
+ - basic_machine=i386-pc
339
+ - os=vsta
340
+ + basic_os=mach
341
+ ;;
342
+ isi68 | isi)
343
+ basic_machine=m68k-isi
344
+ - os=sysv
345
+ + basic_os=sysv
346
+ ;;
347
+ m68knommu)
348
+ basic_machine=m68k-unknown
349
+ - os=linux
350
+ + basic_os=linux
351
+ ;;
352
+ magnum | m3230)
353
+ basic_machine=mips-mips
354
+ - os=sysv
355
+ + basic_os=sysv
356
+ ;;
357
+ merlin)
358
+ basic_machine=ns32k-utek
359
+ - os=sysv
360
+ + basic_os=sysv
361
+ ;;
362
+ mingw64)
363
+ basic_machine=x86_64-pc
364
+ - os=mingw64
365
+ + basic_os=mingw64
366
+ ;;
367
+ mingw32)
368
+ basic_machine=i686-pc
369
+ - os=mingw32
370
+ + basic_os=mingw32
371
+ ;;
372
+ mingw32ce)
373
+ basic_machine=arm-unknown
374
+ - os=mingw32ce
375
+ + basic_os=mingw32ce
376
+ ;;
377
+ monitor)
378
+ basic_machine=m68k-rom68k
379
+ - os=coff
380
+ + basic_os=coff
381
+ ;;
382
+ morphos)
383
+ basic_machine=powerpc-unknown
384
+ - os=morphos
385
+ + basic_os=morphos
386
+ ;;
387
+ moxiebox)
388
+ basic_machine=moxie-unknown
389
+ - os=moxiebox
390
+ + basic_os=moxiebox
391
+ ;;
392
+ msdos)
393
+ basic_machine=i386-pc
394
+ - os=msdos
395
+ + basic_os=msdos
396
+ ;;
397
+ msys)
398
+ basic_machine=i686-pc
399
+ - os=msys
400
+ + basic_os=msys
401
+ ;;
402
+ mvs)
403
+ basic_machine=i370-ibm
404
+ - os=mvs
405
+ + basic_os=mvs
406
+ ;;
407
+ nacl)
408
+ basic_machine=le32-unknown
409
+ - os=nacl
410
+ + basic_os=nacl
411
+ ;;
412
+ ncr3000)
413
+ basic_machine=i486-ncr
414
+ - os=sysv4
415
+ + basic_os=sysv4
416
+ ;;
417
+ netbsd386)
418
+ basic_machine=i386-pc
419
+ - os=netbsd
420
+ + basic_os=netbsd
421
+ ;;
422
+ netwinder)
423
+ basic_machine=armv4l-rebel
424
+ - os=linux
425
+ + basic_os=linux
426
+ ;;
427
+ news | news700 | news800 | news900)
428
+ basic_machine=m68k-sony
429
+ - os=newsos
430
+ + basic_os=newsos
431
+ ;;
432
+ news1000)
433
+ basic_machine=m68030-sony
434
+ - os=newsos
435
+ + basic_os=newsos
436
+ ;;
437
+ necv70)
438
+ basic_machine=v70-nec
439
+ - os=sysv
440
+ + basic_os=sysv
441
+ ;;
442
+ nh3000)
443
+ basic_machine=m68k-harris
444
+ - os=cxux
445
+ + basic_os=cxux
446
+ ;;
447
+ nh[45]000)
448
+ basic_machine=m88k-harris
449
+ - os=cxux
450
+ + basic_os=cxux
451
+ ;;
452
+ nindy960)
453
+ basic_machine=i960-intel
454
+ - os=nindy
455
+ + basic_os=nindy
456
+ ;;
457
+ mon960)
458
+ basic_machine=i960-intel
459
+ - os=mon960
460
+ + basic_os=mon960
461
+ ;;
462
+ nonstopux)
463
+ basic_machine=mips-compaq
464
+ - os=nonstopux
465
+ + basic_os=nonstopux
466
+ ;;
467
+ os400)
468
+ basic_machine=powerpc-ibm
469
+ - os=os400
470
+ + basic_os=os400
471
+ ;;
472
+ OSE68000 | ose68000)
473
+ basic_machine=m68000-ericsson
474
+ - os=ose
475
+ + basic_os=ose
476
+ ;;
477
+ os68k)
478
+ basic_machine=m68k-none
479
+ - os=os68k
480
+ + basic_os=os68k
481
+ ;;
482
+ paragon)
483
+ basic_machine=i860-intel
484
+ - os=osf
485
+ + basic_os=osf
486
+ ;;
487
+ parisc)
488
+ basic_machine=hppa-unknown
489
+ - os=linux
490
+ + basic_os=linux
491
+ + ;;
492
+ + psp)
493
+ + basic_machine=mipsallegrexel-sony
494
+ + basic_os=psp
495
+ ;;
496
+ pw32)
497
+ basic_machine=i586-unknown
498
+ - os=pw32
499
+ + basic_os=pw32
500
+ ;;
501
+ rdos | rdos64)
502
+ basic_machine=x86_64-pc
503
+ - os=rdos
504
+ + basic_os=rdos
505
+ ;;
506
+ rdos32)
507
+ basic_machine=i386-pc
508
+ - os=rdos
509
+ + basic_os=rdos
510
+ ;;
511
+ rom68k)
512
+ basic_machine=m68k-rom68k
513
+ - os=coff
514
+ + basic_os=coff
515
+ ;;
516
+ sa29200)
517
+ basic_machine=a29k-amd
518
+ - os=udi
519
+ + basic_os=udi
520
+ ;;
521
+ sei)
522
+ basic_machine=mips-sei
523
+ - os=seiux
524
+ + basic_os=seiux
525
+ ;;
526
+ sequent)
527
+ basic_machine=i386-sequent
528
+ - os=
529
+ + basic_os=
530
+ ;;
531
+ sps7)
532
+ basic_machine=m68k-bull
533
+ - os=sysv2
534
+ + basic_os=sysv2
535
+ ;;
536
+ st2000)
537
+ basic_machine=m68k-tandem
538
+ - os=
539
+ + basic_os=
540
+ ;;
541
+ stratus)
542
+ basic_machine=i860-stratus
543
+ - os=sysv4
544
+ + basic_os=sysv4
545
+ ;;
546
+ sun2)
547
+ basic_machine=m68000-sun
548
+ - os=
549
+ + basic_os=
550
+ ;;
551
+ sun2os3)
552
+ basic_machine=m68000-sun
553
+ - os=sunos3
554
+ + basic_os=sunos3
555
+ ;;
556
+ sun2os4)
557
+ basic_machine=m68000-sun
558
+ - os=sunos4
559
+ + basic_os=sunos4
560
+ ;;
561
+ sun3)
562
+ basic_machine=m68k-sun
563
+ - os=
564
+ + basic_os=
565
+ ;;
566
+ sun3os3)
567
+ basic_machine=m68k-sun
568
+ - os=sunos3
569
+ + basic_os=sunos3
570
+ ;;
571
+ sun3os4)
572
+ basic_machine=m68k-sun
573
+ - os=sunos4
574
+ + basic_os=sunos4
575
+ ;;
576
+ sun4)
577
+ basic_machine=sparc-sun
578
+ - os=
579
+ + basic_os=
580
+ ;;
581
+ sun4os3)
582
+ basic_machine=sparc-sun
583
+ - os=sunos3
584
+ + basic_os=sunos3
585
+ ;;
586
+ sun4os4)
587
+ basic_machine=sparc-sun
588
+ - os=sunos4
589
+ + basic_os=sunos4
590
+ ;;
591
+ sun4sol2)
592
+ basic_machine=sparc-sun
593
+ - os=solaris2
594
+ + basic_os=solaris2
595
+ ;;
596
+ sun386 | sun386i | roadrunner)
597
+ basic_machine=i386-sun
598
+ - os=
599
+ + basic_os=
600
+ ;;
601
+ sv1)
602
+ basic_machine=sv1-cray
603
+ - os=unicos
604
+ + basic_os=unicos
605
+ ;;
606
+ symmetry)
607
+ basic_machine=i386-sequent
608
+ - os=dynix
609
+ + basic_os=dynix
610
+ ;;
611
+ t3e)
612
+ basic_machine=alphaev5-cray
613
+ - os=unicos
614
+ + basic_os=unicos
615
+ ;;
616
+ t90)
617
+ basic_machine=t90-cray
618
+ - os=unicos
619
+ + basic_os=unicos
620
+ ;;
621
+ toad1)
622
+ basic_machine=pdp10-xkl
623
+ - os=tops20
624
+ + basic_os=tops20
625
+ ;;
626
+ tpf)
627
+ basic_machine=s390x-ibm
628
+ - os=tpf
629
+ + basic_os=tpf
630
+ ;;
631
+ udi29k)
632
+ basic_machine=a29k-amd
633
+ - os=udi
634
+ + basic_os=udi
635
+ ;;
636
+ ultra3)
637
+ basic_machine=a29k-nyu
638
+ - os=sym1
639
+ + basic_os=sym1
640
+ ;;
641
+ v810 | necv810)
642
+ basic_machine=v810-nec
643
+ - os=none
644
+ + basic_os=none
645
+ ;;
646
+ vaxv)
647
+ basic_machine=vax-dec
648
+ - os=sysv
649
+ + basic_os=sysv
650
+ ;;
651
+ vms)
652
+ basic_machine=vax-dec
653
+ - os=vms
654
+ + basic_os=vms
655
+ + ;;
656
+ + vsta)
657
+ + basic_machine=i386-pc
658
+ + basic_os=vsta
659
+ ;;
660
+ vxworks960)
661
+ basic_machine=i960-wrs
662
+ - os=vxworks
663
+ + basic_os=vxworks
664
+ ;;
665
+ vxworks68)
666
+ basic_machine=m68k-wrs
667
+ - os=vxworks
668
+ + basic_os=vxworks
669
+ ;;
670
+ vxworks29k)
671
+ basic_machine=a29k-wrs
672
+ - os=vxworks
673
+ + basic_os=vxworks
674
+ ;;
675
+ xbox)
676
+ basic_machine=i686-pc
677
+ - os=mingw32
678
+ + basic_os=mingw32
679
+ ;;
680
+ ymp)
681
+ basic_machine=ymp-cray
682
+ - os=unicos
683
+ + basic_os=unicos
684
+ ;;
685
+ *)
686
+ basic_machine=$1
687
+ - os=
688
+ + basic_os=
689
+ ;;
690
+ esac
691
+ ;;
692
+ @@ -685,17 +686,17 @@
693
+ bluegene*)
694
+ cpu=powerpc
695
+ vendor=ibm
696
+ - os=cnk
697
+ + basic_os=cnk
698
+ ;;
699
+ decsystem10* | dec10*)
700
+ cpu=pdp10
701
+ vendor=dec
702
+ - os=tops10
703
+ + basic_os=tops10
704
+ ;;
705
+ decsystem20* | dec20*)
706
+ cpu=pdp10
707
+ vendor=dec
708
+ - os=tops20
709
+ + basic_os=tops20
710
+ ;;
711
+ delta | 3300 | motorola-3300 | motorola-delta \
712
+ | 3300-motorola | delta-motorola)
713
+ @@ -705,7 +706,7 @@
714
+ dpx2*)
715
+ cpu=m68k
716
+ vendor=bull
717
+ - os=sysv3
718
+ + basic_os=sysv3
719
+ ;;
720
+ encore | umax | mmax)
721
+ cpu=ns32k
722
+ @@ -714,7 +715,7 @@
723
+ elxsi)
724
+ cpu=elxsi
725
+ vendor=elxsi
726
+ - os=${os:-bsd}
727
+ + basic_os=${basic_os:-bsd}
728
+ ;;
729
+ fx2800)
730
+ cpu=i860
731
+ @@ -727,7 +728,7 @@
732
+ h3050r* | hiux*)
733
+ cpu=hppa1.1
734
+ vendor=hitachi
735
+ - os=hiuxwe2
736
+ + basic_os=hiuxwe2
737
+ ;;
738
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
739
+ cpu=hppa1.0
740
+ @@ -768,38 +769,38 @@
741
+ vendor=hp
742
+ ;;
743
+ i*86v32)
744
+ - cpu=`echo "$1" | sed -e 's/86.*/86/'`
745
+ + cpu=$(echo "$1" | sed -e 's/86.*/86/')
746
+ vendor=pc
747
+ - os=sysv32
748
+ + basic_os=sysv32
749
+ ;;
750
+ i*86v4*)
751
+ - cpu=`echo "$1" | sed -e 's/86.*/86/'`
752
+ + cpu=$(echo "$1" | sed -e 's/86.*/86/')
753
+ vendor=pc
754
+ - os=sysv4
755
+ + basic_os=sysv4
756
+ ;;
757
+ i*86v)
758
+ - cpu=`echo "$1" | sed -e 's/86.*/86/'`
759
+ + cpu=$(echo "$1" | sed -e 's/86.*/86/')
760
+ vendor=pc
761
+ - os=sysv
762
+ + basic_os=sysv
763
+ ;;
764
+ i*86sol2)
765
+ - cpu=`echo "$1" | sed -e 's/86.*/86/'`
766
+ + cpu=$(echo "$1" | sed -e 's/86.*/86/')
767
+ vendor=pc
768
+ - os=solaris2
769
+ + basic_os=solaris2
770
+ ;;
771
+ j90 | j90-cray)
772
+ cpu=j90
773
+ vendor=cray
774
+ - os=${os:-unicos}
775
+ + basic_os=${basic_os:-unicos}
776
+ ;;
777
+ iris | iris4d)
778
+ cpu=mips
779
+ vendor=sgi
780
+ - case $os in
781
+ + case $basic_os in
782
+ irix*)
783
+ ;;
784
+ *)
785
+ - os=irix4
786
+ + basic_os=irix4
787
+ ;;
788
+ esac
789
+ ;;
790
+ @@ -810,24 +811,26 @@
791
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
792
+ cpu=m68k
793
+ vendor=atari
794
+ - os=mint
795
+ + basic_os=mint
796
+ ;;
797
+ news-3600 | risc-news)
798
+ cpu=mips
799
+ vendor=sony
800
+ - os=newsos
801
+ + basic_os=newsos
802
+ ;;
803
+ next | m*-next)
804
+ cpu=m68k
805
+ vendor=next
806
+ - case $os in
807
+ - nextstep* )
808
+ + case $basic_os in
809
+ + openstep*)
810
+ + ;;
811
+ + nextstep*)
812
+ ;;
813
+ ns2*)
814
+ - os=nextstep2
815
+ + basic_os=nextstep2
816
+ ;;
817
+ *)
818
+ - os=nextstep3
819
+ + basic_os=nextstep3
820
+ ;;
821
+ esac
822
+ ;;
823
+ @@ -838,12 +841,12 @@
824
+ op50n-* | op60c-*)
825
+ cpu=hppa1.1
826
+ vendor=oki
827
+ - os=proelf
828
+ + basic_os=proelf
829
+ ;;
830
+ pa-hitachi)
831
+ cpu=hppa1.1
832
+ vendor=hitachi
833
+ - os=hiuxwe2
834
+ + basic_os=hiuxwe2
835
+ ;;
836
+ pbd)
837
+ cpu=sparc
838
+ @@ -880,12 +883,12 @@
839
+ sde)
840
+ cpu=mipsisa32
841
+ vendor=sde
842
+ - os=${os:-elf}
843
+ + basic_os=${basic_os:-elf}
844
+ ;;
845
+ simso-wrs)
846
+ cpu=sparclite
847
+ vendor=wrs
848
+ - os=vxworks
849
+ + basic_os=vxworks
850
+ ;;
851
+ tower | tower-32)
852
+ cpu=m68k
853
+ @@ -902,7 +905,7 @@
854
+ w89k-*)
855
+ cpu=hppa1.1
856
+ vendor=winbond
857
+ - os=proelf
858
+ + basic_os=proelf
859
+ ;;
860
+ none)
861
+ cpu=none
862
+ @@ -914,11 +917,12 @@
863
+ ;;
864
+ leon-*|leon[3-9]-*)
865
+ cpu=sparc
866
+ - vendor=`echo "$basic_machine" | sed 's/-.*//'`
867
+ + vendor=$(echo "$basic_machine" | sed 's/-.*//')
868
+ ;;
869
+
870
+ *-*)
871
+ - IFS="-" read -r cpu vendor <<EOF
872
+ + # shellcheck disable=SC2162
873
+ + IFS="-" read cpu vendor <<EOF
874
+ $basic_machine
875
+ EOF
876
+ ;;
877
+ @@ -950,15 +954,15 @@
878
+
879
+ # Decode basic machines in the full and proper CPU-Company form.
880
+ case $cpu-$vendor in
881
+ - # Here we handle the default manufacturer of certain CPU types in cannonical form. It is in
882
+ + # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
883
+ # some cases the only manufacturer, in others, it is the most popular.
884
+ craynv-unknown)
885
+ vendor=cray
886
+ - os=${os:-unicosmp}
887
+ + basic_os=${basic_os:-unicosmp}
888
+ ;;
889
+ c90-unknown | c90-cray)
890
+ vendor=cray
891
+ - os=${os:-unicos}
892
+ + basic_os=${Basic_os:-unicos}
893
+ ;;
894
+ fx80-unknown)
895
+ vendor=alliant
896
+ @@ -1002,7 +1006,7 @@
897
+ dpx20-unknown | dpx20-bull)
898
+ cpu=rs6000
899
+ vendor=bull
900
+ - os=${os:-bosx}
901
+ + basic_os=${basic_os:-bosx}
902
+ ;;
903
+
904
+ # Here we normalize CPU types irrespective of the vendor
905
+ @@ -1011,7 +1015,7 @@
906
+ ;;
907
+ blackfin-*)
908
+ cpu=bfin
909
+ - os=linux
910
+ + basic_os=linux
911
+ ;;
912
+ c54x-*)
913
+ cpu=tic54x
914
+ @@ -1024,7 +1028,7 @@
915
+ ;;
916
+ e500v[12]-*)
917
+ cpu=powerpc
918
+ - os=$os"spe"
919
+ + basic_os=${basic_os}"spe"
920
+ ;;
921
+ mips3*-*)
922
+ cpu=mips64
923
+ @@ -1034,7 +1038,7 @@
924
+ ;;
925
+ m68knommu-*)
926
+ cpu=m68k
927
+ - os=linux
928
+ + basic_os=linux
929
+ ;;
930
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
931
+ cpu=s12z
932
+ @@ -1044,7 +1048,7 @@
933
+ ;;
934
+ parisc-*)
935
+ cpu=hppa
936
+ - os=linux
937
+ + basic_os=linux
938
+ ;;
939
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
940
+ cpu=i586
941
+ @@ -1080,7 +1084,7 @@
942
+ cpu=mipsisa64sb1el
943
+ ;;
944
+ sh5e[lb]-*)
945
+ - cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
946
+ + cpu=$(echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/')
947
+ ;;
948
+ spur-*)
949
+ cpu=spur
950
+ @@ -1098,13 +1102,16 @@
951
+ cpu=x86_64
952
+ ;;
953
+ xscale-* | xscalee[bl]-*)
954
+ - cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
955
+ + cpu=$(echo "$cpu" | sed 's/^xscale/arm/')
956
+ + ;;
957
+ + arm64-*)
958
+ + cpu=aarch64
959
+ ;;
960
+
961
+ - # Recognize the cannonical CPU Types that limit and/or modify the
962
+ + # Recognize the canonical CPU Types that limit and/or modify the
963
+ # company names they are paired with.
964
+ cr16-*)
965
+ - os=${os:-elf}
966
+ + basic_os=${basic_os:-elf}
967
+ ;;
968
+ crisv32-* | etraxfs*-*)
969
+ cpu=crisv32
970
+ @@ -1115,7 +1122,7 @@
971
+ vendor=axis
972
+ ;;
973
+ crx-*)
974
+ - os=${os:-elf}
975
+ + basic_os=${basic_os:-elf}
976
+ ;;
977
+ neo-tandem)
978
+ cpu=neo
979
+ @@ -1137,20 +1144,16 @@
980
+ cpu=nsx
981
+ vendor=tandem
982
+ ;;
983
+ - s390-*)
984
+ - cpu=s390
985
+ - vendor=ibm
986
+ - ;;
987
+ - s390x-*)
988
+ - cpu=s390x
989
+ - vendor=ibm
990
+ + mipsallegrexel-sony)
991
+ + cpu=mipsallegrexel
992
+ + vendor=sony
993
+ ;;
994
+ tile*-*)
995
+ - os=${os:-linux-gnu}
996
+ + basic_os=${basic_os:-linux-gnu}
997
+ ;;
998
+
999
+ *)
1000
+ - # Recognize the cannonical CPU types that are allowed with any
1001
+ + # Recognize the canonical CPU types that are allowed with any
1002
+ # company name.
1003
+ case $cpu in
1004
+ 1750a | 580 \
1005
+ @@ -1161,13 +1164,14 @@
1006
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
1007
+ | alphapca5[67] | alpha64pca5[67] \
1008
+ | am33_2.0 \
1009
+ + | amdgcn \
1010
+ | arc | arceb \
1011
+ - | arm | arm[lb]e | arme[lb] | armv* \
1012
+ + | arm | arm[lb]e | arme[lb] | armv* \
1013
+ | avr | avr32 \
1014
+ | asmjs \
1015
+ | ba \
1016
+ | be32 | be64 \
1017
+ - | bfin | bs2000 \
1018
+ + | bfin | bpf | bs2000 \
1019
+ | c[123]* | c30 | [cjt]90 | c4x \
1020
+ | c8051 | clipper | craynv | csky | cydra \
1021
+ | d10v | d30v | dlx | dsp16xx \
1022
+ @@ -1182,13 +1186,13 @@
1023
+ | le32 | le64 \
1024
+ | lm32 \
1025
+ | m32c | m32r | m32rle \
1026
+ - | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
1027
+ - | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
1028
+ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
1029
+ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1030
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
1031
+ | microblaze | microblazeel \
1032
+ | mips | mipsbe | mipseb | mipsel | mipsle \
1033
+ | mips16 \
1034
+ - | mips64 | mips64el \
1035
+ + | mips64 | mips64eb | mips64el \
1036
+ | mips64octeon | mips64octeonel \
1037
+ | mips64orion | mips64orionel \
1038
+ | mips64r5900 | mips64r5900el \
1039
+ @@ -1215,19 +1219,22 @@
1040
+ | nds32 | nds32le | nds32be \
1041
+ | nfp \
1042
+ | nios | nios2 | nios2eb | nios2el \
1043
+ - | none | np1 | ns16k | ns32k \
1044
+ + | none | np1 | ns16k | ns32k | nvptx \
1045
+ | open8 \
1046
+ | or1k* \
1047
+ | or32 \
1048
+ | orion \
1049
+ + | picochip \
1050
+ | pdp10 | pdp11 | pj | pjl | pn | power \
1051
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
1052
+ | pru \
1053
+ | pyramid \
1054
+ | riscv | riscv32 | riscv64 \
1055
+ | rl78 | romp | rs6000 | rx \
1056
+ + | s390 | s390x \
1057
+ | score \
1058
+ - | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
1059
+ + | sh | shl \
1060
+ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
1061
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
1062
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
1063
+ | sparclite \
1064
+ @@ -1237,10 +1244,11 @@
1065
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
1066
+ | tron \
1067
+ | ubicom32 \
1068
+ - | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1069
+ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1070
+ | vax \
1071
+ | visium \
1072
+ - | wasm32 \
1073
+ + | w65 \
1074
+ + | wasm32 | wasm64 \
1075
+ | we32k \
1076
+ | x86 | x86_64 | xc16x | xgate | xps100 \
1077
+ | xstormy16 | xtensa* \
1078
+ @@ -1270,8 +1278,47 @@
1079
+
1080
+ # Decode manufacturer-specific aliases for certain operating systems.
1081
+
1082
+ -if [ x$os != x ]
1083
+ +if test x$basic_os != x
1084
+ then
1085
+ +
1086
+ +# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
1087
+ +# set os.
1088
+ +case $basic_os in
1089
+ + gnu/linux*)
1090
+ + kernel=linux
1091
+ + os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|')
1092
+ + ;;
1093
+ + os2-emx)
1094
+ + kernel=os2
1095
+ + os=$(echo $basic_os | sed -e 's|os2-emx|emx|')
1096
+ + ;;
1097
+ + nto-qnx*)
1098
+ + kernel=nto
1099
+ + os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|')
1100
+ + ;;
1101
+ + *-*)
1102
+ + # shellcheck disable=SC2162
1103
+ + IFS="-" read kernel os <<EOF
1104
+ +$basic_os
1105
+ +EOF
1106
+ + ;;
1107
+ + # Default OS when just kernel was specified
1108
+ + nto*)
1109
+ + kernel=nto
1110
+ + os=$(echo $basic_os | sed -e 's|nto|qnx|')
1111
+ + ;;
1112
+ + linux*)
1113
+ + kernel=linux
1114
+ + os=$(echo $basic_os | sed -e 's|linux|gnu|')
1115
+ + ;;
1116
+ + *)
1117
+ + kernel=
1118
+ + os=$basic_os
1119
+ + ;;
1120
+ +esac
1121
+ +
1122
+ +# Now, normalize the OS (knowing we just have one component, it's not a kernel,
1123
+ +# etc.)
1124
+ case $os in
1125
+ # First match some system type aliases that might get confused
1126
+ # with valid system types.
1127
+ @@ -1283,7 +1330,7 @@
1128
+ os=cnk
1129
+ ;;
1130
+ solaris1 | solaris1.*)
1131
+ - os=`echo $os | sed -e 's|solaris1|sunos4|'`
1132
+ + os=$(echo $os | sed -e 's|solaris1|sunos4|')
1133
+ ;;
1134
+ solaris)
1135
+ os=solaris2
1136
+ @@ -1291,9 +1338,6 @@
1137
+ unixware*)
1138
+ os=sysv4.2uw
1139
+ ;;
1140
+ - gnu/linux*)
1141
+ - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1142
+ - ;;
1143
+ # es1800 is here to avoid being matched by es* (a different OS)
1144
+ es1800*)
1145
+ os=ose
1146
+ @@ -1315,12 +1359,9 @@
1147
+ os=sco3.2v4
1148
+ ;;
1149
+ sco3.2.[4-9]*)
1150
+ - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1151
+ - ;;
1152
+ - sco3.2v[4-9]* | sco5v6*)
1153
+ - # Don't forget version if it is 3.2v4 or newer.
1154
+ + os=$(echo $os | sed -e 's/sco3.2./sco3.2v/')
1155
+ ;;
1156
+ - scout)
1157
+ + sco*v* | scout)
1158
+ # Don't match below
1159
+ ;;
1160
+ sco*)
1161
+ @@ -1329,78 +1370,26 @@
1162
+ psos*)
1163
+ os=psos
1164
+ ;;
1165
+ - # Now accept the basic system types.
1166
+ - # The portable systems comes first.
1167
+ - # Each alternative MUST end in a * to match a version number.
1168
+ - # sysv* is not here because it comes later, after sysvr4.
1169
+ - gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1170
+ - | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
1171
+ - | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1172
+ - | sym* | kopensolaris* | plan9* \
1173
+ - | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1174
+ - | aos* | aros* | cloudabi* | sortix* \
1175
+ - | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1176
+ - | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1177
+ - | knetbsd* | mirbsd* | netbsd* \
1178
+ - | bitrig* | openbsd* | solidbsd* | libertybsd* \
1179
+ - | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
1180
+ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1181
+ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1182
+ - | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
1183
+ - | chorusrdb* | cegcc* | glidix* \
1184
+ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1185
+ - | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
1186
+ - | linux-newlib* | linux-musl* | linux-uclibc* \
1187
+ - | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1188
+ - | interix* | uwin* | mks* | rhapsody* | darwin* \
1189
+ - | openstep* | oskit* | conix* | pw32* | nonstopux* \
1190
+ - | storm-chaos* | tops10* | tenex* | tops20* | its* \
1191
+ - | os2* | vos* | palmos* | uclinux* | nucleus* \
1192
+ - | morphos* | superux* | rtmk* | windiss* \
1193
+ - | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1194
+ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1195
+ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1196
+ - | midnightbsd*)
1197
+ - # Remember, each alternative MUST END IN *, to match a version number.
1198
+ - ;;
1199
+ qnx*)
1200
+ - case $cpu in
1201
+ - x86 | i*86)
1202
+ - ;;
1203
+ - *)
1204
+ - os=nto-$os
1205
+ - ;;
1206
+ - esac
1207
+ + os=qnx
1208
+ ;;
1209
+ hiux*)
1210
+ os=hiuxwe2
1211
+ ;;
1212
+ - nto-qnx*)
1213
+ - ;;
1214
+ - nto*)
1215
+ - os=`echo $os | sed -e 's|nto|nto-qnx|'`
1216
+ - ;;
1217
+ - sim | xray | os68k* | v88r* \
1218
+ - | windows* | osx | abug | netware* | os9* \
1219
+ - | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
1220
+ - ;;
1221
+ - linux-dietlibc)
1222
+ - os=linux-dietlibc
1223
+ - ;;
1224
+ - linux*)
1225
+ - os=`echo $os | sed -e 's|linux|linux-gnu|'`
1226
+ - ;;
1227
+ lynx*178)
1228
+ os=lynxos178
1229
+ ;;
1230
+ lynx*5)
1231
+ os=lynxos5
1232
+ ;;
1233
+ + lynxos*)
1234
+ + # don't get caught up in next wildcard
1235
+ + ;;
1236
+ lynx*)
1237
+ os=lynxos
1238
+ ;;
1239
+ - mac*)
1240
+ - os=`echo "$os" | sed -e 's|mac|macos|'`
1241
+ + mac[0-9]*)
1242
+ + os=$(echo "$os" | sed -e 's|mac|macos|')
1243
+ ;;
1244
+ opened*)
1245
+ os=openedition
1246
+ @@ -1409,10 +1398,10 @@
1247
+ os=os400
1248
+ ;;
1249
+ sunos5*)
1250
+ - os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1251
+ + os=$(echo "$os" | sed -e 's|sunos5|solaris2|')
1252
+ ;;
1253
+ sunos6*)
1254
+ - os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1255
+ + os=$(echo "$os" | sed -e 's|sunos6|solaris3|')
1256
+ ;;
1257
+ wince*)
1258
+ os=wince
1259
+ @@ -1444,12 +1433,9 @@
1260
+ ns2)
1261
+ os=nextstep2
1262
+ ;;
1263
+ - nsk*)
1264
+ - os=nsk
1265
+ - ;;
1266
+ # Preserve the version number of sinix5.
1267
+ sinix5.*)
1268
+ - os=`echo $os | sed -e 's|sinix|sysv|'`
1269
+ + os=$(echo $os | sed -e 's|sinix|sysv|')
1270
+ ;;
1271
+ sinix*)
1272
+ os=sysv4
1273
+ @@ -1472,18 +1458,12 @@
1274
+ sysvr4)
1275
+ os=sysv4
1276
+ ;;
1277
+ - # This must come after sysvr4.
1278
+ - sysv*)
1279
+ - ;;
1280
+ ose*)
1281
+ os=ose
1282
+ ;;
1283
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1284
+ os=mint
1285
+ ;;
1286
+ - zvmoe)
1287
+ - os=zvmoe
1288
+ - ;;
1289
+ dicos*)
1290
+ os=dicos
1291
+ ;;
1292
+ @@ -1500,19 +1480,11 @@
1293
+ ;;
1294
+ esac
1295
+ ;;
1296
+ - nacl*)
1297
+ - ;;
1298
+ - ios)
1299
+ - ;;
1300
+ - none)
1301
+ - ;;
1302
+ - *-eabi)
1303
+ - ;;
1304
+ *)
1305
+ - echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
1306
+ - exit 1
1307
+ + # No normalization, but not necessarily accepted, that comes below.
1308
+ ;;
1309
+ esac
1310
+ +
1311
+ else
1312
+
1313
+ # Here we handle the default operating systems that come with various machines.
1314
+ @@ -1525,6 +1497,7 @@
1315
+ # will signal an error saying that MANUFACTURER isn't an operating
1316
+ # system, and we'll never get to this point.
1317
+
1318
+ +kernel=
1319
+ case $cpu-$vendor in
1320
+ score-*)
1321
+ os=elf
1322
+ @@ -1536,7 +1509,8 @@
1323
+ os=riscix1.2
1324
+ ;;
1325
+ arm*-rebel)
1326
+ - os=linux
1327
+ + kernel=linux
1328
+ + os=gnu
1329
+ ;;
1330
+ arm*-semi)
1331
+ os=aout
1332
+ @@ -1702,84 +1676,173 @@
1333
+ os=none
1334
+ ;;
1335
+ esac
1336
+ +
1337
+ fi
1338
+
1339
+ +# Now, validate our (potentially fixed-up) OS.
1340
+ +case $os in
1341
+ + # Sometimes we do "kernel-abi", so those need to count as OSes.
1342
+ + musl* | newlib* | uclibc*)
1343
+ + ;;
1344
+ + # Likewise for "kernel-libc"
1345
+ + eabi | eabihf | gnueabi | gnueabihf)
1346
+ + ;;
1347
+ + # Now accept the basic system types.
1348
+ + # The portable systems comes first.
1349
+ + # Each alternative MUST end in a * to match a version number.
1350
+ + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1351
+ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
1352
+ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1353
+ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
1354
+ + | hiux* | abug | nacl* | netware* | windows* \
1355
+ + | os9* | macos* | osx* | ios* \
1356
+ + | mpw* | magic* | mmixware* | mon960* | lnews* \
1357
+ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1358
+ + | aos* | aros* | cloudabi* | sortix* | twizzler* \
1359
+ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1360
+ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1361
+ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \
1362
+ + | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
1363
+ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
1364
+ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1365
+ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1366
+ + | udi* | lites* | ieee* | go32* | aux* | hcos* \
1367
+ + | chorusrdb* | cegcc* | glidix* \
1368
+ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1369
+ + | midipix* | mingw32* | mingw64* | mint* \
1370
+ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1371
+ + | interix* | uwin* | mks* | rhapsody* | darwin* \
1372
+ + | openstep* | oskit* | conix* | pw32* | nonstopux* \
1373
+ + | storm-chaos* | tops10* | tenex* | tops20* | its* \
1374
+ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
1375
+ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
1376
+ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1377
+ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1378
+ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1379
+ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1380
+ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
1381
+ + ;;
1382
+ + # This one is extra strict with allowed versions
1383
+ + sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
1384
+ + # Don't forget version if it is 3.2v4 or newer.
1385
+ + ;;
1386
+ + none)
1387
+ + ;;
1388
+ + *)
1389
+ + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
1390
+ + exit 1
1391
+ + ;;
1392
+ +esac
1393
+ +
1394
+ +# As a final step for OS-related things, validate the OS-kernel combination
1395
+ +# (given a valid OS), if there is a kernel.
1396
+ +case $kernel-$os in
1397
+ + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
1398
+ + ;;
1399
+ + uclinux-uclibc* )
1400
+ + ;;
1401
+ + -dietlibc* | -newlib* | -musl* | -uclibc* )
1402
+ + # These are just libc implementations, not actual OSes, and thus
1403
+ + # require a kernel.
1404
+ + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
1405
+ + exit 1
1406
+ + ;;
1407
+ + kfreebsd*-gnu* | kopensolaris*-gnu*)
1408
+ + ;;
1409
+ + nto-qnx*)
1410
+ + ;;
1411
+ + os2-emx)
1412
+ + ;;
1413
+ + *-eabi* | *-gnueabi*)
1414
+ + ;;
1415
+ + -*)
1416
+ + # Blank kernel with real OS is always fine.
1417
+ + ;;
1418
+ + *-*)
1419
+ + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
1420
+ + exit 1
1421
+ + ;;
1422
+ +esac
1423
+ +
1424
+ # Here we handle the case where we know the os, and the CPU type, but not the
1425
+ # manufacturer. We pick the logical manufacturer.
1426
+ case $vendor in
1427
+ unknown)
1428
+ - case $os in
1429
+ - riscix*)
1430
+ + case $cpu-$os in
1431
+ + *-riscix*)
1432
+ vendor=acorn
1433
+ ;;
1434
+ - sunos*)
1435
+ + *-sunos*)
1436
+ vendor=sun
1437
+ ;;
1438
+ - cnk*|-aix*)
1439
+ + *-cnk* | *-aix*)
1440
+ vendor=ibm
1441
+ ;;
1442
+ - beos*)
1443
+ + *-beos*)
1444
+ vendor=be
1445
+ ;;
1446
+ - hpux*)
1447
+ + *-hpux*)
1448
+ vendor=hp
1449
+ ;;
1450
+ - mpeix*)
1451
+ + *-mpeix*)
1452
+ vendor=hp
1453
+ ;;
1454
+ - hiux*)
1455
+ + *-hiux*)
1456
+ vendor=hitachi
1457
+ ;;
1458
+ - unos*)
1459
+ + *-unos*)
1460
+ vendor=crds
1461
+ ;;
1462
+ - dgux*)
1463
+ + *-dgux*)
1464
+ vendor=dg
1465
+ ;;
1466
+ - luna*)
1467
+ + *-luna*)
1468
+ vendor=omron
1469
+ ;;
1470
+ - genix*)
1471
+ + *-genix*)
1472
+ vendor=ns
1473
+ ;;
1474
+ - clix*)
1475
+ + *-clix*)
1476
+ vendor=intergraph
1477
+ ;;
1478
+ - mvs* | opened*)
1479
+ + *-mvs* | *-opened*)
1480
+ + vendor=ibm
1481
+ + ;;
1482
+ + *-os400*)
1483
+ vendor=ibm
1484
+ ;;
1485
+ - os400*)
1486
+ + s390-* | s390x-*)
1487
+ vendor=ibm
1488
+ ;;
1489
+ - ptx*)
1490
+ + *-ptx*)
1491
+ vendor=sequent
1492
+ ;;
1493
+ - tpf*)
1494
+ + *-tpf*)
1495
+ vendor=ibm
1496
+ ;;
1497
+ - vxsim* | vxworks* | windiss*)
1498
+ + *-vxsim* | *-vxworks* | *-windiss*)
1499
+ vendor=wrs
1500
+ ;;
1501
+ - aux*)
1502
+ + *-aux*)
1503
+ vendor=apple
1504
+ ;;
1505
+ - hms*)
1506
+ + *-hms*)
1507
+ vendor=hitachi
1508
+ ;;
1509
+ - mpw* | macos*)
1510
+ + *-mpw* | *-macos*)
1511
+ vendor=apple
1512
+ ;;
1513
+ - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1514
+ + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
1515
+ vendor=atari
1516
+ ;;
1517
+ - vos*)
1518
+ + *-vos*)
1519
+ vendor=stratus
1520
+ ;;
1521
+ esac
1522
+ ;;
1523
+ esac
1524
+
1525
+ -echo "$cpu-$vendor-$os"
1526
+ +echo "$cpu-$vendor-${kernel:+$kernel-}$os"
1527
+ exit
1528
+
1529
+ # Local variables:
1530
+ --- a/config.guess
1531
+ +++ b/config.guess
1532
+ @@ -1,8 +1,8 @@
1533
+ #! /bin/sh
1534
+ # Attempt to guess a canonical system name.
1535
+ -# Copyright 1992-2018 Free Software Foundation, Inc.
1536
+ +# Copyright 1992-2020 Free Software Foundation, Inc.
1537
+
1538
+ -timestamp='2018-08-29'
1539
+ +timestamp='2020-11-07'
1540
+
1541
+ # This file is free software; you can redistribute it and/or modify it
1542
+ # under the terms of the GNU General Public License as published by
1543
+ @@ -32,7 +32,7 @@
1544
+ # Please send patches to <config-patches@gnu.org>.
1545
+
1546
+
1547
+ -me=`echo "$0" | sed -e 's,.*/,,'`
1548
+ +me=$(echo "$0" | sed -e 's,.*/,,')
1549
+
1550
+ usage="\
1551
+ Usage: $0 [OPTION]
1552
+ @@ -50,7 +50,7 @@
1553
+ GNU config.guess ($timestamp)
1554
+
1555
+ Originally written by Per Bothner.
1556
+ -Copyright 1992-2018 Free Software Foundation, Inc.
1557
+ +Copyright 1992-2020 Free Software Foundation, Inc.
1558
+
1559
+ This is free software; see the source for copying conditions. There is NO
1560
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
1561
+ @@ -96,13 +96,14 @@
1562
+
1563
+ tmp=
1564
+ # shellcheck disable=SC2172
1565
+ -trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15
1566
+ -trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
1567
+ +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
1568
+
1569
+ set_cc_for_build() {
1570
+ + # prevent multiple calls if $tmp is already set
1571
+ + test "$tmp" && return 0
1572
+ : "${TMPDIR=/tmp}"
1573
+ # shellcheck disable=SC2039
1574
+ - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1575
+ + { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } ||
1576
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
1577
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1578
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
1579
+ @@ -130,10 +131,10 @@
1580
+ PATH=$PATH:/.attbin ; export PATH
1581
+ fi
1582
+
1583
+ -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1584
+ -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1585
+ -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
1586
+ -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1587
+ +UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
1588
+ +UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown
1589
+ +UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown
1590
+ +UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
1591
+
1592
+ case "$UNAME_SYSTEM" in
1593
+ Linux|GNU|GNU/*)
1594
+ @@ -149,17 +150,15 @@
1595
+ #elif defined(__dietlibc__)
1596
+ LIBC=dietlibc
1597
+ #else
1598
+ + #include <stdarg.h>
1599
+ + #ifdef __DEFINED_va_list
1600
+ + LIBC=musl
1601
+ + #else
1602
+ LIBC=gnu
1603
+ #endif
1604
+ + #endif
1605
+ EOF
1606
+ - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
1607
+ -
1608
+ - # If ldd exists, use it to detect musl libc.
1609
+ - if command -v ldd >/dev/null && \
1610
+ - ldd --version 2>&1 | grep -q ^musl
1611
+ - then
1612
+ - LIBC=musl
1613
+ - fi
1614
+ + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
1615
+ ;;
1616
+ esac
1617
+
1618
+ @@ -178,19 +177,20 @@
1619
+ # Note: NetBSD doesn't particularly care about the vendor
1620
+ # portion of the name. We always set it to "unknown".
1621
+ sysctl="sysctl -n hw.machine_arch"
1622
+ - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
1623
+ + UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
1624
+ "/sbin/$sysctl" 2>/dev/null || \
1625
+ "/usr/sbin/$sysctl" 2>/dev/null || \
1626
+ - echo unknown)`
1627
+ + echo unknown))
1628
+ case "$UNAME_MACHINE_ARCH" in
1629
+ + aarch64eb) machine=aarch64_be-unknown ;;
1630
+ armeb) machine=armeb-unknown ;;
1631
+ arm*) machine=arm-unknown ;;
1632
+ sh3el) machine=shl-unknown ;;
1633
+ sh3eb) machine=sh-unknown ;;
1634
+ sh5el) machine=sh5le-unknown ;;
1635
+ earmv*)
1636
+ - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
1637
+ - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
1638
+ + arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,')
1639
+ + endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p')
1640
+ machine="${arch}${endian}"-unknown
1641
+ ;;
1642
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
1643
+ @@ -221,7 +221,7 @@
1644
+ case "$UNAME_MACHINE_ARCH" in
1645
+ earm*)
1646
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
1647
+ - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
1648
+ + abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")
1649
+ ;;
1650
+ esac
1651
+ # The OS release
1652
+ @@ -234,7 +234,7 @@
1653
+ release='-gnu'
1654
+ ;;
1655
+ *)
1656
+ - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
1657
+ + release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2)
1658
+ ;;
1659
+ esac
1660
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
1661
+ @@ -243,15 +243,15 @@
1662
+ echo "$machine-${os}${release}${abi-}"
1663
+ exit ;;
1664
+ *:Bitrig:*:*)
1665
+ - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
1666
+ + UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
1667
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
1668
+ exit ;;
1669
+ *:OpenBSD:*:*)
1670
+ - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
1671
+ + UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
1672
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
1673
+ exit ;;
1674
+ *:LibertyBSD:*:*)
1675
+ - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
1676
+ + UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
1677
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
1678
+ exit ;;
1679
+ *:MidnightBSD:*:*)
1680
+ @@ -263,6 +263,9 @@
1681
+ *:SolidBSD:*:*)
1682
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
1683
+ exit ;;
1684
+ + *:OS108:*:*)
1685
+ + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
1686
+ + exit ;;
1687
+ macppc:MirBSD:*:*)
1688
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
1689
+ exit ;;
1690
+ @@ -272,26 +275,29 @@
1691
+ *:Sortix:*:*)
1692
+ echo "$UNAME_MACHINE"-unknown-sortix
1693
+ exit ;;
1694
+ + *:Twizzler:*:*)
1695
+ + echo "$UNAME_MACHINE"-unknown-twizzler
1696
+ + exit ;;
1697
+ *:Redox:*:*)
1698
+ echo "$UNAME_MACHINE"-unknown-redox
1699
+ exit ;;
1700
+ mips:OSF1:*.*)
1701
+ - echo mips-dec-osf1
1702
+ - exit ;;
1703
+ + echo mips-dec-osf1
1704
+ + exit ;;
1705
+ alpha:OSF1:*:*)
1706
+ case $UNAME_RELEASE in
1707
+ *4.0)
1708
+ - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
1709
+ + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
1710
+ ;;
1711
+ *5.*)
1712
+ - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
1713
+ + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
1714
+ ;;
1715
+ esac
1716
+ # According to Compaq, /usr/sbin/psrinfo has been available on
1717
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
1718
+ # covers most systems running today. This code pipes the CPU
1719
+ # types through head -n 1, so we only detect the type of CPU 0.
1720
+ - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
1721
+ + ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1)
1722
+ case "$ALPHA_CPU_TYPE" in
1723
+ "EV4 (21064)")
1724
+ UNAME_MACHINE=alpha ;;
1725
+ @@ -329,7 +335,7 @@
1726
+ # A Tn.n version is a released field test version.
1727
+ # A Xn.n version is an unreleased experimental baselevel.
1728
+ # 1.2 uses "1.2" for uname -r.
1729
+ - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
1730
+ + echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"
1731
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
1732
+ exitcode=$?
1733
+ trap '' 0
1734
+ @@ -363,7 +369,7 @@
1735
+ exit ;;
1736
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
1737
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
1738
+ - if test "`(/bin/universe) 2>/dev/null`" = att ; then
1739
+ + if test "$( (/bin/universe) 2>/dev/null)" = att ; then
1740
+ echo pyramid-pyramid-sysv3
1741
+ else
1742
+ echo pyramid-pyramid-bsd
1743
+ @@ -376,54 +382,59 @@
1744
+ echo sparc-icl-nx6
1745
+ exit ;;
1746
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
1747
+ - case `/usr/bin/uname -p` in
1748
+ + case $(/usr/bin/uname -p) in
1749
+ sparc) echo sparc-icl-nx7; exit ;;
1750
+ esac ;;
1751
+ s390x:SunOS:*:*)
1752
+ - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
1753
+ + echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
1754
+ exit ;;
1755
+ sun4H:SunOS:5.*:*)
1756
+ - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
1757
+ + echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
1758
+ exit ;;
1759
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
1760
+ - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
1761
+ + echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
1762
+ exit ;;
1763
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
1764
+ echo i386-pc-auroraux"$UNAME_RELEASE"
1765
+ exit ;;
1766
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
1767
+ - UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
1768
+ - case `isainfo -b` in
1769
+ - 32)
1770
+ - echo i386-pc-solaris2"$UNAME_REL"
1771
+ - ;;
1772
+ - 64)
1773
+ - echo x86_64-pc-solaris2"$UNAME_REL"
1774
+ - ;;
1775
+ - esac
1776
+ + set_cc_for_build
1777
+ + SUN_ARCH=i386
1778
+ + # If there is a compiler, see if it is configured for 64-bit objects.
1779
+ + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
1780
+ + # This test works for both compilers.
1781
+ + if test "$CC_FOR_BUILD" != no_compiler_found; then
1782
+ + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
1783
+ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1784
+ + grep IS_64BIT_ARCH >/dev/null
1785
+ + then
1786
+ + SUN_ARCH=x86_64
1787
+ + fi
1788
+ + fi
1789
+ + echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
1790
+ exit ;;
1791
+ sun4*:SunOS:6*:*)
1792
+ # According to config.sub, this is the proper way to canonicalize
1793
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
1794
+ # it's likely to be more like Solaris than SunOS4.
1795
+ - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
1796
+ + echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
1797
+ exit ;;
1798
+ sun4*:SunOS:*:*)
1799
+ - case "`/usr/bin/arch -k`" in
1800
+ + case "$(/usr/bin/arch -k)" in
1801
+ Series*|S4*)
1802
+ - UNAME_RELEASE=`uname -v`
1803
+ + UNAME_RELEASE=$(uname -v)
1804
+ ;;
1805
+ esac
1806
+ # Japanese Language versions have a version number like `4.1.3-JL'.
1807
+ - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
1808
+ + echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
1809
+ exit ;;
1810
+ sun3*:SunOS:*:*)
1811
+ echo m68k-sun-sunos"$UNAME_RELEASE"
1812
+ exit ;;
1813
+ sun*:*:4.2BSD:*)
1814
+ - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
1815
+ + UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null)
1816
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
1817
+ - case "`/bin/arch`" in
1818
+ + case "$(/bin/arch)" in
1819
+ sun3)
1820
+ echo m68k-sun-sunos"$UNAME_RELEASE"
1821
+ ;;
1822
+ @@ -503,8 +514,8 @@
1823
+ }
1824
+ EOF
1825
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
1826
+ - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
1827
+ - SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
1828
+ + dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
1829
+ + SYSTEM_NAME=$("$dummy" "$dummyarg") &&
1830
+ { echo "$SYSTEM_NAME"; exit; }
1831
+ echo mips-mips-riscos"$UNAME_RELEASE"
1832
+ exit ;;
1833
+ @@ -531,11 +542,11 @@
1834
+ exit ;;
1835
+ AViiON:dgux:*:*)
1836
+ # DG/UX returns AViiON for all architectures
1837
+ - UNAME_PROCESSOR=`/usr/bin/uname -p`
1838
+ - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
1839
+ + UNAME_PROCESSOR=$(/usr/bin/uname -p)
1840
+ + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
1841
+ then
1842
+ - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
1843
+ - [ "$TARGET_BINARY_INTERFACE"x = x ]
1844
+ + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
1845
+ + test "$TARGET_BINARY_INTERFACE"x = x
1846
+ then
1847
+ echo m88k-dg-dgux"$UNAME_RELEASE"
1848
+ else
1849
+ @@ -559,17 +570,17 @@
1850
+ echo m68k-tektronix-bsd
1851
+ exit ;;
1852
+ *:IRIX*:*:*)
1853
+ - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
1854
+ + echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
1855
+ exit ;;
1856
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
1857
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
1858
+ - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
1859
+ + exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX '
1860
+ i*86:AIX:*:*)
1861
+ echo i386-ibm-aix
1862
+ exit ;;
1863
+ ia64:AIX:*:*)
1864
+ - if [ -x /usr/bin/oslevel ] ; then
1865
+ - IBM_REV=`/usr/bin/oslevel`
1866
+ + if test -x /usr/bin/oslevel ; then
1867
+ + IBM_REV=$(/usr/bin/oslevel)
1868
+ else
1869
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
1870
+ fi
1871
+ @@ -589,7 +600,7 @@
1872
+ exit(0);
1873
+ }
1874
+ EOF
1875
+ - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
1876
+ + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy")
1877
+ then
1878
+ echo "$SYSTEM_NAME"
1879
+ else
1880
+ @@ -602,15 +613,15 @@
1881
+ fi
1882
+ exit ;;
1883
+ *:AIX:*:[4567])
1884
+ - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
1885
+ + IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }')
1886
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
1887
+ IBM_ARCH=rs6000
1888
+ else
1889
+ IBM_ARCH=powerpc
1890
+ fi
1891
+ - if [ -x /usr/bin/lslpp ] ; then
1892
+ - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
1893
+ - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
1894
+ + if test -x /usr/bin/lslpp ; then
1895
+ + IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
1896
+ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
1897
+ else
1898
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
1899
+ fi
1900
+ @@ -638,14 +649,14 @@
1901
+ echo m68k-hp-bsd4.4
1902
+ exit ;;
1903
+ 9000/[34678]??:HP-UX:*:*)
1904
+ - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
1905
+ + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
1906
+ case "$UNAME_MACHINE" in
1907
+ 9000/31?) HP_ARCH=m68000 ;;
1908
+ 9000/[34]??) HP_ARCH=m68k ;;
1909
+ 9000/[678][0-9][0-9])
1910
+ - if [ -x /usr/bin/getconf ]; then
1911
+ - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
1912
+ - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
1913
+ + if test -x /usr/bin/getconf; then
1914
+ + sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null)
1915
+ + sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null)
1916
+ case "$sc_cpu_version" in
1917
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
1918
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
1919
+ @@ -657,7 +668,7 @@
1920
+ esac ;;
1921
+ esac
1922
+ fi
1923
+ - if [ "$HP_ARCH" = "" ]; then
1924
+ + if test "$HP_ARCH" = ""; then
1925
+ set_cc_for_build
1926
+ sed 's/^ //' << EOF > "$dummy.c"
1927
+
1928
+ @@ -692,11 +703,11 @@
1929
+ exit (0);
1930
+ }
1931
+ EOF
1932
+ - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
1933
+ + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy")
1934
+ test -z "$HP_ARCH" && HP_ARCH=hppa
1935
+ fi ;;
1936
+ esac
1937
+ - if [ "$HP_ARCH" = hppa2.0w ]
1938
+ + if test "$HP_ARCH" = hppa2.0w
1939
+ then
1940
+ set_cc_for_build
1941
+
1942
+ @@ -720,7 +731,7 @@
1943
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
1944
+ exit ;;
1945
+ ia64:HP-UX:*:*)
1946
+ - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
1947
+ + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
1948
+ echo ia64-hp-hpux"$HPUX_REV"
1949
+ exit ;;
1950
+ 3050*:HI-UX:*:*)
1951
+ @@ -750,7 +761,7 @@
1952
+ exit (0);
1953
+ }
1954
+ EOF
1955
+ - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
1956
+ + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") &&
1957
+ { echo "$SYSTEM_NAME"; exit; }
1958
+ echo unknown-hitachi-hiuxwe2
1959
+ exit ;;
1960
+ @@ -770,7 +781,7 @@
1961
+ echo hppa1.0-hp-osf
1962
+ exit ;;
1963
+ i*86:OSF1:*:*)
1964
+ - if [ -x /usr/sbin/sysversion ] ; then
1965
+ + if test -x /usr/sbin/sysversion ; then
1966
+ echo "$UNAME_MACHINE"-unknown-osf1mk
1967
+ else
1968
+ echo "$UNAME_MACHINE"-unknown-osf1
1969
+ @@ -819,14 +830,14 @@
1970
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
1971
+ exit ;;
1972
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
1973
+ - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
1974
+ - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
1975
+ - FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
1976
+ + FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)
1977
+ + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
1978
+ + FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/')
1979
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
1980
+ exit ;;
1981
+ 5000:UNIX_System_V:4.*:*)
1982
+ - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
1983
+ - FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
1984
+ + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
1985
+ + FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/')
1986
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
1987
+ exit ;;
1988
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
1989
+ @@ -839,25 +850,25 @@
1990
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
1991
+ exit ;;
1992
+ arm:FreeBSD:*:*)
1993
+ - UNAME_PROCESSOR=`uname -p`
1994
+ + UNAME_PROCESSOR=$(uname -p)
1995
+ set_cc_for_build
1996
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
1997
+ | grep -q __ARM_PCS_VFP
1998
+ then
1999
+ - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
2000
+ + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi
2001
+ else
2002
+ - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
2003
+ + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
2004
+ fi
2005
+ exit ;;
2006
+ *:FreeBSD:*:*)
2007
+ - UNAME_PROCESSOR=`/usr/bin/uname -p`
2008
+ + UNAME_PROCESSOR=$(/usr/bin/uname -p)
2009
+ case "$UNAME_PROCESSOR" in
2010
+ amd64)
2011
+ UNAME_PROCESSOR=x86_64 ;;
2012
+ i386)
2013
+ UNAME_PROCESSOR=i586 ;;
2014
+ esac
2015
+ - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
2016
+ + echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
2017
+ exit ;;
2018
+ i*:CYGWIN*:*)
2019
+ echo "$UNAME_MACHINE"-pc-cygwin
2020
+ @@ -890,18 +901,18 @@
2021
+ echo "$UNAME_MACHINE"-pc-uwin
2022
+ exit ;;
2023
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
2024
+ - echo x86_64-unknown-cygwin
2025
+ + echo x86_64-pc-cygwin
2026
+ exit ;;
2027
+ prep*:SunOS:5.*:*)
2028
+ - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
2029
+ + echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
2030
+ exit ;;
2031
+ *:GNU:*:*)
2032
+ # the GNU system
2033
+ - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
2034
+ + echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')"
2035
+ exit ;;
2036
+ *:GNU/*:*:*)
2037
+ # other systems with GNU libc and userland
2038
+ - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
2039
+ + echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC"
2040
+ exit ;;
2041
+ *:Minix:*:*)
2042
+ echo "$UNAME_MACHINE"-unknown-minix
2043
+ @@ -914,7 +925,7 @@
2044
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
2045
+ exit ;;
2046
+ alpha:Linux:*:*)
2047
+ - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
2048
+ + case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in
2049
+ EV5) UNAME_MACHINE=alphaev5 ;;
2050
+ EV56) UNAME_MACHINE=alphaev56 ;;
2051
+ PCA56) UNAME_MACHINE=alphapca56 ;;
2052
+ @@ -981,22 +992,50 @@
2053
+ exit ;;
2054
+ mips:Linux:*:* | mips64:Linux:*:*)
2055
+ set_cc_for_build
2056
+ + IS_GLIBC=0
2057
+ + test x"${LIBC}" = xgnu && IS_GLIBC=1
2058
+ sed 's/^ //' << EOF > "$dummy.c"
2059
+ #undef CPU
2060