Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 1 | From e36cbf9d7a32de9945a8b6c62ad29dfb60358081 Mon Sep 17 00:00:00 2001 |
| 2 | From: "Anu Deepthika, Nandipati" <Nandipati.AnuDeepthika@philips.com> |
| 3 | Date: Wed, 9 Mar 2022 02:03:51 +0530 |
| 4 | Subject: [PATCH] Add and use pkgconfig instead of libgcrypt-config |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Signed-off-by: Anu Deepthika, Nandipati <Nandipati.AnuDeepthika@philips.com> |
| 9 | --- |
| 10 | m4/libgcrypt.m4 | 56 ++----------------------------------------------- |
| 11 | 1 file changed, 2 insertions(+), 54 deletions(-) |
| 12 | |
| 13 | diff --git a/m4/libgcrypt.m4 b/m4/libgcrypt.m4 |
| 14 | index 9a29eb5..465fe24 100644 |
| 15 | --- a/m4/libgcrypt.m4 |
| 16 | +++ b/m4/libgcrypt.m4 |
| 17 | @@ -22,17 +22,7 @@ dnl with a changed API. |
| 18 | dnl |
| 19 | AC_DEFUN([AM_PATH_LIBGCRYPT], |
| 20 | [ AC_REQUIRE([AC_CANONICAL_HOST]) |
| 21 | - AC_ARG_WITH(libgcrypt-prefix, |
| 22 | - AS_HELP_STRING([--with-libgcrypt-prefix=PFX], |
| 23 | - [prefix where LIBGCRYPT is installed (optional)]), |
| 24 | - libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") |
| 25 | - if test x$libgcrypt_config_prefix != x ; then |
| 26 | - if test x${LIBGCRYPT_CONFIG+set} != xset ; then |
| 27 | - LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config |
| 28 | - fi |
| 29 | - fi |
| 30 | |
| 31 | - AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) |
| 32 | tmp=ifelse([$1], ,1:1.2.0,$1) |
| 33 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then |
| 34 | req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` |
| 35 | @@ -41,44 +31,8 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], |
| 36 | req_libgcrypt_api=0 |
| 37 | min_libgcrypt_version="$tmp" |
| 38 | fi |
| 39 | + PKG_CHECK_MODULES(LIBGCRYPT, [libgcrypt >= $min_libgcrypt_version], [ok=yes], [ok=no]) |
| 40 | |
| 41 | - AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version) |
| 42 | - ok=no |
| 43 | - if test "$LIBGCRYPT_CONFIG" != "no" ; then |
| 44 | - req_major=`echo $min_libgcrypt_version | \ |
| 45 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
| 46 | - req_minor=`echo $min_libgcrypt_version | \ |
| 47 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
| 48 | - req_micro=`echo $min_libgcrypt_version | \ |
| 49 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
| 50 | - libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` |
| 51 | - major=`echo $libgcrypt_config_version | \ |
| 52 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` |
| 53 | - minor=`echo $libgcrypt_config_version | \ |
| 54 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` |
| 55 | - micro=`echo $libgcrypt_config_version | \ |
| 56 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` |
| 57 | - if test "$major" -gt "$req_major"; then |
| 58 | - ok=yes |
| 59 | - else |
| 60 | - if test "$major" -eq "$req_major"; then |
| 61 | - if test "$minor" -gt "$req_minor"; then |
| 62 | - ok=yes |
| 63 | - else |
| 64 | - if test "$minor" -eq "$req_minor"; then |
| 65 | - if test "$micro" -ge "$req_micro"; then |
| 66 | - ok=yes |
| 67 | - fi |
| 68 | - fi |
| 69 | - fi |
| 70 | - fi |
| 71 | - fi |
| 72 | - fi |
| 73 | - if test $ok = yes; then |
| 74 | - AC_MSG_RESULT([yes ($libgcrypt_config_version)]) |
| 75 | - else |
| 76 | - AC_MSG_RESULT(no) |
| 77 | - fi |
| 78 | if test $ok = yes; then |
| 79 | # If we have a recent libgcrypt, we should also check that the |
| 80 | # API is compatible |
| 81 | @@ -96,10 +50,8 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], |
| 82 | fi |
| 83 | fi |
| 84 | if test $ok = yes; then |
| 85 | - LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` |
| 86 | - LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` |
| 87 | ifelse([$2], , :, [$2]) |
| 88 | - libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` |
| 89 | + libgcrypt_config_host=`$PKG_CONFIG --variable=host libgcrypt` |
| 90 | if test x"$libgcrypt_config_host" != xnone ; then |
| 91 | if test x"$libgcrypt_config_host" != x"$host" ; then |
| 92 | AC_MSG_WARN([[ |
| 93 | @@ -112,10 +64,6 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], |
| 94 | ***]]) |
| 95 | fi |
| 96 | fi |
| 97 | - else |
| 98 | - LIBGCRYPT_CFLAGS="" |
| 99 | - LIBGCRYPT_LIBS="" |
| 100 | - ifelse([$3], , :, [$3]) |
| 101 | fi |
| 102 | AC_SUBST(LIBGCRYPT_CFLAGS) |
| 103 | AC_SUBST(LIBGCRYPT_LIBS) |
| 104 | -- |
| 105 | 2.25.1 |
| 106 | |