uringmachine 0.16 → 0.18

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 (259) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +3 -0
  3. data/.gitmodules +4 -0
  4. data/CHANGELOG.md +8 -0
  5. data/TODO.md +12 -3
  6. data/examples/bm_send.rb +86 -0
  7. data/ext/um/um.c +28 -1
  8. data/ext/um/um.h +3 -0
  9. data/ext/um/um_class.c +17 -0
  10. data/ext/um/um_utils.c +38 -15
  11. data/lib/uringmachine/version.rb +1 -1
  12. data/test/test_um.rb +76 -0
  13. data/vendor/libressl/.github/scripts/changelog.sh +74 -0
  14. data/vendor/libressl/.github/workflows/android.yml +35 -0
  15. data/vendor/libressl/.github/workflows/cifuzz.yml +33 -0
  16. data/vendor/libressl/.github/workflows/cmake-config.yml +98 -0
  17. data/vendor/libressl/.github/workflows/coverity.yml +69 -0
  18. data/vendor/libressl/.github/workflows/emscripten.yml +71 -0
  19. data/vendor/libressl/.github/workflows/fedora-rawhide.yml +39 -0
  20. data/vendor/libressl/.github/workflows/freebsd.yml +71 -0
  21. data/vendor/libressl/.github/workflows/linux.yml +71 -0
  22. data/vendor/libressl/.github/workflows/macos.yml +37 -0
  23. data/vendor/libressl/.github/workflows/release.yml +81 -0
  24. data/vendor/libressl/.github/workflows/rust-openssl.yml +47 -0
  25. data/vendor/libressl/.github/workflows/solaris.yml +37 -0
  26. data/vendor/libressl/.github/workflows/windows.yml +70 -0
  27. data/vendor/libressl/.gitignore +333 -0
  28. data/vendor/libressl/CMakeLists.txt +581 -0
  29. data/vendor/libressl/COPYING +133 -0
  30. data/vendor/libressl/ChangeLog +3280 -0
  31. data/vendor/libressl/FindLibreSSL.cmake +232 -0
  32. data/vendor/libressl/LibreSSLConfig.cmake.in +36 -0
  33. data/vendor/libressl/Makefile.am +60 -0
  34. data/vendor/libressl/Makefile.am.common +20 -0
  35. data/vendor/libressl/OPENBSD_BRANCH +1 -0
  36. data/vendor/libressl/README.md +238 -0
  37. data/vendor/libressl/README.mingw.md +43 -0
  38. data/vendor/libressl/apps/CMakeLists.txt +18 -0
  39. data/vendor/libressl/apps/Makefile.am +5 -0
  40. data/vendor/libressl/apps/nc/CMakeLists.txt +67 -0
  41. data/vendor/libressl/apps/nc/Makefile.am +64 -0
  42. data/vendor/libressl/apps/nc/compat/accept4.c +17 -0
  43. data/vendor/libressl/apps/nc/compat/readpassphrase.c +205 -0
  44. data/vendor/libressl/apps/nc/compat/socket.c +29 -0
  45. data/vendor/libressl/apps/nc/compat/sys/socket.h +30 -0
  46. data/vendor/libressl/apps/ocspcheck/CMakeLists.txt +44 -0
  47. data/vendor/libressl/apps/ocspcheck/Makefile.am +45 -0
  48. data/vendor/libressl/apps/ocspcheck/compat/.gitignore +0 -0
  49. data/vendor/libressl/apps/openssl/CMakeLists.txt +97 -0
  50. data/vendor/libressl/apps/openssl/Makefile.am +108 -0
  51. data/vendor/libressl/apps/openssl/apps_win.c +138 -0
  52. data/vendor/libressl/apps/openssl/certhash_win.c +13 -0
  53. data/vendor/libressl/apps/openssl/compat/clock_gettime_osx.c +26 -0
  54. data/vendor/libressl/apps/openssl/compat/poll_win.c +329 -0
  55. data/vendor/libressl/appveyor.yml +53 -0
  56. data/vendor/libressl/autogen.sh +15 -0
  57. data/vendor/libressl/check-release.sh +86 -0
  58. data/vendor/libressl/cmake_export_symbol.cmake +71 -0
  59. data/vendor/libressl/cmake_uninstall.cmake.in +36 -0
  60. data/vendor/libressl/config +17 -0
  61. data/vendor/libressl/configure.ac +165 -0
  62. data/vendor/libressl/crypto/CMakeLists.txt +863 -0
  63. data/vendor/libressl/crypto/Makefile.am +962 -0
  64. data/vendor/libressl/crypto/Makefile.am.arc4random +46 -0
  65. data/vendor/libressl/crypto/Makefile.am.elf-mips +14 -0
  66. data/vendor/libressl/crypto/Makefile.am.elf-mips64 +14 -0
  67. data/vendor/libressl/crypto/Makefile.am.elf-x86_64 +35 -0
  68. data/vendor/libressl/crypto/Makefile.am.macosx-x86_64 +35 -0
  69. data/vendor/libressl/crypto/Makefile.am.masm-x86_64 +22 -0
  70. data/vendor/libressl/crypto/Makefile.am.mingw64-x86_64 +23 -0
  71. data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_darwin.c +60 -0
  72. data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_linux.c +62 -0
  73. data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_none.c +26 -0
  74. data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_windows.c +36 -0
  75. data/vendor/libressl/crypto/arch/loongarch64/crypto_arch.h +21 -0
  76. data/vendor/libressl/crypto/arch/mips/crypto_arch.h +21 -0
  77. data/vendor/libressl/crypto/bn/arch/loongarch64/bn_arch.h +23 -0
  78. data/vendor/libressl/crypto/bn/arch/mips/bn_arch.h +24 -0
  79. data/vendor/libressl/crypto/compat/.gitignore +31 -0
  80. data/vendor/libressl/crypto/compat/arc4random.h +41 -0
  81. data/vendor/libressl/crypto/compat/b_win.c +55 -0
  82. data/vendor/libressl/crypto/compat/bsd-asprintf.c +96 -0
  83. data/vendor/libressl/crypto/compat/crypto_lock_win.c +56 -0
  84. data/vendor/libressl/crypto/compat/explicit_bzero_win.c +13 -0
  85. data/vendor/libressl/crypto/compat/freezero.c +32 -0
  86. data/vendor/libressl/crypto/compat/getdelim.c +78 -0
  87. data/vendor/libressl/crypto/compat/getline.c +40 -0
  88. data/vendor/libressl/crypto/compat/getopt_long.c +528 -0
  89. data/vendor/libressl/crypto/compat/getpagesize.c +18 -0
  90. data/vendor/libressl/crypto/compat/getprogname_linux.c +23 -0
  91. data/vendor/libressl/crypto/compat/getprogname_unimpl.c +7 -0
  92. data/vendor/libressl/crypto/compat/getprogname_windows.c +13 -0
  93. data/vendor/libressl/crypto/compat/posix_win.c +296 -0
  94. data/vendor/libressl/crypto/compat/syslog_r.c +19 -0
  95. data/vendor/libressl/crypto/compat/ui_openssl_win.c +334 -0
  96. data/vendor/libressl/dist.sh +22 -0
  97. data/vendor/libressl/gen-coverage-report.sh +58 -0
  98. data/vendor/libressl/gen-openbsd-tags.sh +20 -0
  99. data/vendor/libressl/include/CMakeLists.txt +61 -0
  100. data/vendor/libressl/include/Makefile.am +79 -0
  101. data/vendor/libressl/include/arch/loongarch64/opensslconf.h +150 -0
  102. data/vendor/libressl/include/arch/mips/opensslconf.h +150 -0
  103. data/vendor/libressl/include/compat/arpa/inet.h +15 -0
  104. data/vendor/libressl/include/compat/arpa/nameser.h +25 -0
  105. data/vendor/libressl/include/compat/cet.h +19 -0
  106. data/vendor/libressl/include/compat/dirent.h +17 -0
  107. data/vendor/libressl/include/compat/dirent_msvc.h +611 -0
  108. data/vendor/libressl/include/compat/endian.h +161 -0
  109. data/vendor/libressl/include/compat/err.h +95 -0
  110. data/vendor/libressl/include/compat/fcntl.h +32 -0
  111. data/vendor/libressl/include/compat/getopt.h +50 -0
  112. data/vendor/libressl/include/compat/limits.h +25 -0
  113. data/vendor/libressl/include/compat/netdb.h +10 -0
  114. data/vendor/libressl/include/compat/netinet/in.h +19 -0
  115. data/vendor/libressl/include/compat/netinet/ip.h +49 -0
  116. data/vendor/libressl/include/compat/netinet/tcp.h +10 -0
  117. data/vendor/libressl/include/compat/poll.h +63 -0
  118. data/vendor/libressl/include/compat/pthread.h +122 -0
  119. data/vendor/libressl/include/compat/readpassphrase.h +44 -0
  120. data/vendor/libressl/include/compat/resolv.h +24 -0
  121. data/vendor/libressl/include/compat/stdint.h +31 -0
  122. data/vendor/libressl/include/compat/stdio.h +65 -0
  123. data/vendor/libressl/include/compat/stdlib.h +57 -0
  124. data/vendor/libressl/include/compat/string.h +98 -0
  125. data/vendor/libressl/include/compat/sys/_null.h +18 -0
  126. data/vendor/libressl/include/compat/sys/ioctl.h +11 -0
  127. data/vendor/libressl/include/compat/sys/mman.h +19 -0
  128. data/vendor/libressl/include/compat/sys/param.h +15 -0
  129. data/vendor/libressl/include/compat/sys/queue.h +536 -0
  130. data/vendor/libressl/include/compat/sys/select.h +10 -0
  131. data/vendor/libressl/include/compat/sys/socket.h +18 -0
  132. data/vendor/libressl/include/compat/sys/stat.h +129 -0
  133. data/vendor/libressl/include/compat/sys/time.h +37 -0
  134. data/vendor/libressl/include/compat/sys/tree.h +1006 -0
  135. data/vendor/libressl/include/compat/sys/types.h +69 -0
  136. data/vendor/libressl/include/compat/sys/uio.h +17 -0
  137. data/vendor/libressl/include/compat/syslog.h +38 -0
  138. data/vendor/libressl/include/compat/time.h +59 -0
  139. data/vendor/libressl/include/compat/unistd.h +83 -0
  140. data/vendor/libressl/include/compat/win32netcompat.h +57 -0
  141. data/vendor/libressl/include/openssl/Makefile.am.tpl +45 -0
  142. data/vendor/libressl/libcrypto.pc.in +28 -0
  143. data/vendor/libressl/libressl.pub +2 -0
  144. data/vendor/libressl/libssl.pc.in +28 -0
  145. data/vendor/libressl/libtls.pc.in +28 -0
  146. data/vendor/libressl/m4/ax_add_fortify_source.m4 +80 -0
  147. data/vendor/libressl/m4/ax_check_compile_flag.m4 +53 -0
  148. data/vendor/libressl/m4/check-hardening-options.m4 +110 -0
  149. data/vendor/libressl/m4/check-libc.m4 +189 -0
  150. data/vendor/libressl/m4/check-os-options.m4 +181 -0
  151. data/vendor/libressl/m4/disable-compiler-warnings.m4 +44 -0
  152. data/vendor/libressl/man/CMakeLists.txt +26 -0
  153. data/vendor/libressl/man/links +2780 -0
  154. data/vendor/libressl/man/update_links.sh +25 -0
  155. data/vendor/libressl/openssl.pc.in +11 -0
  156. data/vendor/libressl/patches/bn_shift.patch +34 -0
  157. data/vendor/libressl/patches/crypto_arch.h.patch +34 -0
  158. data/vendor/libressl/patches/crypto_namespace.h.patch +22 -0
  159. data/vendor/libressl/patches/netcat.c.patch +178 -0
  160. data/vendor/libressl/patches/openssl.c.patch +12 -0
  161. data/vendor/libressl/patches/opensslfeatures.h.patch +49 -0
  162. data/vendor/libressl/patches/patch-amd64-crypto-cpu-caps.c.patch +20 -0
  163. data/vendor/libressl/patches/patch-i386-crypto-cpu-caps.c.patch +20 -0
  164. data/vendor/libressl/patches/speed.c.patch +114 -0
  165. data/vendor/libressl/patches/ssl_namespace.h.patch +21 -0
  166. data/vendor/libressl/patches/tls.h.patch +16 -0
  167. data/vendor/libressl/patches/tls_config.c.patch +15 -0
  168. data/vendor/libressl/patches/win32_amd64_bn_arch.h.patch +28 -0
  169. data/vendor/libressl/patches/windows_headers.patch +80 -0
  170. data/vendor/libressl/scripts/config.guess +1774 -0
  171. data/vendor/libressl/scripts/config.sub +1907 -0
  172. data/vendor/libressl/scripts/i686-w64-mingw32.cmake +9 -0
  173. data/vendor/libressl/scripts/test +210 -0
  174. data/vendor/libressl/scripts/wrap-compiler-for-flag-check +31 -0
  175. data/vendor/libressl/scripts/x86_64-w64-mingw32.cmake +9 -0
  176. data/vendor/libressl/ssl/CMakeLists.txt +183 -0
  177. data/vendor/libressl/ssl/Makefile.am +187 -0
  178. data/vendor/libressl/tests/CMakeLists.txt +970 -0
  179. data/vendor/libressl/tests/Makefile.am +944 -0
  180. data/vendor/libressl/tests/aeadtest.sh +30 -0
  181. data/vendor/libressl/tests/arc4randomforktest.sh +21 -0
  182. data/vendor/libressl/tests/asn1time_small.test +10 -0
  183. data/vendor/libressl/tests/cmake/CMakeLists.txt +52 -0
  184. data/vendor/libressl/tests/cmake/crypto.c +7 -0
  185. data/vendor/libressl/tests/cmake/ssl.c +6 -0
  186. data/vendor/libressl/tests/cmake/tls.c +6 -0
  187. data/vendor/libressl/tests/compat/pipe2.c +186 -0
  188. data/vendor/libressl/tests/dtlstest.sh +28 -0
  189. data/vendor/libressl/tests/evptest.sh +22 -0
  190. data/vendor/libressl/tests/keypairtest.sh +27 -0
  191. data/vendor/libressl/tests/mlkem_tests.sh +39 -0
  192. data/vendor/libressl/tests/ocsptest.bat +25 -0
  193. data/vendor/libressl/tests/ocsptest.sh +23 -0
  194. data/vendor/libressl/tests/openssl.cnf +29 -0
  195. data/vendor/libressl/tests/optionstest.c +381 -0
  196. data/vendor/libressl/tests/pidwraptest.c +85 -0
  197. data/vendor/libressl/tests/pidwraptest.sh +26 -0
  198. data/vendor/libressl/tests/quictest.bat +27 -0
  199. data/vendor/libressl/tests/quictest.sh +30 -0
  200. data/vendor/libressl/tests/renegotiation_test.bat +27 -0
  201. data/vendor/libressl/tests/renegotiation_test.sh +30 -0
  202. data/vendor/libressl/tests/rfc5280time_small.test +10 -0
  203. data/vendor/libressl/tests/servertest.bat +27 -0
  204. data/vendor/libressl/tests/servertest.sh +30 -0
  205. data/vendor/libressl/tests/shutdowntest.bat +27 -0
  206. data/vendor/libressl/tests/shutdowntest.sh +30 -0
  207. data/vendor/libressl/tests/ssltest.bat +32 -0
  208. data/vendor/libressl/tests/ssltest.sh +48 -0
  209. data/vendor/libressl/tests/testdsa.bat +47 -0
  210. data/vendor/libressl/tests/testdsa.sh +57 -0
  211. data/vendor/libressl/tests/testenc.bat +85 -0
  212. data/vendor/libressl/tests/testenc.sh +93 -0
  213. data/vendor/libressl/tests/testrsa.bat +47 -0
  214. data/vendor/libressl/tests/testrsa.sh +57 -0
  215. data/vendor/libressl/tests/testssl.bat +171 -0
  216. data/vendor/libressl/tests/tlstest.bat +27 -0
  217. data/vendor/libressl/tests/tlstest.sh +28 -0
  218. data/vendor/libressl/tls/CMakeLists.txt +125 -0
  219. data/vendor/libressl/tls/Makefile.am +76 -0
  220. data/vendor/libressl/tls/compat/ftruncate.c +17 -0
  221. data/vendor/libressl/tls/compat/pread.c +29 -0
  222. data/vendor/libressl/tls/compat/pwrite.c +29 -0
  223. data/vendor/libressl/update.sh +460 -0
  224. data/vendor/liburing/.github/workflows/ci.yml +8 -0
  225. data/vendor/liburing/configure +23 -2
  226. data/vendor/liburing/examples/helpers.c +1 -1
  227. data/vendor/liburing/examples/helpers.h +1 -1
  228. data/vendor/liburing/examples/reg-wait.c +3 -3
  229. data/vendor/liburing/examples/zcrx.c +5 -5
  230. data/vendor/liburing/liburing.spec +1 -1
  231. data/vendor/liburing/src/include/liburing/io_uring.h +16 -0
  232. data/vendor/liburing/src/include/liburing.h +20 -4
  233. data/vendor/liburing/src/lib.h +2 -4
  234. data/vendor/liburing/src/liburing-ffi.map +7 -0
  235. data/vendor/liburing/src/liburing.map +7 -0
  236. data/vendor/liburing/src/register.c +5 -0
  237. data/vendor/liburing/src/sanitize.c +5 -4
  238. data/vendor/liburing/src/setup.c +43 -28
  239. data/vendor/liburing/test/Makefile +7 -0
  240. data/vendor/liburing/test/cmd-discard.c +2 -2
  241. data/vendor/liburing/test/evfd-short-read.c +84 -0
  242. data/vendor/liburing/test/fdinfo-sqpoll.c +117 -0
  243. data/vendor/liburing/test/fdinfo.c +1 -1
  244. data/vendor/liburing/test/fixed-buf-merge.c +2 -2
  245. data/vendor/liburing/test/futex-kill.c +135 -0
  246. data/vendor/liburing/test/helpers.c +1 -1
  247. data/vendor/liburing/test/helpers.h +1 -1
  248. data/vendor/liburing/test/init-mem.c +50 -12
  249. data/vendor/liburing/test/io_uring_passthrough.c +25 -6
  250. data/vendor/liburing/test/msg-ring.c +123 -9
  251. data/vendor/liburing/test/recv-bundle-short-ooo.c +16 -1
  252. data/vendor/liburing/test/recv-inc-ooo.c +411 -0
  253. data/vendor/liburing/test/recv-mshot-fair.c +513 -0
  254. data/vendor/liburing/test/reg-wait.c +14 -14
  255. data/vendor/liburing/test/send-zerocopy.c +4 -4
  256. data/vendor/liburing/test/timerfd-short-read.c +81 -0
  257. data/vendor/liburing/test/timestamp.c +382 -0
  258. data/vendor/liburing/test/zcrx.c +22 -22
  259. metadata +222 -2
@@ -0,0 +1,110 @@
1
+
2
+ AC_DEFUN([CHECK_CFLAG], [
3
+ AC_LANG_ASSERT(C)
4
+ AC_MSG_CHECKING([if $saved_CC supports "$1"])
5
+ old_cflags="$CFLAGS"
6
+ CFLAGS="$1 -Wall -Werror"
7
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("Hello")]])],
8
+ [AC_MSG_RESULT([yes])
9
+ CFLAGS=$old_cflags
10
+ HARDEN_CFLAGS="$HARDEN_CFLAGS $1"],
11
+ [AC_MSG_RESULT([no])
12
+ CFLAGS=$old_cflags
13
+ [$2]])
14
+ ])
15
+
16
+ AC_DEFUN([CHECK_LDFLAG], [
17
+ AC_LANG_ASSERT(C)
18
+ AC_MSG_CHECKING([if $saved_LD supports "$1"])
19
+ old_ldflags="$LDFLAGS"
20
+ LDFLAGS="$1 -Wall -Werror"
21
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("Hello")]])],
22
+ [AC_MSG_RESULT([yes])
23
+ LDFLAGS=$old_ldflags
24
+ HARDEN_LDFLAGS="$HARDEN_LDFLAGS $1"],
25
+ [AC_MSG_RESULT([no])
26
+ LDFLAGS=$old_ldflags
27
+ [$2]])
28
+ ])
29
+
30
+ AC_DEFUN([DISABLE_AS_EXECUTABLE_STACK], [
31
+ save_cflags="$CFLAGS"
32
+ CFLAGS=
33
+ AC_MSG_CHECKING([whether AS supports .note.GNU-stack])
34
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
35
+ __asm__(".section .note.GNU-stack,\"\",@progbits");]])],
36
+ [AC_MSG_RESULT([yes])]
37
+ [AM_CFLAGS=-DHAVE_GNU_STACK],
38
+ [AC_MSG_RESULT([no])]
39
+ )
40
+ CFLAGS="$save_cflags $AM_CFLAGS"
41
+ ])
42
+
43
+
44
+ AC_DEFUN([CHECK_C_HARDENING_OPTIONS], [
45
+
46
+ AC_ARG_ENABLE([hardening],
47
+ [AS_HELP_STRING([--disable-hardening],
48
+ [Disable options to frustrate memory corruption exploits])],
49
+ [], [enable_hardening=yes])
50
+
51
+ AC_ARG_ENABLE([windows-ssp],
52
+ [AS_HELP_STRING([--enable-windows-ssp],
53
+ [Enable building the stack smashing protection on
54
+ Windows. This currently distributing libssp-0.dll.])])
55
+
56
+ # We want to check for compiler flag support. Prior to clang v5.1, there was no
57
+ # way to make clang's "argument unused" warning fatal. So we invoke the
58
+ # compiler through a wrapper script that greps for this message.
59
+ saved_CC="$CC"
60
+ saved_LD="$LD"
61
+ flag_wrap="$srcdir/scripts/wrap-compiler-for-flag-check"
62
+ CC="$flag_wrap $CC"
63
+ LD="$flag_wrap $LD"
64
+
65
+ AS_IF([test "x$enable_hardening" = "xyes"], [
66
+ # Tell GCC to NOT optimize based on signed arithmetic overflow
67
+ CHECK_CFLAG([[-fno-strict-overflow]])
68
+
69
+ # _FORTIFY_SOURCE replaces builtin functions with safer versions.
70
+ AS_IF([test "x$HOST_OS" != "xwin"], [
71
+ AX_ADD_FORTIFY_SOURCE
72
+ ])
73
+
74
+ # Enable read only relocations
75
+ CHECK_LDFLAG([[-Wl,-z,relro]])
76
+ CHECK_LDFLAG([[-Wl,-z,now]])
77
+
78
+ # Windows security flags
79
+ AS_IF([test "x$HOST_OS" = "xwin"], [
80
+ CHECK_LDFLAG([[-Wl,--nxcompat]])
81
+ CHECK_LDFLAG([[-Wl,--dynamicbase]])
82
+ CHECK_LDFLAG([[-Wl,--high-entropy-va]])
83
+ ])
84
+
85
+ # Use stack-protector-strong if available; if not, fallback to
86
+ # stack-protector-all which is considered to be overkill
87
+ AS_IF([test "x$enable_windows_ssp" = "xyes" -o "x$HOST_OS" != "xwin"], [
88
+ CHECK_CFLAG([[-fstack-protector-strong]],
89
+ CHECK_CFLAG([[-fstack-protector-all]],
90
+ AC_MSG_WARN([compiler does not appear to support stack protection])
91
+ )
92
+ )
93
+ AS_IF([test "x$HOST_OS" = "xwin"], [
94
+ AC_SEARCH_LIBS([__stack_chk_guard],[ssp])
95
+ ])
96
+ ])
97
+
98
+ # Check for control-flow integrity support
99
+ AS_IF([test "x$HOST_OS" != "xdarwin"], [
100
+ CHECK_CFLAG([[-fcf-protection=full]])
101
+ ])
102
+ ])
103
+
104
+ # Restore CC, LD
105
+ CC="$saved_CC"
106
+ LD="$saved_LD"
107
+
108
+ CFLAGS="$CFLAGS $HARDEN_CFLAGS"
109
+ LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS"
110
+ ])
@@ -0,0 +1,189 @@
1
+ #
2
+ # Copyright (c) 2014 Brent Cook
3
+ #
4
+ # Permission to use, copy, modify, and distribute this software for any
5
+ # purpose with or without fee is hereby granted, provided that the above
6
+ # copyright notice and this permission notice appear in all copies.
7
+ #
8
+ # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
+ # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
+ # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
+ # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
+ # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
+ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
+
16
+ AC_DEFUN([CHECK_LIBC_COMPAT], [
17
+ # Check for libc headers
18
+ AC_CHECK_HEADERS([endian.h machine/endian.h err.h readpassphrase.h])
19
+ AC_CHECK_HEADERS([netinet/ip.h], [], [],
20
+ [#include <sys/types.h>
21
+ #include <arpa/inet.h>
22
+ ])
23
+ AC_HEADER_RESOLV
24
+ # Check for general libc functions
25
+ AC_CHECK_FUNCS([asprintf freezero getdelim getline memmem])
26
+ AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray])
27
+ AC_CHECK_FUNCS([strcasecmp strlcat strlcpy strndup strnlen strsep strtonum])
28
+ AC_CHECK_FUNCS([timegm _mkgmtime timespecsub])
29
+ AC_CHECK_FUNCS([getopt getprogname syslog syslog_r])
30
+ AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [
31
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
32
+ #include <unistd.h>
33
+ ]], [[
34
+ getpagesize();
35
+ ]])],
36
+ [ ac_cv_func_getpagesize="yes" ],
37
+ [ ac_cv_func_getpagesize="no"
38
+ ])
39
+ ])
40
+ AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes])
41
+ AM_CONDITIONAL([HAVE_FREEZERO], [test "x$ac_cv_func_freezero" = xyes])
42
+ AM_CONDITIONAL([HAVE_GETDELIM], [test "x$ac_cv_func_getdelim" = xyes])
43
+ AM_CONDITIONAL([HAVE_GETLINE], [test "x$ac_cv_func_getline" = xyes])
44
+ AM_CONDITIONAL([HAVE_GETPAGESIZE], [test "x$ac_cv_func_getpagesize" = xyes])
45
+ AM_CONDITIONAL([HAVE_GETOPT], [test "x$ac_cv_func_getopt" = xyes])
46
+ AM_CONDITIONAL([HAVE_MEMMEM], [test "x$ac_cv_func_memmem" = xyes])
47
+ AM_CONDITIONAL([HAVE_READPASSPHRASE], [test "x$ac_cv_func_readpassphrase" = xyes])
48
+ AM_CONDITIONAL([HAVE_REALLOCARRAY], [test "x$ac_cv_func_reallocarray" = xyes])
49
+ AM_CONDITIONAL([HAVE_RECALLOCARRAY], [test "x$ac_cv_func_recallocarray" = xyes])
50
+ AM_CONDITIONAL([HAVE_STRCASECMP], [test "x$ac_cv_func_strcasecmp" = xyes])
51
+ AM_CONDITIONAL([HAVE_STRLCAT], [test "x$ac_cv_func_strlcat" = xyes])
52
+ AM_CONDITIONAL([HAVE_STRLCPY], [test "x$ac_cv_func_strlcpy" = xyes])
53
+ AM_CONDITIONAL([HAVE_STRNDUP], [test "x$ac_cv_func_strndup" = xyes])
54
+ AM_CONDITIONAL([HAVE_STRNLEN], [test "x$ac_cv_func_strnlen" = xyes])
55
+ AM_CONDITIONAL([HAVE_STRSEP], [test "x$ac_cv_func_strsep" = xyes])
56
+ AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes])
57
+ AM_CONDITIONAL([HAVE_GETPROGNAME], [test "x$ac_cv_func_getprogname" = xyes])
58
+ AM_CONDITIONAL([HAVE_SYSLOG], [test "x$ac_cv_func_syslog" = xyes])
59
+ AM_CONDITIONAL([HAVE_SYSLOG_R], [test "x$ac_cv_func_syslog_r" = xyes])
60
+ ])
61
+
62
+ AC_DEFUN([CHECK_SYSCALL_COMPAT], [
63
+ AC_CHECK_FUNCS([accept4 pipe2 pledge poll socketpair])
64
+ AM_CONDITIONAL([HAVE_ACCEPT4], [test "x$ac_cv_func_accept4" = xyes])
65
+ AM_CONDITIONAL([HAVE_PIPE2], [test "x$ac_cv_func_pipe2" = xyes])
66
+ AM_CONDITIONAL([HAVE_PLEDGE], [test "x$ac_cv_func_pledge" = xyes])
67
+ AM_CONDITIONAL([HAVE_POLL], [test "x$ac_cv_func_poll" = xyes])
68
+ AM_CONDITIONAL([HAVE_SOCKETPAIR], [test "x$ac_cv_func_socketpair" = xyes])
69
+ ])
70
+
71
+ AC_DEFUN([CHECK_B64_NTOP], [
72
+ AC_SEARCH_LIBS([b64_ntop],[resolv])
73
+ AC_SEARCH_LIBS([__b64_ntop],[resolv])
74
+ AC_CACHE_CHECK([for b64_ntop], ac_cv_have_b64_ntop_arg, [
75
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
76
+ #include <sys/types.h>
77
+ #include <sys/socket.h>
78
+ #include <netinet/in.h>
79
+ #include <arpa/inet.h>
80
+ #include <resolv.h>
81
+ ]], [[ b64_ntop(NULL, 0, NULL, 0); ]])],
82
+ [ ac_cv_have_b64_ntop_arg="yes" ],
83
+ [ ac_cv_have_b64_ntop_arg="no"
84
+ ])
85
+ ])
86
+ AM_CONDITIONAL([HAVE_B64_NTOP], [test "x$ac_cv_func_b64_ntop_arg" = xyes])
87
+ ])
88
+
89
+ AC_DEFUN([CHECK_CRYPTO_COMPAT], [
90
+ # Check crypto-related libc functions and syscalls
91
+ AC_CHECK_FUNCS([arc4random arc4random_buf arc4random_uniform])
92
+ AC_CHECK_FUNCS([explicit_bzero getauxval])
93
+
94
+ AC_CACHE_CHECK([for getentropy], ac_cv_func_getentropy, [
95
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
96
+ #include <sys/types.h>
97
+ #include <unistd.h>
98
+
99
+ /*
100
+ * Explanation:
101
+ *
102
+ * - iOS <= 10.1 fails because of missing sys/random.h
103
+ *
104
+ * - in macOS 10.12 getentropy is not tagged as introduced in
105
+ * 10.12 so we cannot use it for target < 10.12
106
+ */
107
+ #ifdef __APPLE__
108
+ # include <AvailabilityMacros.h>
109
+ # include <TargetConditionals.h>
110
+
111
+ # if (TARGET_OS_IPHONE || TARGET_OS_SIMULATOR)
112
+ # include <sys/random.h> /* Not available as of iOS <= 10.1 */
113
+ # else
114
+
115
+ # include <sys/random.h> /* Pre 10.12 systems should die here */
116
+
117
+ /* Based on: https://gitweb.torproject.org/tor.git/commit/?id=16fcbd21 */
118
+ # ifndef MAC_OS_X_VERSION_10_12
119
+ # define MAC_OS_X_VERSION_10_12 101200 /* Robustness */
120
+ # endif
121
+ # if defined(MAC_OS_X_VERSION_MIN_REQUIRED)
122
+ # if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
123
+ # error "Targeting on Mac OSX 10.11 or earlier"
124
+ # endif
125
+ # endif
126
+
127
+ # endif
128
+ #endif /* __APPLE__ */
129
+ ]], [[
130
+ char buffer;
131
+ (void)getentropy(&buffer, sizeof (buffer));
132
+ ]])],
133
+ [ ac_cv_func_getentropy="yes" ],
134
+ [ ac_cv_func_getentropy="no"
135
+ ])
136
+ ])
137
+
138
+ AC_CHECK_FUNCS([timingsafe_bcmp timingsafe_memcmp])
139
+ AM_CONDITIONAL([HAVE_ARC4RANDOM], [test "x$ac_cv_func_arc4random" = xyes])
140
+ AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF], [test "x$ac_cv_func_arc4random_buf" = xyes])
141
+ AM_CONDITIONAL([HAVE_ARC4RANDOM_UNIFORM], [test "x$ac_cv_func_arc4random_uniform" = xyes])
142
+ AM_CONDITIONAL([HAVE_EXPLICIT_BZERO], [test "x$ac_cv_func_explicit_bzero" = xyes])
143
+ AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = xyes])
144
+ AM_CONDITIONAL([HAVE_TIMINGSAFE_BCMP], [test "x$ac_cv_func_timingsafe_bcmp" = xyes])
145
+ AM_CONDITIONAL([HAVE_TIMINGSAFE_MEMCMP], [test "x$ac_cv_func_timingsafe_memcmp" = xyes])
146
+
147
+ # Override arc4random_buf implementations with known issues
148
+ AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF],
149
+ [test "x$USE_BUILTIN_ARC4RANDOM" != xyes \
150
+ -a "x$ac_cv_func_arc4random_buf" = xyes])
151
+
152
+ # Check for getentropy fallback dependencies
153
+ AC_CHECK_FUNCS([getauxval])
154
+ AC_SEARCH_LIBS([dl_iterate_phdr],[dl])
155
+ AC_CHECK_FUNCS([dl_iterate_phdr])
156
+
157
+ AC_SEARCH_LIBS([pthread_once],[pthread])
158
+ AC_SEARCH_LIBS([pthread_mutex_lock],[pthread])
159
+ AC_SEARCH_LIBS([clock_gettime],[rt posix4])
160
+ AC_CHECK_FUNCS([clock_gettime])
161
+ AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "x$ac_cv_func_clock_gettime" = xyes])
162
+ ])
163
+
164
+ AC_DEFUN([CHECK_VA_COPY], [
165
+ AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
166
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
167
+ #include <stdarg.h>
168
+ va_list x,y;
169
+ ]], [[ va_copy(x,y); ]])],
170
+ [ ac_cv_have_va_copy="yes" ],
171
+ [ ac_cv_have_va_copy="no"
172
+ ])
173
+ ])
174
+ if test "x$ac_cv_have_va_copy" = "xyes" ; then
175
+ AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists])
176
+ fi
177
+
178
+ AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
179
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
180
+ #include <stdarg.h>
181
+ va_list x,y;
182
+ ]], [[ __va_copy(x,y); ]])],
183
+ [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no"
184
+ ])
185
+ ])
186
+ if test "x$ac_cv_have___va_copy" = "xyes" ; then
187
+ AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists])
188
+ fi
189
+ ])
@@ -0,0 +1,181 @@
1
+ #
2
+ # Copyright (c) 2014 Brent Cook
3
+ #
4
+ # Permission to use, copy, modify, and distribute this software for any
5
+ # purpose with or without fee is hereby granted, provided that the above
6
+ # copyright notice and this permission notice appear in all copies.
7
+ #
8
+ # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
+ # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
+ # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
+ # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
+ # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
+ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
+
16
+ AC_DEFUN([CHECK_OS_OPTIONS], [
17
+
18
+ CFLAGS="$CFLAGS -Wall -std=gnu99 -fno-strict-aliasing"
19
+ BUILD_NC=yes
20
+
21
+ case $host_os in
22
+ *aix*)
23
+ HOST_OS=aix
24
+ if test "`echo $CC | cut -d ' ' -f 1`" != "gcc" ; then
25
+ CFLAGS="-qnoansialias $USER_CFLAGS"
26
+ fi
27
+ AC_SUBST([PLATFORM_LDADD], ['-lperfstat'])
28
+ ;;
29
+ *cygwin*)
30
+ HOST_OS=cygwin
31
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
32
+ ;;
33
+ *darwin*)
34
+ HOST_OS=darwin
35
+ HOST_ABI=macosx
36
+ #
37
+ # Don't use arc4random on systems before 10.12 because of
38
+ # weak seed on failure to open /dev/random, based on latest
39
+ # public source:
40
+ # https://www.opensource.apple.com/source/Libc/Libc-997.90.3/gen/FreeBSD/arc4random.c
41
+ #
42
+ # We use the presence of getentropy() to detect 10.12. The
43
+ # following check take into account that:
44
+ #
45
+ # - iOS <= 10.1 fails because of missing getentropy and
46
+ # hence they miss sys/random.h
47
+ #
48
+ # - in macOS 10.12 getentropy is not tagged as introduced in
49
+ # 10.12 so we cannot use it for target < 10.12
50
+ #
51
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
52
+ #include <AvailabilityMacros.h>
53
+ #include <unistd.h>
54
+ #include <sys/random.h> /* Systems without getentropy() should die here */
55
+
56
+ /* Based on: https://gitweb.torproject.org/tor.git/commit/?id=16fcbd21 */
57
+ #ifndef MAC_OS_X_VERSION_10_12
58
+ # define MAC_OS_X_VERSION_10_12 101200
59
+ #endif
60
+ #if defined(MAC_OS_X_VERSION_MIN_REQUIRED)
61
+ # if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
62
+ # error "Running on Mac OSX 10.11 or earlier"
63
+ # endif
64
+ #endif
65
+ ]], [[
66
+ char buf[1]; getentropy(buf, 1);
67
+ ]])],
68
+ [ USE_BUILTIN_ARC4RANDOM=no ],
69
+ [ USE_BUILTIN_ARC4RANDOM=yes ]
70
+ )
71
+ AC_MSG_CHECKING([whether to use builtin arc4random])
72
+ AC_MSG_RESULT([$USE_BUILTIN_ARC4RANDOM])
73
+ # Not available on iOS
74
+ AC_CHECK_HEADER([arpa/telnet.h], [], [BUILD_NC=no])
75
+ ;;
76
+ *freebsd*)
77
+ HOST_OS=freebsd
78
+ HOST_ABI=elf
79
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
80
+ #include <sys/param.h>
81
+ #if __FreeBSD_version < 1200000
82
+ undefined
83
+ #endif
84
+ ]], [[]])],
85
+ [ USE_BUILTIN_ARC4RANDOM=no ],
86
+ [ USE_BUILTIN_ARC4RANDOM=yes ]
87
+ )
88
+ AC_SUBST([PROG_LDADD], ['-lthr'])
89
+ ;;
90
+ *hpux*)
91
+ HOST_OS=hpux;
92
+ if test "echo $host_os | cut -c 1-4" = "ia64" ; then
93
+ if test "echo $CC | cut -d ' ' -f 1" = "gcc" ; then
94
+ CFLAGS="$CFLAGS -mlp64"
95
+ else
96
+ CFLAGS="+DD64"
97
+ fi
98
+ fi
99
+ if ! test "echo $CC | cut -d ' ' -f 1" = "gcc" ; then
100
+ CFLAGS="-g -O2 +Otype_safety=off $CFLAGS $USER_CFLAGS"
101
+ fi
102
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT"
103
+ ;;
104
+ *linux*)
105
+ HOST_OS=linux
106
+ HOST_ABI=elf
107
+ CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
108
+ ;;
109
+ *midipix*)
110
+ HOST_OS=midipix
111
+ CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
112
+ ;;
113
+ *netbsd*)
114
+ HOST_OS=netbsd
115
+ HOST_ABI=elf
116
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
117
+ #include <sys/param.h>
118
+ #if __NetBSD_Version__ < 700000001
119
+ undefined
120
+ #endif
121
+ ]], [[]])],
122
+ [ USE_BUILTIN_ARC4RANDOM=no ],
123
+ [ USE_BUILTIN_ARC4RANDOM=yes ]
124
+ )
125
+ CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE"
126
+ ;;
127
+ *openbsd*)
128
+ HOST_OS=openbsd
129
+ HOST_ABI=elf
130
+ AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded])
131
+ AC_DEFINE([HAVE_ATTRIBUTE__DEAD], [1], [OpenBSD gcc has __dead])
132
+ ;;
133
+ *mingw*)
134
+ HOST_OS=win
135
+ HOST_ABI=mingw64
136
+ BUILD_NC=no
137
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_POSIX -D_POSIX_SOURCE -D__USE_MINGW_ANSI_STDIO"
138
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS"
139
+ CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
140
+ CPPFLAGS="$CPPFLAGS"
141
+ AC_SUBST([PLATFORM_LDADD], ['-lws2_32 -lbcrypt'])
142
+ ;;
143
+ *solaris*)
144
+ HOST_OS=solaris
145
+ HOST_ABI=elf
146
+ CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP"
147
+ AC_SUBST([PLATFORM_LDADD], ['-ldl -lmd -lnsl -lsocket'])
148
+ ;;
149
+ *)
150
+ HOST_OS=unsupported
151
+ HOST_ABI=elf
152
+ ;;
153
+ esac
154
+
155
+ # Check if time_t is sized correctly
156
+ AC_CHECK_SIZEOF([time_t], [time.h])
157
+ AM_CONDITIONAL([SMALL_TIME_T], [test "$ac_cv_sizeof_time_t" = "4"])
158
+ if test "$ac_cv_sizeof_time_t" = "4"; then
159
+ AC_DEFINE([SMALL_TIME_T])
160
+ echo " ** Warning, this system is unable to represent times past 2038"
161
+ echo " ** It will behave incorrectly when handling valid RFC5280 dates"
162
+
163
+ if test "$host_os" = "mingw32" ; then
164
+ echo " **"
165
+ echo " ** You can solve this by adjusting the build flags in your"
166
+ echo " ** mingw-w64 toolchain. Refer to README.mingw.md for details."
167
+ fi
168
+ fi
169
+
170
+ AM_CONDITIONAL([HOST_AIX], [test x$HOST_OS = xaix])
171
+ AM_CONDITIONAL([HOST_CYGWIN], [test x$HOST_OS = xcygwin])
172
+ AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin])
173
+ AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd])
174
+ AM_CONDITIONAL([HOST_HPUX], [test x$HOST_OS = xhpux])
175
+ AM_CONDITIONAL([HOST_LINUX], [test x$HOST_OS = xlinux])
176
+ AM_CONDITIONAL([HOST_MIDIPIX], [test x$HOST_OS = xmidipix])
177
+ AM_CONDITIONAL([HOST_NETBSD], [test x$HOST_OS = xnetbsd])
178
+ AM_CONDITIONAL([HOST_OPENBSD], [test x$HOST_OS = xopenbsd])
179
+ AM_CONDITIONAL([HOST_SOLARIS], [test x$HOST_OS = xsolaris])
180
+ AM_CONDITIONAL([HOST_WIN], [test x$HOST_OS = xwin])
181
+ ])
@@ -0,0 +1,44 @@
1
+ #
2
+ # Copyright (c) 2014 Brent Cook
3
+ #
4
+ # Permission to use, copy, modify, and distribute this software for any
5
+ # purpose with or without fee is hereby granted, provided that the above
6
+ # copyright notice and this permission notice appear in all copies.
7
+ #
8
+ # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
+ # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
+ # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
+ # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
+ # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
+ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
+
16
+ AC_DEFUN([DISABLE_COMPILER_WARNINGS], [
17
+ # Clang throws a lot of warnings when it does not understand a flag. Disable
18
+ # this warning for now so other warnings are visible.
19
+ AC_MSG_CHECKING([if compiling with clang])
20
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
21
+ #ifndef __clang__
22
+ not clang
23
+ #endif
24
+ ]])],
25
+ [CLANG=yes],
26
+ [CLANG=no]
27
+ )
28
+ AC_MSG_RESULT([$CLANG])
29
+ AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments])
30
+ CFLAGS="$CFLAGS $CLANG_FLAGS"
31
+ LDFLAGS="$LDFLAGS $CLANG_FLAGS"
32
+
33
+ # Removing the dependency on -Wno-pointer-sign should be a goal. These are
34
+ # largely unsigned char */char* mismatches in asn1 functions.
35
+ save_cflags="$CFLAGS"
36
+ CFLAGS=-Wno-pointer-sign
37
+ AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
38
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
39
+ [AC_MSG_RESULT([yes])]
40
+ [AM_CFLAGS=-Wno-pointer-sign],
41
+ [AC_MSG_RESULT([no])]
42
+ )
43
+ CFLAGS="$save_cflags $AM_CFLAGS"
44
+ ])
@@ -0,0 +1,26 @@
1
+ #
2
+ # Copyright (c) 2015 Jeff Davey
3
+ #
4
+ # Permission to use, copy, modify, and distribute this software for any
5
+ # purpose with or without fee is hereby granted, provided that the above
6
+ # copyright notice and this permission notice appear in all copies.
7
+ #
8
+ # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
+ # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
+ # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
+ # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
+ # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
+ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
+
16
+ if(ENABLE_LIBRESSL_INSTALL)
17
+ install(DIRECTORY .
18
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
19
+ FILES_MATCHING PATTERN "*.3"
20
+ )
21
+
22
+ install(DIRECTORY .
23
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man5
24
+ FILES_MATCHING PATTERN "*.5"
25
+ )
26
+ endif(ENABLE_LIBRESSL_INSTALL)