Starting project 'GnuPG Made Easy'
This commit is contained in:
parent
a300f43aab
commit
77fa0ec399
182
INSTALL
Normal file
182
INSTALL
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
Basic Installation
|
||||||
|
==================
|
||||||
|
|
||||||
|
These are generic installation instructions.
|
||||||
|
|
||||||
|
The `configure' shell script attempts to guess correct values for
|
||||||
|
various system-dependent variables used during compilation. It uses
|
||||||
|
those values to create a `Makefile' in each directory of the package.
|
||||||
|
It may also create one or more `.h' files containing system-dependent
|
||||||
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
|
you can run in the future to recreate the current configuration, a file
|
||||||
|
`config.cache' that saves the results of its tests to speed up
|
||||||
|
reconfiguring, and a file `config.log' containing compiler output
|
||||||
|
(useful mainly for debugging `configure').
|
||||||
|
|
||||||
|
If you need to do unusual things to compile the package, please try
|
||||||
|
to figure out how `configure' could check whether to do them, and mail
|
||||||
|
diffs or instructions to the address given in the `README' so they can
|
||||||
|
be considered for the next release. If at some point `config.cache'
|
||||||
|
contains results you don't want to keep, you may remove or edit it.
|
||||||
|
|
||||||
|
The file `configure.in' is used to create `configure' by a program
|
||||||
|
called `autoconf'. You only need `configure.in' if you want to change
|
||||||
|
it or regenerate `configure' using a newer version of `autoconf'.
|
||||||
|
|
||||||
|
The simplest way to compile this package is:
|
||||||
|
|
||||||
|
1. `cd' to the directory containing the package's source code and type
|
||||||
|
`./configure' to configure the package for your system. If you're
|
||||||
|
using `csh' on an old version of System V, you might need to type
|
||||||
|
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||||
|
`configure' itself.
|
||||||
|
|
||||||
|
Running `configure' takes awhile. While running, it prints some
|
||||||
|
messages telling which features it is checking for.
|
||||||
|
|
||||||
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
|
3. Optionally, type `make check' to run any self-tests that come with
|
||||||
|
the package.
|
||||||
|
|
||||||
|
4. Type `make install' to install the programs and any data files and
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
5. You can remove the program binaries and object files from the
|
||||||
|
source code directory by typing `make clean'. To also remove the
|
||||||
|
files that `configure' created (so you can compile the package for
|
||||||
|
a different kind of computer), type `make distclean'. There is
|
||||||
|
also a `make maintainer-clean' target, but that is intended mainly
|
||||||
|
for the package's developers. If you use it, you may have to get
|
||||||
|
all sorts of other programs in order to regenerate files that came
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
Compilers and Options
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Some systems require unusual options for compilation or linking that
|
||||||
|
the `configure' script does not know about. You can give `configure'
|
||||||
|
initial values for variables by setting them in the environment. Using
|
||||||
|
a Bourne-compatible shell, you can do that on the command line like
|
||||||
|
this:
|
||||||
|
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||||
|
|
||||||
|
Or on systems that have the `env' program, you can do it like this:
|
||||||
|
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||||
|
|
||||||
|
Compiling For Multiple Architectures
|
||||||
|
====================================
|
||||||
|
|
||||||
|
You can compile the package for more than one kind of computer at the
|
||||||
|
same time, by placing the object files for each architecture in their
|
||||||
|
own directory. To do this, you must use a version of `make' that
|
||||||
|
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||||
|
directory where you want the object files and executables to go and run
|
||||||
|
the `configure' script. `configure' automatically checks for the
|
||||||
|
source code in the directory that `configure' is in and in `..'.
|
||||||
|
|
||||||
|
If you have to use a `make' that does not supports the `VPATH'
|
||||||
|
variable, you have to compile the package for one architecture at a time
|
||||||
|
in the source code directory. After you have installed the package for
|
||||||
|
one architecture, use `make distclean' before reconfiguring for another
|
||||||
|
architecture.
|
||||||
|
|
||||||
|
Installation Names
|
||||||
|
==================
|
||||||
|
|
||||||
|
By default, `make install' will install the package's files in
|
||||||
|
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||||
|
installation prefix other than `/usr/local' by giving `configure' the
|
||||||
|
option `--prefix=PATH'.
|
||||||
|
|
||||||
|
You can specify separate installation prefixes for
|
||||||
|
architecture-specific files and architecture-independent files. If you
|
||||||
|
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||||
|
PATH as the prefix for installing programs and libraries.
|
||||||
|
Documentation and other data files will still use the regular prefix.
|
||||||
|
|
||||||
|
In addition, if you use an unusual directory layout you can give
|
||||||
|
options like `--bindir=PATH' to specify different values for particular
|
||||||
|
kinds of files. Run `configure --help' for a list of the directories
|
||||||
|
you can set and what kinds of files go in them.
|
||||||
|
|
||||||
|
If the package supports it, you can cause programs to be installed
|
||||||
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
|
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||||
|
|
||||||
|
Optional Features
|
||||||
|
=================
|
||||||
|
|
||||||
|
Some packages pay attention to `--enable-FEATURE' options to
|
||||||
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
|
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||||
|
is something like `gnu-as' or `x' (for the X Window System). The
|
||||||
|
`README' should mention any `--enable-' and `--with-' options that the
|
||||||
|
package recognizes.
|
||||||
|
|
||||||
|
For packages that use the X Window System, `configure' can usually
|
||||||
|
find the X include and library files automatically, but if it doesn't,
|
||||||
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
|
`--x-libraries=DIR' to specify their locations.
|
||||||
|
|
||||||
|
Specifying the System Type
|
||||||
|
==========================
|
||||||
|
|
||||||
|
There may be some features `configure' can not figure out
|
||||||
|
automatically, but needs to determine by the type of host the package
|
||||||
|
will run on. Usually `configure' can figure that out, but if it prints
|
||||||
|
a message saying it can not guess the host type, give it the
|
||||||
|
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||||
|
type, such as `sun4', or a canonical name with three fields:
|
||||||
|
CPU-COMPANY-SYSTEM
|
||||||
|
|
||||||
|
See the file `config.sub' for the possible values of each field. If
|
||||||
|
`config.sub' isn't included in this package, then this package doesn't
|
||||||
|
need to know the host type.
|
||||||
|
|
||||||
|
If you are building compiler tools for cross-compiling, you can also
|
||||||
|
use the `--target=TYPE' option to select the type of system they will
|
||||||
|
produce code for and the `--build=TYPE' option to select the type of
|
||||||
|
system on which you are compiling the package.
|
||||||
|
|
||||||
|
Sharing Defaults
|
||||||
|
================
|
||||||
|
|
||||||
|
If you want to set default values for `configure' scripts to share,
|
||||||
|
you can create a site shell script called `config.site' that gives
|
||||||
|
default values for variables like `CC', `cache_file', and `prefix'.
|
||||||
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||||
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||||
|
`CONFIG_SITE' environment variable to the location of the site script.
|
||||||
|
A warning: not all `configure' scripts look for a site script.
|
||||||
|
|
||||||
|
Operation Controls
|
||||||
|
==================
|
||||||
|
|
||||||
|
`configure' recognizes the following options to control how it
|
||||||
|
operates.
|
||||||
|
|
||||||
|
`--cache-file=FILE'
|
||||||
|
Use and save the results of the tests in FILE instead of
|
||||||
|
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||||
|
debugging `configure'.
|
||||||
|
|
||||||
|
`--help'
|
||||||
|
Print a summary of the options to `configure', and exit.
|
||||||
|
|
||||||
|
`--quiet'
|
||||||
|
`--silent'
|
||||||
|
`-q'
|
||||||
|
Do not print messages saying which checks are being made. To
|
||||||
|
suppress all normal output, redirect it to `/dev/null' (any error
|
||||||
|
messages will still be shown).
|
||||||
|
|
||||||
|
`--srcdir=DIR'
|
||||||
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
`configure' can determine that directory automatically.
|
||||||
|
|
||||||
|
`--version'
|
||||||
|
Print the version of Autoconf used to generate the `configure'
|
||||||
|
script, and exit.
|
||||||
|
|
||||||
|
`configure' also accepts some other, not widely useful, options.
|
7
README
Normal file
7
README
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
GPGME - GnuPG Made Easy
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
THIS IS WORK IN PROGRESS !!!
|
||||||
|
|
||||||
|
Contact wk@gnupg.org for questions.
|
||||||
|
|
1
README-alpha
Normal file
1
README-alpha
Normal file
@ -0,0 +1 @@
|
|||||||
|
THIS IS WORK IN PROGRESS !!!!
|
48
acconfig.h
Normal file
48
acconfig.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/* acconfig.h - used by autoheader to make config.h.in
|
||||||
|
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||||
|
*
|
||||||
|
* This file is part of GPGME.
|
||||||
|
*
|
||||||
|
* GPGME is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* GPGME is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
#ifndef GPGME_CONFIG_H
|
||||||
|
#define GPGME_CONFIG_H
|
||||||
|
|
||||||
|
/* need this, because some autoconf tests rely on this (e.g. stpcpy)
|
||||||
|
* and it should be used for new programs
|
||||||
|
*/
|
||||||
|
#define _GNU_SOURCE 1
|
||||||
|
|
||||||
|
@TOP@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#undef HAVE_DRIVE_LETTERS
|
||||||
|
/* defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2)
|
||||||
|
* with special properties like no file modes */
|
||||||
|
#undef HAVE_DOSISH_SYSTEM
|
||||||
|
/* because the Unix gettext has to much overhead on MingW32 systems
|
||||||
|
* and these systems lack Posix functions, we use a simplified version
|
||||||
|
* of gettext */
|
||||||
|
#undef USE_SIMPLE_GETTEXT
|
||||||
|
/* Some systems have mkdir that takes a single argument. */
|
||||||
|
#undef MKDIR_TAKES_ONE_ARG
|
||||||
|
|
||||||
|
|
||||||
|
@BOTTOM@
|
||||||
|
|
||||||
|
/* not yet needed #include "gpgme-defs.h"*/
|
||||||
|
|
||||||
|
#endif /*GPGME_CONFIG_H*/
|
81
configure.in
Normal file
81
configure.in
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
# configure.in for GPGME
|
||||||
|
#
|
||||||
|
dnl (Process this file with autoconf to produce a configure script.)
|
||||||
|
AC_REVISION($Revision$)dnl
|
||||||
|
|
||||||
|
AC_INIT(gpgme/gpgme.h)
|
||||||
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
AM_MAINTAINER_MODE
|
||||||
|
#############################################
|
||||||
|
# Version numbers (Remember to change them just before a release)
|
||||||
|
# 1. No interfaces changed, only implementations (good): Increment REVISION.
|
||||||
|
# 2. Interfaces added, none removed (good): Increment CURRENT, increment
|
||||||
|
# AGE, set REVISION to 0.
|
||||||
|
# 3. Interfaces removed (BAD, breaks upward compatibility): Increment
|
||||||
|
# CURRENT, set AGE and REVISION to 0.
|
||||||
|
AM_INIT_AUTOMAKE(gpgme,0.0)
|
||||||
|
LIBGPGME_LT_CURRENT=0
|
||||||
|
LIBGPGME_LT_AGE=0
|
||||||
|
LIBGPGME_LT_REVISION=0
|
||||||
|
##############################################
|
||||||
|
|
||||||
|
AC_SUBST(LIBGPGME_LT_CURRENT)
|
||||||
|
AC_SUBST(LIBGPGME_LT_AGE)
|
||||||
|
AC_SUBST(LIBGPGME_LT_REVISION)
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks for programs
|
||||||
|
dnl
|
||||||
|
AC_ARG_PROGRAM
|
||||||
|
|
||||||
|
dnl Don't default to build static libs
|
||||||
|
AM_DISABLE_STATIC
|
||||||
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
|
if test "$GCC" = yes; then
|
||||||
|
CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks for libraries
|
||||||
|
dnl
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks for header files
|
||||||
|
dnl
|
||||||
|
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks for typedefs and structures
|
||||||
|
dnl
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks for compiler features
|
||||||
|
dnl
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks for library functions
|
||||||
|
dnl
|
||||||
|
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks for system services
|
||||||
|
dnl
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Create config files
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_OUTPUT_COMMANDS([
|
||||||
|
chmod +x gpgme/gpgme-config
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_OUTPUT([
|
||||||
|
Makefile
|
||||||
|
gpgme/Makefile
|
||||||
|
gpgme/gpgme-config
|
||||||
|
])
|
||||||
|
|
0
gpgme/ChangeLog
Normal file
0
gpgme/ChangeLog
Normal file
19
gpgme/Makefile.am
Normal file
19
gpgme/Makefile.am
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
EXTRA_DIST = gpgme-config.in gpgme.m4
|
||||||
|
bin_SCRIPTS = gpgme-config
|
||||||
|
m4datadir = $(datadir)/aclocal
|
||||||
|
m4data_DATA = gpgme.m4
|
||||||
|
include_HEADERS = gpgme.h
|
||||||
|
lib_LTLIBRARIES = libgpgme.la
|
||||||
|
|
||||||
|
libgpgme_la_LDFLAGS = -version-info \
|
||||||
|
@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
|
||||||
|
libgpgme_la_INCLUDES = -I$(top_srcdir)/lib
|
||||||
|
|
||||||
|
libgpgme_la_SOURCES = \
|
||||||
|
gpgme.h \
|
||||||
|
gpgme.c
|
||||||
|
|
||||||
|
|
||||||
|
|
93
gpgme/gpgme-config.in
Normal file
93
gpgme/gpgme-config.in
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
exec_prefix_set=no
|
||||||
|
|
||||||
|
gpgme_libs="@GPGME_LIBS@"
|
||||||
|
gpgme_cflags="@GPGME_CFLAGS@"
|
||||||
|
|
||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
cat <<EOF
|
||||||
|
Usage: gpgme-config [OPTIONS]
|
||||||
|
Options:
|
||||||
|
[--prefix[=DIR]]
|
||||||
|
[--exec-prefix[=DIR]]
|
||||||
|
[--version]
|
||||||
|
[--libs]
|
||||||
|
[--cflags]
|
||||||
|
EOF
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
usage 1 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
while test $# -gt 0; do
|
||||||
|
case "$1" in
|
||||||
|
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||||
|
*) optarg= ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
--prefix=*)
|
||||||
|
prefix=$optarg
|
||||||
|
if test $exec_prefix_set = no ; then
|
||||||
|
exec_prefix=$optarg
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--prefix)
|
||||||
|
echo_prefix=yes
|
||||||
|
;;
|
||||||
|
--exec-prefix=*)
|
||||||
|
exec_prefix=$optarg
|
||||||
|
exec_prefix_set=yes
|
||||||
|
;;
|
||||||
|
--exec-prefix)
|
||||||
|
echo_exec_prefix=yes
|
||||||
|
;;
|
||||||
|
--version)
|
||||||
|
echo "@VERSION@"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--cflags)
|
||||||
|
echo_cflags=yes
|
||||||
|
;;
|
||||||
|
--libs)
|
||||||
|
echo_libs=yes
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage 1 1>&2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if test "$echo_prefix" = "yes"; then
|
||||||
|
echo $prefix
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$echo_exec_prefix" = "yes"; then
|
||||||
|
echo $exec_prefix
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$echo_cflags" = "yes"; then
|
||||||
|
if test "@includedir@" != "/usr/include" ; then
|
||||||
|
includes="-I@includedir@"
|
||||||
|
for i in $gpgme_cflags ; do
|
||||||
|
if test "$i" = "-I@includedir@" ; then
|
||||||
|
includes=""
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
echo $includes $gpgme_cflags
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$echo_libs" = "yes"; then
|
||||||
|
echo ${gpgme_libs}
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
28
gpgme/gpgme.c
Normal file
28
gpgme/gpgme.c
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/* gpgme.c - GnuPG Made Easy
|
||||||
|
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||||
|
*
|
||||||
|
* This file is part of GPGME.
|
||||||
|
*
|
||||||
|
* GPGME is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* GPGME is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
37
gpgme/gpgme.h
Normal file
37
gpgme/gpgme.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/* gpgme.h - GnuPG Made Easy
|
||||||
|
* Copyright (C) 2000 Werner Koch (dd9jn)
|
||||||
|
*
|
||||||
|
* This file is part of GPGME.
|
||||||
|
*
|
||||||
|
* GPGME is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* GPGME is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GPGME_H
|
||||||
|
#define GPGME_H
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* GPGME_H */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
164
gpgme/gpgme.m4
Normal file
164
gpgme/gpgme.m4
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
dnl Autoconf macros for libgpgme
|
||||||
|
dnl $Id$
|
||||||
|
|
||||||
|
# Configure paths for GPGME
|
||||||
|
# Shamelessly stolen from the one of XDELTA by Owen Taylor
|
||||||
|
# Werner Koch 2000-10-27
|
||||||
|
|
||||||
|
dnl AM_PATH_GPGME([MINIMUM-VERSION,
|
||||||
|
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
|
||||||
|
dnl Test for gpgme, and define GPGME_CFLAGS and GPGME_LIBS
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AM_PATH_GPGME,
|
||||||
|
[dnl
|
||||||
|
dnl Get the cflags and libraries from the gpgme-config script
|
||||||
|
dnl
|
||||||
|
AC_ARG_WITH(gpgme-prefix,
|
||||||
|
[ --with-gpgme-prefix=PFX Prefix where gpgme is installed (optional)],
|
||||||
|
gpgme_config_prefix="$withval", gpgme_config_prefix="")
|
||||||
|
AC_ARG_ENABLE(gpgmetest,
|
||||||
|
[ --disable-gpgmetest Do not try to compile and run a test gpgme program],
|
||||||
|
, enable_gpgmetest=yes)
|
||||||
|
|
||||||
|
if test x$gpgme_config_prefix != x ; then
|
||||||
|
gpgme_config_args="$gpgme_config_args --prefix=$gpgme_config_prefix"
|
||||||
|
if test x${GPGME_CONFIG+set} != xset ; then
|
||||||
|
GPGME_CONFIG=$gpgme_config_prefix/bin/gpgme-config
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
|
||||||
|
min_gpgme_version=ifelse([$1], ,1.1.0,$1)
|
||||||
|
AC_MSG_CHECKING(for gpgme - version >= $min_gpgme_version)
|
||||||
|
no_gpgme=""
|
||||||
|
if test "$GPGME_CONFIG" = "no" ; then
|
||||||
|
no_gpgme=yes
|
||||||
|
else
|
||||||
|
GPGME_CFLAGS=`$GPGME_CONFIG $gpgme_config_args --cflags`
|
||||||
|
GPGME_LIBS=`$GPGME_CONFIG $gpgme_config_args --libs`
|
||||||
|
gpgme_config_version=`$GPGME_CONFIG $gpgme_config_args --version`
|
||||||
|
if test "x$enable_gpgmetest" = "xyes" ; then
|
||||||
|
ac_save_CFLAGS="$CFLAGS"
|
||||||
|
ac_save_LIBS="$LIBS"
|
||||||
|
CFLAGS="$CFLAGS $GPGME_CFLAGS"
|
||||||
|
LIBS="$LIBS $GPGME_LIBS"
|
||||||
|
dnl
|
||||||
|
dnl Now check if the installed gpgme is sufficiently new. Also sanity
|
||||||
|
dnl checks the results of gpgme-config to some extent
|
||||||
|
dnl
|
||||||
|
rm -f conf.gpgmetest
|
||||||
|
AC_TRY_RUN([
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <gpgme.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
system ("touch conf.gpgmetest");
|
||||||
|
|
||||||
|
if( strcmp( gcry_check_version(NULL), "$gpgme_config_version" ) )
|
||||||
|
{
|
||||||
|
printf("\n*** 'gpgme-config --version' returned %s, but GPGME (%s)\n",
|
||||||
|
"$gpgme_config_version", gcry_check_version(NULL) );
|
||||||
|
printf("*** was found! If gpgme-config was correct, then it is best\n");
|
||||||
|
printf("*** to remove the old version of GPGME. You may also be able to fix the error\n");
|
||||||
|
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||||
|
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||||
|
printf("*** required on your system.\n");
|
||||||
|
printf("*** If gpgme-config was wrong, set the environment variable GPGME_CONFIG\n");
|
||||||
|
printf("*** to point to the correct copy of gpgme-config, and remove the file config.cache\n");
|
||||||
|
printf("*** before re-running configure\n");
|
||||||
|
}
|
||||||
|
else if ( strcmp(gcry_check_version(NULL), GPGME_VERSION ) )
|
||||||
|
{
|
||||||
|
printf("\n*** GPGME header file (version %s) does not match\n", GPGME_VERSION);
|
||||||
|
printf("*** library (version %s)\n", gcry_check_version(NULL) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( gcry_check_version( "$min_gpgme_version" ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("no\n*** An old version of GPGME (%s) was found.\n",
|
||||||
|
gcry_check_version(NULL) );
|
||||||
|
printf("*** You need a version of GPGME newer than %s. The latest version of\n",
|
||||||
|
"$min_gpgme_version" );
|
||||||
|
printf("*** GPGME is always available from ftp://ftp.gnupg.org/pub/gpgme/gnupg.\n");
|
||||||
|
printf("*** (It is distributed along with GnuPG).\n");
|
||||||
|
printf("*** \n");
|
||||||
|
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||||
|
printf("*** probably means that the wrong copy of the gpgme-config shell script is\n");
|
||||||
|
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||||
|
printf("*** of GPGME, but you can also set the GPGME_CONFIG environment to point to the\n");
|
||||||
|
printf("*** correct copy of gpgme-config. (In this case, you will have to\n");
|
||||||
|
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||||
|
printf("*** so that the correct libraries are found at run-time))\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
],, no_gpgme=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||||
|
CFLAGS="$ac_save_CFLAGS"
|
||||||
|
LIBS="$ac_save_LIBS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test "x$no_gpgme" = x ; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
ifelse([$2], , :, [$2])
|
||||||
|
else
|
||||||
|
if test -f conf.gpgmetest ; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
if test "$GPGME_CONFIG" = "no" ; then
|
||||||
|
echo "*** The gpgme-config script installed by GPGME could not be found"
|
||||||
|
echo "*** If GPGME was installed in PREFIX, make sure PREFIX/bin is in"
|
||||||
|
echo "*** your path, or set the GPGME_CONFIG environment variable to the"
|
||||||
|
echo "*** full path to gpgme-config."
|
||||||
|
else
|
||||||
|
if test -f conf.gpgmetest ; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
echo "*** Could not run gpgme test program, checking why..."
|
||||||
|
CFLAGS="$CFLAGS $GPGME_CFLAGS"
|
||||||
|
LIBS="$LIBS $GPGME_LIBS"
|
||||||
|
AC_TRY_LINK([
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <gpgme.h>
|
||||||
|
], [ return !!gcry_check_version(NULL); ],
|
||||||
|
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||||
|
echo "*** that the run-time linker is not finding GPGME or finding the wrong"
|
||||||
|
echo "*** version of GPGME. If it is not finding GPGME, you'll need to set your"
|
||||||
|
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||||
|
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||||
|
echo "*** is required on your system"
|
||||||
|
echo "***"
|
||||||
|
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||||
|
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
|
||||||
|
echo "***" ],
|
||||||
|
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||||
|
echo "*** exact error that occured. This usually means GPGME was incorrectly installed"
|
||||||
|
echo "*** or that you have moved GPGME since it was installed. In the latter case, you"
|
||||||
|
echo "*** may want to edit the gpgme-config script: $GPGME_CONFIG" ])
|
||||||
|
CFLAGS="$ac_save_CFLAGS"
|
||||||
|
LIBS="$ac_save_LIBS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
GPGME_CFLAGS=""
|
||||||
|
GPGME_LIBS=""
|
||||||
|
ifelse([$3], , :, [$3])
|
||||||
|
fi
|
||||||
|
AC_SUBST(GPGME_CFLAGS)
|
||||||
|
AC_SUBST(GPGME_LIBS)
|
||||||
|
rm -f conf.gpgmetest
|
||||||
|
])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user