1 # configure.in for GPGME
2 # Copyright (C) 2000 Werner Koch (dd9jn)
3 # Copyright (C) 2001, 2002 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.7-cvs, [gnupg-devel@gnupg.org])
32 LIBGPGME_LT_REVISION=0
33 NEED_GPG_VERSION=1.0.7
34 NEED_GPGSM_VERSION=0.3.6
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)
47 AH_VERBATIM([_GNU_SOURCE],
48 [/* Enable GNU extensions on systems that have them. */
53 AH_VERBATIM([_REENTRANT],
54 [/* To allow the use of GPGME in multithreaded programs we have to use
55 special features from the library.
56 IMPORTANT: gpgme is not yet fully reentrant and you should use it
57 only from one thread. */
66 AC_SUBST(LIBGPGME_LT_CURRENT)
67 AC_SUBST(LIBGPGME_LT_AGE)
68 AC_SUBST(LIBGPGME_LT_REVISION)
69 AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
70 [Min. needed GnuPG version.])
71 AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",
72 [Min. needed GPGSM version.])
76 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
77 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
79 dnl Don't default to build static libs.
87 *-*-mingw32* | i?86-emx-os2 | i?86-*-os2*emx | i?86-*-msdosdjgpp* )
88 # special stuff for Windoze NT
89 # OS/2 with the EMX environment
90 # DOS with the DJGPP environment
91 AC_DEFINE(HAVE_DRIVE_LETTERS, ,
92 [Defined if we run on some of the PCDOS like systems (DOS,
93 Windoze, OS/2) with special properties like no file modes.])
94 AC_DEFINE(HAVE_DOSISH_SYSTEM, ,
95 [Defined if the filesystem uses driver letters.])
96 have_dosish_system=yes
97 GPG_DEFAULT='c:\\gnupg\\gpg.exe'
98 GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
99 #component_system='COM+'
102 dnl # XXX: Probably use exec-prefix here?
103 dnl GPG_DEFAULT='/usr/bin/gpg'
104 dnl GPGSM_DEFAULT='/usr/bin/gpgsm'
107 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = "yes")
110 dnl Checks for libraries.
113 dnl FIXME: check whether Bonobo is installed
116 dnl Checks for header files.
120 dnl Checks for typedefs and structures.
122 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
123 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
124 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
125 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
126 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
128 dnl We should not use them in this software;
129 dnl However jnlib/types.h needs them - so we take the easy way.
130 AC_CHECK_SIZEOF(unsigned short)
131 AC_CHECK_SIZEOF(unsigned int)
132 AC_CHECK_SIZEOF(unsigned long)
135 dnl Checks for compiler features.
138 if test "$GCC" = yes; then
139 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
143 dnl Checks for library functions.
145 dnl These are needed by libjnlib
146 AC_CHECK_FUNCS(memicmp stpcpy strlwr strtoul memmove stricmp)
148 # asprintf() is at least used in assuan
149 AC_REPLACE_FUNCS(vasprintf)
150 # Note: fopencokie is only a dummy stub and not used.
151 # However some code in assuan/ links against it.
152 AC_REPLACE_FUNCS(fopencookie)
155 dnl We use jnlib, so tell other modules about it
156 AC_DEFINE(HAVE_JNLIB_LOGGING, 1,
157 [Defined if jnlib style logging fucntions are available.])
160 dnl Checks for system services
165 AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
166 GPG=$withval, NO_OVERRIDE=yes)
167 if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then
170 if test "$cross_compiling" != "yes"; then
171 AC_PATH_PROG(GPG, gpg)
173 if test -z "$GPG"; then
177 if test "$GPG" = no; then
178 if test "$NO_OVERRIDE" = "yes"; then
179 if test "$cross_compiling" != "yes"; then
180 AC_MSG_WARN([Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it])
182 AC_MSG_ERROR([Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH])
186 AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the GnuPG binary.])
189 AM_CONDITIONAL(RUN_GPG_TESTS,
190 [test "$cross_compiling" != "yes" && test -n "$GPG" && test -r "$GPG"])
195 AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
196 GPGSM=$withval, NO_OVERRIDE=yes)
197 if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then
200 if test "$cross_compiling" != "yes"; then
201 AC_PATH_PROG(GPGSM, gpgsm)
203 if test -z "$GPGSM"; then
204 GPGSM="$GPGSM_DEFAULT"
207 if test "$GPGSM" = no; then
208 if test "$NO_OVERRIDE" = "yes"; then
209 if test "$cross_compiling" != "yes"; then
210 AC_MSG_WARN([Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it])
212 AC_MSG_ERROR([Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH])
216 AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.])
219 AM_CONDITIONAL(RUN_GPGSM_TESTS,
220 [test "$cross_compiling" != "yes" && test -n "$GPGSM" && test -r "$GPGSM"])
222 dnl FIXME: Only build if supported.
223 AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
225 AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
226 AM_CONDITIONAL(BUILD_BONOBO, test "$component_system" = "Bonobo")
229 AC_ARG_ENABLE(gpgmeplug,
230 AC_HELP_STRING([--enable-gpgmeplug], [build GPGME Crypt Plug-In]),
231 GPGMEPLUG=$enableval)
232 AM_CONDITIONAL(BUILD_GPGMEPLUG, test "$GPGMEPLUG" = "yes")
234 dnl Make the version number in gpgme/gpgme.h the same as the one here.
235 dnl (this is easier than to have a *.in file just for one substitution)
236 GNUPG_FIX_HDR_VERSION(gpgme/gpgme.h, GPGME_VERSION)
238 dnl Substitution used for gpgme-config
239 GPGME_LIBS="-L${libdir} -lgpgme"
242 AC_SUBST(GPGME_CFLAGS)
245 dnl Create config files
248 AC_CONFIG_FILES(Makefile assuan/Makefile jnlib/Makefile gpgme/Makefile
249 tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile
251 bonobo/Makefile complus/Makefile gpgmeplug/Makefile)
252 AC_CONFIG_FILES(gpgme/gpgme-config, chmod +x gpgme/gpgme-config)
256 GPGME v${VERSION} has been configured as follows:
258 GnuPG version: min. $NEED_GPG_VERSION
261 GpgSM version: min. $NEED_GPGSM_VERSION
264 GPGME CryptPlug: $GPGMEPLUG