1 # configure.in for GPGME
2 # Copyright (C) 2000 Werner Koch (dd9jn)
3 # Copyright (C) 2001 g10 Code GmbH
5 # This file is part of GPGME.
7 # GPGME is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # GPGME is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 # (Process this file with autoconf to produce a configure script.)
23 # Version numbers (Remember to change them just before a release.)
24 # (Code changed: REVISION++)
25 # (Interfaces added/removed/changed: CURRENT++, REVISION=0)
26 # (Interfaces added: AGE++)
27 # (Interfaces removed: AGE=0)
29 AC_INIT(gpgme, 0.3.4, [gnupg-devel@gnupg.org])
32 LIBGPGME_LT_REVISION=0
33 NEED_GPG_VERSION=1.0.6
34 NEED_GPGSM_VERSION=0.3.1
35 ##############################################
37 AC_REVISION($Revision$)
40 VERSION=$PACKAGE_VERSION
42 AC_CONFIG_SRCDIR(gpgme/gpgme.h)
43 AM_CONFIG_HEADER(config.h)
44 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
50 AC_SUBST(LIBGPGME_LT_CURRENT)
51 AC_SUBST(LIBGPGME_LT_AGE)
52 AC_SUBST(LIBGPGME_LT_REVISION)
53 AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION")
54 AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION")
58 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
59 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
61 dnl Don't default to build static libs.
69 *-*-mingw32* | i?86-emx-os2 | i?86-*-os2*emx | i?86-*-msdosdjgpp* )
70 # special stuff for Windoze NT
71 # OS/2 with the EMX environment
72 # DOS with the DJGPP environment
73 AC_DEFINE(HAVE_DRIVE_LETTERS)
74 AC_DEFINE(HAVE_DOSISH_SYSTEM)
75 GPG_DEFAULT='c:\\gnupg\\gpg.exe'
76 GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
77 #component_system='COM+'
80 dnl # XXX: Probably use exec-prefix here?
81 dnl GPG_DEFAULT='/usr/bin/gpg'
82 dnl GPGSM_DEFAULT='/usr/bin/gpgsm'
87 dnl Checks for libraries.
90 dnl FIXME: check whether Bonobo is installed
93 dnl Checks for header files.
97 dnl Checks for typedefs and structures.
99 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
100 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
101 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
102 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
103 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
105 dnl We should not use them in this software;
106 dnl However jnlib/types.h needs them - so we take the easy way.
107 AC_CHECK_SIZEOF(unsigned short)
108 AC_CHECK_SIZEOF(unsigned int)
109 AC_CHECK_SIZEOF(unsigned long)
112 dnl Checks for compiler features.
115 if test "$GCC" = yes; then
116 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
120 dnl Checks for library functions.
122 dnl These are needed by libjnlib
123 AC_CHECK_FUNCS(memicmp stpcpy strlwr strtoul memmove stricmp)
125 # asprintf() is at least used in assuan
126 AC_REPLACE_FUNCS(vasprintf)
127 # Note: fopencokie is only a dummy stub and not used.
128 # However some code in assuan/ links against it.
129 AC_REPLACE_FUNCS(fopencookie)
132 dnl We use jnlib, so tell other modules about it
133 AC_DEFINE(HAVE_JNLIB_LOGGING, 1,
134 [Defined if jnlib style logging fucntions are available.])
137 dnl Checks for system services
142 AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
143 GPG=$withval, NO_OVERRIDE=yes)
144 if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then
147 if test "$cross_compiling" != "yes"; then
148 AC_PATH_PROG(GPG, gpg)
150 if test -z "$GPG"; then
154 if test "$GPG" = no; then
155 if test "$NO_OVERRIDE" = "yes"; then
156 if test "$cross_compiling" != "yes"; then
157 AC_MSG_WARN([Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it])
159 AC_MSG_ERROR([Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH])
163 AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG")
166 AM_CONDITIONAL(RUN_GPG_TESTS,
167 [test "$cross_compiling" != "yes" && test -n "$GPG" && test -r "$GPG"])
172 AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
173 GPGSM=$withval, NO_OVERRIDE=yes)
174 if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then
177 if test "$cross_compiling" != "yes"; then
178 AC_PATH_PROG(GPGSM, gpgsm)
180 if test -z "$GPGSM"; then
181 GPGSM="$GPGSM_DEFAULT"
184 if test "$GPGSM" = no; then
185 if test "$NO_OVERRIDE" = "yes"; then
186 if test "$cross_compiling" != "yes"; then
187 AC_MSG_WARN([Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it])
189 AC_MSG_ERROR([Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH])
193 AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM")
196 AM_CONDITIONAL(RUN_GPGSM_TESTS,
197 [test "$cross_compiling" != "yes" && test -n "$GPGSM" && test -r "$GPGSM"])
199 dnl FIXME: Only build if supported.
200 AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
202 AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
203 AM_CONDITIONAL(BUILD_BONOBO, test "$component_system" = "Bonobo")
206 AC_ARG_ENABLE(gpgmeplug,
207 AC_HELP_STRING([--enable-gpgmeplug], [build GPGME Crypt Plug-In]),
208 GPGMEPLUG=$enableval)
209 AM_CONDITIONAL(BUILD_GPGMEPLUG, test "$GPGMEPLUG" = "yes")
211 dnl Make the version number in gpgme/gpgme.h the same as the one here.
212 dnl (this is easier than to have a *.in file just for one substitution)
213 GNUPG_FIX_HDR_VERSION(gpgme/gpgme.h, GPGME_VERSION)
215 dnl Substitution used for gpgme-config
216 GPGME_LIBS="-L${libdir} -lgpgme"
219 AC_SUBST(GPGME_CFLAGS)
222 dnl Create config files
225 AC_CONFIG_FILES(Makefile assuan/Makefile jnlib/Makefile gpgme/Makefile
226 tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile
228 bonobo/Makefile complus/Makefile gpgmeplug/Makefile)
229 AC_CONFIG_FILES(gpgme/gpgme-config, chmod +x gpgme/gpgme-config)
233 GPGME v${VERSION} has been configured as follows:
235 GnuPG version: min. $NEED_GPG_VERSION
238 GpgSM version: min. $NEED_GPGSM_VERSION
241 GPGME CryptPlug: $GPGMEPLUG