summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren at mit.edu>2015-09-20 17:46:07 -0400
committerGravatar Benjamin Barenblat <bbaren at mit.edu>2015-09-20 17:46:07 -0400
commit438e05e7ea9949b7ee61e40a2a6bc7e1c1d4b8f3 (patch)
tree37b337e60f9df517c895327003f41b83d717cf28 /configure.ac
parent03f1d80a665c4de6fd83ff6dc9399dda97838efa (diff)
Use correct OpenSSL thread safety macros on OS X (closes #209)
Create an Autoconf test to determine if pthread_t is a pointer or scalar type, and use the appropriate CRYPTO_THREADID_set macro based on the result.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a6f8ac43..f074ccbf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,6 +112,22 @@ if test [$CLANG = "yes"]; then
PTHREAD_LIBS=""
fi
+# Check if pthread_t is a scalar or pointer type so we can use the correct
+# OpenSSL functions on it.
+AC_MSG_CHECKING([if pthread_t is a pointer type])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <pthread.h>
+ ]],
+ [[
+pthread_t a;
+*a;
+ ]])],
+ AC_DEFINE([PTHREAD_T_IS_POINTER], [1], [Define if pthread_t is a pointer.])
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+
AC_SUBST(CC)
AC_SUBST(BIN)
AC_SUBST(LIB)