ffi 1.1.5 → 1.15.5

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