ffi 1.9.25 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (339) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +212 -0
  3. data/Gemfile +3 -4
  4. data/README.md +38 -18
  5. data/Rakefile +55 -146
  6. data/ext/ffi_c/AbstractMemory.c +29 -34
  7. data/ext/ffi_c/Buffer.c +4 -9
  8. data/ext/ffi_c/Call.c +16 -49
  9. data/ext/ffi_c/Call.h +4 -7
  10. data/ext/ffi_c/ClosurePool.c +75 -25
  11. data/ext/ffi_c/ClosurePool.h +3 -1
  12. data/ext/ffi_c/DynamicLibrary.c +2 -7
  13. data/ext/ffi_c/Function.c +47 -131
  14. data/ext/ffi_c/Function.h +0 -4
  15. data/ext/ffi_c/FunctionInfo.c +3 -8
  16. data/ext/ffi_c/LastError.c +49 -8
  17. data/ext/ffi_c/LongDouble.c +12 -10
  18. data/ext/ffi_c/LongDouble.h +0 -4
  19. data/ext/ffi_c/MemoryPointer.c +3 -8
  20. data/ext/ffi_c/MemoryPointer.h +0 -4
  21. data/ext/ffi_c/MethodHandle.c +21 -31
  22. data/ext/ffi_c/MethodHandle.h +3 -2
  23. data/ext/ffi_c/Platform.c +3 -54
  24. data/ext/ffi_c/Pointer.c +25 -26
  25. data/ext/ffi_c/Pointer.h +0 -4
  26. data/ext/ffi_c/Struct.c +49 -56
  27. data/ext/ffi_c/Struct.h +12 -6
  28. data/ext/ffi_c/StructByValue.c +2 -7
  29. data/ext/ffi_c/StructLayout.c +22 -20
  30. data/ext/ffi_c/Thread.c +4 -228
  31. data/ext/ffi_c/Thread.h +1 -20
  32. data/ext/ffi_c/Type.c +1 -19
  33. data/ext/ffi_c/Type.h +0 -1
  34. data/ext/ffi_c/Types.c +7 -8
  35. data/ext/ffi_c/Types.h +3 -4
  36. data/ext/ffi_c/Variadic.c +23 -24
  37. data/ext/ffi_c/compat.h +4 -0
  38. data/ext/ffi_c/extconf.rb +53 -30
  39. data/ext/ffi_c/ffi.c +3 -8
  40. data/ext/ffi_c/libffi.darwin.mk +1 -1
  41. data/ext/ffi_c/libffi/.appveyor.yml +29 -13
  42. data/ext/ffi_c/libffi/.gitattributes +4 -0
  43. data/ext/ffi_c/libffi/.travis.yml +51 -2
  44. data/ext/ffi_c/libffi/.travis/bfin-sim.exp +58 -0
  45. data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +14 -0
  46. data/ext/ffi_c/libffi/.travis/build-in-container.sh +12 -0
  47. data/ext/ffi_c/libffi/.travis/build.sh +116 -8
  48. data/ext/ffi_c/libffi/.travis/install.sh +65 -16
  49. data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
  50. data/ext/ffi_c/libffi/.travis/moxie-sim.exp +1 -1
  51. data/ext/ffi_c/libffi/.travis/or1k-sim.exp +58 -0
  52. data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +58 -0
  53. data/ext/ffi_c/libffi/.travis/site.exp +10 -1
  54. data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
  55. data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
  56. data/ext/ffi_c/libffi/LICENSE +1 -1
  57. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
  58. data/ext/ffi_c/libffi/Makefile.am +56 -72
  59. data/ext/ffi_c/libffi/README.md +33 -8
  60. data/ext/ffi_c/libffi/config.guess +552 -331
  61. data/ext/ffi_c/libffi/config.sub +1321 -1306
  62. data/ext/ffi_c/libffi/configure.ac +37 -12
  63. data/ext/ffi_c/libffi/configure.host +56 -27
  64. data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
  65. data/ext/ffi_c/libffi/doc/libffi.texi +997 -0
  66. data/ext/ffi_c/libffi/doc/version.texi +4 -0
  67. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +2 -4
  68. data/ext/ffi_c/libffi/include/ffi.h.in +19 -7
  69. data/ext/ffi_c/libffi/include/ffi_common.h +5 -1
  70. data/ext/ffi_c/libffi/libffi.map.in +8 -12
  71. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
  72. data/ext/ffi_c/libffi/libtool-version +1 -1
  73. data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
  74. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
  75. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
  76. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +2 -1
  77. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
  78. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
  79. data/ext/ffi_c/libffi/make_sunver.pl +333 -0
  80. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
  81. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
  82. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
  83. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
  84. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
  85. data/ext/ffi_c/libffi/msvcc.sh +38 -13
  86. data/ext/ffi_c/libffi/src/aarch64/ffi.c +153 -69
  87. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
  88. data/ext/ffi_c/libffi/src/aarch64/internal.h +1 -0
  89. data/ext/ffi_c/libffi/src/aarch64/sysv.S +22 -9
  90. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
  91. data/ext/ffi_c/libffi/src/arm/ffi.c +62 -5
  92. data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
  93. data/ext/ffi_c/libffi/src/arm/sysv.S +6 -4
  94. data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
  95. data/ext/ffi_c/libffi/src/closures.c +69 -14
  96. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  97. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  98. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  99. data/ext/ffi_c/libffi/src/dlmalloc.c +1 -1
  100. data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
  101. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  102. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  103. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  104. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  105. data/ext/ffi_c/libffi/src/metag/ffi.c +1 -1
  106. data/ext/ffi_c/libffi/src/mips/ffi.c +5 -1
  107. data/ext/ffi_c/libffi/src/mips/ffitarget.h +1 -1
  108. data/ext/ffi_c/libffi/src/mips/o32.S +2 -0
  109. data/ext/ffi_c/libffi/src/moxie/ffi.c +1 -1
  110. data/ext/ffi_c/libffi/src/pa/ffi.c +46 -91
  111. data/ext/ffi_c/libffi/src/pa/ffitarget.h +1 -6
  112. data/ext/ffi_c/libffi/src/pa/hpux32.S +4 -2
  113. data/ext/ffi_c/libffi/src/pa/linux.S +27 -4
  114. data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
  115. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
  116. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +211 -32
  117. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
  118. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
  119. data/ext/ffi_c/libffi/src/powerpc/linux64.S +91 -28
  120. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +81 -5
  121. data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
  122. data/ext/ffi_c/libffi/src/prep_cif.c +4 -2
  123. data/ext/ffi_c/libffi/src/riscv/ffi.c +42 -6
  124. data/ext/ffi_c/libffi/src/riscv/ffitarget.h +1 -0
  125. data/ext/ffi_c/libffi/src/riscv/sysv.S +86 -7
  126. data/ext/ffi_c/libffi/src/x86/ffi.c +29 -12
  127. data/ext/ffi_c/libffi/src/x86/ffi64.c +22 -11
  128. data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -2
  129. data/ext/ffi_c/libffi/src/x86/ffiw64.c +20 -10
  130. data/ext/ffi_c/libffi/src/x86/sysv.S +105 -10
  131. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
  132. data/ext/ffi_c/libffi/src/x86/unix64.S +100 -4
  133. data/ext/ffi_c/libffi/src/x86/win64.S +12 -3
  134. data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
  135. data/ext/ffi_c/libffi/testsuite/Makefile.am +114 -109
  136. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +32 -8
  137. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
  138. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +4 -4
  139. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
  140. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
  141. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
  142. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -1
  143. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
  144. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +0 -0
  145. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +0 -0
  146. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +0 -0
  147. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +0 -0
  148. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +0 -0
  149. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +0 -0
  150. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +0 -0
  151. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +0 -0
  152. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +0 -0
  153. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +0 -0
  154. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +0 -0
  155. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +0 -0
  156. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +0 -0
  157. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +0 -0
  158. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +0 -0
  159. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +0 -0
  160. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +0 -0
  161. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +0 -0
  162. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +0 -0
  163. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +0 -0
  164. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +0 -0
  165. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +0 -0
  166. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +0 -0
  167. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +0 -0
  168. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +0 -0
  169. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +0 -0
  170. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +0 -0
  171. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +0 -0
  172. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +0 -0
  173. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +0 -0
  174. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +0 -0
  175. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +0 -0
  176. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +0 -0
  177. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +0 -0
  178. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +0 -0
  179. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +0 -0
  180. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +0 -0
  181. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +0 -0
  182. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +0 -0
  183. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +0 -0
  184. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +0 -0
  185. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +0 -0
  186. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +0 -0
  187. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +0 -0
  188. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +0 -0
  189. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +0 -0
  190. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +0 -0
  191. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
  192. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +0 -0
  193. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +0 -0
  194. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +0 -0
  195. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +0 -0
  196. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
  197. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
  198. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +0 -0
  199. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +0 -0
  200. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +0 -0
  201. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +0 -0
  202. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +0 -0
  203. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +0 -0
  204. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +0 -0
  205. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +0 -0
  206. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +0 -0
  207. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +0 -0
  208. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +0 -0
  209. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +0 -0
  210. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
  211. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar_va.c +0 -0
  212. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
  213. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +0 -0
  214. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +0 -0
  215. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +0 -0
  216. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
  217. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort_va.c +0 -0
  218. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
  219. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +138 -0
  220. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +3 -1
  221. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +0 -0
  222. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +0 -0
  223. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +0 -0
  224. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +0 -0
  225. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +0 -0
  226. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +0 -0
  227. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +0 -0
  228. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +0 -0
  229. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +0 -0
  230. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +0 -0
  231. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +0 -0
  232. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +0 -0
  233. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
  234. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
  235. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
  236. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +0 -0
  237. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +0 -0
  238. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +0 -0
  239. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +0 -0
  240. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +0 -0
  241. data/ext/ffi_c/rbffi.h +0 -2
  242. data/ffi.gemspec +13 -6
  243. data/lib/ffi.rb +10 -2
  244. data/lib/ffi/abstract_memory.rb +44 -0
  245. data/lib/ffi/autopointer.rb +1 -1
  246. data/lib/ffi/data_converter.rb +67 -0
  247. data/lib/ffi/ffi.rb +3 -0
  248. data/lib/ffi/io.rb +3 -3
  249. data/lib/ffi/library.rb +12 -8
  250. data/lib/ffi/managedstruct.rb +2 -2
  251. data/lib/ffi/platform.rb +34 -10
  252. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  253. data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
  254. data/lib/ffi/platform/aarch64-freebsd12/types.conf +128 -0
  255. data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
  256. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  257. data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
  258. data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
  259. data/lib/ffi/platform/arm-linux/types.conf +110 -82
  260. data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
  261. data/lib/ffi/platform/i386-darwin/types.conf +63 -63
  262. data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
  263. data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
  264. data/lib/ffi/platform/i386-gnu/types.conf +84 -84
  265. data/lib/ffi/platform/i386-linux/types.conf +77 -77
  266. data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
  267. data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
  268. data/lib/ffi/platform/i386-solaris/types.conf +96 -96
  269. data/lib/ffi/platform/i386-windows/types.conf +43 -96
  270. data/lib/ffi/platform/ia64-linux/types.conf +79 -79
  271. data/lib/ffi/platform/mips-linux/types.conf +79 -79
  272. data/lib/ffi/platform/mips64-linux/types.conf +81 -81
  273. data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
  274. data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
  275. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
  276. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
  277. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
  278. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
  279. data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
  280. data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
  281. data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
  282. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  283. data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
  284. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  285. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  286. data/lib/ffi/platform/s390-linux/types.conf +79 -79
  287. data/lib/ffi/platform/s390x-linux/types.conf +79 -79
  288. data/lib/ffi/platform/sparc-linux/types.conf +79 -79
  289. data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
  290. data/lib/ffi/platform/sparc64-linux/types.conf +79 -79
  291. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  292. data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
  293. data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
  294. data/lib/ffi/platform/x86_64-darwin/types.conf +88 -84
  295. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
  296. data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -90
  297. data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
  298. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  299. data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
  300. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  301. data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
  302. data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
  303. data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
  304. data/lib/ffi/platform/x86_64-windows/types.conf +42 -110
  305. data/lib/ffi/pointer.rb +26 -20
  306. data/lib/ffi/struct.rb +13 -68
  307. data/lib/ffi/struct_by_reference.rb +72 -0
  308. data/lib/ffi/struct_layout.rb +96 -0
  309. data/lib/ffi/tools/const_generator.rb +5 -4
  310. data/lib/ffi/tools/generator.rb +47 -2
  311. data/lib/ffi/tools/generator_task.rb +13 -17
  312. data/lib/ffi/tools/struct_generator.rb +4 -4
  313. data/lib/ffi/tools/types_generator.rb +7 -4
  314. data/lib/ffi/types.rb +1 -1
  315. data/lib/ffi/variadic.rb +1 -10
  316. data/lib/ffi/version.rb +1 -1
  317. data/rakelib/ffi_gem_helper.rb +65 -0
  318. data/samples/getlogin.rb +1 -1
  319. data/samples/getpid.rb +1 -1
  320. data/samples/gettimeofday.rb +8 -8
  321. data/samples/hello.rb +2 -1
  322. data/samples/inotify.rb +1 -1
  323. data/samples/pty.rb +1 -2
  324. data/samples/qsort.rb +0 -1
  325. metadata +160 -122
  326. data/.gitignore +0 -22
  327. data/.gitmodules +0 -3
  328. data/.travis.yml +0 -52
  329. data/.yardopts +0 -5
  330. data/appveyor.yml +0 -22
  331. data/ext/ffi_c/DataConverter.c +0 -91
  332. data/ext/ffi_c/StructByReference.c +0 -190
  333. data/ext/ffi_c/StructByReference.h +0 -50
  334. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
  335. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  336. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  337. data/ext/ffi_c/win32/stdbool.h +0 -8
  338. data/ext/ffi_c/win32/stdint.h +0 -201
  339. data/samples/sample_helper.rb +0 -6
@@ -1,4 +1,4 @@
1
- libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others.
1
+ libffi - Copyright (c) 1996-2020 Anthony Green, Red Hat, Inc and others.
2
2
  See source files for details.
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
@@ -1,10 +1,11 @@
1
1
  The libffi source distribution contains certain code that is not part
2
2
  of libffi, and is only used as tooling to assist with the building and
3
3
  testing of libffi. This includes the msvcc.sh script used to wrap the
4
- Microsoft compiler with GNU compatible command-line options, and the
5
- libffi test code distributed in the testsuite/libffi.bhaible
6
- directory. This code is distributed with libffi for the purpose of
7
- convenience only, and libffi is in no way derived from this code.
4
+ Microsoft compiler with GNU compatible command-line options,
5
+ make_sunver.pl, and the libffi test code distributed in the
6
+ testsuite/libffi.bhaible directory. This code is distributed with
7
+ libffi for the purpose of convenience only, and libffi is in no way
8
+ derived from this code.
8
9
 
9
10
  msvcc.sh an testsuite/libffi.bhaible are both distributed under the
10
11
  terms of the GNU GPL version 2, as below.
@@ -14,15 +14,14 @@ if BUILD_DOCS
14
14
  SUBDIRS += doc
15
15
  endif
16
16
 
17
- EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \
18
- ChangeLog.libffi ChangeLog.libffi-3.1 \
17
+ EXTRA_DIST = LICENSE ChangeLog.old \
19
18
  m4/libtool.m4 m4/lt~obsolete.m4 \
20
19
  m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
21
20
  m4/ltversion.m4 src/debug.c msvcc.sh \
22
21
  generate-darwin-source-and-headers.py \
23
22
  libffi.xcodeproj/project.pbxproj \
24
23
  libtool-ldflags libtool-version configure.host README.md \
25
- libffi.map.in
24
+ libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl
26
25
 
27
26
  # local.exp is generated by configure
28
27
  DISTCLEANFILES = local.exp
@@ -45,74 +44,55 @@ if FFI_DEBUG
45
44
  libffi_la_SOURCES += src/debug.c
46
45
  endif
47
46
 
48
- noinst_HEADERS = \
49
- src/aarch64/ffitarget.h src/aarch64/internal.h \
47
+ noinst_HEADERS = src/aarch64/ffitarget.h src/aarch64/internal.h \
50
48
  src/alpha/ffitarget.h src/alpha/internal.h \
51
- src/arc/ffitarget.h \
52
- src/arm/ffitarget.h src/arm/internal.h \
53
- src/avr32/ffitarget.h \
54
- src/bfin/ffitarget.h \
55
- src/cris/ffitarget.h \
56
- src/frv/ffitarget.h \
49
+ src/arc/ffitarget.h src/arm/ffitarget.h src/arm/internal.h \
50
+ src/avr32/ffitarget.h src/bfin/ffitarget.h \
51
+ src/cris/ffitarget.h src/csky/ffitarget.h src/frv/ffitarget.h \
57
52
  src/ia64/ffitarget.h src/ia64/ia64_flags.h \
58
- src/m32r/ffitarget.h \
59
- src/m68k/ffitarget.h \
60
- src/m88k/ffitarget.h \
61
- src/metag/ffitarget.h \
62
- src/microblaze/ffitarget.h \
63
- src/mips/ffitarget.h \
64
- src/moxie/ffitarget.h \
65
- src/nios2/ffitarget.h \
66
- src/or1k/ffitarget.h \
67
- src/pa/ffitarget.h \
68
- src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \
69
- src/riscv/ffitarget.h \
70
- src/s390/ffitarget.h src/s390/internal.h \
71
- src/sh/ffitarget.h \
72
- src/sh64/ffitarget.h \
73
- src/sparc/ffitarget.h src/sparc/internal.h \
74
- src/tile/ffitarget.h \
75
- src/vax/ffitarget.h \
76
- src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h src/x86/asmnames.h \
77
- src/xtensa/ffitarget.h \
78
- src/dlmalloc.c
79
-
80
- EXTRA_libffi_la_SOURCES = \
81
- src/aarch64/ffi.c src/aarch64/sysv.S \
82
- src/alpha/ffi.c src/alpha/osf.S \
83
- src/arc/ffi.c src/arc/arcompact.S \
84
- src/arm/ffi.c src/arm/sysv.S \
85
- src/avr32/ffi.c src/avr32/sysv.S \
86
- src/bfin/ffi.c src/bfin/sysv.S \
87
- src/cris/ffi.c src/cris/sysv.S \
88
- src/frv/ffi.c src/frv/eabi.S \
89
- src/ia64/ffi.c src/ia64/unix.S \
90
- src/m32r/ffi.c src/m32r/sysv.S \
91
- src/m68k/ffi.c src/m68k/sysv.S \
92
- src/m88k/ffi.c src/m88k/obsd.S \
93
- src/metag/ffi.c src/metag/sysv.S \
94
- src/microblaze/ffi.c src/microblaze/sysv.S \
95
- src/mips/ffi.c src/mips/o32.S src/mips/n32.S \
96
- src/moxie/ffi.c src/moxie/eabi.S \
97
- src/nios2/ffi.c src/nios2/sysv.S \
98
- src/or1k/ffi.c src/or1k/sysv.S \
99
- src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \
100
- src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \
101
- src/powerpc/sysv.S src/powerpc/linux64.S \
102
- src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \
103
- src/powerpc/aix.S src/powerpc/darwin.S src/powerpc/aix_closure.S \
104
- src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \
105
- src/riscv/ffi.c src/riscv/sysv.S \
106
- src/s390/ffi.c src/s390/sysv.S \
107
- src/sh/ffi.c src/sh/sysv.S \
108
- src/sh64/ffi.c src/sh64/sysv.S \
109
- src/sparc/ffi.c src/sparc/ffi64.c src/sparc/v8.S src/sparc/v9.S \
110
- src/tile/ffi.c src/tile/tile.S \
111
- src/vax/ffi.c src/vax/elfbsd.S \
112
- src/x86/ffi.c src/x86/sysv.S \
113
- src/x86/ffiw64.c src/x86/win64.S \
114
- src/x86/ffi64.c src/x86/unix64.S \
115
- src/xtensa/ffi.c src/xtensa/sysv.S
53
+ src/m32r/ffitarget.h src/m68k/ffitarget.h \
54
+ src/m88k/ffitarget.h src/metag/ffitarget.h \
55
+ src/microblaze/ffitarget.h src/mips/ffitarget.h \
56
+ src/moxie/ffitarget.h src/nios2/ffitarget.h \
57
+ src/or1k/ffitarget.h src/pa/ffitarget.h \
58
+ src/powerpc/ffitarget.h src/powerpc/asm.h \
59
+ src/powerpc/ffi_powerpc.h src/riscv/ffitarget.h \
60
+ src/s390/ffitarget.h src/s390/internal.h src/sh/ffitarget.h \
61
+ src/sh64/ffitarget.h src/sparc/ffitarget.h \
62
+ src/sparc/internal.h src/tile/ffitarget.h src/vax/ffitarget.h \
63
+ src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h \
64
+ src/x86/asmnames.h src/xtensa/ffitarget.h src/dlmalloc.c \
65
+ src/kvx/ffitarget.h
66
+
67
+ EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S \
68
+ src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S \
69
+ src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c \
70
+ src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S \
71
+ src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c \
72
+ src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c \
73
+ src/csky/ffi.c src/csky/sysv.S src/frv/eabi.S src/ia64/ffi.c \
74
+ src/ia64/unix.S src/m32r/ffi.c src/m32r/sysv.S src/m68k/ffi.c \
75
+ src/m68k/sysv.S src/m88k/ffi.c src/m88k/obsd.S \
76
+ src/metag/ffi.c src/metag/sysv.S src/microblaze/ffi.c \
77
+ src/microblaze/sysv.S src/mips/ffi.c src/mips/o32.S \
78
+ src/mips/n32.S src/moxie/ffi.c src/moxie/eabi.S \
79
+ src/nios2/ffi.c src/nios2/sysv.S src/or1k/ffi.c \
80
+ src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \
81
+ src/powerpc/ffi.c src/powerpc/ffi_sysv.c \
82
+ src/powerpc/ffi_linux64.c src/powerpc/sysv.S \
83
+ src/powerpc/linux64.S src/powerpc/linux64_closure.S \
84
+ src/powerpc/ppc_closure.S src/powerpc/aix.S \
85
+ src/powerpc/darwin.S src/powerpc/aix_closure.S \
86
+ src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \
87
+ src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c \
88
+ src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c \
89
+ src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c \
90
+ src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S \
91
+ src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S \
92
+ src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c \
93
+ src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S \
94
+ src/xtensa/ffi.c src/xtensa/sysv.S src/kvx/ffi.c \
95
+ src/kvx/sysv.S
116
96
 
117
97
  TARGET_OBJ = @TARGET_OBJ@
118
98
  libffi_la_LIBADD = $(TARGET_OBJ)
@@ -140,9 +120,9 @@ endif
140
120
  if LIBFFI_BUILD_VERSIONED_SHLIB_SUN
141
121
  libffi_version_script = -Wl,-M,libffi.map-sun
142
122
  libffi_version_dep = libffi.map-sun
143
- libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \
123
+ libffi.map-sun : libffi.map $(top_srcdir)/make_sunver.pl \
144
124
  $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
145
- perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \
125
+ perl $(top_srcdir)/make_sunver.pl libffi.map \
146
126
  `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \
147
127
  sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
148
128
  > $@ || (rm -f $@ ; exit 1)
@@ -154,7 +134,8 @@ endif
154
134
  libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
155
135
 
156
136
  libffi.map: $(top_srcdir)/libffi.map.in
157
- $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $<
137
+ $(COMPILE) -D$(TARGET) -DGENERATE_LIBFFI_MAP \
138
+ -E -x assembler-with-cpp -o $@ $(top_srcdir)/libffi.map.in
158
139
 
159
140
  libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS)
160
141
  libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
@@ -163,4 +144,7 @@ AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
163
144
  AM_CCASFLAGS = $(AM_CPPFLAGS)
164
145
 
165
146
  dist-hook:
147
+ d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc)
166
148
  if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
149
+ s=`awk '/was released on/{ print NR; exit}' $(top_srcdir)/README.md`; tail -n +$$(($$s-1)) $(top_srcdir)/README.md > $(distdir)/README.md
150
+
@@ -4,7 +4,7 @@ Status
4
4
  [![Build Status](https://travis-ci.org/libffi/libffi.svg?branch=master)](https://travis-ci.org/libffi/libffi)
5
5
  [![Build status](https://ci.appveyor.com/api/projects/status/8lko9vagbx4w2kxq?svg=true)](https://ci.appveyor.com/project/atgreen/libffi)
6
6
 
7
- libffi-3.3-rc0 was released on April 2, 2018. Check the libffi web
7
+ libffi-3.4 was released on TBD. Check the libffi web
8
8
  page for updates: <URL:http://sourceware.org/libffi/>.
9
9
 
10
10
 
@@ -51,14 +51,18 @@ tested:
51
51
  | --------------- | ---------------- | ----------------------- |
52
52
  | AArch64 (ARM64) | iOS | Clang |
53
53
  | AArch64 | Linux | GCC |
54
+ | AArch64 | Windows | MSVC |
54
55
  | Alpha | Linux | GCC |
55
56
  | Alpha | Tru64 | GCC |
56
57
  | ARC | Linux | GCC |
57
58
  | ARM | Linux | GCC |
58
59
  | ARM | iOS | GCC |
60
+ | ARM | Windows | MSVC |
59
61
  | AVR32 | Linux | GCC |
60
62
  | Blackfin | uClinux | GCC |
63
+ | CSKY | Linux | GCC |
61
64
  | HPPA | HPUX | GCC |
65
+ | KVX | Linux | GCC |
62
66
  | IA-64 | Linux | GCC |
63
67
  | M68K | FreeMiNT | GCC |
64
68
  | M68K | Linux | GCC |
@@ -99,7 +103,6 @@ tested:
99
103
  | X86 | Interix | GCC |
100
104
  | X86 | kFreeBSD | GCC |
101
105
  | X86 | Linux | GCC |
102
- | X86 | Mac OSX | GCC |
103
106
  | X86 | OpenBSD | GCC |
104
107
  | X86 | OS/2 | GCC |
105
108
  | X86 | Solaris | GCC |
@@ -152,7 +155,7 @@ It's also possible to build libffi on Windows platforms with
152
155
  Microsoft's Visual C++ compiler. In this case, use the msvcc.sh
153
156
  wrapper script during configuration like so:
154
157
 
155
- path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP"
158
+ path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP" CPPFLAGS="-DFFI_BUILDING_DLL"
156
159
 
157
160
  For 64-bit Windows builds, use ``CC="path/to/msvcc.sh -m64"`` and
158
161
  ``CXX="path/to/msvcc.sh -m64"``. You may also need to specify
@@ -161,13 +164,18 @@ For 64-bit Windows builds, use ``CC="path/to/msvcc.sh -m64"`` and
161
164
  It is also possible to build libffi on Windows platforms with the LLVM
162
165
  project's clang-cl compiler, like below:
163
166
 
164
- path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP"
167
+ path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP"
165
168
 
166
169
  When building with MSVC under a MingW environment, you may need to
167
170
  remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
168
171
  command. ('cygpath' is not present in MingW, and is not required when
169
172
  using MingW-style paths.)
170
173
 
174
+ To build static library for ARM64 with MSVC using visual studio solution, msvc_build folder have
175
+ aarch64/Ffi_staticLib.sln
176
+ required header files in aarch64/aarch64_include/
177
+
178
+
171
179
  SPARC Solaris builds require the use of the GNU assembler and linker.
172
180
  Point ``AS`` and ``LD`` environment variables at those tool prior to
173
181
  configuration.
@@ -190,13 +198,25 @@ History
190
198
 
191
199
  See the git log for details at http://github.com/libffi/libffi.
192
200
 
193
- 3.3 TBD
201
+ 3.4 TBD
202
+ Add support for Alibaba's CSKY architecture.
203
+ Add support for Intel Control-flow Enforcement Technology (CET).
204
+ Add support for ARM Pointer Authentication (PA).
205
+ Fix 32-bit PPC regression.
206
+ Fix MIPS soft-float problem.
207
+
208
+ 3.3 Nov-23-19
194
209
  Add RISC-V support.
195
210
  New API in support of GO closures.
211
+ Add IEEE754 binary128 long double support for 64-bit Power
196
212
  Default to Microsoft's 64 bit long double ABI with Visual C++.
197
- GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI.
198
- Many new tests cases and bug fixes.
199
-
213
+ GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI.
214
+ Add Windows on ARM64 (WOA) support.
215
+ Add Windows 32-bit ARM support.
216
+ Raw java (gcj) API deprecated.
217
+ Add pre-built PDF documentation to source distribution.
218
+ Many new test cases and bug fixes.
219
+
200
220
  3.2.1 Nov-12-14
201
221
  Build fix for non-iOS AArch64 targets.
202
222
 
@@ -412,14 +432,18 @@ developers:
412
432
 
413
433
  aarch64 Marcus Shawcroft, James Greenhalgh
414
434
  alpha Richard Henderson
435
+ arc Hackers at Synopsis
415
436
  arm Raffaele Sena
437
+ avr32 Bradley Smith
416
438
  blackfin Alexandre Keunecke I. de Mendonca
417
439
  cris Simon Posnjak, Hans-Peter Nilsson
440
+ csky Ma Jun, Zhang Wenmeng
418
441
  frv Anthony Green
419
442
  ia64 Hans Boehm
420
443
  m32r Kazuhiro Inaoka
421
444
  m68k Andreas Schwab
422
445
  m88k Miod Vallat
446
+ metag Hackers at Imagination Technologies
423
447
  microblaze Nathan Rossi
424
448
  mips Anthony Green, Casey Marshall
425
449
  mips64 David Daney
@@ -430,6 +454,7 @@ developers:
430
454
  powerpc Geoffrey Keating, Andreas Tobler,
431
455
  David Edelsohn, John Hornkvist
432
456
  powerpc64 Jakub Jelinek
457
+ riscv Michael Knyszek, Andrew Waterman, Stef O'Rear
433
458
  s390 Gerhard Tonn, Ulrich Weigand
434
459
  sh Kaz Kojima
435
460
  sh64 Kaz Kojima
@@ -1,8 +1,8 @@
1
1
  #! /bin/sh
2
2
  # Attempt to guess a canonical system name.
3
- # Copyright 1992-2017 Free Software Foundation, Inc.
3
+ # Copyright 1992-2020 Free Software Foundation, Inc.
4
4
 
5
- timestamp='2017-05-11'
5
+ timestamp='2020-07-12'
6
6
 
7
7
  # This file is free software; you can redistribute it and/or modify it
8
8
  # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2017-05-11'
15
15
  # General Public License for more details.
16
16
  #
17
17
  # You should have received a copy of the GNU General Public License
18
- # along with this program; if not, see <http://www.gnu.org/licenses/>.
18
+ # along with this program; if not, see <https://www.gnu.org/licenses/>.
19
19
  #
20
20
  # As a special exception to the GNU General Public License, if you
21
21
  # distribute this file as part of a program that contains a
@@ -27,7 +27,7 @@ timestamp='2017-05-11'
27
27
  # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
28
28
  #
29
29
  # You can get the latest version of this script from:
30
- # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
30
+ # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
31
31
  #
32
32
  # Please send patches to <config-patches@gnu.org>.
33
33
 
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
39
39
 
40
40
  Output the configuration name of the system \`$me' is run on.
41
41
 
42
- Operation modes:
42
+ Options:
43
43
  -h, --help print this help, then exit
44
44
  -t, --time-stamp print date of last modification, then exit
45
45
  -v, --version print version number, then exit
@@ -50,7 +50,7 @@ version="\
50
50
  GNU config.guess ($timestamp)
51
51
 
52
52
  Originally written by Per Bothner.
53
- Copyright 1992-2017 Free Software Foundation, Inc.
53
+ Copyright 1992-2020 Free Software Foundation, Inc.
54
54
 
55
55
  This is free software; see the source for copying conditions. There is NO
56
56
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
84
84
  exit 1
85
85
  fi
86
86
 
87
- trap 'exit 1' 1 2 15
88
-
89
87
  # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90
88
  # compiler to aid in system detection is discouraged as it requires
91
89
  # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,40 @@ trap 'exit 1' 1 2 15
96
94
 
97
95
  # Portable tmp directory creation inspired by the Autoconf team.
98
96
 
99
- set_cc_for_build='
100
- trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101
- trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102
- : ${TMPDIR=/tmp} ;
103
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107
- dummy=$tmp/dummy ;
108
- tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109
- case $CC_FOR_BUILD,$HOST_CC,$CC in
110
- ,,) echo "int x;" > $dummy.c ;
111
- for c in cc gcc c89 c99 ; do
112
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
113
- CC_FOR_BUILD="$c"; break ;
114
- fi ;
115
- done ;
116
- if test x"$CC_FOR_BUILD" = x ; then
117
- CC_FOR_BUILD=no_compiler_found ;
118
- fi
119
- ;;
120
- ,,*) CC_FOR_BUILD=$CC ;;
121
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
122
- esac ; set_cc_for_build= ;'
97
+ tmp=
98
+ # shellcheck disable=SC2172
99
+ trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
100
+
101
+ set_cc_for_build() {
102
+ # prevent multiple calls if $tmp is already set
103
+ test "$tmp" && return 0
104
+ : "${TMPDIR=/tmp}"
105
+ # shellcheck disable=SC2039
106
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
107
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
108
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
109
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
110
+ dummy=$tmp/dummy
111
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
112
+ ,,) echo "int x;" > "$dummy.c"
113
+ for driver in cc gcc c89 c99 ; do
114
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
115
+ CC_FOR_BUILD="$driver"
116
+ break
117
+ fi
118
+ done
119
+ if test x"$CC_FOR_BUILD" = x ; then
120
+ CC_FOR_BUILD=no_compiler_found
121
+ fi
122
+ ;;
123
+ ,,*) CC_FOR_BUILD=$CC ;;
124
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
125
+ esac
126
+ }
123
127
 
124
128
  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125
129
  # (ghazi@noc.rutgers.edu 1994-08-24)
126
- if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
130
+ if test -f /.attbin/uname ; then
127
131
  PATH=$PATH:/.attbin ; export PATH
128
132
  fi
129
133
 
@@ -132,14 +136,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132
136
  UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
133
137
  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134
138
 
135
- case "${UNAME_SYSTEM}" in
139
+ case "$UNAME_SYSTEM" in
136
140
  Linux|GNU|GNU/*)
137
141
  # If the system lacks a compiler, then just pick glibc.
138
142
  # We could probably try harder.
139
143
  LIBC=gnu
140
144
 
141
- eval $set_cc_for_build
142
- cat <<-EOF > $dummy.c
145
+ set_cc_for_build
146
+ cat <<-EOF > "$dummy.c"
143
147
  #include <features.h>
144
148
  #if defined(__UCLIBC__)
145
149
  LIBC=uclibc
@@ -149,13 +153,20 @@ Linux|GNU|GNU/*)
149
153
  LIBC=gnu
150
154
  #endif
151
155
  EOF
152
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
156
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
157
+
158
+ # If ldd exists, use it to detect musl libc.
159
+ if command -v ldd >/dev/null && \
160
+ ldd --version 2>&1 | grep -q ^musl
161
+ then
162
+ LIBC=musl
163
+ fi
153
164
  ;;
154
165
  esac
155
166
 
156
167
  # Note: order is significant - the case branches are not exclusive.
157
168
 
158
- case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
169
+ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
159
170
  *:NetBSD:*:*)
160
171
  # NetBSD (nbsd) targets should (where applicable) match one or
161
172
  # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +180,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
169
180
  # portion of the name. We always set it to "unknown".
170
181
  sysctl="sysctl -n hw.machine_arch"
171
182
  UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
172
- /sbin/$sysctl 2>/dev/null || \
173
- /usr/sbin/$sysctl 2>/dev/null || \
183
+ "/sbin/$sysctl" 2>/dev/null || \
184
+ "/usr/sbin/$sysctl" 2>/dev/null || \
174
185
  echo unknown)`
175
- case "${UNAME_MACHINE_ARCH}" in
186
+ case "$UNAME_MACHINE_ARCH" in
176
187
  armeb) machine=armeb-unknown ;;
177
188
  arm*) machine=arm-unknown ;;
178
189
  sh3el) machine=shl-unknown ;;
179
190
  sh3eb) machine=sh-unknown ;;
180
191
  sh5el) machine=sh5le-unknown ;;
181
192
  earmv*)
182
- arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
183
- endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
184
- machine=${arch}${endian}-unknown
193
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
194
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
195
+ machine="${arch}${endian}"-unknown
185
196
  ;;
186
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
197
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
187
198
  esac
188
199
  # The Operating System including object format, if it has switched
189
200
  # to ELF recently (or will in the future) and ABI.
190
- case "${UNAME_MACHINE_ARCH}" in
201
+ case "$UNAME_MACHINE_ARCH" in
191
202
  earm*)
192
203
  os=netbsdelf
193
204
  ;;
194
205
  arm*|i386|m68k|ns32k|sh3*|sparc|vax)
195
- eval $set_cc_for_build
206
+ set_cc_for_build
196
207
  if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
197
208
  | grep -q __ELF__
198
209
  then
@@ -208,10 +219,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
208
219
  ;;
209
220
  esac
210
221
  # Determine ABI tags.
211
- case "${UNAME_MACHINE_ARCH}" in
222
+ case "$UNAME_MACHINE_ARCH" in
212
223
  earm*)
213
224
  expr='s/^earmv[0-9]/-eabi/;s/eb$//'
214
- abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
225
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
215
226
  ;;
216
227
  esac
217
228
  # The OS release
@@ -219,45 +230,60 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
219
230
  # thus, need a distinct triplet. However, they do not need
220
231
  # kernel version information, so it can be replaced with a
221
232
  # suitable tag, in the style of linux-gnu.
222
- case "${UNAME_VERSION}" in
233
+ case "$UNAME_VERSION" in
223
234
  Debian*)
224
235
  release='-gnu'
225
236
  ;;
226
237
  *)
227
- release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
238
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
228
239
  ;;
229
240
  esac
230
241
  # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
231
242
  # contains redundant information, the shorter form:
232
243
  # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
233
- echo "${machine}-${os}${release}${abi}"
244
+ echo "$machine-${os}${release}${abi-}"
234
245
  exit ;;
235
246
  *:Bitrig:*:*)
236
247
  UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
237
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
248
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
238
249
  exit ;;
239
250
  *:OpenBSD:*:*)
240
251
  UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
241
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
252
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
242
253
  exit ;;
243
254
  *:LibertyBSD:*:*)
244
255
  UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
245
- echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
256
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
257
+ exit ;;
258
+ *:MidnightBSD:*:*)
259
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
246
260
  exit ;;
247
261
  *:ekkoBSD:*:*)
248
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
262
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
249
263
  exit ;;
250
264
  *:SolidBSD:*:*)
251
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
265
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
266
+ exit ;;
267
+ *:OS108:*:*)
268
+ echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
252
269
  exit ;;
253
270
  macppc:MirBSD:*:*)
254
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
271
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
255
272
  exit ;;
256
273
  *:MirBSD:*:*)
257
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
274
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
258
275
  exit ;;
259
276
  *:Sortix:*:*)
260
- echo ${UNAME_MACHINE}-unknown-sortix
277
+ echo "$UNAME_MACHINE"-unknown-sortix
278
+ exit ;;
279
+ *:Twizzler:*:*)
280
+ echo "$UNAME_MACHINE"-unknown-twizzler
281
+ exit ;;
282
+ *:Redox:*:*)
283
+ echo "$UNAME_MACHINE"-unknown-redox
284
+ exit ;;
285
+ mips:OSF1:*.*)
286
+ echo mips-dec-osf1
261
287
  exit ;;
262
288
  alpha:OSF1:*:*)
263
289
  case $UNAME_RELEASE in
@@ -310,28 +336,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
310
336
  # A Tn.n version is a released field test version.
311
337
  # A Xn.n version is an unreleased experimental baselevel.
312
338
  # 1.2 uses "1.2" for uname -r.
313
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
339
+ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
314
340
  # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
315
341
  exitcode=$?
316
342
  trap '' 0
317
343
  exit $exitcode ;;
318
- Alpha\ *:Windows_NT*:*)
319
- # How do we know it's Interix rather than the generic POSIX subsystem?
320
- # Should we change UNAME_MACHINE based on the output of uname instead
321
- # of the specific Alpha model?
322
- echo alpha-pc-interix
323
- exit ;;
324
- 21064:Windows_NT:50:3)
325
- echo alpha-dec-winnt3.5
326
- exit ;;
327
344
  Amiga*:UNIX_System_V:4.0:*)
328
345
  echo m68k-unknown-sysv4
329
346
  exit ;;
330
347
  *:[Aa]miga[Oo][Ss]:*:*)
331
- echo ${UNAME_MACHINE}-unknown-amigaos
348
+ echo "$UNAME_MACHINE"-unknown-amigaos
332
349
  exit ;;
333
350
  *:[Mm]orph[Oo][Ss]:*:*)
334
- echo ${UNAME_MACHINE}-unknown-morphos
351
+ echo "$UNAME_MACHINE"-unknown-morphos
335
352
  exit ;;
336
353
  *:OS/390:*:*)
337
354
  echo i370-ibm-openedition
@@ -343,7 +360,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
343
360
  echo powerpc-ibm-os400
344
361
  exit ;;
345
362
  arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
346
- echo arm-acorn-riscix${UNAME_RELEASE}
363
+ echo arm-acorn-riscix"$UNAME_RELEASE"
347
364
  exit ;;
348
365
  arm*:riscos:*:*|arm*:RISCOS:*:*)
349
366
  echo arm-unknown-riscos
@@ -370,19 +387,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
370
387
  sparc) echo sparc-icl-nx7; exit ;;
371
388
  esac ;;
372
389
  s390x:SunOS:*:*)
373
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
390
+ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
374
391
  exit ;;
375
392
  sun4H:SunOS:5.*:*)
376
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
393
+ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
377
394
  exit ;;
378
395
  sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
379
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
396
+ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
380
397
  exit ;;
381
398
  i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
382
- echo i386-pc-auroraux${UNAME_RELEASE}
399
+ echo i386-pc-auroraux"$UNAME_RELEASE"
383
400
  exit ;;
384
401
  i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
385
- eval $set_cc_for_build
402
+ set_cc_for_build
386
403
  SUN_ARCH=i386
387
404
  # If there is a compiler, see if it is configured for 64-bit objects.
388
405
  # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -395,13 +412,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
395
412
  SUN_ARCH=x86_64
396
413
  fi
397
414
  fi
398
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
415
+ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
399
416
  exit ;;
400
417
  sun4*:SunOS:6*:*)
401
418
  # According to config.sub, this is the proper way to canonicalize
402
419
  # SunOS6. Hard to guess exactly what SunOS6 will be like, but
403
420
  # it's likely to be more like Solaris than SunOS4.
404
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
421
+ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
405
422
  exit ;;
406
423
  sun4*:SunOS:*:*)
407
424
  case "`/usr/bin/arch -k`" in
@@ -410,25 +427,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
410
427
  ;;
411
428
  esac
412
429
  # Japanese Language versions have a version number like `4.1.3-JL'.
413
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
430
+ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
414
431
  exit ;;
415
432
  sun3*:SunOS:*:*)
416
- echo m68k-sun-sunos${UNAME_RELEASE}
433
+ echo m68k-sun-sunos"$UNAME_RELEASE"
417
434
  exit ;;
418
435
  sun*:*:4.2BSD:*)
419
436
  UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
420
- test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
437
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
421
438
  case "`/bin/arch`" in
422
439
  sun3)
423
- echo m68k-sun-sunos${UNAME_RELEASE}
440
+ echo m68k-sun-sunos"$UNAME_RELEASE"
424
441
  ;;
425
442
  sun4)
426
- echo sparc-sun-sunos${UNAME_RELEASE}
443
+ echo sparc-sun-sunos"$UNAME_RELEASE"
427
444
  ;;
428
445
  esac
429
446
  exit ;;
430
447
  aushp:SunOS:*:*)
431
- echo sparc-auspex-sunos${UNAME_RELEASE}
448
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
432
449
  exit ;;
433
450
  # The situation for MiNT is a little confusing. The machine name
434
451
  # can be virtually everything (everything which is not
@@ -439,44 +456,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
439
456
  # MiNT. But MiNT is downward compatible to TOS, so this should
440
457
  # be no problem.
441
458
  atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
442
- echo m68k-atari-mint${UNAME_RELEASE}
459
+ echo m68k-atari-mint"$UNAME_RELEASE"
443
460
  exit ;;
444
461
  atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
445
- echo m68k-atari-mint${UNAME_RELEASE}
462
+ echo m68k-atari-mint"$UNAME_RELEASE"
446
463
  exit ;;
447
464
  *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
448
- echo m68k-atari-mint${UNAME_RELEASE}
465
+ echo m68k-atari-mint"$UNAME_RELEASE"
449
466
  exit ;;
450
467
  milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
451
- echo m68k-milan-mint${UNAME_RELEASE}
468
+ echo m68k-milan-mint"$UNAME_RELEASE"
452
469
  exit ;;
453
470
  hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
454
- echo m68k-hades-mint${UNAME_RELEASE}
471
+ echo m68k-hades-mint"$UNAME_RELEASE"
455
472
  exit ;;
456
473
  *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
457
- echo m68k-unknown-mint${UNAME_RELEASE}
474
+ echo m68k-unknown-mint"$UNAME_RELEASE"
458
475
  exit ;;
459
476
  m68k:machten:*:*)
460
- echo m68k-apple-machten${UNAME_RELEASE}
477
+ echo m68k-apple-machten"$UNAME_RELEASE"
461
478
  exit ;;
462
479
  powerpc:machten:*:*)
463
- echo powerpc-apple-machten${UNAME_RELEASE}
480
+ echo powerpc-apple-machten"$UNAME_RELEASE"
464
481
  exit ;;
465
482
  RISC*:Mach:*:*)
466
483
  echo mips-dec-mach_bsd4.3
467
484
  exit ;;
468
485
  RISC*:ULTRIX:*:*)
469
- echo mips-dec-ultrix${UNAME_RELEASE}
486
+ echo mips-dec-ultrix"$UNAME_RELEASE"
470
487
  exit ;;
471
488
  VAX*:ULTRIX*:*:*)
472
- echo vax-dec-ultrix${UNAME_RELEASE}
489
+ echo vax-dec-ultrix"$UNAME_RELEASE"
473
490
  exit ;;
474
491
  2020:CLIX:*:* | 2430:CLIX:*:*)
475
- echo clipper-intergraph-clix${UNAME_RELEASE}
492
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
476
493
  exit ;;
477
494
  mips:*:*:UMIPS | mips:*:*:RISCos)
478
- eval $set_cc_for_build
479
- sed 's/^ //' << EOF >$dummy.c
495
+ set_cc_for_build
496
+ sed 's/^ //' << EOF > "$dummy.c"
480
497
  #ifdef __cplusplus
481
498
  #include <stdio.h> /* for printf() prototype */
482
499
  int main (int argc, char *argv[]) {
@@ -485,23 +502,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
485
502
  #endif
486
503
  #if defined (host_mips) && defined (MIPSEB)
487
504
  #if defined (SYSTYPE_SYSV)
488
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
505
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
489
506
  #endif
490
507
  #if defined (SYSTYPE_SVR4)
491
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
508
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
492
509
  #endif
493
510
  #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
494
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
511
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
495
512
  #endif
496
513
  #endif
497
514
  exit (-1);
498
515
  }
499
516
  EOF
500
- $CC_FOR_BUILD -o $dummy $dummy.c &&
501
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
502
- SYSTEM_NAME=`$dummy $dummyarg` &&
517
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
518
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
519
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
503
520
  { echo "$SYSTEM_NAME"; exit; }
504
- echo mips-mips-riscos${UNAME_RELEASE}
521
+ echo mips-mips-riscos"$UNAME_RELEASE"
505
522
  exit ;;
506
523
  Motorola:PowerMAX_OS:*:*)
507
524
  echo powerpc-motorola-powermax
@@ -527,17 +544,17 @@ EOF
527
544
  AViiON:dgux:*:*)
528
545
  # DG/UX returns AViiON for all architectures
529
546
  UNAME_PROCESSOR=`/usr/bin/uname -p`
530
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
547
+ if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
531
548
  then
532
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
533
- [ ${TARGET_BINARY_INTERFACE}x = x ]
549
+ if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
550
+ [ "$TARGET_BINARY_INTERFACE"x = x ]
534
551
  then
535
- echo m88k-dg-dgux${UNAME_RELEASE}
552
+ echo m88k-dg-dgux"$UNAME_RELEASE"
536
553
  else
537
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
554
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
538
555
  fi
539
556
  else
540
- echo i586-dg-dgux${UNAME_RELEASE}
557
+ echo i586-dg-dgux"$UNAME_RELEASE"
541
558
  fi
542
559
  exit ;;
543
560
  M88*:DolphinOS:*:*) # DolphinOS (SVR3)
@@ -554,7 +571,7 @@ EOF
554
571
  echo m68k-tektronix-bsd
555
572
  exit ;;
556
573
  *:IRIX*:*:*)
557
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
574
+ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
558
575
  exit ;;
559
576
  ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
560
577
  echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
@@ -566,14 +583,14 @@ EOF
566
583
  if [ -x /usr/bin/oslevel ] ; then
567
584
  IBM_REV=`/usr/bin/oslevel`
568
585
  else
569
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
586
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
570
587
  fi
571
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
588
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
572
589
  exit ;;
573
590
  *:AIX:2:3)
574
591
  if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
575
- eval $set_cc_for_build
576
- sed 's/^ //' << EOF >$dummy.c
592
+ set_cc_for_build
593
+ sed 's/^ //' << EOF > "$dummy.c"
577
594
  #include <sys/systemcfg.h>
578
595
 
579
596
  main()
@@ -584,7 +601,7 @@ EOF
584
601
  exit(0);
585
602
  }
586
603
  EOF
587
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
604
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
588
605
  then
589
606
  echo "$SYSTEM_NAME"
590
607
  else
@@ -598,7 +615,7 @@ EOF
598
615
  exit ;;
599
616
  *:AIX:*:[4567])
600
617
  IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
601
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
618
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
602
619
  IBM_ARCH=rs6000
603
620
  else
604
621
  IBM_ARCH=powerpc
@@ -607,18 +624,18 @@ EOF
607
624
  IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
608
625
  awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
609
626
  else
610
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
627
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
611
628
  fi
612
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
629
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
613
630
  exit ;;
614
631
  *:AIX:*:*)
615
632
  echo rs6000-ibm-aix
616
633
  exit ;;
617
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
634
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
618
635
  echo romp-ibm-bsd4.4
619
636
  exit ;;
620
637
  ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
621
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
638
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
622
639
  exit ;; # report: romp-ibm BSD 4.3
623
640
  *:BOSX:*:*)
624
641
  echo rs6000-bull-bosx
@@ -633,28 +650,28 @@ EOF
633
650
  echo m68k-hp-bsd4.4
634
651
  exit ;;
635
652
  9000/[34678]??:HP-UX:*:*)
636
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
637
- case "${UNAME_MACHINE}" in
638
- 9000/31? ) HP_ARCH=m68000 ;;
639
- 9000/[34]?? ) HP_ARCH=m68k ;;
653
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
654
+ case "$UNAME_MACHINE" in
655
+ 9000/31?) HP_ARCH=m68000 ;;
656
+ 9000/[34]??) HP_ARCH=m68k ;;
640
657
  9000/[678][0-9][0-9])
641
658
  if [ -x /usr/bin/getconf ]; then
642
659
  sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
643
660
  sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
644
- case "${sc_cpu_version}" in
661
+ case "$sc_cpu_version" in
645
662
  523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
646
663
  528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
647
664
  532) # CPU_PA_RISC2_0
648
- case "${sc_kernel_bits}" in
665
+ case "$sc_kernel_bits" in
649
666
  32) HP_ARCH=hppa2.0n ;;
650
667
  64) HP_ARCH=hppa2.0w ;;
651
668
  '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
652
669
  esac ;;
653
670
  esac
654
671
  fi
655
- if [ "${HP_ARCH}" = "" ]; then
656
- eval $set_cc_for_build
657
- sed 's/^ //' << EOF >$dummy.c
672
+ if [ "$HP_ARCH" = "" ]; then
673
+ set_cc_for_build
674
+ sed 's/^ //' << EOF > "$dummy.c"
658
675
 
659
676
  #define _HPUX_SOURCE
660
677
  #include <stdlib.h>
@@ -687,13 +704,13 @@ EOF
687
704
  exit (0);
688
705
  }
689
706
  EOF
690
- (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
707
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
691
708
  test -z "$HP_ARCH" && HP_ARCH=hppa
692
709
  fi ;;
693
710
  esac
694
- if [ ${HP_ARCH} = hppa2.0w ]
711
+ if [ "$HP_ARCH" = hppa2.0w ]
695
712
  then
696
- eval $set_cc_for_build
713
+ set_cc_for_build
697
714
 
698
715
  # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
699
716
  # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -712,15 +729,15 @@ EOF
712
729
  HP_ARCH=hppa64
713
730
  fi
714
731
  fi
715
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
732
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
716
733
  exit ;;
717
734
  ia64:HP-UX:*:*)
718
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
719
- echo ia64-hp-hpux${HPUX_REV}
735
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
736
+ echo ia64-hp-hpux"$HPUX_REV"
720
737
  exit ;;
721
738
  3050*:HI-UX:*:*)
722
- eval $set_cc_for_build
723
- sed 's/^ //' << EOF >$dummy.c
739
+ set_cc_for_build
740
+ sed 's/^ //' << EOF > "$dummy.c"
724
741
  #include <unistd.h>
725
742
  int
726
743
  main ()
@@ -745,11 +762,11 @@ EOF
745
762
  exit (0);
746
763
  }
747
764
  EOF
748
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
765
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
749
766
  { echo "$SYSTEM_NAME"; exit; }
750
767
  echo unknown-hitachi-hiuxwe2
751
768
  exit ;;
752
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
769
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
753
770
  echo hppa1.1-hp-bsd
754
771
  exit ;;
755
772
  9000/8??:4.3bsd:*:*)
@@ -758,7 +775,7 @@ EOF
758
775
  *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
759
776
  echo hppa1.0-hp-mpeix
760
777
  exit ;;
761
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
778
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
762
779
  echo hppa1.1-hp-osf
763
780
  exit ;;
764
781
  hp8??:OSF1:*:*)
@@ -766,9 +783,9 @@ EOF
766
783
  exit ;;
767
784
  i*86:OSF1:*:*)
768
785
  if [ -x /usr/sbin/sysversion ] ; then
769
- echo ${UNAME_MACHINE}-unknown-osf1mk
786
+ echo "$UNAME_MACHINE"-unknown-osf1mk
770
787
  else
771
- echo ${UNAME_MACHINE}-unknown-osf1
788
+ echo "$UNAME_MACHINE"-unknown-osf1
772
789
  fi
773
790
  exit ;;
774
791
  parisc*:Lites*:*:*)
@@ -793,131 +810,123 @@ EOF
793
810
  echo c4-convex-bsd
794
811
  exit ;;
795
812
  CRAY*Y-MP:*:*:*)
796
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
813
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
797
814
  exit ;;
798
815
  CRAY*[A-Z]90:*:*:*)
799
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
816
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
800
817
  | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
801
818
  -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
802
819
  -e 's/\.[^.]*$/.X/'
803
820
  exit ;;
804
821
  CRAY*TS:*:*:*)
805
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
822
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
806
823
  exit ;;
807
824
  CRAY*T3E:*:*:*)
808
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
825
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
809
826
  exit ;;
810
827
  CRAY*SV1:*:*:*)
811
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
828
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
812
829
  exit ;;
813
830
  *:UNICOS/mp:*:*)
814
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
831
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
815
832
  exit ;;
816
833
  F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
817
834
  FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
818
835
  FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
819
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
836
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
820
837
  echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
821
838
  exit ;;
822
839
  5000:UNIX_System_V:4.*:*)
823
840
  FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
824
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
841
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
825
842
  echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
826
843
  exit ;;
827
844
  i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
828
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
845
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
829
846
  exit ;;
830
847
  sparc*:BSD/OS:*:*)
831
- echo sparc-unknown-bsdi${UNAME_RELEASE}
848
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
832
849
  exit ;;
833
850
  *:BSD/OS:*:*)
834
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
851
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
852
+ exit ;;
853
+ arm:FreeBSD:*:*)
854
+ UNAME_PROCESSOR=`uname -p`
855
+ set_cc_for_build
856
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
857
+ | grep -q __ARM_PCS_VFP
858
+ then
859
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
860
+ else
861
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
862
+ fi
835
863
  exit ;;
836
864
  *:FreeBSD:*:*)
837
865
  UNAME_PROCESSOR=`/usr/bin/uname -p`
838
- case ${UNAME_PROCESSOR} in
866
+ case "$UNAME_PROCESSOR" in
839
867
  amd64)
840
868
  UNAME_PROCESSOR=x86_64 ;;
841
869
  i386)
842
870
  UNAME_PROCESSOR=i586 ;;
843
871
  esac
844
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
872
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
845
873
  exit ;;
846
874
  i*:CYGWIN*:*)
847
- echo ${UNAME_MACHINE}-pc-cygwin
875
+ echo "$UNAME_MACHINE"-pc-cygwin
848
876
  exit ;;
849
877
  *:MINGW64*:*)
850
- echo ${UNAME_MACHINE}-pc-mingw64
878
+ echo "$UNAME_MACHINE"-pc-mingw64
851
879
  exit ;;
852
880
  *:MINGW*:*)
853
- echo ${UNAME_MACHINE}-pc-mingw32
881
+ echo "$UNAME_MACHINE"-pc-mingw32
854
882
  exit ;;
855
883
  *:MSYS*:*)
856
- echo ${UNAME_MACHINE}-pc-msys
857
- exit ;;
858
- i*:windows32*:*)
859
- # uname -m includes "-pc" on this system.
860
- echo ${UNAME_MACHINE}-mingw32
884
+ echo "$UNAME_MACHINE"-pc-msys
861
885
  exit ;;
862
886
  i*:PW*:*)
863
- echo ${UNAME_MACHINE}-pc-pw32
887
+ echo "$UNAME_MACHINE"-pc-pw32
864
888
  exit ;;
865
889
  *:Interix*:*)
866
- case ${UNAME_MACHINE} in
890
+ case "$UNAME_MACHINE" in
867
891
  x86)
868
- echo i586-pc-interix${UNAME_RELEASE}
892
+ echo i586-pc-interix"$UNAME_RELEASE"
869
893
  exit ;;
870
894
  authenticamd | genuineintel | EM64T)
871
- echo x86_64-unknown-interix${UNAME_RELEASE}
895
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
872
896
  exit ;;
873
897
  IA64)
874
- echo ia64-unknown-interix${UNAME_RELEASE}
898
+ echo ia64-unknown-interix"$UNAME_RELEASE"
875
899
  exit ;;
876
900
  esac ;;
877
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
878
- echo i${UNAME_MACHINE}-pc-mks
879
- exit ;;
880
- 8664:Windows_NT:*)
881
- echo x86_64-pc-mks
882
- exit ;;
883
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
884
- # How do we know it's Interix rather than the generic POSIX subsystem?
885
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
886
- # UNAME_MACHINE based on the output of uname instead of i386?
887
- echo i586-pc-interix
888
- exit ;;
889
901
  i*:UWIN*:*)
890
- echo ${UNAME_MACHINE}-pc-uwin
902
+ echo "$UNAME_MACHINE"-pc-uwin
891
903
  exit ;;
892
904
  amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
893
- echo x86_64-unknown-cygwin
894
- exit ;;
895
- p*:CYGWIN*:*)
896
- echo powerpcle-unknown-cygwin
905
+ echo x86_64-pc-cygwin
897
906
  exit ;;
898
907
  prep*:SunOS:5.*:*)
899
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
908
+ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
900
909
  exit ;;
901
910
  *:GNU:*:*)
902
911
  # the GNU system
903
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
912
+ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
904
913
  exit ;;
905
914
  *:GNU/*:*:*)
906
915
  # other systems with GNU libc and userland
907
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
916
+ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
908
917
  exit ;;
909
- i*86:Minix:*:*)
910
- echo ${UNAME_MACHINE}-pc-minix
918
+ *:Minix:*:*)
919
+ echo "$UNAME_MACHINE"-unknown-minix
911
920
  exit ;;
912
921
  aarch64:Linux:*:*)
913
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
922
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
914
923
  exit ;;
915
924
  aarch64_be:Linux:*:*)
916
925
  UNAME_MACHINE=aarch64_be
917
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
926
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
918
927
  exit ;;
919
928
  alpha:Linux:*:*)
920
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
929
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
921
930
  EV5) UNAME_MACHINE=alphaev5 ;;
922
931
  EV56) UNAME_MACHINE=alphaev56 ;;
923
932
  PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -928,140 +937,178 @@ EOF
928
937
  esac
929
938
  objdump --private-headers /bin/sh | grep -q ld.so.1
930
939
  if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
931
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
940
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
932
941
  exit ;;
933
942
  arc:Linux:*:* | arceb:Linux:*:*)
934
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
943
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
935
944
  exit ;;
936
945
  arm*:Linux:*:*)
937
- eval $set_cc_for_build
946
+ set_cc_for_build
938
947
  if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
939
948
  | grep -q __ARM_EABI__
940
949
  then
941
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
950
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
942
951
  else
943
952
  if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
944
953
  | grep -q __ARM_PCS_VFP
945
954
  then
946
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
955
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
947
956
  else
948
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
957
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
949
958
  fi
950
959
  fi
951
960
  exit ;;
952
961
  avr32*:Linux:*:*)
953
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
962
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
954
963
  exit ;;
955
964
  cris:Linux:*:*)
956
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
965
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
957
966
  exit ;;
958
967
  crisv32:Linux:*:*)
959
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
968
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
960
969
  exit ;;
961
970
  e2k:Linux:*:*)
962
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
971
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
963
972
  exit ;;
964
973
  frv:Linux:*:*)
965
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
974
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
966
975
  exit ;;
967
976
  hexagon:Linux:*:*)
968
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
977
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
969
978
  exit ;;
970
979
  i*86:Linux:*:*)
971
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
980
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
972
981
  exit ;;
973
982
  ia64:Linux:*:*)
974
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
983
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
975
984
  exit ;;
976
985
  k1om:Linux:*:*)
977
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
986
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
978
987
  exit ;;
979
988
  m32r*:Linux:*:*)
980
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
989
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
981
990
  exit ;;
982
991
  m68*:Linux:*:*)
983
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
992
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
984
993
  exit ;;
985
994
  mips:Linux:*:* | mips64:Linux:*:*)
986
- eval $set_cc_for_build
987
- sed 's/^ //' << EOF >$dummy.c
995
+ set_cc_for_build
996
+ IS_GLIBC=0
997
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
998
+ sed 's/^ //' << EOF > "$dummy.c"
988
999
  #undef CPU
989
- #undef ${UNAME_MACHINE}
990
- #undef ${UNAME_MACHINE}el
1000
+ #undef mips
1001
+ #undef mipsel
1002
+ #undef mips64
1003
+ #undef mips64el
1004
+ #if ${IS_GLIBC} && defined(_ABI64)
1005
+ LIBCABI=gnuabi64
1006
+ #else
1007
+ #if ${IS_GLIBC} && defined(_ABIN32)
1008
+ LIBCABI=gnuabin32
1009
+ #else
1010
+ LIBCABI=${LIBC}
1011
+ #endif
1012
+ #endif
1013
+
1014
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1015
+ CPU=mipsisa64r6
1016
+ #else
1017
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1018
+ CPU=mipsisa32r6
1019
+ #else
1020
+ #if defined(__mips64)
1021
+ CPU=mips64
1022
+ #else
1023
+ CPU=mips
1024
+ #endif
1025
+ #endif
1026
+ #endif
1027
+
991
1028
  #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
992
- CPU=${UNAME_MACHINE}el
1029
+ MIPS_ENDIAN=el
993
1030
  #else
994
1031
  #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
995
- CPU=${UNAME_MACHINE}
1032
+ MIPS_ENDIAN=
996
1033
  #else
997
- CPU=
1034
+ MIPS_ENDIAN=
998
1035
  #endif
999
1036
  #endif
1000
1037
  EOF
1001
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
1002
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
1038
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
1039
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1003
1040
  ;;
1004
1041
  mips64el:Linux:*:*)
1005
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1042
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1006
1043
  exit ;;
1007
1044
  openrisc*:Linux:*:*)
1008
- echo or1k-unknown-linux-${LIBC}
1045
+ echo or1k-unknown-linux-"$LIBC"
1009
1046
  exit ;;
1010
1047
  or32:Linux:*:* | or1k*:Linux:*:*)
1011
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1048
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1012
1049
  exit ;;
1013
1050
  padre:Linux:*:*)
1014
- echo sparc-unknown-linux-${LIBC}
1051
+ echo sparc-unknown-linux-"$LIBC"
1015
1052
  exit ;;
1016
1053
  parisc64:Linux:*:* | hppa64:Linux:*:*)
1017
- echo hppa64-unknown-linux-${LIBC}
1054
+ echo hppa64-unknown-linux-"$LIBC"
1018
1055
  exit ;;
1019
1056
  parisc:Linux:*:* | hppa:Linux:*:*)
1020
1057
  # Look for CPU level
1021
1058
  case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1022
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
1023
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
1024
- *) echo hppa-unknown-linux-${LIBC} ;;
1059
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1060
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1061
+ *) echo hppa-unknown-linux-"$LIBC" ;;
1025
1062
  esac
1026
1063
  exit ;;
1027
1064
  ppc64:Linux:*:*)
1028
- echo powerpc64-unknown-linux-${LIBC}
1065
+ echo powerpc64-unknown-linux-"$LIBC"
1029
1066
  exit ;;
1030
1067
  ppc:Linux:*:*)
1031
- echo powerpc-unknown-linux-${LIBC}
1068
+ echo powerpc-unknown-linux-"$LIBC"
1032
1069
  exit ;;
1033
1070
  ppc64le:Linux:*:*)
1034
- echo powerpc64le-unknown-linux-${LIBC}
1071
+ echo powerpc64le-unknown-linux-"$LIBC"
1035
1072
  exit ;;
1036
1073
  ppcle:Linux:*:*)
1037
- echo powerpcle-unknown-linux-${LIBC}
1074
+ echo powerpcle-unknown-linux-"$LIBC"
1038
1075
  exit ;;
1039
1076
  riscv32:Linux:*:* | riscv64:Linux:*:*)
1040
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1077
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1041
1078
  exit ;;
1042
1079
  s390:Linux:*:* | s390x:Linux:*:*)
1043
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1080
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
1044
1081
  exit ;;
1045
1082
  sh64*:Linux:*:*)
1046
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1083
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1047
1084
  exit ;;
1048
1085
  sh*:Linux:*:*)
1049
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1086
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1050
1087
  exit ;;
1051
1088
  sparc:Linux:*:* | sparc64:Linux:*:*)
1052
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1089
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1053
1090
  exit ;;
1054
1091
  tile*:Linux:*:*)
1055
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1092
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1056
1093
  exit ;;
1057
1094
  vax:Linux:*:*)
1058
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1095
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
1059
1096
  exit ;;
1060
1097
  x86_64:Linux:*:*)
1061
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
1098
+ set_cc_for_build
1099
+ LIBCABI=$LIBC
1100
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1101
+ if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
1102
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1103
+ grep IS_X32 >/dev/null
1104
+ then
1105
+ LIBCABI="$LIBC"x32
1106
+ fi
1107
+ fi
1108
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
1062
1109
  exit ;;
1063
1110
  xtensa*:Linux:*:*)
1064
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1111
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1065
1112
  exit ;;
1066
1113
  i*86:DYNIX/ptx:4*:*)
1067
1114
  # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1075,34 +1122,34 @@ EOF
1075
1122
  # I am not positive that other SVR4 systems won't match this,
1076
1123
  # I just have to hope. -- rms.
1077
1124
  # Use sysv4.2uw... so that sysv4* matches it.
1078
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1125
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
1079
1126
  exit ;;
1080
1127
  i*86:OS/2:*:*)
1081
1128
  # If we were able to find `uname', then EMX Unix compatibility
1082
1129
  # is probably installed.
1083
- echo ${UNAME_MACHINE}-pc-os2-emx
1130
+ echo "$UNAME_MACHINE"-pc-os2-emx
1084
1131
  exit ;;
1085
1132
  i*86:XTS-300:*:STOP)
1086
- echo ${UNAME_MACHINE}-unknown-stop
1133
+ echo "$UNAME_MACHINE"-unknown-stop
1087
1134
  exit ;;
1088
1135
  i*86:atheos:*:*)
1089
- echo ${UNAME_MACHINE}-unknown-atheos
1136
+ echo "$UNAME_MACHINE"-unknown-atheos
1090
1137
  exit ;;
1091
1138
  i*86:syllable:*:*)
1092
- echo ${UNAME_MACHINE}-pc-syllable
1139
+ echo "$UNAME_MACHINE"-pc-syllable
1093
1140
  exit ;;
1094
1141
  i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1095
- echo i386-unknown-lynxos${UNAME_RELEASE}
1142
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
1096
1143
  exit ;;
1097
1144
  i*86:*DOS:*:*)
1098
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
1145
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
1099
1146
  exit ;;
1100
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1101
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1147
+ i*86:*:4.*:*)
1148
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1102
1149
  if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1103
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1150
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
1104
1151
  else
1105
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1152
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
1106
1153
  fi
1107
1154
  exit ;;
1108
1155
  i*86:*:5:[678]*)
@@ -1112,12 +1159,12 @@ EOF
1112
1159
  *Pentium) UNAME_MACHINE=i586 ;;
1113
1160
  *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1114
1161
  esac
1115
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1162
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
1116
1163
  exit ;;
1117
1164
  i*86:*:3.2:*)
1118
1165
  if test -f /usr/options/cb.name; then
1119
1166
  UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1120
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1167
+ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
1121
1168
  elif /bin/uname -X 2>/dev/null >/dev/null ; then
1122
1169
  UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1123
1170
  (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1127,9 +1174,9 @@ EOF
1127
1174
  && UNAME_MACHINE=i686
1128
1175
  (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1129
1176
  && UNAME_MACHINE=i686
1130
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1177
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
1131
1178
  else
1132
- echo ${UNAME_MACHINE}-pc-sysv32
1179
+ echo "$UNAME_MACHINE"-pc-sysv32
1133
1180
  fi
1134
1181
  exit ;;
1135
1182
  pc:*:*:*)
@@ -1149,9 +1196,9 @@ EOF
1149
1196
  exit ;;
1150
1197
  i860:*:4.*:*) # i860-SVR4
1151
1198
  if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1152
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1199
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
1153
1200
  else # Add other i860-SVR4 vendors below as they are discovered.
1154
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1201
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
1155
1202
  fi
1156
1203
  exit ;;
1157
1204
  mini*:CTIX:SYS*5:*)
@@ -1171,9 +1218,9 @@ EOF
1171
1218
  test -r /etc/.relid \
1172
1219
  && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1173
1220
  /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1174
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1221
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1175
1222
  /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1176
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1223
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1177
1224
  3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1178
1225
  /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1179
1226
  && { echo i486-ncr-sysv4; exit; } ;;
@@ -1182,28 +1229,28 @@ EOF
1182
1229
  test -r /etc/.relid \
1183
1230
  && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1184
1231
  /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1185
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1232
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1186
1233
  /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1187
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1234
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1188
1235
  /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1189
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1236
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1190
1237
  m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1191
- echo m68k-unknown-lynxos${UNAME_RELEASE}
1238
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
1192
1239
  exit ;;
1193
1240
  mc68030:UNIX_System_V:4.*:*)
1194
1241
  echo m68k-atari-sysv4
1195
1242
  exit ;;
1196
1243
  TSUNAMI:LynxOS:2.*:*)
1197
- echo sparc-unknown-lynxos${UNAME_RELEASE}
1244
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
1198
1245
  exit ;;
1199
1246
  rs6000:LynxOS:2.*:*)
1200
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
1247
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1201
1248
  exit ;;
1202
1249
  PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1203
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
1250
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
1204
1251
  exit ;;
1205
1252
  SM[BE]S:UNIX_SV:*:*)
1206
- echo mips-dde-sysv${UNAME_RELEASE}
1253
+ echo mips-dde-sysv"$UNAME_RELEASE"
1207
1254
  exit ;;
1208
1255
  RM*:ReliantUNIX-*:*:*)
1209
1256
  echo mips-sni-sysv4
@@ -1214,7 +1261,7 @@ EOF
1214
1261
  *:SINIX-*:*:*)
1215
1262
  if uname -p 2>/dev/null >/dev/null ; then
1216
1263
  UNAME_MACHINE=`(uname -p) 2>/dev/null`
1217
- echo ${UNAME_MACHINE}-sni-sysv4
1264
+ echo "$UNAME_MACHINE"-sni-sysv4
1218
1265
  else
1219
1266
  echo ns32k-sni-sysv
1220
1267
  fi
@@ -1234,23 +1281,23 @@ EOF
1234
1281
  exit ;;
1235
1282
  i*86:VOS:*:*)
1236
1283
  # From Paul.Green@stratus.com.
1237
- echo ${UNAME_MACHINE}-stratus-vos
1284
+ echo "$UNAME_MACHINE"-stratus-vos
1238
1285
  exit ;;
1239
1286
  *:VOS:*:*)
1240
1287
  # From Paul.Green@stratus.com.
1241
1288
  echo hppa1.1-stratus-vos
1242
1289
  exit ;;
1243
1290
  mc68*:A/UX:*:*)
1244
- echo m68k-apple-aux${UNAME_RELEASE}
1291
+ echo m68k-apple-aux"$UNAME_RELEASE"
1245
1292
  exit ;;
1246
1293
  news*:NEWS-OS:6*:*)
1247
1294
  echo mips-sony-newsos6
1248
1295
  exit ;;
1249
1296
  R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1250
1297
  if [ -d /usr/nec ]; then
1251
- echo mips-nec-sysv${UNAME_RELEASE}
1298
+ echo mips-nec-sysv"$UNAME_RELEASE"
1252
1299
  else
1253
- echo mips-unknown-sysv${UNAME_RELEASE}
1300
+ echo mips-unknown-sysv"$UNAME_RELEASE"
1254
1301
  fi
1255
1302
  exit ;;
1256
1303
  BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
@@ -1269,60 +1316,71 @@ EOF
1269
1316
  echo x86_64-unknown-haiku
1270
1317
  exit ;;
1271
1318
  SX-4:SUPER-UX:*:*)
1272
- echo sx4-nec-superux${UNAME_RELEASE}
1319
+ echo sx4-nec-superux"$UNAME_RELEASE"
1273
1320
  exit ;;
1274
1321
  SX-5:SUPER-UX:*:*)
1275
- echo sx5-nec-superux${UNAME_RELEASE}
1322
+ echo sx5-nec-superux"$UNAME_RELEASE"
1276
1323
  exit ;;
1277
1324
  SX-6:SUPER-UX:*:*)
1278
- echo sx6-nec-superux${UNAME_RELEASE}
1325
+ echo sx6-nec-superux"$UNAME_RELEASE"
1279
1326
  exit ;;
1280
1327
  SX-7:SUPER-UX:*:*)
1281
- echo sx7-nec-superux${UNAME_RELEASE}
1328
+ echo sx7-nec-superux"$UNAME_RELEASE"
1282
1329
  exit ;;
1283
1330
  SX-8:SUPER-UX:*:*)
1284
- echo sx8-nec-superux${UNAME_RELEASE}
1331
+ echo sx8-nec-superux"$UNAME_RELEASE"
1285
1332
  exit ;;
1286
1333
  SX-8R:SUPER-UX:*:*)
1287
- echo sx8r-nec-superux${UNAME_RELEASE}
1334
+ echo sx8r-nec-superux"$UNAME_RELEASE"
1288
1335
  exit ;;
1289
1336
  SX-ACE:SUPER-UX:*:*)
1290
- echo sxace-nec-superux${UNAME_RELEASE}
1337
+ echo sxace-nec-superux"$UNAME_RELEASE"
1291
1338
  exit ;;
1292
1339
  Power*:Rhapsody:*:*)
1293
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
1340
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
1294
1341
  exit ;;
1295
1342
  *:Rhapsody:*:*)
1296
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1343
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1344
+ exit ;;
1345
+ arm64:Darwin:*:*)
1346
+ echo aarch64-apple-darwin"$UNAME_RELEASE"
1297
1347
  exit ;;
1298
1348
  *:Darwin:*:*)
1299
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1300
- eval $set_cc_for_build
1301
- if test "$UNAME_PROCESSOR" = unknown ; then
1302
- UNAME_PROCESSOR=powerpc
1349
+ UNAME_PROCESSOR=`uname -p`
1350
+ case $UNAME_PROCESSOR in
1351
+ unknown) UNAME_PROCESSOR=powerpc ;;
1352
+ esac
1353
+ if command -v xcode-select > /dev/null 2> /dev/null && \
1354
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
1355
+ # Avoid executing cc if there is no toolchain installed as
1356
+ # cc will be a stub that puts up a graphical alert
1357
+ # prompting the user to install developer tools.
1358
+ CC_FOR_BUILD=no_compiler_found
1359
+ else
1360
+ set_cc_for_build
1303
1361
  fi
1304
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1305
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1306
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1307
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1308
- grep IS_64BIT_ARCH >/dev/null
1309
- then
1310
- case $UNAME_PROCESSOR in
1311
- i386) UNAME_PROCESSOR=x86_64 ;;
1312
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
1313
- esac
1314
- fi
1362
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1363
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1364
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1365
+ grep IS_64BIT_ARCH >/dev/null
1366
+ then
1367
+ case $UNAME_PROCESSOR in
1368
+ i386) UNAME_PROCESSOR=x86_64 ;;
1369
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
1370
+ esac
1371
+ fi
1372
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1373
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1374
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1375
+ grep IS_PPC >/dev/null
1376
+ then
1377
+ UNAME_PROCESSOR=powerpc
1315
1378
  fi
1316
1379
  elif test "$UNAME_PROCESSOR" = i386 ; then
1317
- # Avoid executing cc on OS X 10.9, as it ships with a stub
1318
- # that puts up a graphical alert prompting to install
1319
- # developer tools. Any system running Mac OS X 10.7 or
1320
- # later (Darwin 11 and later) is required to have a 64-bit
1321
- # processor. This is not true of the ARM version of Darwin
1322
- # that Apple uses in portable devices.
1323
- UNAME_PROCESSOR=x86_64
1380
+ # uname -m returns i386 or x86_64
1381
+ UNAME_PROCESSOR=$UNAME_MACHINE
1324
1382
  fi
1325
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1383
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1326
1384
  exit ;;
1327
1385
  *:procnto*:*:* | *:QNX:[0123456789]*:*)
1328
1386
  UNAME_PROCESSOR=`uname -p`
@@ -1330,22 +1388,25 @@ EOF
1330
1388
  UNAME_PROCESSOR=i386
1331
1389
  UNAME_MACHINE=pc
1332
1390
  fi
1333
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1391
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
1334
1392
  exit ;;
1335
1393
  *:QNX:*:4*)
1336
1394
  echo i386-pc-qnx
1337
1395
  exit ;;
1338
1396
  NEO-*:NONSTOP_KERNEL:*:*)
1339
- echo neo-tandem-nsk${UNAME_RELEASE}
1397
+ echo neo-tandem-nsk"$UNAME_RELEASE"
1340
1398
  exit ;;
1341
1399
  NSE-*:NONSTOP_KERNEL:*:*)
1342
- echo nse-tandem-nsk${UNAME_RELEASE}
1400
+ echo nse-tandem-nsk"$UNAME_RELEASE"
1343
1401
  exit ;;
1344
1402
  NSR-*:NONSTOP_KERNEL:*:*)
1345
- echo nsr-tandem-nsk${UNAME_RELEASE}
1403
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
1404
+ exit ;;
1405
+ NSV-*:NONSTOP_KERNEL:*:*)
1406
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
1346
1407
  exit ;;
1347
1408
  NSX-*:NONSTOP_KERNEL:*:*)
1348
- echo nsx-tandem-nsk${UNAME_RELEASE}
1409
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
1349
1410
  exit ;;
1350
1411
  *:NonStop-UX:*:*)
1351
1412
  echo mips-compaq-nonstopux
@@ -1354,18 +1415,19 @@ EOF
1354
1415
  echo bs2000-siemens-sysv
1355
1416
  exit ;;
1356
1417
  DS/*:UNIX_System_V:*:*)
1357
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1418
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
1358
1419
  exit ;;
1359
1420
  *:Plan9:*:*)
1360
1421
  # "uname -m" is not consistent, so use $cputype instead. 386
1361
1422
  # is converted to i386 for consistency with other x86
1362
1423
  # operating systems.
1424
+ # shellcheck disable=SC2154
1363
1425
  if test "$cputype" = 386; then
1364
1426
  UNAME_MACHINE=i386
1365
1427
  else
1366
1428
  UNAME_MACHINE="$cputype"
1367
1429
  fi
1368
- echo ${UNAME_MACHINE}-unknown-plan9
1430
+ echo "$UNAME_MACHINE"-unknown-plan9
1369
1431
  exit ;;
1370
1432
  *:TOPS-10:*:*)
1371
1433
  echo pdp10-unknown-tops10
@@ -1386,14 +1448,14 @@ EOF
1386
1448
  echo pdp10-unknown-its
1387
1449
  exit ;;
1388
1450
  SEI:*:*:SEIUX)
1389
- echo mips-sei-seiux${UNAME_RELEASE}
1451
+ echo mips-sei-seiux"$UNAME_RELEASE"
1390
1452
  exit ;;
1391
1453
  *:DragonFly:*:*)
1392
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1454
+ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
1393
1455
  exit ;;
1394
1456
  *:*VMS:*:*)
1395
1457
  UNAME_MACHINE=`(uname -p) 2>/dev/null`
1396
- case "${UNAME_MACHINE}" in
1458
+ case "$UNAME_MACHINE" in
1397
1459
  A*) echo alpha-dec-vms ; exit ;;
1398
1460
  I*) echo ia64-dec-vms ; exit ;;
1399
1461
  V*) echo vax-dec-vms ; exit ;;
@@ -1402,32 +1464,190 @@ EOF
1402
1464
  echo i386-pc-xenix
1403
1465
  exit ;;
1404
1466
  i*86:skyos:*:*)
1405
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
1467
+ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
1406
1468
  exit ;;
1407
1469
  i*86:rdos:*:*)
1408
- echo ${UNAME_MACHINE}-pc-rdos
1470
+ echo "$UNAME_MACHINE"-pc-rdos
1409
1471
  exit ;;
1410
1472
  i*86:AROS:*:*)
1411
- echo ${UNAME_MACHINE}-pc-aros
1473
+ echo "$UNAME_MACHINE"-pc-aros
1412
1474
  exit ;;
1413
1475
  x86_64:VMkernel:*:*)
1414
- echo ${UNAME_MACHINE}-unknown-esx
1476
+ echo "$UNAME_MACHINE"-unknown-esx
1415
1477
  exit ;;
1416
1478
  amd64:Isilon\ OneFS:*:*)
1417
1479
  echo x86_64-unknown-onefs
1418
1480
  exit ;;
1481
+ *:Unleashed:*:*)
1482
+ echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
1483
+ exit ;;
1484
+ esac
1485
+
1486
+ # No uname command or uname output not recognized.
1487
+ set_cc_for_build
1488
+ cat > "$dummy.c" <<EOF
1489
+ #ifdef _SEQUENT_
1490
+ #include <sys/types.h>
1491
+ #include <sys/utsname.h>
1492
+ #endif
1493
+ #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1494
+ #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1495
+ #include <signal.h>
1496
+ #if defined(_SIZE_T_) || defined(SIGLOST)
1497
+ #include <sys/utsname.h>
1498
+ #endif
1499
+ #endif
1500
+ #endif
1501
+ main ()
1502
+ {
1503
+ #if defined (sony)
1504
+ #if defined (MIPSEB)
1505
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1506
+ I don't know.... */
1507
+ printf ("mips-sony-bsd\n"); exit (0);
1508
+ #else
1509
+ #include <sys/param.h>
1510
+ printf ("m68k-sony-newsos%s\n",
1511
+ #ifdef NEWSOS4
1512
+ "4"
1513
+ #else
1514
+ ""
1515
+ #endif
1516
+ ); exit (0);
1517
+ #endif
1518
+ #endif
1519
+
1520
+ #if defined (NeXT)
1521
+ #if !defined (__ARCHITECTURE__)
1522
+ #define __ARCHITECTURE__ "m68k"
1523
+ #endif
1524
+ int version;
1525
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1526
+ if (version < 4)
1527
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1528
+ else
1529
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1530
+ exit (0);
1531
+ #endif
1532
+
1533
+ #if defined (MULTIMAX) || defined (n16)
1534
+ #if defined (UMAXV)
1535
+ printf ("ns32k-encore-sysv\n"); exit (0);
1536
+ #else
1537
+ #if defined (CMU)
1538
+ printf ("ns32k-encore-mach\n"); exit (0);
1539
+ #else
1540
+ printf ("ns32k-encore-bsd\n"); exit (0);
1541
+ #endif
1542
+ #endif
1543
+ #endif
1544
+
1545
+ #if defined (__386BSD__)
1546
+ printf ("i386-pc-bsd\n"); exit (0);
1547
+ #endif
1548
+
1549
+ #if defined (sequent)
1550
+ #if defined (i386)
1551
+ printf ("i386-sequent-dynix\n"); exit (0);
1552
+ #endif
1553
+ #if defined (ns32000)
1554
+ printf ("ns32k-sequent-dynix\n"); exit (0);
1555
+ #endif
1556
+ #endif
1557
+
1558
+ #if defined (_SEQUENT_)
1559
+ struct utsname un;
1560
+
1561
+ uname(&un);
1562
+ if (strncmp(un.version, "V2", 2) == 0) {
1563
+ printf ("i386-sequent-ptx2\n"); exit (0);
1564
+ }
1565
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1566
+ printf ("i386-sequent-ptx1\n"); exit (0);
1567
+ }
1568
+ printf ("i386-sequent-ptx\n"); exit (0);
1569
+ #endif
1570
+
1571
+ #if defined (vax)
1572
+ #if !defined (ultrix)
1573
+ #include <sys/param.h>
1574
+ #if defined (BSD)
1575
+ #if BSD == 43
1576
+ printf ("vax-dec-bsd4.3\n"); exit (0);
1577
+ #else
1578
+ #if BSD == 199006
1579
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
1580
+ #else
1581
+ printf ("vax-dec-bsd\n"); exit (0);
1582
+ #endif
1583
+ #endif
1584
+ #else
1585
+ printf ("vax-dec-bsd\n"); exit (0);
1586
+ #endif
1587
+ #else
1588
+ #if defined(_SIZE_T_) || defined(SIGLOST)
1589
+ struct utsname un;
1590
+ uname (&un);
1591
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1592
+ #else
1593
+ printf ("vax-dec-ultrix\n"); exit (0);
1594
+ #endif
1595
+ #endif
1596
+ #endif
1597
+ #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1598
+ #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1599
+ #if defined(_SIZE_T_) || defined(SIGLOST)
1600
+ struct utsname *un;
1601
+ uname (&un);
1602
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1603
+ #else
1604
+ printf ("mips-dec-ultrix\n"); exit (0);
1605
+ #endif
1606
+ #endif
1607
+ #endif
1608
+
1609
+ #if defined (alliant) && defined (i860)
1610
+ printf ("i860-alliant-bsd\n"); exit (0);
1611
+ #endif
1612
+
1613
+ exit (1);
1614
+ }
1615
+ EOF
1616
+
1617
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1618
+ { echo "$SYSTEM_NAME"; exit; }
1619
+
1620
+ # Apollos put the system type in the environment.
1621
+ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1622
+
1623
+ echo "$0: unable to guess system type" >&2
1624
+
1625
+ case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1626
+ mips:Linux | mips64:Linux)
1627
+ # If we got here on MIPS GNU/Linux, output extra information.
1628
+ cat >&2 <<EOF
1629
+
1630
+ NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1631
+ the system type. Please install a C compiler and try again.
1632
+ EOF
1633
+ ;;
1419
1634
  esac
1420
1635
 
1421
1636
  cat >&2 <<EOF
1422
- $0: unable to guess system type
1423
1637
 
1424
1638
  This script (version $timestamp), has failed to recognize the
1425
- operating system you are using. If your script is old, overwrite
1426
- config.guess and config.sub with the latest versions from:
1639
+ operating system you are using. If your script is old, overwrite *all*
1640
+ copies of config.guess and config.sub with the latest versions from:
1427
1641
 
1428
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1642
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1429
1643
  and
1430
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1644
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1645
+ EOF
1646
+
1647
+ year=`echo $timestamp | sed 's,-.*,,'`
1648
+ # shellcheck disable=SC2003
1649
+ if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
1650
+ cat >&2 <<EOF
1431
1651
 
1432
1652
  If $0 has already been updated, send the following data and any
1433
1653
  information you think might be pertinent to config-patches@gnu.org to
@@ -1450,16 +1670,17 @@ hostinfo = `(hostinfo) 2>/dev/null`
1450
1670
  /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1451
1671
  /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1452
1672
 
1453
- UNAME_MACHINE = ${UNAME_MACHINE}
1454
- UNAME_RELEASE = ${UNAME_RELEASE}
1455
- UNAME_SYSTEM = ${UNAME_SYSTEM}
1456
- UNAME_VERSION = ${UNAME_VERSION}
1673
+ UNAME_MACHINE = "$UNAME_MACHINE"
1674
+ UNAME_RELEASE = "$UNAME_RELEASE"
1675
+ UNAME_SYSTEM = "$UNAME_SYSTEM"
1676
+ UNAME_VERSION = "$UNAME_VERSION"
1457
1677
  EOF
1678
+ fi
1458
1679
 
1459
1680
  exit 1
1460
1681
 
1461
1682
  # Local variables:
1462
- # eval: (add-hook 'write-file-hooks 'time-stamp)
1683
+ # eval: (add-hook 'before-save-hook 'time-stamp)
1463
1684
  # time-stamp-start: "timestamp='"
1464
1685
  # time-stamp-format: "%:y-%02m-%02d"
1465
1686
  # time-stamp-end: "'"