aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-11-07 16:33:42 +0000
committerChristian Grothoff <christian@grothoff.org>2014-11-07 16:33:42 +0000
commit0c89b2a16eae49cb23635f6d6c0f13da070c5c66 (patch)
tree559186ca56ac1279a611d31f3bf3816bc971431c /m4
parent2e33b6fcbad3c1b8ebf7176c39a201c39b23c2b2 (diff)
downloadgnunet-0c89b2a16eae49cb23635f6d6c0f13da070c5c66.tar.gz
gnunet-0c89b2a16eae49cb23635f6d6c0f13da070c5c66.zip
implementing plugin session monitoring API (#3452)
Diffstat (limited to 'm4')
-rw-r--r--m4/libgcrypt.m430
1 files changed, 22 insertions, 8 deletions
diff --git a/m4/libgcrypt.m4 b/m4/libgcrypt.m4
index 20bd10556..6cf482fcb 100644
--- a/m4/libgcrypt.m4
+++ b/m4/libgcrypt.m4
@@ -1,5 +1,5 @@
1dnl Autoconf macros for libgcrypt 1dnl Autoconf macros for libgcrypt
2dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc. 2dnl Copyright (C) 2002, 2004, 2011 Free Software Foundation, Inc.
3dnl 3dnl
4dnl This file is free software; as a special exception the author gives 4dnl This file is free software; as a special exception the author gives
5dnl unlimited permission to copy and/or distribute it, with or without 5dnl unlimited permission to copy and/or distribute it, with or without
@@ -15,13 +15,14 @@ dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
15dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS. 15dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
16dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed 16dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
17dnl with the API version to also check the API compatibility. Example: 17dnl with the API version to also check the API compatibility. Example:
18dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed 18dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
19dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using 19dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using
20dnl this features allows to prevent build against newer versions of libgcrypt 20dnl this features allows to prevent build against newer versions of libgcrypt
21dnl with a changed API. 21dnl with a changed API.
22dnl 22dnl
23AC_DEFUN([AM_PATH_LIBGCRYPT], 23AC_DEFUN([AM_PATH_LIBGCRYPT],
24[ AC_ARG_WITH(libgcrypt-prefix, 24[ AC_REQUIRE([AC_CANONICAL_HOST])
25 AC_ARG_WITH(libgcrypt-prefix,
25 AC_HELP_STRING([--with-libgcrypt-prefix=PFX], 26 AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
26 [prefix where LIBGCRYPT is installed (optional)]), 27 [prefix where LIBGCRYPT is installed (optional)]),
27 libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") 28 libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
@@ -31,7 +32,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
31 fi 32 fi
32 fi 33 fi
33 34
34 AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) 35 AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
35 tmp=ifelse([$1], ,1:1.2.0,$1) 36 tmp=ifelse([$1], ,1:1.2.0,$1)
36 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then 37 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
37 req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` 38 req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
@@ -59,7 +60,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
59 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` 60 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
60 if test "$major" -gt "$req_major"; then 61 if test "$major" -gt "$req_major"; then
61 ok=yes 62 ok=yes
62 else 63 else
63 if test "$major" -eq "$req_major"; then 64 if test "$major" -eq "$req_major"; then
64 if test "$minor" -gt "$req_minor"; then 65 if test "$minor" -gt "$req_minor"; then
65 ok=yes 66 ok=yes
@@ -74,7 +75,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
74 fi 75 fi
75 fi 76 fi
76 if test $ok = yes; then 77 if test $ok = yes; then
77 AC_MSG_RESULT(yes) 78 AC_MSG_RESULT([yes ($libgcrypt_config_version)])
78 else 79 else
79 AC_MSG_RESULT(no) 80 AC_MSG_RESULT(no)
80 fi 81 fi
@@ -86,10 +87,10 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
86 if test "$tmp" -gt 0 ; then 87 if test "$tmp" -gt 0 ; then
87 AC_MSG_CHECKING([LIBGCRYPT API version]) 88 AC_MSG_CHECKING([LIBGCRYPT API version])
88 if test "$req_libgcrypt_api" -eq "$tmp" ; then 89 if test "$req_libgcrypt_api" -eq "$tmp" ; then
89 AC_MSG_RESULT(okay) 90 AC_MSG_RESULT([okay])
90 else 91 else
91 ok=no 92 ok=no
92 AC_MSG_RESULT([does not match (want=$req_libgcrypt_api got=$tmp)]) 93 AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
93 fi 94 fi
94 fi 95 fi
95 fi 96 fi
@@ -98,6 +99,19 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
98 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` 99 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
99 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` 100 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
100 ifelse([$2], , :, [$2]) 101 ifelse([$2], , :, [$2])
102 libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
103 if test x"$libgcrypt_config_host" != xnone ; then
104 if test x"$libgcrypt_config_host" != x"$host" ; then
105 AC_MSG_WARN([[
106***
107*** The config script $LIBGCRYPT_CONFIG was
108*** built for $libgcrypt_config_host and thus may not match the
109*** used host $host.
110*** You may want to use the configure option --with-libgcrypt-prefix
111*** to specify a matching config script.
112***]])
113 fi
114 fi
101 else 115 else
102 LIBGCRYPT_CFLAGS="" 116 LIBGCRYPT_CFLAGS=""
103 LIBGCRYPT_LIBS="" 117 LIBGCRYPT_LIBS=""