1
# configure.ac - for GnuPG 1.9
2
# Copyright (C) 1998, 1999, 2000, 2001, 2002,
3
# 2003, 2004 Free Software Foundation, Inc.
5
# This file is part of GnuPG.
7
# GnuPG 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
# GnuPG 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
min_automake_version="1.9.3"
25
# Version number: Remember to change it immediately *after* a release.
26
# Add a "-cvs" prefix for non-released code.
27
AC_INIT(gnupg, 1.9.15, gnupg-devel@gnupg.org)
28
# Set development_version to yes if the minor number is odd or you
29
# feel that the default check for a development version is not
31
development_version=yes
32
NEED_GPG_ERROR_VERSION=1.0
35
NEED_LIBGCRYPT_VERSION=1.1.94
37
NEED_LIBASSUAN_VERSION=0.6.9
39
NEED_KSBA_VERSION=0.9.7
41
NEED_OPENSC_VERSION=0.8.0
46
PACKAGE_GT=${PACKAGE_NAME}2
47
VERSION=$PACKAGE_VERSION
49
AC_CONFIG_AUX_DIR(scripts)
50
AC_CONFIG_SRCDIR(sm/gpgsm.c)
51
AM_CONFIG_HEADER(config.h)
53
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
57
# Some status variables to give feedback at the end of a configure run
65
GNUPG_BUILD_PROGRAM(gpg, yes)
66
GNUPG_BUILD_PROGRAM(gpgsm, yes)
67
GNUPG_BUILD_PROGRAM(agent, yes)
68
GNUPG_BUILD_PROGRAM(scdaemon, yes)
74
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
75
AC_DEFINE_UNQUOTED(PACKAGE_GT, "$PACKAGE_GT",
76
[Name of this package for gettext])
77
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
78
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
80
AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION",
81
[Required version of Libgcrypt])
82
AC_DEFINE_UNQUOTED(NEED_KSBA_VERSION, "$NEED_KSBA_VERSION",
83
[Required version of Libksba])
87
# The default is to use the modules from this package and the few
88
# other packages in a standard place; i.e where this package gets
89
# installed. With these options it is possible to override these
90
# ${prefix} depended values with fixed paths, which can't be replaced
91
# at make time. See also am/cmacros.am and the defaults in AH_BOTTOM.
92
AC_ARG_WITH(agent-pgm,
93
[ --with-agent-pgm=PATH Use PATH as the default for the agent)],
94
GNUPG_AGENT_PGM="$withval", GNUPG_AGENT_PGM="" )
95
AC_SUBST(GNUPG_AGENT_PGM)
96
AM_CONDITIONAL(GNUPG_AGENT_PGM, test -n "$GNUPG_AGENT_PGM")
97
show_gnupg_agent_pgm="(default)"
98
test -n "$GNUPG_AGENT_PGM" && show_gnupg_agent_pgm="$GNUPG_AGENT_PGM"
100
AC_ARG_WITH(pinentry-pgm,
101
[ --with-pinentry-pgm=PATH Use PATH as the default for the pinentry)],
102
GNUPG_PINENTRY_PGM="$withval", GNUPG_PINENTRY_PGM="" )
103
AC_SUBST(GNUPG_PINENTRY_PGM)
104
AM_CONDITIONAL(GNUPG_PINENTRY_PGM, test -n "$GNUPG_PINENTRY_PGM")
105
show_gnupg_pinentry_pgm="(default)"
106
test -n "$GNUPG_PINENTRY_PGM" && show_gnupg_pinentry_pgm="$GNUPG_PINENTRY_PGM"
109
AC_ARG_WITH(scdaemon-pgm,
110
[ --with-scdaemon-pgm=PATH Use PATH as the default for the scdaemon)],
111
GNUPG_SCDAEMON_PGM="$withval", GNUPG_SCDAEMON_PGM="" )
112
AC_SUBST(GNUPG_SCDAEMON_PGM)
113
AM_CONDITIONAL(GNUPG_SCDAEMON_PGM, test -n "$GNUPG_SCDAEMON_PGM")
114
show_gnupg_scdaemon_pgm="(default)"
115
test -n "$GNUPG_SCDAEMON_PGM" && show_gnupg_scdaemon_pgm="$GNUPG_SCDAEMON_PGM"
118
AC_ARG_WITH(dirmngr-pgm,
119
[ --with-dirmngr-pgm=PATH Use PATH as the default for the dirmngr)],
120
GNUPG_DIRMNGR_PGM="$withval", GNUPG_DIRMNGR_PGM="" )
121
AC_SUBST(GNUPG_DIRMNGR_PGM)
122
AM_CONDITIONAL(GNUPG_DIRMNGR_PGM, test -n "$GNUPG_DIRMNGR_PGM")
123
show_gnupg_dirmngr_pgm="(default)"
124
test -n "$GNUPG_DIRMNGR_PGM" && show_gnupg_dirmngr_pgm="$GNUPG_DIRMNGR_PGM"
126
AC_ARG_WITH(protect-tool-pgm,
127
[ --with-protect-tool-pgm=PATH Use PATH as the default for the protect-tool)],
128
GNUPG_PROTECT_TOOL_PGM="$withval", GNUPG_PROTECT_TOOL_PGM="" )
129
AC_SUBST(GNUPG_PROTECT_TOOL_PGM)
130
AM_CONDITIONAL(GNUPG_PROTECT_TOOL_PGM, test -n "$GNUPG_PROTECT_TOOL_PGM")
131
show_gnupg_protect_tool_pgm="(default)"
132
test -n "$GNUPG_PROTECT_TOOL_PGM" \
133
&& show_gnupg_protect_tool_pgm="$GNUPG_PROTECT_TOOL_PGM"
137
# Some folks want to use only the agent form this packet. Make it
138
# easier for them by providing the configure option
139
# --enable-only-agent.
140
AC_ARG_ENABLE(agent-only,
141
AC_HELP_STRING([--enable-agent-only],[build only the gpg-agent]),
142
build_agent_only=$enableval)
145
# Configure option to allow or disallow execution of external
146
# programs, like a photo viewer.
147
AC_MSG_CHECKING([whether to enable external program execution])
149
AC_HELP_STRING([--disable-exec],[disable all external program execution]),
151
AC_MSG_RESULT($use_exec)
152
if test "$use_exec" = no ; then
153
AC_DEFINE(NO_EXEC,1,[Define to disable all external program execution])
156
if test "$use_exec" = yes ; then
157
AC_MSG_CHECKING([whether to enable photo ID viewing])
158
AC_ARG_ENABLE(photo-viewers,
159
[ --disable-photo-viewers disable photo ID viewers],
160
[if test "$enableval" = no ; then
161
AC_DEFINE(DISABLE_PHOTO_VIEWER,1,[define to disable photo viewing])
163
gnupg_cv_enable_photo_viewers=$enableval
164
AC_MSG_RESULT($enableval)
166
if test "$gnupg_cv_enable_photo_viewers" = yes ; then
167
AC_MSG_CHECKING([whether to use a fixed photo ID viewer])
168
AC_ARG_WITH(photo-viewer,
169
[ --with-photo-viewer=FIXED_VIEWER set a fixed photo ID viewer],
170
[if test "$withval" = yes ; then
172
elif test "$withval" != no ; then
173
AC_DEFINE_UNQUOTED(FIXED_PHOTO_VIEWER,"$withval",
174
[if set, restrict photo-viewer to this])
176
AC_MSG_RESULT($withval)
179
AC_MSG_CHECKING([whether to enable external keyserver helpers])
180
AC_ARG_ENABLE(keyserver-helpers,
181
[ --disable-keyserver-helpers disable all external keyserver support],
182
[if test "$enableval" = no ; then
183
AC_DEFINE(DISABLE_KEYSERVER_HELPERS,1,
184
[define to disable keyserver helpers])
186
gnupg_cv_enable_keyserver_helpers=$enableval
187
AC_MSG_RESULT($enableval)
189
if test "$gnupg_cv_enable_keyserver_helpers" = yes ; then
190
AC_MSG_CHECKING([whether LDAP keyserver support is requested])
192
[ --disable-ldap disable LDAP keyserver interface],
193
try_ldap=$enableval, try_ldap=yes)
194
AC_MSG_RESULT($try_ldap)
196
AC_MSG_CHECKING([whether HKP keyserver support is requested])
198
[ --disable-hkp disable HKP keyserver interface],
199
try_hkp=$enableval, try_hkp=yes)
200
AC_MSG_RESULT($try_hkp)
202
if test "$try_hkp" = yes ; then
203
AC_SUBST(GPGKEYS_HKP,"gpgkeys_hkp$EXEEXT")
206
AC_MSG_CHECKING([whether email keyserver support is requested])
207
AC_ARG_ENABLE(mailto,
208
[ --disable-mailto disable email keyserver interface],
209
try_mailto=$enableval, try_mailto=yes)
210
AC_MSG_RESULT($try_mailto)
213
AC_MSG_CHECKING([whether keyserver exec-path is enabled])
214
AC_ARG_ENABLE(keyserver-path,
215
[ --disable-keyserver-path disable the exec-path option for keyserver helpers],
216
[if test "$enableval" = no ; then
217
AC_DEFINE(DISABLE_KEYSERVER_PATH,1,[define to disable exec-path for keyserver helpers])
219
AC_MSG_RESULT($enableval)
223
dnl Check whether we want to use Linux capabilities
225
AC_MSG_CHECKING([whether use of capabilities is requested])
226
AC_ARG_WITH(capabilities,
227
[ --with-capabilities use linux capabilities [default=no]],
228
[use_capabilities="$withval"],[use_capabilities=no])
229
AC_MSG_RESULT($use_capabilities)
233
/* Some global constants. */
234
#ifdef HAVE_DRIVE_LETTERS
235
#define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
237
#define GNUPG_DEFAULT_HOMEDIR "/SYS\$LOGIN/gnupg"
239
#define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
241
#define GNUPG_PRIVATE_KEYS_DIR "private-keys-v1.d"
243
/* Tell libgcrypt not to use its own libgpg-error implementation. */
244
#define USE_LIBGPG_ERROR 1
246
/* This is the major version number of GnuPG so that
247
source included files can test for this. Note, that\
248
we use 2 here even for GnuPG 1.9.x. */
249
#define GNUPG_MAJOR_VERSION 2
251
/* Now to separate file name parts.
252
Please note that the string version must not contain more
253
than one character because the code assumes strlen()==1 */
254
#ifdef HAVE_DOSISH_SYSTEM
255
#define DIRSEP_C '\\'
256
#define DIRSEP_S "\\"
259
#define PATHSEP_C ';'
260
#define PATHSEP_S ";"
261
#define EXEEXT_S ".exe"
267
#define PATHSEP_C ':'
268
#define PATHSEP_S ":"
272
/* This is the same as VERSION, but should be overridden if the
273
platform cannot handle things like dots '.' in filenames. Set
274
SAFE_VERSION_DOT and SAFE_VERSION_DASH to whatever SAFE_VERSION
275
uses for dots and dashes. */
276
#define SAFE_VERSION VERSION
277
#define SAFE_VERSION_DOT '.'
278
#define SAFE_VERSION_DASH '-'
280
/* For some systems (DOS currently), we hardcode the path here. For
281
POSIX systems the values are constructed by the Makefiles, so that
282
the values may be overridden by the make invocations; this is to
283
comply with the GNU coding standards. */
284
#ifdef HAVE_DRIVE_LETTERS
285
#define GNUPG_BINDIR "c:\\gnupg"
286
#define GNUPG_LIBEXECDIR "c:\\gnupg"
287
#define GNUPG_LIBDIR "c:\\gnupg"
288
#define GNUPG_DATADIR "c:\\gnupg"
291
/* Setup the hardwired names of modules. */
292
#ifndef GNUPG_DEFAULT_AGENT
293
#define GNUPG_DEFAULT_AGENT ( GNUPG_BINDIR DIRSEP_S "gpg-agent" EXEEXT_S )
295
#ifndef GNUPG_DEFAULT_PINENTRY
296
#define GNUPG_DEFAULT_PINENTRY ( GNUPG_BINDIR DIRSEP_S "pinentry" EXEEXT_S )
298
#ifndef GNUPG_DEFAULT_SCDAEMON
299
#define GNUPG_DEFAULT_SCDAEMON ( GNUPG_BINDIR DIRSEP_S "scdaemon" EXEEXT_S )
301
#ifndef GNUPG_DEFAULT_DIRMNGR
302
#define GNUPG_DEFAULT_DIRMNGR ( GNUPG_BINDIR DIRSEP_S "dirmngr" EXEEXT_S )
304
#ifndef GNUPG_DEFAULT_PROTECT_TOOL
305
#define GNUPG_DEFAULT_PROTECT_TOOL \
306
( GNUPG_LIBEXECDIR DIRSEP_S "gpg-protect-tool" EXEEXT_S )
310
/* Derive some other constants. */
311
#if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
312
#define EXEC_TEMPFILE_ONLY
319
# Checks for programs.
322
missing_dir=`cd $ac_aux_dir && pwd`
323
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
324
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
325
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
326
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
327
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
335
AC_CHECK_TOOL(AR, ar, :)
336
AC_PATH_PROG(PERL,"perl")
339
AC_CHECK_PROG(DOCBOOK_TO_MAN, docbook-to-man, yes, no)
340
AM_CONDITIONAL(HAVE_DOCBOOK_TO_MAN, test "$ac_cv_prog_DOCBOOK_TO_MAN" = yes)
342
GNUPG_CHECK_DOCBOOK_TO_TEXI
346
have_dosish_system=no
350
# special stuff for Windoze NT
351
ac_cv_have_dev_random=no
352
AC_DEFINE(USE_ONLY_8DOT3,1,
353
[set this to limit filenames to the 8.3 format])
354
AC_DEFINE(HAVE_DRIVE_LETTERS,1,
355
[defined if we must run on a stupid file system])
356
AC_DEFINE(USE_SIMPLE_GETTEXT,1,
357
[because the Unix gettext has too much overhead on
358
MingW32 systems and these systems lack Posix functions,
359
we use a simplified version of gettext])
360
have_dosish_system=yes
364
i?86-emx-os2 | i?86-*-os2*emx )
365
# OS/2 with the EMX environment
366
ac_cv_have_dev_random=no
367
AC_DEFINE(HAVE_DRIVE_LETTERS)
368
have_dosish_system=yes
373
# DOS with the DJGPP environment
374
ac_cv_have_dev_random=no
375
AC_DEFINE(HAVE_DRIVE_LETTERS)
376
have_dosish_system=yes
382
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
383
LDFLAGS="$LDFLAGS -L/usr/local/lib"
387
if test -z "$GCC" ; then
388
CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
392
if test -z "$GCC" ; then
393
# Suppress all warnings
394
# to get rid of the unsigned/signed char mismatch warnings.
399
if test -z "$GCC" ; then
400
# Use the newer compiler `-msg_disable ptrmismatch' to
401
# get rid of the unsigned/signed char mismatch warnings.
402
# Using this may hide other pointer mismatch warnings, but
403
# it at least lets other warning classes through
404
CFLAGS="$CFLAGS -msg_disable ptrmismatch"
413
if test "$have_dosish_system" = yes; then
414
AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
415
[Defined if we run on some of the PCDOS like systems
416
(DOS, Windoze. OS/2) with special properties like
419
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
421
if test "$have_w32_system" = yes; then
422
AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
424
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
429
# Checks for libraries.
434
# libgpg-error is a library with error codes shared between GnuPG
437
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
438
have_gpg_error=yes,have_gpg_error=no)
442
# Libgcrypt is our generic crypto library
444
AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
445
have_libgcrypt=yes,have_libgcrypt=no)
449
# libassuan is used for IPC
451
AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_VERSION",
452
have_libassuan=yes,have_libassuan=no)
456
# libksba is our X.509 support library
458
AM_PATH_KSBA("$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)
461
# libusb allows us to use the integrated CCID smartcard reader driver.
463
AC_CHECK_LIB(usb, usb_bulk_write,
464
[ LIBUSB_LIBS="$LIBUSB_LIBS -lusb"
465
AC_DEFINE(HAVE_LIBUSB,1,
466
[defined if libusb is available])
468
AC_SUBST(LIBUSB_LIBS)
469
AC_CHECK_FUNCS(usb_create_match)
472
# Check wether it is necessary to link against libdl.
475
AC_SEARCH_LIBS(dlopen, c dl,,,)
480
# OpenSC is needed by the SCdaemon - if it is not availbale we can only
481
# build a limited SCdaemon
483
AM_PATH_OPENSC("$NEED_OPENSC_VERSION",have_opensc=yes,have_opensc=no)
484
if test $have_opensc = yes; then
485
AC_DEFINE(HAVE_OPENSC,1,
486
[defined if the OpenSC library is available])
488
AM_CONDITIONAL(HAVE_OPENSC, test "$have_opensc" = "yes")
491
# Check whether the (highly desirable) GNU Pth library is available
492
# Note, that we include a Pth emulation for W32.
494
AC_ARG_WITH(pth-prefix,
495
AC_HELP_STRING([--with-pth-prefix=PFX],
496
[prefix where GNU Pth is installed (optional)]),
497
pth_config_prefix="$withval", pth_config_prefix="")
498
if test x$pth_config_prefix != x ; then
499
PTH_CONFIG="$pth_config_prefix/bin/pth-config"
501
AC_PATH_PROG(PTH_CONFIG, pth-config, no)
502
if test "$have_w32_system" = no; then
503
if test "$PTH_CONFIG" = "no"; then
506
*** To support concurrent access to the gpg-agent and the SCdaemon
507
*** we need the support of the GNU Portable Threads Library.
508
*** Download it from ftp://ftp.gnu.org/gnu/pth/
509
*** On a Debian GNU/Linux system you might want to try
510
*** apt-get install libpth-dev
513
GNUPG_PTH_VERSION_CHECK(1.3.7)
514
if test $have_pth = yes; then
515
PTH_CFLAGS=`$PTH_CONFIG --cflags`
516
PTH_LIBS=`$PTH_CONFIG --ldflags`
517
PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs`"
518
AC_DEFINE(USE_GNU_PTH, 1,
519
[Defined if the GNU Portable Thread Library should be used])
526
AC_DEFINE(USE_GNU_PTH, 1)
531
AC_ARG_ENABLE(threads,
532
AC_HELP_STRING([--disable-threads],[allow building without Pth support])
536
dnl Must check for network library requirements before doing link tests
537
dnl for ldap, for example. If ldap libs are static (or dynamic and without
538
dnl ELF runtime link paths), then link will fail and LDAP support won't
541
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
542
[NETLIBS="-lnsl $NETLIBS"]))
543
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
544
[NETLIBS="-lsocket $NETLIBS"]))
546
dnl Now try for the resolver functions so we can use DNS SRV
548
AC_ARG_ENABLE(dns-srv,
549
AC_HELP_STRING([--disable-dns-srv],[disable the use of DNS SRV in HKP]),
550
use_dns_srv=$enableval,use_dns_srv=yes)
552
if test x"$try_hkp" = xyes && test x"$use_dns_srv" = xyes ; then
555
# the double underscore thing is a glibc-ism?
556
AC_SEARCH_LIBS(res_query,resolv bind,,
557
AC_SEARCH_LIBS(__res_query,resolv bind,,use_dns_srv=no))
558
AC_SEARCH_LIBS(dn_expand,resolv bind,,
559
AC_SEARCH_LIBS(__dn_expand,resolv bind,,use_dns_srv=no))
560
AC_SEARCH_LIBS(dn_skipname,resolv bind,,
561
AC_SEARCH_LIBS(__dn_skipname,resolv bind,,use_dns_srv=no))
563
if test x"$use_dns_srv" = xyes ; then
564
AC_DEFINE(USE_DNS_SRV,1,[define to use DNS SRV])
567
AC_MSG_WARN([Resolver functions not found. Disabling DNS SRV.])
574
# Try and link a LDAP test program to weed out unusable LDAP
575
# libraries. -lldap [-llber [-lresolv]] is for OpenLDAP. OpenLDAP in
576
# general is terrible with creating weird dependencies. If all else
577
# fails, the user can play guess-the-dependency by using something
578
# like ./configure LDAPLIBS="-Lfoo -lbar"
580
if test "$try_ldap" = yes ; then
581
for MY_LDAPLIBS in ${LDAPLIBS+"$LDAPLIBS"} "-lldap" "-lldap -llber" "-lldap -llber -lresolv"; do
582
_ldap_save_libs=$LIBS
583
LIBS="$MY_LDAPLIBS $NETLIBS $LIBS"
585
AC_MSG_CHECKING([whether LDAP via \"$MY_LDAPLIBS\" is present and sane])
586
AC_TRY_LINK([#include <ldap.h>],[ldap_open("foobar",1234);],
587
[gnupg_cv_func_ldap_init=yes],[gnupg_cv_func_ldap_init=no])
588
AC_MSG_RESULT([$gnupg_cv_func_ldap_init])
590
if test $gnupg_cv_func_ldap_init = no; then
591
AC_MSG_CHECKING([whether I can make LDAP be sane with lber.h])
592
AC_TRY_LINK([#include <lber.h>
593
#include <ldap.h>],[ldap_open("foobar",1234);],
594
[gnupg_cv_func_ldaplber_init=yes],[gnupg_cv_func_ldaplber_init=no])
595
AC_MSG_RESULT([$gnupg_cv_func_ldaplber_init])
598
if test "$gnupg_cv_func_ldaplber_init" = yes ; then
599
AC_DEFINE(NEED_LBER_H,1,[Define if the LDAP library requires including lber.h before ldap.h])
602
if test "$gnupg_cv_func_ldap_init" = yes || \
603
test "$gnupg_cv_func_ldaplber_init" = yes ; then
604
LDAPLIBS=$MY_LDAPLIBS
605
GPGKEYS_LDAP="gpgkeys_ldap$EXEEXT"
607
AC_MSG_CHECKING([whether LDAP supports ldap_get_option])
609
if test "$gnupg_cv_func_ldap_init" = yes ; then
610
AC_TRY_LINK([#include <ldap.h>],
611
[ldap_get_option((void *)0,0,(void *)0);],
612
[gnupg_cv_func_ldap_get_option=yes],
613
[gnupg_cv_func_ldap_get_option=no])
615
AC_TRY_LINK([#include <lber.h>
616
#include <ldap.h>],[ldap_get_option((void *)0,0,(void *)0);],
617
[gnupg_cv_func_ldap_get_option=yes],
618
[gnupg_cv_func_ldap_get_option=no])
621
AC_MSG_RESULT([$gnupg_cv_func_ldap_get_option])
623
if test "$gnupg_cv_func_ldap_get_option" = yes ; then
624
AC_DEFINE(HAVE_LDAP_GET_OPTION,1,[Define if the LDAP library has ldap_get_option])
626
AC_MSG_CHECKING([whether LDAP supports ld_errno])
628
if test "$gnupg_cv_func_ldap_init" = yes ; then
629
AC_TRY_COMPILE([#include <ldap.h>],
630
[LDAP *ldap; ldap->ld_errno;],
631
[gnupg_cv_func_ldap_ld_errno=yes],
632
[gnupg_cv_func_ldap_ld_errno=no])
634
AC_TRY_LINK([#include <lber.h>
635
#include <ldap.h>],[LDAP *ldap; ldap->ld_errno;],
636
[gnupg_cv_func_ldap_ld_errno=yes],
637
[gnupg_cv_func_ldap_ld_errno=no])
640
AC_MSG_RESULT([$gnupg_cv_func_ldap_ld_errno])
642
if test "$gnupg_cv_func_ldap_ld_errno" = yes ; then
643
AC_DEFINE(HAVE_LDAP_LD_ERRNO,1,[Define if the LDAP library supports ld_errno])
648
LIBS=$_ldap_save_libs
650
if test "$GPGKEYS_LDAP" != "" ; then break; fi
654
AC_SUBST(GPGKEYS_LDAP)
657
dnl This isn't necessarily sendmail itself, but anything that gives a
658
dnl sendmail-ish interface to the outside world. That includes qmail,
659
dnl postfix, etc. Basically, anything that can handle "sendmail -t".
661
if test "$try_mailto" = yes ; then
662
AC_ARG_WITH(mailprog,[ --with-mailprog=NAME use "NAME -t" for mail transport],,with_mailprog=yes)
664
if test "$with_mailprog" = yes ; then
665
AC_PATH_PROG(SENDMAIL,sendmail,,$PATH:/usr/sbin:/usr/libexec:/usr/lib)
666
if test "$ac_cv_path_SENDMAIL" ; then
667
GPGKEYS_MAILTO="gpgkeys_mailto"
669
elif test "$with_mailprog" != no ; then
670
AC_MSG_CHECKING([for a mail transport program])
671
AC_SUBST(SENDMAIL,$with_mailprog)
672
AC_MSG_RESULT($with_mailprog)
673
GPGKEYS_MAILTO="gpgkeys_mailto"
677
AC_SUBST(GPGKEYS_MAILTO)
681
PRINTABLE_OS_NAME="MingW32"
684
PRINTABLE_OS_NAME="Cygwin"
686
i?86-emx-os2 | i?86-*-os2*emx )
687
PRINTABLE_OS_NAME="OS/2"
690
PRINTABLE_OS_NAME="MSDOS/DJGPP"
694
PRINTABLE_OS_NAME="GNU/Linux"
697
PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
700
AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
701
[A human readable text with the name of the OS])
704
AM_GNU_GETTEXT_VERSION(0.14.1)
705
if test "$try_gettext" = yes; then
706
AM_GNU_GETTEXT(,[need-ngettext])
708
# gettext requires some extra checks. These really should be part of
709
# the basic AM_GNU_GETTEXT macro. TODO: move other gettext-specific
710
# function checks to here.
712
AC_CHECK_FUNCS(strchr)
715
USE_INCLUDED_LIBINTL=no
716
BUILD_INCLUDED_LIBINTL=no
718
AC_SUBST(USE_INCLUDED_LIBINTL)
719
AC_SUBST(BUILD_INCLUDED_LIBINTL)
722
# Checks for header files.
724
AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h)
726
# Checks for typedefs, structures, and compiler characteristics.
735
GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
736
GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
737
GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
738
GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
739
GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
741
AC_CHECK_SIZEOF(unsigned short)
742
AC_CHECK_SIZEOF(unsigned int)
743
AC_CHECK_SIZEOF(unsigned long)
744
AC_CHECK_SIZEOF(unsigned long long)
745
# Ensure that we have UINT64_C before we bother to check for uint64_t
746
# fixme: really needed in gnupg? I think it is only useful in libcgrypt.
747
AC_CACHE_CHECK([for UINT64_C],[gnupg_cv_uint64_c_works],
748
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <inttypes.h>
749
uint64_t foo=UINT64_C(42);]),gnupg_cv_uint64_c_works=yes,gnupg_cv_uint64_c_works=no))
750
if test "$gnupg_cv_uint64_c_works" = "yes" ; then
751
AC_CHECK_SIZEOF(uint64_t)
757
if test "$ac_cv_sizeof_unsigned_short" = "0" \
758
|| test "$ac_cv_sizeof_unsigned_int" = "0" \
759
|| test "$ac_cv_sizeof_unsigned_long" = "0"; then
760
AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
763
dnl Do we have any 64-bit data types?
764
if test "$ac_cv_sizeof_unsigned_int" != "8" \
765
&& test "$ac_cv_sizeof_unsigned_long" != "8" \
766
&& test "$ac_cv_sizeof_unsigned_long_long" != "8" \
767
&& test "$ac_cv_sizeof_uint64_t" != "8"; then
768
AC_MSG_WARN([No 64-bit types. Disabling SHA-384, and SHA-512])
770
if test x"$use_sha512" = xyes ; then
771
AC_SUBST(SHA512_O,sha512.o)
772
AC_DEFINE(USE_SHA512,1,[Define to include the SHA-384 and SHA-512 digests])
776
# fixme: do we really need this - it should be encapsulated in libassuan
777
GNUPG_SYS_SO_PEERCRED
779
# Checks for library functions.
783
AC_CHECK_FUNCS(strerror stpcpy strsep strlwr tcgetattr strtoul mmap)
784
AC_CHECK_FUNCS(strcasecmp strncasecmp ctermid times gmtime_r)
785
AC_CHECK_FUNCS(memmove gettimeofday getrusage setrlimit clock_gettime)
786
AC_CHECK_FUNCS(atexit raise getpagesize strftime nl_langinfo setlocale)
787
AC_CHECK_FUNCS(waitpid wait4 sigaction sigprocmask rand pipe stat getaddrinfo)
789
AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
791
# These are needed by libjnlib - fixme: we should have macros for them
792
AC_CHECK_FUNCS(memicmp stpcpy strlwr strtoul memmove stricmp strtol)
793
AC_CHECK_FUNCS(getrusage setrlimit stat setlocale)
794
AC_CHECK_FUNCS(flockfile funlockfile fopencookie funopen)
796
AC_REPLACE_FUNCS(vasprintf)
797
AC_REPLACE_FUNCS(mkdtemp)
798
AC_REPLACE_FUNCS(fseeko ftello)
799
AC_REPLACE_FUNCS(isascii)
800
AC_REPLACE_FUNCS(putc_unlocked)
801
AC_REPLACE_FUNCS(strsep)
802
AC_REPLACE_FUNCS(ttyname)
807
# check for gethrtime and run a testprogram to see whether
808
# it is broken. It has been reported that some Solaris and HP UX systems
811
# fixme: Do we need this - iirc, this is only used by libgcrypt.
813
AC_CACHE_CHECK([for gethrtime],
814
[gnupg_cv_func_gethrtime],
815
[AC_TRY_LINK([#include <sys/times.h>],[
819
[gnupg_cv_func_gethrtime=yes],
820
[gnupg_cv_func_gethrtime=no])
822
if test $gnupg_cv_func_gethrtime = yes; then
823
AC_DEFINE([HAVE_GETHRTIME], 1,
824
[Define if you have the `gethrtime(2)' function.])
825
AC_CACHE_CHECK([whether gethrtime is broken],
826
[gnupg_cv_func_broken_gethrtime],
828
#include <sys/times.h>
834
[gnupg_cv_func_broken_gethrtime=no],
835
[gnupg_cv_func_broken_gethrtime=yes],
836
[gnupg_cv_func_broken_gethrtime=assume-no])
838
if test $gnupg_cv_func_broken_gethrtime = yes; then
839
AC_DEFINE([HAVE_BROKEN_GETHRTIME], 1,
840
[Define if `gethrtime(2)' does not work correctly i.e. issues a SIGILL.])
846
GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
849
dnl Check whether we can use Linux capabilities as requested
851
# fixme: Still required?
853
if test "$use_capabilities" = "yes" ; then
855
AC_CHECK_HEADERS(sys/capability.h)
856
if test "$ac_cv_header_sys_capability_h" = "yes" ; then
857
AC_CHECK_LIB(cap, cap_init, ac_need_libcap=1)
858
if test "$ac_cv_lib_cap_cap_init" = "yes"; then
859
AC_DEFINE(USE_CAPABILITIES,1,
860
[define if capabilities should be used])
861
AC_SUBST(CAPLIBS,"-lcap")
865
if test "$use_capabilities" = "no" ; then
868
*** The use of capabilities on this system is not possible.
869
*** You need a recent Linux kernel and some patches:
870
*** fcaps-2.2.9-990610.patch (kernel patch for 2.2.9)
871
*** fcap-module-990613.tar.gz (kernel module)
872
*** libcap-1.92.tar.gz (user mode library and utilities)
873
*** And you have to configure the kernel with CONFIG_VFS_CAP_PLUGIN
874
*** set (filesystems menu). Be warned: This code is *really* ALPHA.
880
# Sanity check regex. Tests adapted from mutt.
882
AC_MSG_CHECKING([whether regular expression support is requested])
884
[ --disable-regex do not handle regular expressions in trust sigs],
885
use_regex=$enableval, use_regex=yes)
886
AC_MSG_RESULT($use_regex)
888
if test "$use_regex" = yes ; then
889
AC_MSG_CHECKING([whether the included regex lib is requested])
890
AC_ARG_WITH(included-regex,
891
[ --with-included-regex use the included GNU regex library],
892
[gnupg_cv_included_regex=yes],[gnupg_cv_included_regex=no])
893
AC_MSG_RESULT($gnupg_cv_included_regex)
895
if test $gnupg_cv_included_regex = no ; then
896
# Does the system have regex functions at all?
897
AC_CHECK_FUNC(regcomp,gnupg_cv_included_regex=no,
898
gnupg_cv_included_regex=yes)
901
if test $gnupg_cv_included_regex = no ; then
902
AC_CACHE_CHECK([whether your system's regexp library is broken],
903
[gnupg_cv_regex_broken],
907
main() { regex_t blah ; regmatch_t p; p.rm_eo = p.rm_eo; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); }],
908
gnupg_cv_regex_broken=no, gnupg_cv_regex_broken=yes, gnupg_cv_regex_broken=yes))
910
if test $gnupg_cv_regex_broken = yes ; then
911
AC_MSG_WARN(your regex is broken - using the included GNU regex instead.)
912
gnupg_cv_included_regex=yes
916
if test $gnupg_cv_included_regex = yes; then
917
AC_DEFINE(USE_GNU_REGEX,1,[ Define if you want to use the included regex lib ])
918
AC_SUBST(REGEX_O,regex.o)
922
AC_DEFINE(DISABLE_REGEX,1,[ Define to disable regular expression support ])
925
dnl Do we have zlib? Must do it here because Solaris failed
926
dnl when compiling a conftest (due to the "-lz" from LIBS).
927
_cppflags="${CPPFLAGS}"
928
_ldflags="${LDFLAGS}"
931
[ --with-zlib=DIR use libz in DIR],[
932
if test -d "$withval"; then
933
CPPFLAGS="${CPPFLAGS} -I$withval/include"
934
LDFLAGS="${LDFLAGS} -L$withval/lib"
938
AC_CHECK_HEADER(zlib.h,
939
AC_CHECK_LIB(z, deflateInit2_,
941
CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
942
CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
946
# See wether we want to run the long test suite.
947
AC_ARG_WITH(pkits-tests,
948
AC_HELP_STRING([--with-pkits-tests],[run the PKITS based tests]),
949
[run_pkits_tests=$withval], [run_pkits_tests=no])
950
AM_CONDITIONAL(RUN_PKITS_TESTS, test "$run_pkits_tests" = "yes")
953
# Allow users to append something to the version string without
954
# flagging it as development version. The user version parts is
955
# considered everything after a dash.
956
if test "$development_version" != yes; then
960
if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
961
development_version=yes
964
if test "$development_version" = yes; then
965
AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
966
[Defined if this is not a regular release])
969
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
973
# Add some extra libs here so that previous tests don't fail for
974
# mysterious reasons - the final link step should bail out.
975
if test "$have_w32_system" = yes; then
980
if test "$GCC" = yes; then
981
if test "$USE_MAINTAINER_MODE" = "yes"; then
982
CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
983
CFLAGS="$CFLAGS -Wformat-nonliteral"
985
CFLAGS="$CFLAGS -Wall"
993
# We use jnlib, so tell other modules about it
994
AC_DEFINE(HAVE_JNLIB_LOGGING, 1,
995
[Defined if jnlib style logging functions are available])
997
# For W32 we need to use our Pth emulation code
998
if test "$have_w32_system" = yes; then
999
AC_CONFIG_LINKS(pth.h:jnlib/w32-pth.h)
1004
# Decide what to build
1007
if test $have_ksba = no; then
1012
build_agent_threaded=""
1013
if test "$build_agent" = "yes"; then
1014
if test $have_pth = no; then
1015
build_agent_threaded="(not multi-threaded)"
1020
build_scdaemon_extra=""
1021
if test "$build_scdaemon" = "yes"; then
1023
if test $have_pth = no; then
1024
build_scdaemon_extra="not multi-threaded"
1028
if test $have_opensc = no; then
1029
build_scdaemon_extra="${build_scdaemon_extra}${tmp}no pkcs#15"
1032
if test -n "$build_scdaemon_extra"; then
1033
build_scdaemon_extra="(${build_scdaemon_extra})"
1038
if test "$build_agent_only" = "yes" ; then
1045
AM_CONDITIONAL(BUILD_GPG, test "$build_gpg" = "yes")
1046
AM_CONDITIONAL(BUILD_GPGSM, test "$build_gpgsm" = "yes")
1047
AM_CONDITIONAL(BUILD_AGENT, test "$build_agent" = "yes")
1048
AM_CONDITIONAL(BUILD_SCDAEMON, test "$build_scdaemon" = "yes")
1053
# Print errors here so that they are visible all
1054
# together and the user can acquire them all together.
1057
if test "$have_gpg_error" = "no"; then
1061
*** You need libgpg-error to build this program.
1062
** This library is for example available at
1063
*** ftp://ftp.gnupg.org/gcrypt/alpha/libgpg-error
1064
*** (at least version $NEED_GPG_ERROR_VERSION is required.)
1067
if test "$have_libgcrypt" = "no"; then
1071
*** You need libgcrypt to build this program.
1072
** This library is for example available at
1073
*** ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/
1074
*** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API) is required.)
1077
if test "$have_libassuan" = "no"; then
1081
*** You need libassuan to build this program.
1082
*** This library is for example available at
1083
*** ftp://ftp.gnupg.org/gcrypt/alpha/libassuan/
1084
*** (at least version $NEED_LIBASSUAN_VERSION is required).
1087
if test "$have_ksba" = "no"; then
1090
*** You need libksba to build this program.
1091
*** This library is for example available at
1092
*** ftp://ftp.gnupg.org/gcrypt/alpha/libksba/
1093
*** (at least version $NEED_KSBA_VERSION is required).
1096
if test "$missing_pth" = "yes"; then
1099
*** It is strongly suggested to build with support for the
1100
*** GNU Portable Threads Library (Pth). Please install this
1101
*** library first or use --disable-threads to allow building
1102
*** anyway. The library is for example available at
1103
*** ftp://ftp.gnu.org/gnu/pth/
1104
*** On a Debian GNU/Linux system you can install it using
1105
*** apt-get install libpth-dev
1107
if test "$enable_threads" != "no"; then
1112
if test "$die" = "yes"; then
1115
*** Required libraries not found. Please consult the above messages
1116
*** and install them before running configure again.
1122
AC_CONFIG_FILES([ m4/Makefile
1139
#tests/pkits/Makefile
1145
GnuPG v${VERSION} has been configured as follows:
1147
Platform: $PRINTABLE_OS_NAME ($host)
1150
S/MIME: $build_gpgsm
1151
Agent: $build_agent $build_agent_threaded
1152
Smartcard: $build_scdaemon $build_scdaemon_extra
1154
Protect tool: $show_gnupg_protect_tool_pgm
1155
Default agent: $show_gnupg_agent_pgm
1156
Default pinentry: $show_gnupg_pinentry_pgm
1157
Default scdaemon: $show_gnupg_scdaemon_pgm
1158
Default dirmngr: $show_gnupg_dirmngr_pgm
1160
PKITS based tests: $run_pkits_tests