aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/libgcrypt_version_check.diff
blob: 71c4b840b10c65779d31cc0cc612cf47826dacae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -302,12 +302,12 @@
 void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init ()
 {
   gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
-  if (!gcry_check_version (GCRYPT_VERSION))
+  if (!gcry_check_version (NEED_LIBGCRYPT_VERSION))
   {
     FPRINTF (stderr,
              _
              ("libgcrypt has not the expected version (version %s is required).\n"),
-             GCRYPT_VERSION);
+             NEED_LIBGCRYPT_VERSION);
     GNUNET_abort ();
   }
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
--- a/configure.ac
+++ b/configure.ac
@@ -211,13 +211,25 @@
 
 # libgcrypt
 gcrypt=0
-AM_PATH_LIBGCRYPT(1.2.0, gcrypt=1)
+NEED_LIBGCRYPT_API=1
+NEED_LIBGCRYPT_VERSION=1.4.2
+
+
+AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION", gcrypt=1)
 AC_CHECK_DECLS([gcry_mpi_lshift], [], [], [[#include <gcrypt.h>]])
 
 if test $gcrypt = 0
 then
-  AC_MSG_ERROR([GNUnet needs libgcrypt])
+  AC_MSG_ERROR([[
+***
+*** You need libgcrypt to build this program.
+**  This library is for example available at
+***   ftp://ftp.gnupg.org/gcrypt/libgcrypt/
+*** (at least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API)
+***  is required.)
+***]])
 fi
+AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version])
 
 # Adam shostack suggests the following for Windows:
 # -D_FORTIFY_SOURCE=2 -fstack-protector-all