blob: f4aec2d1c39927167055bad049b60be3e3275918 [file] [log] [blame]
Andrew Geissler90fd73c2021-03-05 15:25:55 -06001From 26fb6c3faa27180c8ed9ada1728c3d8683a65f3a Mon Sep 17 00:00:00 2001
2From: Armin Kuster <akuster@mvista.com>
3Date: Thu, 22 May 2014 10:50:00 +0100
4Subject: [PATCH] libassuan: Improve pkgconfig support
5
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006Convert to pkg-config support to match changes done to
7the libassuan recipe for libassuan.pc generation.
8
9Upstream-Status: Inappropriate [OE specific]
10
11Signed-off-by: Armin Kuster <akuster@mvista.com>
12
Andrew Geissler90fd73c2021-03-05 15:25:55 -060013---
14 configure.ac | 4 +--
15 m4/libassuan.m4 | 93 ++++---------------------------------------------
16 2 files changed, 9 insertions(+), 88 deletions(-)
17
18diff --git a/configure.ac b/configure.ac
19index d8dcc0c..ca51766 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -267,8 +267,8 @@ if test "$have_libassuan" = "yes"; then
23 [version of the libassuan library])
24 fi
25
26-COMMON_CFLAGS="$LIBASSUAN_CFLAGS $COMMON_CFLAGS"
27-COMMON_LIBS="$LIBASSUAN_LIBS $COMMON_LIBS"
28+COMMON_CFLAGS="$LIBASSUAN_COMMON_CFLAGS $COMMON_CFLAGS"
29+COMMON_LIBS="$LIBASSUAN_COMMON_LIBS $COMMON_LIBS"
30
31
32 dnl Checks for libsecmem.
33diff --git a/m4/libassuan.m4 b/m4/libassuan.m4
34index df50484..2057412 100644
35--- a/m4/libassuan.m4
36+++ b/m4/libassuan.m4
37@@ -15,30 +15,8 @@ dnl
Brad Bishopd7bf8c12018-02-25 22:55:05 -050038 dnl Common code used for libassuan detection [internal]
39 dnl Returns ok set to yes or no.
40 dnl
41-AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
42-[ AC_REQUIRE([AC_CANONICAL_HOST])
43- AC_ARG_WITH(libassuan-prefix,
Andrew Geissler90fd73c2021-03-05 15:25:55 -060044- AS_HELP_STRING([--with-libassuan-prefix=PFX],
Brad Bishopd7bf8c12018-02-25 22:55:05 -050045- [prefix where LIBASSUAN is installed (optional)]),
46- libassuan_config_prefix="$withval", libassuan_config_prefix="")
47- if test x$libassuan_config_prefix != x ; then
Brad Bishopd7bf8c12018-02-25 22:55:05 -050048- if test x${LIBASSUAN_CONFIG+set} != xset ; then
49- LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
50- fi
Brad Bishopd7bf8c12018-02-25 22:55:05 -050051- fi
52-
Andrew Geissler90fd73c2021-03-05 15:25:55 -060053- use_gpgrt_config=""
54- if test x"${LIBASSUAN_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
55- if $GPGRT_CONFIG libassuan --exists; then
56- LIBASSUAN_CONFIG="$GPGRT_CONFIG libassuan"
57- AC_MSG_NOTICE([Use gpgrt-config as libassuan-config])
58- use_gpgrt_config=yes
59- fi
60- fi
61- if test -z "$use_gpgrt_config"; then
62- AC_PATH_PROG(LIBASSUAN_CONFIG, libassuan-config, no)
63- fi
Brad Bishopd7bf8c12018-02-25 22:55:05 -050064-
65+AC_DEFUN([AM_PATH_LIBASSUAN_COMMON],
66+[
67 tmp=ifelse([$1], ,1:0.9.2,$1)
68 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
69 req_libassuan_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
Andrew Geissler90fd73c2021-03-05 15:25:55 -060070@@ -48,58 +26,11 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
Brad Bishopd7bf8c12018-02-25 22:55:05 -050071 min_libassuan_version="$tmp"
72 fi
73
74- AC_MSG_CHECKING(for LIBASSUAN - version >= $min_libassuan_version)
75- ok=no
Andrew Geissler90fd73c2021-03-05 15:25:55 -060076- if test "$LIBASSUAN_CONFIG" != "no"; then
Brad Bishopd7bf8c12018-02-25 22:55:05 -050077- req_major=`echo $min_libassuan_version | \
78- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
79- req_minor=`echo $min_libassuan_version | \
80- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
81- req_micro=`echo $min_libassuan_version | \
82- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
83-
Andrew Geissler90fd73c2021-03-05 15:25:55 -060084- if test -z "$use_gpgrt_config"; then
85- libassuan_config_version=`$LIBASSUAN_CONFIG --version`
86- else
87- libassuan_config_version=`$LIBASSUAN_CONFIG --modversion`
88- fi
Brad Bishopd7bf8c12018-02-25 22:55:05 -050089- major=`echo $libassuan_config_version | \
90- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
91- minor=`echo $libassuan_config_version | \
92- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
93- micro=`echo $libassuan_config_version | \
94- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
95-
96- if test "$major" -gt "$req_major"; then
97- ok=yes
98- else
99- if test "$major" -eq "$req_major"; then
100- if test "$minor" -gt "$req_minor"; then
101- ok=yes
102- else
103- if test "$minor" -eq "$req_minor"; then
104- if test "$micro" -ge "$req_micro"; then
105- ok=yes
106- fi
107- fi
108- fi
109- fi
110- fi
111- fi
112-
113- if test $ok = yes; then
114- AC_MSG_RESULT([yes ($libassuan_config_version)])
115- else
116- AC_MSG_RESULT(no)
117- fi
118+ PKG_CHECK_MODULES(LIBASSUAN_COMMON, [libassuan >= $min_libassuan_version libassuan], [ok=yes], [ok=no])
119
120 if test $ok = yes; then
121 if test "$req_libassuan_api" -gt 0 ; then
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600122- if test -z "$use_gpgrt_config"; then
123- tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
124- else
125- tmp=`$LIBASSUAN_CONFIG --variable=api_version 2>/dev/null || echo 0`
126- fi
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500127+ tmp=`$PKG_CONFIG --variable=api_version libassuan 2>/dev/null || echo 0`
128 if test "$tmp" -gt 0 ; then
129 AC_MSG_CHECKING([LIBASSUAN API version])
130 if test "$req_libassuan_api" -eq "$tmp" ; then
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600131@@ -114,11 +45,7 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500132
133 if test $ok = yes; then
134 if test x"$host" != x ; then
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600135- if test -z "$use_gpgrt_config"; then
136- libassuan_config_host=`$LIBASSUAN_CONFIG --host 2>/dev/null || echo none`
137- else
138- libassuan_config_host=`$LIBASSUAN_CONFIG --variable=host 2>/dev/null || echo none`
139- fi
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500140+ libassuan_config_host=`$PKG_CONFIG --host libassuan 2>/dev/null || echo 0`
141 if test x"$libassuan_config_host" != xnone ; then
142 if test x"$libassuan_config_host" != x"$host" ; then
143 AC_MSG_WARN([[
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600144@@ -141,7 +68,7 @@ dnl Test whether libassuan has at least MINIMUM-VERSION. This is
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500145 dnl used to test for features only available in newer versions.
146 dnl
147 AC_DEFUN([AM_CHECK_LIBASSUAN],
148-[ _AM_PATH_LIBASSUAN_COMMON($1)
149+[ AM_PATH_LIBASSUAN_COMMON($1)
150 if test $ok = yes; then
151 ifelse([$2], , :, [$2])
152 else
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600153@@ -157,16 +84,10 @@ dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500154 dnl Test for libassuan and define LIBASSUAN_CFLAGS and LIBASSUAN_LIBS
155 dnl
156 AC_DEFUN([AM_PATH_LIBASSUAN],
157-[ _AM_PATH_LIBASSUAN_COMMON($1)
158+[ AM_PATH_LIBASSUAN_COMMON($1)
159 if test $ok = yes; then
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600160- LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG --cflags`
161- LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG --libs`
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500162 ifelse([$2], , :, [$2])
163 else
164- LIBASSUAN_CFLAGS=""
165- LIBASSUAN_LIBS=""
166 ifelse([$3], , :, [$3])
167 fi
168- AC_SUBST(LIBASSUAN_CFLAGS)
169- AC_SUBST(LIBASSUAN_LIBS)
170 ])