summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-17 16:47:36 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-17 16:47:36 +0000
commiteb7a8feef56ef8bad8774723277b119c5e0e0601 (patch)
treeb36973bca0b6ca274513653b06e0a95ea8cc7b6c
parent7d9edad22513a954edc66ad249dbba0b431959ac (diff)
try to fix --with-crypto=gnutls due libcrypt-config usage.
Seems AC_PATH_GENERIC() wasn't present somewhere, then I'm adding the AM_PATH_LIBGCRYPT() provided by libcrypt (I need to include it in m4/ otherwise it will fail for people doing ./autogen.sh without libgcrypt installed). It works on my machine, but `libgcrypt-config --libs` output is just "-lgcrypt -lgpg-error", including no -L. SVN revision: 82939
Diffstat (limited to '')
-rw-r--r--Makefile.am9
-rw-r--r--configure.ac9
-rw-r--r--m4/libgcrypt.m4123
3 files changed, 132 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index dc41e3ad32..d52f527847 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,20 +37,21 @@ m4/ltversion.m4
37 37
38EXTRA_DIST = \ 38EXTRA_DIST = \
39m4/ac_path_generic.m4 \ 39m4/ac_path_generic.m4 \
40m4/ecore_check_c_extension.m4 \
41m4/ecore_check_module.m4 \
40m4/efl_attribute.m4 \ 42m4/efl_attribute.m4 \
41m4/efl_check_funcs.m4 \ 43m4/efl_check_funcs.m4 \
42m4/efl_compiler.m4 \ 44m4/efl_compiler.m4 \
43m4/efl_doxygen.m4 \ 45m4/efl_doxygen.m4 \
44m4/efl_path_max.m4 \ 46m4/efl_path_max.m4 \
45m4/efl_threads.m4 \ 47m4/efl_threads.m4 \
46m4/evil_windows.m4 \
47m4/eina_check.m4 \ 48m4/eina_check.m4 \
48m4/eina_config.m4 \ 49m4/eina_config.m4 \
50m4/eio_check_options.m4 \
49m4/evas_check_engine.m4 \ 51m4/evas_check_engine.m4 \
50m4/evas_check_loader.m4 \ 52m4/evas_check_loader.m4 \
51m4/ecore_check_c_extension.m4 \ 53m4/evil_windows.m4 \
52m4/ecore_check_module.m4 \ 54m4/libgcrypt.m4
53m4/eio_check_options.m4
54 55
55EXTRA_DIST += \ 56EXTRA_DIST += \
56autogen.sh \ 57autogen.sh \
diff --git a/configure.ac b/configure.ac
index 3c9dd03bb3..7d06758a7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -274,11 +274,10 @@ case "$build_crypto" in
274 gnutls) 274 gnutls)
275 EFL_DEPEND_PKG([crypto], [GNUTLS], [gnutls >= 2.11]) 275 EFL_DEPEND_PKG([crypto], [GNUTLS], [gnutls >= 2.11])
276 276
277 # libgcrypt 277 AM_PATH_LIBGCRYPT([], [:],
278# AC_PATH_GENERIC([libgcrypt], [], [:], 278 [AC_MSG_ERROR([libgcrypt required but not found])])
279# [AC_MSG_ERROR([libgcrypt required but not found])]) 279 requirements_libs_crypto="${LIBGCRYPT_LIBS} ${requirements_libs_crypto}"
280# requirements_libs_crypto="${LIBGCRYPT_LIBS} ${requirements_libs_crypto}" 280 requirements_cflags_crypto="${LIBGCRYPT_CFLAGS} ${requirements_cflags_crypto}"
281# requirements_cflags_crypto="${LIBGCRYPT_CFLAGS} ${requirements_cflags_crypto}"
282 ;; 281 ;;
283 282
284 openssl) 283 openssl)
diff --git a/m4/libgcrypt.m4 b/m4/libgcrypt.m4
new file mode 100644
index 0000000000..831dc0c6f4
--- /dev/null
+++ b/m4/libgcrypt.m4
@@ -0,0 +1,123 @@
1dnl Autoconf macros for libgcrypt
2dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc.
3dnl
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
6dnl modifications, as long as this notice is preserved.
7dnl
8dnl This file is distributed in the hope that it will be useful, but
9dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12
13dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
14dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
15dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
16dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
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
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
21dnl with a changed API.
22dnl
23AC_DEFUN([AM_PATH_LIBGCRYPT],
24[ AC_ARG_WITH(libgcrypt-prefix,
25 AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
26 [prefix where LIBGCRYPT is installed (optional)]),
27 libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
28 if test x$libgcrypt_config_prefix != x ; then
29 if test x${LIBGCRYPT_CONFIG+set} != xset ; then
30 LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
31 fi
32 fi
33
34 AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
35 tmp=ifelse([$1], ,1:1.2.0,$1)
36 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
37 req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
38 min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
39 else
40 req_libgcrypt_api=0
41 min_libgcrypt_version="$tmp"
42 fi
43
44 AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
45 ok=no
46 if test "$LIBGCRYPT_CONFIG" != "no" ; then
47 req_major=`echo $min_libgcrypt_version | \
48 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
49 req_minor=`echo $min_libgcrypt_version | \
50 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
51 req_micro=`echo $min_libgcrypt_version | \
52 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
53 libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
54 major=`echo $libgcrypt_config_version | \
55 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
56 minor=`echo $libgcrypt_config_version | \
57 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
58 micro=`echo $libgcrypt_config_version | \
59 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
60 if test "$major" -gt "$req_major"; then
61 ok=yes
62 else
63 if test "$major" -eq "$req_major"; then
64 if test "$minor" -gt "$req_minor"; then
65 ok=yes
66 else
67 if test "$minor" -eq "$req_minor"; then
68 if test "$micro" -ge "$req_micro"; then
69 ok=yes
70 fi
71 fi
72 fi
73 fi
74 fi
75 fi
76 if test $ok = yes; then
77 AC_MSG_RESULT([yes ($libgcrypt_config_version)])
78 else
79 AC_MSG_RESULT(no)
80 fi
81 if test $ok = yes; then
82 # If we have a recent libgcrypt, we should also check that the
83 # API is compatible
84 if test "$req_libgcrypt_api" -gt 0 ; then
85 tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
86 if test "$tmp" -gt 0 ; then
87 AC_MSG_CHECKING([LIBGCRYPT API version])
88 if test "$req_libgcrypt_api" -eq "$tmp" ; then
89 AC_MSG_RESULT([okay])
90 else
91 ok=no
92 AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
93 fi
94 fi
95 fi
96 fi
97 if test $ok = yes; then
98 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
99 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
100 ifelse([$2], , :, [$2])
101 if test x"$host" != x ; then
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
115 fi
116 else
117 LIBGCRYPT_CFLAGS=""
118 LIBGCRYPT_LIBS=""
119 ifelse([$3], , :, [$3])
120 fi
121 AC_SUBST(LIBGCRYPT_CFLAGS)
122 AC_SUBST(LIBGCRYPT_LIBS)
123])