Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Add pkgconfig support to libassuan. |
| 2 | This patch is rejected by upstream for the reason below: |
| 3 | They think pkgconfig adds no portability and maintaining them is not worthwhile. |
| 4 | |
| 5 | Upstream-Status: Denied |
| 6 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| 7 | Signed-off-by: Constantin Musca <constantinx.musca@intel.com> |
| 8 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 9 | forward ported to 2.4.4 |
| 10 | Signed-off-by: Armin Kuster <akuster@mvista.com> |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 11 | --- |
| 12 | src/libassuan.m4 | 81 ++---------------------------------------------- |
| 13 | 1 file changed, 3 insertions(+), 78 deletions(-) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 14 | |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 15 | diff --git a/src/libassuan.m4 b/src/libassuan.m4 |
| 16 | index df50484..380a48a 100644 |
| 17 | --- a/src/libassuan.m4 |
| 18 | +++ b/src/libassuan.m4 |
| 19 | @@ -17,27 +17,6 @@ dnl Returns ok set to yes or no. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 20 | dnl |
| 21 | AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON], |
| 22 | [ AC_REQUIRE([AC_CANONICAL_HOST]) |
| 23 | - AC_ARG_WITH(libassuan-prefix, |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 24 | - AS_HELP_STRING([--with-libassuan-prefix=PFX], |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | - [prefix where LIBASSUAN is installed (optional)]), |
| 26 | - libassuan_config_prefix="$withval", libassuan_config_prefix="") |
| 27 | - if test x$libassuan_config_prefix != x ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | - if test x${LIBASSUAN_CONFIG+set} != xset ; then |
| 29 | - LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config |
| 30 | - fi |
| 31 | - fi |
| 32 | - |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 33 | - use_gpgrt_config="" |
| 34 | - if test x"${LIBASSUAN_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then |
| 35 | - if $GPGRT_CONFIG libassuan --exists; then |
| 36 | - LIBASSUAN_CONFIG="$GPGRT_CONFIG libassuan" |
| 37 | - AC_MSG_NOTICE([Use gpgrt-config as libassuan-config]) |
| 38 | - use_gpgrt_config=yes |
| 39 | - fi |
| 40 | - fi |
| 41 | - if test -z "$use_gpgrt_config"; then |
| 42 | - AC_PATH_PROG(LIBASSUAN_CONFIG, libassuan-config, no) |
| 43 | - fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | |
| 45 | tmp=ifelse([$1], ,1:0.9.2,$1) |
| 46 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 47 | @@ -47,59 +26,11 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON], |
| 48 | req_libassuan_api=0 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | min_libassuan_version="$tmp" |
| 50 | fi |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 51 | - |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | - AC_MSG_CHECKING(for LIBASSUAN - version >= $min_libassuan_version) |
| 53 | - ok=no |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 54 | - if test "$LIBASSUAN_CONFIG" != "no"; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | - req_major=`echo $min_libassuan_version | \ |
| 56 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
| 57 | - req_minor=`echo $min_libassuan_version | \ |
| 58 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
| 59 | - req_micro=`echo $min_libassuan_version | \ |
| 60 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
| 61 | - |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 62 | - if test -z "$use_gpgrt_config"; then |
| 63 | - libassuan_config_version=`$LIBASSUAN_CONFIG --version` |
| 64 | - else |
| 65 | - libassuan_config_version=`$LIBASSUAN_CONFIG --modversion` |
| 66 | - fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 67 | - major=`echo $libassuan_config_version | \ |
| 68 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` |
| 69 | - minor=`echo $libassuan_config_version | \ |
| 70 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` |
| 71 | - micro=`echo $libassuan_config_version | \ |
| 72 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` |
| 73 | - |
| 74 | - if test "$major" -gt "$req_major"; then |
| 75 | - ok=yes |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 76 | - else |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | - if test "$major" -eq "$req_major"; then |
| 78 | - if test "$minor" -gt "$req_minor"; then |
| 79 | - ok=yes |
| 80 | - else |
| 81 | - if test "$minor" -eq "$req_minor"; then |
| 82 | - if test "$micro" -ge "$req_micro"; then |
| 83 | - ok=yes |
| 84 | - fi |
| 85 | - fi |
| 86 | - fi |
| 87 | - fi |
| 88 | - fi |
| 89 | - fi |
| 90 | - |
| 91 | - if test $ok = yes; then |
| 92 | - AC_MSG_RESULT([yes ($libassuan_config_version)]) |
| 93 | - else |
| 94 | - AC_MSG_RESULT(no) |
| 95 | - fi |
| 96 | + PKG_CHECK_MODULES(LIBASSUAN, [libassuan >= $min_libassuan_version], [ok=yes], [ok=no]) |
| 97 | |
| 98 | if test $ok = yes; then |
| 99 | if test "$req_libassuan_api" -gt 0 ; then |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 100 | - if test -z "$use_gpgrt_config"; then |
| 101 | - tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0` |
| 102 | - else |
| 103 | - tmp=`$LIBASSUAN_CONFIG --variable=api_version 2>/dev/null || echo 0` |
| 104 | - fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | + tmp=`$PKG_CONFIG --variable=api_version libassuan` |
| 106 | if test "$tmp" -gt 0 ; then |
| 107 | AC_MSG_CHECKING([LIBASSUAN API version]) |
| 108 | if test "$req_libassuan_api" -eq "$tmp" ; then |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 109 | @@ -115,9 +46,7 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON], |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 110 | if test $ok = yes; then |
| 111 | if test x"$host" != x ; then |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 112 | if test -z "$use_gpgrt_config"; then |
| 113 | - libassuan_config_host=`$LIBASSUAN_CONFIG --host 2>/dev/null || echo none` |
| 114 | - else |
| 115 | - libassuan_config_host=`$LIBASSUAN_CONFIG --variable=host 2>/dev/null || echo none` |
| 116 | + libassuan_config_host=`$PKG_CONFIG --variable=host libassuan` |
| 117 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 118 | if test x"$libassuan_config_host" != xnone ; then |
| 119 | if test x"$libassuan_config_host" != x"$host" ; then |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 120 | @@ -159,12 +88,8 @@ dnl |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 121 | AC_DEFUN([AM_PATH_LIBASSUAN], |
| 122 | [ _AM_PATH_LIBASSUAN_COMMON($1) |
| 123 | if test $ok = yes; then |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 124 | - LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG --cflags` |
| 125 | - LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG --libs` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 126 | ifelse([$2], , :, [$2]) |
| 127 | else |
| 128 | - LIBASSUAN_CFLAGS="" |
| 129 | - LIBASSUAN_LIBS="" |
| 130 | ifelse([$3], , :, [$3]) |
| 131 | fi |
| 132 | AC_SUBST(LIBASSUAN_CFLAGS) |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 133 | -- |
| 134 | 2.25.1 |
| 135 | |