2 dnl Copyright (C) 2005-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
9 AC_ARG_WITH([libgcrypt],
10 AS_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
11 libgcrypt=$withval, libgcrypt=no)
12 if test "$libgcrypt" != no; then
13 # gc-libgcrypt.c will fail on startup if we don't have
14 # version 1.4.4 or later, so test for it early. */
16 AM_PATH_LIBGCRYPT([1.4.4], [gl_good_gcrypt=yes],
17 [AC_MSG_ERROR([libgcrypt is too old])])
18 if test "x$gl_good_gcrypt" != xno; then
19 dnl Ignore the value of LIBGCRYPT_LIBS, because it does not include
21 AC_LIB_HAVE_LINKFLAGS([gcrypt], [gpg-error], [#include <gcrypt.h>])
22 LIB_CRYPTO="$LIBGCRYPT"
24 AC_MSG_ERROR([libgcrypt not found])
27 AC_SUBST([LIB_CRYPTO])
29 AC_REQUIRE([AC_C_RESTRICT])