]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - m4/pdns_check_libcrypto.m4
Merge pull request #7653 from pieterlexis/docker-ignore
[thirdparty/pdns.git] / m4 / pdns_check_libcrypto.m4
index c9034cf5a2c608542f2789464723541f513feff0..c71c98acc8208cb22fee669e51cc582f2c731a0d 100644 (file)
@@ -90,6 +90,10 @@ AC_DEFUN([PDNS_CHECK_LIBCRYPTO], [
         # it will just work!
     fi
 
+    if $found; then
+        AC_DEFINE([HAVE_LIBCRYPTO], [1], [Define to 1 if you have OpenSSL libcrypto])
+    fi
+
     # try the preprocessor and linker with our new flags,
     # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
 
@@ -107,6 +111,7 @@ AC_DEFUN([PDNS_CHECK_LIBCRYPTO], [
         [AC_LANG_PROGRAM([#include <openssl/crypto.h>], [ERR_load_CRYPTO_strings()])],
         [
             AC_MSG_RESULT([yes])
+            AC_CHECK_FUNCS([RAND_bytes RAND_pseudo_bytes])
             $1
         ], [
             AC_MSG_RESULT([no])
@@ -119,4 +124,5 @@ AC_DEFUN([PDNS_CHECK_LIBCRYPTO], [
     AC_SUBST([LIBCRYPTO_INCLUDES])
     AC_SUBST([LIBCRYPTO_LIBS])
     AC_SUBST([LIBCRYPTO_LDFLAGS])
+    AM_CONDITIONAL([HAVE_LIBCRYPTO], [test "x$LIBCRYPTO_LIBS" != "x"])
 ])