1 Add and use pkg-config for libgcrypt instead of -config scripts.
3 Upstream-Status: Rejected [upstream have indicated they don't want a pkg-config dependency]
7 Index: libgcrypt-1.2.4/configure.ac
8 ===================================================================
9 --- libgcrypt-1.2.4.orig/configure.ac 2008-03-19 22:14:50.000000000 +0000
10 +++ libgcrypt-1.2.4/configure.ac 2008-03-19 22:14:58.000000000 +0000
19 Index: libgcrypt-1.2.4/src/libgcrypt.pc.in
20 ===================================================================
21 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
22 +++ libgcrypt-1.2.4/src/libgcrypt.pc.in 2008-03-19 22:14:58.000000000 +0000
24 +# Process this file with autoconf to produce a pkg-config metadata file.
25 +# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation
26 +# Author: Simon Josefsson
28 +# This file is free software; as a special exception the author gives
29 +# unlimited permission to copy and/or distribute it, with or without
30 +# modifications, as long as this notice is preserved.
32 +# This file is distributed in the hope that it will be useful, but
33 +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
34 +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
37 +exec_prefix=@exec_prefix@
39 +includedir=@includedir@
42 +api_version=@LIBGCRYPT_CONFIG_API_VERSION@
43 +host=@LIBGCRYPT_CONFIG_HOST@
46 +symmetric_ciphers=@LIBGCRYPT_CIPHERS@
47 +asymmetric_ciphers=@LIBGCRYPT_PUBKEY_CIPHERS@
48 +digests=@LIBGCRYPT_DIGESTS@
51 +Description: GNU crypto library
52 +URL: http://www.gnupg.org
54 +Libs: -L${libdir} -lgcrypt
55 +Libs.private: -L${libdir} -lgpg-error
56 +Cflags: -I${includedir}
57 Index: libgcrypt-1.6.1/src/libgcrypt.m4
58 ===================================================================
59 --- libgcrypt-1.6.1.orig/src/libgcrypt.m4 2013-12-16 17:44:32.000000000 +0000
60 +++ libgcrypt-1.6.1/src/libgcrypt.m4 2014-05-13 21:25:37.478389833 +0000
63 AC_DEFUN([AM_PATH_LIBGCRYPT],
64 [ AC_REQUIRE([AC_CANONICAL_HOST])
65 - AC_ARG_WITH(libgcrypt-prefix,
66 - AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
67 - [prefix where LIBGCRYPT is installed (optional)]),
68 - libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
69 - if test x$libgcrypt_config_prefix != x ; then
70 - if test x${LIBGCRYPT_CONFIG+set} != xset ; then
71 - LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
75 - AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
76 tmp=ifelse([$1], ,1:1.2.0,$1)
77 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
78 req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
80 min_libgcrypt_version="$tmp"
83 - AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
85 - if test "$LIBGCRYPT_CONFIG" != "no" ; then
86 - req_major=`echo $min_libgcrypt_version | \
87 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
88 - req_minor=`echo $min_libgcrypt_version | \
89 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
90 - req_micro=`echo $min_libgcrypt_version | \
91 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
92 - libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
93 - major=`echo $libgcrypt_config_version | \
94 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
95 - minor=`echo $libgcrypt_config_version | \
96 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
97 - micro=`echo $libgcrypt_config_version | \
98 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
99 - if test "$major" -gt "$req_major"; then
102 - if test "$major" -eq "$req_major"; then
103 - if test "$minor" -gt "$req_minor"; then
106 - if test "$minor" -eq "$req_minor"; then
107 - if test "$micro" -ge "$req_micro"; then
115 - if test $ok = yes; then
116 - AC_MSG_RESULT([yes ($libgcrypt_config_version)])
120 + PKG_CHECK_MODULES(LIBGCRYPT, [libgcrypt >= $min_libgcrypt_version], [ok=yes], [ok=no])
122 if test $ok = yes; then
123 # If we have a recent libgcrypt, we should also check that the
125 if test "$req_libgcrypt_api" -gt 0 ; then
126 - tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
127 + tmp=`$PKG_CONFIG --variable=api_version libgcrypt`
128 if test "$tmp" -gt 0 ; then
129 AC_MSG_CHECKING([LIBGCRYPT API version])
130 if test "$req_libgcrypt_api" -eq "$tmp" ; then
134 if test $ok = yes; then
135 - LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
136 - LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
137 ifelse([$2], , :, [$2])
138 - libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
139 + libgcrypt_config_host=`$PKG_CONFIG --variable=host libgcrypt`
140 if test x"$libgcrypt_config_host" != xnone ; then
141 if test x"$libgcrypt_config_host" != x"$host" ; then
147 - LIBGCRYPT_CFLAGS=""
149 ifelse([$3], , :, [$3])
151 AC_SUBST(LIBGCRYPT_CFLAGS)