xcrypt 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +106 -0
  3. data/ext/libxcrypt/AUTHORS +38 -0
  4. data/ext/libxcrypt/COPYING.LIB +502 -0
  5. data/ext/libxcrypt/ChangeLog +239 -0
  6. data/ext/libxcrypt/INSTALL +380 -0
  7. data/ext/libxcrypt/LICENSING +152 -0
  8. data/ext/libxcrypt/Makefile.am +704 -0
  9. data/ext/libxcrypt/Makefile.in +4110 -0
  10. data/ext/libxcrypt/NEWS +630 -0
  11. data/ext/libxcrypt/README +1 -0
  12. data/ext/libxcrypt/README.md +179 -0
  13. data/ext/libxcrypt/THANKS +13 -0
  14. data/ext/libxcrypt/TODO +1 -0
  15. data/ext/libxcrypt/TODO.md +100 -0
  16. data/ext/libxcrypt/aclocal.m4 +2617 -0
  17. data/ext/libxcrypt/autogen.sh +33 -0
  18. data/ext/libxcrypt/autom4te.cache/output.0 +19884 -0
  19. data/ext/libxcrypt/autom4te.cache/output.1 +19884 -0
  20. data/ext/libxcrypt/autom4te.cache/output.2 +19884 -0
  21. data/ext/libxcrypt/autom4te.cache/output.3 +19885 -0
  22. data/ext/libxcrypt/autom4te.cache/requests +714 -0
  23. data/ext/libxcrypt/autom4te.cache/traces.0 +4088 -0
  24. data/ext/libxcrypt/autom4te.cache/traces.1 +1060 -0
  25. data/ext/libxcrypt/autom4te.cache/traces.2 +4088 -0
  26. data/ext/libxcrypt/autom4te.cache/traces.3 +1060 -0
  27. data/ext/libxcrypt/build-aux/ci/ci-log-dependency-versions +79 -0
  28. data/ext/libxcrypt/build-aux/ci/ci-log-logfiles +22 -0
  29. data/ext/libxcrypt/build-aux/ci/clang-gcov-wrapper +2 -0
  30. data/ext/libxcrypt/build-aux/ci/configure-wrapper +10 -0
  31. data/ext/libxcrypt/build-aux/ci/summarize-coverage +24 -0
  32. data/ext/libxcrypt/build-aux/m4/ax_append_compile_flags.m4 +46 -0
  33. data/ext/libxcrypt/build-aux/m4/ax_append_flag.m4 +50 -0
  34. data/ext/libxcrypt/build-aux/m4/ax_check_compile_flag.m4 +53 -0
  35. data/ext/libxcrypt/build-aux/m4/ax_check_vscript.m4 +142 -0
  36. data/ext/libxcrypt/build-aux/m4/ax_gcc_func_attribute.m4 +246 -0
  37. data/ext/libxcrypt/build-aux/m4/ax_require_defined.m4 +37 -0
  38. data/ext/libxcrypt/build-aux/m4/ax_valgrind_check.m4 +239 -0
  39. data/ext/libxcrypt/build-aux/m4/libtool.m4 +8488 -0
  40. data/ext/libxcrypt/build-aux/m4/ltoptions.m4 +467 -0
  41. data/ext/libxcrypt/build-aux/m4/ltsugar.m4 +124 -0
  42. data/ext/libxcrypt/build-aux/m4/ltversion.m4 +24 -0
  43. data/ext/libxcrypt/build-aux/m4/lt~obsolete.m4 +99 -0
  44. data/ext/libxcrypt/build-aux/m4/pkg_compat.m4 +88 -0
  45. data/ext/libxcrypt/build-aux/m4/zw_alignment.m4 +90 -0
  46. data/ext/libxcrypt/build-aux/m4/zw_automodern.m4 +307 -0
  47. data/ext/libxcrypt/build-aux/m4/zw_detect_asan.m4 +24 -0
  48. data/ext/libxcrypt/build-aux/m4/zw_endianness.m4 +152 -0
  49. data/ext/libxcrypt/build-aux/m4/zw_ld_wrap.m4 +47 -0
  50. data/ext/libxcrypt/build-aux/m4/zw_prog_perl.m4 +40 -0
  51. data/ext/libxcrypt/build-aux/m4/zw_simple_warnings.m4 +150 -0
  52. data/ext/libxcrypt/build-aux/m4/zw_static_assert.m4 +68 -0
  53. data/ext/libxcrypt/build-aux/m4-autogen/compile +364 -0
  54. data/ext/libxcrypt/build-aux/m4-autogen/config.guess +1815 -0
  55. data/ext/libxcrypt/build-aux/m4-autogen/config.sub +2354 -0
  56. data/ext/libxcrypt/build-aux/m4-autogen/depcomp +792 -0
  57. data/ext/libxcrypt/build-aux/m4-autogen/install-sh +541 -0
  58. data/ext/libxcrypt/build-aux/m4-autogen/ltmain.sh +11524 -0
  59. data/ext/libxcrypt/build-aux/m4-autogen/missing +236 -0
  60. data/ext/libxcrypt/build-aux/m4-autogen/test-driver +160 -0
  61. data/ext/libxcrypt/build-aux/scripts/BuildCommon.pm +712 -0
  62. data/ext/libxcrypt/build-aux/scripts/check-perlcritic-config +76 -0
  63. data/ext/libxcrypt/build-aux/scripts/compute-symver-floor +116 -0
  64. data/ext/libxcrypt/build-aux/scripts/expand-selected-hashes +80 -0
  65. data/ext/libxcrypt/build-aux/scripts/gen-crypt-h +131 -0
  66. data/ext/libxcrypt/build-aux/scripts/gen-crypt-hashes-h +141 -0
  67. data/ext/libxcrypt/build-aux/scripts/gen-crypt-symbol-vers-h +150 -0
  68. data/ext/libxcrypt/build-aux/scripts/gen-libcrypt-map +67 -0
  69. data/ext/libxcrypt/build-aux/scripts/move-if-change +84 -0
  70. data/ext/libxcrypt/build-aux/scripts/skip-if-exec-format-error +78 -0
  71. data/ext/libxcrypt/codecov.yml +4 -0
  72. data/ext/libxcrypt/config.h.in +303 -0
  73. data/ext/libxcrypt/configure +19885 -0
  74. data/ext/libxcrypt/configure.ac +549 -0
  75. data/ext/libxcrypt/doc/crypt.3 +512 -0
  76. data/ext/libxcrypt/doc/crypt.5 +343 -0
  77. data/ext/libxcrypt/doc/crypt_checksalt.3 +106 -0
  78. data/ext/libxcrypt/doc/crypt_gensalt.3 +285 -0
  79. data/ext/libxcrypt/doc/crypt_gensalt_ra.3 +1 -0
  80. data/ext/libxcrypt/doc/crypt_gensalt_rn.3 +1 -0
  81. data/ext/libxcrypt/doc/crypt_preferred_method.3 +68 -0
  82. data/ext/libxcrypt/doc/crypt_r.3 +1 -0
  83. data/ext/libxcrypt/doc/crypt_ra.3 +1 -0
  84. data/ext/libxcrypt/doc/crypt_rn.3 +1 -0
  85. data/ext/libxcrypt/lib/alg-des-tables.c +3858 -0
  86. data/ext/libxcrypt/lib/alg-des.c +269 -0
  87. data/ext/libxcrypt/lib/alg-des.h +74 -0
  88. data/ext/libxcrypt/lib/alg-gost3411-2012-const.h +313 -0
  89. data/ext/libxcrypt/lib/alg-gost3411-2012-core.c +238 -0
  90. data/ext/libxcrypt/lib/alg-gost3411-2012-core.h +51 -0
  91. data/ext/libxcrypt/lib/alg-gost3411-2012-hmac.c +78 -0
  92. data/ext/libxcrypt/lib/alg-gost3411-2012-hmac.h +46 -0
  93. data/ext/libxcrypt/lib/alg-gost3411-2012-precalc.h +1426 -0
  94. data/ext/libxcrypt/lib/alg-gost3411-2012-ref.h +67 -0
  95. data/ext/libxcrypt/lib/alg-hmac-sha1.c +140 -0
  96. data/ext/libxcrypt/lib/alg-hmac-sha1.h +35 -0
  97. data/ext/libxcrypt/lib/alg-md4.c +270 -0
  98. data/ext/libxcrypt/lib/alg-md4.h +43 -0
  99. data/ext/libxcrypt/lib/alg-md5.c +291 -0
  100. data/ext/libxcrypt/lib/alg-md5.h +43 -0
  101. data/ext/libxcrypt/lib/alg-sha1.c +288 -0
  102. data/ext/libxcrypt/lib/alg-sha1.h +34 -0
  103. data/ext/libxcrypt/lib/alg-sha256.c +630 -0
  104. data/ext/libxcrypt/lib/alg-sha256.h +123 -0
  105. data/ext/libxcrypt/lib/alg-sha512.c +311 -0
  106. data/ext/libxcrypt/lib/alg-sha512.h +81 -0
  107. data/ext/libxcrypt/lib/alg-sm3-hmac.c +113 -0
  108. data/ext/libxcrypt/lib/alg-sm3-hmac.h +42 -0
  109. data/ext/libxcrypt/lib/alg-sm3.c +449 -0
  110. data/ext/libxcrypt/lib/alg-sm3.h +63 -0
  111. data/ext/libxcrypt/lib/alg-yescrypt-common.c +713 -0
  112. data/ext/libxcrypt/lib/alg-yescrypt-opt.c +1568 -0
  113. data/ext/libxcrypt/lib/alg-yescrypt-platform.c +106 -0
  114. data/ext/libxcrypt/lib/alg-yescrypt.h +360 -0
  115. data/ext/libxcrypt/lib/byteorder.h +164 -0
  116. data/ext/libxcrypt/lib/crypt-bcrypt.c +1061 -0
  117. data/ext/libxcrypt/lib/crypt-des-obsolete.c +215 -0
  118. data/ext/libxcrypt/lib/crypt-des.c +491 -0
  119. data/ext/libxcrypt/lib/crypt-gensalt-static.c +40 -0
  120. data/ext/libxcrypt/lib/crypt-gost-yescrypt.c +182 -0
  121. data/ext/libxcrypt/lib/crypt-md5.c +232 -0
  122. data/ext/libxcrypt/lib/crypt-nthash.c +134 -0
  123. data/ext/libxcrypt/lib/crypt-obsolete.h +40 -0
  124. data/ext/libxcrypt/lib/crypt-pbkdf1-sha1.c +260 -0
  125. data/ext/libxcrypt/lib/crypt-port.h +514 -0
  126. data/ext/libxcrypt/lib/crypt-scrypt.c +247 -0
  127. data/ext/libxcrypt/lib/crypt-sha256.c +308 -0
  128. data/ext/libxcrypt/lib/crypt-sha512.c +323 -0
  129. data/ext/libxcrypt/lib/crypt-sm3-yescrypt.c +189 -0
  130. data/ext/libxcrypt/lib/crypt-sm3.c +308 -0
  131. data/ext/libxcrypt/lib/crypt-static.c +44 -0
  132. data/ext/libxcrypt/lib/crypt-sunmd5.c +314 -0
  133. data/ext/libxcrypt/lib/crypt-yescrypt.c +177 -0
  134. data/ext/libxcrypt/lib/crypt.c +421 -0
  135. data/ext/libxcrypt/lib/crypt.h.in +249 -0
  136. data/ext/libxcrypt/lib/gen-des-tables.c +363 -0
  137. data/ext/libxcrypt/lib/hashes.conf +59 -0
  138. data/ext/libxcrypt/lib/libcrypt.map.in +48 -0
  139. data/ext/libxcrypt/lib/libcrypt.minver +97 -0
  140. data/ext/libxcrypt/lib/libxcrypt.pc.in +15 -0
  141. data/ext/libxcrypt/lib/util-base64.c +26 -0
  142. data/ext/libxcrypt/lib/util-gensalt-sha.c +88 -0
  143. data/ext/libxcrypt/lib/util-get-random-bytes.c +154 -0
  144. data/ext/libxcrypt/lib/util-make-failure-token.c +48 -0
  145. data/ext/libxcrypt/lib/util-xbzero.c +43 -0
  146. data/ext/libxcrypt/lib/util-xstrcpy.c +42 -0
  147. data/ext/libxcrypt/lib/xcrypt.h.in +58 -0
  148. data/ext/libxcrypt/libxcrypt.spec.rpkg +481 -0
  149. data/ext/libxcrypt/rpkg.conf +2 -0
  150. data/ext/libxcrypt/rpkg.macros +86 -0
  151. data/ext/libxcrypt/test/TestCommon.pm +326 -0
  152. data/ext/libxcrypt/test/alg-des.c +80 -0
  153. data/ext/libxcrypt/test/alg-gost3411-2012-hmac.c +90 -0
  154. data/ext/libxcrypt/test/alg-gost3411-2012.c +191 -0
  155. data/ext/libxcrypt/test/alg-hmac-sha1.c +187 -0
  156. data/ext/libxcrypt/test/alg-md4.c +111 -0
  157. data/ext/libxcrypt/test/alg-md5.c +134 -0
  158. data/ext/libxcrypt/test/alg-pbkdf-hmac-sha256.c +269 -0
  159. data/ext/libxcrypt/test/alg-sha1.c +111 -0
  160. data/ext/libxcrypt/test/alg-sha256.c +141 -0
  161. data/ext/libxcrypt/test/alg-sha512.c +170 -0
  162. data/ext/libxcrypt/test/alg-sm3-hmac.c +149 -0
  163. data/ext/libxcrypt/test/alg-sm3.c +168 -0
  164. data/ext/libxcrypt/test/alg-yescrypt.c +466 -0
  165. data/ext/libxcrypt/test/badsalt.c +726 -0
  166. data/ext/libxcrypt/test/badsetting.c +350 -0
  167. data/ext/libxcrypt/test/byteorder.c +254 -0
  168. data/ext/libxcrypt/test/checksalt.c +265 -0
  169. data/ext/libxcrypt/test/compile-strong-alias.c +43 -0
  170. data/ext/libxcrypt/test/crypt-badargs.c +392 -0
  171. data/ext/libxcrypt/test/crypt-gost-yescrypt.c +149 -0
  172. data/ext/libxcrypt/test/crypt-nested-call.c +180 -0
  173. data/ext/libxcrypt/test/crypt-sm3-yescrypt.c +149 -0
  174. data/ext/libxcrypt/test/crypt-too-long-phrase.c +157 -0
  175. data/ext/libxcrypt/test/des-cases.h +196 -0
  176. data/ext/libxcrypt/test/des-obsolete.c +206 -0
  177. data/ext/libxcrypt/test/des-obsolete_r.c +207 -0
  178. data/ext/libxcrypt/test/explicit-bzero.c +334 -0
  179. data/ext/libxcrypt/test/gensalt-bcrypt_x.c +54 -0
  180. data/ext/libxcrypt/test/gensalt-extradata.c +246 -0
  181. data/ext/libxcrypt/test/gensalt-nested-call.c +126 -0
  182. data/ext/libxcrypt/test/gensalt-nthash.c +65 -0
  183. data/ext/libxcrypt/test/gensalt.c +599 -0
  184. data/ext/libxcrypt/test/getrandom-fallbacks.c +295 -0
  185. data/ext/libxcrypt/test/getrandom-interface.c +211 -0
  186. data/ext/libxcrypt/test/ka-table-gen.py +945 -0
  187. data/ext/libxcrypt/test/ka-table.inc +5849 -0
  188. data/ext/libxcrypt/test/ka-tester.c +240 -0
  189. data/ext/libxcrypt/test/preferred-method.c +133 -0
  190. data/ext/libxcrypt/test/short-outbuf.c +119 -0
  191. data/ext/libxcrypt/test/special-char-salt.c +1160 -0
  192. data/ext/libxcrypt/test/symbols-compat.pl +137 -0
  193. data/ext/libxcrypt/test/symbols-renames.pl +107 -0
  194. data/ext/libxcrypt/test/symbols-static.pl +87 -0
  195. data/ext/xcrypt/xcrypt.c +9 -0
  196. data/lib/xcrypt/ffi.rb +76 -0
  197. data/lib/xcrypt/version.rb +5 -0
  198. data/lib/xcrypt.rb +89 -0
  199. metadata +267 -0
@@ -0,0 +1,99 @@
1
+ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
2
+ #
3
+ # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2024 Free
4
+ # Software Foundation, Inc.
5
+ # Written by Scott James Remnant, 2004.
6
+ #
7
+ # This file is free software; the Free Software Foundation gives
8
+ # unlimited permission to copy and/or distribute it, with or without
9
+ # modifications, as long as this notice is preserved.
10
+
11
+ # serial 5 lt~obsolete.m4
12
+
13
+ # These exist entirely to fool aclocal when bootstrapping libtool.
14
+ #
15
+ # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
16
+ # which have later been changed to m4_define as they aren't part of the
17
+ # exported API, or moved to Autoconf or Automake where they belong.
18
+ #
19
+ # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
20
+ # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
21
+ # using a macro with the same name in our local m4/libtool.m4 it'll
22
+ # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
23
+ # and doesn't know about Autoconf macros at all.)
24
+ #
25
+ # So we provide this file, which has a silly filename so it's always
26
+ # included after everything else. This provides aclocal with the
27
+ # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
28
+ # because those macros already exist, or will be overwritten later.
29
+ # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
30
+ #
31
+ # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
32
+ # Yes, that means every name once taken will need to remain here until
33
+ # we give up compatibility with versions before 1.7, at which point
34
+ # we need to keep only those names which we still refer to.
35
+
36
+ # This is to help aclocal find these macros, as it can't see m4_define.
37
+ AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
38
+
39
+ m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
40
+ m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
41
+ m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
42
+ m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
43
+ m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
44
+ m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
45
+ m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
46
+ m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
47
+ m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
48
+ m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
49
+ m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
50
+ m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
51
+ m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
52
+ m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
53
+ m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
54
+ m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
55
+ m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
56
+ m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
57
+ m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
58
+ m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
59
+ m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
60
+ m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
61
+ m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
62
+ m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
63
+ m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
64
+ m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
65
+ m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
66
+ m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
67
+ m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
68
+ m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
69
+ m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
70
+ m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
71
+ m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
72
+ m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
73
+ m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
74
+ m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
75
+ m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
76
+ m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
77
+ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
78
+ m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
79
+ m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
80
+ m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
81
+ m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
82
+ m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
83
+ m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
84
+ m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
85
+ m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
86
+ m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
87
+ m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
88
+ m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
89
+ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
90
+ m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
91
+ m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
92
+ m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
93
+ m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
94
+ m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
95
+ m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
96
+ m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
97
+ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
98
+ m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
99
+ m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
@@ -0,0 +1,88 @@
1
+ # pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
2
+ # serial 12 (pkg-config-0.29.2)
3
+
4
+ # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
5
+ # Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
6
+ #
7
+ # This program is free software; you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation; either version 2 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful, but
13
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with this program; if not, write to the Free Software
19
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20
+ # 02111-1307, USA.
21
+ #
22
+ # As a special exception to the GNU General Public License, if you
23
+ # distribute this file as part of a program that contains a
24
+ # configuration script generated by Autoconf, you may include it under
25
+ # the same distribution terms that you use for the rest of that
26
+ # program.
27
+
28
+ # PKG_PROG_PKG_CONFIG_COMPAT([MIN-VERSION], [ACTION-IF-NOT-FOUND])
29
+ # ---------------------------------------------------------
30
+ # Backported from pkg-config 0.29.2.
31
+ #
32
+ # Search for the pkg-config tool and set the PKG_CONFIG variable to
33
+ # first found in the path. Checks that the version of pkg-config found
34
+ # is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
35
+ # used since that's the first version where most current features of
36
+ # pkg-config existed.
37
+ #
38
+ # If pkg-config is not found or older than specified, it will result
39
+ # in an empty PKG_CONFIG variable. To avoid widespread issues with
40
+ # scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting.
41
+ # You can specify [PKG_CONFIG=false] as an action instead, which would
42
+ # result in pkg-config tests failing, but no bogus error messages.
43
+ AC_DEFUN([PKG_PROG_PKG_CONFIG_COMPAT],
44
+ [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
45
+ m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
46
+ m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
47
+ AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
48
+ AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
49
+ AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
50
+
51
+ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
52
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
53
+ fi
54
+ if test -n "$PKG_CONFIG"; then
55
+ _pkg_min_version=m4_default([$1], [0.9.0])
56
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
57
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
58
+ AC_MSG_RESULT([yes])
59
+ else
60
+ AC_MSG_RESULT([no])
61
+ PKG_CONFIG=""
62
+ fi
63
+ fi
64
+ if test -z "$PKG_CONFIG"; then
65
+ m4_default([$2], [AC_MSG_ERROR([pkg-config not found])])
66
+ fi[]
67
+ ])
68
+
69
+ # PKG_INSTALLDIR_COMPAT([DIRECTORY])
70
+ # -------------------------
71
+ # Backported from pkg-config 0.27.
72
+ #
73
+ # Substitutes the variable pkgconfigdir as the location where a module
74
+ # should install pkg-config .pc files. By default the directory is
75
+ # $libdir/pkgconfig, but the default can be changed by passing
76
+ # DIRECTORY. The user can override through the --with-pkgconfigdir
77
+ # parameter.
78
+ AC_DEFUN([PKG_INSTALLDIR_COMPAT],
79
+ [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
80
+ m4_pushdef([pkg_description],
81
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
82
+ AC_ARG_WITH([pkgconfigdir],
83
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
84
+ [with_pkgconfigdir=]pkg_default)
85
+ AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
86
+ m4_popdef([pkg_default])
87
+ m4_popdef([pkg_description])
88
+ ])
@@ -0,0 +1,90 @@
1
+ dnl Written by Zack Weinberg <zackw at panix.com> in 2017.
2
+ dnl To the extent possible under law, Zack Weinberg has waived all
3
+ dnl copyright and related or neighboring rights to this work.
4
+ dnl
5
+ dnl See https://creativecommons.org/publicdomain/zero/1.0/ for further
6
+ dnl details.
7
+ dnl
8
+ dnl Find out how to query and set data alignment.
9
+ dnl Currently knows about C11's _Alignas and _Alignof,
10
+ dnl and GCC's __attribute__ ((aligned)) and __alignof.
11
+ dnl
12
+ dnl Note: AC_PROG_CC_C11 includes a test for _Alignas and _Alignof,
13
+ dnl but not for <stdalign.h>, which we don't bother using anyway.
14
+ dnl
15
+ dnl Compatibility note: alignas (TYPE) does not work when alignas() is
16
+ dnl defined using __attribute__ ((aligned)). Use alignas (alignof (TYPE))
17
+ dnl instead.
18
+ AC_DEFUN([zw_C_ALIGNAS],
19
+ [AC_REQUIRE([AC_PROG_CC])
20
+ AC_CACHE_CHECK([how to control data alignment], [zw_cv_c_alignas],
21
+ [AS_IF([test x$ac_prog_cc_stdc = xc11],
22
+ [zw_cv_c_alignas=_Alignas],
23
+ [AC_COMPILE_IFELSE(
24
+ [AC_LANG_PROGRAM([[
25
+ int __attribute__((__aligned__(8))) global;
26
+ struct __attribute__((__aligned__(8))) aggregate { int x, y; };
27
+ ]], [[
28
+ int __attribute__((__aligned__(8))) local;
29
+ ]])],
30
+ [zw_cv_c_alignas=__attribute__],
31
+ [zw_cv_c_alignas=unknown])
32
+ ])
33
+ ])
34
+ AS_IF([test x$zw_cv_c_alignas = x_Alignas],
35
+ [zw_c_alignas_expr="_Alignas(n)"],
36
+ [test x$zw_cv_c_alignas = x__attribute__],
37
+ [zw_c_alignas_expr="__attribute__((__aligned__(n)))"],
38
+ [AC_MSG_FAILURE([could not find a way to control data alignment])])
39
+ AC_DEFINE_UNQUOTED([alignas(n)], [$zw_c_alignas_expr],
40
+ [Define as a type specifier which sets the alignment of a variable or type
41
+ to N bytes. C11 alignas(TYPE) does not need to be supported.])
42
+ ])
43
+
44
+ AC_DEFUN([zw_C_ALIGNOF],
45
+ [AC_REQUIRE([AC_PROG_CC])
46
+ AC_CACHE_CHECK([how to query data alignment], [zw_cv_c_alignof],
47
+ [AS_IF([test x$ac_prog_cc_stdc = xc11],
48
+ [zw_cv_c_alignof=_Alignof],
49
+ [AC_COMPILE_IFELSE(
50
+ [AC_LANG_PROGRAM([[
51
+ struct agg { int x, y; };
52
+ extern const char align_int[__alignof__(int)];
53
+ extern const char align_agg[__alignof__(struct agg)];
54
+ ]], [[
55
+ double d;
56
+ char align_var[__alignof__(d)];
57
+ ]])],
58
+ [zw_cv_c_alignof=__alignof__],
59
+ [zw_cv_c_alignof=unknown])
60
+ ])
61
+ ])
62
+ AS_IF([test x$zw_cv_c_alignof = x_Alignof],
63
+ [zw_c_alignof_expr="_Alignof(thing)"],
64
+ [test x$zw_cv_c_alignof = x__alignof__],
65
+ [zw_c_alignof_expr="__alignof__(thing)"],
66
+ [AC_MSG_FAILURE([could not find a way to query data alignment])])
67
+ AC_DEFINE_UNQUOTED([alignof(thing)], [$zw_c_alignof_expr],
68
+ [Define as an expression which evaluates to the alignment of THING.
69
+ Must be computed at compile time (an "integer constant expression").])
70
+ ])
71
+
72
+ AC_DEFUN([zw_C_MAX_ALIGN_T],
73
+ [AC_REQUIRE([AC_PROG_CC])
74
+ AC_REQUIRE([zw_C_ALIGNOF])
75
+ AC_CACHE_CHECK([for max_align_t in stddef.h], [zw_cv_c_max_align_t],
76
+ [AC_COMPILE_IFELSE(
77
+ [AC_LANG_PROGRAM([[
78
+ #include <stddef.h>
79
+ ]], [[
80
+ max_align_t var;
81
+ return alignof(var);
82
+ ]])],
83
+ [zw_cv_c_max_align_t=yes],
84
+ [zw_cv_c_max_align_t=no])
85
+ ])
86
+ AS_IF([test x$zw_cv_c_max_align_t = xyes],
87
+ [AC_DEFINE([HAVE_MAX_ALIGN_T], 1,
88
+ [Define if stddef.h provides max_align_t.])
89
+ ])
90
+ ])
@@ -0,0 +1,307 @@
1
+ dnl Copyright 2017 Zack Weinberg <zackw at panix.com>.
2
+ dnl Partially based on Autoconf, copyright 1992-2017 Free Software Foundation.
3
+ dnl
4
+ dnl This program is free software; you can redistribute it and/or
5
+ dnl modify it under the terms of the GNU General Public License as
6
+ dnl published by the Free Software Foundation, either version 3 of the
7
+ dnl License, or (at your option) any later version.
8
+ dnl
9
+ dnl This program is distributed in the hope that it will be useful,
10
+ dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ dnl GNU General Public License for more details.
13
+ dnl
14
+ dnl Under Section 7 of GPL version 3, you are granted additional
15
+ dnl permissions described in the Autoconf Configure Script Exception,
16
+ dnl version 3.0, as published by the Free Software Foundation.
17
+ dnl
18
+ dnl Because only two files in this source tree are released
19
+ dnl under GPLv3 with exceptions, neither the GPLv3 nor the exception are
20
+ dnl distributed with this source tree. Copies can be retrieved from
21
+ dnl https://www.gnu.org/licenses/
22
+ dnl
23
+ dnl As of this writing (September 2017), Autoconf 2.70 is not yet released.
24
+ dnl Backport some improvements:
25
+ dnl - switch AC_CHECK_HEADER to compile-only
26
+ dnl - eliminate unnecessary tests in AC_INCLUDES_DEFAULT
27
+ dnl - Darwin (OSX) support in AC_USE_SYSTEM_EXTENSIONS
28
+ dnl - C11 mode by default in AC_PROG_CC, falling back to C99
29
+ AC_PREREQ([2.62])dnl earliest version with working m4_version_prereq
30
+ m4_version_prereq([2.70], [], [
31
+
32
+ m4_define([AC_CHECK_HEADER], [_AC_CHECK_HEADER_COMPILE($@)])
33
+
34
+ AC_DEFUN_ONCE([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
35
+ [m4_divert_text([DEFAULTS],
36
+ [# Factoring default headers for most tests.
37
+ ac_includes_default="\
38
+ #include <stddef.h>
39
+ #include <stdio.h>
40
+ #include <stdlib.h>
41
+ #include <string.h>
42
+ #ifdef HAVE_SYS_TYPES_H
43
+ # include <sys/types.h>
44
+ #endif
45
+ #ifdef HAVE_SYS_STAT_H
46
+ # include <sys/stat.h>
47
+ #endif
48
+ #ifdef HAVE_STRINGS_H
49
+ # include <strings.h>
50
+ #endif
51
+ #ifdef HAVE_INTTYPES_H
52
+ # include <inttypes.h>
53
+ #endif
54
+ #ifdef HAVE_STDINT_H
55
+ # include <stdint.h>
56
+ #endif
57
+ #ifdef HAVE_UNISTD_H
58
+ # include <unistd.h>
59
+ #endif"
60
+ ])]dnl
61
+ [AC_CHECK_HEADERS(
62
+ [sys/types.h sys/stat.h strings.h inttypes.h stdint.h unistd.h],,,[/**/])]dnl
63
+ dnl For backward compatibility, provide unconditional AC_DEFINEs of
64
+ dnl HAVE_STDLIB_H, HAVE_STRING_H, and STDC_HEADERS.
65
+ [AC_DEFINE([HAVE_STDLIB_H], [1],
66
+ [Always define to 1, for backward compatibility.
67
+ You can assume <stdlib.h> exists.])]dnl
68
+ [AC_DEFINE([HAVE_STRING_H], [1],
69
+ [Always define to 1, for backward compatibility.
70
+ You can assume <string.h> exists.])]dnl
71
+ [AC_DEFINE([STDC_HEADERS], [1],
72
+ [Always define to 1, for backward compatibility.
73
+ You can assume the C90 standard headers exist.])])
74
+
75
+ m4_define([AC_USE_SYSTEM_EXTENSIONS],
76
+ m4_defn([AC_USE_SYSTEM_EXTENSIONS])[
77
+ AH_VERBATIM([USE_SYSTEM_EXTENSIONS_270],
78
+ [/* Enable general extensions on OSX. */
79
+ #ifndef _DARWIN_C_SOURCE
80
+ # undef _DARWIN_C_SOURCE
81
+ #endif
82
+ ])
83
+ AC_DEFINE([_DARWIN_C_SOURCE])
84
+ ])
85
+
86
+ dnl Prior to 2.70, AC_PROG_CC ends with an unconditional call to
87
+ dnl _AC_PROG_CC_C89. Use this as an extension hook, replacing it with
88
+ dnl the logic that will be used in 2.70.
89
+ m4_define([_AC_PROG_CC_C89_original], m4_defn([_AC_PROG_CC_C89]))
90
+ m4_define([_AC_PROG_CC_C89], [dnl
91
+ dnl Set ac_prog_cc_stdc to the supported C version.
92
+ dnl Also set the documented variable ac_cv_prog_cc_stdc;
93
+ dnl its name was chosen when it was cached, but it is no longer cached.
94
+ _AC_PROG_CC_C11([ac_prog_cc_stdc=c11
95
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11],
96
+ [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99
97
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99],
98
+ [_AC_PROG_CC_C89_original([ac_prog_cc_stdc=c89
99
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89],
100
+ [ac_prog_cc_stdc=no
101
+ ac_cv_prog_cc_stdc=no])])])
102
+ ])
103
+ dnl Must also supply the definition of _AC_PROG_CC_C11.
104
+ dnl This is also taken verbatim from Autoconf trunk.
105
+ dnl I regret the bulk.
106
+ AC_DEFUN([_AC_PROG_CC_C11],
107
+ [_AC_C_STD_TRY([c11],
108
+ [[#include <stdarg.h>
109
+ #include <stdbool.h>
110
+ #include <stddef.h>
111
+ #include <stdlib.h>
112
+ #include <wchar.h>
113
+ #include <stdio.h>
114
+
115
+ // Check varargs macros. These examples are taken from C99 6.10.3.5.
116
+ #define debug(...) fprintf (stderr, __VA_ARGS__)
117
+ #define showlist(...) puts (#__VA_ARGS__)
118
+ #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
119
+ static void
120
+ test_varargs_macros (void)
121
+ {
122
+ int x = 1234;
123
+ int y = 5678;
124
+ debug ("Flag");
125
+ debug ("X = %d\n", x);
126
+ showlist (The first, second, and third items.);
127
+ report (x>y, "x is %d but y is %d", x, y);
128
+ }
129
+
130
+ // Check long long types.
131
+ #define BIG64 18446744073709551615ull
132
+ #define BIG32 4294967295ul
133
+ #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
134
+ #if !BIG_OK
135
+ your preprocessor is broken;
136
+ #endif
137
+ #if BIG_OK
138
+ #else
139
+ your preprocessor is broken;
140
+ #endif
141
+ static long long int bignum = -9223372036854775807LL;
142
+ static unsigned long long int ubignum = BIG64;
143
+
144
+ struct incomplete_array
145
+ {
146
+ int datasize;
147
+ double data[];
148
+ };
149
+
150
+ struct named_init {
151
+ int number;
152
+ const wchar_t *name;
153
+ double average;
154
+ };
155
+
156
+ typedef const char *ccp;
157
+
158
+ static inline int
159
+ test_restrict (ccp restrict text)
160
+ {
161
+ // See if C++-style comments work.
162
+ // Iterate through items via the restricted pointer.
163
+ // Also check for declarations in for loops.
164
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
165
+ continue;
166
+ return 0;
167
+ }
168
+
169
+ // Check varargs and va_copy.
170
+ static bool
171
+ test_varargs (const char *format, ...)
172
+ {
173
+ va_list args;
174
+ va_start (args, format);
175
+ va_list args_copy;
176
+ va_copy (args_copy, args);
177
+
178
+ const char *str = "";
179
+ int number = 0;
180
+ float fnumber = 0;
181
+
182
+ while (*format)
183
+ {
184
+ switch (*format++)
185
+ {
186
+ case 's': // string
187
+ str = va_arg (args_copy, const char *);
188
+ break;
189
+ case 'd': // int
190
+ number = va_arg (args_copy, int);
191
+ break;
192
+ case 'f': // float
193
+ fnumber = va_arg (args_copy, double);
194
+ break;
195
+ default:
196
+ break;
197
+ }
198
+ }
199
+ va_end (args_copy);
200
+ va_end (args);
201
+
202
+ return *str && number && fnumber;
203
+ }
204
+
205
+ // Check _Alignas.
206
+ char _Alignas (double) aligned_as_double;
207
+ char _Alignas (0) no_special_alignment;
208
+ extern char aligned_as_int;
209
+ char _Alignas (0) _Alignas (int) aligned_as_int;
210
+
211
+ // Check _Alignof.
212
+ enum
213
+ {
214
+ int_alignment = _Alignof (int),
215
+ int_array_alignment = _Alignof (int[100]),
216
+ char_alignment = _Alignof (char)
217
+ };
218
+ _Static_assert (0 < -_Alignof (int), "_Alignof is signed");
219
+
220
+ // Check _Noreturn.
221
+ int _Noreturn does_not_return (void) { for (;;) continue; }
222
+
223
+ // Check _Static_assert.
224
+ struct test_static_assert
225
+ {
226
+ int x;
227
+ _Static_assert (sizeof (int) <= sizeof (long int),
228
+ "_Static_assert does not work in struct");
229
+ long int y;
230
+ };
231
+
232
+ // Check UTF-8 literals.
233
+ #define u8 syntax error!
234
+ char const utf8_literal[] = u8"happens to be ASCII" "another string";
235
+
236
+ // Check duplicate typedefs.
237
+ typedef long *long_ptr;
238
+ typedef long int *long_ptr;
239
+ typedef long_ptr long_ptr;
240
+
241
+ // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
242
+ struct anonymous
243
+ {
244
+ union {
245
+ struct { int i; int j; };
246
+ struct { int k; long int l; } w;
247
+ };
248
+ int m;
249
+ } v1;
250
+ ]],
251
+ [[
252
+ // Check bool.
253
+ _Bool success = false;
254
+
255
+ // Check restrict.
256
+ if (test_restrict ("String literal") == 0)
257
+ success = true;
258
+ char *restrict newvar = "Another string";
259
+
260
+ // Check varargs.
261
+ success &= test_varargs ("s, d' f .", "string", 65, 34.234);
262
+ test_varargs_macros ();
263
+
264
+ // Check flexible array members.
265
+ struct incomplete_array *ia =
266
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
267
+ ia->datasize = 10;
268
+ for (int i = 0; i < ia->datasize; ++i)
269
+ ia->data[i] = i * 1.234;
270
+
271
+ // Check named initializers.
272
+ struct named_init ni = {
273
+ .number = 34,
274
+ .name = L"Test wide string",
275
+ .average = 543.34343,
276
+ };
277
+
278
+ ni.number = 58;
279
+
280
+ int dynamic_array[ni.number];
281
+ dynamic_array[ni.number - 1] = 543;
282
+
283
+ // work around unused variable warnings
284
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
285
+ || dynamic_array[ni.number - 1] != 543);
286
+
287
+ v1.i = 2;
288
+ v1.w.k = 5;
289
+ _Static_assert ((offsetof (struct anonymous, i)
290
+ == offsetof (struct anonymous, w.k)),
291
+ "Anonymous union alignment botch");
292
+ ]],
293
+ dnl Try
294
+ dnl GCC -std=gnu11 (unused restrictive mode: -std=c11)
295
+ dnl with extended modes being tried first.
296
+ dnl
297
+ dnl Do not try -qlanglvl=extc1x, because IBM XL C V12.1 (the latest version as
298
+ dnl of September 2012) does not pass the C11 test. For now, try extc1x when
299
+ dnl compiling the C99 test instead, since it enables _Static_assert and
300
+ dnl _Noreturn, which is a win. If -qlanglvl=extc11 or -qlanglvl=extc1x passes
301
+ dnl the C11 test in some future version of IBM XL C, we'll add it here,
302
+ dnl preferably extc11.
303
+ [[-std=gnu11]], [$1], [$2])[]dnl
304
+ ])# _AC_PROG_CC_C11
305
+
306
+
307
+ ])dnl m4_version_prereq([2.70], ...)
@@ -0,0 +1,24 @@
1
+ dnl Written by Zack Weinberg <zackw at panix.com> in 2021.
2
+ dnl To the extent possible under law, Zack Weinberg has waived all
3
+ dnl copyright and related or neighboring rights to this work.
4
+ dnl
5
+ dnl See https://creativecommons.org/publicdomain/zero/1.0/ for further
6
+ dnl details.
7
+ dnl
8
+ dnl Detect whether the active compiler compiles programs with ASan
9
+ dnl instrumentation. If so, execute ACTIONS-IF-TRUE, otherwise
10
+ dnl ACTIONS-IF-FALSE.
11
+ dnl
12
+ dnl Implementation note: with clang one can use __has_feature(address_sanitizer)
13
+ dnl to detect ASan, but gcc does not support that. Instead we look
14
+ dnl for ASan symbols in the linked executable. This requires a helper
15
+ dnl macro shipped with libtool.
16
+ dnl
17
+ dnl zw_ASAN_IFELSE(actions-if-true[, actions-if-false])
18
+ AC_DEFUN([zw_ASAN_IFELSE],
19
+ [AC_REQUIRE([AC_PROG_EGREP])]dnl
20
+ [AC_REQUIRE([LT_PATH_NM])]dnl
21
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
22
+ [AS_IF([$NM conftest$EXEEXT | $EGREP _asan_ > /dev/null 2>&1],
23
+ [$1], [$2])],
24
+ [AC_MSG_ERROR([cannot link a trivial test program])])])