diff options
| author | Simeon Simeonov | 2018-02-26 11:23:00 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2018-02-26 11:23:00 +0100 |
| commit | 0b3cbf57875fd692e4ba0b336fefa4bee1ed00dc (patch) | |
| tree | af916a30553c78ce9d4f2d8658656a175c5b6921 /ac/missing/gpgme.m4 | |
Initial commit for sylpheed 3.7.0
Diffstat (limited to 'ac/missing/gpgme.m4')
| -rw-r--r-- | ac/missing/gpgme.m4 | 236 |
1 files changed, 236 insertions, 0 deletions
diff --git a/ac/missing/gpgme.m4 b/ac/missing/gpgme.m4 new file mode 100644 index 0000000..1915f55 --- /dev/null +++ b/ac/missing/gpgme.m4 | |||
| @@ -0,0 +1,236 @@ | |||
| 1 | # gpgme.m4 - autoconf macro to detect GPGME. | ||
| 2 | # Copyright (C) 2002, 2003, 2004 g10 Code GmbH | ||
| 3 | # | ||
| 4 | # This file is free software; as a special exception the author gives | ||
| 5 | # unlimited permission to copy and/or distribute it, with or without | ||
| 6 | # modifications, as long as this notice is preserved. | ||
| 7 | # | ||
| 8 | # This file is distributed in the hope that it will be useful, but | ||
| 9 | # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the | ||
| 10 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 11 | |||
| 12 | |||
| 13 | AC_DEFUN([_AM_PATH_GPGME_CONFIG], | ||
| 14 | [ AC_ARG_WITH(gpgme-prefix, | ||
| 15 | AC_HELP_STRING([--with-gpgme-prefix=PFX], | ||
| 16 | [prefix where GPGME is installed (optional)]), | ||
| 17 | gpgme_config_prefix="$withval", gpgme_config_prefix="") | ||
| 18 | if test "x$gpgme_config_prefix" != x ; then | ||
| 19 | GPGME_CONFIG="$gpgme_config_prefix/bin/gpgme-config" | ||
| 20 | fi | ||
| 21 | AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no) | ||
| 22 | |||
| 23 | gpgme_version=`$GPGME_CONFIG --version` | ||
| 24 | gpgme_version_major=`echo $gpgme_version | \ | ||
| 25 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` | ||
| 26 | gpgme_version_minor=`echo $gpgme_version | \ | ||
| 27 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` | ||
| 28 | gpgme_version_micro=`echo $gpgme_version | \ | ||
| 29 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` | ||
| 30 | ]) | ||
| 31 | |||
| 32 | dnl AM_PATH_GPGME([MINIMUM-VERSION, | ||
| 33 | dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) | ||
| 34 | dnl Test for libgpgme and define GPGME_CFLAGS and GPGME_LIBS. | ||
| 35 | dnl | ||
| 36 | AC_DEFUN([AM_PATH_GPGME], | ||
| 37 | [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl | ||
| 38 | tmp=ifelse([$1], ,1:0.4.2,$1) | ||
| 39 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then | ||
| 40 | req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` | ||
| 41 | min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` | ||
| 42 | else | ||
| 43 | req_gpgme_api=0 | ||
| 44 | min_gpgme_version="$tmp" | ||
| 45 | fi | ||
| 46 | |||
| 47 | AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version) | ||
| 48 | ok=no | ||
| 49 | if test "$GPGME_CONFIG" != "no" ; then | ||
| 50 | req_major=`echo $min_gpgme_version | \ | ||
| 51 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` | ||
| 52 | req_minor=`echo $min_gpgme_version | \ | ||
| 53 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | ||
| 54 | req_micro=`echo $min_gpgme_version | \ | ||
| 55 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | ||
| 56 | if test "$gpgme_version_major" -gt "$req_major"; then | ||
| 57 | ok=yes | ||
| 58 | else | ||
| 59 | if test "$gpgme_version_major" -eq "$req_major"; then | ||
| 60 | if test "$gpgme_version_minor" -gt "$req_minor"; then | ||
| 61 | ok=yes | ||
| 62 | else | ||
| 63 | if test "$gpgme_version_minor" -eq "$req_minor"; then | ||
| 64 | if test "$gpgme_version_micro" -ge "$req_micro"; then | ||
| 65 | ok=yes | ||
| 66 | fi | ||
| 67 | fi | ||
| 68 | fi | ||
| 69 | fi | ||
| 70 | fi | ||
| 71 | fi | ||
| 72 | if test $ok = yes; then | ||
| 73 | # If we have a recent GPGME, we should also check that the | ||
| 74 | # API is compatible. | ||
| 75 | if test "$req_gpgme_api" -gt 0 ; then | ||
| 76 | tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` | ||
| 77 | if test "$tmp" -gt 0 ; then | ||
| 78 | if test "$req_gpgme_api" -ne "$tmp" ; then | ||
| 79 | ok=no | ||
| 80 | fi | ||
| 81 | fi | ||
| 82 | fi | ||
| 83 | fi | ||
| 84 | if test $ok = yes; then | ||
| 85 | GPGME_CFLAGS=`$GPGME_CONFIG --cflags` | ||
| 86 | GPGME_LIBS=`$GPGME_CONFIG --libs` | ||
| 87 | AC_MSG_RESULT(yes) | ||
| 88 | ifelse([$2], , :, [$2]) | ||
| 89 | else | ||
| 90 | GPGME_CFLAGS="" | ||
| 91 | GPGME_LIBS="" | ||
| 92 | AC_MSG_RESULT(no) | ||
| 93 | ifelse([$3], , :, [$3]) | ||
| 94 | fi | ||
| 95 | AC_SUBST(GPGME_CFLAGS) | ||
| 96 | AC_SUBST(GPGME_LIBS) | ||
| 97 | ]) | ||
| 98 | |||
| 99 | dnl AM_PATH_GPGME_PTH([MINIMUM-VERSION, | ||
| 100 | dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) | ||
| 101 | dnl Test for libgpgme and define GPGME_PTH_CFLAGS and GPGME_PTH_LIBS. | ||
| 102 | dnl | ||
| 103 | AC_DEFUN([AM_PATH_GPGME_PTH], | ||
| 104 | [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl | ||
| 105 | tmp=ifelse([$1], ,1:0.4.2,$1) | ||
| 106 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then | ||
| 107 | req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` | ||
| 108 | min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` | ||
| 109 | else | ||
| 110 | req_gpgme_api=0 | ||
| 111 | min_gpgme_version="$tmp" | ||
| 112 | fi | ||
| 113 | |||
| 114 | AC_MSG_CHECKING(for GPGME Pth - version >= $min_gpgme_version) | ||
| 115 | ok=no | ||
| 116 | if test "$GPGME_CONFIG" != "no" ; then | ||
| 117 | if `$GPGME_CONFIG --thread=pth 2> /dev/null` ; then | ||
| 118 | req_major=`echo $min_gpgme_version | \ | ||
| 119 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` | ||
| 120 | req_minor=`echo $min_gpgme_version | \ | ||
| 121 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | ||
| 122 | req_micro=`echo $min_gpgme_version | \ | ||
| 123 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | ||
| 124 | if test "$gpgme_version_major" -gt "$req_major"; then | ||
| 125 | ok=yes | ||
| 126 | else | ||
| 127 | if test "$gpgme_version_major" -eq "$req_major"; then | ||
| 128 | if test "$gpgme_version_minor" -gt "$req_minor"; then | ||
| 129 | ok=yes | ||
| 130 | else | ||
| 131 | if test "$gpgme_version_minor" -eq "$req_minor"; then | ||
| 132 | if test "$gpgme_version_micro" -ge "$req_micro"; then | ||
| 133 | ok=yes | ||
| 134 | fi | ||
| 135 | fi | ||
| 136 | fi | ||
| 137 | fi | ||
| 138 | fi | ||
| 139 | fi | ||
| 140 | fi | ||
| 141 | if test $ok = yes; then | ||
| 142 | # If we have a recent GPGME, we should also check that the | ||
| 143 | # API is compatible. | ||
| 144 | if test "$req_gpgme_api" -gt 0 ; then | ||
| 145 | tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` | ||
| 146 | if test "$tmp" -gt 0 ; then | ||
| 147 | if test "$req_gpgme_api" -ne "$tmp" ; then | ||
| 148 | ok=no | ||
| 149 | fi | ||
| 150 | fi | ||
| 151 | fi | ||
| 152 | fi | ||
| 153 | if test $ok = yes; then | ||
| 154 | GPGME_PTH_CFLAGS=`$GPGME_CONFIG --thread=pth --cflags` | ||
| 155 | GPGME_PTH_LIBS=`$GPGME_CONFIG --thread=pth --libs` | ||
| 156 | AC_MSG_RESULT(yes) | ||
| 157 | ifelse([$2], , :, [$2]) | ||
| 158 | else | ||
| 159 | GPGME_PTH_CFLAGS="" | ||
| 160 | GPGME_PTH_LIBS="" | ||
| 161 | AC_MSG_RESULT(no) | ||
| 162 | ifelse([$3], , :, [$3]) | ||
| 163 | fi | ||
| 164 | AC_SUBST(GPGME_PTH_CFLAGS) | ||
| 165 | AC_SUBST(GPGME_PTH_LIBS) | ||
| 166 | ]) | ||
| 167 | |||
| 168 | dnl AM_PATH_GPGME_PTHREAD([MINIMUM-VERSION, | ||
| 169 | dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) | ||
| 170 | dnl Test for libgpgme and define GPGME_PTHREAD_CFLAGS | ||
| 171 | dnl and GPGME_PTHREAD_LIBS. | ||
| 172 | dnl | ||
| 173 | AC_DEFUN([AM_PATH_GPGME_PTHREAD], | ||
| 174 | [ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl | ||
| 175 | tmp=ifelse([$1], ,1:0.4.2,$1) | ||
| 176 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then | ||
| 177 | req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` | ||
| 178 | min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` | ||
| 179 | else | ||
| 180 | req_gpgme_api=0 | ||
| 181 | min_gpgme_version="$tmp" | ||
| 182 | fi | ||
| 183 | |||
| 184 | AC_MSG_CHECKING(for GPGME pthread - version >= $min_gpgme_version) | ||
| 185 | ok=no | ||
| 186 | if test "$GPGME_CONFIG" != "no" ; then | ||
| 187 | if `$GPGME_CONFIG --thread=pthread 2> /dev/null` ; then | ||
| 188 | req_major=`echo $min_gpgme_version | \ | ||
| 189 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` | ||
| 190 | req_minor=`echo $min_gpgme_version | \ | ||
| 191 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | ||
| 192 | req_micro=`echo $min_gpgme_version | \ | ||
| 193 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | ||
| 194 | if test "$gpgme_version_major" -gt "$req_major"; then | ||
| 195 | ok=yes | ||
| 196 | else | ||
| 197 | if test "$gpgme_version_major" -eq "$req_major"; then | ||
| 198 | if test "$gpgme_version_minor" -gt "$req_minor"; then | ||
| 199 | ok=yes | ||
| 200 | else | ||
| 201 | if test "$gpgme_version_minor" -eq "$req_minor"; then | ||
| 202 | if test "$gpgme_version_micro" -ge "$req_micro"; then | ||
| 203 | ok=yes | ||
| 204 | fi | ||
| 205 | fi | ||
| 206 | fi | ||
| 207 | fi | ||
| 208 | fi | ||
| 209 | fi | ||
| 210 | fi | ||
| 211 | if test $ok = yes; then | ||
| 212 | # If we have a recent GPGME, we should also check that the | ||
| 213 | # API is compatible. | ||
| 214 | if test "$req_gpgme_api" -gt 0 ; then | ||
| 215 | tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` | ||
| 216 | if test "$tmp" -gt 0 ; then | ||
| 217 | if test "$req_gpgme_api" -ne "$tmp" ; then | ||
| 218 | ok=no | ||
| 219 | fi | ||
| 220 | fi | ||
| 221 | fi | ||
| 222 | fi | ||
| 223 | if test $ok = yes; then | ||
| 224 | GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --thread=pthread --cflags` | ||
| 225 | GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --thread=pthread --libs` | ||
| 226 | AC_MSG_RESULT(yes) | ||
| 227 | ifelse([$2], , :, [$2]) | ||
| 228 | else | ||
| 229 | GPGME_PTHREAD_CFLAGS="" | ||
| 230 | GPGME_PTHREAD_LIBS="" | ||
| 231 | AC_MSG_RESULT(no) | ||
| 232 | ifelse([$3], , :, [$3]) | ||
| 233 | fi | ||
| 234 | AC_SUBST(GPGME_PTHREAD_CFLAGS) | ||
| 235 | AC_SUBST(GPGME_PTHREAD_LIBS) | ||
| 236 | ]) | ||
