ffi 1.15.5 → 1.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +169 -0
  4. data/Gemfile +15 -3
  5. data/README.md +5 -3
  6. data/Rakefile +30 -12
  7. data/Steepfile +8 -0
  8. data/ext/ffi_c/AbstractMemory.c +99 -74
  9. data/ext/ffi_c/AbstractMemory.h +3 -2
  10. data/ext/ffi_c/ArrayType.c +51 -15
  11. data/ext/ffi_c/ArrayType.h +1 -0
  12. data/ext/ffi_c/Buffer.c +90 -33
  13. data/ext/ffi_c/Call.c +29 -12
  14. data/ext/ffi_c/Call.h +3 -2
  15. data/ext/ffi_c/DynamicLibrary.c +90 -27
  16. data/ext/ffi_c/Function.c +276 -110
  17. data/ext/ffi_c/Function.h +1 -0
  18. data/ext/ffi_c/FunctionInfo.c +81 -25
  19. data/ext/ffi_c/LastError.c +29 -11
  20. data/ext/ffi_c/MappedType.c +66 -23
  21. data/ext/ffi_c/MappedType.h +0 -2
  22. data/ext/ffi_c/MemoryPointer.c +36 -9
  23. data/ext/ffi_c/MethodHandle.c +7 -3
  24. data/ext/ffi_c/Pointer.c +82 -40
  25. data/ext/ffi_c/Pointer.h +1 -0
  26. data/ext/ffi_c/Struct.c +166 -84
  27. data/ext/ffi_c/Struct.h +7 -4
  28. data/ext/ffi_c/StructByValue.c +48 -16
  29. data/ext/ffi_c/StructLayout.c +259 -73
  30. data/ext/ffi_c/Type.c +120 -51
  31. data/ext/ffi_c/Type.h +3 -1
  32. data/ext/ffi_c/Types.c +8 -2
  33. data/ext/ffi_c/Types.h +0 -1
  34. data/ext/ffi_c/Variadic.c +71 -26
  35. data/ext/ffi_c/compat.h +22 -22
  36. data/ext/ffi_c/extconf.rb +19 -2
  37. data/ext/ffi_c/ffi.c +4 -0
  38. data/ext/ffi_c/libffi/LICENSE +1 -1
  39. data/ext/ffi_c/libffi/Makefile.am +28 -16
  40. data/ext/ffi_c/libffi/Makefile.in +138 -84
  41. data/ext/ffi_c/libffi/README.md +189 -108
  42. data/ext/ffi_c/libffi/acinclude.m4 +16 -112
  43. data/ext/ffi_c/libffi/{.travis/compile → compile} +4 -7
  44. data/ext/ffi_c/libffi/config.guess +695 -570
  45. data/ext/ffi_c/libffi/config.sub +217 -95
  46. data/ext/ffi_c/libffi/configure +4642 -3901
  47. data/ext/ffi_c/libffi/configure.ac +83 -33
  48. data/ext/ffi_c/libffi/configure.host +31 -12
  49. data/ext/ffi_c/libffi/doc/Makefile.in +13 -6
  50. data/ext/ffi_c/libffi/doc/libffi.texi +108 -36
  51. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  52. data/ext/ffi_c/libffi/fficonfig.h.in +15 -50
  53. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +144 -60
  54. data/ext/ffi_c/libffi/include/Makefile.am +1 -1
  55. data/ext/ffi_c/libffi/include/Makefile.in +14 -9
  56. data/ext/ffi_c/libffi/include/ffi.h.in +73 -60
  57. data/ext/ffi_c/libffi/include/ffi_cfi.h +23 -0
  58. data/ext/ffi_c/libffi/include/ffi_common.h +50 -2
  59. data/ext/ffi_c/libffi/include/tramp.h +45 -0
  60. data/ext/ffi_c/libffi/install-sh +92 -69
  61. data/ext/ffi_c/libffi/libffi.map.in +18 -1
  62. data/ext/ffi_c/libffi/libtool-version +2 -2
  63. data/ext/ffi_c/libffi/ltmain.sh +518 -333
  64. data/ext/ffi_c/libffi/m4/asmcfi.m4 +28 -11
  65. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
  66. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
  67. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +13 -3
  68. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -45
  69. data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
  70. data/ext/ffi_c/libffi/man/Makefile.in +13 -6
  71. data/ext/ffi_c/libffi/missing +1 -1
  72. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +2 -2
  73. data/ext/ffi_c/libffi/msvcc.sh +1 -1
  74. data/ext/ffi_c/libffi/src/aarch64/ffi.c +177 -57
  75. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +2 -2
  76. data/ext/ffi_c/libffi/src/aarch64/internal.h +78 -0
  77. data/ext/ffi_c/libffi/src/aarch64/sysv.S +347 -93
  78. data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
  79. data/ext/ffi_c/libffi/src/arc/ffi.c +328 -147
  80. data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
  81. data/ext/ffi_c/libffi/src/arm/ffi.c +62 -17
  82. data/ext/ffi_c/libffi/src/arm/ffitarget.h +3 -3
  83. data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
  84. data/ext/ffi_c/libffi/src/arm/sysv.S +114 -43
  85. data/ext/ffi_c/libffi/src/closures.c +137 -51
  86. data/ext/ffi_c/libffi/src/debug.c +2 -2
  87. data/ext/ffi_c/libffi/src/dlmalloc.c +7 -1
  88. data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
  89. data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
  90. data/ext/ffi_c/libffi/src/loongarch64/ffi.c +624 -0
  91. data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
  92. data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
  93. data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
  94. data/ext/ffi_c/libffi/src/mips/ffi.c +250 -67
  95. data/ext/ffi_c/libffi/src/mips/ffitarget.h +9 -4
  96. data/ext/ffi_c/libffi/src/mips/n32.S +197 -33
  97. data/ext/ffi_c/libffi/src/mips/o32.S +65 -4
  98. data/ext/ffi_c/libffi/src/moxie/ffi.c +47 -22
  99. data/ext/ffi_c/libffi/src/or1k/ffi.c +27 -14
  100. data/ext/ffi_c/libffi/src/pa/ffi.c +32 -33
  101. data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
  102. data/ext/ffi_c/libffi/src/pa/ffitarget.h +22 -8
  103. data/ext/ffi_c/libffi/src/pa/hpux32.S +83 -36
  104. data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
  105. data/ext/ffi_c/libffi/src/pa/linux.S +86 -35
  106. data/ext/ffi_c/libffi/src/powerpc/ffi.c +19 -0
  107. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +36 -24
  108. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +27 -20
  109. data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +26 -16
  110. data/ext/ffi_c/libffi/src/powerpc/internal.h +10 -0
  111. data/ext/ffi_c/libffi/src/powerpc/linux64.S +2 -0
  112. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +49 -0
  113. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +24 -0
  114. data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
  115. data/ext/ffi_c/libffi/src/prep_cif.c +22 -5
  116. data/ext/ffi_c/libffi/src/riscv/ffi.c +74 -18
  117. data/ext/ffi_c/libffi/src/riscv/internal.h +7 -0
  118. data/ext/ffi_c/libffi/src/riscv/sysv.S +24 -0
  119. data/ext/ffi_c/libffi/src/s390/ffi.c +28 -1
  120. data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
  121. data/ext/ffi_c/libffi/src/s390/sysv.S +38 -0
  122. data/ext/ffi_c/libffi/src/sparc/ffi.c +16 -0
  123. data/ext/ffi_c/libffi/src/sparc/ffi64.c +23 -1
  124. data/ext/ffi_c/libffi/src/tramp.c +721 -0
  125. data/ext/ffi_c/libffi/src/types.c +26 -6
  126. data/ext/ffi_c/libffi/src/wasm/ffi.c +798 -0
  127. data/ext/ffi_c/libffi/src/wasm/ffitarget.h +79 -0
  128. data/ext/ffi_c/libffi/src/x86/ffi.c +102 -37
  129. data/ext/ffi_c/libffi/src/x86/ffi64.c +71 -13
  130. data/ext/ffi_c/libffi/src/x86/ffitarget.h +6 -5
  131. data/ext/ffi_c/libffi/src/x86/ffiw64.c +44 -1
  132. data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
  133. data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
  134. data/ext/ffi_c/libffi/src/x86/sysv.S +173 -41
  135. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +92 -91
  136. data/ext/ffi_c/libffi/src/x86/unix64.S +96 -6
  137. data/ext/ffi_c/libffi/src/x86/win64.S +20 -7
  138. data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
  139. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
  140. data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
  141. data/ext/ffi_c/libffi/testsuite/Makefile.in +95 -121
  142. data/ext/ffi_c/libffi.bsd.mk +2 -2
  143. data/ext/ffi_c/libffi.darwin.mk +2 -2
  144. data/ext/ffi_c/libffi.gnu.mk +2 -2
  145. data/ext/ffi_c/libffi.mk +5 -0
  146. data/ext/ffi_c/rbffi.h +1 -1
  147. data/ffi.gemspec +9 -8
  148. data/lib/ffi/autopointer.rb +14 -31
  149. data/lib/ffi/compat.rb +54 -0
  150. data/lib/ffi/data_converter.rb +2 -2
  151. data/lib/ffi/dynamic_library.rb +118 -0
  152. data/lib/ffi/enum.rb +18 -12
  153. data/lib/ffi/ffi.rb +62 -0
  154. data/lib/ffi/function.rb +94 -0
  155. data/lib/ffi/io.rb +2 -2
  156. data/lib/ffi/library.rb +88 -88
  157. data/lib/ffi/library_path.rb +109 -0
  158. data/lib/ffi/managedstruct.rb +1 -1
  159. data/lib/ffi/platform/aarch64-linux/types.conf +74 -3
  160. data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
  161. data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
  162. data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
  163. data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
  164. data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
  165. data/lib/ffi/platform.rb +15 -13
  166. data/lib/ffi/pointer.rb +6 -6
  167. data/lib/ffi/struct.rb +6 -5
  168. data/lib/ffi/struct_by_reference.rb +1 -1
  169. data/lib/ffi/struct_layout.rb +3 -3
  170. data/lib/ffi/struct_layout_builder.rb +9 -9
  171. data/lib/ffi/types.rb +65 -37
  172. data/lib/ffi/variadic.rb +19 -8
  173. data/lib/ffi/version.rb +1 -1
  174. data/samples/hello_ractor.rb +19 -0
  175. data/samples/qsort_ractor.rb +36 -0
  176. data/sig/ffi/abstract_memory.rbs +165 -0
  177. data/sig/ffi/auto_pointer.rbs +26 -0
  178. data/sig/ffi/buffer.rbs +18 -0
  179. data/sig/ffi/data_converter.rbs +10 -0
  180. data/sig/ffi/dynamic_library.rbs +9 -0
  181. data/sig/ffi/enum.rbs +38 -0
  182. data/sig/ffi/errno.rbs +8 -0
  183. data/sig/ffi/function.rbs +39 -0
  184. data/sig/ffi/library.rbs +42 -0
  185. data/sig/ffi/native_type.rbs +86 -0
  186. data/sig/ffi/platform.rbs +49 -0
  187. data/sig/ffi/pointer.rbs +42 -0
  188. data/sig/ffi/struct.rbs +76 -0
  189. data/sig/ffi/struct_by_reference.rbs +11 -0
  190. data/sig/ffi/struct_by_value.rbs +7 -0
  191. data/sig/ffi/struct_layout.rbs +9 -0
  192. data/sig/ffi/struct_layout_builder.rbs +5 -0
  193. data/sig/ffi/type.rbs +39 -0
  194. data/sig/ffi.rbs +29 -0
  195. data.tar.gz.sig +0 -0
  196. metadata +79 -299
  197. metadata.gz.sig +0 -0
  198. data/ext/ffi_c/libffi/.appveyor.yml +0 -66
  199. data/ext/ffi_c/libffi/.gitattributes +0 -4
  200. data/ext/ffi_c/libffi/.github/issue_template.md +0 -10
  201. data/ext/ffi_c/libffi/.gitignore +0 -38
  202. data/ext/ffi_c/libffi/.travis/ar-lib +0 -270
  203. data/ext/ffi_c/libffi/.travis/bfin-sim.exp +0 -58
  204. data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +0 -14
  205. data/ext/ffi_c/libffi/.travis/build-in-container.sh +0 -12
  206. data/ext/ffi_c/libffi/.travis/build.sh +0 -142
  207. data/ext/ffi_c/libffi/.travis/install.sh +0 -71
  208. data/ext/ffi_c/libffi/.travis/m32r-sim.exp +0 -58
  209. data/ext/ffi_c/libffi/.travis/moxie-sim.exp +0 -60
  210. data/ext/ffi_c/libffi/.travis/or1k-sim.exp +0 -58
  211. data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +0 -58
  212. data/ext/ffi_c/libffi/.travis/site.exp +0 -27
  213. data/ext/ffi_c/libffi/.travis/wine-sim.exp +0 -55
  214. data/ext/ffi_c/libffi/.travis.yml +0 -83
  215. data/ext/ffi_c/libffi/src/nios2/ffi.c +0 -304
  216. data/ext/ffi_c/libffi/src/nios2/ffitarget.h +0 -52
  217. data/ext/ffi_c/libffi/src/nios2/sysv.S +0 -136
  218. data/ext/ffi_c/libffi/testsuite/Makefile.am +0 -122
  219. data/ext/ffi_c/libffi/testsuite/config/default.exp +0 -1
  220. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +0 -660
  221. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +0 -283
  222. data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +0 -45
  223. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +0 -28
  224. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +0 -78
  225. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +0 -50
  226. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +0 -63
  227. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +0 -1745
  228. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +0 -2885
  229. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +0 -743
  230. data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +0 -46
  231. data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +0 -46
  232. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +0 -54
  233. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +0 -26
  234. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +0 -138
  235. data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +0 -59
  236. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +0 -60
  237. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +0 -61
  238. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +0 -74
  239. data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +0 -62
  240. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +0 -107
  241. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +0 -59
  242. data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +0 -57
  243. data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +0 -70
  244. data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +0 -78
  245. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -52
  246. data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +0 -46
  247. data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +0 -127
  248. data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +0 -59
  249. data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +0 -114
  250. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +0 -36
  251. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +0 -43
  252. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +0 -42
  253. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +0 -35
  254. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +0 -36
  255. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +0 -49
  256. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +0 -42
  257. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +0 -34
  258. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +0 -41
  259. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +0 -43
  260. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +0 -36
  261. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +0 -38
  262. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +0 -38
  263. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +0 -38
  264. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +0 -44
  265. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +0 -49
  266. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +0 -49
  267. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +0 -55
  268. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +0 -67
  269. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +0 -57
  270. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +0 -67
  271. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +0 -60
  272. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +0 -64
  273. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +0 -66
  274. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +0 -64
  275. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +0 -74
  276. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +0 -81
  277. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +0 -68
  278. data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +0 -61
  279. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +0 -196
  280. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +0 -121
  281. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +0 -123
  282. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +0 -125
  283. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +0 -67
  284. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c +0 -89
  285. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c +0 -81
  286. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c +0 -81
  287. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c +0 -82
  288. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c +0 -89
  289. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c +0 -92
  290. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c +0 -90
  291. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c +0 -95
  292. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c +0 -55
  293. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c +0 -94
  294. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c +0 -95
  295. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c +0 -96
  296. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c +0 -102
  297. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c +0 -89
  298. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c +0 -91
  299. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c +0 -93
  300. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c +0 -113
  301. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c +0 -90
  302. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c +0 -95
  303. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c +0 -90
  304. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c +0 -90
  305. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +0 -95
  306. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c +0 -98
  307. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c +0 -90
  308. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c +0 -109
  309. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c +0 -98
  310. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c +0 -124
  311. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c +0 -113
  312. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c +0 -99
  313. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c +0 -117
  314. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c +0 -97
  315. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c +0 -88
  316. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c +0 -90
  317. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c +0 -91
  318. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c +0 -93
  319. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c +0 -91
  320. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c +0 -92
  321. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c +0 -132
  322. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c +0 -115
  323. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c +0 -95
  324. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c +0 -91
  325. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c +0 -91
  326. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c +0 -92
  327. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c +0 -91
  328. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c +0 -91
  329. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c +0 -93
  330. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c +0 -66
  331. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double.c +0 -43
  332. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c +0 -61
  333. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c +0 -42
  334. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c +0 -105
  335. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c +0 -61
  336. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +0 -70
  337. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +0 -55
  338. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c +0 -74
  339. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c +0 -74
  340. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +0 -86
  341. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c +0 -91
  342. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c +0 -74
  343. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +0 -86
  344. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c +0 -74
  345. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c +0 -142
  346. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c +0 -44
  347. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c +0 -42
  348. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c +0 -42
  349. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +0 -114
  350. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c +0 -42
  351. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +0 -44
  352. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c +0 -43
  353. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +0 -45
  354. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +0 -45
  355. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c +0 -47
  356. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c +0 -43
  357. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +0 -44
  358. data/ext/ffi_c/libffi/testsuite/libffi.closures/err_bad_abi.c +0 -36
  359. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +0 -138
  360. data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +0 -343
  361. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c +0 -152
  362. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c +0 -161
  363. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c +0 -134
  364. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +0 -121
  365. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c +0 -110
  366. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c +0 -111
  367. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c +0 -111
  368. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c +0 -112
  369. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c +0 -131
  370. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c +0 -111
  371. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c +0 -131
  372. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c +0 -131
  373. data/ext/ffi_c/libffi/testsuite/libffi.closures/problem1.c +0 -90
  374. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large.c +0 -145
  375. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large2.c +0 -148
  376. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c +0 -124
  377. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c +0 -125
  378. data/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c +0 -70
  379. data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc +0 -117
  380. data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc +0 -54
  381. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +0 -91
  382. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +0 -10
  383. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +0 -10
  384. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +0 -10
  385. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +0 -42
  386. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +0 -10
  387. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +0 -10
  388. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +0 -10
  389. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +0 -71
  390. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +0 -10
  391. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +0 -10
  392. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +0 -10
  393. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +0 -80
  394. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +0 -10
  395. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +0 -16
  396. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +0 -10
  397. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp +0 -36
  398. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +0 -51
  399. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +0 -7
  400. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +0 -7
  401. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +0 -7
  402. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +0 -10
  403. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +0 -10
  404. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +0 -86
  405. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +0 -10
  406. data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +0 -1
  407. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +0 -78
  408. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +0 -10
  409. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +0 -10
  410. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +0 -10
  411. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +0 -37
  412. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +0 -41
  413. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +0 -10
  414. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +0 -10
  415. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +0 -10
  416. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +0 -44
  417. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +0 -10
  418. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +0 -10
  419. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +0 -10
  420. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +0 -10
  421. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +0 -10
  422. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +0 -10
  423. data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +0 -34
  424. data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +0 -28
  425. data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +0 -1
  426. data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +0 -36
  427. data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +0 -19
  428. data/lib/ffi/tools/types_generator.rb +0 -137
  429. data/rakelib/ffi_gem_helper.rb +0 -65
  430. /data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +0 -0
@@ -1,12 +1,14 @@
1
1
  #! /bin/sh
2
2
  # Attempt to guess a canonical system name.
3
- # Copyright 1992-2020 Free Software Foundation, Inc.
3
+ # Copyright 1992-2024 Free Software Foundation, Inc.
4
4
 
5
- timestamp='2020-07-12'
5
+ # shellcheck disable=SC2006,SC2268 # see below for rationale
6
+
7
+ timestamp='2024-01-01'
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
@@ -27,17 +29,25 @@ timestamp='2020-07-12'
27
29
  # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
28
30
  #
29
31
  # You can get the latest version of this script from:
30
- # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
32
+ # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
31
33
  #
32
34
  # Please send patches to <config-patches@gnu.org>.
33
35
 
34
36
 
37
+ # The "shellcheck disable" line above the timestamp inhibits complaints
38
+ # about features and limitations of the classic Bourne shell that were
39
+ # superseded or lifted in POSIX. However, this script identifies a wide
40
+ # variety of pre-POSIX systems that do not have POSIX shells at all, and
41
+ # even some reasonably current systems (Solaris 10 as case-in-point) still
42
+ # have a pre-POSIX /bin/sh.
43
+
44
+
35
45
  me=`echo "$0" | sed -e 's,.*/,,'`
36
46
 
37
47
  usage="\
38
48
  Usage: $0 [OPTION]
39
49
 
40
- Output the configuration name of the system \`$me' is run on.
50
+ Output the configuration name of the system '$me' is run on.
41
51
 
42
52
  Options:
43
53
  -h, --help print this help, then exit
@@ -50,13 +60,13 @@ version="\
50
60
  GNU config.guess ($timestamp)
51
61
 
52
62
  Originally written by Per Bothner.
53
- Copyright 1992-2020 Free Software Foundation, Inc.
63
+ Copyright 1992-2024 Free Software Foundation, Inc.
54
64
 
55
65
  This is free software; see the source for copying conditions. There is NO
56
66
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57
67
 
58
68
  help="
59
- Try \`$me --help' for more information."
69
+ Try '$me --help' for more information."
60
70
 
61
71
  # Parse command line
62
72
  while test $# -gt 0 ; do
@@ -84,13 +94,16 @@ if test $# != 0; then
84
94
  exit 1
85
95
  fi
86
96
 
97
+ # Just in case it came from the environment.
98
+ GUESS=
99
+
87
100
  # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
88
101
  # compiler to aid in system detection is discouraged as it requires
89
102
  # temporary files to be created and, as you can see below, it is a
90
103
  # headache to deal with in a portable fashion.
91
104
 
92
- # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
93
- # use `HOST_CC' if defined, but it is deprecated.
105
+ # Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
106
+ # use 'HOST_CC' if defined, but it is deprecated.
94
107
 
95
108
  # Portable tmp directory creation inspired by the Autoconf team.
96
109
 
@@ -102,7 +115,7 @@ set_cc_for_build() {
102
115
  # prevent multiple calls if $tmp is already set
103
116
  test "$tmp" && return 0
104
117
  : "${TMPDIR=/tmp}"
105
- # shellcheck disable=SC2039
118
+ # shellcheck disable=SC2039,SC3028
106
119
  { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
107
120
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
108
121
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
@@ -112,7 +125,7 @@ set_cc_for_build() {
112
125
  ,,) echo "int x;" > "$dummy.c"
113
126
  for driver in cc gcc c89 c99 ; do
114
127
  if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
115
- CC_FOR_BUILD="$driver"
128
+ CC_FOR_BUILD=$driver
116
129
  break
117
130
  fi
118
131
  done
@@ -133,40 +146,57 @@ fi
133
146
 
134
147
  UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
135
148
  UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
136
- UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
149
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
137
150
  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
138
151
 
139
- case "$UNAME_SYSTEM" in
152
+ case $UNAME_SYSTEM in
140
153
  Linux|GNU|GNU/*)
141
- # If the system lacks a compiler, then just pick glibc.
142
- # We could probably try harder.
143
- LIBC=gnu
154
+ LIBC=unknown
144
155
 
145
156
  set_cc_for_build
146
157
  cat <<-EOF > "$dummy.c"
158
+ #if defined(__ANDROID__)
159
+ LIBC=android
160
+ #else
147
161
  #include <features.h>
148
162
  #if defined(__UCLIBC__)
149
163
  LIBC=uclibc
150
164
  #elif defined(__dietlibc__)
151
165
  LIBC=dietlibc
152
- #else
166
+ #elif defined(__GLIBC__)
153
167
  LIBC=gnu
168
+ #elif defined(__LLVM_LIBC__)
169
+ LIBC=llvm
170
+ #else
171
+ #include <stdarg.h>
172
+ /* First heuristic to detect musl libc. */
173
+ #ifdef __DEFINED_va_list
174
+ LIBC=musl
175
+ #endif
176
+ #endif
154
177
  #endif
155
178
  EOF
156
- eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
179
+ cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
180
+ eval "$cc_set_libc"
157
181
 
158
- # If ldd exists, use it to detect musl libc.
159
- if command -v ldd >/dev/null && \
160
- ldd --version 2>&1 | grep -q ^musl
161
- then
162
- LIBC=musl
182
+ # Second heuristic to detect musl libc.
183
+ if [ "$LIBC" = unknown ] &&
184
+ command -v ldd >/dev/null &&
185
+ ldd --version 2>&1 | grep -q ^musl; then
186
+ LIBC=musl
187
+ fi
188
+
189
+ # If the system lacks a compiler, then just pick glibc.
190
+ # We could probably try harder.
191
+ if [ "$LIBC" = unknown ]; then
192
+ LIBC=gnu
163
193
  fi
164
194
  ;;
165
195
  esac
166
196
 
167
197
  # Note: order is significant - the case branches are not exclusive.
168
198
 
169
- case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
199
+ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
170
200
  *:NetBSD:*:*)
171
201
  # NetBSD (nbsd) targets should (where applicable) match one or
172
202
  # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -178,12 +208,12 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
178
208
  #
179
209
  # Note: NetBSD doesn't particularly care about the vendor
180
210
  # portion of the name. We always set it to "unknown".
181
- sysctl="sysctl -n hw.machine_arch"
182
211
  UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
183
- "/sbin/$sysctl" 2>/dev/null || \
184
- "/usr/sbin/$sysctl" 2>/dev/null || \
212
+ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
213
+ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
185
214
  echo unknown)`
186
- case "$UNAME_MACHINE_ARCH" in
215
+ case $UNAME_MACHINE_ARCH in
216
+ aarch64eb) machine=aarch64_be-unknown ;;
187
217
  armeb) machine=armeb-unknown ;;
188
218
  arm*) machine=arm-unknown ;;
189
219
  sh3el) machine=shl-unknown ;;
@@ -192,13 +222,13 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
192
222
  earmv*)
193
223
  arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
194
224
  endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
195
- machine="${arch}${endian}"-unknown
225
+ machine=${arch}${endian}-unknown
196
226
  ;;
197
- *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
227
+ *) machine=$UNAME_MACHINE_ARCH-unknown ;;
198
228
  esac
199
229
  # The Operating System including object format, if it has switched
200
230
  # to ELF recently (or will in the future) and ABI.
201
- case "$UNAME_MACHINE_ARCH" in
231
+ case $UNAME_MACHINE_ARCH in
202
232
  earm*)
203
233
  os=netbsdelf
204
234
  ;;
@@ -219,7 +249,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
219
249
  ;;
220
250
  esac
221
251
  # Determine ABI tags.
222
- case "$UNAME_MACHINE_ARCH" in
252
+ case $UNAME_MACHINE_ARCH in
223
253
  earm*)
224
254
  expr='s/^earmv[0-9]/-eabi/;s/eb$//'
225
255
  abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
@@ -230,7 +260,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
230
260
  # thus, need a distinct triplet. However, they do not need
231
261
  # kernel version information, so it can be replaced with a
232
262
  # suitable tag, in the style of linux-gnu.
233
- case "$UNAME_VERSION" in
263
+ case $UNAME_VERSION in
234
264
  Debian*)
235
265
  release='-gnu'
236
266
  ;;
@@ -241,51 +271,57 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
241
271
  # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
242
272
  # contains redundant information, the shorter form:
243
273
  # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
244
- echo "$machine-${os}${release}${abi-}"
245
- exit ;;
274
+ GUESS=$machine-${os}${release}${abi-}
275
+ ;;
246
276
  *:Bitrig:*:*)
247
277
  UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
248
- echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
249
- exit ;;
278
+ GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
279
+ ;;
250
280
  *:OpenBSD:*:*)
251
281
  UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
252
- echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
253
- exit ;;
282
+ GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
283
+ ;;
284
+ *:SecBSD:*:*)
285
+ UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
286
+ GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
287
+ ;;
254
288
  *:LibertyBSD:*:*)
255
289
  UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
256
- echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
257
- exit ;;
290
+ GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
291
+ ;;
258
292
  *:MidnightBSD:*:*)
259
- echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
260
- exit ;;
293
+ GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
294
+ ;;
261
295
  *:ekkoBSD:*:*)
262
- echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
263
- exit ;;
296
+ GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
297
+ ;;
264
298
  *:SolidBSD:*:*)
265
- echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
266
- exit ;;
299
+ GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
300
+ ;;
267
301
  *:OS108:*:*)
268
- echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
269
- exit ;;
302
+ GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
303
+ ;;
270
304
  macppc:MirBSD:*:*)
271
- echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
272
- exit ;;
305
+ GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
306
+ ;;
273
307
  *:MirBSD:*:*)
274
- echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
275
- exit ;;
308
+ GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
309
+ ;;
276
310
  *:Sortix:*:*)
277
- echo "$UNAME_MACHINE"-unknown-sortix
278
- exit ;;
311
+ GUESS=$UNAME_MACHINE-unknown-sortix
312
+ ;;
279
313
  *:Twizzler:*:*)
280
- echo "$UNAME_MACHINE"-unknown-twizzler
281
- exit ;;
314
+ GUESS=$UNAME_MACHINE-unknown-twizzler
315
+ ;;
282
316
  *:Redox:*:*)
283
- echo "$UNAME_MACHINE"-unknown-redox
284
- exit ;;
317
+ GUESS=$UNAME_MACHINE-unknown-redox
318
+ ;;
285
319
  mips:OSF1:*.*)
286
- echo mips-dec-osf1
287
- exit ;;
320
+ GUESS=mips-dec-osf1
321
+ ;;
288
322
  alpha:OSF1:*:*)
323
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
324
+ trap '' 0
289
325
  case $UNAME_RELEASE in
290
326
  *4.0)
291
327
  UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -299,7 +335,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
299
335
  # covers most systems running today. This code pipes the CPU
300
336
  # types through head -n 1, so we only detect the type of CPU 0.
301
337
  ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
302
- case "$ALPHA_CPU_TYPE" in
338
+ case $ALPHA_CPU_TYPE in
303
339
  "EV4 (21064)")
304
340
  UNAME_MACHINE=alpha ;;
305
341
  "EV4.5 (21064)")
@@ -336,117 +372,121 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
336
372
  # A Tn.n version is a released field test version.
337
373
  # A Xn.n version is an unreleased experimental baselevel.
338
374
  # 1.2 uses "1.2" for uname -r.
339
- echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
340
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
341
- exitcode=$?
342
- trap '' 0
343
- exit $exitcode ;;
375
+ OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
376
+ GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
377
+ ;;
344
378
  Amiga*:UNIX_System_V:4.0:*)
345
- echo m68k-unknown-sysv4
346
- exit ;;
379
+ GUESS=m68k-unknown-sysv4
380
+ ;;
347
381
  *:[Aa]miga[Oo][Ss]:*:*)
348
- echo "$UNAME_MACHINE"-unknown-amigaos
349
- exit ;;
382
+ GUESS=$UNAME_MACHINE-unknown-amigaos
383
+ ;;
350
384
  *:[Mm]orph[Oo][Ss]:*:*)
351
- echo "$UNAME_MACHINE"-unknown-morphos
352
- exit ;;
385
+ GUESS=$UNAME_MACHINE-unknown-morphos
386
+ ;;
353
387
  *:OS/390:*:*)
354
- echo i370-ibm-openedition
355
- exit ;;
388
+ GUESS=i370-ibm-openedition
389
+ ;;
356
390
  *:z/VM:*:*)
357
- echo s390-ibm-zvmoe
358
- exit ;;
391
+ GUESS=s390-ibm-zvmoe
392
+ ;;
359
393
  *:OS400:*:*)
360
- echo powerpc-ibm-os400
361
- exit ;;
394
+ GUESS=powerpc-ibm-os400
395
+ ;;
362
396
  arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
363
- echo arm-acorn-riscix"$UNAME_RELEASE"
364
- exit ;;
397
+ GUESS=arm-acorn-riscix$UNAME_RELEASE
398
+ ;;
365
399
  arm*:riscos:*:*|arm*:RISCOS:*:*)
366
- echo arm-unknown-riscos
367
- exit ;;
400
+ GUESS=arm-unknown-riscos
401
+ ;;
368
402
  SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
369
- echo hppa1.1-hitachi-hiuxmpp
370
- exit ;;
403
+ GUESS=hppa1.1-hitachi-hiuxmpp
404
+ ;;
371
405
  Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
372
406
  # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
373
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
374
- echo pyramid-pyramid-sysv3
375
- else
376
- echo pyramid-pyramid-bsd
377
- fi
378
- exit ;;
407
+ case `(/bin/universe) 2>/dev/null` in
408
+ att) GUESS=pyramid-pyramid-sysv3 ;;
409
+ *) GUESS=pyramid-pyramid-bsd ;;
410
+ esac
411
+ ;;
379
412
  NILE*:*:*:dcosx)
380
- echo pyramid-pyramid-svr4
381
- exit ;;
413
+ GUESS=pyramid-pyramid-svr4
414
+ ;;
382
415
  DRS?6000:unix:4.0:6*)
383
- echo sparc-icl-nx6
384
- exit ;;
416
+ GUESS=sparc-icl-nx6
417
+ ;;
385
418
  DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
386
419
  case `/usr/bin/uname -p` in
387
- sparc) echo sparc-icl-nx7; exit ;;
388
- esac ;;
420
+ sparc) GUESS=sparc-icl-nx7 ;;
421
+ esac
422
+ ;;
389
423
  s390x:SunOS:*:*)
390
- echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
391
- exit ;;
424
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
425
+ GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
426
+ ;;
392
427
  sun4H:SunOS:5.*:*)
393
- echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
394
- exit ;;
428
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
429
+ GUESS=sparc-hal-solaris2$SUN_REL
430
+ ;;
395
431
  sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
396
- echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
397
- exit ;;
432
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
433
+ GUESS=sparc-sun-solaris2$SUN_REL
434
+ ;;
398
435
  i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
399
- echo i386-pc-auroraux"$UNAME_RELEASE"
400
- exit ;;
436
+ GUESS=i386-pc-auroraux$UNAME_RELEASE
437
+ ;;
401
438
  i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
402
439
  set_cc_for_build
403
440
  SUN_ARCH=i386
404
441
  # If there is a compiler, see if it is configured for 64-bit objects.
405
442
  # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
406
443
  # This test works for both compilers.
407
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
444
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
408
445
  if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
409
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
446
+ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
410
447
  grep IS_64BIT_ARCH >/dev/null
411
448
  then
412
449
  SUN_ARCH=x86_64
413
450
  fi
414
451
  fi
415
- echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
416
- exit ;;
452
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
453
+ GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
454
+ ;;
417
455
  sun4*:SunOS:6*:*)
418
456
  # According to config.sub, this is the proper way to canonicalize
419
457
  # SunOS6. Hard to guess exactly what SunOS6 will be like, but
420
458
  # it's likely to be more like Solaris than SunOS4.
421
- echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
422
- exit ;;
459
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
460
+ GUESS=sparc-sun-solaris3$SUN_REL
461
+ ;;
423
462
  sun4*:SunOS:*:*)
424
- case "`/usr/bin/arch -k`" in
463
+ case `/usr/bin/arch -k` in
425
464
  Series*|S4*)
426
465
  UNAME_RELEASE=`uname -v`
427
466
  ;;
428
467
  esac
429
- # Japanese Language versions have a version number like `4.1.3-JL'.
430
- echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
431
- exit ;;
468
+ # Japanese Language versions have a version number like '4.1.3-JL'.
469
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
470
+ GUESS=sparc-sun-sunos$SUN_REL
471
+ ;;
432
472
  sun3*:SunOS:*:*)
433
- echo m68k-sun-sunos"$UNAME_RELEASE"
434
- exit ;;
473
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
474
+ ;;
435
475
  sun*:*:4.2BSD:*)
436
476
  UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
437
477
  test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
438
- case "`/bin/arch`" in
478
+ case `/bin/arch` in
439
479
  sun3)
440
- echo m68k-sun-sunos"$UNAME_RELEASE"
480
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
441
481
  ;;
442
482
  sun4)
443
- echo sparc-sun-sunos"$UNAME_RELEASE"
483
+ GUESS=sparc-sun-sunos$UNAME_RELEASE
444
484
  ;;
445
485
  esac
446
- exit ;;
486
+ ;;
447
487
  aushp:SunOS:*:*)
448
- echo sparc-auspex-sunos"$UNAME_RELEASE"
449
- exit ;;
488
+ GUESS=sparc-auspex-sunos$UNAME_RELEASE
489
+ ;;
450
490
  # The situation for MiNT is a little confusing. The machine name
451
491
  # can be virtually everything (everything which is not
452
492
  # "atarist" or "atariste" at least should have a processor
@@ -456,41 +496,41 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
456
496
  # MiNT. But MiNT is downward compatible to TOS, so this should
457
497
  # be no problem.
458
498
  atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
459
- echo m68k-atari-mint"$UNAME_RELEASE"
460
- exit ;;
499
+ GUESS=m68k-atari-mint$UNAME_RELEASE
500
+ ;;
461
501
  atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
462
- echo m68k-atari-mint"$UNAME_RELEASE"
463
- exit ;;
502
+ GUESS=m68k-atari-mint$UNAME_RELEASE
503
+ ;;
464
504
  *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
465
- echo m68k-atari-mint"$UNAME_RELEASE"
466
- exit ;;
505
+ GUESS=m68k-atari-mint$UNAME_RELEASE
506
+ ;;
467
507
  milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
468
- echo m68k-milan-mint"$UNAME_RELEASE"
469
- exit ;;
508
+ GUESS=m68k-milan-mint$UNAME_RELEASE
509
+ ;;
470
510
  hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
471
- echo m68k-hades-mint"$UNAME_RELEASE"
472
- exit ;;
511
+ GUESS=m68k-hades-mint$UNAME_RELEASE
512
+ ;;
473
513
  *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
474
- echo m68k-unknown-mint"$UNAME_RELEASE"
475
- exit ;;
514
+ GUESS=m68k-unknown-mint$UNAME_RELEASE
515
+ ;;
476
516
  m68k:machten:*:*)
477
- echo m68k-apple-machten"$UNAME_RELEASE"
478
- exit ;;
517
+ GUESS=m68k-apple-machten$UNAME_RELEASE
518
+ ;;
479
519
  powerpc:machten:*:*)
480
- echo powerpc-apple-machten"$UNAME_RELEASE"
481
- exit ;;
520
+ GUESS=powerpc-apple-machten$UNAME_RELEASE
521
+ ;;
482
522
  RISC*:Mach:*:*)
483
- echo mips-dec-mach_bsd4.3
484
- exit ;;
523
+ GUESS=mips-dec-mach_bsd4.3
524
+ ;;
485
525
  RISC*:ULTRIX:*:*)
486
- echo mips-dec-ultrix"$UNAME_RELEASE"
487
- exit ;;
526
+ GUESS=mips-dec-ultrix$UNAME_RELEASE
527
+ ;;
488
528
  VAX*:ULTRIX*:*:*)
489
- echo vax-dec-ultrix"$UNAME_RELEASE"
490
- exit ;;
529
+ GUESS=vax-dec-ultrix$UNAME_RELEASE
530
+ ;;
491
531
  2020:CLIX:*:* | 2430:CLIX:*:*)
492
- echo clipper-intergraph-clix"$UNAME_RELEASE"
493
- exit ;;
532
+ GUESS=clipper-intergraph-clix$UNAME_RELEASE
533
+ ;;
494
534
  mips:*:*:UMIPS | mips:*:*:RISCos)
495
535
  set_cc_for_build
496
536
  sed 's/^ //' << EOF > "$dummy.c"
@@ -518,75 +558,76 @@ EOF
518
558
  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
519
559
  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
520
560
  { echo "$SYSTEM_NAME"; exit; }
521
- echo mips-mips-riscos"$UNAME_RELEASE"
522
- exit ;;
561
+ GUESS=mips-mips-riscos$UNAME_RELEASE
562
+ ;;
523
563
  Motorola:PowerMAX_OS:*:*)
524
- echo powerpc-motorola-powermax
525
- exit ;;
564
+ GUESS=powerpc-motorola-powermax
565
+ ;;
526
566
  Motorola:*:4.3:PL8-*)
527
- echo powerpc-harris-powermax
528
- exit ;;
567
+ GUESS=powerpc-harris-powermax
568
+ ;;
529
569
  Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
530
- echo powerpc-harris-powermax
531
- exit ;;
570
+ GUESS=powerpc-harris-powermax
571
+ ;;
532
572
  Night_Hawk:Power_UNIX:*:*)
533
- echo powerpc-harris-powerunix
534
- exit ;;
573
+ GUESS=powerpc-harris-powerunix
574
+ ;;
535
575
  m88k:CX/UX:7*:*)
536
- echo m88k-harris-cxux7
537
- exit ;;
576
+ GUESS=m88k-harris-cxux7
577
+ ;;
538
578
  m88k:*:4*:R4*)
539
- echo m88k-motorola-sysv4
540
- exit ;;
579
+ GUESS=m88k-motorola-sysv4
580
+ ;;
541
581
  m88k:*:3*:R3*)
542
- echo m88k-motorola-sysv3
543
- exit ;;
582
+ GUESS=m88k-motorola-sysv3
583
+ ;;
544
584
  AViiON:dgux:*:*)
545
585
  # DG/UX returns AViiON for all architectures
546
586
  UNAME_PROCESSOR=`/usr/bin/uname -p`
547
- if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
587
+ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
548
588
  then
549
- if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
550
- [ "$TARGET_BINARY_INTERFACE"x = x ]
589
+ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
590
+ test "$TARGET_BINARY_INTERFACE"x = x
551
591
  then
552
- echo m88k-dg-dgux"$UNAME_RELEASE"
592
+ GUESS=m88k-dg-dgux$UNAME_RELEASE
553
593
  else
554
- echo m88k-dg-dguxbcs"$UNAME_RELEASE"
594
+ GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
555
595
  fi
556
596
  else
557
- echo i586-dg-dgux"$UNAME_RELEASE"
597
+ GUESS=i586-dg-dgux$UNAME_RELEASE
558
598
  fi
559
- exit ;;
599
+ ;;
560
600
  M88*:DolphinOS:*:*) # DolphinOS (SVR3)
561
- echo m88k-dolphin-sysv3
562
- exit ;;
601
+ GUESS=m88k-dolphin-sysv3
602
+ ;;
563
603
  M88*:*:R3*:*)
564
604
  # Delta 88k system running SVR3
565
- echo m88k-motorola-sysv3
566
- exit ;;
605
+ GUESS=m88k-motorola-sysv3
606
+ ;;
567
607
  XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
568
- echo m88k-tektronix-sysv3
569
- exit ;;
608
+ GUESS=m88k-tektronix-sysv3
609
+ ;;
570
610
  Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
571
- echo m68k-tektronix-bsd
572
- exit ;;
611
+ GUESS=m68k-tektronix-bsd
612
+ ;;
573
613
  *:IRIX*:*:*)
574
- echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
575
- exit ;;
614
+ IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
615
+ GUESS=mips-sgi-irix$IRIX_REL
616
+ ;;
576
617
  ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
577
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
578
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
618
+ GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
619
+ ;; # Note that: echo "'`uname -s`'" gives 'AIX '
579
620
  i*86:AIX:*:*)
580
- echo i386-ibm-aix
581
- exit ;;
621
+ GUESS=i386-ibm-aix
622
+ ;;
582
623
  ia64:AIX:*:*)
583
- if [ -x /usr/bin/oslevel ] ; then
624
+ if test -x /usr/bin/oslevel ; then
584
625
  IBM_REV=`/usr/bin/oslevel`
585
626
  else
586
- IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
627
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
587
628
  fi
588
- echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
589
- exit ;;
629
+ GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
630
+ ;;
590
631
  *:AIX:2:3)
591
632
  if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
592
633
  set_cc_for_build
@@ -603,16 +644,16 @@ EOF
603
644
  EOF
604
645
  if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
605
646
  then
606
- echo "$SYSTEM_NAME"
647
+ GUESS=$SYSTEM_NAME
607
648
  else
608
- echo rs6000-ibm-aix3.2.5
649
+ GUESS=rs6000-ibm-aix3.2.5
609
650
  fi
610
651
  elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
611
- echo rs6000-ibm-aix3.2.4
652
+ GUESS=rs6000-ibm-aix3.2.4
612
653
  else
613
- echo rs6000-ibm-aix3.2
654
+ GUESS=rs6000-ibm-aix3.2
614
655
  fi
615
- exit ;;
656
+ ;;
616
657
  *:AIX:*:[4567])
617
658
  IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
618
659
  if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
@@ -620,56 +661,56 @@ EOF
620
661
  else
621
662
  IBM_ARCH=powerpc
622
663
  fi
623
- if [ -x /usr/bin/lslpp ] ; then
624
- IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
664
+ if test -x /usr/bin/lslpp ; then
665
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
625
666
  awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
626
667
  else
627
- IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
668
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
628
669
  fi
629
- echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
630
- exit ;;
670
+ GUESS=$IBM_ARCH-ibm-aix$IBM_REV
671
+ ;;
631
672
  *:AIX:*:*)
632
- echo rs6000-ibm-aix
633
- exit ;;
673
+ GUESS=rs6000-ibm-aix
674
+ ;;
634
675
  ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
635
- echo romp-ibm-bsd4.4
636
- exit ;;
676
+ GUESS=romp-ibm-bsd4.4
677
+ ;;
637
678
  ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
638
- echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
639
- exit ;; # report: romp-ibm BSD 4.3
679
+ GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
680
+ ;; # report: romp-ibm BSD 4.3
640
681
  *:BOSX:*:*)
641
- echo rs6000-bull-bosx
642
- exit ;;
682
+ GUESS=rs6000-bull-bosx
683
+ ;;
643
684
  DPX/2?00:B.O.S.:*:*)
644
- echo m68k-bull-sysv3
645
- exit ;;
685
+ GUESS=m68k-bull-sysv3
686
+ ;;
646
687
  9000/[34]??:4.3bsd:1.*:*)
647
- echo m68k-hp-bsd
648
- exit ;;
688
+ GUESS=m68k-hp-bsd
689
+ ;;
649
690
  hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
650
- echo m68k-hp-bsd4.4
651
- exit ;;
691
+ GUESS=m68k-hp-bsd4.4
692
+ ;;
652
693
  9000/[34678]??:HP-UX:*:*)
653
- HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
654
- case "$UNAME_MACHINE" in
694
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
695
+ case $UNAME_MACHINE in
655
696
  9000/31?) HP_ARCH=m68000 ;;
656
697
  9000/[34]??) HP_ARCH=m68k ;;
657
698
  9000/[678][0-9][0-9])
658
- if [ -x /usr/bin/getconf ]; then
699
+ if test -x /usr/bin/getconf; then
659
700
  sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
660
701
  sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
661
- case "$sc_cpu_version" in
702
+ case $sc_cpu_version in
662
703
  523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
663
704
  528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
664
705
  532) # CPU_PA_RISC2_0
665
- case "$sc_kernel_bits" in
706
+ case $sc_kernel_bits in
666
707
  32) HP_ARCH=hppa2.0n ;;
667
708
  64) HP_ARCH=hppa2.0w ;;
668
709
  '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
669
710
  esac ;;
670
711
  esac
671
712
  fi
672
- if [ "$HP_ARCH" = "" ]; then
713
+ if test "$HP_ARCH" = ""; then
673
714
  set_cc_for_build
674
715
  sed 's/^ //' << EOF > "$dummy.c"
675
716
 
@@ -708,7 +749,7 @@ EOF
708
749
  test -z "$HP_ARCH" && HP_ARCH=hppa
709
750
  fi ;;
710
751
  esac
711
- if [ "$HP_ARCH" = hppa2.0w ]
752
+ if test "$HP_ARCH" = hppa2.0w
712
753
  then
713
754
  set_cc_for_build
714
755
 
@@ -729,12 +770,12 @@ EOF
729
770
  HP_ARCH=hppa64
730
771
  fi
731
772
  fi
732
- echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
733
- exit ;;
773
+ GUESS=$HP_ARCH-hp-hpux$HPUX_REV
774
+ ;;
734
775
  ia64:HP-UX:*:*)
735
- HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
736
- echo ia64-hp-hpux"$HPUX_REV"
737
- exit ;;
776
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
777
+ GUESS=ia64-hp-hpux$HPUX_REV
778
+ ;;
738
779
  3050*:HI-UX:*:*)
739
780
  set_cc_for_build
740
781
  sed 's/^ //' << EOF > "$dummy.c"
@@ -764,36 +805,36 @@ EOF
764
805
  EOF
765
806
  $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
766
807
  { echo "$SYSTEM_NAME"; exit; }
767
- echo unknown-hitachi-hiuxwe2
768
- exit ;;
808
+ GUESS=unknown-hitachi-hiuxwe2
809
+ ;;
769
810
  9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
770
- echo hppa1.1-hp-bsd
771
- exit ;;
811
+ GUESS=hppa1.1-hp-bsd
812
+ ;;
772
813
  9000/8??:4.3bsd:*:*)
773
- echo hppa1.0-hp-bsd
774
- exit ;;
814
+ GUESS=hppa1.0-hp-bsd
815
+ ;;
775
816
  *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
776
- echo hppa1.0-hp-mpeix
777
- exit ;;
817
+ GUESS=hppa1.0-hp-mpeix
818
+ ;;
778
819
  hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
779
- echo hppa1.1-hp-osf
780
- exit ;;
820
+ GUESS=hppa1.1-hp-osf
821
+ ;;
781
822
  hp8??:OSF1:*:*)
782
- echo hppa1.0-hp-osf
783
- exit ;;
823
+ GUESS=hppa1.0-hp-osf
824
+ ;;
784
825
  i*86:OSF1:*:*)
785
- if [ -x /usr/sbin/sysversion ] ; then
786
- echo "$UNAME_MACHINE"-unknown-osf1mk
826
+ if test -x /usr/sbin/sysversion ; then
827
+ GUESS=$UNAME_MACHINE-unknown-osf1mk
787
828
  else
788
- echo "$UNAME_MACHINE"-unknown-osf1
829
+ GUESS=$UNAME_MACHINE-unknown-osf1
789
830
  fi
790
- exit ;;
831
+ ;;
791
832
  parisc*:Lites*:*:*)
792
- echo hppa1.1-hp-lites
793
- exit ;;
833
+ GUESS=hppa1.1-hp-lites
834
+ ;;
794
835
  C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
795
- echo c1-convex-bsd
796
- exit ;;
836
+ GUESS=c1-convex-bsd
837
+ ;;
797
838
  C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
798
839
  if getsysinfo -f scalar_acc
799
840
  then echo c32-convex-bsd
@@ -801,17 +842,18 @@ EOF
801
842
  fi
802
843
  exit ;;
803
844
  C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
804
- echo c34-convex-bsd
805
- exit ;;
845
+ GUESS=c34-convex-bsd
846
+ ;;
806
847
  C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
807
- echo c38-convex-bsd
808
- exit ;;
848
+ GUESS=c38-convex-bsd
849
+ ;;
809
850
  C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
810
- echo c4-convex-bsd
811
- exit ;;
851
+ GUESS=c4-convex-bsd
852
+ ;;
812
853
  CRAY*Y-MP:*:*:*)
813
- echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
814
- exit ;;
854
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
855
+ GUESS=ymp-cray-unicos$CRAY_REL
856
+ ;;
815
857
  CRAY*[A-Z]90:*:*:*)
816
858
  echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
817
859
  | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
@@ -819,112 +861,153 @@ EOF
819
861
  -e 's/\.[^.]*$/.X/'
820
862
  exit ;;
821
863
  CRAY*TS:*:*:*)
822
- echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
823
- exit ;;
864
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
865
+ GUESS=t90-cray-unicos$CRAY_REL
866
+ ;;
824
867
  CRAY*T3E:*:*:*)
825
- echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
826
- exit ;;
868
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
869
+ GUESS=alphaev5-cray-unicosmk$CRAY_REL
870
+ ;;
827
871
  CRAY*SV1:*:*:*)
828
- echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
829
- exit ;;
872
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
873
+ GUESS=sv1-cray-unicos$CRAY_REL
874
+ ;;
830
875
  *:UNICOS/mp:*:*)
831
- echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
832
- exit ;;
876
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
877
+ GUESS=craynv-cray-unicosmp$CRAY_REL
878
+ ;;
833
879
  F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
834
880
  FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
835
881
  FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
836
882
  FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
837
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
838
- exit ;;
883
+ GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
884
+ ;;
839
885
  5000:UNIX_System_V:4.*:*)
840
886
  FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
841
887
  FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
842
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
843
- exit ;;
888
+ GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
889
+ ;;
844
890
  i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
845
- echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
846
- exit ;;
891
+ GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
892
+ ;;
847
893
  sparc*:BSD/OS:*:*)
848
- echo sparc-unknown-bsdi"$UNAME_RELEASE"
849
- exit ;;
894
+ GUESS=sparc-unknown-bsdi$UNAME_RELEASE
895
+ ;;
850
896
  *:BSD/OS:*:*)
851
- echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
852
- exit ;;
897
+ GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
898
+ ;;
853
899
  arm:FreeBSD:*:*)
854
900
  UNAME_PROCESSOR=`uname -p`
855
901
  set_cc_for_build
856
902
  if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
857
903
  | grep -q __ARM_PCS_VFP
858
904
  then
859
- echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
905
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
906
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
860
907
  else
861
- echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
908
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
909
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
862
910
  fi
863
- exit ;;
911
+ ;;
864
912
  *:FreeBSD:*:*)
865
- UNAME_PROCESSOR=`/usr/bin/uname -p`
866
- case "$UNAME_PROCESSOR" in
913
+ UNAME_PROCESSOR=`uname -p`
914
+ case $UNAME_PROCESSOR in
867
915
  amd64)
868
916
  UNAME_PROCESSOR=x86_64 ;;
869
917
  i386)
870
918
  UNAME_PROCESSOR=i586 ;;
871
919
  esac
872
- echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
873
- exit ;;
920
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
921
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
922
+ ;;
874
923
  i*:CYGWIN*:*)
875
- echo "$UNAME_MACHINE"-pc-cygwin
876
- exit ;;
924
+ GUESS=$UNAME_MACHINE-pc-cygwin
925
+ ;;
877
926
  *:MINGW64*:*)
878
- echo "$UNAME_MACHINE"-pc-mingw64
879
- exit ;;
927
+ GUESS=$UNAME_MACHINE-pc-mingw64
928
+ ;;
880
929
  *:MINGW*:*)
881
- echo "$UNAME_MACHINE"-pc-mingw32
882
- exit ;;
930
+ GUESS=$UNAME_MACHINE-pc-mingw32
931
+ ;;
883
932
  *:MSYS*:*)
884
- echo "$UNAME_MACHINE"-pc-msys
885
- exit ;;
933
+ GUESS=$UNAME_MACHINE-pc-msys
934
+ ;;
886
935
  i*:PW*:*)
887
- echo "$UNAME_MACHINE"-pc-pw32
888
- exit ;;
936
+ GUESS=$UNAME_MACHINE-pc-pw32
937
+ ;;
938
+ *:SerenityOS:*:*)
939
+ GUESS=$UNAME_MACHINE-pc-serenity
940
+ ;;
889
941
  *:Interix*:*)
890
- case "$UNAME_MACHINE" in
942
+ case $UNAME_MACHINE in
891
943
  x86)
892
- echo i586-pc-interix"$UNAME_RELEASE"
893
- exit ;;
944
+ GUESS=i586-pc-interix$UNAME_RELEASE
945
+ ;;
894
946
  authenticamd | genuineintel | EM64T)
895
- echo x86_64-unknown-interix"$UNAME_RELEASE"
896
- exit ;;
947
+ GUESS=x86_64-unknown-interix$UNAME_RELEASE
948
+ ;;
897
949
  IA64)
898
- echo ia64-unknown-interix"$UNAME_RELEASE"
899
- exit ;;
950
+ GUESS=ia64-unknown-interix$UNAME_RELEASE
951
+ ;;
900
952
  esac ;;
901
953
  i*:UWIN*:*)
902
- echo "$UNAME_MACHINE"-pc-uwin
903
- exit ;;
954
+ GUESS=$UNAME_MACHINE-pc-uwin
955
+ ;;
904
956
  amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
905
- echo x86_64-pc-cygwin
906
- exit ;;
957
+ GUESS=x86_64-pc-cygwin
958
+ ;;
907
959
  prep*:SunOS:5.*:*)
908
- echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
909
- exit ;;
960
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
961
+ GUESS=powerpcle-unknown-solaris2$SUN_REL
962
+ ;;
910
963
  *:GNU:*:*)
911
964
  # the GNU system
912
- echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
913
- exit ;;
965
+ GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
966
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
967
+ GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
968
+ ;;
914
969
  *:GNU/*:*:*)
915
970
  # other systems with GNU libc and userland
916
- echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
917
- exit ;;
971
+ GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
972
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
973
+ GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
974
+ ;;
975
+ x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
976
+ GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
977
+ ;;
978
+ *:[Mm]anagarm:*:*)
979
+ GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
980
+ ;;
918
981
  *:Minix:*:*)
919
- echo "$UNAME_MACHINE"-unknown-minix
920
- exit ;;
982
+ GUESS=$UNAME_MACHINE-unknown-minix
983
+ ;;
921
984
  aarch64:Linux:*:*)
922
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
923
- exit ;;
985
+ set_cc_for_build
986
+ CPU=$UNAME_MACHINE
987
+ LIBCABI=$LIBC
988
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
989
+ ABI=64
990
+ sed 's/^ //' << EOF > "$dummy.c"
991
+ #ifdef __ARM_EABI__
992
+ #ifdef __ARM_PCS_VFP
993
+ ABI=eabihf
994
+ #else
995
+ ABI=eabi
996
+ #endif
997
+ #endif
998
+ EOF
999
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1000
+ eval "$cc_set_abi"
1001
+ case $ABI in
1002
+ eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
1003
+ esac
1004
+ fi
1005
+ GUESS=$CPU-unknown-linux-$LIBCABI
1006
+ ;;
924
1007
  aarch64_be:Linux:*:*)
925
1008
  UNAME_MACHINE=aarch64_be
926
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
927
- exit ;;
1009
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1010
+ ;;
928
1011
  alpha:Linux:*:*)
929
1012
  case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
930
1013
  EV5) UNAME_MACHINE=alphaev5 ;;
@@ -937,60 +1020,72 @@ EOF
937
1020
  esac
938
1021
  objdump --private-headers /bin/sh | grep -q ld.so.1
939
1022
  if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
940
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
941
- exit ;;
942
- arc:Linux:*:* | arceb:Linux:*:*)
943
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
944
- exit ;;
1023
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1024
+ ;;
1025
+ arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
1026
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1027
+ ;;
945
1028
  arm*:Linux:*:*)
946
1029
  set_cc_for_build
947
1030
  if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
948
1031
  | grep -q __ARM_EABI__
949
1032
  then
950
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1033
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
951
1034
  else
952
1035
  if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
953
1036
  | grep -q __ARM_PCS_VFP
954
1037
  then
955
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
1038
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
956
1039
  else
957
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
1040
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
958
1041
  fi
959
1042
  fi
960
- exit ;;
1043
+ ;;
961
1044
  avr32*:Linux:*:*)
962
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
963
- exit ;;
1045
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1046
+ ;;
964
1047
  cris:Linux:*:*)
965
- echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
966
- exit ;;
1048
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1049
+ ;;
967
1050
  crisv32:Linux:*:*)
968
- echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
969
- exit ;;
1051
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1052
+ ;;
970
1053
  e2k:Linux:*:*)
971
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
972
- exit ;;
1054
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1055
+ ;;
973
1056
  frv:Linux:*:*)
974
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
975
- exit ;;
1057
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1058
+ ;;
976
1059
  hexagon:Linux:*:*)
977
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
978
- exit ;;
1060
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1061
+ ;;
979
1062
  i*86:Linux:*:*)
980
- echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
981
- exit ;;
1063
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBC
1064
+ ;;
982
1065
  ia64:Linux:*:*)
983
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
984
- exit ;;
1066
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1067
+ ;;
985
1068
  k1om:Linux:*:*)
986
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
987
- exit ;;
1069
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1070
+ ;;
1071
+ kvx:Linux:*:*)
1072
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1073
+ ;;
1074
+ kvx:cos:*:*)
1075
+ GUESS=$UNAME_MACHINE-unknown-cos
1076
+ ;;
1077
+ kvx:mbr:*:*)
1078
+ GUESS=$UNAME_MACHINE-unknown-mbr
1079
+ ;;
1080
+ loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1081
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1082
+ ;;
988
1083
  m32r*:Linux:*:*)
989
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
990
- exit ;;
1084
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1085
+ ;;
991
1086
  m68*:Linux:*:*)
992
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
993
- exit ;;
1087
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1088
+ ;;
994
1089
  mips:Linux:*:* | mips64:Linux:*:*)
995
1090
  set_cc_for_build
996
1091
  IS_GLIBC=0
@@ -1035,123 +1130,135 @@ EOF
1035
1130
  #endif
1036
1131
  #endif
1037
1132
  EOF
1038
- eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
1133
+ cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
1134
+ eval "$cc_set_vars"
1039
1135
  test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1040
1136
  ;;
1041
1137
  mips64el:Linux:*:*)
1042
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1043
- exit ;;
1138
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1139
+ ;;
1044
1140
  openrisc*:Linux:*:*)
1045
- echo or1k-unknown-linux-"$LIBC"
1046
- exit ;;
1141
+ GUESS=or1k-unknown-linux-$LIBC
1142
+ ;;
1047
1143
  or32:Linux:*:* | or1k*:Linux:*:*)
1048
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1049
- exit ;;
1144
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1145
+ ;;
1050
1146
  padre:Linux:*:*)
1051
- echo sparc-unknown-linux-"$LIBC"
1052
- exit ;;
1147
+ GUESS=sparc-unknown-linux-$LIBC
1148
+ ;;
1053
1149
  parisc64:Linux:*:* | hppa64:Linux:*:*)
1054
- echo hppa64-unknown-linux-"$LIBC"
1055
- exit ;;
1150
+ GUESS=hppa64-unknown-linux-$LIBC
1151
+ ;;
1056
1152
  parisc:Linux:*:* | hppa:Linux:*:*)
1057
1153
  # Look for CPU level
1058
1154
  case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1059
- PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1060
- PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1061
- *) echo hppa-unknown-linux-"$LIBC" ;;
1155
+ PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
1156
+ PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
1157
+ *) GUESS=hppa-unknown-linux-$LIBC ;;
1062
1158
  esac
1063
- exit ;;
1159
+ ;;
1064
1160
  ppc64:Linux:*:*)
1065
- echo powerpc64-unknown-linux-"$LIBC"
1066
- exit ;;
1161
+ GUESS=powerpc64-unknown-linux-$LIBC
1162
+ ;;
1067
1163
  ppc:Linux:*:*)
1068
- echo powerpc-unknown-linux-"$LIBC"
1069
- exit ;;
1164
+ GUESS=powerpc-unknown-linux-$LIBC
1165
+ ;;
1070
1166
  ppc64le:Linux:*:*)
1071
- echo powerpc64le-unknown-linux-"$LIBC"
1072
- exit ;;
1167
+ GUESS=powerpc64le-unknown-linux-$LIBC
1168
+ ;;
1073
1169
  ppcle:Linux:*:*)
1074
- echo powerpcle-unknown-linux-"$LIBC"
1075
- exit ;;
1076
- riscv32:Linux:*:* | riscv64:Linux:*:*)
1077
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1078
- exit ;;
1170
+ GUESS=powerpcle-unknown-linux-$LIBC
1171
+ ;;
1172
+ riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1173
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1174
+ ;;
1079
1175
  s390:Linux:*:* | s390x:Linux:*:*)
1080
- echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
1081
- exit ;;
1176
+ GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
1177
+ ;;
1082
1178
  sh64*:Linux:*:*)
1083
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1084
- exit ;;
1179
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1180
+ ;;
1085
1181
  sh*:Linux:*:*)
1086
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1087
- exit ;;
1182
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1183
+ ;;
1088
1184
  sparc:Linux:*:* | sparc64:Linux:*:*)
1089
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1090
- exit ;;
1185
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1186
+ ;;
1091
1187
  tile*:Linux:*:*)
1092
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1093
- exit ;;
1188
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1189
+ ;;
1094
1190
  vax:Linux:*:*)
1095
- echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
1096
- exit ;;
1191
+ GUESS=$UNAME_MACHINE-dec-linux-$LIBC
1192
+ ;;
1097
1193
  x86_64:Linux:*:*)
1098
1194
  set_cc_for_build
1195
+ CPU=$UNAME_MACHINE
1099
1196
  LIBCABI=$LIBC
1100
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1101
- if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
1102
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1103
- grep IS_X32 >/dev/null
1104
- then
1105
- LIBCABI="$LIBC"x32
1106
- fi
1197
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
1198
+ ABI=64
1199
+ sed 's/^ //' << EOF > "$dummy.c"
1200
+ #ifdef __i386__
1201
+ ABI=x86
1202
+ #else
1203
+ #ifdef __ILP32__
1204
+ ABI=x32
1205
+ #endif
1206
+ #endif
1207
+ EOF
1208
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1209
+ eval "$cc_set_abi"
1210
+ case $ABI in
1211
+ x86) CPU=i686 ;;
1212
+ x32) LIBCABI=${LIBC}x32 ;;
1213
+ esac
1107
1214
  fi
1108
- echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
1109
- exit ;;
1215
+ GUESS=$CPU-pc-linux-$LIBCABI
1216
+ ;;
1110
1217
  xtensa*:Linux:*:*)
1111
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1112
- exit ;;
1218
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1219
+ ;;
1113
1220
  i*86:DYNIX/ptx:4*:*)
1114
1221
  # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1115
1222
  # earlier versions are messed up and put the nodename in both
1116
1223
  # sysname and nodename.
1117
- echo i386-sequent-sysv4
1118
- exit ;;
1224
+ GUESS=i386-sequent-sysv4
1225
+ ;;
1119
1226
  i*86:UNIX_SV:4.2MP:2.*)
1120
1227
  # Unixware is an offshoot of SVR4, but it has its own version
1121
1228
  # number series starting with 2...
1122
1229
  # I am not positive that other SVR4 systems won't match this,
1123
1230
  # I just have to hope. -- rms.
1124
1231
  # Use sysv4.2uw... so that sysv4* matches it.
1125
- echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
1126
- exit ;;
1232
+ GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
1233
+ ;;
1127
1234
  i*86:OS/2:*:*)
1128
- # If we were able to find `uname', then EMX Unix compatibility
1235
+ # If we were able to find 'uname', then EMX Unix compatibility
1129
1236
  # is probably installed.
1130
- echo "$UNAME_MACHINE"-pc-os2-emx
1131
- exit ;;
1237
+ GUESS=$UNAME_MACHINE-pc-os2-emx
1238
+ ;;
1132
1239
  i*86:XTS-300:*:STOP)
1133
- echo "$UNAME_MACHINE"-unknown-stop
1134
- exit ;;
1240
+ GUESS=$UNAME_MACHINE-unknown-stop
1241
+ ;;
1135
1242
  i*86:atheos:*:*)
1136
- echo "$UNAME_MACHINE"-unknown-atheos
1137
- exit ;;
1243
+ GUESS=$UNAME_MACHINE-unknown-atheos
1244
+ ;;
1138
1245
  i*86:syllable:*:*)
1139
- echo "$UNAME_MACHINE"-pc-syllable
1140
- exit ;;
1246
+ GUESS=$UNAME_MACHINE-pc-syllable
1247
+ ;;
1141
1248
  i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1142
- echo i386-unknown-lynxos"$UNAME_RELEASE"
1143
- exit ;;
1249
+ GUESS=i386-unknown-lynxos$UNAME_RELEASE
1250
+ ;;
1144
1251
  i*86:*DOS:*:*)
1145
- echo "$UNAME_MACHINE"-pc-msdosdjgpp
1146
- exit ;;
1252
+ GUESS=$UNAME_MACHINE-pc-msdosdjgpp
1253
+ ;;
1147
1254
  i*86:*:4.*:*)
1148
1255
  UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1149
1256
  if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1150
- echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
1257
+ GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
1151
1258
  else
1152
- echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
1259
+ GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
1153
1260
  fi
1154
- exit ;;
1261
+ ;;
1155
1262
  i*86:*:5:[678]*)
1156
1263
  # UnixWare 7.x, OpenUNIX and OpenServer 6.
1157
1264
  case `/bin/uname -X | grep "^Machine"` in
@@ -1159,12 +1266,12 @@ EOF
1159
1266
  *Pentium) UNAME_MACHINE=i586 ;;
1160
1267
  *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1161
1268
  esac
1162
- echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
1163
- exit ;;
1269
+ GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1270
+ ;;
1164
1271
  i*86:*:3.2:*)
1165
1272
  if test -f /usr/options/cb.name; then
1166
1273
  UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1167
- echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
1274
+ GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
1168
1275
  elif /bin/uname -X 2>/dev/null >/dev/null ; then
1169
1276
  UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1170
1277
  (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1174,11 +1281,11 @@ EOF
1174
1281
  && UNAME_MACHINE=i686
1175
1282
  (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1176
1283
  && UNAME_MACHINE=i686
1177
- echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
1284
+ GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
1178
1285
  else
1179
- echo "$UNAME_MACHINE"-pc-sysv32
1286
+ GUESS=$UNAME_MACHINE-pc-sysv32
1180
1287
  fi
1181
- exit ;;
1288
+ ;;
1182
1289
  pc:*:*:*)
1183
1290
  # Left here for compatibility:
1184
1291
  # uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -1186,31 +1293,31 @@ EOF
1186
1293
  # Note: whatever this is, it MUST be the same as what config.sub
1187
1294
  # prints for the "djgpp" host, or else GDB configure will decide that
1188
1295
  # this is a cross-build.
1189
- echo i586-pc-msdosdjgpp
1190
- exit ;;
1296
+ GUESS=i586-pc-msdosdjgpp
1297
+ ;;
1191
1298
  Intel:Mach:3*:*)
1192
- echo i386-pc-mach3
1193
- exit ;;
1299
+ GUESS=i386-pc-mach3
1300
+ ;;
1194
1301
  paragon:*:*:*)
1195
- echo i860-intel-osf1
1196
- exit ;;
1302
+ GUESS=i860-intel-osf1
1303
+ ;;
1197
1304
  i860:*:4.*:*) # i860-SVR4
1198
1305
  if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1199
- echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
1306
+ GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
1200
1307
  else # Add other i860-SVR4 vendors below as they are discovered.
1201
- echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
1308
+ GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
1202
1309
  fi
1203
- exit ;;
1310
+ ;;
1204
1311
  mini*:CTIX:SYS*5:*)
1205
1312
  # "miniframe"
1206
- echo m68010-convergent-sysv
1207
- exit ;;
1313
+ GUESS=m68010-convergent-sysv
1314
+ ;;
1208
1315
  mc68k:UNIX:SYSTEM5:3.51m)
1209
- echo m68k-convergent-sysv
1210
- exit ;;
1316
+ GUESS=m68k-convergent-sysv
1317
+ ;;
1211
1318
  M680?0:D-NIX:5.3:*)
1212
- echo m68k-diab-dnix
1213
- exit ;;
1319
+ GUESS=m68k-diab-dnix
1320
+ ;;
1214
1321
  M68*:*:R3V[5678]*:*)
1215
1322
  test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1216
1323
  3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
@@ -1235,116 +1342,119 @@ EOF
1235
1342
  /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1236
1343
  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1237
1344
  m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1238
- echo m68k-unknown-lynxos"$UNAME_RELEASE"
1239
- exit ;;
1345
+ GUESS=m68k-unknown-lynxos$UNAME_RELEASE
1346
+ ;;
1240
1347
  mc68030:UNIX_System_V:4.*:*)
1241
- echo m68k-atari-sysv4
1242
- exit ;;
1348
+ GUESS=m68k-atari-sysv4
1349
+ ;;
1243
1350
  TSUNAMI:LynxOS:2.*:*)
1244
- echo sparc-unknown-lynxos"$UNAME_RELEASE"
1245
- exit ;;
1351
+ GUESS=sparc-unknown-lynxos$UNAME_RELEASE
1352
+ ;;
1246
1353
  rs6000:LynxOS:2.*:*)
1247
- echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1248
- exit ;;
1354
+ GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
1355
+ ;;
1249
1356
  PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1250
- echo powerpc-unknown-lynxos"$UNAME_RELEASE"
1251
- exit ;;
1357
+ GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
1358
+ ;;
1252
1359
  SM[BE]S:UNIX_SV:*:*)
1253
- echo mips-dde-sysv"$UNAME_RELEASE"
1254
- exit ;;
1360
+ GUESS=mips-dde-sysv$UNAME_RELEASE
1361
+ ;;
1255
1362
  RM*:ReliantUNIX-*:*:*)
1256
- echo mips-sni-sysv4
1257
- exit ;;
1363
+ GUESS=mips-sni-sysv4
1364
+ ;;
1258
1365
  RM*:SINIX-*:*:*)
1259
- echo mips-sni-sysv4
1260
- exit ;;
1366
+ GUESS=mips-sni-sysv4
1367
+ ;;
1261
1368
  *:SINIX-*:*:*)
1262
1369
  if uname -p 2>/dev/null >/dev/null ; then
1263
1370
  UNAME_MACHINE=`(uname -p) 2>/dev/null`
1264
- echo "$UNAME_MACHINE"-sni-sysv4
1371
+ GUESS=$UNAME_MACHINE-sni-sysv4
1265
1372
  else
1266
- echo ns32k-sni-sysv
1373
+ GUESS=ns32k-sni-sysv
1267
1374
  fi
1268
- exit ;;
1269
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1375
+ ;;
1376
+ PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
1270
1377
  # says <Richard.M.Bartel@ccMail.Census.GOV>
1271
- echo i586-unisys-sysv4
1272
- exit ;;
1378
+ GUESS=i586-unisys-sysv4
1379
+ ;;
1273
1380
  *:UNIX_System_V:4*:FTX*)
1274
1381
  # From Gerald Hewes <hewes@openmarket.com>.
1275
1382
  # How about differentiating between stratus architectures? -djm
1276
- echo hppa1.1-stratus-sysv4
1277
- exit ;;
1383
+ GUESS=hppa1.1-stratus-sysv4
1384
+ ;;
1278
1385
  *:*:*:FTX*)
1279
1386
  # From seanf@swdc.stratus.com.
1280
- echo i860-stratus-sysv4
1281
- exit ;;
1387
+ GUESS=i860-stratus-sysv4
1388
+ ;;
1282
1389
  i*86:VOS:*:*)
1283
1390
  # From Paul.Green@stratus.com.
1284
- echo "$UNAME_MACHINE"-stratus-vos
1285
- exit ;;
1391
+ GUESS=$UNAME_MACHINE-stratus-vos
1392
+ ;;
1286
1393
  *:VOS:*:*)
1287
1394
  # From Paul.Green@stratus.com.
1288
- echo hppa1.1-stratus-vos
1289
- exit ;;
1395
+ GUESS=hppa1.1-stratus-vos
1396
+ ;;
1290
1397
  mc68*:A/UX:*:*)
1291
- echo m68k-apple-aux"$UNAME_RELEASE"
1292
- exit ;;
1398
+ GUESS=m68k-apple-aux$UNAME_RELEASE
1399
+ ;;
1293
1400
  news*:NEWS-OS:6*:*)
1294
- echo mips-sony-newsos6
1295
- exit ;;
1401
+ GUESS=mips-sony-newsos6
1402
+ ;;
1296
1403
  R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1297
- if [ -d /usr/nec ]; then
1298
- echo mips-nec-sysv"$UNAME_RELEASE"
1404
+ if test -d /usr/nec; then
1405
+ GUESS=mips-nec-sysv$UNAME_RELEASE
1299
1406
  else
1300
- echo mips-unknown-sysv"$UNAME_RELEASE"
1407
+ GUESS=mips-unknown-sysv$UNAME_RELEASE
1301
1408
  fi
1302
- exit ;;
1409
+ ;;
1303
1410
  BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1304
- echo powerpc-be-beos
1305
- exit ;;
1411
+ GUESS=powerpc-be-beos
1412
+ ;;
1306
1413
  BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1307
- echo powerpc-apple-beos
1308
- exit ;;
1414
+ GUESS=powerpc-apple-beos
1415
+ ;;
1309
1416
  BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1310
- echo i586-pc-beos
1311
- exit ;;
1417
+ GUESS=i586-pc-beos
1418
+ ;;
1312
1419
  BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1313
- echo i586-pc-haiku
1314
- exit ;;
1315
- x86_64:Haiku:*:*)
1316
- echo x86_64-unknown-haiku
1317
- exit ;;
1420
+ GUESS=i586-pc-haiku
1421
+ ;;
1422
+ ppc:Haiku:*:*) # Haiku running on Apple PowerPC
1423
+ GUESS=powerpc-apple-haiku
1424
+ ;;
1425
+ *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
1426
+ GUESS=$UNAME_MACHINE-unknown-haiku
1427
+ ;;
1318
1428
  SX-4:SUPER-UX:*:*)
1319
- echo sx4-nec-superux"$UNAME_RELEASE"
1320
- exit ;;
1429
+ GUESS=sx4-nec-superux$UNAME_RELEASE
1430
+ ;;
1321
1431
  SX-5:SUPER-UX:*:*)
1322
- echo sx5-nec-superux"$UNAME_RELEASE"
1323
- exit ;;
1432
+ GUESS=sx5-nec-superux$UNAME_RELEASE
1433
+ ;;
1324
1434
  SX-6:SUPER-UX:*:*)
1325
- echo sx6-nec-superux"$UNAME_RELEASE"
1326
- exit ;;
1435
+ GUESS=sx6-nec-superux$UNAME_RELEASE
1436
+ ;;
1327
1437
  SX-7:SUPER-UX:*:*)
1328
- echo sx7-nec-superux"$UNAME_RELEASE"
1329
- exit ;;
1438
+ GUESS=sx7-nec-superux$UNAME_RELEASE
1439
+ ;;
1330
1440
  SX-8:SUPER-UX:*:*)
1331
- echo sx8-nec-superux"$UNAME_RELEASE"
1332
- exit ;;
1441
+ GUESS=sx8-nec-superux$UNAME_RELEASE
1442
+ ;;
1333
1443
  SX-8R:SUPER-UX:*:*)
1334
- echo sx8r-nec-superux"$UNAME_RELEASE"
1335
- exit ;;
1444
+ GUESS=sx8r-nec-superux$UNAME_RELEASE
1445
+ ;;
1336
1446
  SX-ACE:SUPER-UX:*:*)
1337
- echo sxace-nec-superux"$UNAME_RELEASE"
1338
- exit ;;
1447
+ GUESS=sxace-nec-superux$UNAME_RELEASE
1448
+ ;;
1339
1449
  Power*:Rhapsody:*:*)
1340
- echo powerpc-apple-rhapsody"$UNAME_RELEASE"
1341
- exit ;;
1450
+ GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
1451
+ ;;
1342
1452
  *:Rhapsody:*:*)
1343
- echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1344
- exit ;;
1453
+ GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
1454
+ ;;
1345
1455
  arm64:Darwin:*:*)
1346
- echo aarch64-apple-darwin"$UNAME_RELEASE"
1347
- exit ;;
1456
+ GUESS=aarch64-apple-darwin$UNAME_RELEASE
1457
+ ;;
1348
1458
  *:Darwin:*:*)
1349
1459
  UNAME_PROCESSOR=`uname -p`
1350
1460
  case $UNAME_PROCESSOR in
@@ -1359,7 +1469,7 @@ EOF
1359
1469
  else
1360
1470
  set_cc_for_build
1361
1471
  fi
1362
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1472
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
1363
1473
  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1364
1474
  (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1365
1475
  grep IS_64BIT_ARCH >/dev/null
@@ -1380,109 +1490,122 @@ EOF
1380
1490
  # uname -m returns i386 or x86_64
1381
1491
  UNAME_PROCESSOR=$UNAME_MACHINE
1382
1492
  fi
1383
- echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1384
- exit ;;
1493
+ GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
1494
+ ;;
1385
1495
  *:procnto*:*:* | *:QNX:[0123456789]*:*)
1386
1496
  UNAME_PROCESSOR=`uname -p`
1387
1497
  if test "$UNAME_PROCESSOR" = x86; then
1388
1498
  UNAME_PROCESSOR=i386
1389
1499
  UNAME_MACHINE=pc
1390
1500
  fi
1391
- echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
1392
- exit ;;
1501
+ GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
1502
+ ;;
1393
1503
  *:QNX:*:4*)
1394
- echo i386-pc-qnx
1395
- exit ;;
1504
+ GUESS=i386-pc-qnx
1505
+ ;;
1396
1506
  NEO-*:NONSTOP_KERNEL:*:*)
1397
- echo neo-tandem-nsk"$UNAME_RELEASE"
1398
- exit ;;
1507
+ GUESS=neo-tandem-nsk$UNAME_RELEASE
1508
+ ;;
1399
1509
  NSE-*:NONSTOP_KERNEL:*:*)
1400
- echo nse-tandem-nsk"$UNAME_RELEASE"
1401
- exit ;;
1510
+ GUESS=nse-tandem-nsk$UNAME_RELEASE
1511
+ ;;
1402
1512
  NSR-*:NONSTOP_KERNEL:*:*)
1403
- echo nsr-tandem-nsk"$UNAME_RELEASE"
1404
- exit ;;
1513
+ GUESS=nsr-tandem-nsk$UNAME_RELEASE
1514
+ ;;
1405
1515
  NSV-*:NONSTOP_KERNEL:*:*)
1406
- echo nsv-tandem-nsk"$UNAME_RELEASE"
1407
- exit ;;
1516
+ GUESS=nsv-tandem-nsk$UNAME_RELEASE
1517
+ ;;
1408
1518
  NSX-*:NONSTOP_KERNEL:*:*)
1409
- echo nsx-tandem-nsk"$UNAME_RELEASE"
1410
- exit ;;
1519
+ GUESS=nsx-tandem-nsk$UNAME_RELEASE
1520
+ ;;
1411
1521
  *:NonStop-UX:*:*)
1412
- echo mips-compaq-nonstopux
1413
- exit ;;
1522
+ GUESS=mips-compaq-nonstopux
1523
+ ;;
1414
1524
  BS2000:POSIX*:*:*)
1415
- echo bs2000-siemens-sysv
1416
- exit ;;
1525
+ GUESS=bs2000-siemens-sysv
1526
+ ;;
1417
1527
  DS/*:UNIX_System_V:*:*)
1418
- echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
1419
- exit ;;
1528
+ GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
1529
+ ;;
1420
1530
  *:Plan9:*:*)
1421
1531
  # "uname -m" is not consistent, so use $cputype instead. 386
1422
1532
  # is converted to i386 for consistency with other x86
1423
1533
  # operating systems.
1424
- # shellcheck disable=SC2154
1425
- if test "$cputype" = 386; then
1534
+ if test "${cputype-}" = 386; then
1426
1535
  UNAME_MACHINE=i386
1427
- else
1428
- UNAME_MACHINE="$cputype"
1536
+ elif test "x${cputype-}" != x; then
1537
+ UNAME_MACHINE=$cputype
1429
1538
  fi
1430
- echo "$UNAME_MACHINE"-unknown-plan9
1431
- exit ;;
1539
+ GUESS=$UNAME_MACHINE-unknown-plan9
1540
+ ;;
1432
1541
  *:TOPS-10:*:*)
1433
- echo pdp10-unknown-tops10
1434
- exit ;;
1542
+ GUESS=pdp10-unknown-tops10
1543
+ ;;
1435
1544
  *:TENEX:*:*)
1436
- echo pdp10-unknown-tenex
1437
- exit ;;
1545
+ GUESS=pdp10-unknown-tenex
1546
+ ;;
1438
1547
  KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1439
- echo pdp10-dec-tops20
1440
- exit ;;
1548
+ GUESS=pdp10-dec-tops20
1549
+ ;;
1441
1550
  XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1442
- echo pdp10-xkl-tops20
1443
- exit ;;
1551
+ GUESS=pdp10-xkl-tops20
1552
+ ;;
1444
1553
  *:TOPS-20:*:*)
1445
- echo pdp10-unknown-tops20
1446
- exit ;;
1554
+ GUESS=pdp10-unknown-tops20
1555
+ ;;
1447
1556
  *:ITS:*:*)
1448
- echo pdp10-unknown-its
1449
- exit ;;
1557
+ GUESS=pdp10-unknown-its
1558
+ ;;
1450
1559
  SEI:*:*:SEIUX)
1451
- echo mips-sei-seiux"$UNAME_RELEASE"
1452
- exit ;;
1560
+ GUESS=mips-sei-seiux$UNAME_RELEASE
1561
+ ;;
1453
1562
  *:DragonFly:*:*)
1454
- echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
1455
- exit ;;
1563
+ DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
1564
+ GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
1565
+ ;;
1456
1566
  *:*VMS:*:*)
1457
1567
  UNAME_MACHINE=`(uname -p) 2>/dev/null`
1458
- case "$UNAME_MACHINE" in
1459
- A*) echo alpha-dec-vms ; exit ;;
1460
- I*) echo ia64-dec-vms ; exit ;;
1461
- V*) echo vax-dec-vms ; exit ;;
1568
+ case $UNAME_MACHINE in
1569
+ A*) GUESS=alpha-dec-vms ;;
1570
+ I*) GUESS=ia64-dec-vms ;;
1571
+ V*) GUESS=vax-dec-vms ;;
1462
1572
  esac ;;
1463
1573
  *:XENIX:*:SysV)
1464
- echo i386-pc-xenix
1465
- exit ;;
1574
+ GUESS=i386-pc-xenix
1575
+ ;;
1466
1576
  i*86:skyos:*:*)
1467
- echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
1468
- exit ;;
1577
+ SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
1578
+ GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
1579
+ ;;
1469
1580
  i*86:rdos:*:*)
1470
- echo "$UNAME_MACHINE"-pc-rdos
1471
- exit ;;
1472
- i*86:AROS:*:*)
1473
- echo "$UNAME_MACHINE"-pc-aros
1474
- exit ;;
1581
+ GUESS=$UNAME_MACHINE-pc-rdos
1582
+ ;;
1583
+ i*86:Fiwix:*:*)
1584
+ GUESS=$UNAME_MACHINE-pc-fiwix
1585
+ ;;
1586
+ *:AROS:*:*)
1587
+ GUESS=$UNAME_MACHINE-unknown-aros
1588
+ ;;
1475
1589
  x86_64:VMkernel:*:*)
1476
- echo "$UNAME_MACHINE"-unknown-esx
1477
- exit ;;
1590
+ GUESS=$UNAME_MACHINE-unknown-esx
1591
+ ;;
1478
1592
  amd64:Isilon\ OneFS:*:*)
1479
- echo x86_64-unknown-onefs
1480
- exit ;;
1593
+ GUESS=x86_64-unknown-onefs
1594
+ ;;
1481
1595
  *:Unleashed:*:*)
1482
- echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
1483
- exit ;;
1596
+ GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
1597
+ ;;
1598
+ *:Ironclad:*:*)
1599
+ GUESS=$UNAME_MACHINE-unknown-ironclad
1600
+ ;;
1484
1601
  esac
1485
1602
 
1603
+ # Do we have a guess based on uname results?
1604
+ if test "x$GUESS" != x; then
1605
+ echo "$GUESS"
1606
+ exit
1607
+ fi
1608
+
1486
1609
  # No uname command or uname output not recognized.
1487
1610
  set_cc_for_build
1488
1611
  cat > "$dummy.c" <<EOF
@@ -1614,7 +1737,7 @@ main ()
1614
1737
  }
1615
1738
  EOF
1616
1739
 
1617
- $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1740
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
1618
1741
  { echo "$SYSTEM_NAME"; exit; }
1619
1742
 
1620
1743
  # Apollos put the system type in the environment.
@@ -1622,7 +1745,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1622
1745
 
1623
1746
  echo "$0: unable to guess system type" >&2
1624
1747
 
1625
- case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1748
+ case $UNAME_MACHINE:$UNAME_SYSTEM in
1626
1749
  mips:Linux | mips64:Linux)
1627
1750
  # If we got here on MIPS GNU/Linux, output extra information.
1628
1751
  cat >&2 <<EOF
@@ -1639,14 +1762,16 @@ This script (version $timestamp), has failed to recognize the
1639
1762
  operating system you are using. If your script is old, overwrite *all*
1640
1763
  copies of config.guess and config.sub with the latest versions from:
1641
1764
 
1642
- https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1765
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
1643
1766
  and
1644
- https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1767
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1645
1768
  EOF
1646
1769
 
1647
- year=`echo $timestamp | sed 's,-.*,,'`
1770
+ our_year=`echo $timestamp | sed 's,-.*,,'`
1771
+ thisyear=`date +%Y`
1648
1772
  # shellcheck disable=SC2003
1649
- if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
1773
+ script_age=`expr "$thisyear" - "$our_year"`
1774
+ if test "$script_age" -lt 3 ; then
1650
1775
  cat >&2 <<EOF
1651
1776
 
1652
1777
  If $0 has already been updated, send the following data and any