aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/m4/odp_openssl.m4
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/m4/odp_openssl.m4')
-rw-r--r--platform/linux-generic/m4/odp_openssl.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/platform/linux-generic/m4/odp_openssl.m4 b/platform/linux-generic/m4/odp_openssl.m4
new file mode 100644
index 000000000..c9d584c64
--- /dev/null
+++ b/platform/linux-generic/m4/odp_openssl.m4
@@ -0,0 +1,36 @@
+##########################################################################
+# Enable/disable usage of OpenSSL library
+##########################################################################
+AC_ARG_WITH([openssl],
+ [AS_HELP_STRING([--without-openssl],
+ [compile without OpenSSL (may result in disabled crypto and random support)]
+ [[default=with] (linux-generic)])],
+ [],
+ [with_openssl=yes])
+AS_IF([test "$with_openssl" != "no"],
+ [ODP_OPENSSL
+ have_openssl=1], [have_openssl=0])
+AM_CONDITIONAL([WITH_OPENSSL], [test x$with_openssl != xno])
+AC_DEFINE_UNQUOTED([_ODP_OPENSSL], [$have_openssl],
+ [Define to 1 to enable OpenSSL support])
+
+AS_IF([test "${with_openssl}" = "no"],
+ [AC_MSG_WARN([Strong cryptography is not available without OpenSSL])])
+
+##########################################################################
+# Enable/disable usage of OpenSSL for random data
+##########################################################################
+have_openssl_rand=1
+AC_ARG_ENABLE([openssl-rand],
+ [AS_HELP_STRING([--disable-openssl-rand],
+ [disable OpenSSL random data (use arch-specific instead)]
+ [[default=enabled] (linux-generic)])],
+ [if test "x$enableval" = "xno"; then
+ have_openssl_rand=0
+ fi])
+
+AS_IF([test "$have_openssl" != "1"], [have_openssl_rand=0])
+AS_IF([test "$have_openssl_rand" = "1"], [openssl_rand=yes], [openssl_rand=no])
+
+AC_DEFINE_UNQUOTED([_ODP_OPENSSL_RAND], [$have_openssl_rand],
+ [Define to 1 to enable OpenSSL support])