~ubuntu-branches/ubuntu/precise/gnupg2/precise-security

« back to all changes in this revision

Viewing changes to .pc/Add-build-and-runtime-support-for-larger-RSA-key.patch/configure.ac

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-03-27 08:20:03 UTC
  • Revision ID: package-import@ubuntu.com-20150327082003-doob38ydqdxubnf1
Tags: 2.0.17-2ubuntu2.12.04.6
* Screen responses from keyservers (LP: #1409117)
  - d/p/0001-Screen-keyserver-responses.patch
  - d/p/0002-Make-screening-of-keyserver-result-work-with-multi-k.patch
  - d/p/0003-Add-kbnode_t-for-easier-backporting.patch
  - d/p/0004-gpg-Fix-regression-due-to-the-keyserver-import-filte.patch
* Fix large key size regression from CVE-2014-5270 changes (LP: #1371766)
  - d/p/Add-build-and-runtime-support-for-larger-RSA-key.patch
  - debian/rules: build with --enable-large-secmem
* SECURITY UPDATE: invalid memory read via invalid keyring
  - debian/patches/CVE-2015-1606.patch: skip all packets not allowed in
    a keyring in g10/keyring.c.
  - CVE-2015-1606
* SECURITY UPDATE: memcpy with overlapping ranges
  - debian/patches/CVE-2015-1607.patch: use inline functions to convert
    buffer data to scalars in common/iobuf.c, g10/build-packet.c,
    g10/getkey.c, g10/keygen.c, g10/keyid.c, g10/main.h, g10/misc.c,
    g10/parse-packet.c, g10/tdbio.c, g10/trustdb.c, include/host2net.h,
    kbx/keybox-dump.c, kbx/keybox-openpgp.c, kbx/keybox-search.c,
    kbx/keybox-update.c, scd/apdu.c, scd/app-openpgp.c,
    scd/ccid-driver.c, scd/pcsc-wrapper.c, tools/ccidmon.c.
  - CVE-2015-1607

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# configure.ac - for GnuPG 2.0
 
2
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 
3
#               2006, 2007, 2008, 2010, 2011 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 3 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, see <http://www.gnu.org/licenses/>.
 
19
 
 
20
# Process this file with autoconf to produce a configure script.
 
21
AC_PREREQ(2.61)
 
22
min_automake_version="1.10"
 
23
 
 
24
# Remember to change the version number immediately *after* a release.
 
25
# Set my_issvn to "yes" for non-released code.  Remember to run an
 
26
# "svn up" and "autogen.sh" right before creating a distribution.
 
27
m4_define([my_version], [2.0.17])
 
28
m4_define([my_issvn], [no])
 
29
 
 
30
m4_define([svn_revision], m4_esyscmd([printf "%d" $(svn info 2>/dev/null \
 
31
          | sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
 
32
m4_define([git_revision], m4_esyscmd([git branch -v 2>/dev/null \
 
33
          | awk '/^\* / {printf "%s",$3}']))
 
34
AC_INIT([gnupg2], 
 
35
        [my_version[]m4_if(my_issvn,[yes],
 
36
        [m4_if(git_revision,[],[-svn[]svn_revision],[-git[]git_revision])])],
 
37
        [http://bugs.gnupg.org])
 
38
# Set development_version to yes if the minor number is odd or you
 
39
# feel that the default check for a development version is not
 
40
# sufficient.
 
41
development_version=no
 
42
 
 
43
NEED_GPG_ERROR_VERSION=1.7
 
44
 
 
45
NEED_LIBGCRYPT_API=1
 
46
NEED_LIBGCRYPT_VERSION=1.4.0
 
47
 
 
48
NEED_LIBASSUAN_API=2
 
49
NEED_LIBASSUAN_VERSION=2.0.0
 
50
 
 
51
NEED_KSBA_API=1
 
52
NEED_KSBA_VERSION=1.0.7
 
53
 
 
54
 
 
55
PACKAGE=$PACKAGE_NAME
 
56
PACKAGE_GT=${PACKAGE_NAME}
 
57
VERSION=$PACKAGE_VERSION
 
58
 
 
59
AC_CONFIG_AUX_DIR(scripts)
 
60
AC_CONFIG_SRCDIR(sm/gpgsm.c)
 
61
AM_CONFIG_HEADER(config.h)
 
62
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
 
63
AC_CANONICAL_HOST
 
64
AB_INIT
 
65
 
 
66
AC_GNU_SOURCE
 
67
 
 
68
# Some status variables.
 
69
have_gpg_error=no
 
70
have_libgcrypt=no 
 
71
have_libassuan=no
 
72
have_ksba=no
 
73
have_pth=no
 
74
have_libusb=no
 
75
have_adns=no
 
76
 
 
77
use_bzip2=yes
 
78
use_exec=yes
 
79
disable_keyserver_path=no
 
80
use_ccid_driver=yes
 
81
use_standard_socket=no
 
82
 
 
83
GNUPG_BUILD_PROGRAM(gpg, yes)
 
84
GNUPG_BUILD_PROGRAM(gpgsm, yes)
 
85
GNUPG_BUILD_PROGRAM(agent, yes)
 
86
GNUPG_BUILD_PROGRAM(scdaemon, yes)
 
87
GNUPG_BUILD_PROGRAM(tools, yes)
 
88
GNUPG_BUILD_PROGRAM(doc, yes)
 
89
GNUPG_BUILD_PROGRAM(symcryptrun, no)
 
90
GNUPG_BUILD_PROGRAM(gpgtar, no)
 
91
 
 
92
 
 
93
AC_SUBST(PACKAGE)
 
94
AC_SUBST(PACKAGE_GT)
 
95
AC_SUBST(VERSION)
 
96
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
 
97
AC_DEFINE_UNQUOTED(PACKAGE_GT, "$PACKAGE_GT",
 
98
                                [Name of this package for gettext])
 
99
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
 
100
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
 
101
                                        [Bug report address])
 
102
AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION",
 
103
                                       [Required version of Libgcrypt])
 
104
AC_DEFINE_UNQUOTED(NEED_KSBA_VERSION, "$NEED_KSBA_VERSION",
 
105
                                       [Required version of Libksba])
 
106
 
 
107
 
 
108
 
 
109
# The default is to use the modules from this package and the few
 
110
# other packages in a standard place; i.e where this package gets
 
111
# installed.  With these options it is possible to override these
 
112
# ${prefix} depended values with fixed paths, which can't be replaced
 
113
# at make time.  See also am/cmacros.am and the defaults in AH_BOTTOM.
 
114
AC_ARG_WITH(agent-pgm,
 
115
    [  --with-agent-pgm=PATH  Use PATH as the default for the agent)],
 
116
          GNUPG_AGENT_PGM="$withval", GNUPG_AGENT_PGM="" )
 
117
AC_SUBST(GNUPG_AGENT_PGM)
 
118
AM_CONDITIONAL(GNUPG_AGENT_PGM, test -n "$GNUPG_AGENT_PGM")
 
119
show_gnupg_agent_pgm="(default)"
 
120
test -n "$GNUPG_AGENT_PGM" && show_gnupg_agent_pgm="$GNUPG_AGENT_PGM"
 
121
 
 
122
AC_ARG_WITH(pinentry-pgm,
 
123
    [  --with-pinentry-pgm=PATH  Use PATH as the default for the pinentry)],
 
124
          GNUPG_PINENTRY_PGM="$withval", GNUPG_PINENTRY_PGM="" )
 
125
AC_SUBST(GNUPG_PINENTRY_PGM)
 
126
AM_CONDITIONAL(GNUPG_PINENTRY_PGM, test -n "$GNUPG_PINENTRY_PGM")
 
127
show_gnupg_pinentry_pgm="(default)"
 
128
test -n "$GNUPG_PINENTRY_PGM" && show_gnupg_pinentry_pgm="$GNUPG_PINENTRY_PGM"
 
129
 
 
130
 
 
131
AC_ARG_WITH(scdaemon-pgm,
 
132
    [  --with-scdaemon-pgm=PATH  Use PATH as the default for the scdaemon)],
 
133
          GNUPG_SCDAEMON_PGM="$withval", GNUPG_SCDAEMON_PGM="" )
 
134
AC_SUBST(GNUPG_SCDAEMON_PGM)
 
135
AM_CONDITIONAL(GNUPG_SCDAEMON_PGM, test -n "$GNUPG_SCDAEMON_PGM")
 
136
show_gnupg_scdaemon_pgm="(default)"
 
137
test -n "$GNUPG_SCDAEMON_PGM" && show_gnupg_scdaemon_pgm="$GNUPG_SCDAEMON_PGM"
 
138
 
 
139
 
 
140
AC_ARG_WITH(dirmngr-pgm,
 
141
    [  --with-dirmngr-pgm=PATH  Use PATH as the default for the dirmngr)],
 
142
          GNUPG_DIRMNGR_PGM="$withval", GNUPG_DIRMNGR_PGM="" )
 
143
AC_SUBST(GNUPG_DIRMNGR_PGM)
 
144
AM_CONDITIONAL(GNUPG_DIRMNGR_PGM, test -n "$GNUPG_DIRMNGR_PGM")
 
145
show_gnupg_dirmngr_pgm="(default)"
 
146
test -n "$GNUPG_DIRMNGR_PGM" && show_gnupg_dirmngr_pgm="$GNUPG_DIRMNGR_PGM"
 
147
 
 
148
AC_ARG_WITH(protect-tool-pgm,
 
149
    [  --with-protect-tool-pgm=PATH  Use PATH as the default for the protect-tool)],
 
150
          GNUPG_PROTECT_TOOL_PGM="$withval", GNUPG_PROTECT_TOOL_PGM="" )
 
151
AC_SUBST(GNUPG_PROTECT_TOOL_PGM)
 
152
AM_CONDITIONAL(GNUPG_PROTECT_TOOL_PGM, test -n "$GNUPG_PROTECT_TOOL_PGM")
 
153
show_gnupg_protect_tool_pgm="(default)"
 
154
test -n "$GNUPG_PROTECT_TOOL_PGM" \
 
155
      && show_gnupg_protect_tool_pgm="$GNUPG_PROTECT_TOOL_PGM"
 
156
 
 
157
 
 
158
# Some folks want to use only the agent from this packet.  Make it
 
159
# easier for them by providing the configure option
 
160
# --enable-only-agent.
 
161
AC_ARG_ENABLE(agent-only,
 
162
    AC_HELP_STRING([--enable-agent-only],[build only the gpg-agent]),
 
163
    build_agent_only=$enableval)
 
164
 
 
165
# SELinux support includes tracking of sensitive files to avoid
 
166
# leaking their contents through processing these files by gpg itself
 
167
AC_MSG_CHECKING([whether SELinux support is requested])
 
168
AC_ARG_ENABLE(selinux-support,
 
169
              AC_HELP_STRING([--enable-selinux-support],
 
170
                             [enable SELinux support]),
 
171
              selinux_support=$enableval, selinux_support=no)
 
172
AC_MSG_RESULT($selinux_support)
 
173
 
 
174
# Allow disabling of bzib2 support.
 
175
# It is defined only after we confirm the library is available later
 
176
AC_MSG_CHECKING([whether to enable the BZIP2 compression algorithm])
 
177
AC_ARG_ENABLE(bzip2,
 
178
   AC_HELP_STRING([--disable-bzip2],[disable the BZIP2 compression algorithm]),
 
179
   use_bzip2=$enableval)
 
180
AC_MSG_RESULT($use_bzip2)
 
181
 
 
182
# Configure option to allow or disallow execution of external
 
183
# programs, like a photo viewer.
 
184
AC_MSG_CHECKING([whether to enable external program execution])
 
185
AC_ARG_ENABLE(exec,
 
186
    AC_HELP_STRING([--disable-exec],[disable all external program execution]),
 
187
    use_exec=$enableval)
 
188
AC_MSG_RESULT($use_exec)
 
189
if test "$use_exec" = no ; then
 
190
    AC_DEFINE(NO_EXEC,1,[Define to disable all external program execution])
 
191
fi
 
192
 
 
193
if test "$use_exec" = yes ; then
 
194
  AC_MSG_CHECKING([whether to enable photo ID viewing])
 
195
  AC_ARG_ENABLE(photo-viewers,
 
196
      [  --disable-photo-viewers disable photo ID viewers],
 
197
      [if test "$enableval" = no ; then
 
198
         AC_DEFINE(DISABLE_PHOTO_VIEWER,1,[define to disable photo viewing])
 
199
      fi],enableval=yes)
 
200
  gnupg_cv_enable_photo_viewers=$enableval
 
201
  AC_MSG_RESULT($enableval)
 
202
 
 
203
  if test "$gnupg_cv_enable_photo_viewers" = yes ; then
 
204
    AC_MSG_CHECKING([whether to use a fixed photo ID viewer])
 
205
    AC_ARG_WITH(photo-viewer,
 
206
        [  --with-photo-viewer=FIXED_VIEWER  set a fixed photo ID viewer],
 
207
        [if test "$withval" = yes ; then
 
208
           withval=no
 
209
        elif test "$withval" != no ; then
 
210
           AC_DEFINE_UNQUOTED(FIXED_PHOTO_VIEWER,"$withval",
 
211
                            [if set, restrict photo-viewer to this])
 
212
        fi],withval=no)
 
213
    AC_MSG_RESULT($withval)
 
214
  fi
 
215
 
 
216
  AC_MSG_CHECKING([whether to enable external keyserver helpers])
 
217
  AC_ARG_ENABLE(keyserver-helpers,
 
218
      [  --disable-keyserver-helpers  disable all external keyserver support],
 
219
      [if test "$enableval" = no ; then
 
220
         AC_DEFINE(DISABLE_KEYSERVER_HELPERS,1,
 
221
                  [define to disable keyserver helpers])
 
222
      fi],enableval=yes)
 
223
  gnupg_cv_enable_keyserver_helpers=$enableval
 
224
  AC_MSG_RESULT($enableval)
 
225
 
 
226
  if test "$gnupg_cv_enable_keyserver_helpers" = yes ; then
 
227
    # LDAP is defined only after we confirm the library is available later
 
228
    AC_MSG_CHECKING([whether LDAP keyserver support is requested])
 
229
    AC_ARG_ENABLE(ldap,
 
230
      AC_HELP_STRING([--disable-ldap],[disable LDAP keyserver interface only]),
 
231
      try_ldap=$enableval, try_ldap=yes)
 
232
    AC_MSG_RESULT($try_ldap)
 
233
 
 
234
    AC_MSG_CHECKING([whether HKP keyserver support is requested])
 
235
    AC_ARG_ENABLE(hkp,
 
236
      AC_HELP_STRING([--disable-hkp],[disable HKP keyserver interface only]),
 
237
      try_hkp=$enableval, try_hkp=yes)
 
238
    AC_MSG_RESULT($try_hkp)
 
239
 
 
240
    AC_MSG_CHECKING([whether finger key fetching support is requested])
 
241
    AC_ARG_ENABLE(finger,
 
242
      AC_HELP_STRING([--disable-finger],
 
243
        [disable finger key fetching interface only]),
 
244
      try_finger=$enableval, try_finger=yes)
 
245
    AC_MSG_RESULT($try_finger)
 
246
 
 
247
    AC_MSG_CHECKING([whether generic object key fetching support is requested])
 
248
    AC_ARG_ENABLE(generic,
 
249
      AC_HELP_STRING([--disable-generic],
 
250
        [disable generic object key fetching interface only]),
 
251
      try_generic=$enableval, try_generic=yes)
 
252
    AC_MSG_RESULT($try_generic)
 
253
 
 
254
    AC_MSG_CHECKING([whether email keyserver support is requested])
 
255
    AC_ARG_ENABLE(mailto,
 
256
      AC_HELP_STRING([--enable-mailto],
 
257
        [enable email keyserver interface only]),
 
258
      try_mailto=$enableval, try_mailto=no)
 
259
    AC_MSG_RESULT($try_mailto)
 
260
  fi
 
261
 
 
262
  AC_MSG_CHECKING([whether keyserver exec-path is enabled])
 
263
  AC_ARG_ENABLE(keyserver-path,
 
264
      AC_HELP_STRING([--disable-keyserver-path],
 
265
           [disable the exec-path option for keyserver helpers]),
 
266
           [if test "$enableval" = no ; then
 
267
              disable_keyserver_path=yes
 
268
           fi],enableval=yes)
 
269
  AC_MSG_RESULT($enableval)
 
270
fi
 
271
 
 
272
 
 
273
#
 
274
# Check for the key/uid cache size.  This can't be zero, but can be
 
275
# pretty small on embedded systems.  This is used for the gpg part.
 
276
#
 
277
AC_MSG_CHECKING([for the size of the key and uid cache])
 
278
AC_ARG_ENABLE(key-cache,
 
279
        AC_HELP_STRING([--enable-key-cache=SIZE],
 
280
                       [Set key cache to SIZE (default 4096)]),,enableval=4096)
 
281
if test "$enableval" = "no"; then
 
282
   enableval=5
 
283
elif test "$enableval" = "yes" || test "$enableval" = ""; then
 
284
   enableval=4096
 
285
fi
 
286
changequote(,)dnl
 
287
key_cache_size=`echo "$enableval" | sed 's/[A-Za-z]//g'`
 
288
changequote([,])dnl
 
289
if test "$enableval" != "$key_cache_size" || test "$key_cache_size" -lt 5; then
 
290
   AC_MSG_ERROR([invalid key-cache size])
 
291
fi
 
292
AC_MSG_RESULT($key_cache_size)
 
293
AC_DEFINE_UNQUOTED(PK_UID_CACHE_SIZE,$key_cache_size,
 
294
                  [Size of the key and UID caches])
 
295
 
 
296
 
 
297
 
 
298
#
 
299
# Check whether we want to use Linux capabilities
 
300
#
 
301
AC_MSG_CHECKING([whether use of capabilities is requested])
 
302
AC_ARG_WITH(capabilities,
 
303
    [  --with-capabilities     use linux capabilities [default=no]],
 
304
[use_capabilities="$withval"],[use_capabilities=no])
 
305
AC_MSG_RESULT($use_capabilities)
 
306
 
 
307
 
 
308
#
 
309
# Allow disabling of internal CCID support.
 
310
# It is defined only after we confirm the library is available later
 
311
#
 
312
AC_MSG_CHECKING([whether to enable the internal CCID driver])
 
313
AC_ARG_ENABLE(ccid-driver,
 
314
              AC_HELP_STRING([--disable-ccid-driver],
 
315
                             [disable the internal CCID driver]),
 
316
              use_ccid_driver=$enableval)
 
317
AC_MSG_RESULT($use_ccid_driver)
 
318
 
 
319
 
 
320
#
 
321
# To avoid double inclusion of config.h which might happen at some
 
322
# places, we add the usual double inclusion protection at the top of
 
323
# config.h.
 
324
#
 
325
AH_TOP([
 
326
#ifndef GNUPG_CONFIG_H_INCLUDED
 
327
#define GNUPG_CONFIG_H_INCLUDED
 
328
])
 
329
 
 
330
#
 
331
# Stuff which goes at the bottom of config.h.
 
332
#
 
333
AH_BOTTOM([
 
334
/* This is the major version number of GnuPG so that
 
335
   source included files can test for this.  Note, that
 
336
   we use 2 here even for GnuPG 1.9.x. */
 
337
#define GNUPG_MAJOR_VERSION 2
 
338
 
 
339
/* Now to separate file name parts.
 
340
   Please note that the string version must not contain more
 
341
   than one character because the code assumes strlen()==1 */
 
342
#ifdef HAVE_DOSISH_SYSTEM
 
343
#define DIRSEP_C '\\'
 
344
#define DIRSEP_S "\\"
 
345
#define EXTSEP_C '.'
 
346
#define EXTSEP_S "."
 
347
#define PATHSEP_C ';'
 
348
#define PATHSEP_S ";"
 
349
#define EXEEXT_S ".exe"
 
350
#else
 
351
#define DIRSEP_C '/'
 
352
#define DIRSEP_S "/"
 
353
#define EXTSEP_C '.'
 
354
#define EXTSEP_S "."
 
355
#define PATHSEP_C ':'
 
356
#define PATHSEP_S ":"
 
357
#define EXEEXT_S ""
 
358
#endif
 
359
 
 
360
/* This is the same as VERSION, but should be overridden if the
 
361
   platform cannot handle things like dots '.' in filenames. Set
 
362
   SAFE_VERSION_DOT and SAFE_VERSION_DASH to whatever SAFE_VERSION
 
363
   uses for dots and dashes. */
 
364
#define SAFE_VERSION VERSION
 
365
#define SAFE_VERSION_DOT  '.'
 
366
#define SAFE_VERSION_DASH '-'
 
367
 
 
368
/* Some global constants. */
 
369
#ifdef HAVE_DRIVE_LETTERS
 
370
#define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
 
371
#elif defined(__VMS)
 
372
#define GNUPG_DEFAULT_HOMEDIR "/SYS\$LOGIN/gnupg" 
 
373
#else
 
374
#define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
 
375
#endif 
 
376
#define GNUPG_PRIVATE_KEYS_DIR "private-keys-v1.d"
 
377
 
 
378
/* For some systems (DOS currently), we hardcode the path here.  For
 
379
   POSIX systems the values are constructed by the Makefiles, so that
 
380
   the values may be overridden by the make invocations; this is to
 
381
   comply with the GNU coding standards. */
 
382
#ifdef HAVE_DRIVE_LETTERS
 
383
 /* FIXME: We need to use a function to determine these values depending 
 
384
    on the actual installation directory. */
 
385
#define GNUPG_BINDIR      "c:\\gnupg"
 
386
#define GNUPG_LIBEXECDIR  "c:\\gnupg"
 
387
#define GNUPG_LIBDIR      "c:\\gnupg"
 
388
#define GNUPG_DATADIR     "c:\\gnupg"
 
389
#define GNUPG_SYSCONFDIR  "c:\\gnupg"
 
390
#endif
 
391
 
 
392
/* Derive some other constants. */
 
393
#if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
 
394
#define EXEC_TEMPFILE_ONLY
 
395
#endif
 
396
 
 
397
 
 
398
/* We didn't define endianness above, so get it from OS macros.  This
 
399
   is intended for making fat binary builds on OS X. */
 
400
#if !defined(BIG_ENDIAN_HOST) && !defined(LITTLE_ENDIAN_HOST)
 
401
#if defined(__BIG_ENDIAN__)
 
402
#define BIG_ENDIAN_HOST 1
 
403
#elif defined(__LITTLE_ENDIAN__)
 
404
#define LITTLE_ENDIAN_HOST 1
 
405
#else
 
406
#error "No endianness found"
 
407
#endif
 
408
#endif
 
409
 
 
410
 
 
411
/* Hack used for W32: ldap.m4 also tests for the ASCII version of
 
412
   ldap_start_tls_s because that is the actual symbol used in the
 
413
   library.  winldap.h redefines it to our commonly used value,
 
414
   thus we define our usual macro here.  */
 
415
#ifdef HAVE_LDAP_START_TLS_SA
 
416
# ifndef HAVE_LDAP_START_TLS_S
 
417
#  define HAVE_LDAP_START_TLS_S 1
 
418
# endif
 
419
#endif
 
420
 
 
421
 
 
422
/* Tell libgcrypt not to use its own libgpg-error implementation. */
 
423
#define USE_LIBGPG_ERROR 1
 
424
 
 
425
/* We use jnlib, so tell other modules about it.  */
 
426
#define HAVE_JNLIB_LOGGING 1
 
427
 
 
428
/* Our HTTP code is used in estream mode.  */
 
429
#define HTTP_USE_ESTREAM 1
 
430
 
 
431
/* Under W32 we do an explicit socket initialization, thus we need to
 
432
   avoid the on-demand initialization which would also install an atexit
 
433
   handler.  */
 
434
#define HTTP_NO_WSASTARTUP
 
435
 
 
436
/* We always include support for the OpenPGP card.  */
 
437
#define ENABLE_CARD_SUPPORT 1
 
438
 
 
439
/* We don't want the old assuan codes anymore. */
 
440
#define _ASSUAN_ONLY_GPG_ERRORS 1
 
441
 
 
442
/* We explicitly need to disable PTH's soft mapping as Debian
 
443
   currently enables it by default for no reason. */
 
444
#define PTH_SYSCALL_SOFT 0
 
445
 
 
446
/* We want to use the libgcrypt provided memory allocation for
 
447
   asprintf.  */
 
448
#define _ESTREAM_PRINTF_MALLOC        gcry_malloc
 
449
#define _ESTREAM_PRINTF_FREE          gcry_free
 
450
#define _ESTREAM_PRINTF_EXTRA_INCLUDE "util.h"
 
451
 
 
452
#endif /*GNUPG_CONFIG_H_INCLUDED*/
 
453
])
 
454
 
 
455
 
 
456
AM_MAINTAINER_MODE
 
457
 
 
458
# Checks for programs.
 
459
AC_MSG_NOTICE([checking for programs])
 
460
AC_PROG_MAKE_SET
 
461
AM_SANITY_CHECK
 
462
missing_dir=`cd $ac_aux_dir && pwd`
 
463
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
 
464
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 
465
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
 
466
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
 
467
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
 
468
AC_PROG_AWK
 
469
AC_PROG_CC
 
470
AC_PROG_CPP
 
471
AM_PROG_CC_C_O
 
472
if test "x$ac_cv_prog_cc_c89" = "xno" ; then
 
473
  AC_MSG_ERROR([[No C-89 compiler found]])
 
474
fi
 
475
AC_PROG_INSTALL
 
476
AC_PROG_LN_S
 
477
AC_PROG_RANLIB
 
478
AC_CHECK_TOOL(AR, ar, :)
 
479
AC_PATH_PROG(PERL,"perl")
 
480
AC_CHECK_TOOL(WINDRES, windres, :)
 
481
AC_ISC_POSIX
 
482
gl_EARLY
 
483
AC_SYS_LARGEFILE
 
484
GNUPG_CHECK_FAQPROG
 
485
GNUPG_CHECK_USTAR
 
486
 
 
487
# We need to compile and run a program on the build machine.  A
 
488
# comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
 
489
# the AC archive is broken for autoconf 2.57.  Given that tehre is no
 
490
# newer version of that macro, we assume that it is also broken for
 
491
# autoconf 2.61 and thus we use a simple but usually sufficient
 
492
# approach.
 
493
AC_MSG_CHECKING(for cc for build)
 
494
if test "$cross_compiling" = "yes"; then
 
495
  CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
 
496
else
 
497
  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
 
498
fi
 
499
AC_MSG_RESULT($CC_FOR_BUILD)
 
500
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
 
501
 
 
502
 
 
503
 
 
504
try_gettext=yes
 
505
have_dosish_system=no
 
506
have_w32_system=no
 
507
use_simple_gettext=no
 
508
case "${host}" in
 
509
    *-mingw32*)
 
510
        # special stuff for Windoze NT
 
511
        ac_cv_have_dev_random=no
 
512
        AC_DEFINE(USE_ONLY_8DOT3,1,
 
513
                  [set this to limit filenames to the 8.3 format])
 
514
        AC_DEFINE(HAVE_DRIVE_LETTERS,1,
 
515
                  [defined if we must run on a stupid file system])
 
516
        AC_DEFINE(USE_SIMPLE_GETTEXT,1,
 
517
                  [because the Unix gettext has too much overhead on
 
518
                   MingW32 systems and these systems lack Posix functions,
 
519
                   we use a simplified version of gettext])
 
520
        disable_keyserver_path=yes
 
521
        have_dosish_system=yes
 
522
        have_w32_system=yes
 
523
        try_gettext="no"
 
524
        use_simple_gettext=yes
 
525
        ;;
 
526
    i?86-emx-os2 | i?86-*-os2*emx )
 
527
        # OS/2 with the EMX environment
 
528
        ac_cv_have_dev_random=no
 
529
        AC_DEFINE(HAVE_DRIVE_LETTERS)
 
530
        have_dosish_system=yes
 
531
        try_gettext="no"
 
532
        ;;
 
533
 
 
534
    i?86-*-msdosdjgpp*)
 
535
        # DOS with the DJGPP environment
 
536
        ac_cv_have_dev_random=no
 
537
        AC_DEFINE(HAVE_DRIVE_LETTERS)
 
538
        have_dosish_system=yes
 
539
        try_gettext="no"
 
540
        ;;
 
541
 
 
542
    *-*-freebsd*)
 
543
       # FreeBSD
 
544
       CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 
545
       LDFLAGS="$LDFLAGS -L/usr/local/lib"
 
546
       ;;
 
547
 
 
548
    *-*-hpux*)
 
549
        if test -z "$GCC" ; then
 
550
            CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
 
551
        fi
 
552
        ;;
 
553
    *-dec-osf4*)
 
554
        if test -z "$GCC" ; then
 
555
            # Suppress all warnings
 
556
            # to get rid of the unsigned/signed char mismatch warnings.
 
557
            CFLAGS="$CFLAGS -w"
 
558
        fi
 
559
        ;;
 
560
    *-dec-osf5*)
 
561
        if test -z "$GCC" ; then
 
562
            # Use the newer compiler `-msg_disable ptrmismatch1' to
 
563
            # get rid of the unsigned/signed char mismatch warnings.
 
564
            # Using this may hide other pointer mismatch warnings, but
 
565
            # it at least lets other warning classes through
 
566
            CFLAGS="$CFLAGS -msg_disable ptrmismatch1"
 
567
        fi
 
568
        ;;
 
569
    m68k-atari-mint)
 
570
        ;;
 
571
    *)
 
572
       ;;
 
573
esac
 
574
 
 
575
if test "$have_dosish_system" = yes; then
 
576
   AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
 
577
             [Defined if we run on some of the PCDOS like systems 
 
578
              (DOS, Windoze. OS/2) with special properties like
 
579
              no file modes])
 
580
fi
 
581
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
 
582
 
 
583
AM_CONDITIONAL(USE_SIMPLE_GETTEXT, test x"$use_simple_gettext" = xyes)
 
584
 
 
585
if test "$have_w32_system" = yes; then
 
586
   AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
 
587
fi
 
588
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
 
589
 
 
590
if test "$disable_keyserver_path" = yes; then
 
591
    AC_DEFINE(DISABLE_KEYSERVER_PATH,1,
 
592
              [Defined to disable exec-path for keyserver helpers])
 
593
fi
 
594
 
 
595
#
 
596
# Allows enabling the use of a standard socket by default This is
 
597
# gpg-agent's option --[no-]use-standard-socket.  For Windows we force
 
598
# the use of this.
 
599
#
 
600
AC_MSG_CHECKING([whether to use a standard socket by default])
 
601
AC_ARG_ENABLE(standard-socket,
 
602
              AC_HELP_STRING([--enable-standard-socket],
 
603
                             [use a standard socket for the agent by default]),
 
604
              use_standard_socket=$enableval)
 
605
tmp=""
 
606
if test "$use_standard_socket" != yes; then
 
607
  if test "$have_w32_system" = yes; then
 
608
    use_standard_socket=yes
 
609
    tmp=" (forced)"
 
610
  fi
 
611
fi
 
612
AC_MSG_RESULT($use_standard_socket$tmp)
 
613
if test "$use_standard_socket" = yes; then
 
614
  AC_DEFINE(USE_STANDARD_SOCKET,1,
 
615
            [Use a standard socket for the agent by default])
 
616
fi
 
617
 
 
618
 
 
619
# (These need to go after AC_PROG_CC so that $EXEEXT is defined)
 
620
AC_DEFINE_UNQUOTED(EXEEXT,"$EXEEXT",[The executable file extension, if any])
 
621
 
 
622
if test x"$try_hkp" = xyes ; then
 
623
  AC_SUBST(GPGKEYS_HKP,"gpg2keys_hkp$EXEEXT")
 
624
fi
 
625
 
 
626
if test x"$try_finger" = xyes ; then
 
627
  AC_SUBST(GPGKEYS_FINGER,"gpg2keys_finger$EXEEXT")
 
628
fi
 
629
 
 
630
 
 
631
 
 
632
#
 
633
# Checks for libraries.
 
634
#
 
635
AC_MSG_NOTICE([checking for libraries])
 
636
 
 
637
 
 
638
#
 
639
# libgpg-error is a library with error codes shared between GnuPG
 
640
# related projects.
 
641
#
 
642
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
 
643
                  have_gpg_error=yes,have_gpg_error=no)
 
644
 
 
645
 
 
646
#
 
647
# Libgcrypt is our generic crypto library
 
648
#
 
649
AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
 
650
        have_libgcrypt=yes,have_libgcrypt=no)
 
651
 
 
652
 
 
653
#
 
654
# libassuan is used for IPC
 
655
#
 
656
AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
 
657
                  have_libassuan=yes,have_libassuan=no)
 
658
if test "$have_libassuan" = "yes"; then
 
659
  AC_DEFINE_UNQUOTED(GNUPG_LIBASSUAN_VERSION, "$libassuan_version",
 
660
            [version of the libbassuan library])
 
661
fi
 
662
 
 
663
 
 
664
 
 
665
#
 
666
# libksba is our X.509 support library
 
667
#
 
668
AM_PATH_KSBA("$NEED_KSBA_API:$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)
 
669
 
 
670
 
 
671
#
 
672
# libusb allows us to use the integrated CCID smartcard reader driver.
 
673
#
 
674
# FiXME: Use GNUPG_CHECK_LIBUSB and modify to use separate AC_SUBSTs.
 
675
if test "$use_ccid_driver" = yes ; then
 
676
  AC_CHECK_LIB(usb, usb_bulk_write,
 
677
                [ LIBUSB_LIBS="$LIBUSB_LIBS -lusb"
 
678
                  AC_DEFINE(HAVE_LIBUSB,1,
 
679
                           [defined if libusb is available])
 
680
                  have_libusb=yes
 
681
               ])
 
682
  AC_CHECK_FUNCS(usb_create_match)
 
683
fi
 
684
AC_SUBST(LIBUSB_LIBS)
 
685
 
 
686
#
 
687
# Check wether it is necessary to link against libdl.
 
688
#
 
689
gnupg_dlopen_save_libs="$LIBS"
 
690
LIBS=""
 
691
AC_SEARCH_LIBS(dlopen, c dl,,,)
 
692
DL_LIBS=$LIBS
 
693
AC_SUBST(DL_LIBS)
 
694
LIBS="$gnupg_dlopen_save_libs"
 
695
 
 
696
#
 
697
# Checks for symcryptrun:
 
698
#
 
699
 
 
700
# libutil has openpty() and login_tty().
 
701
AC_CHECK_LIB(util, openpty,
 
702
              [ LIBUTIL_LIBS="$LIBUTIL_LIBS -lutil"
 
703
                AC_DEFINE(HAVE_LIBUTIL,1,
 
704
                         [defined if libutil is available])
 
705
             ])
 
706
AC_SUBST(LIBUTIL_LIBS)
 
707
 
 
708
# shred is used to clean temporary plain text files.
 
709
AC_PATH_PROG(SHRED, shred, /usr/bin/shred)
 
710
AC_DEFINE_UNQUOTED(SHRED,
 
711
        "${SHRED}", [defines the filename of the shred program])
 
712
 
 
713
 
 
714
 
 
715
#
 
716
# Check whether the GNU Pth library is available
 
717
# Note, that we include a Pth emulation for W32.
 
718
#
 
719
GNUPG_PATH_PTH
 
720
if test "$have_pth" = "yes"; then
 
721
  AC_DEFINE(USE_GNU_PTH, 1,
 
722
              [Defined if the GNU Portable Thread Library should be used])
 
723
else
 
724
  AC_MSG_WARN([[
 
725
***
 
726
*** To support concurrent access to the gpg-agent and the SCdaemon
 
727
*** we need the support of the GNU Portable Threads Library.
 
728
*** Download it from ftp://ftp.gnu.org/gnu/pth/
 
729
*** On a Debian GNU/Linux system you might want to try 
 
730
***   apt-get install libpth-dev
 
731
***]])
 
732
fi
 
733
 
 
734
 
 
735
AC_MSG_NOTICE([checking for networking options])
 
736
 
 
737
#
 
738
# Must check for network library requirements before doing link tests
 
739
# for ldap, for example. If ldap libs are static (or dynamic and without
 
740
# ELF runtime link paths), then link will fail and LDAP support won't
 
741
# be detected.
 
742
#
 
743
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
 
744
        [NETLIBS="-lnsl $NETLIBS"]))
 
745
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
 
746
        [NETLIBS="-lsocket $NETLIBS"]))
 
747
 
 
748
 
 
749
#
 
750
# Check for ADNS.
 
751
#
 
752
_cppflags="${CPPFLAGS}"
 
753
_ldflags="${LDFLAGS}"
 
754
AC_ARG_WITH(adns,
 
755
            AC_HELP_STRING([--with-adns=DIR],
 
756
                           [look for the adns library in DIR]),
 
757
            [if test -d "$withval"; then
 
758
               CPPFLAGS="${CPPFLAGS} -I$withval/include"
 
759
               LDFLAGS="${LDFLAGS} -L$withval/lib"
 
760
             fi])
 
761
if test "$with_adns" != "no"; then
 
762
  AC_CHECK_HEADERS(adns.h,
 
763
                AC_CHECK_LIB(adns, adns_init,
 
764
                             [have_adns=yes],
 
765
                             [CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}]),
 
766
                [CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}])
 
767
fi
 
768
if test "$have_adns" = "yes"; then
 
769
  ADNSLIBS="-ladns" 
 
770
fi
 
771
AC_SUBST(ADNSLIBS)
 
772
# Newer adns versions feature a free function to be used under W32.
 
773
AC_CHECK_FUNCS(adns_free)
 
774
 
 
775
 
 
776
#
 
777
# Now try for the resolver functions so we can use DNS for SRV, PA and CERT.
 
778
#
 
779
if test x"$try_hkp" = xyes || test x"$try_http" = xyes ; then
 
780
  AC_ARG_ENABLE(dns-srv,
 
781
     AC_HELP_STRING([--disable-dns-srv],
 
782
                    [disable the use of DNS SRV in HKP and HTTP]),
 
783
                use_dns_srv=$enableval,use_dns_srv=yes)
 
784
fi
 
785
 
 
786
AC_ARG_ENABLE(dns-pka,
 
787
   AC_HELP_STRING([--disable-dns-pka],
 
788
        [disable the use of PKA records in DNS]),
 
789
   use_dns_pka=$enableval,use_dns_pka=yes)
 
790
 
 
791
AC_ARG_ENABLE(dns-cert,
 
792
   AC_HELP_STRING([--disable-dns-cert],
 
793
        [disable the use of CERT records in DNS]),
 
794
   use_dns_cert=$enableval,use_dns_cert=yes)
 
795
 
 
796
if test x"$use_dns_pka" = xyes || test x"$use_dns_srv" = xyes \
 
797
   || test x"$use_dns_cert" = xyes; then
 
798
  _dns_save_libs=$LIBS
 
799
  LIBS=""
 
800
  # the double underscore thing is a glibc-ism?
 
801
  AC_SEARCH_LIBS(res_query,resolv bind,,
 
802
                 AC_SEARCH_LIBS(__res_query,resolv bind,,have_resolver=no))
 
803
  AC_SEARCH_LIBS(dn_expand,resolv bind,,
 
804
                 AC_SEARCH_LIBS(__dn_expand,resolv bind,,have_resolver=no))
 
805
  AC_SEARCH_LIBS(dn_skipname,resolv bind,,
 
806
                 AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no))
 
807
 
 
808
  if test x"$have_resolver" != xno ; then
 
809
 
 
810
    # Make sure that the BIND 4 resolver interface is workable before
 
811
    # enabling any code that calls it.  At some point I'll rewrite the
 
812
    # code to use the BIND 8 resolver API.
 
813
    # We might also want to use adns instead.  Problem with ADNS is that
 
814
    # it does not support v6.
 
815
 
 
816
    AC_MSG_CHECKING([whether the resolver is usable])
 
817
    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
 
818
#include <netinet/in.h>
 
819
#include <arpa/nameser.h>
 
820
#include <resolv.h>],
 
821
[[unsigned char answer[PACKETSZ];
 
822
  res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
 
823
  dn_skipname(0,0); 
 
824
  dn_expand(0,0,0,0,0);
 
825
]])],have_resolver=yes,have_resolver=no)
 
826
    AC_MSG_RESULT($have_resolver)
 
827
 
 
828
    # This is Apple-specific and somewhat bizarre as they changed the
 
829
    # define in bind 8 for some reason.
 
830
 
 
831
    if test x"$have_resolver" != xyes ; then
 
832
       AC_MSG_CHECKING(
 
833
             [whether I can make the resolver usable with BIND_8_COMPAT])
 
834
       AC_LINK_IFELSE([AC_LANG_PROGRAM([#define BIND_8_COMPAT
 
835
#include <sys/types.h>
 
836
#include <netinet/in.h>
 
837
#include <arpa/nameser.h>
 
838
#include <resolv.h>],
 
839
[[unsigned char answer[PACKETSZ];
 
840
  res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
 
841
  dn_skipname(0,0); dn_expand(0,0,0,0,0);
 
842
]])],[have_resolver=yes ; need_compat=yes])
 
843
       AC_MSG_RESULT($have_resolver)
 
844
    fi
 
845
  fi
 
846
 
 
847
  if test x"$have_resolver" = xyes ; then
 
848
     DNSLIBS=$LIBS
 
849
 
 
850
     if test x"$use_dns_srv" = xyes ; then
 
851
        AC_DEFINE(USE_DNS_SRV,1,[define to use DNS SRV])
 
852
     fi
 
853
 
 
854
     if test x"$use_dns_pka" = xyes ; then
 
855
        AC_DEFINE(USE_DNS_PKA,1,[define to use our experimental DNS PKA])
 
856
     fi
 
857
 
 
858
     if test x"$use_dns_cert" = xyes ; then
 
859
        AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
 
860
     fi
 
861
 
 
862
     if test x"$need_compat" = xyes ; then
 
863
        AC_DEFINE(BIND_8_COMPAT,1,[an Apple OSXism])
 
864
     fi
 
865
  else
 
866
     # If we have no resolver library but ADNS (e.g. under W32) enable the
 
867
     # code parts which can be used with ADNS.
 
868
     if test x"$have_adns" = xyes ; then
 
869
        DNSLIBS="$ADNSLIBS"
 
870
        AC_DEFINE(USE_ADNS,1,[Use ADNS as resolver library.])
 
871
 
 
872
        if test x"$use_dns_srv" = xyes ; then
 
873
           AC_DEFINE(USE_DNS_SRV,1)
 
874
        fi
 
875
 
 
876
        if test x"$use_dns_pka" = xyes ; then
 
877
           AC_DEFINE(USE_DNS_PKA,1)
 
878
        fi
 
879
 
 
880
        if test x"$use_dns_cert" = xyes ; then
 
881
           AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
 
882
        fi
 
883
     else
 
884
        use_dns_srv=no
 
885
        use_dns_pka=no
 
886
        use_dns_cert=no
 
887
     fi
 
888
  fi
 
889
 
 
890
  LIBS=$_dns_save_libs
 
891
fi
 
892
 
 
893
AC_SUBST(DNSLIBS)
 
894
 
 
895
AM_CONDITIONAL(USE_DNS_SRV, test x"$use_dns_srv" = xyes)
 
896
 
 
897
 
 
898
#
 
899
# Check for LDAP
 
900
#
 
901
if test "$try_ldap" = yes ; then
 
902
   GNUPG_CHECK_LDAP($NETLIBS)
 
903
fi
 
904
 
 
905
#
 
906
# Check for curl.  We fake the curl API if libcurl isn't installed.
 
907
# We require 7.10 or later as we use curl_version_info().
 
908
#
 
909
LIBCURL_CHECK_CONFIG([yes],[7.10],,[fake_curl=yes])
 
910
AM_CONDITIONAL(FAKE_CURL,test x"$fake_curl" = xyes)
 
911
 
 
912
# Generic, for us, means curl
 
913
 
 
914
if test x"$try_generic" = xyes ; then
 
915
   AC_SUBST(GPGKEYS_CURL,"gpg2keys_curl$EXEEXT")
 
916
fi
 
917
 
 
918
#
 
919
# Check for sendmail
 
920
#
 
921
# This isn't necessarily sendmail itself, but anything that gives a
 
922
# sendmail-ish interface to the outside world.  That includes Exim,
 
923
# Postfix, etc.  Basically, anything that can handle "sendmail -t".
 
924
if test "$try_mailto" = yes ; then
 
925
  AC_ARG_WITH(mailprog,
 
926
      AC_HELP_STRING([--with-mailprog=NAME],
 
927
                     [use "NAME -t" for mail transport]),
 
928
             ,with_mailprog=yes)
 
929
 
 
930
  if test x"$with_mailprog" = xyes ; then
 
931
    AC_PATH_PROG(SENDMAIL,sendmail,,$PATH:/usr/sbin:/usr/libexec:/usr/lib)
 
932
    if test "$ac_cv_path_SENDMAIL" ; then
 
933
      GPGKEYS_MAILTO="gpg2keys_mailto"
 
934
    fi
 
935
  elif test x"$with_mailprog" != xno ; then
 
936
    AC_MSG_CHECKING([for a mail transport program])
 
937
    AC_SUBST(SENDMAIL,$with_mailprog)
 
938
    AC_MSG_RESULT($with_mailprog)
 
939
    GPGKEYS_MAILTO="gpg2keys_mailto"
 
940
  fi
 
941
fi
 
942
 
 
943
AC_SUBST(GPGKEYS_MAILTO)
 
944
 
 
945
#
 
946
# Construct a printable name of the OS
 
947
#
 
948
case "${host}" in
 
949
    *-mingw32*)
 
950
        PRINTABLE_OS_NAME="MingW32"
 
951
        ;;
 
952
    *-*-cygwin*)
 
953
        PRINTABLE_OS_NAME="Cygwin"
 
954
        ;;
 
955
    i?86-emx-os2 | i?86-*-os2*emx )
 
956
        PRINTABLE_OS_NAME="OS/2"
 
957
        ;;
 
958
    i?86-*-msdosdjgpp*)
 
959
        PRINTABLE_OS_NAME="MSDOS/DJGPP"
 
960
        try_dynload=no
 
961
        ;;
 
962
    *-linux*)
 
963
        PRINTABLE_OS_NAME="GNU/Linux"
 
964
        ;;
 
965
    *)
 
966
        PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
 
967
        ;;
 
968
esac
 
969
AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
 
970
                   [A human readable text with the name of the OS])
 
971
 
 
972
 
 
973
#
 
974
# Checking for iconv
 
975
#
 
976
AM_ICONV
 
977
 
 
978
 
 
979
#
 
980
# Check for gettext
 
981
#
 
982
# This is "GNU gnupg" - The project-id script from gettext
 
983
#                       needs this string
 
984
#
 
985
AC_MSG_NOTICE([checking for gettext])
 
986
AM_PO_SUBDIRS
 
987
AM_GNU_GETTEXT_VERSION([0.17])
 
988
if test "$try_gettext" = yes; then
 
989
  AM_GNU_GETTEXT([external],[need-ngettext])
 
990
 
 
991
  # gettext requires some extra checks.  These really should be part of
 
992
  # the basic AM_GNU_GETTEXT macro.  TODO: move other gettext-specific
 
993
  # function checks to here.
 
994
 
 
995
  AC_CHECK_FUNCS(strchr)
 
996
else
 
997
  USE_NLS=no
 
998
  USE_INCLUDED_LIBINTL=no
 
999
  BUILD_INCLUDED_LIBINTL=no
 
1000
  POSUB=po
 
1001
  AC_SUBST(USE_NLS)
 
1002
  AC_SUBST(USE_INCLUDED_LIBINTL)
 
1003
  AC_SUBST(BUILD_INCLUDED_LIBINTL)
 
1004
  AC_SUBST(POSUB)
 
1005
fi
 
1006
 
 
1007
# We use HAVE_LANGINFO_CODESET in a couple of places.
 
1008
AM_LANGINFO_CODESET
 
1009
 
 
1010
# Checks required for our use locales
 
1011
gt_LC_MESSAGES
 
1012
 
 
1013
 
 
1014
#
 
1015
# SELinux support
 
1016
#
 
1017
if test "$selinux_support" = yes ; then
 
1018
  AC_DEFINE(ENABLE_SELINUX_HACKS,1,[Define to enable SELinux support])
 
1019
fi
 
1020
 
 
1021
 
 
1022
#
 
1023
# Checks for header files.
 
1024
#
 
1025
AC_MSG_NOTICE([checking for header files])
 
1026
AC_HEADER_STDC
 
1027
AC_CHECK_HEADERS([string.h unistd.h langinfo.h termio.h locale.h getopt.h])
 
1028
AC_CHECK_HEADERS([pty.h pwd.h inttypes.h])
 
1029
AC_HEADER_TIME
 
1030
 
 
1031
 
 
1032
#
 
1033
# Checks for typedefs, structures, and compiler characteristics.
 
1034
#
 
1035
AC_MSG_NOTICE([checking for system characteristics])
 
1036
AC_C_CONST
 
1037
AC_C_INLINE
 
1038
AC_C_VOLATILE
 
1039
AC_TYPE_SIZE_T
 
1040
AC_TYPE_MODE_T
 
1041
AC_TYPE_SIGNAL
 
1042
AC_DECL_SYS_SIGLIST
 
1043
 
 
1044
gl_HEADER_SYS_SOCKET
 
1045
gl_TYPE_SOCKLEN_T
 
1046
 
 
1047
AC_ARG_ENABLE(endian-check,
 
1048
              AC_HELP_STRING([--disable-endian-check],
 
1049
              [disable the endian check and trust the OS provided macros]),
 
1050
              endiancheck=$enableval,endiancheck=yes)
 
1051
 
 
1052
if test x"$endiancheck" = xyes ; then
 
1053
  GNUPG_CHECK_ENDIAN
 
1054
fi
 
1055
 
 
1056
# fixme: we should get rid of the byte type
 
1057
GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
 
1058
GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
 
1059
GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
 
1060
GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
 
1061
GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
 
1062
 
 
1063
AC_CHECK_SIZEOF(unsigned short)
 
1064
AC_CHECK_SIZEOF(unsigned int)
 
1065
AC_CHECK_SIZEOF(unsigned long)
 
1066
AC_CHECK_SIZEOF(unsigned long long)
 
1067
AC_CHECK_SIZEOF(time_t,,[[
 
1068
#include <stdio.h>
 
1069
#if TIME_WITH_SYS_TIME
 
1070
# include <sys/time.h>
 
1071
# include <time.h>
 
1072
#else
 
1073
# if HAVE_SYS_TIME_H
 
1074
#  include <sys/time.h>
 
1075
# else
 
1076
#  include <time.h>
 
1077
# endif
 
1078
#endif
 
1079
]])
 
1080
 
 
1081
 
 
1082
# Ensure that we have UINT64_C before we bother to check for uint64_t
 
1083
# Fixme: really needed in gnupg?  I think it is only useful in libcgrypt.
 
1084
AC_CACHE_CHECK([for UINT64_C],[gnupg_cv_uint64_c_works],
 
1085
   AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <inttypes.h>
 
1086
       uint64_t foo=UINT64_C(42);]),
 
1087
     gnupg_cv_uint64_c_works=yes,gnupg_cv_uint64_c_works=no))
 
1088
if test "$gnupg_cv_uint64_c_works" = "yes" ; then
 
1089
   AC_CHECK_SIZEOF(uint64_t)
 
1090
fi
 
1091
 
 
1092
if test "$ac_cv_sizeof_unsigned_short" = "0" \
 
1093
   || test "$ac_cv_sizeof_unsigned_int" = "0" \
 
1094
   || test "$ac_cv_sizeof_unsigned_long" = "0"; then
 
1095
    AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
 
1096
fi
 
1097
 
 
1098
 
 
1099
#
 
1100
# Checks for library functions.
 
1101
#
 
1102
AC_MSG_NOTICE([checking for library functions])
 
1103
AC_CHECK_DECLS(getpagesize)
 
1104
AC_FUNC_FSEEKO
 
1105
AC_FUNC_VPRINTF
 
1106
AC_FUNC_FORK
 
1107
AC_CHECK_FUNCS([strerror strlwr tcgetattr mmap])
 
1108
AC_CHECK_FUNCS([strcasecmp strncasecmp ctermid times gmtime_r])
 
1109
AC_CHECK_FUNCS([unsetenv fcntl ftruncate])
 
1110
AC_CHECK_FUNCS([gettimeofday getrusage getrlimit setrlimit clock_gettime])
 
1111
AC_CHECK_FUNCS([atexit raise getpagesize strftime nl_langinfo setlocale])
 
1112
AC_CHECK_FUNCS([waitpid wait4 sigaction sigprocmask pipe stat getaddrinfo])
 
1113
AC_CHECK_FUNCS([ttyname rand ftello fsync stat])
 
1114
 
 
1115
AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
 
1116
 
 
1117
#
 
1118
# These are needed by libjnlib - fixme: we should use a jnlib.m4
 
1119
# Note:  We already checked pwd.h.
 
1120
AC_CHECK_FUNCS([memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol])
 
1121
AC_CHECK_FUNCS([memrchr isascii timegm getrusage setrlimit stat setlocale])
 
1122
AC_CHECK_FUNCS([flockfile funlockfile fopencookie funopen getpwnam getpwuid])
 
1123
 
 
1124
#
 
1125
# gnulib checks
 
1126
#
 
1127
gl_SOURCE_BASE([gl])
 
1128
gl_M4_BASE([gl/m4])
 
1129
gl_MODULES([setenv mkdtemp xsize strpbrk])
 
1130
gl_INIT
 
1131
 
 
1132
 
 
1133
#
 
1134
# W32 specific test
 
1135
#
 
1136
GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
 
1137
 
 
1138
#
 
1139
# Sanity check regex.  Tests adapted from mutt.
 
1140
#
 
1141
AC_MSG_CHECKING([whether regular expression support is requested])
 
1142
AC_ARG_ENABLE(regex,
 
1143
  AC_HELP_STRING([--disable-regex],
 
1144
    [do not handle regular expressions in trust signatures]),
 
1145
  use_regex=$enableval, use_regex=yes)
 
1146
AC_MSG_RESULT($use_regex)
 
1147
 
 
1148
if test "$use_regex" = yes ; then
 
1149
  _cppflags="${CPPFLAGS}"
 
1150
  _ldflags="${LDFLAGS}"
 
1151
  AC_ARG_WITH(regex,
 
1152
     AC_HELP_STRING([--with-regex=DIR],[look for regex in DIR]),
 
1153
      [
 
1154
      if test -d "$withval" ; then
 
1155
        CPPFLAGS="${CPPFLAGS} -I$withval/include"
 
1156
        LDFLAGS="${LDFLAGS} -L$withval/lib"
 
1157
      fi
 
1158
      ],withval="")     
 
1159
 
 
1160
  # Does the system have regex functions at all?
 
1161
  AC_SEARCH_LIBS([regcomp], [regex])
 
1162
  AC_CHECK_FUNC(regcomp, gnupg_cv_have_regex=yes, gnupg_cv_have_regex=no)
 
1163
 
 
1164
  if test $gnupg_cv_have_regex = no; then
 
1165
    use_regex=no
 
1166
  else
 
1167
    if test x"$cross_compiling" = xyes; then
 
1168
      AC_MSG_WARN([cross compiling; assuming regexp libray is not broken])
 
1169
    else
 
1170
      AC_CACHE_CHECK([whether your system's regexp library is broken],
 
1171
       [gnupg_cv_regex_broken],
 
1172
       AC_TRY_RUN([
 
1173
#include <unistd.h>
 
1174
#include <regex.h>
 
1175
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); }],
 
1176
       gnupg_cv_regex_broken=no, gnupg_cv_regex_broken=yes, gnupg_cv_regex_broken=yes))
 
1177
 
 
1178
      if test $gnupg_cv_regex_broken = yes; then
 
1179
        AC_MSG_WARN([your regex is broken - disabling regex use])
 
1180
        use_regex=no
 
1181
      fi
 
1182
    fi
 
1183
  fi
 
1184
  CPPFLAGS="${_cppflags}"
 
1185
  LDFLAGS="${_ldflags}"
 
1186
fi
 
1187
 
 
1188
if test "$use_regex" != yes ; then
 
1189
  AC_DEFINE(DISABLE_REGEX,1, [Define to disable regular expression support])
 
1190
fi
 
1191
AM_CONDITIONAL(DISABLE_REGEX, test x"$use_regex" != xyes)
 
1192
 
 
1193
 
 
1194
 
 
1195
#
 
1196
# Do we have zlib? Must do it here because Solaris failed
 
1197
# when compiling a conftest (due to the "-lz" from LIBS).
 
1198
# Note that we combine zlib and bzlib2 in ZLIBS.
 
1199
#
 
1200
_cppflags="${CPPFLAGS}"
 
1201
_ldflags="${LDFLAGS}"
 
1202
AC_ARG_WITH(zlib,
 
1203
  [  --with-zlib=DIR         use libz in DIR],[
 
1204
    if test -d "$withval"; then
 
1205
      CPPFLAGS="${CPPFLAGS} -I$withval/include"
 
1206
      LDFLAGS="${LDFLAGS} -L$withval/lib"
 
1207
    fi
 
1208
  ])
 
1209
 
 
1210
AC_CHECK_HEADER(zlib.h,
 
1211
      AC_CHECK_LIB(z, deflateInit2_,
 
1212
       ZLIBS="-lz",
 
1213
       CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
 
1214
       CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
 
1215
 
 
1216
#
 
1217
# Check whether we can support bzip2
 
1218
 
1219
if test "$use_bzip2" = yes ; then
 
1220
  _cppflags="${CPPFLAGS}"
 
1221
  _ldflags="${LDFLAGS}"
 
1222
  AC_ARG_WITH(bzip2,
 
1223
     AC_HELP_STRING([--with-bzip2=DIR],[look for bzip2 in DIR]),
 
1224
      [
 
1225
      if test -d "$withval" ; then
 
1226
        CPPFLAGS="${CPPFLAGS} -I$withval/include"
 
1227
        LDFLAGS="${LDFLAGS} -L$withval/lib"
 
1228
      fi
 
1229
      ],withval="")
 
1230
 
 
1231
  # Checking alongside stdio.h as an early version of bzip2 (1.0)
 
1232
  # required stdio.h to be included before bzlib.h, and Solaris 9 is 
 
1233
  # woefully out of date.
 
1234
  if test "$withval" != no ; then
 
1235
     AC_CHECK_HEADER(bzlib.h,
 
1236
        AC_CHECK_LIB(bz2,BZ2_bzCompressInit,
 
1237
          [
 
1238
          have_bz2=yes
 
1239
          ZLIBS="$ZLIBS -lbz2"
 
1240
          AC_DEFINE(HAVE_BZIP2,1,
 
1241
                  [Defined if the bz2 compression library is available])
 
1242
          ],
 
1243
          CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
 
1244
          CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags},[#include <stdio.h>])
 
1245
  fi
 
1246
fi
 
1247
AM_CONDITIONAL(ENABLE_BZIP2_SUPPORT,test x"$have_bz2" = "xyes")
 
1248
AC_SUBST(ZLIBS)
 
1249
 
 
1250
 
 
1251
# Check for readline support
 
1252
GNUPG_CHECK_READLINE
 
1253
 
 
1254
#
 
1255
# Allow users to append something to the version string without
 
1256
# flagging it as development version.  The user version parts is
 
1257
# considered everything after a dash. 
 
1258
#
 
1259
if test "$development_version" != yes; then
 
1260
  changequote(,)dnl
 
1261
  tmp_pat='[a-zA-Z]'
 
1262
  changequote([,])dnl
 
1263
  if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
 
1264
    development_version=yes
 
1265
  fi
 
1266
fi
 
1267
if test "$development_version" = yes; then
 
1268
    AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
 
1269
            [Defined if this is not a regular release])
 
1270
fi
 
1271
 
 
1272
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
 
1273
 
 
1274
GNUPG_CHECK_GNUMAKE
 
1275
 
 
1276
# Add some extra libs here so that previous tests don't fail for
 
1277
# mysterious reasons - the final link step should bail out.
 
1278
# W32SOCKLIBS is also defined so that if can be used for tools not
 
1279
# requiring any network stuff but linking to code in libcommon which
 
1280
# tracks in winsock stuff (e.g. init_common_subsystems.
 
1281
if test "$have_w32_system" = yes; then
 
1282
   W32SOCKLIBS="-lws2_32"
 
1283
   NETLIBS="${NETLIBS} ${W32SOCKLIBS}"
 
1284
fi
 
1285
 
 
1286
AC_SUBST(NETLIBS)
 
1287
AC_SUBST(W32SOCKLIBS)
 
1288
 
 
1289
#
 
1290
# Setup gcc specific options
 
1291
#
 
1292
AC_MSG_NOTICE([checking for cc features])
 
1293
if test "$GCC" = yes; then
 
1294
    # Note that it is okay to use CFLAGS here because this are just
 
1295
    # warning options and the user should have a chance of overriding
 
1296
    # them.
 
1297
    if test "$USE_MAINTAINER_MODE" = "yes"; then
 
1298
        CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
 
1299
        CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
 
1300
        AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
 
1301
        _gcc_cflags_save=$CFLAGS
 
1302
        CFLAGS="-Wno-missing-field-initializers"
 
1303
        AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
 
1304
        AC_MSG_RESULT($_gcc_wopt)
 
1305
        CFLAGS=$_gcc_cflags_save;
 
1306
        if test x"$_gcc_wopt" = xyes ; then
 
1307
          CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
 
1308
        fi
 
1309
        AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
 
1310
        _gcc_cflags_save=$CFLAGS
 
1311
        CFLAGS="-Wdeclaration-after-statement"
 
1312
        AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
 
1313
        AC_MSG_RESULT($_gcc_wopt)
 
1314
        CFLAGS=$_gcc_cflags_save;
 
1315
        if test x"$_gcc_wopt" = xyes ; then
 
1316
          CFLAGS="$CFLAGS -Wdeclaration-after-statement"
 
1317
        fi
 
1318
    else
 
1319
        CFLAGS="$CFLAGS -Wall"
 
1320
    fi
 
1321
 
 
1322
    AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
 
1323
    _gcc_cflags_save=$CFLAGS
 
1324
    CFLAGS="-Wno-pointer-sign"
 
1325
    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
 
1326
    AC_MSG_RESULT($_gcc_psign)
 
1327
    CFLAGS=$_gcc_cflags_save;
 
1328
    if test x"$_gcc_psign" = xyes ; then
 
1329
       CFLAGS="$CFLAGS -Wno-pointer-sign"
 
1330
    fi
 
1331
 
 
1332
    AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
 
1333
    _gcc_cflags_save=$CFLAGS
 
1334
    CFLAGS="-Wpointer-arith"
 
1335
    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
 
1336
    AC_MSG_RESULT($_gcc_psign)
 
1337
    CFLAGS=$_gcc_cflags_save;
 
1338
    if test x"$_gcc_psign" = xyes ; then
 
1339
       CFLAGS="$CFLAGS -Wpointer-arith"
 
1340
    fi
 
1341
fi
 
1342
 
 
1343
 
 
1344
#
 
1345
# This is handy for debugging so the compiler doesn't rearrange
 
1346
# things and eliminate variables.
 
1347
#
 
1348
AC_ARG_ENABLE(optimization,
 
1349
   AC_HELP_STRING([--disable-optimization],
 
1350
                  [disable compiler optimization]),
 
1351
                  [if test $enableval = no ; then
 
1352
                      CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
 
1353
                   fi])
 
1354
 
 
1355
#
 
1356
# Prepare building of estream
 
1357
#
 
1358
estream_INIT
 
1359
 
 
1360
 
 
1361
#
 
1362
# Decide what to build
 
1363
#
 
1364
if test "$have_adns" = "yes"; then
 
1365
  AC_SUBST(GPGKEYS_KDNS, "gpg2keys_kdns$EXEEXT")
 
1366
fi
 
1367
 
 
1368
 
 
1369
missing_pth=no
 
1370
if test $have_ksba = no; then
 
1371
  build_gpgsm=no
 
1372
  build_scdaemon=no
 
1373
fi
 
1374
 
 
1375
build_agent_threaded=""
 
1376
if test "$build_agent" = "yes"; then
 
1377
  if test $have_pth = no; then
 
1378
     build_agent_threaded="(not multi-threaded)"
 
1379
     missing_pth=yes
 
1380
  fi
 
1381
fi
 
1382
 
 
1383
build_scdaemon_extra=""
 
1384
if test "$build_scdaemon" = "yes"; then
 
1385
  tmp=""
 
1386
  if test $have_pth = no; then
 
1387
     build_scdaemon_extra="not multi-threaded"
 
1388
     tmp=", "
 
1389
     missing_pth=yes
 
1390
  fi
 
1391
  if test $have_libusb = no; then
 
1392
     build_scdaemon_extra="${tmp}without internal CCID driver"
 
1393
     tmp=", "
 
1394
  fi
 
1395
  if test -n "$build_scdaemon_extra"; then
 
1396
     build_scdaemon_extra="(${build_scdaemon_extra})"
 
1397
  fi
 
1398
fi
 
1399
 
 
1400
 
 
1401
if test "$build_agent_only" = "yes" ; then
 
1402
  build_gpg=no
 
1403
  build_gpgsm=no
 
1404
  build_scdaemon=no
 
1405
  build_tools=no
 
1406
  build_doc=no
 
1407
fi
 
1408
 
 
1409
 
 
1410
AM_CONDITIONAL(BUILD_GPG,   test "$build_gpg" = "yes")
 
1411
AM_CONDITIONAL(BUILD_GPGSM, test "$build_gpgsm" = "yes")
 
1412
AM_CONDITIONAL(BUILD_AGENT, test "$build_agent" = "yes")
 
1413
AM_CONDITIONAL(BUILD_SCDAEMON, test "$build_scdaemon" = "yes")
 
1414
AM_CONDITIONAL(BUILD_TOOLS, test "$build_tools" = "yes")
 
1415
AM_CONDITIONAL(BUILD_DOC,   test "$build_doc" = "yes")
 
1416
AM_CONDITIONAL(BUILD_SYMCRYPTRUN, test "$build_symcryptrun" = "yes")
 
1417
AM_CONDITIONAL(BUILD_GPGTAR,      test "$build_gpgtar" = "yes")
 
1418
 
 
1419
AM_CONDITIONAL(RUN_GPG_TESTS,
 
1420
        test x$cross_compiling = xno -a "$build_gpg" = yes )
 
1421
 
 
1422
 
 
1423
#
 
1424
# Print errors here so that they are visible all
 
1425
# together and the user can acquire them all together.
 
1426
#
 
1427
die=no
 
1428
if test "$have_gpg_error" = "no"; then
 
1429
   die=yes
 
1430
   AC_MSG_NOTICE([[
 
1431
***  
 
1432
*** You need libgpg-error to build this program.
 
1433
**  This library is for example available at
 
1434
***   ftp://ftp.gnupg.org/gcrypt/libgpg-error
 
1435
*** (at least version $NEED_GPG_ERROR_VERSION is required.)
 
1436
***]])
 
1437
fi
 
1438
if test "$have_libgcrypt" = "no"; then
 
1439
   die=yes
 
1440
   AC_MSG_NOTICE([[
 
1441
***  
 
1442
*** You need libgcrypt to build this program.
 
1443
**  This library is for example available at
 
1444
***   ftp://ftp.gnupg.org/gcrypt/libgcrypt/
 
1445
*** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)
 
1446
***]])
 
1447
fi
 
1448
if test "$have_libassuan" = "no"; then
 
1449
   die=yes
 
1450
   AC_MSG_NOTICE([[
 
1451
***
 
1452
*** You need libassuan to build this program.
 
1453
*** This library is for example available at
 
1454
***   ftp://ftp.gnupg.org/gcrypt/libassuan/
 
1455
*** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
 
1456
***]])
 
1457
fi
 
1458
if test "$have_ksba" = "no"; then
 
1459
    AC_MSG_NOTICE([[
 
1460
***
 
1461
*** You need libksba to build this program.
 
1462
*** This library is for example available at
 
1463
***   ftp://ftp.gnupg.org/gcrypt/libksba/
 
1464
*** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required).
 
1465
***]])
 
1466
fi
 
1467
if test "$missing_pth" = "yes"; then
 
1468
    AC_MSG_NOTICE([[
 
1469
***
 
1470
*** It is now required to build with support for the
 
1471
*** GNU Portable Threads Library (Pth). Please install this
 
1472
*** library first.  The library is for example available at
 
1473
***   ftp://ftp.gnu.org/gnu/pth/
 
1474
*** On a Debian GNU/Linux system you can install it using 
 
1475
***   apt-get install libpth-dev
 
1476
*** To build GnuPG for Windows you need to use the W32PTH
 
1477
*** package; available at:
 
1478
***   ftp://ftp.g10code.com/g10code/w32pth/
 
1479
***]])
 
1480
   die=yes
 
1481
fi
 
1482
 
 
1483
if test "$die" = "yes"; then
 
1484
    AC_MSG_ERROR([[
 
1485
***
 
1486
*** Required libraries not found. Please consult the above messages
 
1487
*** and install them before running configure again.
 
1488
***]])
 
1489
fi
 
1490
 
 
1491
 
 
1492
 
 
1493
AC_CONFIG_FILES([ m4/Makefile 
 
1494
Makefile
 
1495
po/Makefile.in
 
1496
gl/Makefile
 
1497
include/Makefile
 
1498
jnlib/Makefile
 
1499
common/Makefile
 
1500
kbx/Makefile
 
1501
g10/Makefile
 
1502
sm/Makefile
 
1503
agent/Makefile
 
1504
scd/Makefile
 
1505
keyserver/Makefile
 
1506
keyserver/gpg2keys_mailto
 
1507
keyserver/gpg2keys_test
 
1508
tools/gpg-zip
 
1509
tools/Makefile
 
1510
doc/Makefile
 
1511
tests/Makefile
 
1512
tests/openpgp/Makefile
 
1513
tests/pkits/Makefile
 
1514
])
 
1515
AC_OUTPUT
 
1516
 
 
1517
 
 
1518
echo "
 
1519
        GnuPG v${VERSION} has been configured as follows:
 
1520
        
 
1521
        Platform:  $PRINTABLE_OS_NAME ($host)
 
1522
 
 
1523
        OpenPGP:   $build_gpg
 
1524
        S/MIME:    $build_gpgsm
 
1525
        Agent:     $build_agent $build_agent_threaded
 
1526
        Smartcard: $build_scdaemon $build_scdaemon_extra
 
1527
        Gpgtar:    $build_gpgtar
 
1528
 
 
1529
        Protect tool:      $show_gnupg_protect_tool_pgm
 
1530
        Default agent:     $show_gnupg_agent_pgm
 
1531
        Default pinentry:  $show_gnupg_pinentry_pgm
 
1532
        Default scdaemon:  $show_gnupg_scdaemon_pgm
 
1533
        Default dirmngr:   $show_gnupg_dirmngr_pgm
 
1534
"
 
1535
if test x"$use_regex" != xyes ; then
 
1536
echo "
 
1537
        Warning: No regular expression support available.
 
1538
                 OpenPGP trust signatures won't work.
 
1539
                 gpg-check-pattern will not be build.
 
1540
"
 
1541
fi