ffi 1.9.24 → 1.16.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (457) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +348 -0
  4. data/Gemfile +4 -5
  5. data/README.md +44 -17
  6. data/Rakefile +74 -148
  7. data/ext/ffi_c/AbstractMemory.c +89 -70
  8. data/ext/ffi_c/AbstractMemory.h +3 -2
  9. data/ext/ffi_c/ArrayType.c +49 -13
  10. data/ext/ffi_c/ArrayType.h +1 -0
  11. data/ext/ffi_c/Buffer.c +90 -38
  12. data/ext/ffi_c/Call.c +55 -56
  13. data/ext/ffi_c/Call.h +12 -6
  14. data/ext/ffi_c/ClosurePool.c +333 -0
  15. data/ext/ffi_c/{Closure.h → ClosurePool.h} +25 -13
  16. data/ext/ffi_c/DynamicLibrary.c +91 -33
  17. data/ext/ffi_c/Function.c +306 -235
  18. data/ext/ffi_c/Function.h +3 -5
  19. data/ext/ffi_c/FunctionInfo.c +87 -32
  20. data/ext/ffi_c/LastError.c +74 -15
  21. data/ext/ffi_c/LongDouble.c +12 -10
  22. data/ext/ffi_c/LongDouble.h +0 -4
  23. data/ext/ffi_c/MappedType.c +66 -23
  24. data/ext/ffi_c/MappedType.h +0 -2
  25. data/ext/ffi_c/MemoryPointer.c +37 -15
  26. data/ext/ffi_c/MemoryPointer.h +0 -4
  27. data/ext/ffi_c/MethodHandle.c +265 -38
  28. data/ext/ffi_c/MethodHandle.h +3 -2
  29. data/ext/ffi_c/Platform.c +5 -56
  30. data/ext/ffi_c/Pointer.c +93 -55
  31. data/ext/ffi_c/Pointer.h +1 -4
  32. data/ext/ffi_c/Struct.c +202 -134
  33. data/ext/ffi_c/Struct.h +18 -9
  34. data/ext/ffi_c/StructByValue.c +50 -23
  35. data/ext/ffi_c/StructLayout.c +135 -64
  36. data/ext/ffi_c/Thread.c +4 -228
  37. data/ext/ffi_c/Thread.h +1 -20
  38. data/ext/ffi_c/Type.c +105 -55
  39. data/ext/ffi_c/Type.h +3 -2
  40. data/ext/ffi_c/Types.c +8 -9
  41. data/ext/ffi_c/Types.h +3 -4
  42. data/ext/ffi_c/Variadic.c +88 -47
  43. data/ext/ffi_c/compat.h +26 -22
  44. data/ext/ffi_c/extconf.rb +75 -32
  45. data/ext/ffi_c/ffi.c +9 -10
  46. data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
  47. data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
  48. data/ext/ffi_c/libffi/.appveyor.yml +53 -19
  49. data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
  50. data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
  51. data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
  52. data/ext/ffi_c/libffi/.ci/build.sh +124 -0
  53. data/ext/ffi_c/libffi/.ci/install.sh +78 -0
  54. data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
  55. data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +1 -1
  56. data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
  57. data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
  58. data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
  59. data/ext/ffi_c/libffi/.ci/site.exp +29 -0
  60. data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
  61. data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
  62. data/ext/ffi_c/libffi/.gitattributes +4 -0
  63. data/ext/ffi_c/libffi/.github/workflows/build.yml +460 -0
  64. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +171 -0
  65. data/ext/ffi_c/libffi/.gitignore +10 -2
  66. data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
  67. data/ext/ffi_c/libffi/LICENSE +1 -1
  68. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
  69. data/ext/ffi_c/libffi/Makefile.am +64 -73
  70. data/ext/ffi_c/libffi/Makefile.in +553 -235
  71. data/ext/ffi_c/libffi/README.md +165 -100
  72. data/ext/ffi_c/libffi/acinclude.m4 +10 -112
  73. data/ext/ffi_c/libffi/compile +348 -0
  74. data/ext/ffi_c/libffi/config.guess +950 -662
  75. data/ext/ffi_c/libffi/config.sub +1362 -1306
  76. data/ext/ffi_c/libffi/configure +4909 -4096
  77. data/ext/ffi_c/libffi/configure.ac +93 -32
  78. data/ext/ffi_c/libffi/configure.host +76 -28
  79. data/ext/ffi_c/libffi/doc/Makefile.in +15 -8
  80. data/ext/ffi_c/libffi/doc/libffi.texi +107 -46
  81. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  82. data/ext/ffi_c/libffi/fficonfig.h.in +22 -44
  83. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +165 -56
  84. data/ext/ffi_c/libffi/include/Makefile.am +1 -1
  85. data/ext/ffi_c/libffi/include/Makefile.in +17 -12
  86. data/ext/ffi_c/libffi/include/ffi.h.in +64 -48
  87. data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
  88. data/ext/ffi_c/libffi/include/ffi_common.h +34 -1
  89. data/ext/ffi_c/libffi/include/tramp.h +45 -0
  90. data/ext/ffi_c/libffi/install-sh +107 -74
  91. data/ext/ffi_c/libffi/libffi.map.in +8 -12
  92. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
  93. data/ext/ffi_c/libffi/libtool-version +2 -2
  94. data/ext/ffi_c/libffi/ltmain.sh +576 -284
  95. data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
  96. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
  97. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
  98. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
  99. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
  100. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -44
  101. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
  102. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
  103. data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
  104. data/ext/ffi_c/libffi/make_sunver.pl +333 -0
  105. data/ext/ffi_c/libffi/man/Makefile.in +15 -8
  106. data/ext/ffi_c/libffi/missing +8 -8
  107. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
  108. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
  109. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
  110. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
  111. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
  112. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
  113. data/ext/ffi_c/libffi/msvcc.sh +39 -14
  114. data/ext/ffi_c/libffi/src/aarch64/ffi.c +286 -98
  115. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
  116. data/ext/ffi_c/libffi/src/aarch64/internal.h +33 -0
  117. data/ext/ffi_c/libffi/src/aarch64/sysv.S +142 -37
  118. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
  119. data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
  120. data/ext/ffi_c/libffi/src/arc/ffi.c +325 -148
  121. data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
  122. data/ext/ffi_c/libffi/src/arm/ffi.c +112 -10
  123. data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
  124. data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
  125. data/ext/ffi_c/libffi/src/arm/sysv.S +117 -44
  126. data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
  127. data/ext/ffi_c/libffi/src/closures.c +189 -48
  128. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  129. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  130. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  131. data/ext/ffi_c/libffi/src/dlmalloc.c +6 -1
  132. data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
  133. data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
  134. data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
  135. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  136. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  137. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  138. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  139. data/ext/ffi_c/libffi/src/loongarch64/ffi.c +621 -0
  140. data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
  141. data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
  142. data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
  143. data/ext/ffi_c/libffi/src/metag/ffi.c +1 -1
  144. data/ext/ffi_c/libffi/src/mips/ffi.c +245 -66
  145. data/ext/ffi_c/libffi/src/mips/ffitarget.h +8 -1
  146. data/ext/ffi_c/libffi/src/mips/n32.S +137 -28
  147. data/ext/ffi_c/libffi/src/mips/o32.S +63 -4
  148. data/ext/ffi_c/libffi/src/moxie/ffi.c +48 -23
  149. data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
  150. data/ext/ffi_c/libffi/src/pa/ffi.c +62 -108
  151. data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
  152. data/ext/ffi_c/libffi/src/pa/ffitarget.h +20 -11
  153. data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
  154. data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
  155. data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
  156. data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
  157. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
  158. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +211 -32
  159. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
  160. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
  161. data/ext/ffi_c/libffi/src/powerpc/linux64.S +93 -28
  162. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +83 -5
  163. data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
  164. data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
  165. data/ext/ffi_c/libffi/src/prep_cif.c +26 -4
  166. data/ext/ffi_c/libffi/src/riscv/ffi.c +79 -10
  167. data/ext/ffi_c/libffi/src/riscv/ffitarget.h +1 -0
  168. data/ext/ffi_c/libffi/src/riscv/sysv.S +86 -7
  169. data/ext/ffi_c/libffi/src/sparc/ffi64.c +16 -0
  170. data/ext/ffi_c/libffi/src/tramp.c +716 -0
  171. data/ext/ffi_c/libffi/src/wasm32/ffi.c +934 -0
  172. data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
  173. data/ext/ffi_c/libffi/src/x86/ffi.c +128 -49
  174. data/ext/ffi_c/libffi/src/x86/ffi64.c +89 -23
  175. data/ext/ffi_c/libffi/src/x86/ffitarget.h +21 -4
  176. data/ext/ffi_c/libffi/src/x86/ffiw64.c +63 -10
  177. data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
  178. data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
  179. data/ext/ffi_c/libffi/src/x86/sysv.S +274 -45
  180. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
  181. data/ext/ffi_c/libffi/src/x86/unix64.S +190 -4
  182. data/ext/ffi_c/libffi/src/x86/win64.S +32 -10
  183. data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
  184. data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
  185. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
  186. data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
  187. data/ext/ffi_c/libffi/testsuite/Makefile.am +127 -109
  188. data/ext/ffi_c/libffi/testsuite/Makefile.in +144 -88
  189. data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
  190. data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
  191. data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +80 -0
  192. data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
  193. data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
  194. data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
  195. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +71 -25
  196. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
  197. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
  198. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +5 -4
  199. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
  200. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +5 -1
  201. data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
  202. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
  203. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
  204. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
  205. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +3 -0
  206. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
  207. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
  208. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
  209. data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
  210. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +8 -9
  211. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +2 -2
  212. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +2 -2
  213. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +2 -2
  214. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +1 -1
  215. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
  216. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
  217. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
  218. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
  219. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
  220. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
  221. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
  222. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
  223. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
  224. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -119
  225. data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
  226. data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
  227. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +13 -0
  228. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +11 -0
  229. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +15 -0
  230. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
  231. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
  232. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
  233. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
  234. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
  235. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
  236. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
  237. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
  238. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
  239. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +6 -0
  240. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +18 -0
  241. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +22 -0
  242. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +24 -0
  243. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +29 -0
  244. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -0
  245. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +19 -1
  246. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +21 -1
  247. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +35 -3
  248. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +13 -0
  249. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +19 -0
  250. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +13 -0
  251. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +13 -0
  252. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +18 -0
  253. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +22 -0
  254. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +13 -0
  255. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +29 -1
  256. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +19 -1
  257. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +24 -0
  258. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +28 -1
  259. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +24 -2
  260. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +39 -1
  261. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +25 -1
  262. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +14 -0
  263. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +14 -1
  264. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +14 -2
  265. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +19 -1
  266. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +19 -1
  267. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +20 -1
  268. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +40 -25
  269. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +40 -3
  270. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +19 -1
  271. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +18 -1
  272. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +18 -3
  273. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +18 -1
  274. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +18 -1
  275. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +19 -1
  276. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +19 -1
  277. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +3 -1
  278. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +9 -1
  279. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
  280. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +11 -1
  281. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +22 -3
  282. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
  283. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
  284. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
  285. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
  286. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
  287. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
  288. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +5 -0
  289. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +10 -0
  290. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
  291. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
  292. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
  293. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +11 -0
  294. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
  295. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
  296. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +4 -0
  297. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +4 -0
  298. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +2 -0
  299. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
  300. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
  301. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +24 -22
  302. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +32 -9
  303. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +1 -1
  304. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +12 -0
  305. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +21 -5
  306. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
  307. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
  308. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +10 -1
  309. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +10 -1
  310. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +9 -0
  311. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +9 -0
  312. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +11 -0
  313. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +9 -0
  314. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +11 -0
  315. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +11 -0
  316. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
  317. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
  318. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
  319. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +1 -1
  320. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +1 -1
  321. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +6 -1
  322. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +2 -1
  323. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +1 -0
  324. data/ext/ffi_c/libffi.bsd.mk +2 -2
  325. data/ext/ffi_c/libffi.darwin.mk +1 -1
  326. data/ext/ffi_c/libffi.gnu.mk +2 -2
  327. data/ext/ffi_c/rbffi.h +1 -3
  328. data/ffi.gemspec +15 -9
  329. data/lib/ffi/abstract_memory.rb +44 -0
  330. data/lib/ffi/autopointer.rb +8 -23
  331. data/lib/ffi/compat.rb +43 -0
  332. data/lib/ffi/data_converter.rb +67 -0
  333. data/lib/ffi/dynamic_library.rb +89 -0
  334. data/lib/ffi/enum.rb +18 -11
  335. data/lib/ffi/ffi.rb +6 -0
  336. data/lib/ffi/function.rb +71 -0
  337. data/lib/ffi/io.rb +3 -3
  338. data/lib/ffi/library.rb +65 -77
  339. data/lib/ffi/library_path.rb +109 -0
  340. data/lib/ffi/managedstruct.rb +3 -3
  341. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  342. data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
  343. data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
  344. data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
  345. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  346. data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
  347. data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
  348. data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
  349. data/lib/ffi/platform/arm-linux/types.conf +110 -82
  350. data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
  351. data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
  352. data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
  353. data/lib/ffi/platform/i386-darwin/types.conf +63 -63
  354. data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
  355. data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
  356. data/lib/ffi/platform/i386-gnu/types.conf +84 -84
  357. data/lib/ffi/platform/i386-linux/types.conf +77 -77
  358. data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
  359. data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
  360. data/lib/ffi/platform/i386-solaris/types.conf +96 -96
  361. data/lib/ffi/platform/i386-windows/types.conf +43 -96
  362. data/lib/ffi/platform/ia64-linux/types.conf +79 -79
  363. data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
  364. data/lib/ffi/platform/mips-linux/types.conf +79 -79
  365. data/lib/ffi/platform/mips64-linux/types.conf +81 -81
  366. data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
  367. data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
  368. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
  369. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
  370. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
  371. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
  372. data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
  373. data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
  374. data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
  375. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  376. data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
  377. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  378. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  379. data/lib/ffi/platform/s390-linux/types.conf +79 -79
  380. data/lib/ffi/platform/s390x-linux/types.conf +79 -79
  381. data/lib/ffi/platform/sparc-linux/types.conf +79 -79
  382. data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
  383. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  384. data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
  385. data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
  386. data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
  387. data/lib/ffi/platform/x86_64-darwin/types.conf +88 -84
  388. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
  389. data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -90
  390. data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
  391. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  392. data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
  393. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  394. data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
  395. data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
  396. data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
  397. data/lib/ffi/platform/x86_64-windows/types.conf +42 -110
  398. data/lib/ffi/platform.rb +43 -20
  399. data/lib/ffi/pointer.rb +26 -20
  400. data/lib/ffi/struct.rb +14 -68
  401. data/lib/ffi/struct_by_reference.rb +72 -0
  402. data/lib/ffi/struct_layout.rb +96 -0
  403. data/lib/ffi/struct_layout_builder.rb +1 -1
  404. data/lib/ffi/tools/const_generator.rb +11 -8
  405. data/lib/ffi/tools/generator.rb +47 -2
  406. data/lib/ffi/tools/generator_task.rb +13 -17
  407. data/lib/ffi/tools/struct_generator.rb +6 -5
  408. data/lib/ffi/tools/types_generator.rb +7 -4
  409. data/lib/ffi/types.rb +33 -7
  410. data/lib/ffi/variadic.rb +20 -18
  411. data/lib/ffi/version.rb +1 -1
  412. data/lib/ffi.rb +10 -3
  413. data/rakelib/ffi_gem_helper.rb +65 -0
  414. data/samples/getlogin.rb +1 -1
  415. data/samples/getpid.rb +1 -1
  416. data/samples/gettimeofday.rb +8 -8
  417. data/samples/hello.rb +2 -1
  418. data/samples/hello_ractor.rb +11 -0
  419. data/samples/inotify.rb +1 -1
  420. data/samples/pty.rb +1 -2
  421. data/samples/qsort.rb +0 -1
  422. data/samples/qsort_ractor.rb +28 -0
  423. data.tar.gz.sig +0 -0
  424. metadata +252 -153
  425. metadata.gz.sig +0 -0
  426. data/.gitignore +0 -22
  427. data/.gitmodules +0 -3
  428. data/.travis.yml +0 -52
  429. data/.yardopts +0 -5
  430. data/appveyor.yml +0 -22
  431. data/ext/ffi_c/Closure.c +0 -54
  432. data/ext/ffi_c/DataConverter.c +0 -91
  433. data/ext/ffi_c/StructByReference.c +0 -190
  434. data/ext/ffi_c/StructByReference.h +0 -50
  435. data/ext/ffi_c/libffi/.travis/build.sh +0 -34
  436. data/ext/ffi_c/libffi/.travis/install.sh +0 -22
  437. data/ext/ffi_c/libffi/.travis/site.exp +0 -18
  438. data/ext/ffi_c/libffi/.travis.yml +0 -34
  439. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
  440. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  441. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  442. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +0 -44
  443. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +0 -44
  444. data/ext/ffi_c/win32/stdbool.h +0 -8
  445. data/ext/ffi_c/win32/stdint.h +0 -201
  446. data/samples/sample_helper.rb +0 -6
  447. data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
  448. data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
  449. data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
  450. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
  451. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
  452. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
  453. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
  454. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
  455. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
  456. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
  457. data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +79 -79
@@ -1,12 +1,14 @@
1
1
  #! /bin/sh
2
2
  # Configuration validation subroutine script.
3
- # Copyright 1992-2017 Free Software Foundation, Inc.
3
+ # Copyright 1992-2022 Free Software Foundation, Inc.
4
4
 
5
- timestamp='2017-04-02'
5
+ # shellcheck disable=SC2006,SC2268 # see below for rationale
6
+
7
+ timestamp='2022-01-03'
6
8
 
7
9
  # This file is free software; you can redistribute it and/or modify it
8
10
  # under the terms of the GNU General Public License as published by
9
- # the Free Software Foundation; either version 3 of the License, or
11
+ # the Free Software Foundation, either version 3 of the License, or
10
12
  # (at your option) any later version.
11
13
  #
12
14
  # This program is distributed in the hope that it will be useful, but
@@ -15,7 +17,7 @@ timestamp='2017-04-02'
15
17
  # General Public License for more details.
16
18
  #
17
19
  # You should have received a copy of the GNU General Public License
18
- # along with this program; if not, see <http://www.gnu.org/licenses/>.
20
+ # along with this program; if not, see <https://www.gnu.org/licenses/>.
19
21
  #
20
22
  # As a special exception to the GNU General Public License, if you
21
23
  # distribute this file as part of a program that contains a
@@ -33,7 +35,7 @@ timestamp='2017-04-02'
33
35
  # Otherwise, we print the canonical config type on stdout and succeed.
34
36
 
35
37
  # You can get the latest version of this script from:
36
- # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
38
+ # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
37
39
 
38
40
  # This file is supposed to be the same for all GNU packages
39
41
  # and recognize all the CPU types, system types and aliases
@@ -50,6 +52,13 @@ timestamp='2017-04-02'
50
52
  # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
51
53
  # It is wrong to echo any other type of specification.
52
54
 
55
+ # The "shellcheck disable" line above the timestamp inhibits complaints
56
+ # about features and limitations of the classic Bourne shell that were
57
+ # superseded or lifted in POSIX. However, this script identifies a wide
58
+ # variety of pre-POSIX systems that do not have POSIX shells at all, and
59
+ # even some reasonably current systems (Solaris 10 as case-in-point) still
60
+ # have a pre-POSIX /bin/sh.
61
+
53
62
  me=`echo "$0" | sed -e 's,.*/,,'`
54
63
 
55
64
  usage="\
@@ -57,7 +66,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
57
66
 
58
67
  Canonicalize a configuration name.
59
68
 
60
- Operation modes:
69
+ Options:
61
70
  -h, --help print this help, then exit
62
71
  -t, --time-stamp print date of last modification, then exit
63
72
  -v, --version print version number, then exit
@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
67
76
  version="\
68
77
  GNU config.sub ($timestamp)
69
78
 
70
- Copyright 1992-2017 Free Software Foundation, Inc.
79
+ Copyright 1992-2022 Free Software Foundation, Inc.
71
80
 
72
81
  This is free software; see the source for copying conditions. There is NO
73
82
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -89,12 +98,12 @@ while test $# -gt 0 ; do
89
98
  - ) # Use stdin as input.
90
99
  break ;;
91
100
  -* )
92
- echo "$me: invalid option $1$help"
101
+ echo "$me: invalid option $1$help" >&2
93
102
  exit 1 ;;
94
103
 
95
104
  *local*)
96
105
  # First pass through any local machine types.
97
- echo $1
106
+ echo "$1"
98
107
  exit ;;
99
108
 
100
109
  * )
@@ -110,1252 +119,1186 @@ case $# in
110
119
  exit 1;;
111
120
  esac
112
121
 
113
- # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
114
- # Here we must recognize all the valid KERNEL-OS combinations.
115
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
116
- case $maybe_os in
117
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
118
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119
- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
120
- kopensolaris*-gnu* | cloudabi*-eabi* | \
121
- storm-chaos* | os2-emx* | rtmk-nova*)
122
- os=-$maybe_os
123
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124
- ;;
125
- android-linux)
126
- os=-linux-android
127
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
128
- ;;
129
- *)
130
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131
- if [ $basic_machine != $1 ]
132
- then os=`echo $1 | sed 's/.*-/-/'`
133
- else os=; fi
134
- ;;
135
- esac
122
+ # Split fields of configuration type
123
+ # shellcheck disable=SC2162
124
+ saved_IFS=$IFS
125
+ IFS="-" read field1 field2 field3 field4 <<EOF
126
+ $1
127
+ EOF
128
+ IFS=$saved_IFS
136
129
 
137
- ### Let's recognize common machines as not being operating systems so
138
- ### that things like config.sub decstation-3100 work. We also
139
- ### recognize some manufacturers as not being operating systems, so we
140
- ### can provide default operating systems below.
141
- case $os in
142
- -sun*os*)
143
- # Prevent following clause from handling this invalid input.
144
- ;;
145
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
146
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
147
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
148
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151
- -apple | -axis | -knuth | -cray | -microblaze*)
152
- os=
153
- basic_machine=$1
154
- ;;
155
- -bluegene*)
156
- os=-cnk
157
- ;;
158
- -sim | -cisco | -oki | -wec | -winbond)
159
- os=
160
- basic_machine=$1
161
- ;;
162
- -scout)
163
- ;;
164
- -wrs)
165
- os=-vxworks
166
- basic_machine=$1
167
- ;;
168
- -chorusos*)
169
- os=-chorusos
170
- basic_machine=$1
171
- ;;
172
- -chorusrdb)
173
- os=-chorusrdb
174
- basic_machine=$1
175
- ;;
176
- -hiux*)
177
- os=-hiuxwe2
178
- ;;
179
- -sco6)
180
- os=-sco5v6
181
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182
- ;;
183
- -sco5)
184
- os=-sco3.2v5
185
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186
- ;;
187
- -sco4)
188
- os=-sco3.2v4
189
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190
- ;;
191
- -sco3.2.[4-9]*)
192
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194
- ;;
195
- -sco3.2v[4-9]*)
196
- # Don't forget version if it is 3.2v4 or newer.
197
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198
- ;;
199
- -sco5v6*)
200
- # Don't forget version if it is 3.2v4 or newer.
201
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202
- ;;
203
- -sco*)
204
- os=-sco3.2v2
205
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206
- ;;
207
- -udk*)
208
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209
- ;;
210
- -isc)
211
- os=-isc2.2
212
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
213
- ;;
214
- -clix*)
215
- basic_machine=clipper-intergraph
216
- ;;
217
- -isc*)
218
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219
- ;;
220
- -lynx*178)
221
- os=-lynxos178
222
- ;;
223
- -lynx*5)
224
- os=-lynxos5
225
- ;;
226
- -lynx*)
227
- os=-lynxos
130
+ # Separate into logical components for further validation
131
+ case $1 in
132
+ *-*-*-*-*)
133
+ echo Invalid configuration \`"$1"\': more than four components >&2
134
+ exit 1
228
135
  ;;
229
- -ptx*)
230
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
136
+ *-*-*-*)
137
+ basic_machine=$field1-$field2
138
+ basic_os=$field3-$field4
231
139
  ;;
232
- -windowsnt*)
233
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
140
+ *-*-*)
141
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
142
+ # parts
143
+ maybe_os=$field2-$field3
144
+ case $maybe_os in
145
+ nto-qnx* | linux-* | uclinux-uclibc* \
146
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
147
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
148
+ | storm-chaos* | os2-emx* | rtmk-nova*)
149
+ basic_machine=$field1
150
+ basic_os=$maybe_os
151
+ ;;
152
+ android-linux)
153
+ basic_machine=$field1-unknown
154
+ basic_os=linux-android
155
+ ;;
156
+ *)
157
+ basic_machine=$field1-$field2
158
+ basic_os=$field3
159
+ ;;
160
+ esac
234
161
  ;;
235
- -psos*)
236
- os=-psos
162
+ *-*)
163
+ # A lone config we happen to match not fitting any pattern
164
+ case $field1-$field2 in
165
+ decstation-3100)
166
+ basic_machine=mips-dec
167
+ basic_os=
168
+ ;;
169
+ *-*)
170
+ # Second component is usually, but not always the OS
171
+ case $field2 in
172
+ # Prevent following clause from handling this valid os
173
+ sun*os*)
174
+ basic_machine=$field1
175
+ basic_os=$field2
176
+ ;;
177
+ zephyr*)
178
+ basic_machine=$field1-unknown
179
+ basic_os=$field2
180
+ ;;
181
+ # Manufacturers
182
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
183
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
184
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
185
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
186
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
187
+ | ultra | tti* | harris | dolphin | highlevel | gould \
188
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
189
+ | microblaze* | sim | cisco \
190
+ | oki | wec | wrs | winbond)
191
+ basic_machine=$field1-$field2
192
+ basic_os=
193
+ ;;
194
+ *)
195
+ basic_machine=$field1
196
+ basic_os=$field2
197
+ ;;
198
+ esac
199
+ ;;
200
+ esac
237
201
  ;;
238
- -mint | -mint[0-9]*)
239
- basic_machine=m68k-atari
240
- os=-mint
202
+ *)
203
+ # Convert single-component short-hands not valid as part of
204
+ # multi-component configurations.
205
+ case $field1 in
206
+ 386bsd)
207
+ basic_machine=i386-pc
208
+ basic_os=bsd
209
+ ;;
210
+ a29khif)
211
+ basic_machine=a29k-amd
212
+ basic_os=udi
213
+ ;;
214
+ adobe68k)
215
+ basic_machine=m68010-adobe
216
+ basic_os=scout
217
+ ;;
218
+ alliant)
219
+ basic_machine=fx80-alliant
220
+ basic_os=
221
+ ;;
222
+ altos | altos3068)
223
+ basic_machine=m68k-altos
224
+ basic_os=
225
+ ;;
226
+ am29k)
227
+ basic_machine=a29k-none
228
+ basic_os=bsd
229
+ ;;
230
+ amdahl)
231
+ basic_machine=580-amdahl
232
+ basic_os=sysv
233
+ ;;
234
+ amiga)
235
+ basic_machine=m68k-unknown
236
+ basic_os=
237
+ ;;
238
+ amigaos | amigados)
239
+ basic_machine=m68k-unknown
240
+ basic_os=amigaos
241
+ ;;
242
+ amigaunix | amix)
243
+ basic_machine=m68k-unknown
244
+ basic_os=sysv4
245
+ ;;
246
+ apollo68)
247
+ basic_machine=m68k-apollo
248
+ basic_os=sysv
249
+ ;;
250
+ apollo68bsd)
251
+ basic_machine=m68k-apollo
252
+ basic_os=bsd
253
+ ;;
254
+ aros)
255
+ basic_machine=i386-pc
256
+ basic_os=aros
257
+ ;;
258
+ aux)
259
+ basic_machine=m68k-apple
260
+ basic_os=aux
261
+ ;;
262
+ balance)
263
+ basic_machine=ns32k-sequent
264
+ basic_os=dynix
265
+ ;;
266
+ blackfin)
267
+ basic_machine=bfin-unknown
268
+ basic_os=linux
269
+ ;;
270
+ cegcc)
271
+ basic_machine=arm-unknown
272
+ basic_os=cegcc
273
+ ;;
274
+ convex-c1)
275
+ basic_machine=c1-convex
276
+ basic_os=bsd
277
+ ;;
278
+ convex-c2)
279
+ basic_machine=c2-convex
280
+ basic_os=bsd
281
+ ;;
282
+ convex-c32)
283
+ basic_machine=c32-convex
284
+ basic_os=bsd
285
+ ;;
286
+ convex-c34)
287
+ basic_machine=c34-convex
288
+ basic_os=bsd
289
+ ;;
290
+ convex-c38)
291
+ basic_machine=c38-convex
292
+ basic_os=bsd
293
+ ;;
294
+ cray)
295
+ basic_machine=j90-cray
296
+ basic_os=unicos
297
+ ;;
298
+ crds | unos)
299
+ basic_machine=m68k-crds
300
+ basic_os=
301
+ ;;
302
+ da30)
303
+ basic_machine=m68k-da30
304
+ basic_os=
305
+ ;;
306
+ decstation | pmax | pmin | dec3100 | decstatn)
307
+ basic_machine=mips-dec
308
+ basic_os=
309
+ ;;
310
+ delta88)
311
+ basic_machine=m88k-motorola
312
+ basic_os=sysv3
313
+ ;;
314
+ dicos)
315
+ basic_machine=i686-pc
316
+ basic_os=dicos
317
+ ;;
318
+ djgpp)
319
+ basic_machine=i586-pc
320
+ basic_os=msdosdjgpp
321
+ ;;
322
+ ebmon29k)
323
+ basic_machine=a29k-amd
324
+ basic_os=ebmon
325
+ ;;
326
+ es1800 | OSE68k | ose68k | ose | OSE)
327
+ basic_machine=m68k-ericsson
328
+ basic_os=ose
329
+ ;;
330
+ gmicro)
331
+ basic_machine=tron-gmicro
332
+ basic_os=sysv
333
+ ;;
334
+ go32)
335
+ basic_machine=i386-pc
336
+ basic_os=go32
337
+ ;;
338
+ h8300hms)
339
+ basic_machine=h8300-hitachi
340
+ basic_os=hms
341
+ ;;
342
+ h8300xray)
343
+ basic_machine=h8300-hitachi
344
+ basic_os=xray
345
+ ;;
346
+ h8500hms)
347
+ basic_machine=h8500-hitachi
348
+ basic_os=hms
349
+ ;;
350
+ harris)
351
+ basic_machine=m88k-harris
352
+ basic_os=sysv3
353
+ ;;
354
+ hp300 | hp300hpux)
355
+ basic_machine=m68k-hp
356
+ basic_os=hpux
357
+ ;;
358
+ hp300bsd)
359
+ basic_machine=m68k-hp
360
+ basic_os=bsd
361
+ ;;
362
+ hppaosf)
363
+ basic_machine=hppa1.1-hp
364
+ basic_os=osf
365
+ ;;
366
+ hppro)
367
+ basic_machine=hppa1.1-hp
368
+ basic_os=proelf
369
+ ;;
370
+ i386mach)
371
+ basic_machine=i386-mach
372
+ basic_os=mach
373
+ ;;
374
+ isi68 | isi)
375
+ basic_machine=m68k-isi
376
+ basic_os=sysv
377
+ ;;
378
+ m68knommu)
379
+ basic_machine=m68k-unknown
380
+ basic_os=linux
381
+ ;;
382
+ magnum | m3230)
383
+ basic_machine=mips-mips
384
+ basic_os=sysv
385
+ ;;
386
+ merlin)
387
+ basic_machine=ns32k-utek
388
+ basic_os=sysv
389
+ ;;
390
+ mingw64)
391
+ basic_machine=x86_64-pc
392
+ basic_os=mingw64
393
+ ;;
394
+ mingw32)
395
+ basic_machine=i686-pc
396
+ basic_os=mingw32
397
+ ;;
398
+ mingw32ce)
399
+ basic_machine=arm-unknown
400
+ basic_os=mingw32ce
401
+ ;;
402
+ monitor)
403
+ basic_machine=m68k-rom68k
404
+ basic_os=coff
405
+ ;;
406
+ morphos)
407
+ basic_machine=powerpc-unknown
408
+ basic_os=morphos
409
+ ;;
410
+ moxiebox)
411
+ basic_machine=moxie-unknown
412
+ basic_os=moxiebox
413
+ ;;
414
+ msdos)
415
+ basic_machine=i386-pc
416
+ basic_os=msdos
417
+ ;;
418
+ msys)
419
+ basic_machine=i686-pc
420
+ basic_os=msys
421
+ ;;
422
+ mvs)
423
+ basic_machine=i370-ibm
424
+ basic_os=mvs
425
+ ;;
426
+ nacl)
427
+ basic_machine=le32-unknown
428
+ basic_os=nacl
429
+ ;;
430
+ ncr3000)
431
+ basic_machine=i486-ncr
432
+ basic_os=sysv4
433
+ ;;
434
+ netbsd386)
435
+ basic_machine=i386-pc
436
+ basic_os=netbsd
437
+ ;;
438
+ netwinder)
439
+ basic_machine=armv4l-rebel
440
+ basic_os=linux
441
+ ;;
442
+ news | news700 | news800 | news900)
443
+ basic_machine=m68k-sony
444
+ basic_os=newsos
445
+ ;;
446
+ news1000)
447
+ basic_machine=m68030-sony
448
+ basic_os=newsos
449
+ ;;
450
+ necv70)
451
+ basic_machine=v70-nec
452
+ basic_os=sysv
453
+ ;;
454
+ nh3000)
455
+ basic_machine=m68k-harris
456
+ basic_os=cxux
457
+ ;;
458
+ nh[45]000)
459
+ basic_machine=m88k-harris
460
+ basic_os=cxux
461
+ ;;
462
+ nindy960)
463
+ basic_machine=i960-intel
464
+ basic_os=nindy
465
+ ;;
466
+ mon960)
467
+ basic_machine=i960-intel
468
+ basic_os=mon960
469
+ ;;
470
+ nonstopux)
471
+ basic_machine=mips-compaq
472
+ basic_os=nonstopux
473
+ ;;
474
+ os400)
475
+ basic_machine=powerpc-ibm
476
+ basic_os=os400
477
+ ;;
478
+ OSE68000 | ose68000)
479
+ basic_machine=m68000-ericsson
480
+ basic_os=ose
481
+ ;;
482
+ os68k)
483
+ basic_machine=m68k-none
484
+ basic_os=os68k
485
+ ;;
486
+ paragon)
487
+ basic_machine=i860-intel
488
+ basic_os=osf
489
+ ;;
490
+ parisc)
491
+ basic_machine=hppa-unknown
492
+ basic_os=linux
493
+ ;;
494
+ psp)
495
+ basic_machine=mipsallegrexel-sony
496
+ basic_os=psp
497
+ ;;
498
+ pw32)
499
+ basic_machine=i586-unknown
500
+ basic_os=pw32
501
+ ;;
502
+ rdos | rdos64)
503
+ basic_machine=x86_64-pc
504
+ basic_os=rdos
505
+ ;;
506
+ rdos32)
507
+ basic_machine=i386-pc
508
+ basic_os=rdos
509
+ ;;
510
+ rom68k)
511
+ basic_machine=m68k-rom68k
512
+ basic_os=coff
513
+ ;;
514
+ sa29200)
515
+ basic_machine=a29k-amd
516
+ basic_os=udi
517
+ ;;
518
+ sei)
519
+ basic_machine=mips-sei
520
+ basic_os=seiux
521
+ ;;
522
+ sequent)
523
+ basic_machine=i386-sequent
524
+ basic_os=
525
+ ;;
526
+ sps7)
527
+ basic_machine=m68k-bull
528
+ basic_os=sysv2
529
+ ;;
530
+ st2000)
531
+ basic_machine=m68k-tandem
532
+ basic_os=
533
+ ;;
534
+ stratus)
535
+ basic_machine=i860-stratus
536
+ basic_os=sysv4
537
+ ;;
538
+ sun2)
539
+ basic_machine=m68000-sun
540
+ basic_os=
541
+ ;;
542
+ sun2os3)
543
+ basic_machine=m68000-sun
544
+ basic_os=sunos3
545
+ ;;
546
+ sun2os4)
547
+ basic_machine=m68000-sun
548
+ basic_os=sunos4
549
+ ;;
550
+ sun3)
551
+ basic_machine=m68k-sun
552
+ basic_os=
553
+ ;;
554
+ sun3os3)
555
+ basic_machine=m68k-sun
556
+ basic_os=sunos3
557
+ ;;
558
+ sun3os4)
559
+ basic_machine=m68k-sun
560
+ basic_os=sunos4
561
+ ;;
562
+ sun4)
563
+ basic_machine=sparc-sun
564
+ basic_os=
565
+ ;;
566
+ sun4os3)
567
+ basic_machine=sparc-sun
568
+ basic_os=sunos3
569
+ ;;
570
+ sun4os4)
571
+ basic_machine=sparc-sun
572
+ basic_os=sunos4
573
+ ;;
574
+ sun4sol2)
575
+ basic_machine=sparc-sun
576
+ basic_os=solaris2
577
+ ;;
578
+ sun386 | sun386i | roadrunner)
579
+ basic_machine=i386-sun
580
+ basic_os=
581
+ ;;
582
+ sv1)
583
+ basic_machine=sv1-cray
584
+ basic_os=unicos
585
+ ;;
586
+ symmetry)
587
+ basic_machine=i386-sequent
588
+ basic_os=dynix
589
+ ;;
590
+ t3e)
591
+ basic_machine=alphaev5-cray
592
+ basic_os=unicos
593
+ ;;
594
+ t90)
595
+ basic_machine=t90-cray
596
+ basic_os=unicos
597
+ ;;
598
+ toad1)
599
+ basic_machine=pdp10-xkl
600
+ basic_os=tops20
601
+ ;;
602
+ tpf)
603
+ basic_machine=s390x-ibm
604
+ basic_os=tpf
605
+ ;;
606
+ udi29k)
607
+ basic_machine=a29k-amd
608
+ basic_os=udi
609
+ ;;
610
+ ultra3)
611
+ basic_machine=a29k-nyu
612
+ basic_os=sym1
613
+ ;;
614
+ v810 | necv810)
615
+ basic_machine=v810-nec
616
+ basic_os=none
617
+ ;;
618
+ vaxv)
619
+ basic_machine=vax-dec
620
+ basic_os=sysv
621
+ ;;
622
+ vms)
623
+ basic_machine=vax-dec
624
+ basic_os=vms
625
+ ;;
626
+ vsta)
627
+ basic_machine=i386-pc
628
+ basic_os=vsta
629
+ ;;
630
+ vxworks960)
631
+ basic_machine=i960-wrs
632
+ basic_os=vxworks
633
+ ;;
634
+ vxworks68)
635
+ basic_machine=m68k-wrs
636
+ basic_os=vxworks
637
+ ;;
638
+ vxworks29k)
639
+ basic_machine=a29k-wrs
640
+ basic_os=vxworks
641
+ ;;
642
+ xbox)
643
+ basic_machine=i686-pc
644
+ basic_os=mingw32
645
+ ;;
646
+ ymp)
647
+ basic_machine=ymp-cray
648
+ basic_os=unicos
649
+ ;;
650
+ *)
651
+ basic_machine=$1
652
+ basic_os=
653
+ ;;
654
+ esac
241
655
  ;;
242
656
  esac
243
657
 
244
- # Decode aliases for certain CPU-COMPANY combinations.
658
+ # Decode 1-component or ad-hoc basic machines
245
659
  case $basic_machine in
246
- # Recognize the basic CPU types without company name.
247
- # Some are omitted here because they have special meanings below.
248
- 1750a | 580 \
249
- | a29k \
250
- | aarch64 | aarch64_be \
251
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
252
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
253
- | am33_2.0 \
254
- | arc | arceb \
255
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
256
- | avr | avr32 \
257
- | ba \
258
- | be32 | be64 \
259
- | bfin \
260
- | c4x | c8051 | clipper \
261
- | d10v | d30v | dlx | dsp16xx \
262
- | e2k | epiphany \
263
- | fido | fr30 | frv | ft32 \
264
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
265
- | hexagon \
266
- | i370 | i860 | i960 | ia16 | ia64 \
267
- | ip2k | iq2000 \
268
- | k1om \
269
- | le32 | le64 \
270
- | lm32 \
271
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
272
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
273
- | mips | mipsbe | mipseb | mipsel | mipsle \
274
- | mips16 \
275
- | mips64 | mips64el \
276
- | mips64octeon | mips64octeonel \
277
- | mips64orion | mips64orionel \
278
- | mips64r5900 | mips64r5900el \
279
- | mips64vr | mips64vrel \
280
- | mips64vr4100 | mips64vr4100el \
281
- | mips64vr4300 | mips64vr4300el \
282
- | mips64vr5000 | mips64vr5000el \
283
- | mips64vr5900 | mips64vr5900el \
284
- | mipsisa32 | mipsisa32el \
285
- | mipsisa32r2 | mipsisa32r2el \
286
- | mipsisa32r6 | mipsisa32r6el \
287
- | mipsisa64 | mipsisa64el \
288
- | mipsisa64r2 | mipsisa64r2el \
289
- | mipsisa64r6 | mipsisa64r6el \
290
- | mipsisa64sb1 | mipsisa64sb1el \
291
- | mipsisa64sr71k | mipsisa64sr71kel \
292
- | mipsr5900 | mipsr5900el \
293
- | mipstx39 | mipstx39el \
294
- | mn10200 | mn10300 \
295
- | moxie \
296
- | mt \
297
- | msp430 \
298
- | nds32 | nds32le | nds32be \
299
- | nios | nios2 | nios2eb | nios2el \
300
- | ns16k | ns32k \
301
- | open8 | or1k | or1knd | or32 \
302
- | pdp10 | pdp11 | pj | pjl \
303
- | powerpc | powerpc64 | powerpc64le | powerpcle \
304
- | pru \
305
- | pyramid \
306
- | riscv32 | riscv64 \
307
- | rl78 | rx \
308
- | score \
309
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
310
- | sh64 | sh64le \
311
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
312
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
313
- | spu \
314
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
315
- | ubicom32 \
316
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
317
- | visium \
318
- | wasm32 \
319
- | we32k \
320
- | x86 | xc16x | xstormy16 | xtensa \
321
- | z8k | z80)
322
- basic_machine=$basic_machine-unknown
323
- ;;
324
- c54x)
325
- basic_machine=tic54x-unknown
326
- ;;
327
- c55x)
328
- basic_machine=tic55x-unknown
329
- ;;
330
- c6x)
331
- basic_machine=tic6x-unknown
332
- ;;
333
- leon|leon[3-9])
334
- basic_machine=sparc-$basic_machine
335
- ;;
336
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
337
- basic_machine=$basic_machine-unknown
338
- os=-none
660
+ # Here we handle the default manufacturer of certain CPU types. It is in
661
+ # some cases the only manufacturer, in others, it is the most popular.
662
+ w89k)
663
+ cpu=hppa1.1
664
+ vendor=winbond
339
665
  ;;
340
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
666
+ op50n)
667
+ cpu=hppa1.1
668
+ vendor=oki
341
669
  ;;
342
- ms1)
343
- basic_machine=mt-unknown
670
+ op60c)
671
+ cpu=hppa1.1
672
+ vendor=oki
344
673
  ;;
345
-
346
- strongarm | thumb | xscale)
347
- basic_machine=arm-unknown
674
+ ibm*)
675
+ cpu=i370
676
+ vendor=ibm
348
677
  ;;
349
- xgate)
350
- basic_machine=$basic_machine-unknown
351
- os=-none
678
+ orion105)
679
+ cpu=clipper
680
+ vendor=highlevel
352
681
  ;;
353
- xscaleeb)
354
- basic_machine=armeb-unknown
682
+ mac | mpw | mac-mpw)
683
+ cpu=m68k
684
+ vendor=apple
355
685
  ;;
356
-
357
- xscaleel)
358
- basic_machine=armel-unknown
686
+ pmac | pmac-mpw)
687
+ cpu=powerpc
688
+ vendor=apple
359
689
  ;;
360
690
 
361
- # We use `pc' rather than `unknown'
362
- # because (1) that's what they normally are, and
363
- # (2) the word "unknown" tends to confuse beginning users.
364
- i*86 | x86_64)
365
- basic_machine=$basic_machine-pc
366
- ;;
367
- # Object if more than one company name word.
368
- *-*-*)
369
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
370
- exit 1
371
- ;;
372
- # Recognize the basic CPU types with company name.
373
- 580-* \
374
- | a29k-* \
375
- | aarch64-* | aarch64_be-* \
376
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
377
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
378
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
379
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
380
- | avr-* | avr32-* \
381
- | ba-* \
382
- | be32-* | be64-* \
383
- | bfin-* | bs2000-* \
384
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
385
- | c8051-* | clipper-* | craynv-* | cydra-* \
386
- | d10v-* | d30v-* | dlx-* \
387
- | e2k-* | elxsi-* \
388
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
389
- | h8300-* | h8500-* \
390
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
391
- | hexagon-* \
392
- | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
393
- | ip2k-* | iq2000-* \
394
- | k1om-* \
395
- | le32-* | le64-* \
396
- | lm32-* \
397
- | m32c-* | m32r-* | m32rle-* \
398
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
399
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
400
- | microblaze-* | microblazeel-* \
401
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
402
- | mips16-* \
403
- | mips64-* | mips64el-* \
404
- | mips64octeon-* | mips64octeonel-* \
405
- | mips64orion-* | mips64orionel-* \
406
- | mips64r5900-* | mips64r5900el-* \
407
- | mips64vr-* | mips64vrel-* \
408
- | mips64vr4100-* | mips64vr4100el-* \
409
- | mips64vr4300-* | mips64vr4300el-* \
410
- | mips64vr5000-* | mips64vr5000el-* \
411
- | mips64vr5900-* | mips64vr5900el-* \
412
- | mipsisa32-* | mipsisa32el-* \
413
- | mipsisa32r2-* | mipsisa32r2el-* \
414
- | mipsisa32r6-* | mipsisa32r6el-* \
415
- | mipsisa64-* | mipsisa64el-* \
416
- | mipsisa64r2-* | mipsisa64r2el-* \
417
- | mipsisa64r6-* | mipsisa64r6el-* \
418
- | mipsisa64sb1-* | mipsisa64sb1el-* \
419
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
420
- | mipsr5900-* | mipsr5900el-* \
421
- | mipstx39-* | mipstx39el-* \
422
- | mmix-* \
423
- | mt-* \
424
- | msp430-* \
425
- | nds32-* | nds32le-* | nds32be-* \
426
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
427
- | none-* | np1-* | ns16k-* | ns32k-* \
428
- | open8-* \
429
- | or1k*-* \
430
- | orion-* \
431
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
432
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
433
- | pru-* \
434
- | pyramid-* \
435
- | riscv32-* | riscv64-* \
436
- | rl78-* | romp-* | rs6000-* | rx-* \
437
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
438
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
439
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
440
- | sparclite-* \
441
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
442
- | tahoe-* \
443
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
444
- | tile*-* \
445
- | tron-* \
446
- | ubicom32-* \
447
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
448
- | vax-* \
449
- | visium-* \
450
- | wasm32-* \
451
- | we32k-* \
452
- | x86-* | x86_64-* | xc16x-* | xps100-* \
453
- | xstormy16-* | xtensa*-* \
454
- | ymp-* \
455
- | z8k-* | z80-*)
456
- ;;
457
- # Recognize the basic CPU types without company name, with glob match.
458
- xtensa*)
459
- basic_machine=$basic_machine-unknown
460
- ;;
461
691
  # Recognize the various machine names and aliases which stand
462
692
  # for a CPU type and a company and sometimes even an OS.
463
- 386bsd)
464
- basic_machine=i386-unknown
465
- os=-bsd
466
- ;;
467
693
  3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
468
- basic_machine=m68000-att
694
+ cpu=m68000
695
+ vendor=att
469
696
  ;;
470
697
  3b*)
471
- basic_machine=we32k-att
472
- ;;
473
- a29khif)
474
- basic_machine=a29k-amd
475
- os=-udi
476
- ;;
477
- abacus)
478
- basic_machine=abacus-unknown
479
- ;;
480
- adobe68k)
481
- basic_machine=m68010-adobe
482
- os=-scout
483
- ;;
484
- alliant | fx80)
485
- basic_machine=fx80-alliant
486
- ;;
487
- altos | altos3068)
488
- basic_machine=m68k-altos
489
- ;;
490
- am29k)
491
- basic_machine=a29k-none
492
- os=-bsd
493
- ;;
494
- amd64)
495
- basic_machine=x86_64-pc
496
- ;;
497
- amd64-*)
498
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
499
- ;;
500
- amdahl)
501
- basic_machine=580-amdahl
502
- os=-sysv
503
- ;;
504
- amiga | amiga-*)
505
- basic_machine=m68k-unknown
506
- ;;
507
- amigaos | amigados)
508
- basic_machine=m68k-unknown
509
- os=-amigaos
510
- ;;
511
- amigaunix | amix)
512
- basic_machine=m68k-unknown
513
- os=-sysv4
514
- ;;
515
- apollo68)
516
- basic_machine=m68k-apollo
517
- os=-sysv
518
- ;;
519
- apollo68bsd)
520
- basic_machine=m68k-apollo
521
- os=-bsd
522
- ;;
523
- aros)
524
- basic_machine=i386-pc
525
- os=-aros
526
- ;;
527
- asmjs)
528
- basic_machine=asmjs-unknown
529
- ;;
530
- aux)
531
- basic_machine=m68k-apple
532
- os=-aux
533
- ;;
534
- balance)
535
- basic_machine=ns32k-sequent
536
- os=-dynix
537
- ;;
538
- blackfin)
539
- basic_machine=bfin-unknown
540
- os=-linux
541
- ;;
542
- blackfin-*)
543
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
544
- os=-linux
698
+ cpu=we32k
699
+ vendor=att
545
700
  ;;
546
701
  bluegene*)
547
- basic_machine=powerpc-ibm
548
- os=-cnk
549
- ;;
550
- c54x-*)
551
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
552
- ;;
553
- c55x-*)
554
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
555
- ;;
556
- c6x-*)
557
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
558
- ;;
559
- c90)
560
- basic_machine=c90-cray
561
- os=-unicos
562
- ;;
563
- cegcc)
564
- basic_machine=arm-unknown
565
- os=-cegcc
566
- ;;
567
- convex-c1)
568
- basic_machine=c1-convex
569
- os=-bsd
570
- ;;
571
- convex-c2)
572
- basic_machine=c2-convex
573
- os=-bsd
574
- ;;
575
- convex-c32)
576
- basic_machine=c32-convex
577
- os=-bsd
578
- ;;
579
- convex-c34)
580
- basic_machine=c34-convex
581
- os=-bsd
582
- ;;
583
- convex-c38)
584
- basic_machine=c38-convex
585
- os=-bsd
586
- ;;
587
- cray | j90)
588
- basic_machine=j90-cray
589
- os=-unicos
590
- ;;
591
- craynv)
592
- basic_machine=craynv-cray
593
- os=-unicosmp
594
- ;;
595
- cr16 | cr16-*)
596
- basic_machine=cr16-unknown
597
- os=-elf
598
- ;;
599
- crds | unos)
600
- basic_machine=m68k-crds
601
- ;;
602
- crisv32 | crisv32-* | etraxfs*)
603
- basic_machine=crisv32-axis
604
- ;;
605
- cris | cris-* | etrax*)
606
- basic_machine=cris-axis
607
- ;;
608
- crx)
609
- basic_machine=crx-unknown
610
- os=-elf
611
- ;;
612
- da30 | da30-*)
613
- basic_machine=m68k-da30
614
- ;;
615
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
616
- basic_machine=mips-dec
702
+ cpu=powerpc
703
+ vendor=ibm
704
+ basic_os=cnk
617
705
  ;;
618
706
  decsystem10* | dec10*)
619
- basic_machine=pdp10-dec
620
- os=-tops10
707
+ cpu=pdp10
708
+ vendor=dec
709
+ basic_os=tops10
621
710
  ;;
622
711
  decsystem20* | dec20*)
623
- basic_machine=pdp10-dec
624
- os=-tops20
712
+ cpu=pdp10
713
+ vendor=dec
714
+ basic_os=tops20
625
715
  ;;
626
716
  delta | 3300 | motorola-3300 | motorola-delta \
627
717
  | 3300-motorola | delta-motorola)
628
- basic_machine=m68k-motorola
629
- ;;
630
- delta88)
631
- basic_machine=m88k-motorola
632
- os=-sysv3
633
- ;;
634
- dicos)
635
- basic_machine=i686-pc
636
- os=-dicos
637
- ;;
638
- djgpp)
639
- basic_machine=i586-pc
640
- os=-msdosdjgpp
641
- ;;
642
- dpx20 | dpx20-*)
643
- basic_machine=rs6000-bull
644
- os=-bosx
718
+ cpu=m68k
719
+ vendor=motorola
645
720
  ;;
646
- dpx2* | dpx2*-bull)
647
- basic_machine=m68k-bull
648
- os=-sysv3
649
- ;;
650
- e500v[12])
651
- basic_machine=powerpc-unknown
652
- os=$os"spe"
653
- ;;
654
- e500v[12]-*)
655
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
656
- os=$os"spe"
657
- ;;
658
- ebmon29k)
659
- basic_machine=a29k-amd
660
- os=-ebmon
661
- ;;
662
- elxsi)
663
- basic_machine=elxsi-elxsi
664
- os=-bsd
721
+ dpx2*)
722
+ cpu=m68k
723
+ vendor=bull
724
+ basic_os=sysv3
665
725
  ;;
666
726
  encore | umax | mmax)
667
- basic_machine=ns32k-encore
727
+ cpu=ns32k
728
+ vendor=encore
668
729
  ;;
669
- es1800 | OSE68k | ose68k | ose | OSE)
670
- basic_machine=m68k-ericsson
671
- os=-ose
730
+ elxsi)
731
+ cpu=elxsi
732
+ vendor=elxsi
733
+ basic_os=${basic_os:-bsd}
672
734
  ;;
673
735
  fx2800)
674
- basic_machine=i860-alliant
736
+ cpu=i860
737
+ vendor=alliant
675
738
  ;;
676
739
  genix)
677
- basic_machine=ns32k-ns
678
- ;;
679
- gmicro)
680
- basic_machine=tron-gmicro
681
- os=-sysv
682
- ;;
683
- go32)
684
- basic_machine=i386-pc
685
- os=-go32
740
+ cpu=ns32k
741
+ vendor=ns
686
742
  ;;
687
743
  h3050r* | hiux*)
688
- basic_machine=hppa1.1-hitachi
689
- os=-hiuxwe2
690
- ;;
691
- h8300hms)
692
- basic_machine=h8300-hitachi
693
- os=-hms
694
- ;;
695
- h8300xray)
696
- basic_machine=h8300-hitachi
697
- os=-xray
698
- ;;
699
- h8500hms)
700
- basic_machine=h8500-hitachi
701
- os=-hms
702
- ;;
703
- harris)
704
- basic_machine=m88k-harris
705
- os=-sysv3
706
- ;;
707
- hp300-*)
708
- basic_machine=m68k-hp
709
- ;;
710
- hp300bsd)
711
- basic_machine=m68k-hp
712
- os=-bsd
713
- ;;
714
- hp300hpux)
715
- basic_machine=m68k-hp
716
- os=-hpux
744
+ cpu=hppa1.1
745
+ vendor=hitachi
746
+ basic_os=hiuxwe2
717
747
  ;;
718
748
  hp3k9[0-9][0-9] | hp9[0-9][0-9])
719
- basic_machine=hppa1.0-hp
749
+ cpu=hppa1.0
750
+ vendor=hp
720
751
  ;;
721
752
  hp9k2[0-9][0-9] | hp9k31[0-9])
722
- basic_machine=m68000-hp
753
+ cpu=m68000
754
+ vendor=hp
723
755
  ;;
724
756
  hp9k3[2-9][0-9])
725
- basic_machine=m68k-hp
757
+ cpu=m68k
758
+ vendor=hp
726
759
  ;;
727
760
  hp9k6[0-9][0-9] | hp6[0-9][0-9])
728
- basic_machine=hppa1.0-hp
761
+ cpu=hppa1.0
762
+ vendor=hp
729
763
  ;;
730
764
  hp9k7[0-79][0-9] | hp7[0-79][0-9])
731
- basic_machine=hppa1.1-hp
765
+ cpu=hppa1.1
766
+ vendor=hp
732
767
  ;;
733
768
  hp9k78[0-9] | hp78[0-9])
734
769
  # FIXME: really hppa2.0-hp
735
- basic_machine=hppa1.1-hp
770
+ cpu=hppa1.1
771
+ vendor=hp
736
772
  ;;
737
773
  hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
738
774
  # FIXME: really hppa2.0-hp
739
- basic_machine=hppa1.1-hp
775
+ cpu=hppa1.1
776
+ vendor=hp
740
777
  ;;
741
778
  hp9k8[0-9][13679] | hp8[0-9][13679])
742
- basic_machine=hppa1.1-hp
779
+ cpu=hppa1.1
780
+ vendor=hp
743
781
  ;;
744
782
  hp9k8[0-9][0-9] | hp8[0-9][0-9])
745
- basic_machine=hppa1.0-hp
746
- ;;
747
- hppa-next)
748
- os=-nextstep3
749
- ;;
750
- hppaosf)
751
- basic_machine=hppa1.1-hp
752
- os=-osf
753
- ;;
754
- hppro)
755
- basic_machine=hppa1.1-hp
756
- os=-proelf
757
- ;;
758
- i370-ibm* | ibm*)
759
- basic_machine=i370-ibm
783
+ cpu=hppa1.0
784
+ vendor=hp
760
785
  ;;
761
786
  i*86v32)
762
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
763
- os=-sysv32
787
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
788
+ vendor=pc
789
+ basic_os=sysv32
764
790
  ;;
765
791
  i*86v4*)
766
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
767
- os=-sysv4
792
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
793
+ vendor=pc
794
+ basic_os=sysv4
768
795
  ;;
769
796
  i*86v)
770
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
771
- os=-sysv
797
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
798
+ vendor=pc
799
+ basic_os=sysv
772
800
  ;;
773
801
  i*86sol2)
774
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
775
- os=-solaris2
776
- ;;
777
- i386mach)
778
- basic_machine=i386-mach
779
- os=-mach
802
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
803
+ vendor=pc
804
+ basic_os=solaris2
780
805
  ;;
781
- i386-vsta | vsta)
782
- basic_machine=i386-unknown
783
- os=-vsta
806
+ j90 | j90-cray)
807
+ cpu=j90
808
+ vendor=cray
809
+ basic_os=${basic_os:-unicos}
784
810
  ;;
785
811
  iris | iris4d)
786
- basic_machine=mips-sgi
787
- case $os in
788
- -irix*)
812
+ cpu=mips
813
+ vendor=sgi
814
+ case $basic_os in
815
+ irix*)
789
816
  ;;
790
817
  *)
791
- os=-irix4
818
+ basic_os=irix4
792
819
  ;;
793
820
  esac
794
821
  ;;
795
- isi68 | isi)
796
- basic_machine=m68k-isi
797
- os=-sysv
798
- ;;
799
- leon-*|leon[3-9]-*)
800
- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
801
- ;;
802
- m68knommu)
803
- basic_machine=m68k-unknown
804
- os=-linux
805
- ;;
806
- m68knommu-*)
807
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
808
- os=-linux
809
- ;;
810
- m88k-omron*)
811
- basic_machine=m88k-omron
812
- ;;
813
- magnum | m3230)
814
- basic_machine=mips-mips
815
- os=-sysv
816
- ;;
817
- merlin)
818
- basic_machine=ns32k-utek
819
- os=-sysv
820
- ;;
821
- microblaze*)
822
- basic_machine=microblaze-xilinx
823
- ;;
824
- mingw64)
825
- basic_machine=x86_64-pc
826
- os=-mingw64
827
- ;;
828
- mingw32)
829
- basic_machine=i686-pc
830
- os=-mingw32
831
- ;;
832
- mingw32ce)
833
- basic_machine=arm-unknown
834
- os=-mingw32ce
835
- ;;
836
822
  miniframe)
837
- basic_machine=m68000-convergent
823
+ cpu=m68000
824
+ vendor=convergent
838
825
  ;;
839
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
840
- basic_machine=m68k-atari
841
- os=-mint
842
- ;;
843
- mips3*-*)
844
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
845
- ;;
846
- mips3*)
847
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
848
- ;;
849
- monitor)
850
- basic_machine=m68k-rom68k
851
- os=-coff
852
- ;;
853
- morphos)
854
- basic_machine=powerpc-unknown
855
- os=-morphos
856
- ;;
857
- moxiebox)
858
- basic_machine=moxie-unknown
859
- os=-moxiebox
860
- ;;
861
- msdos)
862
- basic_machine=i386-pc
863
- os=-msdos
864
- ;;
865
- ms1-*)
866
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
867
- ;;
868
- msys)
869
- basic_machine=i686-pc
870
- os=-msys
871
- ;;
872
- mvs)
873
- basic_machine=i370-ibm
874
- os=-mvs
875
- ;;
876
- nacl)
877
- basic_machine=le32-unknown
878
- os=-nacl
879
- ;;
880
- ncr3000)
881
- basic_machine=i486-ncr
882
- os=-sysv4
883
- ;;
884
- netbsd386)
885
- basic_machine=i386-unknown
886
- os=-netbsd
887
- ;;
888
- netwinder)
889
- basic_machine=armv4l-rebel
890
- os=-linux
891
- ;;
892
- news | news700 | news800 | news900)
893
- basic_machine=m68k-sony
894
- os=-newsos
895
- ;;
896
- news1000)
897
- basic_machine=m68030-sony
898
- os=-newsos
826
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
827
+ cpu=m68k
828
+ vendor=atari
829
+ basic_os=mint
899
830
  ;;
900
831
  news-3600 | risc-news)
901
- basic_machine=mips-sony
902
- os=-newsos
903
- ;;
904
- necv70)
905
- basic_machine=v70-nec
906
- os=-sysv
907
- ;;
908
- next | m*-next )
909
- basic_machine=m68k-next
910
- case $os in
911
- -nextstep* )
832
+ cpu=mips
833
+ vendor=sony
834
+ basic_os=newsos
835
+ ;;
836
+ next | m*-next)
837
+ cpu=m68k
838
+ vendor=next
839
+ case $basic_os in
840
+ openstep*)
841
+ ;;
842
+ nextstep*)
912
843
  ;;
913
- -ns2*)
914
- os=-nextstep2
844
+ ns2*)
845
+ basic_os=nextstep2
915
846
  ;;
916
847
  *)
917
- os=-nextstep3
848
+ basic_os=nextstep3
918
849
  ;;
919
850
  esac
920
851
  ;;
921
- nh3000)
922
- basic_machine=m68k-harris
923
- os=-cxux
924
- ;;
925
- nh[45]000)
926
- basic_machine=m88k-harris
927
- os=-cxux
928
- ;;
929
- nindy960)
930
- basic_machine=i960-intel
931
- os=-nindy
932
- ;;
933
- mon960)
934
- basic_machine=i960-intel
935
- os=-mon960
936
- ;;
937
- nonstopux)
938
- basic_machine=mips-compaq
939
- os=-nonstopux
940
- ;;
941
852
  np1)
942
- basic_machine=np1-gould
943
- ;;
944
- neo-tandem)
945
- basic_machine=neo-tandem
946
- ;;
947
- nse-tandem)
948
- basic_machine=nse-tandem
949
- ;;
950
- nsr-tandem)
951
- basic_machine=nsr-tandem
952
- ;;
953
- nsx-tandem)
954
- basic_machine=nsx-tandem
853
+ cpu=np1
854
+ vendor=gould
955
855
  ;;
956
856
  op50n-* | op60c-*)
957
- basic_machine=hppa1.1-oki
958
- os=-proelf
959
- ;;
960
- openrisc | openrisc-*)
961
- basic_machine=or32-unknown
962
- ;;
963
- os400)
964
- basic_machine=powerpc-ibm
965
- os=-os400
966
- ;;
967
- OSE68000 | ose68000)
968
- basic_machine=m68000-ericsson
969
- os=-ose
970
- ;;
971
- os68k)
972
- basic_machine=m68k-none
973
- os=-os68k
857
+ cpu=hppa1.1
858
+ vendor=oki
859
+ basic_os=proelf
974
860
  ;;
975
861
  pa-hitachi)
976
- basic_machine=hppa1.1-hitachi
977
- os=-hiuxwe2
978
- ;;
979
- paragon)
980
- basic_machine=i860-intel
981
- os=-osf
982
- ;;
983
- parisc)
984
- basic_machine=hppa-unknown
985
- os=-linux
986
- ;;
987
- parisc-*)
988
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
989
- os=-linux
862
+ cpu=hppa1.1
863
+ vendor=hitachi
864
+ basic_os=hiuxwe2
990
865
  ;;
991
866
  pbd)
992
- basic_machine=sparc-tti
867
+ cpu=sparc
868
+ vendor=tti
993
869
  ;;
994
870
  pbb)
995
- basic_machine=m68k-tti
996
- ;;
997
- pc532 | pc532-*)
998
- basic_machine=ns32k-pc532
871
+ cpu=m68k
872
+ vendor=tti
999
873
  ;;
1000
- pc98)
1001
- basic_machine=i386-pc
1002
- ;;
1003
- pc98-*)
1004
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
1005
- ;;
1006
- pentium | p5 | k5 | k6 | nexgen | viac3)
1007
- basic_machine=i586-pc
1008
- ;;
1009
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
1010
- basic_machine=i686-pc
1011
- ;;
1012
- pentiumii | pentium2 | pentiumiii | pentium3)
1013
- basic_machine=i686-pc
1014
- ;;
1015
- pentium4)
1016
- basic_machine=i786-pc
1017
- ;;
1018
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1019
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
1020
- ;;
1021
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
1022
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1023
- ;;
1024
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1025
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1026
- ;;
1027
- pentium4-*)
1028
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
874
+ pc532)
875
+ cpu=ns32k
876
+ vendor=pc532
1029
877
  ;;
1030
878
  pn)
1031
- basic_machine=pn-gould
879
+ cpu=pn
880
+ vendor=gould
1032
881
  ;;
1033
- power) basic_machine=power-ibm
1034
- ;;
1035
- ppc | ppcbe) basic_machine=powerpc-unknown
1036
- ;;
1037
- ppc-* | ppcbe-*)
1038
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1039
- ;;
1040
- ppcle | powerpclittle)
1041
- basic_machine=powerpcle-unknown
1042
- ;;
1043
- ppcle-* | powerpclittle-*)
1044
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
1045
- ;;
1046
- ppc64) basic_machine=powerpc64-unknown
1047
- ;;
1048
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
1049
- ;;
1050
- ppc64le | powerpc64little)
1051
- basic_machine=powerpc64le-unknown
1052
- ;;
1053
- ppc64le-* | powerpc64little-*)
1054
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
882
+ power)
883
+ cpu=power
884
+ vendor=ibm
1055
885
  ;;
1056
886
  ps2)
1057
- basic_machine=i386-ibm
1058
- ;;
1059
- pw32)
1060
- basic_machine=i586-unknown
1061
- os=-pw32
1062
- ;;
1063
- rdos | rdos64)
1064
- basic_machine=x86_64-pc
1065
- os=-rdos
1066
- ;;
1067
- rdos32)
1068
- basic_machine=i386-pc
1069
- os=-rdos
1070
- ;;
1071
- rom68k)
1072
- basic_machine=m68k-rom68k
1073
- os=-coff
887
+ cpu=i386
888
+ vendor=ibm
1074
889
  ;;
1075
890
  rm[46]00)
1076
- basic_machine=mips-siemens
891
+ cpu=mips
892
+ vendor=siemens
1077
893
  ;;
1078
894
  rtpc | rtpc-*)
1079
- basic_machine=romp-ibm
1080
- ;;
1081
- s390 | s390-*)
1082
- basic_machine=s390-ibm
1083
- ;;
1084
- s390x | s390x-*)
1085
- basic_machine=s390x-ibm
895
+ cpu=romp
896
+ vendor=ibm
1086
897
  ;;
1087
- sa29200)
1088
- basic_machine=a29k-amd
1089
- os=-udi
1090
- ;;
1091
- sb1)
1092
- basic_machine=mipsisa64sb1-unknown
898
+ sde)
899
+ cpu=mipsisa32
900
+ vendor=sde
901
+ basic_os=${basic_os:-elf}
1093
902
  ;;
1094
- sb1el)
1095
- basic_machine=mipsisa64sb1el-unknown
903
+ simso-wrs)
904
+ cpu=sparclite
905
+ vendor=wrs
906
+ basic_os=vxworks
1096
907
  ;;
1097
- sde)
1098
- basic_machine=mipsisa32-sde
1099
- os=-elf
908
+ tower | tower-32)
909
+ cpu=m68k
910
+ vendor=ncr
1100
911
  ;;
1101
- sei)
1102
- basic_machine=mips-sei
1103
- os=-seiux
912
+ vpp*|vx|vx-*)
913
+ cpu=f301
914
+ vendor=fujitsu
1104
915
  ;;
1105
- sequent)
1106
- basic_machine=i386-sequent
916
+ w65)
917
+ cpu=w65
918
+ vendor=wdc
1107
919
  ;;
1108
- sh)
1109
- basic_machine=sh-hitachi
1110
- os=-hms
920
+ w89k-*)
921
+ cpu=hppa1.1
922
+ vendor=winbond
923
+ basic_os=proelf
1111
924
  ;;
1112
- sh5el)
1113
- basic_machine=sh5le-unknown
925
+ none)
926
+ cpu=none
927
+ vendor=none
1114
928
  ;;
1115
- sh64)
1116
- basic_machine=sh64-unknown
929
+ leon|leon[3-9])
930
+ cpu=sparc
931
+ vendor=$basic_machine
1117
932
  ;;
1118
- sparclite-wrs | simso-wrs)
1119
- basic_machine=sparclite-wrs
1120
- os=-vxworks
933
+ leon-*|leon[3-9]-*)
934
+ cpu=sparc
935
+ vendor=`echo "$basic_machine" | sed 's/-.*//'`
1121
936
  ;;
1122
- sps7)
1123
- basic_machine=m68k-bull
1124
- os=-sysv2
937
+
938
+ *-*)
939
+ # shellcheck disable=SC2162
940
+ saved_IFS=$IFS
941
+ IFS="-" read cpu vendor <<EOF
942
+ $basic_machine
943
+ EOF
944
+ IFS=$saved_IFS
1125
945
  ;;
1126
- spur)
1127
- basic_machine=spur-unknown
946
+ # We use `pc' rather than `unknown'
947
+ # because (1) that's what they normally are, and
948
+ # (2) the word "unknown" tends to confuse beginning users.
949
+ i*86 | x86_64)
950
+ cpu=$basic_machine
951
+ vendor=pc
1128
952
  ;;
1129
- st2000)
1130
- basic_machine=m68k-tandem
953
+ # These rules are duplicated from below for sake of the special case above;
954
+ # i.e. things that normalized to x86 arches should also default to "pc"
955
+ pc98)
956
+ cpu=i386
957
+ vendor=pc
1131
958
  ;;
1132
- stratus)
1133
- basic_machine=i860-stratus
1134
- os=-sysv4
959
+ x64 | amd64)
960
+ cpu=x86_64
961
+ vendor=pc
1135
962
  ;;
1136
- strongarm-* | thumb-*)
1137
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
963
+ # Recognize the basic CPU types without company name.
964
+ *)
965
+ cpu=$basic_machine
966
+ vendor=unknown
1138
967
  ;;
1139
- sun2)
1140
- basic_machine=m68000-sun
968
+ esac
969
+
970
+ unset -v basic_machine
971
+
972
+ # Decode basic machines in the full and proper CPU-Company form.
973
+ case $cpu-$vendor in
974
+ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
975
+ # some cases the only manufacturer, in others, it is the most popular.
976
+ craynv-unknown)
977
+ vendor=cray
978
+ basic_os=${basic_os:-unicosmp}
1141
979
  ;;
1142
- sun2os3)
1143
- basic_machine=m68000-sun
1144
- os=-sunos3
980
+ c90-unknown | c90-cray)
981
+ vendor=cray
982
+ basic_os=${Basic_os:-unicos}
1145
983
  ;;
1146
- sun2os4)
1147
- basic_machine=m68000-sun
1148
- os=-sunos4
984
+ fx80-unknown)
985
+ vendor=alliant
1149
986
  ;;
1150
- sun3os3)
1151
- basic_machine=m68k-sun
1152
- os=-sunos3
987
+ romp-unknown)
988
+ vendor=ibm
1153
989
  ;;
1154
- sun3os4)
1155
- basic_machine=m68k-sun
1156
- os=-sunos4
990
+ mmix-unknown)
991
+ vendor=knuth
1157
992
  ;;
1158
- sun4os3)
1159
- basic_machine=sparc-sun
1160
- os=-sunos3
993
+ microblaze-unknown | microblazeel-unknown)
994
+ vendor=xilinx
1161
995
  ;;
1162
- sun4os4)
1163
- basic_machine=sparc-sun
1164
- os=-sunos4
996
+ rs6000-unknown)
997
+ vendor=ibm
1165
998
  ;;
1166
- sun4sol2)
1167
- basic_machine=sparc-sun
1168
- os=-solaris2
999
+ vax-unknown)
1000
+ vendor=dec
1169
1001
  ;;
1170
- sun3 | sun3-*)
1171
- basic_machine=m68k-sun
1002
+ pdp11-unknown)
1003
+ vendor=dec
1172
1004
  ;;
1173
- sun4)
1174
- basic_machine=sparc-sun
1005
+ we32k-unknown)
1006
+ vendor=att
1175
1007
  ;;
1176
- sun386 | sun386i | roadrunner)
1177
- basic_machine=i386-sun
1008
+ cydra-unknown)
1009
+ vendor=cydrome
1178
1010
  ;;
1179
- sv1)
1180
- basic_machine=sv1-cray
1181
- os=-unicos
1011
+ i370-ibm*)
1012
+ vendor=ibm
1182
1013
  ;;
1183
- symmetry)
1184
- basic_machine=i386-sequent
1185
- os=-dynix
1014
+ orion-unknown)
1015
+ vendor=highlevel
1186
1016
  ;;
1187
- t3e)
1188
- basic_machine=alphaev5-cray
1189
- os=-unicos
1017
+ xps-unknown | xps100-unknown)
1018
+ cpu=xps100
1019
+ vendor=honeywell
1190
1020
  ;;
1191
- t90)
1192
- basic_machine=t90-cray
1193
- os=-unicos
1021
+
1022
+ # Here we normalize CPU types with a missing or matching vendor
1023
+ armh-unknown | armh-alt)
1024
+ cpu=armv7l
1025
+ vendor=alt
1026
+ basic_os=${basic_os:-linux-gnueabihf}
1194
1027
  ;;
1195
- tile*)
1196
- basic_machine=$basic_machine-unknown
1197
- os=-linux-gnu
1028
+ dpx20-unknown | dpx20-bull)
1029
+ cpu=rs6000
1030
+ vendor=bull
1031
+ basic_os=${basic_os:-bosx}
1198
1032
  ;;
1199
- tx39)
1200
- basic_machine=mipstx39-unknown
1033
+
1034
+ # Here we normalize CPU types irrespective of the vendor
1035
+ amd64-*)
1036
+ cpu=x86_64
1201
1037
  ;;
1202
- tx39el)
1203
- basic_machine=mipstx39el-unknown
1038
+ blackfin-*)
1039
+ cpu=bfin
1040
+ basic_os=linux
1204
1041
  ;;
1205
- toad1)
1206
- basic_machine=pdp10-xkl
1207
- os=-tops20
1042
+ c54x-*)
1043
+ cpu=tic54x
1208
1044
  ;;
1209
- tower | tower-32)
1210
- basic_machine=m68k-ncr
1045
+ c55x-*)
1046
+ cpu=tic55x
1211
1047
  ;;
1212
- tpf)
1213
- basic_machine=s390x-ibm
1214
- os=-tpf
1048
+ c6x-*)
1049
+ cpu=tic6x
1215
1050
  ;;
1216
- udi29k)
1217
- basic_machine=a29k-amd
1218
- os=-udi
1051
+ e500v[12]-*)
1052
+ cpu=powerpc
1053
+ basic_os=${basic_os}"spe"
1219
1054
  ;;
1220
- ultra3)
1221
- basic_machine=a29k-nyu
1222
- os=-sym1
1055
+ mips3*-*)
1056
+ cpu=mips64
1223
1057
  ;;
1224
- v810 | necv810)
1225
- basic_machine=v810-nec
1226
- os=-none
1058
+ ms1-*)
1059
+ cpu=mt
1227
1060
  ;;
1228
- vaxv)
1229
- basic_machine=vax-dec
1230
- os=-sysv
1061
+ m68knommu-*)
1062
+ cpu=m68k
1063
+ basic_os=linux
1231
1064
  ;;
1232
- vms)
1233
- basic_machine=vax-dec
1234
- os=-vms
1065
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
1066
+ cpu=s12z
1235
1067
  ;;
1236
- vpp*|vx|vx-*)
1237
- basic_machine=f301-fujitsu
1068
+ openrisc-*)
1069
+ cpu=or32
1238
1070
  ;;
1239
- vxworks960)
1240
- basic_machine=i960-wrs
1241
- os=-vxworks
1071
+ parisc-*)
1072
+ cpu=hppa
1073
+ basic_os=linux
1242
1074
  ;;
1243
- vxworks68)
1244
- basic_machine=m68k-wrs
1245
- os=-vxworks
1075
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1076
+ cpu=i586
1246
1077
  ;;
1247
- vxworks29k)
1248
- basic_machine=a29k-wrs
1249
- os=-vxworks
1078
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
1079
+ cpu=i686
1250
1080
  ;;
1251
- wasm32)
1252
- basic_machine=wasm32-unknown
1081
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1082
+ cpu=i686
1253
1083
  ;;
1254
- w65*)
1255
- basic_machine=w65-wdc
1256
- os=-none
1084
+ pentium4-*)
1085
+ cpu=i786
1257
1086
  ;;
1258
- w89k-*)
1259
- basic_machine=hppa1.1-winbond
1260
- os=-proelf
1087
+ pc98-*)
1088
+ cpu=i386
1261
1089
  ;;
1262
- xbox)
1263
- basic_machine=i686-pc
1264
- os=-mingw32
1090
+ ppc-* | ppcbe-*)
1091
+ cpu=powerpc
1265
1092
  ;;
1266
- xps | xps100)
1267
- basic_machine=xps100-honeywell
1093
+ ppcle-* | powerpclittle-*)
1094
+ cpu=powerpcle
1268
1095
  ;;
1269
- xscale-* | xscalee[bl]-*)
1270
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1096
+ ppc64-*)
1097
+ cpu=powerpc64
1271
1098
  ;;
1272
- ymp)
1273
- basic_machine=ymp-cray
1274
- os=-unicos
1099
+ ppc64le-* | powerpc64little-*)
1100
+ cpu=powerpc64le
1275
1101
  ;;
1276
- z8k-*-coff)
1277
- basic_machine=z8k-unknown
1278
- os=-sim
1102
+ sb1-*)
1103
+ cpu=mipsisa64sb1
1279
1104
  ;;
1280
- z80-*-coff)
1281
- basic_machine=z80-unknown
1282
- os=-sim
1105
+ sb1el-*)
1106
+ cpu=mipsisa64sb1el
1283
1107
  ;;
1284
- none)
1285
- basic_machine=none-none
1286
- os=-none
1108
+ sh5e[lb]-*)
1109
+ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
1287
1110
  ;;
1288
-
1289
- # Here we handle the default manufacturer of certain CPU types. It is in
1290
- # some cases the only manufacturer, in others, it is the most popular.
1291
- w89k)
1292
- basic_machine=hppa1.1-winbond
1111
+ spur-*)
1112
+ cpu=spur
1293
1113
  ;;
1294
- op50n)
1295
- basic_machine=hppa1.1-oki
1114
+ strongarm-* | thumb-*)
1115
+ cpu=arm
1296
1116
  ;;
1297
- op60c)
1298
- basic_machine=hppa1.1-oki
1117
+ tx39-*)
1118
+ cpu=mipstx39
1299
1119
  ;;
1300
- romp)
1301
- basic_machine=romp-ibm
1120
+ tx39el-*)
1121
+ cpu=mipstx39el
1302
1122
  ;;
1303
- mmix)
1304
- basic_machine=mmix-knuth
1123
+ x64-*)
1124
+ cpu=x86_64
1305
1125
  ;;
1306
- rs6000)
1307
- basic_machine=rs6000-ibm
1126
+ xscale-* | xscalee[bl]-*)
1127
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
1308
1128
  ;;
1309
- vax)
1310
- basic_machine=vax-dec
1129
+ arm64-* | arm64_32-* | aarch64le-*)
1130
+ cpu=aarch64
1311
1131
  ;;
1312
- pdp10)
1313
- # there are many clones, so DEC is not a safe bet
1314
- basic_machine=pdp10-unknown
1132
+
1133
+ # Recognize the canonical CPU Types that limit and/or modify the
1134
+ # company names they are paired with.
1135
+ cr16-*)
1136
+ basic_os=${basic_os:-elf}
1315
1137
  ;;
1316
- pdp11)
1317
- basic_machine=pdp11-dec
1138
+ crisv32-* | etraxfs*-*)
1139
+ cpu=crisv32
1140
+ vendor=axis
1318
1141
  ;;
1319
- we32k)
1320
- basic_machine=we32k-att
1142
+ cris-* | etrax*-*)
1143
+ cpu=cris
1144
+ vendor=axis
1321
1145
  ;;
1322
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1323
- basic_machine=sh-unknown
1146
+ crx-*)
1147
+ basic_os=${basic_os:-elf}
1324
1148
  ;;
1325
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1326
- basic_machine=sparc-sun
1149
+ neo-tandem)
1150
+ cpu=neo
1151
+ vendor=tandem
1327
1152
  ;;
1328
- cydra)
1329
- basic_machine=cydra-cydrome
1153
+ nse-tandem)
1154
+ cpu=nse
1155
+ vendor=tandem
1330
1156
  ;;
1331
- orion)
1332
- basic_machine=orion-highlevel
1157
+ nsr-tandem)
1158
+ cpu=nsr
1159
+ vendor=tandem
1333
1160
  ;;
1334
- orion105)
1335
- basic_machine=clipper-highlevel
1161
+ nsv-tandem)
1162
+ cpu=nsv
1163
+ vendor=tandem
1336
1164
  ;;
1337
- mac | mpw | mac-mpw)
1338
- basic_machine=m68k-apple
1165
+ nsx-tandem)
1166
+ cpu=nsx
1167
+ vendor=tandem
1339
1168
  ;;
1340
- pmac | pmac-mpw)
1341
- basic_machine=powerpc-apple
1169
+ mipsallegrexel-sony)
1170
+ cpu=mipsallegrexel
1171
+ vendor=sony
1342
1172
  ;;
1343
- *-unknown)
1344
- # Make sure to match an already-canonicalized machine name.
1173
+ tile*-*)
1174
+ basic_os=${basic_os:-linux-gnu}
1345
1175
  ;;
1176
+
1346
1177
  *)
1347
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1348
- exit 1
1178
+ # Recognize the canonical CPU types that are allowed with any
1179
+ # company name.
1180
+ case $cpu in
1181
+ 1750a | 580 \
1182
+ | a29k \
1183
+ | aarch64 | aarch64_be \
1184
+ | abacus \
1185
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
1186
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
1187
+ | alphapca5[67] | alpha64pca5[67] \
1188
+ | am33_2.0 \
1189
+ | amdgcn \
1190
+ | arc | arceb | arc32 | arc64 \
1191
+ | arm | arm[lb]e | arme[lb] | armv* \
1192
+ | avr | avr32 \
1193
+ | asmjs \
1194
+ | ba \
1195
+ | be32 | be64 \
1196
+ | bfin | bpf | bs2000 \
1197
+ | c[123]* | c30 | [cjt]90 | c4x \
1198
+ | c8051 | clipper | craynv | csky | cydra \
1199
+ | d10v | d30v | dlx | dsp16xx \
1200
+ | e2k | elxsi | epiphany \
1201
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
1202
+ | h8300 | h8500 \
1203
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1204
+ | hexagon \
1205
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
1206
+ | ip2k | iq2000 \
1207
+ | k1om \
1208
+ | le32 | le64 \
1209
+ | lm32 \
1210
+ | loongarch32 | loongarch64 | loongarchx32 \
1211
+ | m32c | m32r | m32rle \
1212
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
1213
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1214
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
1215
+ | microblaze | microblazeel \
1216
+ | mips | mipsbe | mipseb | mipsel | mipsle \
1217
+ | mips16 \
1218
+ | mips64 | mips64eb | mips64el \
1219
+ | mips64octeon | mips64octeonel \
1220
+ | mips64orion | mips64orionel \
1221
+ | mips64r5900 | mips64r5900el \
1222
+ | mips64vr | mips64vrel \
1223
+ | mips64vr4100 | mips64vr4100el \
1224
+ | mips64vr4300 | mips64vr4300el \
1225
+ | mips64vr5000 | mips64vr5000el \
1226
+ | mips64vr5900 | mips64vr5900el \
1227
+ | mipsisa32 | mipsisa32el \
1228
+ | mipsisa32r2 | mipsisa32r2el \
1229
+ | mipsisa32r3 | mipsisa32r3el \
1230
+ | mipsisa32r5 | mipsisa32r5el \
1231
+ | mipsisa32r6 | mipsisa32r6el \
1232
+ | mipsisa64 | mipsisa64el \
1233
+ | mipsisa64r2 | mipsisa64r2el \
1234
+ | mipsisa64r3 | mipsisa64r3el \
1235
+ | mipsisa64r5 | mipsisa64r5el \
1236
+ | mipsisa64r6 | mipsisa64r6el \
1237
+ | mipsisa64sb1 | mipsisa64sb1el \
1238
+ | mipsisa64sr71k | mipsisa64sr71kel \
1239
+ | mipsr5900 | mipsr5900el \
1240
+ | mipstx39 | mipstx39el \
1241
+ | mmix \
1242
+ | mn10200 | mn10300 \
1243
+ | moxie \
1244
+ | mt \
1245
+ | msp430 \
1246
+ | nds32 | nds32le | nds32be \
1247
+ | nfp \
1248
+ | nios | nios2 | nios2eb | nios2el \
1249
+ | none | np1 | ns16k | ns32k | nvptx \
1250
+ | open8 \
1251
+ | or1k* \
1252
+ | or32 \
1253
+ | orion \
1254
+ | picochip \
1255
+ | pdp10 | pdp11 | pj | pjl | pn | power \
1256
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
1257
+ | pru \
1258
+ | pyramid \
1259
+ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
1260
+ | rl78 | romp | rs6000 | rx \
1261
+ | s390 | s390x \
1262
+ | score \
1263
+ | sh | shl \
1264
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
1265
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
1266
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
1267
+ | sparclite \
1268
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
1269
+ | spu \
1270
+ | tahoe \
1271
+ | thumbv7* \
1272
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
1273
+ | tron \
1274
+ | ubicom32 \
1275
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1276
+ | vax \
1277
+ | visium \
1278
+ | w65 \
1279
+ | wasm32 | wasm64 \
1280
+ | we32k \
1281
+ | x86 | x86_64 | xc16x | xgate | xps100 \
1282
+ | xstormy16 | xtensa* \
1283
+ | ymp \
1284
+ | z8k | z80)
1285
+ ;;
1286
+
1287
+ *)
1288
+ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
1289
+ exit 1
1290
+ ;;
1291
+ esac
1349
1292
  ;;
1350
1293
  esac
1351
1294
 
1352
1295
  # Here we canonicalize certain aliases for manufacturers.
1353
- case $basic_machine in
1354
- *-digital*)
1355
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1296
+ case $vendor in
1297
+ digital*)
1298
+ vendor=dec
1356
1299
  ;;
1357
- *-commodore*)
1358
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1300
+ commodore*)
1301
+ vendor=cbm
1359
1302
  ;;
1360
1303
  *)
1361
1304
  ;;
@@ -1363,203 +1306,215 @@ esac
1363
1306
 
1364
1307
  # Decode manufacturer-specific aliases for certain operating systems.
1365
1308
 
1366
- if [ x"$os" != x"" ]
1309
+ if test x$basic_os != x
1367
1310
  then
1368
- case $os in
1369
- # First match some system type aliases
1370
- # that might get confused with valid system types.
1371
- # -solaris* is a basic system type, with this one exception.
1372
- -auroraux)
1373
- os=-auroraux
1311
+
1312
+ # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
1313
+ # set os.
1314
+ case $basic_os in
1315
+ gnu/linux*)
1316
+ kernel=linux
1317
+ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
1318
+ ;;
1319
+ os2-emx)
1320
+ kernel=os2
1321
+ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
1322
+ ;;
1323
+ nto-qnx*)
1324
+ kernel=nto
1325
+ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
1326
+ ;;
1327
+ *-*)
1328
+ # shellcheck disable=SC2162
1329
+ saved_IFS=$IFS
1330
+ IFS="-" read kernel os <<EOF
1331
+ $basic_os
1332
+ EOF
1333
+ IFS=$saved_IFS
1334
+ ;;
1335
+ # Default OS when just kernel was specified
1336
+ nto*)
1337
+ kernel=nto
1338
+ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
1339
+ ;;
1340
+ linux*)
1341
+ kernel=linux
1342
+ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
1374
1343
  ;;
1375
- -solaris1 | -solaris1.*)
1376
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
1344
+ *)
1345
+ kernel=
1346
+ os=$basic_os
1377
1347
  ;;
1378
- -solaris)
1379
- os=-solaris2
1348
+ esac
1349
+
1350
+ # Now, normalize the OS (knowing we just have one component, it's not a kernel,
1351
+ # etc.)
1352
+ case $os in
1353
+ # First match some system type aliases that might get confused
1354
+ # with valid system types.
1355
+ # solaris* is a basic system type, with this one exception.
1356
+ auroraux)
1357
+ os=auroraux
1380
1358
  ;;
1381
- -svr4*)
1382
- os=-sysv4
1359
+ bluegene*)
1360
+ os=cnk
1383
1361
  ;;
1384
- -unixware*)
1385
- os=-sysv4.2uw
1362
+ solaris1 | solaris1.*)
1363
+ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
1386
1364
  ;;
1387
- -gnu/linux*)
1388
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1365
+ solaris)
1366
+ os=solaris2
1389
1367
  ;;
1390
- # First accept the basic system types.
1391
- # The portable systems comes first.
1392
- # Each alternative MUST END IN A *, to match a version number.
1393
- # -sysv* is not here because it comes later, after sysvr4.
1394
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1395
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1396
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1397
- | -sym* | -kopensolaris* | -plan9* \
1398
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1399
- | -aos* | -aros* | -cloudabi* | -sortix* \
1400
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1401
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1402
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1403
- | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
1404
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1405
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1406
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1407
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1408
- | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
1409
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1410
- | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1411
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1412
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
1413
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1414
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1415
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1416
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1417
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1418
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1419
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1420
- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
1421
- # Remember, each alternative MUST END IN *, to match a version number.
1422
- ;;
1423
- -qnx*)
1424
- case $basic_machine in
1425
- x86-* | i*86-*)
1426
- ;;
1427
- *)
1428
- os=-nto$os
1429
- ;;
1430
- esac
1368
+ unixware*)
1369
+ os=sysv4.2uw
1431
1370
  ;;
1432
- -nto-qnx*)
1371
+ # es1800 is here to avoid being matched by es* (a different OS)
1372
+ es1800*)
1373
+ os=ose
1433
1374
  ;;
1434
- -nto*)
1435
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
1375
+ # Some version numbers need modification
1376
+ chorusos*)
1377
+ os=chorusos
1436
1378
  ;;
1437
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1438
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1439
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1379
+ isc)
1380
+ os=isc2.2
1440
1381
  ;;
1441
- -mac*)
1442
- os=`echo $os | sed -e 's|mac|macos|'`
1382
+ sco6)
1383
+ os=sco5v6
1443
1384
  ;;
1444
- -linux-dietlibc)
1445
- os=-linux-dietlibc
1385
+ sco5)
1386
+ os=sco3.2v5
1446
1387
  ;;
1447
- -linux*)
1448
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
1388
+ sco4)
1389
+ os=sco3.2v4
1449
1390
  ;;
1450
- -sunos5*)
1451
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
1391
+ sco3.2.[4-9]*)
1392
+ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
1452
1393
  ;;
1453
- -sunos6*)
1454
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
1394
+ sco*v* | scout)
1395
+ # Don't match below
1455
1396
  ;;
1456
- -opened*)
1457
- os=-openedition
1397
+ sco*)
1398
+ os=sco3.2v2
1458
1399
  ;;
1459
- -os400*)
1460
- os=-os400
1400
+ psos*)
1401
+ os=psos
1461
1402
  ;;
1462
- -wince*)
1463
- os=-wince
1403
+ qnx*)
1404
+ os=qnx
1464
1405
  ;;
1465
- -osfrose*)
1466
- os=-osfrose
1406
+ hiux*)
1407
+ os=hiuxwe2
1467
1408
  ;;
1468
- -osf*)
1469
- os=-osf
1409
+ lynx*178)
1410
+ os=lynxos178
1470
1411
  ;;
1471
- -utek*)
1472
- os=-bsd
1412
+ lynx*5)
1413
+ os=lynxos5
1473
1414
  ;;
1474
- -dynix*)
1475
- os=-bsd
1415
+ lynxos*)
1416
+ # don't get caught up in next wildcard
1476
1417
  ;;
1477
- -acis*)
1478
- os=-aos
1418
+ lynx*)
1419
+ os=lynxos
1479
1420
  ;;
1480
- -atheos*)
1481
- os=-atheos
1421
+ mac[0-9]*)
1422
+ os=`echo "$os" | sed -e 's|mac|macos|'`
1482
1423
  ;;
1483
- -syllable*)
1484
- os=-syllable
1424
+ opened*)
1425
+ os=openedition
1485
1426
  ;;
1486
- -386bsd)
1487
- os=-bsd
1427
+ os400*)
1428
+ os=os400
1488
1429
  ;;
1489
- -ctix* | -uts*)
1490
- os=-sysv
1430
+ sunos5*)
1431
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1491
1432
  ;;
1492
- -nova*)
1493
- os=-rtmk-nova
1433
+ sunos6*)
1434
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1494
1435
  ;;
1495
- -ns2 )
1496
- os=-nextstep2
1436
+ wince*)
1437
+ os=wince
1497
1438
  ;;
1498
- -nsk*)
1499
- os=-nsk
1439
+ utek*)
1440
+ os=bsd
1500
1441
  ;;
1501
- # Preserve the version number of sinix5.
1502
- -sinix5.*)
1503
- os=`echo $os | sed -e 's|sinix|sysv|'`
1442
+ dynix*)
1443
+ os=bsd
1444
+ ;;
1445
+ acis*)
1446
+ os=aos
1504
1447
  ;;
1505
- -sinix*)
1506
- os=-sysv4
1448
+ atheos*)
1449
+ os=atheos
1507
1450
  ;;
1508
- -tpf*)
1509
- os=-tpf
1451
+ syllable*)
1452
+ os=syllable
1510
1453
  ;;
1511
- -triton*)
1512
- os=-sysv3
1454
+ 386bsd)
1455
+ os=bsd
1513
1456
  ;;
1514
- -oss*)
1515
- os=-sysv3
1457
+ ctix* | uts*)
1458
+ os=sysv
1516
1459
  ;;
1517
- -svr4)
1518
- os=-sysv4
1460
+ nova*)
1461
+ os=rtmk-nova
1519
1462
  ;;
1520
- -svr3)
1521
- os=-sysv3
1463
+ ns2)
1464
+ os=nextstep2
1522
1465
  ;;
1523
- -sysvr4)
1524
- os=-sysv4
1466
+ # Preserve the version number of sinix5.
1467
+ sinix5.*)
1468
+ os=`echo "$os" | sed -e 's|sinix|sysv|'`
1525
1469
  ;;
1526
- # This must come after -sysvr4.
1527
- -sysv*)
1470
+ sinix*)
1471
+ os=sysv4
1528
1472
  ;;
1529
- -ose*)
1530
- os=-ose
1473
+ tpf*)
1474
+ os=tpf
1531
1475
  ;;
1532
- -es1800*)
1533
- os=-ose
1476
+ triton*)
1477
+ os=sysv3
1534
1478
  ;;
1535
- -xenix)
1536
- os=-xenix
1479
+ oss*)
1480
+ os=sysv3
1537
1481
  ;;
1538
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1539
- os=-mint
1482
+ svr4*)
1483
+ os=sysv4
1540
1484
  ;;
1541
- -aros*)
1542
- os=-aros
1485
+ svr3)
1486
+ os=sysv3
1543
1487
  ;;
1544
- -zvmoe)
1545
- os=-zvmoe
1488
+ sysvr4)
1489
+ os=sysv4
1546
1490
  ;;
1547
- -dicos*)
1548
- os=-dicos
1491
+ ose*)
1492
+ os=ose
1549
1493
  ;;
1550
- -nacl*)
1494
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1495
+ os=mint
1551
1496
  ;;
1552
- -ios)
1497
+ dicos*)
1498
+ os=dicos
1553
1499
  ;;
1554
- -none)
1500
+ pikeos*)
1501
+ # Until real need of OS specific support for
1502
+ # particular features comes up, bare metal
1503
+ # configurations are quite functional.
1504
+ case $cpu in
1505
+ arm*)
1506
+ os=eabi
1507
+ ;;
1508
+ *)
1509
+ os=elf
1510
+ ;;
1511
+ esac
1555
1512
  ;;
1556
1513
  *)
1557
- # Get rid of the `-' at the beginning of $os.
1558
- os=`echo $os | sed 's/[^-]*-//'`
1559
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1560
- exit 1
1514
+ # No normalization, but not necessarily accepted, that comes below.
1561
1515
  ;;
1562
1516
  esac
1517
+
1563
1518
  else
1564
1519
 
1565
1520
  # Here we handle the default operating systems that come with various machines.
@@ -1572,264 +1527,365 @@ else
1572
1527
  # will signal an error saying that MANUFACTURER isn't an operating
1573
1528
  # system, and we'll never get to this point.
1574
1529
 
1575
- case $basic_machine in
1530
+ kernel=
1531
+ case $cpu-$vendor in
1576
1532
  score-*)
1577
- os=-elf
1533
+ os=elf
1578
1534
  ;;
1579
1535
  spu-*)
1580
- os=-elf
1536
+ os=elf
1581
1537
  ;;
1582
1538
  *-acorn)
1583
- os=-riscix1.2
1539
+ os=riscix1.2
1584
1540
  ;;
1585
1541
  arm*-rebel)
1586
- os=-linux
1542
+ kernel=linux
1543
+ os=gnu
1587
1544
  ;;
1588
1545
  arm*-semi)
1589
- os=-aout
1546
+ os=aout
1590
1547
  ;;
1591
1548
  c4x-* | tic4x-*)
1592
- os=-coff
1549
+ os=coff
1593
1550
  ;;
1594
1551
  c8051-*)
1595
- os=-elf
1552
+ os=elf
1553
+ ;;
1554
+ clipper-intergraph)
1555
+ os=clix
1596
1556
  ;;
1597
1557
  hexagon-*)
1598
- os=-elf
1558
+ os=elf
1599
1559
  ;;
1600
1560
  tic54x-*)
1601
- os=-coff
1561
+ os=coff
1602
1562
  ;;
1603
1563
  tic55x-*)
1604
- os=-coff
1564
+ os=coff
1605
1565
  ;;
1606
1566
  tic6x-*)
1607
- os=-coff
1567
+ os=coff
1608
1568
  ;;
1609
1569
  # This must come before the *-dec entry.
1610
1570
  pdp10-*)
1611
- os=-tops20
1571
+ os=tops20
1612
1572
  ;;
1613
1573
  pdp11-*)
1614
- os=-none
1574
+ os=none
1615
1575
  ;;
1616
1576
  *-dec | vax-*)
1617
- os=-ultrix4.2
1577
+ os=ultrix4.2
1618
1578
  ;;
1619
1579
  m68*-apollo)
1620
- os=-domain
1580
+ os=domain
1621
1581
  ;;
1622
1582
  i386-sun)
1623
- os=-sunos4.0.2
1583
+ os=sunos4.0.2
1624
1584
  ;;
1625
1585
  m68000-sun)
1626
- os=-sunos3
1586
+ os=sunos3
1627
1587
  ;;
1628
1588
  m68*-cisco)
1629
- os=-aout
1589
+ os=aout
1630
1590
  ;;
1631
1591
  mep-*)
1632
- os=-elf
1592
+ os=elf
1633
1593
  ;;
1634
1594
  mips*-cisco)
1635
- os=-elf
1595
+ os=elf
1636
1596
  ;;
1637
1597
  mips*-*)
1638
- os=-elf
1598
+ os=elf
1639
1599
  ;;
1640
1600
  or32-*)
1641
- os=-coff
1601
+ os=coff
1642
1602
  ;;
1643
1603
  *-tti) # must be before sparc entry or we get the wrong os.
1644
- os=-sysv3
1604
+ os=sysv3
1645
1605
  ;;
1646
1606
  sparc-* | *-sun)
1647
- os=-sunos4.1.1
1607
+ os=sunos4.1.1
1648
1608
  ;;
1649
1609
  pru-*)
1650
- os=-elf
1610
+ os=elf
1651
1611
  ;;
1652
1612
  *-be)
1653
- os=-beos
1654
- ;;
1655
- *-haiku)
1656
- os=-haiku
1613
+ os=beos
1657
1614
  ;;
1658
1615
  *-ibm)
1659
- os=-aix
1616
+ os=aix
1660
1617
  ;;
1661
1618
  *-knuth)
1662
- os=-mmixware
1619
+ os=mmixware
1663
1620
  ;;
1664
1621
  *-wec)
1665
- os=-proelf
1622
+ os=proelf
1666
1623
  ;;
1667
1624
  *-winbond)
1668
- os=-proelf
1625
+ os=proelf
1669
1626
  ;;
1670
1627
  *-oki)
1671
- os=-proelf
1628
+ os=proelf
1672
1629
  ;;
1673
1630
  *-hp)
1674
- os=-hpux
1631
+ os=hpux
1675
1632
  ;;
1676
1633
  *-hitachi)
1677
- os=-hiux
1634
+ os=hiux
1678
1635
  ;;
1679
1636
  i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1680
- os=-sysv
1637
+ os=sysv
1681
1638
  ;;
1682
1639
  *-cbm)
1683
- os=-amigaos
1640
+ os=amigaos
1684
1641
  ;;
1685
1642
  *-dg)
1686
- os=-dgux
1643
+ os=dgux
1687
1644
  ;;
1688
1645
  *-dolphin)
1689
- os=-sysv3
1646
+ os=sysv3
1690
1647
  ;;
1691
1648
  m68k-ccur)
1692
- os=-rtu
1649
+ os=rtu
1693
1650
  ;;
1694
1651
  m88k-omron*)
1695
- os=-luna
1652
+ os=luna
1696
1653
  ;;
1697
- *-next )
1698
- os=-nextstep
1654
+ *-next)
1655
+ os=nextstep
1699
1656
  ;;
1700
1657
  *-sequent)
1701
- os=-ptx
1658
+ os=ptx
1702
1659
  ;;
1703
1660
  *-crds)
1704
- os=-unos
1661
+ os=unos
1705
1662
  ;;
1706
1663
  *-ns)
1707
- os=-genix
1664
+ os=genix
1708
1665
  ;;
1709
1666
  i370-*)
1710
- os=-mvs
1711
- ;;
1712
- *-next)
1713
- os=-nextstep3
1667
+ os=mvs
1714
1668
  ;;
1715
1669
  *-gould)
1716
- os=-sysv
1670
+ os=sysv
1717
1671
  ;;
1718
1672
  *-highlevel)
1719
- os=-bsd
1673
+ os=bsd
1720
1674
  ;;
1721
1675
  *-encore)
1722
- os=-bsd
1676
+ os=bsd
1723
1677
  ;;
1724
1678
  *-sgi)
1725
- os=-irix
1679
+ os=irix
1726
1680
  ;;
1727
1681
  *-siemens)
1728
- os=-sysv4
1682
+ os=sysv4
1729
1683
  ;;
1730
1684
  *-masscomp)
1731
- os=-rtu
1685
+ os=rtu
1732
1686
  ;;
1733
1687
  f30[01]-fujitsu | f700-fujitsu)
1734
- os=-uxpv
1688
+ os=uxpv
1735
1689
  ;;
1736
1690
  *-rom68k)
1737
- os=-coff
1691
+ os=coff
1738
1692
  ;;
1739
1693
  *-*bug)
1740
- os=-coff
1694
+ os=coff
1741
1695
  ;;
1742
1696
  *-apple)
1743
- os=-macos
1697
+ os=macos
1744
1698
  ;;
1745
1699
  *-atari*)
1746
- os=-mint
1700
+ os=mint
1701
+ ;;
1702
+ *-wrs)
1703
+ os=vxworks
1747
1704
  ;;
1748
1705
  *)
1749
- os=-none
1706
+ os=none
1750
1707
  ;;
1751
1708
  esac
1709
+
1752
1710
  fi
1753
1711
 
1712
+ # Now, validate our (potentially fixed-up) OS.
1713
+ case $os in
1714
+ # Sometimes we do "kernel-libc", so those need to count as OSes.
1715
+ musl* | newlib* | relibc* | uclibc*)
1716
+ ;;
1717
+ # Likewise for "kernel-abi"
1718
+ eabi* | gnueabi*)
1719
+ ;;
1720
+ # VxWorks passes extra cpu info in the 4th filed.
1721
+ simlinux | simwindows | spe)
1722
+ ;;
1723
+ # Now accept the basic system types.
1724
+ # The portable systems comes first.
1725
+ # Each alternative MUST end in a * to match a version number.
1726
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1727
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
1728
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1729
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
1730
+ | hiux* | abug | nacl* | netware* | windows* \
1731
+ | os9* | macos* | osx* | ios* | watchos* | tvos* \
1732
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
1733
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1734
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
1735
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1736
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1737
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
1738
+ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
1739
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
1740
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1741
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1742
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
1743
+ | chorusrdb* | cegcc* | glidix* | serenity* \
1744
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1745
+ | midipix* | mingw32* | mingw64* | mint* \
1746
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1747
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
1748
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
1749
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
1750
+ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
1751
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
1752
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1753
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1754
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1755
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1756
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
1757
+ | fiwix* )
1758
+ ;;
1759
+ # This one is extra strict with allowed versions
1760
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
1761
+ # Don't forget version if it is 3.2v4 or newer.
1762
+ ;;
1763
+ none)
1764
+ ;;
1765
+ *)
1766
+ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
1767
+ exit 1
1768
+ ;;
1769
+ esac
1770
+
1771
+ # As a final step for OS-related things, validate the OS-kernel combination
1772
+ # (given a valid OS), if there is a kernel.
1773
+ case $kernel-$os in
1774
+ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
1775
+ | linux-musl* | linux-relibc* | linux-uclibc* )
1776
+ ;;
1777
+ uclinux-uclibc* )
1778
+ ;;
1779
+ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
1780
+ # These are just libc implementations, not actual OSes, and thus
1781
+ # require a kernel.
1782
+ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
1783
+ exit 1
1784
+ ;;
1785
+ kfreebsd*-gnu* | kopensolaris*-gnu*)
1786
+ ;;
1787
+ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
1788
+ ;;
1789
+ nto-qnx*)
1790
+ ;;
1791
+ os2-emx)
1792
+ ;;
1793
+ ios*-simulator | tvos*-simulator | watchos*-simulator)
1794
+ ;;
1795
+ *-eabi* | *-gnueabi*)
1796
+ ;;
1797
+ -*)
1798
+ # Blank kernel with real OS is always fine.
1799
+ ;;
1800
+ *-*)
1801
+ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
1802
+ exit 1
1803
+ ;;
1804
+ esac
1805
+
1754
1806
  # Here we handle the case where we know the os, and the CPU type, but not the
1755
1807
  # manufacturer. We pick the logical manufacturer.
1756
- vendor=unknown
1757
- case $basic_machine in
1758
- *-unknown)
1759
- case $os in
1760
- -riscix*)
1808
+ case $vendor in
1809
+ unknown)
1810
+ case $cpu-$os in
1811
+ *-riscix*)
1761
1812
  vendor=acorn
1762
1813
  ;;
1763
- -sunos*)
1814
+ *-sunos*)
1764
1815
  vendor=sun
1765
1816
  ;;
1766
- -cnk*|-aix*)
1817
+ *-cnk* | *-aix*)
1767
1818
  vendor=ibm
1768
1819
  ;;
1769
- -beos*)
1820
+ *-beos*)
1770
1821
  vendor=be
1771
1822
  ;;
1772
- -hpux*)
1823
+ *-hpux*)
1773
1824
  vendor=hp
1774
1825
  ;;
1775
- -mpeix*)
1826
+ *-mpeix*)
1776
1827
  vendor=hp
1777
1828
  ;;
1778
- -hiux*)
1829
+ *-hiux*)
1779
1830
  vendor=hitachi
1780
1831
  ;;
1781
- -unos*)
1832
+ *-unos*)
1782
1833
  vendor=crds
1783
1834
  ;;
1784
- -dgux*)
1835
+ *-dgux*)
1785
1836
  vendor=dg
1786
1837
  ;;
1787
- -luna*)
1838
+ *-luna*)
1788
1839
  vendor=omron
1789
1840
  ;;
1790
- -genix*)
1841
+ *-genix*)
1791
1842
  vendor=ns
1792
1843
  ;;
1793
- -mvs* | -opened*)
1844
+ *-clix*)
1845
+ vendor=intergraph
1846
+ ;;
1847
+ *-mvs* | *-opened*)
1848
+ vendor=ibm
1849
+ ;;
1850
+ *-os400*)
1794
1851
  vendor=ibm
1795
1852
  ;;
1796
- -os400*)
1853
+ s390-* | s390x-*)
1797
1854
  vendor=ibm
1798
1855
  ;;
1799
- -ptx*)
1856
+ *-ptx*)
1800
1857
  vendor=sequent
1801
1858
  ;;
1802
- -tpf*)
1859
+ *-tpf*)
1803
1860
  vendor=ibm
1804
1861
  ;;
1805
- -vxsim* | -vxworks* | -windiss*)
1862
+ *-vxsim* | *-vxworks* | *-windiss*)
1806
1863
  vendor=wrs
1807
1864
  ;;
1808
- -aux*)
1865
+ *-aux*)
1809
1866
  vendor=apple
1810
1867
  ;;
1811
- -hms*)
1868
+ *-hms*)
1812
1869
  vendor=hitachi
1813
1870
  ;;
1814
- -mpw* | -macos*)
1871
+ *-mpw* | *-macos*)
1815
1872
  vendor=apple
1816
1873
  ;;
1817
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1874
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
1818
1875
  vendor=atari
1819
1876
  ;;
1820
- -vos*)
1877
+ *-vos*)
1821
1878
  vendor=stratus
1822
1879
  ;;
1823
1880
  esac
1824
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1825
1881
  ;;
1826
1882
  esac
1827
1883
 
1828
- echo $basic_machine$os
1884
+ echo "$cpu-$vendor-${kernel:+$kernel-}$os"
1829
1885
  exit
1830
1886
 
1831
1887
  # Local variables:
1832
- # eval: (add-hook 'write-file-hooks 'time-stamp)
1888
+ # eval: (add-hook 'before-save-hook 'time-stamp)
1833
1889
  # time-stamp-start: "timestamp='"
1834
1890
  # time-stamp-format: "%:y-%02m-%02d"
1835
1891
  # time-stamp-end: "'"