ffi 1.9.24 → 1.16.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (457) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +348 -0
  4. data/Gemfile +4 -5
  5. data/README.md +44 -17
  6. data/Rakefile +74 -148
  7. data/ext/ffi_c/AbstractMemory.c +89 -70
  8. data/ext/ffi_c/AbstractMemory.h +3 -2
  9. data/ext/ffi_c/ArrayType.c +49 -13
  10. data/ext/ffi_c/ArrayType.h +1 -0
  11. data/ext/ffi_c/Buffer.c +90 -38
  12. data/ext/ffi_c/Call.c +55 -56
  13. data/ext/ffi_c/Call.h +12 -6
  14. data/ext/ffi_c/ClosurePool.c +333 -0
  15. data/ext/ffi_c/{Closure.h → ClosurePool.h} +25 -13
  16. data/ext/ffi_c/DynamicLibrary.c +91 -33
  17. data/ext/ffi_c/Function.c +306 -235
  18. data/ext/ffi_c/Function.h +3 -5
  19. data/ext/ffi_c/FunctionInfo.c +87 -32
  20. data/ext/ffi_c/LastError.c +74 -15
  21. data/ext/ffi_c/LongDouble.c +12 -10
  22. data/ext/ffi_c/LongDouble.h +0 -4
  23. data/ext/ffi_c/MappedType.c +66 -23
  24. data/ext/ffi_c/MappedType.h +0 -2
  25. data/ext/ffi_c/MemoryPointer.c +37 -15
  26. data/ext/ffi_c/MemoryPointer.h +0 -4
  27. data/ext/ffi_c/MethodHandle.c +265 -38
  28. data/ext/ffi_c/MethodHandle.h +3 -2
  29. data/ext/ffi_c/Platform.c +5 -56
  30. data/ext/ffi_c/Pointer.c +93 -55
  31. data/ext/ffi_c/Pointer.h +1 -4
  32. data/ext/ffi_c/Struct.c +202 -134
  33. data/ext/ffi_c/Struct.h +18 -9
  34. data/ext/ffi_c/StructByValue.c +50 -23
  35. data/ext/ffi_c/StructLayout.c +135 -64
  36. data/ext/ffi_c/Thread.c +4 -228
  37. data/ext/ffi_c/Thread.h +1 -20
  38. data/ext/ffi_c/Type.c +105 -55
  39. data/ext/ffi_c/Type.h +3 -2
  40. data/ext/ffi_c/Types.c +8 -9
  41. data/ext/ffi_c/Types.h +3 -4
  42. data/ext/ffi_c/Variadic.c +88 -47
  43. data/ext/ffi_c/compat.h +26 -22
  44. data/ext/ffi_c/extconf.rb +75 -32
  45. data/ext/ffi_c/ffi.c +9 -10
  46. data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
  47. data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
  48. data/ext/ffi_c/libffi/.appveyor.yml +53 -19
  49. data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
  50. data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
  51. data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
  52. data/ext/ffi_c/libffi/.ci/build.sh +124 -0
  53. data/ext/ffi_c/libffi/.ci/install.sh +78 -0
  54. data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
  55. data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +1 -1
  56. data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
  57. data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
  58. data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
  59. data/ext/ffi_c/libffi/.ci/site.exp +29 -0
  60. data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
  61. data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
  62. data/ext/ffi_c/libffi/.gitattributes +4 -0
  63. data/ext/ffi_c/libffi/.github/workflows/build.yml +460 -0
  64. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +171 -0
  65. data/ext/ffi_c/libffi/.gitignore +10 -2
  66. data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
  67. data/ext/ffi_c/libffi/LICENSE +1 -1
  68. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
  69. data/ext/ffi_c/libffi/Makefile.am +64 -73
  70. data/ext/ffi_c/libffi/Makefile.in +553 -235
  71. data/ext/ffi_c/libffi/README.md +165 -100
  72. data/ext/ffi_c/libffi/acinclude.m4 +10 -112
  73. data/ext/ffi_c/libffi/compile +348 -0
  74. data/ext/ffi_c/libffi/config.guess +950 -662
  75. data/ext/ffi_c/libffi/config.sub +1362 -1306
  76. data/ext/ffi_c/libffi/configure +4909 -4096
  77. data/ext/ffi_c/libffi/configure.ac +93 -32
  78. data/ext/ffi_c/libffi/configure.host +76 -28
  79. data/ext/ffi_c/libffi/doc/Makefile.in +15 -8
  80. data/ext/ffi_c/libffi/doc/libffi.texi +107 -46
  81. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  82. data/ext/ffi_c/libffi/fficonfig.h.in +22 -44
  83. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +165 -56
  84. data/ext/ffi_c/libffi/include/Makefile.am +1 -1
  85. data/ext/ffi_c/libffi/include/Makefile.in +17 -12
  86. data/ext/ffi_c/libffi/include/ffi.h.in +64 -48
  87. data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
  88. data/ext/ffi_c/libffi/include/ffi_common.h +34 -1
  89. data/ext/ffi_c/libffi/include/tramp.h +45 -0
  90. data/ext/ffi_c/libffi/install-sh +107 -74
  91. data/ext/ffi_c/libffi/libffi.map.in +8 -12
  92. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
  93. data/ext/ffi_c/libffi/libtool-version +2 -2
  94. data/ext/ffi_c/libffi/ltmain.sh +576 -284
  95. data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
  96. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
  97. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
  98. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
  99. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
  100. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -44
  101. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
  102. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
  103. data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
  104. data/ext/ffi_c/libffi/make_sunver.pl +333 -0
  105. data/ext/ffi_c/libffi/man/Makefile.in +15 -8
  106. data/ext/ffi_c/libffi/missing +8 -8
  107. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
  108. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
  109. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
  110. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
  111. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
  112. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
  113. data/ext/ffi_c/libffi/msvcc.sh +39 -14
  114. data/ext/ffi_c/libffi/src/aarch64/ffi.c +286 -98
  115. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
  116. data/ext/ffi_c/libffi/src/aarch64/internal.h +33 -0
  117. data/ext/ffi_c/libffi/src/aarch64/sysv.S +142 -37
  118. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
  119. data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
  120. data/ext/ffi_c/libffi/src/arc/ffi.c +325 -148
  121. data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
  122. data/ext/ffi_c/libffi/src/arm/ffi.c +112 -10
  123. data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
  124. data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
  125. data/ext/ffi_c/libffi/src/arm/sysv.S +117 -44
  126. data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
  127. data/ext/ffi_c/libffi/src/closures.c +189 -48
  128. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  129. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  130. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  131. data/ext/ffi_c/libffi/src/dlmalloc.c +6 -1
  132. data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
  133. data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
  134. data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
  135. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  136. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  137. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  138. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  139. data/ext/ffi_c/libffi/src/loongarch64/ffi.c +621 -0
  140. data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
  141. data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
  142. data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
  143. data/ext/ffi_c/libffi/src/metag/ffi.c +1 -1
  144. data/ext/ffi_c/libffi/src/mips/ffi.c +245 -66
  145. data/ext/ffi_c/libffi/src/mips/ffitarget.h +8 -1
  146. data/ext/ffi_c/libffi/src/mips/n32.S +137 -28
  147. data/ext/ffi_c/libffi/src/mips/o32.S +63 -4
  148. data/ext/ffi_c/libffi/src/moxie/ffi.c +48 -23
  149. data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
  150. data/ext/ffi_c/libffi/src/pa/ffi.c +62 -108
  151. data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
  152. data/ext/ffi_c/libffi/src/pa/ffitarget.h +20 -11
  153. data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
  154. data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
  155. data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
  156. data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
  157. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
  158. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +211 -32
  159. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
  160. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
  161. data/ext/ffi_c/libffi/src/powerpc/linux64.S +93 -28
  162. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +83 -5
  163. data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
  164. data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
  165. data/ext/ffi_c/libffi/src/prep_cif.c +26 -4
  166. data/ext/ffi_c/libffi/src/riscv/ffi.c +79 -10
  167. data/ext/ffi_c/libffi/src/riscv/ffitarget.h +1 -0
  168. data/ext/ffi_c/libffi/src/riscv/sysv.S +86 -7
  169. data/ext/ffi_c/libffi/src/sparc/ffi64.c +16 -0
  170. data/ext/ffi_c/libffi/src/tramp.c +716 -0
  171. data/ext/ffi_c/libffi/src/wasm32/ffi.c +934 -0
  172. data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
  173. data/ext/ffi_c/libffi/src/x86/ffi.c +128 -49
  174. data/ext/ffi_c/libffi/src/x86/ffi64.c +89 -23
  175. data/ext/ffi_c/libffi/src/x86/ffitarget.h +21 -4
  176. data/ext/ffi_c/libffi/src/x86/ffiw64.c +63 -10
  177. data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
  178. data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
  179. data/ext/ffi_c/libffi/src/x86/sysv.S +274 -45
  180. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
  181. data/ext/ffi_c/libffi/src/x86/unix64.S +190 -4
  182. data/ext/ffi_c/libffi/src/x86/win64.S +32 -10
  183. data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
  184. data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
  185. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
  186. data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
  187. data/ext/ffi_c/libffi/testsuite/Makefile.am +127 -109
  188. data/ext/ffi_c/libffi/testsuite/Makefile.in +144 -88
  189. data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
  190. data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
  191. data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +80 -0
  192. data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
  193. data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
  194. data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
  195. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +71 -25
  196. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
  197. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
  198. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +5 -4
  199. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
  200. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +5 -1
  201. data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
  202. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
  203. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
  204. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
  205. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +3 -0
  206. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
  207. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
  208. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
  209. data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
  210. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +8 -9
  211. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +2 -2
  212. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +2 -2
  213. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +2 -2
  214. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +1 -1
  215. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
  216. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
  217. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
  218. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
  219. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
  220. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
  221. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
  222. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
  223. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
  224. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -119
  225. data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
  226. data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
  227. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +13 -0
  228. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +11 -0
  229. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +15 -0
  230. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
  231. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
  232. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
  233. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
  234. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
  235. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
  236. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
  237. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
  238. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
  239. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +6 -0
  240. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +18 -0
  241. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +22 -0
  242. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +24 -0
  243. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +29 -0
  244. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -0
  245. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +19 -1
  246. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +21 -1
  247. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +35 -3
  248. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +13 -0
  249. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +19 -0
  250. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +13 -0
  251. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +13 -0
  252. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +18 -0
  253. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +22 -0
  254. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +13 -0
  255. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +29 -1
  256. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +19 -1
  257. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +24 -0
  258. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +28 -1
  259. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +24 -2
  260. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +39 -1
  261. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +25 -1
  262. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +14 -0
  263. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +14 -1
  264. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +14 -2
  265. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +19 -1
  266. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +19 -1
  267. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +20 -1
  268. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +40 -25
  269. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +40 -3
  270. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +19 -1
  271. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +18 -1
  272. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +18 -3
  273. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +18 -1
  274. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +18 -1
  275. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +19 -1
  276. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +19 -1
  277. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +3 -1
  278. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +9 -1
  279. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
  280. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +11 -1
  281. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +22 -3
  282. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
  283. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
  284. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
  285. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
  286. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
  287. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
  288. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +5 -0
  289. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +10 -0
  290. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
  291. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
  292. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
  293. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +11 -0
  294. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
  295. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
  296. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +4 -0
  297. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +4 -0
  298. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +2 -0
  299. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
  300. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
  301. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +24 -22
  302. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +32 -9
  303. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +1 -1
  304. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +12 -0
  305. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +21 -5
  306. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
  307. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
  308. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +10 -1
  309. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +10 -1
  310. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +9 -0
  311. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +9 -0
  312. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +11 -0
  313. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +9 -0
  314. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +11 -0
  315. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +11 -0
  316. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
  317. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
  318. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
  319. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +1 -1
  320. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +1 -1
  321. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +6 -1
  322. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +2 -1
  323. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +1 -0
  324. data/ext/ffi_c/libffi.bsd.mk +2 -2
  325. data/ext/ffi_c/libffi.darwin.mk +1 -1
  326. data/ext/ffi_c/libffi.gnu.mk +2 -2
  327. data/ext/ffi_c/rbffi.h +1 -3
  328. data/ffi.gemspec +15 -9
  329. data/lib/ffi/abstract_memory.rb +44 -0
  330. data/lib/ffi/autopointer.rb +8 -23
  331. data/lib/ffi/compat.rb +43 -0
  332. data/lib/ffi/data_converter.rb +67 -0
  333. data/lib/ffi/dynamic_library.rb +89 -0
  334. data/lib/ffi/enum.rb +18 -11
  335. data/lib/ffi/ffi.rb +6 -0
  336. data/lib/ffi/function.rb +71 -0
  337. data/lib/ffi/io.rb +3 -3
  338. data/lib/ffi/library.rb +65 -77
  339. data/lib/ffi/library_path.rb +109 -0
  340. data/lib/ffi/managedstruct.rb +3 -3
  341. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  342. data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
  343. data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
  344. data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
  345. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  346. data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
  347. data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
  348. data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
  349. data/lib/ffi/platform/arm-linux/types.conf +110 -82
  350. data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
  351. data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
  352. data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
  353. data/lib/ffi/platform/i386-darwin/types.conf +63 -63
  354. data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
  355. data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
  356. data/lib/ffi/platform/i386-gnu/types.conf +84 -84
  357. data/lib/ffi/platform/i386-linux/types.conf +77 -77
  358. data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
  359. data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
  360. data/lib/ffi/platform/i386-solaris/types.conf +96 -96
  361. data/lib/ffi/platform/i386-windows/types.conf +43 -96
  362. data/lib/ffi/platform/ia64-linux/types.conf +79 -79
  363. data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
  364. data/lib/ffi/platform/mips-linux/types.conf +79 -79
  365. data/lib/ffi/platform/mips64-linux/types.conf +81 -81
  366. data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
  367. data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
  368. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
  369. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
  370. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
  371. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
  372. data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
  373. data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
  374. data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
  375. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  376. data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
  377. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  378. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  379. data/lib/ffi/platform/s390-linux/types.conf +79 -79
  380. data/lib/ffi/platform/s390x-linux/types.conf +79 -79
  381. data/lib/ffi/platform/sparc-linux/types.conf +79 -79
  382. data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
  383. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  384. data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
  385. data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
  386. data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
  387. data/lib/ffi/platform/x86_64-darwin/types.conf +88 -84
  388. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
  389. data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -90
  390. data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
  391. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  392. data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
  393. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  394. data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
  395. data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
  396. data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
  397. data/lib/ffi/platform/x86_64-windows/types.conf +42 -110
  398. data/lib/ffi/platform.rb +43 -20
  399. data/lib/ffi/pointer.rb +26 -20
  400. data/lib/ffi/struct.rb +14 -68
  401. data/lib/ffi/struct_by_reference.rb +72 -0
  402. data/lib/ffi/struct_layout.rb +96 -0
  403. data/lib/ffi/struct_layout_builder.rb +1 -1
  404. data/lib/ffi/tools/const_generator.rb +11 -8
  405. data/lib/ffi/tools/generator.rb +47 -2
  406. data/lib/ffi/tools/generator_task.rb +13 -17
  407. data/lib/ffi/tools/struct_generator.rb +6 -5
  408. data/lib/ffi/tools/types_generator.rb +7 -4
  409. data/lib/ffi/types.rb +33 -7
  410. data/lib/ffi/variadic.rb +20 -18
  411. data/lib/ffi/version.rb +1 -1
  412. data/lib/ffi.rb +10 -3
  413. data/rakelib/ffi_gem_helper.rb +65 -0
  414. data/samples/getlogin.rb +1 -1
  415. data/samples/getpid.rb +1 -1
  416. data/samples/gettimeofday.rb +8 -8
  417. data/samples/hello.rb +2 -1
  418. data/samples/hello_ractor.rb +11 -0
  419. data/samples/inotify.rb +1 -1
  420. data/samples/pty.rb +1 -2
  421. data/samples/qsort.rb +0 -1
  422. data/samples/qsort_ractor.rb +28 -0
  423. data.tar.gz.sig +0 -0
  424. metadata +252 -153
  425. metadata.gz.sig +0 -0
  426. data/.gitignore +0 -22
  427. data/.gitmodules +0 -3
  428. data/.travis.yml +0 -52
  429. data/.yardopts +0 -5
  430. data/appveyor.yml +0 -22
  431. data/ext/ffi_c/Closure.c +0 -54
  432. data/ext/ffi_c/DataConverter.c +0 -91
  433. data/ext/ffi_c/StructByReference.c +0 -190
  434. data/ext/ffi_c/StructByReference.h +0 -50
  435. data/ext/ffi_c/libffi/.travis/build.sh +0 -34
  436. data/ext/ffi_c/libffi/.travis/install.sh +0 -22
  437. data/ext/ffi_c/libffi/.travis/site.exp +0 -18
  438. data/ext/ffi_c/libffi/.travis.yml +0 -34
  439. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
  440. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  441. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  442. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +0 -44
  443. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +0 -44
  444. data/ext/ffi_c/win32/stdbool.h +0 -8
  445. data/ext/ffi_c/win32/stdint.h +0 -201
  446. data/samples/sample_helper.rb +0 -6
  447. data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
  448. data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
  449. data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
  450. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
  451. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
  452. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
  453. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
  454. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
  455. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
  456. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
  457. data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +79 -79
@@ -2,7 +2,7 @@ AC_DEFUN([GCC_AS_CFI_PSEUDO_OP],
2
2
  [AC_CACHE_CHECK([assembler .cfi pseudo-op support],
3
3
  gcc_cv_as_cfi_pseudo_op, [
4
4
  gcc_cv_as_cfi_pseudo_op=unknown
5
- AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
5
+ AC_TRY_COMPILE([asm (".cfi_sections\n\t.cfi_startproc\n\t.cfi_endproc");],,
6
6
  [gcc_cv_as_cfi_pseudo_op=yes],
7
7
  [gcc_cv_as_cfi_pseudo_op=no])
8
8
  ])
@@ -23,33 +23,12 @@
23
23
  # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
24
24
  # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
25
25
  #
26
- # This program is free software: you can redistribute it and/or modify it
27
- # under the terms of the GNU General Public License as published by the
28
- # Free Software Foundation, either version 3 of the License, or (at your
29
- # option) any later version.
30
- #
31
- # This program is distributed in the hope that it will be useful, but
32
- # WITHOUT ANY WARRANTY; without even the implied warranty of
33
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
34
- # Public License for more details.
35
- #
36
- # You should have received a copy of the GNU General Public License along
37
- # with this program. If not, see <https://www.gnu.org/licenses/>.
38
- #
39
- # As a special exception, the respective Autoconf Macro's copyright owner
40
- # gives unlimited permission to copy, distribute and modify the configure
41
- # scripts that are the output of Autoconf when processing the Macro. You
42
- # need not follow the terms of the GNU General Public License when using
43
- # or distributing such scripts, even though portions of the text of the
44
- # Macro appear in them. The GNU General Public License (GPL) does govern
45
- # all other use of the material that constitutes the Autoconf Macro.
46
- #
47
- # This special exception to the GPL applies to versions of the Autoconf
48
- # Macro released by the Autoconf Archive. When you make and distribute a
49
- # modified version of the Autoconf Macro, you may extend this special
50
- # exception to the GPL to apply to your modified version as well.
26
+ # Copying and distribution of this file, with or without modification, are
27
+ # permitted in any medium without royalty provided the copyright notice
28
+ # and this notice are preserved. This file is offered as-is, without any
29
+ # warranty.
51
30
 
52
- #serial 7
31
+ #serial 8
53
32
 
54
33
  AC_DEFUN([AX_APPEND_FLAG],
55
34
  [dnl
@@ -55,7 +55,7 @@
55
55
  # modified version of the Autoconf Macro, you may extend this special
56
56
  # exception to the GPL to apply to your modified version as well.
57
57
 
58
- #serial 17
58
+ #serial 22
59
59
 
60
60
  AC_DEFUN([AX_CC_MAXOPT],
61
61
  [
@@ -67,20 +67,19 @@ AC_ARG_ENABLE(portable-binary, [AS_HELP_STRING([--enable-portable-binary], [disa
67
67
  acx_maxopt_portable=$enableval, acx_maxopt_portable=no)
68
68
 
69
69
  # Try to determine "good" native compiler flags if none specified via CFLAGS
70
- if test "$ac_test_CFLAGS" != "set"; then
71
- CFLAGS=""
70
+ if test "x$ac_test_CFLAGS" = "x"; then
72
71
  case $ax_cv_c_compiler_vendor in
73
- dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host"
72
+ dec) CFLAGS="$CFLAGS -newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host"
74
73
  if test "x$acx_maxopt_portable" = xno; then
75
74
  CFLAGS="$CFLAGS -arch host"
76
75
  fi;;
77
76
 
78
- sun) CFLAGS="-native -fast -xO5 -dalign"
77
+ sun) CFLAGS="$CFLAGS -native -fast -xO5 -dalign"
79
78
  if test "x$acx_maxopt_portable" = xyes; then
80
79
  CFLAGS="$CFLAGS -xarch=generic"
81
80
  fi;;
82
81
 
83
- hp) CFLAGS="+Oall +Optrs_ansi +DSnative"
82
+ hp) CFLAGS="$CFLAGS +Oall +Optrs_ansi +DSnative"
84
83
  if test "x$acx_maxopt_portable" = xyes; then
85
84
  CFLAGS="$CFLAGS +DAportable"
86
85
  fi;;
@@ -91,8 +90,8 @@ if test "$ac_test_CFLAGS" != "set"; then
91
90
  xlc_opt="-qtune=auto"
92
91
  fi
93
92
  AX_CHECK_COMPILE_FLAG($xlc_opt,
94
- CFLAGS="-O3 -qansialias -w $xlc_opt",
95
- [CFLAGS="-O3 -qansialias -w"
93
+ CFLAGS="$CFLAGS -O3 -qansialias -w $xlc_opt",
94
+ [CFLAGS="$CFLAGS -O3 -qansialias -w"
96
95
  echo "******************************************************"
97
96
  echo "* You seem to have the IBM C compiler. It is *"
98
97
  echo "* recommended for best performance that you use: *"
@@ -105,7 +104,7 @@ if test "$ac_test_CFLAGS" != "set"; then
105
104
  echo "******************************************************"])
106
105
  ;;
107
106
 
108
- intel) CFLAGS="-O3 -ansi_alias"
107
+ intel) CFLAGS="$CFLAGS -O3 -ansi_alias"
109
108
  if test "x$acx_maxopt_portable" = xno; then
110
109
  icc_archflag=unknown
111
110
  icc_flags=""
@@ -144,12 +143,18 @@ if test "$ac_test_CFLAGS" != "set"; then
144
143
  fi
145
144
  ;;
146
145
 
146
+ nvhpc)
147
+ # default optimization flags for nvhpc
148
+ CFLAGS="$CFLAGS -O3"
149
+ ;;
150
+
147
151
  gnu)
148
152
  # default optimization flags for gcc on all systems
149
- CFLAGS="-O3 -fomit-frame-pointer"
153
+ CFLAGS="$CFLAGS -O3 -fomit-frame-pointer"
150
154
 
151
155
  # -malign-double for x86 systems
152
- # libffi local change -- don't align double, as it changes the ABI
156
+ # LIBFFI_LOCAL: don't do this.
157
+ # The testsuite doesn't use these flags and we'll get test failures.
153
158
  # AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double")
154
159
 
155
160
  # -fstrict-aliasing for gcc-2.95+
@@ -164,7 +169,7 @@ if test "$ac_test_CFLAGS" != "set"; then
164
169
 
165
170
  microsoft)
166
171
  # default optimization flags for MSVC opt builds
167
- CFLAGS="-O2"
172
+ CFLAGS="$CFLAGS -O2"
168
173
  ;;
169
174
  esac
170
175
 
@@ -176,7 +181,7 @@ if test "$ac_test_CFLAGS" != "set"; then
176
181
  echo "* (otherwise, a default of CFLAGS=-O3 will be used) *"
177
182
  echo "********************************************************"
178
183
  echo ""
179
- CFLAGS="-O3"
184
+ CFLAGS="$CFLAGS -O3"
180
185
  fi
181
186
 
182
187
  AX_CHECK_COMPILE_FLAG($CFLAGS, [], [
@@ -187,7 +192,6 @@ if test "$ac_test_CFLAGS" != "set"; then
187
192
  echo "* Use ./configure CFLAGS=... to specify your own flags *"
188
193
  echo "********************************************************"
189
194
  echo ""
190
- CFLAGS=""
191
195
  ])
192
196
 
193
197
  fi
@@ -4,33 +4,54 @@
4
4
  #
5
5
  # SYNOPSIS
6
6
  #
7
- # AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
8
- # AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
9
- # AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
7
+ # AX_CFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])]
8
+ # AX_CXXFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])]
9
+ # AX_FCFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])]
10
10
  #
11
11
  # DESCRIPTION
12
12
  #
13
- # Try to find a compiler option that enables most reasonable warnings.
13
+ # Specify compiler options that enable most reasonable warnings. For the
14
+ # GNU Compiler Collection (GCC), for example, it will be "-Wall". The
15
+ # result is added to shellvar, one of CFLAGS, CXXFLAGS or FCFLAGS if the
16
+ # first parameter is not specified.
14
17
  #
15
- # For the GNU compiler it will be -Wall (and -ansi -pedantic) The result
16
- # is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default.
18
+ # Each of these macros accepts the following optional arguments:
17
19
  #
18
- # Currently this macro knows about the GCC, Solaris, Digital Unix, AIX,
19
- # HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and
20
- # Intel compilers. For a given compiler, the Fortran flags are much more
21
- # experimental than their C equivalents.
20
+ # - $1 - shellvar
21
+ # shell variable to use (CFLAGS, CXXFLAGS or FCFLAGS if not
22
+ # specified, depending on macro)
22
23
  #
23
- # - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS
24
- # - $2 add-value-if-not-found : nothing
25
- # - $3 action-if-found : add value to shellvariable
26
- # - $4 action-if-not-found : nothing
24
+ # - $2 - default
25
+ # value to use for flags if compiler vendor cannot be determined (by
26
+ # default, "")
27
27
  #
28
- # NOTE: These macros depend on AX_APPEND_FLAG.
28
+ # - $3 - action-if-found
29
+ # action to take if the compiler vendor has been successfully
30
+ # determined (by default, add the appropriate compiler flags to
31
+ # shellvar)
32
+ #
33
+ # - $4 - action-if-not-found
34
+ # action to take if the compiler vendor has not been determined or
35
+ # is unknown (by default, add the default flags, or "" if not
36
+ # specified, to shellvar)
37
+ #
38
+ # These macros use AX_COMPILER_VENDOR to determine which flags should be
39
+ # returned for a given compiler. Not all compilers currently have flags
40
+ # defined for them; patches are welcome. If need be, compiler flags may
41
+ # be made language-dependent: use a construct like the following:
42
+ #
43
+ # [vendor_name], [m4_if(_AC_LANG_PREFIX,[C], VAR="--relevant-c-flags",dnl
44
+ # m4_if(_AC_LANG_PREFIX,[CXX], VAR="--relevant-c++-flags",dnl
45
+ # m4_if(_AC_LANG_PREFIX,[FC], VAR="--relevant-fortran-flags",dnl
46
+ # VAR="$2"; FOUND="no")))],
47
+ #
48
+ # Note: These macros also depend on AX_PREPEND_FLAG.
29
49
  #
30
50
  # LICENSE
31
51
  #
32
52
  # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
33
53
  # Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.com>
54
+ # Copyright (c) 2018 John Zaitseff <J.Zaitseff@zap.org.au>
34
55
  #
35
56
  # This program is free software; you can redistribute it and/or modify it
36
57
  # under the terms of the GNU General Public License as published by the
@@ -58,65 +79,80 @@
58
79
  # modified version of the Autoconf Macro, you may extend this special
59
80
  # exception to the GPL to apply to your modified version as well.
60
81
 
61
- #serial 16
82
+ #serial 25
83
+
84
+ AC_DEFUN([AX_FLAGS_WARN_ALL], [
85
+ AX_REQUIRE_DEFINED([AX_PREPEND_FLAG])dnl
86
+ AC_REQUIRE([AX_COMPILER_VENDOR])dnl
87
+
88
+ AS_VAR_PUSHDEF([FLAGS], [m4_default($1,_AC_LANG_PREFIX[]FLAGS)])dnl
89
+ AS_VAR_PUSHDEF([VAR], [ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl
90
+ AS_VAR_PUSHDEF([FOUND], [ac_save_[]_AC_LANG_ABBREV[]flags_warn_all_found])dnl
91
+
92
+ AC_CACHE_CHECK([FLAGS for most reasonable warnings], VAR, [
93
+ VAR=""
94
+ FOUND="yes"
95
+ dnl Cases are listed in the order found in ax_compiler_vendor.m4
96
+ AS_CASE("$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor",
97
+ [intel], [VAR="-w2"],
98
+ [ibm], [VAR="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd"],
99
+ [pathscale], [],
100
+ [clang], [VAR="-Wall"],
101
+ [cray], [VAR="-h msglevel 2"],
102
+ [fujitsu], [],
103
+ [sdcc], [],
104
+ [sx], [VAR="-pvctl[,]fullmsg"],
105
+ [portland], [],
106
+ [gnu], [VAR="-Wall"],
107
+ [sun], [VAR="-v"],
108
+ [hp], [VAR="+w1"],
109
+ [dec], [VAR="-verbose -w0 -warnprotos"],
110
+ [borland], [],
111
+ [comeau], [],
112
+ [kai], [],
113
+ [lcc], [],
114
+ [sgi], [VAR="-fullwarn"],
115
+ [microsoft], [],
116
+ [metrowerks], [],
117
+ [watcom], [],
118
+ [tcc], [],
119
+ [unknown], [
120
+ VAR="$2"
121
+ FOUND="no"
122
+ ],
123
+ [
124
+ AC_MSG_WARN([Unknown compiler vendor returned by [AX_COMPILER_VENDOR]])
125
+ VAR="$2"
126
+ FOUND="no"
127
+ ]
128
+ )
129
+
130
+ AS_IF([test "x$FOUND" = "xyes"], [dnl
131
+ m4_default($3, [AS_IF([test "x$VAR" != "x"], [AX_PREPEND_FLAG([$VAR], [FLAGS])])])
132
+ ], [dnl
133
+ m4_default($4, [m4_ifval($2, [AX_PREPEND_FLAG([$VAR], [FLAGS])], [true])])
134
+ ])dnl
135
+ ])dnl
62
136
 
63
- AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl
64
- AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
65
- AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl
66
- AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
67
- VAR,[VAR="no, unknown"
68
- ac_save_[]FLAGS="$[]FLAGS"
69
- for ac_arg dnl
70
- in "-warn all % -warn all" dnl Intel
71
- "-pedantic % -Wall" dnl GCC
72
- "-xstrconst % -v" dnl Solaris C
73
- "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
74
- "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
75
- "-ansi -ansiE % -fullwarn" dnl IRIX
76
- "+ESlit % +w1" dnl HP-UX C
77
- "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
78
- "-h conform % -h msglevel 2" dnl Cray C (Unicos)
79
- #
80
- do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
81
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
82
- [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
83
- done
84
- FLAGS="$ac_save_[]FLAGS"
85
- ])
86
- AS_VAR_POPDEF([FLAGS])dnl
87
- AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
88
- case ".$VAR" in
89
- .ok|.ok,*) m4_ifvaln($3,$3) ;;
90
- .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;;
91
- *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;;
92
- esac
93
- AS_VAR_POPDEF([VAR])dnl
137
+ AS_VAR_POPDEF([FOUND])dnl
138
+ AS_VAR_POPDEF([VAR])dnl
139
+ AS_VAR_POPDEF([FLAGS])dnl
94
140
  ])dnl AX_FLAGS_WARN_ALL
95
- dnl implementation tactics:
96
- dnl the for-argument contains a list of options. The first part of
97
- dnl these does only exist to detect the compiler - usually it is
98
- dnl a global option to enable -ansi or -extrawarnings. All other
99
- dnl compilers will fail about it. That was needed since a lot of
100
- dnl compilers will give false positives for some option-syntax
101
- dnl like -Woption or -Xoption as they think of it is a pass-through
102
- dnl to later compile stages or something. The "%" is used as a
103
- dnl delimiter. A non-option comment can be given after "%%" marks
104
- dnl which will be shown but not added to the respective C/CXXFLAGS.
105
141
 
106
- AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
107
- AC_LANG_PUSH([C])
108
- AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
109
- AC_LANG_POP([C])
110
- ])
142
+ AC_DEFUN([AX_CFLAGS_WARN_ALL], [dnl
143
+ AC_LANG_PUSH([C])
144
+ AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
145
+ AC_LANG_POP([C])
146
+ ])dnl
111
147
 
112
- AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
113
- AC_LANG_PUSH([C++])
114
- AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
115
- AC_LANG_POP([C++])
116
- ])
148
+ AC_DEFUN([AX_CXXFLAGS_WARN_ALL], [dnl
149
+ AC_LANG_PUSH([C++])
150
+ AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
151
+ AC_LANG_POP([C++])
152
+ ])dnl
117
153
 
118
- AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
119
- AC_LANG_PUSH([Fortran])
120
- AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
121
- AC_LANG_POP([Fortran])
122
- ])
154
+ AC_DEFUN([AX_FCFLAGS_WARN_ALL], [dnl
155
+ AC_LANG_PUSH([Fortran])
156
+ AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
157
+ AC_LANG_POP([Fortran])
158
+ ])dnl
@@ -29,33 +29,12 @@
29
29
  # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
30
30
  # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
31
31
  #
32
- # This program is free software: you can redistribute it and/or modify it
33
- # under the terms of the GNU General Public License as published by the
34
- # Free Software Foundation, either version 3 of the License, or (at your
35
- # option) any later version.
36
- #
37
- # This program is distributed in the hope that it will be useful, but
38
- # WITHOUT ANY WARRANTY; without even the implied warranty of
39
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
40
- # Public License for more details.
41
- #
42
- # You should have received a copy of the GNU General Public License along
43
- # with this program. If not, see <https://www.gnu.org/licenses/>.
44
- #
45
- # As a special exception, the respective Autoconf Macro's copyright owner
46
- # gives unlimited permission to copy, distribute and modify the configure
47
- # scripts that are the output of Autoconf when processing the Macro. You
48
- # need not follow the terms of the GNU General Public License when using
49
- # or distributing such scripts, even though portions of the text of the
50
- # Macro appear in them. The GNU General Public License (GPL) does govern
51
- # all other use of the material that constitutes the Autoconf Macro.
52
- #
53
- # This special exception to the GPL applies to versions of the Autoconf
54
- # Macro released by the Autoconf Archive. When you make and distribute a
55
- # modified version of the Autoconf Macro, you may extend this special
56
- # exception to the GPL to apply to your modified version as well.
32
+ # Copying and distribution of this file, with or without modification, are
33
+ # permitted in any medium without royalty provided the copyright notice
34
+ # and this notice are preserved. This file is offered as-is, without any
35
+ # warranty.
57
36
 
58
- #serial 5
37
+ #serial 6
59
38
 
60
39
  AC_DEFUN([AX_CHECK_COMPILE_FLAG],
61
40
  [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
@@ -8,15 +8,30 @@
8
8
  #
9
9
  # DESCRIPTION
10
10
  #
11
- # Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun,
12
- # hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft,
13
- # watcom, etc. The vendor is returned in the cache variable
14
- # $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++.
11
+ # Determine the vendor of the C, C++ or Fortran compiler. The vendor is
12
+ # returned in the cache variable $ax_cv_c_compiler_vendor for C,
13
+ # $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for
14
+ # (modern) Fortran. The value is one of "intel", "ibm", "pathscale",
15
+ # "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "nvhpc" (NVIDIA HPC
16
+ # Compiler), "portland" (PGI), "gnu" (GCC), "sun" (Oracle Developer
17
+ # Studio), "hp", "dec", "borland", "comeau", "kai", "lcc", "sgi",
18
+ # "microsoft", "metrowerks", "watcom", "tcc" (Tiny CC) or "unknown" (if
19
+ # the compiler cannot be determined).
20
+ #
21
+ # To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT
22
+ # with an appropriate preprocessor-enabled extension. For example:
23
+ #
24
+ # AC_LANG_PUSH([Fortran])
25
+ # AC_PROG_FC
26
+ # AC_FC_PP_SRCEXT([F])
27
+ # AX_COMPILER_VENDOR
28
+ # AC_LANG_POP([Fortran])
15
29
  #
16
30
  # LICENSE
17
31
  #
18
32
  # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
19
33
  # Copyright (c) 2008 Matteo Frigo
34
+ # Copyright (c) 2018-19 John Zaitseff <J.Zaitseff@zap.org.au>
20
35
  #
21
36
  # This program is free software: you can redistribute it and/or modify it
22
37
  # under the terms of the GNU General Public License as published by the
@@ -44,44 +59,61 @@
44
59
  # modified version of the Autoconf Macro, you may extend this special
45
60
  # exception to the GPL to apply to your modified version as well.
46
61
 
47
- #serial 16
62
+ #serial 32
63
+
64
+ AC_DEFUN([AX_COMPILER_VENDOR], [dnl
65
+ AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl
66
+ dnl If you modify this list of vendors, please add similar support
67
+ dnl to ax_compiler_version.m4 if at all possible.
68
+ dnl
69
+ dnl Note: Do NOT check for GCC first since some other compilers
70
+ dnl define __GNUC__ to remain compatible with it. Compilers that
71
+ dnl are very slow to start (such as Intel) are listed first.
72
+
73
+ vendors="
74
+ intel: __ICC,__ECC,__INTEL_COMPILER
75
+ ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__
76
+ pathscale: __PATHCC__,__PATHSCALE__
77
+ clang: __clang__
78
+ cray: _CRAYC
79
+ fujitsu: __FUJITSU
80
+ sdcc: SDCC,__SDCC
81
+ sx: _SX
82
+ nvhpc: __NVCOMPILER
83
+ portland: __PGI
84
+ gnu: __GNUC__
85
+ sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95
86
+ hp: __HP_cc,__HP_aCC
87
+ dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
88
+ borland: __BORLANDC__,__CODEGEARC__,__TURBOC__
89
+ comeau: __COMO__
90
+ kai: __KCC
91
+ lcc: __LCC__
92
+ sgi: __sgi,sgi
93
+ microsoft: _MSC_VER
94
+ metrowerks: __MWERKS__
95
+ watcom: __WATCOMC__
96
+ tcc: __TINYC__
97
+ unknown: UNKNOWN
98
+ "
99
+ for ventest in $vendors; do
100
+ case $ventest in
101
+ *:)
102
+ vendor=$ventest
103
+ continue
104
+ ;;
105
+ *)
106
+ vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")"
107
+ ;;
108
+ esac
109
+
110
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
111
+ #if !($vencpp)
112
+ thisisanerror;
113
+ #endif
114
+ ]])], [break])
115
+ done
48
116
 
49
- AC_DEFUN([AX_COMPILER_VENDOR],
50
- [AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
51
- dnl Please add if possible support to ax_compiler_version.m4
52
- [# note: don't check for gcc first since some other compilers define __GNUC__
53
- vendors="intel: __ICC,__ECC,__INTEL_COMPILER
54
- ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__
55
- pathscale: __PATHCC__,__PATHSCALE__
56
- clang: __clang__
57
- cray: _CRAYC
58
- fujitsu: __FUJITSU
59
- gnu: __GNUC__
60
- sun: __SUNPRO_C,__SUNPRO_CC
61
- hp: __HP_cc,__HP_aCC
62
- dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
63
- borland: __BORLANDC__,__CODEGEARC__,__TURBOC__
64
- comeau: __COMO__
65
- kai: __KCC
66
- lcc: __LCC__
67
- sgi: __sgi,sgi
68
- microsoft: _MSC_VER
69
- metrowerks: __MWERKS__
70
- watcom: __WATCOMC__
71
- portland: __PGI
72
- tcc: __TINYC__
73
- unknown: UNKNOWN"
74
- for ventest in $vendors; do
75
- case $ventest in
76
- *:) vendor=$ventest; continue ;;
77
- *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;;
78
- esac
79
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
80
- #if !($vencpp)
81
- thisisanerror;
82
- #endif
83
- ])], [break])
84
- done
85
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1`
86
- ])
87
- ])
117
+ ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1`
118
+ ])
119
+ ])dnl
@@ -31,33 +31,12 @@
31
31
  #
32
32
  # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
33
33
  #
34
- # This program is free software; you can redistribute it and/or modify it
35
- # under the terms of the GNU General Public License as published by the
36
- # Free Software Foundation; either version 3 of the License, or (at your
37
- # option) any later version.
38
- #
39
- # This program is distributed in the hope that it will be useful, but
40
- # WITHOUT ANY WARRANTY; without even the implied warranty of
41
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
42
- # Public License for more details.
43
- #
44
- # You should have received a copy of the GNU General Public License along
45
- # with this program. If not, see <https://www.gnu.org/licenses/>.
46
- #
47
- # As a special exception, the respective Autoconf Macro's copyright owner
48
- # gives unlimited permission to copy, distribute and modify the configure
49
- # scripts that are the output of Autoconf when processing the Macro. You
50
- # need not follow the terms of the GNU General Public License when using
51
- # or distributing such scripts, even though portions of the text of the
52
- # Macro appear in them. The GNU General Public License (GPL) does govern
53
- # all other use of the material that constitutes the Autoconf Macro.
54
- #
55
- # This special exception to the GPL applies to versions of the Autoconf
56
- # Macro released by the Autoconf Archive. When you make and distribute a
57
- # modified version of the Autoconf Macro, you may extend this special
58
- # exception to the GPL to apply to your modified version as well.
34
+ # Copying and distribution of this file, with or without modification, are
35
+ # permitted in any medium without royalty provided the copyright notice
36
+ # and this notice are preserved. This file is offered as-is, without any
37
+ # warranty.
59
38
 
60
- #serial 13
39
+ #serial 14
61
40
 
62
41
  AC_DEFUN([AX_CONFIGURE_ARGS],[
63
42
  # [$]@ is unusable in 2.60+ but earlier autoconf had no ac_configure_args
@@ -37,7 +37,7 @@
37
37
  # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
38
38
  # Copyright (c) 2008 Matteo Frigo
39
39
  # Copyright (c) 2014 Tsukasa Oi
40
- # Copyright (c) 2017 Alexey Kopytov
40
+ # Copyright (c) 2017-2018 Alexey Kopytov
41
41
  #
42
42
  # This program is free software: you can redistribute it and/or modify it
43
43
  # under the terms of the GNU General Public License as published by the
@@ -65,7 +65,7 @@
65
65
  # modified version of the Autoconf Macro, you may extend this special
66
66
  # exception to the GPL to apply to your modified version as well.
67
67
 
68
- #serial 20
68
+ #serial 22
69
69
 
70
70
  AC_DEFUN([AX_GCC_ARCHFLAG],
71
71
  [AC_REQUIRE([AC_PROG_CC])
@@ -108,7 +108,7 @@ case $host_cpu in
108
108
  *2?6[[ad]]?:*:*:*) ax_gcc_arch="sandybridge corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;;
109
109
  *3?6[[ae]]?:*:*:*) ax_gcc_arch="ivybridge core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;;
110
110
  *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) ax_gcc_arch="haswell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;;
111
- *3?6d?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;;
111
+ *3?6d?:*:*:*|*4?6[[7f]]?:*:*:*|*5?66?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;;
112
112
  *1?6c?:*:*:*|*2?6[[67]]?:*:*:*|*3?6[[56]]?:*:*:*) ax_gcc_arch="bonnell atom core2 pentium-m pentium3 pentiumpro" ;;
113
113
  *3?67?:*:*:*|*[[45]]?6[[ad]]?:*:*:*) ax_gcc_arch="silvermont atom core2 pentium-m pentium3 pentiumpro" ;;
114
114
  *000?f[[012]]?:*:*:*|?f[[012]]?:*:*:*|f[[012]]?:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;;
@@ -198,6 +198,10 @@ case $host_cpu in
198
198
  *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
199
199
  *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
200
200
  603ev|8240) ax_gcc_arch="$cputype 603e 603";;
201
+ *POWER7*) ax_gcc_arch="power7";;
202
+ *POWER8*) ax_gcc_arch="power8";;
203
+ *POWER9*) ax_gcc_arch="power9";;
204
+ *POWER10*) ax_gcc_arch="power10";;
201
205
  *) ax_gcc_arch=$cputype ;;
202
206
  esac
203
207
  ax_gcc_arch="$ax_gcc_arch powerpc"
@@ -0,0 +1,51 @@
1
+ # ===========================================================================
2
+ # https://www.gnu.org/software/autoconf-archive/ax_prepend_flag.html
3
+ # ===========================================================================
4
+ #
5
+ # SYNOPSIS
6
+ #
7
+ # AX_PREPEND_FLAG(FLAG, [FLAGS-VARIABLE])
8
+ #
9
+ # DESCRIPTION
10
+ #
11
+ # FLAG is added to the front of the FLAGS-VARIABLE shell variable, with a
12
+ # space added in between.
13
+ #
14
+ # If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
15
+ # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
16
+ # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
17
+ # FLAG.
18
+ #
19
+ # NOTE: Implementation based on AX_APPEND_FLAG.
20
+ #
21
+ # LICENSE
22
+ #
23
+ # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
24
+ # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
25
+ # Copyright (c) 2018 John Zaitseff <J.Zaitseff@zap.org.au>
26
+ #
27
+ # Copying and distribution of this file, with or without modification, are
28
+ # permitted in any medium without royalty provided the copyright notice
29
+ # and this notice are preserved. This file is offered as-is, without any
30
+ # warranty.
31
+
32
+ #serial 2
33
+
34
+ AC_DEFUN([AX_PREPEND_FLAG],
35
+ [dnl
36
+ AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
37
+ AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
38
+ AS_VAR_SET_IF(FLAGS,[
39
+ AS_CASE([" AS_VAR_GET(FLAGS) "],
40
+ [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
41
+ [
42
+ FLAGS="$1 $FLAGS"
43
+ AC_RUN_LOG([: FLAGS="$FLAGS"])
44
+ ])
45
+ ],
46
+ [
47
+ AS_VAR_SET(FLAGS,[$1])
48
+ AC_RUN_LOG([: FLAGS="$FLAGS"])
49
+ ])
50
+ AS_VAR_POPDEF([FLAGS])dnl
51
+ ])dnl AX_PREPEND_FLAG