From ed029dfab959bca74bd43d86922727c2047eeb4d Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 26 Oct 2017 10:56:04 +0200 Subject: Enable GnuTLS fallback On systems with GNU/Linux kernel older than 3.17 (Debian 8 "jessie" for example) the osmo_get_rand_id() would always return failure due to missing getrandom() syscall. To support such systems, let's add fallback code which uses GnuTLS library. It can be disabled explicitly via '--disable-gnutls' option at compile-time, otherwise ./configure will fail if both getrandom() and GnuTLS are not available. When building with '--enable-embedded' the fallback is disabled automatically. Related: OS#1694 Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b --- configure.ac | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index d9390cf8..a8c1d2e3 100644 --- a/configure.ac +++ b/configure.ac @@ -130,6 +130,20 @@ AS_IF([test "x$ENABLE_PCSC" = "xyes"], [ AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes") AC_SUBST(ENABLE_PCSC) +AC_ARG_ENABLE([gnutls], [AS_HELP_STRING([--disable-gnutls], [Do not use GnuTLS fallback for missing getrandom()])], + [ENABLE_GNUTLS=$enableval], [ENABLE_GNUTLS="yes"]) +AM_CONDITIONAL(ENABLE_GNUTLS, test x"$ENABLE_GNUTLS" = x"yes") +AS_IF([test "x$ENABLE_GNUTLS" = "xyes"], [ + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0]) +]) +AC_SUBST(ENABLE_GNUTLS) +if test x"$ENABLE_GNUTLS" = x"yes" +then + AC_SUBST([LIBGNUTLS_CFLAGS]) + AC_SUBST([LIBGNUTLS_LIBS]) + AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS as a fallback for missing getrandom()]) +fi + AC_ARG_ENABLE(plugin, [AS_HELP_STRING( [--disable-plugin], @@ -228,12 +242,15 @@ then AM_CONDITIONAL(ENABLE_PLUGIN, false) AM_CONDITIONAL(ENABLE_MSGFILE, false) AM_CONDITIONAL(ENABLE_SERIAL, false) + AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_VTY, false) AM_CONDITIONAL(ENABLE_CTRL, false) AM_CONDITIONAL(ENABLE_UTILITIES, false) AM_CONDITIONAL(ENABLE_GB, false) + AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_PCSC, false) AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true) + AC_DEFINE([USE_GNUTLS], [0]) AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) fi -- cgit v1.2.3