diff configure.ac @ 2174:ce312cad5ecd

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.
author Benjamin Barenblat <bbaren at mit.edu>
date Sun, 20 Sep 2015 17:46:07 -0400
parents 7187068f56f5
children 4f4ae5c92434
line wrap: on
line diff
--- a/configure.ac	Thu Aug 27 16:28:45 2015 -0400
+++ b/configure.ac	Sun Sep 20 17:46:07 2015 -0400
@@ -112,6 +112,22 @@
    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)