ffi 1.0.0 → 1.17.1

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