ntp_crypto_rand.m4 [plain text]
AC_DEFUN([NTP_CRYPTO_RAND], [
AC_MSG_CHECKING([if we want to use OpenSSL's crypto random (if available)])
AC_ARG_ENABLE(
[openssl-random],
[AS_HELP_STRING(
[--enable-openssl-random],
[Use OpenSSL's crypto random number functions, if available (default is yes)]
)],
[ntp_use_openssl_random=$enableval],
[ntp_use_openssl_random=yes]
)
AC_MSG_RESULT([$ntp_use_openssl_random])
NTPO_SAVED_LIBS="$LIBS"
LIBS="$NTPO_SAVED_LIBS $LDADD_NTP"
AC_CHECK_FUNCS([RAND_bytes RAND_poll])
LIBS="$NTPO_SAVED_LIBS"
case "$ntp_use_openssl_random$ac_cv_func_RAND_bytes$ac_cv_func_RAND_poll" in
yesyesyes)
AC_DEFINE([USE_OPENSSL_CRYPTO_RAND], [1], [Use OpenSSL's crypto random functions])
;;
*) ntp_use_openssl_random=no ;;
esac
])