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 number: Remember to change it immediately *after* a release.
24 AC_INIT(gpgme, 0.4.1, [bug-gpgme@gnupg.org])
25 # LT Version numbers, remember to change them just *before* a release.
26 # (Code changed: REVISION++)
27 # (Interfaces added/removed/changed: CURRENT++, REVISION=0)
28 # (Interfaces added: AGE++)
29 # (Interfaces removed: AGE=0)
31 LIBGPGME_LT_CURRENT=10
33 LIBGPGME_LT_REVISION=0
34 NEED_GPG_VERSION=1.2.0
35 NEED_GPGSM_VERSION=0.9.0
36 ##############################################
38 AC_REVISION($Revision$)
41 VERSION=$PACKAGE_VERSION
43 AC_CONFIG_SRCDIR(gpgme/gpgme.h)
44 AM_CONFIG_HEADER(config.h)
45 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
48 AH_VERBATIM([_GNU_SOURCE],
49 [/* Enable GNU extensions on systems that have them. */
54 AH_VERBATIM([_REENTRANT],
55 [/* To allow the use of GPGME in multithreaded programs we have to use
56 special features from the library.
57 IMPORTANT: gpgme is not yet fully reentrant and you should use it
58 only from one thread. */
67 AC_SUBST(LIBGPGME_LT_CURRENT)
68 AC_SUBST(LIBGPGME_LT_AGE)
69 AC_SUBST(LIBGPGME_LT_REVISION)
70 AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
71 [Min. needed GnuPG version.])
72 AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",
73 [Min. needed GPGSM version.])
77 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
78 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
80 dnl Don't default to build static libs.
88 *-*-mingw32* | i?86-emx-os2 | i?86-*-os2*emx | i?86-*-msdosdjgpp* )
89 # special stuff for Windoze NT
90 # OS/2 with the EMX environment
91 # DOS with the DJGPP environment
92 AC_DEFINE(HAVE_DRIVE_LETTERS, ,
93 [Defined if we run on some of the PCDOS like systems (DOS,
94 Windoze, OS/2) with special properties like no file modes.])
95 AC_DEFINE(HAVE_DOSISH_SYSTEM, ,
96 [Defined if the filesystem uses driver letters.])
97 have_dosish_system=yes
98 GPG_DEFAULT='c:\\gnupg\\gpg.exe'
99 # XXX Assuan is not supported in this configuration.
100 #GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
101 #component_system='COM+'
104 AC_CHECK_PTH(1.2.0,,,no,have_pth=yes)
105 if test "$have_pth" = yes; then
106 AC_DEFINE(HAVE_PTH, ,[Define if we have Pth.])
107 CFLAGS="$CFLAGS $PTH_CFLAGS"
109 AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
110 if test "$have_pthread" = yes; then
111 AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
114 dnl # XXX: Probably use exec-prefix here?
115 dnl GPG_DEFAULT='/usr/bin/gpg'
116 dnl GPGSM_DEFAULT='/usr/bin/gpgsm'
119 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = "yes")
120 AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
121 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
124 dnl Checks for libraries.
127 dnl FIXME: check whether Bonobo is installed
130 dnl Checks for header files.
132 AC_CHECK_HEADERS(sys/select.h)
137 dnl Checks for typedefs and structures.
139 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
140 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
141 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
142 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
143 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
145 AC_CHECK_SIZEOF(unsigned int)
148 dnl Checks for compiler features.
151 if test "$GCC" = yes; then
152 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
156 dnl Checks for library functions.
159 AC_REPLACE_FUNCS(stpcpy)
161 AC_REPLACE_FUNCS(vasprintf)
162 if test "$ac_cv_func_vasprintf" != yes; then
168 # Note: fopencokie is only a dummy stub and not used.
169 # However some code in assuan/ links against it.
170 AC_REPLACE_FUNCS(fopencookie)
175 dnl Checks for system services
180 AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
181 GPG=$withval, NO_OVERRIDE=yes)
182 if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then
185 if test "$cross_compiling" != "yes"; then
186 AC_PATH_PROG(GPG, gpg)
188 if test -z "$GPG"; then
192 if test "$GPG" = no; then
193 if test "$NO_OVERRIDE" = "yes"; then
194 if test "$cross_compiling" != "yes"; then
195 AC_MSG_WARN([Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it])
197 AC_MSG_ERROR([Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH])
201 AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the GnuPG binary.])
204 AM_CONDITIONAL(RUN_GPG_TESTS,
205 [test "$cross_compiling" != "yes" && test -n "$GPG" && test -r "$GPG"])
210 AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
211 GPGSM=$withval, NO_OVERRIDE=yes)
212 if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then
215 if test "$cross_compiling" != "yes"; then
216 AC_PATH_PROG(GPGSM, gpgsm)
218 if test -z "$GPGSM"; then
219 GPGSM="$GPGSM_DEFAULT"
222 if test "$GPGSM" = no; then
223 if test "$NO_OVERRIDE" = "yes"; then
224 if test "$cross_compiling" != "yes"; then
225 AC_MSG_WARN([Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it])
227 AC_MSG_ERROR([Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH])
231 AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.])
234 AM_CONDITIONAL(HAVE_GPGSM, [test -n "$GPGSM" && test -r "$GPGSM"])
235 AM_CONDITIONAL(RUN_GPGSM_TESTS,
236 [test "$cross_compiling" != "yes" && test -n "$GPGSM" && test -r "$GPGSM"])
238 dnl FIXME: Only build if supported.
239 AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
241 AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
242 AM_CONDITIONAL(BUILD_BONOBO, test "$component_system" = "Bonobo")
244 dnl Make the version number in gpgme/gpgme.h the same as the one here.
245 dnl (this is easier than to have a *.in file just for one substitution)
246 GNUPG_FIX_HDR_VERSION(gpgme/gpgme.h, GPGME_VERSION)
248 dnl Substitution used for gpgme-config
249 GPGME_CONFIG_LIBS="-lgpgme"
250 GPGME_CONFIG_CFLAGS=""
251 AC_SUBST(GPGME_CONFIG_LIBS)
252 AC_SUBST(GPGME_CONFIG_CFLAGS)
254 dnl Frob'da Variables
255 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
256 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
260 dnl Create config files
263 AC_CONFIG_FILES(Makefile assuan/Makefile gpgme/Makefile
264 tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile
266 bonobo/Makefile complus/Makefile)
267 AC_CONFIG_FILES(gpgme/gpgme-config, chmod +x gpgme/gpgme-config)
271 GPGME v${VERSION} has been configured as follows:
273 GnuPG version: min. $NEED_GPG_VERSION
276 GpgSM version: min. $NEED_GPGSM_VERSION