~ubuntu-branches/ubuntu/dapper/gnupg2/dapper

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Mueller
  • Date: 2005-03-29 10:30:32 UTC
  • Revision ID: james.westby@ubuntu.com-20050329103032-sj42n2ain3ipx310
Tags: upstream-1.9.15
ImportĀ upstreamĀ versionĀ 1.9.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# configure.ac - for GnuPG 1.9
 
2
# Copyright (C) 1998, 1999, 2000, 2001, 2002,
 
3
#               2003, 2004 Free Software Foundation, Inc.
 
4
 
5
# This file is part of GnuPG.
 
6
 
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.
 
11
 
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.
 
16
 
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
 
20
 
 
21
# Process this file with autoconf to produce a configure script.
 
22
AC_PREREQ(2.52)
 
23
min_automake_version="1.9.3"
 
24
 
 
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
 
30
# sufficient.
 
31
development_version=yes
 
32
NEED_GPG_ERROR_VERSION=1.0
 
33
 
 
34
NEED_LIBGCRYPT_API=1
 
35
NEED_LIBGCRYPT_VERSION=1.1.94
 
36
 
 
37
NEED_LIBASSUAN_VERSION=0.6.9
 
38
 
 
39
NEED_KSBA_VERSION=0.9.7
 
40
 
 
41
NEED_OPENSC_VERSION=0.8.0
 
42
 
 
43
 
 
44
 
 
45
PACKAGE=$PACKAGE_NAME
 
46
PACKAGE_GT=${PACKAGE_NAME}2
 
47
VERSION=$PACKAGE_VERSION
 
48
 
 
49
AC_CONFIG_AUX_DIR(scripts)
 
50
AC_CONFIG_SRCDIR(sm/gpgsm.c)
 
51
AM_CONFIG_HEADER(config.h)
 
52
AC_CANONICAL_TARGET()
 
53
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
 
54
 
 
55
AC_GNU_SOURCE
 
56
 
 
57
# Some status variables to give feedback at the end of a configure run
 
58
have_gpg_error=no
 
59
have_libgcrypt=no 
 
60
have_libassuan=no
 
61
have_ksba=no
 
62
have_opensc=no
 
63
have_pth=no
 
64
 
 
65
GNUPG_BUILD_PROGRAM(gpg, yes)
 
66
GNUPG_BUILD_PROGRAM(gpgsm, yes)
 
67
GNUPG_BUILD_PROGRAM(agent, yes)
 
68
GNUPG_BUILD_PROGRAM(scdaemon, yes)
 
69
 
 
70
 
 
71
AC_SUBST(PACKAGE)
 
72
AC_SUBST(PACKAGE_GT)
 
73
AC_SUBST(VERSION)
 
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",
 
79
                                        [Bug report address])
 
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])
 
84
 
 
85
 
 
86
 
 
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"
 
99
 
 
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"
 
107
 
 
108
 
 
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"
 
116
 
 
117
 
 
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"
 
125
 
 
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"
 
134
 
 
135
 
 
136
 
 
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)
 
143
 
 
144
 
 
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])
 
148
AC_ARG_ENABLE(exec,
 
149
    AC_HELP_STRING([--disable-exec],[disable all external program execution]),
 
150
    use_exec=$enableval)
 
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])
 
154
fi
 
155
 
 
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])
 
162
      fi],enableval=yes)
 
163
  gnupg_cv_enable_photo_viewers=$enableval
 
164
  AC_MSG_RESULT($enableval)
 
165
 
 
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
 
171
           withval=no
 
172
        elif test "$withval" != no ; then
 
173
           AC_DEFINE_UNQUOTED(FIXED_PHOTO_VIEWER,"$withval",
 
174
                            [if set, restrict photo-viewer to this])
 
175
        fi],withval=no)
 
176
    AC_MSG_RESULT($withval)
 
177
  fi
 
178
 
 
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])
 
185
      fi],enableval=yes)
 
186
  gnupg_cv_enable_keyserver_helpers=$enableval
 
187
  AC_MSG_RESULT($enableval)
 
188
 
 
189
  if test "$gnupg_cv_enable_keyserver_helpers" = yes ; then
 
190
    AC_MSG_CHECKING([whether LDAP keyserver support is requested])
 
191
    AC_ARG_ENABLE(ldap,
 
192
    [  --disable-ldap          disable LDAP keyserver interface],
 
193
        try_ldap=$enableval, try_ldap=yes)
 
194
    AC_MSG_RESULT($try_ldap)
 
195
 
 
196
    AC_MSG_CHECKING([whether HKP keyserver support is requested])
 
197
    AC_ARG_ENABLE(hkp,
 
198
    [  --disable-hkp           disable HKP keyserver interface],
 
199
        try_hkp=$enableval, try_hkp=yes)
 
200
    AC_MSG_RESULT($try_hkp)
 
201
 
 
202
    if test "$try_hkp" = yes ; then
 
203
      AC_SUBST(GPGKEYS_HKP,"gpgkeys_hkp$EXEEXT")
 
204
    fi
 
205
 
 
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)
 
211
    fi
 
212
 
 
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])
 
218
        fi],enableval=yes)
 
219
    AC_MSG_RESULT($enableval)
 
220
  fi
 
221
 
 
222
dnl
 
223
dnl Check whether we want to use Linux capabilities
 
224
dnl
 
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)
 
230
 
 
231
 
 
232
AH_BOTTOM([
 
233
/* Some global constants. */
 
234
#ifdef HAVE_DRIVE_LETTERS
 
235
#define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
 
236
#elif defined(__VMS)
 
237
#define GNUPG_DEFAULT_HOMEDIR "/SYS\$LOGIN/gnupg" 
 
238
#else
 
239
#define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
 
240
#endif 
 
241
#define GNUPG_PRIVATE_KEYS_DIR "private-keys-v1.d"
 
242
 
 
243
/* Tell libgcrypt not to use its own libgpg-error implementation. */
 
244
#define USE_LIBGPG_ERROR 1
 
245
 
 
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
 
250
 
 
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 "\\"
 
257
#define EXTSEP_C '.'
 
258
#define EXTSEP_S "."
 
259
#define PATHSEP_C ';'
 
260
#define PATHSEP_S ";"
 
261
#define EXEEXT_S ".exe"
 
262
#else
 
263
#define DIRSEP_C '/'
 
264
#define DIRSEP_S "/"
 
265
#define EXTSEP_C '.'
 
266
#define EXTSEP_S "."
 
267
#define PATHSEP_C ':'
 
268
#define PATHSEP_S ":"
 
269
#define EXEEXT_S ""
 
270
#endif
 
271
 
 
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 '-'
 
279
 
 
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"
 
289
#endif
 
290
 
 
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 )
 
294
#endif
 
295
#ifndef GNUPG_DEFAULT_PINENTRY
 
296
#define GNUPG_DEFAULT_PINENTRY ( GNUPG_BINDIR DIRSEP_S "pinentry" EXEEXT_S )
 
297
#endif
 
298
#ifndef GNUPG_DEFAULT_SCDAEMON
 
299
#define GNUPG_DEFAULT_SCDAEMON ( GNUPG_BINDIR DIRSEP_S "scdaemon" EXEEXT_S )
 
300
#endif
 
301
#ifndef GNUPG_DEFAULT_DIRMNGR
 
302
#define GNUPG_DEFAULT_DIRMNGR  ( GNUPG_BINDIR DIRSEP_S "dirmngr" EXEEXT_S )
 
303
#endif
 
304
#ifndef GNUPG_DEFAULT_PROTECT_TOOL
 
305
#define GNUPG_DEFAULT_PROTECT_TOOL \
 
306
                    ( GNUPG_LIBEXECDIR DIRSEP_S "gpg-protect-tool" EXEEXT_S )
 
307
#endif
 
308
 
 
309
 
 
310
/* Derive some other constants. */
 
311
#if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
 
312
#define EXEC_TEMPFILE_ONLY
 
313
#endif
 
314
 
 
315
])
 
316
 
 
317
AM_MAINTAINER_MODE
 
318
 
 
319
# Checks for programs.
 
320
AC_PROG_MAKE_SET
 
321
AM_SANITY_CHECK
 
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)
 
328
AC_PROG_AWK
 
329
AC_PROG_CC
 
330
AC_PROG_CPP
 
331
AC_PROG_INSTALL
 
332
AC_PROG_LN_S
 
333
AC_PROG_MAKE_SET
 
334
AC_PROG_RANLIB
 
335
AC_CHECK_TOOL(AR, ar, :)
 
336
AC_PATH_PROG(PERL,"perl")
 
337
AC_ISC_POSIX
 
338
AC_SYS_LARGEFILE
 
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)
 
341
GNUPG_CHECK_FAQPROG
 
342
GNUPG_CHECK_DOCBOOK_TO_TEXI
 
343
 
 
344
 
 
345
try_gettext=yes
 
346
have_dosish_system=no
 
347
have_w32_system=no
 
348
case "${host}" in
 
349
    *-mingw32*)
 
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
 
361
        have_w32_system=yes
 
362
        try_gettext="no"
 
363
        ;;
 
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
 
369
        try_gettext="no"
 
370
        ;;
 
371
 
 
372
    i?86-*-msdosdjgpp*)
 
373
        # DOS with the DJGPP environment
 
374
        ac_cv_have_dev_random=no
 
375
        AC_DEFINE(HAVE_DRIVE_LETTERS)
 
376
        have_dosish_system=yes
 
377
        try_gettext="no"
 
378
        ;;
 
379
 
 
380
    *-*-freebsd*)
 
381
       # FreeBSD
 
382
       CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 
383
       LDFLAGS="$LDFLAGS -L/usr/local/lib"
 
384
       ;;
 
385
 
 
386
    *-*-hpux*)
 
387
        if test -z "$GCC" ; then
 
388
            CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
 
389
        fi
 
390
        ;;
 
391
    *-dec-osf4*)
 
392
        if test -z "$GCC" ; then
 
393
            # Suppress all warnings
 
394
            # to get rid of the unsigned/signed char mismatch warnings.
 
395
            CFLAGS="$CFLAGS -w"
 
396
        fi
 
397
        ;;
 
398
    *-dec-osf5*)
 
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"
 
405
        fi
 
406
        ;;
 
407
    m68k-atari-mint)
 
408
        ;;
 
409
    *)
 
410
       ;;
 
411
esac
 
412
 
 
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
 
417
              no file modes])
 
418
fi
 
419
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
 
420
 
 
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])
 
423
fi
 
424
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
 
425
 
 
426
 
 
427
 
 
428
#
 
429
# Checks for libraries.
 
430
#
 
431
 
 
432
 
 
433
#
 
434
# libgpg-error is a library with error codes shared between GnuPG
 
435
# related projects.
 
436
#
 
437
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
 
438
                  have_gpg_error=yes,have_gpg_error=no)
 
439
 
 
440
 
 
441
#
 
442
# Libgcrypt is our generic crypto library
 
443
#
 
444
AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
 
445
        have_libgcrypt=yes,have_libgcrypt=no)
 
446
 
 
447
 
 
448
#
 
449
# libassuan is used for IPC
 
450
#
 
451
AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_VERSION",
 
452
                  have_libassuan=yes,have_libassuan=no)
 
453
 
 
454
 
 
455
#
 
456
# libksba is our X.509 support library
 
457
#
 
458
AM_PATH_KSBA("$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)
 
459
 
 
460
#
 
461
# libusb allows us to use the integrated CCID smartcard reader driver.
 
462
#
 
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])
 
467
             ])
 
468
AC_SUBST(LIBUSB_LIBS)
 
469
AC_CHECK_FUNCS(usb_create_match)
 
470
 
 
471
#
 
472
# Check wether it is necessary to link against libdl.
 
473
#
 
474
LIBS=""
 
475
AC_SEARCH_LIBS(dlopen, c dl,,,)
 
476
DL_LIBS=$LIBS
 
477
AC_SUBST(DL_LIBS)
 
478
 
 
479
#
 
480
# OpenSC is needed by the SCdaemon - if it is not availbale we can only
 
481
# build a limited SCdaemon
 
482
#
 
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])
 
487
fi
 
488
AM_CONDITIONAL(HAVE_OPENSC, test "$have_opensc" = "yes")
 
489
 
 
490
#
 
491
# Check whether the (highly desirable) GNU Pth library is available
 
492
# Note, that we include a Pth emulation for W32.
 
493
#
 
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"
 
500
fi
 
501
AC_PATH_PROG(PTH_CONFIG, pth-config, no)
 
502
if test "$have_w32_system" = no; then
 
503
 if test "$PTH_CONFIG" = "no"; then
 
504
    AC_MSG_WARN([[
 
505
***
 
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
 
511
***]])
 
512
 else
 
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])
 
520
  fi
 
521
 fi
 
522
else 
 
523
 have_pth=yes
 
524
 PTH_CFLAGS=""
 
525
 PTH_LIBS=""
 
526
 AC_DEFINE(USE_GNU_PTH, 1)
 
527
fi
 
528
AC_SUBST(PTH_CFLAGS)
 
529
AC_SUBST(PTH_LIBS)
 
530
 
 
531
AC_ARG_ENABLE(threads,
 
532
    AC_HELP_STRING([--disable-threads],[allow building without Pth support])
 
533
             )
 
534
 
 
535
 
 
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
 
539
dnl be detected.
 
540
 
 
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"]))
 
545
 
 
546
dnl Now try for the resolver functions so we can use DNS SRV
 
547
 
 
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)
 
551
 
 
552
if test x"$try_hkp" = xyes && test x"$use_dns_srv" = xyes ; then
 
553
  _srv_save_libs=$LIBS
 
554
  LIBS=""
 
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))
 
562
 
 
563
  if test x"$use_dns_srv" = xyes ; then
 
564
     AC_DEFINE(USE_DNS_SRV,1,[define to use DNS SRV])
 
565
     SRVLIBS=$LIBS
 
566
  else
 
567
     AC_MSG_WARN([Resolver functions not found.  Disabling DNS SRV.])
 
568
  fi
 
569
  LIBS=$_srv_save_libs
 
570
fi
 
571
 
 
572
AC_SUBST(SRVLIBS)
 
573
 
 
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"
 
579
 
 
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"
 
584
 
 
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])
 
589
 
 
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])
 
596
    fi
 
597
 
 
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])
 
600
    fi
 
601
 
 
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"
 
606
 
 
607
       AC_MSG_CHECKING([whether LDAP supports ldap_get_option])
 
608
 
 
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])
 
614
        else
 
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])
 
619
       fi
 
620
 
 
621
       AC_MSG_RESULT([$gnupg_cv_func_ldap_get_option])
 
622
 
 
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])
 
625
       else
 
626
          AC_MSG_CHECKING([whether LDAP supports ld_errno])
 
627
 
 
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])
 
633
           else
 
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])
 
638
          fi
 
639
 
 
640
          AC_MSG_RESULT([$gnupg_cv_func_ldap_ld_errno])
 
641
 
 
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])
 
644
          fi
 
645
       fi
 
646
    fi
 
647
 
 
648
    LIBS=$_ldap_save_libs
 
649
 
 
650
    if test "$GPGKEYS_LDAP" != "" ; then break; fi
 
651
  done
 
652
fi
 
653
 
 
654
AC_SUBST(GPGKEYS_LDAP)
 
655
AC_SUBST(LDAPLIBS)
 
656
 
 
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".
 
660
 
 
661
if test "$try_mailto" = yes ; then
 
662
  AC_ARG_WITH(mailprog,[  --with-mailprog=NAME    use "NAME -t" for mail transport],,with_mailprog=yes)
 
663
 
 
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"
 
668
    fi
 
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"
 
674
  fi
 
675
fi
 
676
 
 
677
AC_SUBST(GPGKEYS_MAILTO)
 
678
 
 
679
case "${host}" in
 
680
    *-mingw32*)
 
681
        PRINTABLE_OS_NAME="MingW32"
 
682
        ;;
 
683
    *-*-cygwin*)
 
684
        PRINTABLE_OS_NAME="Cygwin"
 
685
        ;;
 
686
    i?86-emx-os2 | i?86-*-os2*emx )
 
687
        PRINTABLE_OS_NAME="OS/2"
 
688
        ;;
 
689
    i?86-*-msdosdjgpp*)
 
690
        PRINTABLE_OS_NAME="MSDOS/DJGPP"
 
691
        try_dynload=no
 
692
        ;;
 
693
    *-linux*)
 
694
        PRINTABLE_OS_NAME="GNU/Linux"
 
695
        ;;
 
696
    *)
 
697
        PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
 
698
        ;;
 
699
esac
 
700
AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
 
701
                   [A human readable text with the name of the OS])
 
702
 
 
703
 
 
704
AM_GNU_GETTEXT_VERSION(0.14.1)
 
705
if test "$try_gettext" = yes; then
 
706
  AM_GNU_GETTEXT(,[need-ngettext])
 
707
 
 
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.
 
711
 
 
712
  AC_CHECK_FUNCS(strchr)
 
713
else
 
714
  USE_NLS=no
 
715
  USE_INCLUDED_LIBINTL=no
 
716
  BUILD_INCLUDED_LIBINTL=no
 
717
  AC_SUBST(USE_NLS)
 
718
  AC_SUBST(USE_INCLUDED_LIBINTL)
 
719
  AC_SUBST(BUILD_INCLUDED_LIBINTL)
 
720
fi
 
721
 
 
722
# Checks for header files.
 
723
AC_HEADER_STDC
 
724
AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h)
 
725
 
 
726
# Checks for typedefs, structures, and compiler characteristics.
 
727
AC_C_CONST
 
728
AC_C_INLINE
 
729
AC_TYPE_SIZE_T
 
730
AC_TYPE_SIGNAL
 
731
AC_DECL_SYS_SIGLIST
 
732
 
 
733
GNUPG_CHECK_ENDIAN
 
734
 
 
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)
 
740
 
 
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)
 
752
fi
 
753
 
 
754
 
 
755
 
 
756
 
 
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]);
 
761
fi
 
762
 
 
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])
 
769
else
 
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])
 
773
  fi
 
774
fi
 
775
 
 
776
# fixme: do we really need this - it should be encapsulated in libassuan
 
777
GNUPG_SYS_SO_PEERCRED
 
778
 
 
779
# Checks for library functions.
 
780
AC_FUNC_FSEEKO
 
781
AC_FUNC_VPRINTF
 
782
AC_FUNC_FORK
 
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)
 
788
 
 
789
AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
 
790
 
 
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)
 
795
 
 
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)
 
803
 
 
804
 
 
805
 
 
806
#
 
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 
 
809
# raise an SIGILL
 
810
#
 
811
#  fixme: Do we need this - iirc, this is only used by libgcrypt.
 
812
#
 
813
AC_CACHE_CHECK([for gethrtime], 
 
814
               [gnupg_cv_func_gethrtime],
 
815
               [AC_TRY_LINK([#include <sys/times.h>],[
 
816
                   hrtime_t tv;
 
817
                   tv = gethrtime();
 
818
                 ],
 
819
                 [gnupg_cv_func_gethrtime=yes],
 
820
                 [gnupg_cv_func_gethrtime=no])
 
821
               ])
 
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],
 
827
               [AC_TRY_RUN([
 
828
                   #include <sys/times.h>
 
829
                   int main () {
 
830
                   hrtime_t tv;
 
831
                   tv = gethrtime(); 
 
832
                 }
 
833
                 ],
 
834
                 [gnupg_cv_func_broken_gethrtime=no],
 
835
                 [gnupg_cv_func_broken_gethrtime=yes],
 
836
                 [gnupg_cv_func_broken_gethrtime=assume-no])
 
837
                ])
 
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.])
 
841
    fi
 
842
fi
 
843
     
 
844
 
 
845
GNUPG_CHECK_MLOCK
 
846
GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
 
847
 
 
848
dnl
 
849
dnl Check whether we can use Linux capabilities as requested
 
850
dnl
 
851
#  fixme: Still required?
 
852
#
 
853
if test "$use_capabilities" = "yes" ; then
 
854
use_capabilities=no
 
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")
 
862
     use_capabilities=yes
 
863
  fi
 
864
fi
 
865
if test "$use_capabilities" = "no" ; then
 
866
    AC_MSG_WARN([[
 
867
***
 
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.
 
875
***]])
 
876
fi
 
877
fi
 
878
 
 
879
 
 
880
# Sanity check regex.  Tests adapted from mutt.
 
881
 
 
882
AC_MSG_CHECKING([whether regular expression support is requested])
 
883
AC_ARG_ENABLE(regex,
 
884
[  --disable-regex         do not handle regular expressions in trust sigs],
 
885
     use_regex=$enableval, use_regex=yes)
 
886
AC_MSG_RESULT($use_regex)
 
887
 
 
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)
 
894
 
 
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)
 
899
  fi
 
900
 
 
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],
 
904
       AC_TRY_RUN([
 
905
#include <unistd.h>
 
906
#include <regex.h>
 
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))
 
909
 
 
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
 
913
     fi
 
914
  fi
 
915
 
 
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)
 
919
  fi
 
920
else
 
921
 
 
922
  AC_DEFINE(DISABLE_REGEX,1,[ Define to disable regular expression support ])
 
923
fi
 
924
 
 
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}"
 
929
 
 
930
AC_ARG_WITH(zlib,
 
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"
 
935
    fi
 
936
  ])
 
937
 
 
938
AC_CHECK_HEADER(zlib.h,
 
939
      AC_CHECK_LIB(z, deflateInit2_,
 
940
       LIBS="$LIBS -lz",
 
941
       CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
 
942
       CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
 
943
 
 
944
 
 
945
 
 
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")
 
951
 
 
952
 
 
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
 
957
  changequote(,)dnl
 
958
  tmp_pat='[a-zA-Z]'
 
959
  changequote([,])dnl
 
960
  if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
 
961
    development_version=yes
 
962
  fi
 
963
fi
 
964
if test "$development_version" = yes; then
 
965
    AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
 
966
            [Defined if this is not a regular release])
 
967
fi
 
968
 
 
969
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
 
970
 
 
971
GNUPG_CHECK_GNUMAKE
 
972
 
 
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
 
976
   W32LIBS="-lwsock32"
 
977
fi
 
978
 
 
979
 
 
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"
 
984
    else
 
985
        CFLAGS="$CFLAGS -Wall"
 
986
    fi
 
987
fi
 
988
 
 
989
AC_SUBST(NETLIBS)
 
990
AC_SUBST(W32LIBS)
 
991
 
 
992
 
 
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])
 
996
 
 
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)
 
1000
fi
 
1001
 
 
1002
 
 
1003
#
 
1004
# Decide what to build
 
1005
#
 
1006
missing_pth=no
 
1007
if test $have_ksba = no; then
 
1008
  build_gpgsm=no
 
1009
  build_scdaemon=no
 
1010
fi
 
1011
 
 
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)"
 
1016
     missing_pth=yes
 
1017
  fi
 
1018
fi
 
1019
 
 
1020
build_scdaemon_extra=""
 
1021
if test "$build_scdaemon" = "yes"; then
 
1022
  tmp=""
 
1023
  if test $have_pth = no; then
 
1024
     build_scdaemon_extra="not multi-threaded"
 
1025
     tmp=", "
 
1026
     missing_pth=yes
 
1027
  fi
 
1028
  if test $have_opensc = no; then
 
1029
     build_scdaemon_extra="${build_scdaemon_extra}${tmp}no pkcs#15"
 
1030
     tmp=", "
 
1031
  fi      
 
1032
  if test -n "$build_scdaemon_extra"; then
 
1033
     build_scdaemon_extra="(${build_scdaemon_extra})"
 
1034
  fi
 
1035
fi
 
1036
 
 
1037
 
 
1038
if test "$build_agent_only" = "yes" ; then
 
1039
  build_gpg=no
 
1040
  build_gpgsm=no
 
1041
  build_scdaemon=no
 
1042
fi
 
1043
 
 
1044
 
 
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")
 
1049
 
 
1050
 
 
1051
 
 
1052
#
 
1053
# Print errors here so that they are visible all
 
1054
# together and the user can acquire them all together.
 
1055
#
 
1056
die=no
 
1057
if test "$have_gpg_error" = "no"; then
 
1058
   die=yes
 
1059
   AC_MSG_NOTICE([[
 
1060
***  
 
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.)
 
1065
***]])
 
1066
fi
 
1067
if test "$have_libgcrypt" = "no"; then
 
1068
   die=yes
 
1069
   AC_MSG_NOTICE([[
 
1070
***  
 
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.)
 
1075
***]])
 
1076
fi
 
1077
if test "$have_libassuan" = "no"; then
 
1078
   die=yes
 
1079
   AC_MSG_NOTICE([[
 
1080
***
 
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).
 
1085
***]])
 
1086
fi
 
1087
if test "$have_ksba" = "no"; then
 
1088
    AC_MSG_NOTICE([[
 
1089
***
 
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).
 
1094
***]])
 
1095
fi
 
1096
if test "$missing_pth" = "yes"; then
 
1097
    AC_MSG_NOTICE([[
 
1098
***
 
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
 
1106
***]])
 
1107
  if test "$enable_threads" != "no"; then
 
1108
     die=yes
 
1109
  fi
 
1110
fi
 
1111
 
 
1112
if test "$die" = "yes"; then
 
1113
    AC_MSG_ERROR([[
 
1114
***
 
1115
*** Required libraries not found. Please consult the above messages
 
1116
*** and install them before running configure again.
 
1117
***]])
 
1118
fi
 
1119
 
 
1120
 
 
1121
 
 
1122
AC_CONFIG_FILES([ m4/Makefile 
 
1123
Makefile
 
1124
po/Makefile.in
 
1125
intl/Makefile
 
1126
jnlib/Makefile
 
1127
common/Makefile
 
1128
kbx/Makefile
 
1129
g10/Makefile
 
1130
sm/Makefile
 
1131
agent/Makefile
 
1132
scd/Makefile
 
1133
tools/Makefile
 
1134
doc/Makefile
 
1135
tests/Makefile
 
1136
])
 
1137
AC_OUTPUT
 
1138
 
 
1139
#tests/pkits/Makefile
 
1140
 
 
1141
 
 
1142
 
 
1143
 
 
1144
echo "
 
1145
        GnuPG v${VERSION} has been configured as follows:
 
1146
        
 
1147
        Platform:  $PRINTABLE_OS_NAME ($host)
 
1148
 
 
1149
        OpenPGP:   $build_gpg
 
1150
        S/MIME:    $build_gpgsm
 
1151
        Agent:     $build_agent $build_agent_threaded
 
1152
        Smartcard: $build_scdaemon $build_scdaemon_extra
 
1153
 
 
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
 
1159
 
 
1160
        PKITS based tests: $run_pkits_tests
 
1161
"
 
1162