~ubuntu-branches/ubuntu/dapper/gnupg2/dapper

« back to all changes in this revision

Viewing changes to m4/libassuan.m4

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Mueller
  • Date: 2005-03-29 10:30:32 UTC
  • Revision ID: james.westby@ubuntu.com-20050329103032-sj42n2ain3ipx310
Tags: upstream-1.9.15
ImportĀ upstreamĀ versionĀ 1.9.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Autoconf macros for libassuan
 
2
dnl       Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 
3
dnl
 
4
dnl This file is free software; as a special exception the author gives
 
5
dnl unlimited permission to copy and/or distribute it, with or without
 
6
dnl modifications, as long as this notice is preserved.
 
7
dnl
 
8
dnl This file is distributed in the hope that it will be useful, but
 
9
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 
10
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
11
 
 
12
 
 
13
dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION,
 
14
dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
 
15
dnl Test for libassuan and define LIBASSUAN_CFLAGS and LIBASSUAN_LIBS
 
16
dnl
 
17
AC_DEFUN([AM_PATH_LIBASSUAN],
 
18
[ AC_ARG_WITH(libassuan-prefix,
 
19
            AC_HELP_STRING([--with-libassuan-prefix=PFX],
 
20
                           [prefix where LIBASSUAN is installed (optional)]),
 
21
     libassuan_config_prefix="$withval", libassuan_config_prefix="")
 
22
  if test x$libassuan_config_prefix != x ; then
 
23
     libassuan_config_args="$libassuan_config_args --prefix=$libassuan_config_prefix"
 
24
     if test x${LIBASSUAN_CONFIG+set} != xset ; then
 
25
        LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
 
26
     fi
 
27
  fi
 
28
 
 
29
  AC_PATH_PROG(LIBASSUAN_CONFIG, libassuan-config, no)
 
30
  min_libassuan_version=ifelse([$1], ,0.0.1,$1)
 
31
  AC_MSG_CHECKING(for LIBASSUAN - version >= $min_libassuan_version)
 
32
  ok=no
 
33
  if test "$LIBASSUAN_CONFIG" != "no" ; then
 
34
    req_major=`echo $min_libassuan_version | \
 
35
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
 
36
    req_minor=`echo $min_libassuan_version | \
 
37
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
 
38
    req_micro=`echo $min_libassuan_version | \
 
39
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
 
40
    libassuan_config_version=`$LIBASSUAN_CONFIG $libassuan_config_args --version`
 
41
    major=`echo $libassuan_config_version | \
 
42
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
 
43
    minor=`echo $libassuan_config_version | \
 
44
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
 
45
    micro=`echo $libassuan_config_version | \
 
46
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
 
47
    if test "$major" -gt "$req_major"; then
 
48
        ok=yes
 
49
    else 
 
50
        if test "$major" -eq "$req_major"; then
 
51
            if test "$minor" -gt "$req_minor"; then
 
52
               ok=yes
 
53
            else
 
54
               if test "$minor" -eq "$req_minor"; then
 
55
                   if test "$micro" -ge "$req_micro"; then
 
56
                     ok=yes
 
57
                   fi
 
58
               fi
 
59
            fi
 
60
        fi
 
61
    fi
 
62
  fi
 
63
  if test $ok = yes; then
 
64
    LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG $libassuan_config_args --cflags`
 
65
    LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --libs`
 
66
    AC_MSG_RESULT(yes)
 
67
    ifelse([$2], , :, [$2])
 
68
  else
 
69
    LIBASSUAN_CFLAGS=""
 
70
    LIBASSUAN_LIBS=""
 
71
    AC_MSG_RESULT(no)
 
72
    ifelse([$3], , :, [$3])
 
73
  fi
 
74
  AC_SUBST(LIBASSUAN_CFLAGS)
 
75
  AC_SUBST(LIBASSUAN_LIBS)
 
76
])