187
234
AC_MSG_RESULT($enableval)
189
236
if test "$gnupg_cv_enable_keyserver_helpers" = yes ; then
237
# LDAP is defined only after we confirm the library is available later
190
238
AC_MSG_CHECKING([whether LDAP keyserver support is requested])
191
239
AC_ARG_ENABLE(ldap,
192
[ --disable-ldap disable LDAP keyserver interface],
193
try_ldap=$enableval, try_ldap=yes)
240
AC_HELP_STRING([--disable-ldap],[disable LDAP keyserver interface only]),
241
try_ldap=$enableval, try_ldap=yes)
194
242
AC_MSG_RESULT($try_ldap)
196
244
AC_MSG_CHECKING([whether HKP keyserver support is requested])
197
245
AC_ARG_ENABLE(hkp,
198
[ --disable-hkp disable HKP keyserver interface],
199
try_hkp=$enableval, try_hkp=yes)
246
AC_HELP_STRING([--disable-hkp],[disable HKP keyserver interface only]),
247
try_hkp=$enableval, try_hkp=yes)
200
248
AC_MSG_RESULT($try_hkp)
202
if test "$try_hkp" = yes ; then
203
AC_SUBST(GPGKEYS_HKP,"gpgkeys_hkp$EXEEXT")
250
AC_MSG_CHECKING([whether finger key fetching support is requested])
251
AC_ARG_ENABLE(finger,
252
AC_HELP_STRING([--disable-finger],
253
[disable finger key fetching interface only]),
254
try_finger=$enableval, try_finger=yes)
255
AC_MSG_RESULT($try_finger)
257
AC_MSG_CHECKING([whether generic object key fetching support is requested])
258
AC_ARG_ENABLE(generic,
259
AC_HELP_STRING([--disable-generic],
260
[disable generic object key fetching interface only]),
261
try_generic=$enableval, try_generic=yes)
262
AC_MSG_RESULT($try_generic)
206
264
AC_MSG_CHECKING([whether email keyserver support is requested])
207
265
AC_ARG_ENABLE(mailto,
208
[ --disable-mailto disable email keyserver interface],
209
try_mailto=$enableval, try_mailto=yes)
266
AC_HELP_STRING([--enable-mailto],
267
[enable email keyserver interface only]),
268
try_mailto=$enableval, try_mailto=no)
210
269
AC_MSG_RESULT($try_mailto)
213
272
AC_MSG_CHECKING([whether keyserver exec-path is enabled])
214
273
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])
274
AC_HELP_STRING([--disable-keyserver-path],
275
[disable the exec-path option for keyserver helpers]),
276
[if test "$enableval" = no ; then
277
disable_keyserver_path=yes
219
279
AC_MSG_RESULT($enableval)
223
dnl Check whether we want to use Linux capabilities
284
# Check for the key/uid cache size. This can't be zero, but can be
285
# pretty small on embedded systems. This is used for the gpg part.
287
AC_MSG_CHECKING([for the size of the key and uid cache])
288
AC_ARG_ENABLE(key-cache,
289
AC_HELP_STRING([--enable-key-cache=SIZE],
290
[Set key cache to SIZE (default 4096)]),,enableval=4096)
291
if test "$enableval" = "no"; then
293
elif test "$enableval" = "yes" || test "$enableval" = ""; then
297
key_cache_size=`echo "$enableval" | sed 's/[A-Za-z]//g'`
299
if test "$enableval" != "$key_cache_size" || test "$key_cache_size" -lt 5; then
300
AC_MSG_ERROR([invalid key-cache size])
302
AC_MSG_RESULT($key_cache_size)
303
AC_DEFINE_UNQUOTED(PK_UID_CACHE_SIZE,$key_cache_size,
304
[Size of the key and UID caches])
309
# Check whether we want to use Linux capabilities
225
311
AC_MSG_CHECKING([whether use of capabilities is requested])
226
312
AC_ARG_WITH(capabilities,
227
313
[ --with-capabilities use linux capabilities [default=no]],
228
314
[use_capabilities="$withval"],[use_capabilities=no])
229
315
AC_MSG_RESULT($use_capabilities)
318
# To avoid double inclusion of config.h which might happen at some
319
# places, we add the usual double inclusion protection at the top of
323
#ifndef GNUPG_CONFIG_H_INCLUDED
324
#define GNUPG_CONFIG_H_INCLUDED
328
# Stuff which goes at the bottom of config.h.
233
/* Some global constants. */
234
#ifdef HAVE_DRIVE_LETTERS
235
#define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
237
#define GNUPG_DEFAULT_HOMEDIR "/SYS\$LOGIN/gnupg"
239
#define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
241
#define GNUPG_PRIVATE_KEYS_DIR "private-keys-v1.d"
243
/* Tell libgcrypt not to use its own libgpg-error implementation. */
244
#define USE_LIBGPG_ERROR 1
246
331
/* This is the major version number of GnuPG so that
247
source included files can test for this. Note, that\
332
source included files can test for this. Note, that
248
333
we use 2 here even for GnuPG 1.9.x. */
249
334
#define GNUPG_MAJOR_VERSION 2
277
362
#define SAFE_VERSION_DOT '.'
278
363
#define SAFE_VERSION_DASH '-'
365
/* Some global constants. */
366
#ifdef HAVE_DRIVE_LETTERS
367
#define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
369
#define GNUPG_DEFAULT_HOMEDIR "/SYS\$LOGIN/gnupg"
371
#define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
373
#define GNUPG_PRIVATE_KEYS_DIR "private-keys-v1.d"
280
375
/* For some systems (DOS currently), we hardcode the path here. For
281
376
POSIX systems the values are constructed by the Makefiles, so that
282
377
the values may be overridden by the make invocations; this is to
283
378
comply with the GNU coding standards. */
284
379
#ifdef HAVE_DRIVE_LETTERS
380
/* FIXME: We need to use a function to determine these values depending
381
on the actual installation directory. */
285
382
#define GNUPG_BINDIR "c:\\gnupg"
286
383
#define GNUPG_LIBEXECDIR "c:\\gnupg"
287
384
#define GNUPG_LIBDIR "c:\\gnupg"
288
385
#define GNUPG_DATADIR "c:\\gnupg"
291
/* Setup the hardwired names of modules. */
292
#ifndef GNUPG_DEFAULT_AGENT
293
#define GNUPG_DEFAULT_AGENT ( GNUPG_BINDIR DIRSEP_S "gpg-agent" EXEEXT_S )
295
#ifndef GNUPG_DEFAULT_PINENTRY
296
#define GNUPG_DEFAULT_PINENTRY ( GNUPG_BINDIR DIRSEP_S "pinentry" EXEEXT_S )
298
#ifndef GNUPG_DEFAULT_SCDAEMON
299
#define GNUPG_DEFAULT_SCDAEMON ( GNUPG_BINDIR DIRSEP_S "scdaemon" EXEEXT_S )
301
#ifndef GNUPG_DEFAULT_DIRMNGR
302
#define GNUPG_DEFAULT_DIRMNGR ( GNUPG_BINDIR DIRSEP_S "dirmngr" EXEEXT_S )
304
#ifndef GNUPG_DEFAULT_PROTECT_TOOL
305
#define GNUPG_DEFAULT_PROTECT_TOOL \
306
( GNUPG_LIBEXECDIR DIRSEP_S "gpg-protect-tool" EXEEXT_S )
386
#define GNUPG_SYSCONFDIR "c:\\gnupg"
310
389
/* Derive some other constants. */
311
390
#if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
312
391
#define EXEC_TEMPFILE_ONLY
315
/* Temporary hacks to avoid requring a libgpg-error update. */
316
#if !HAVE_DECL_GPG_ERR_LOCKED
317
#define GPG_ERR_LOCKED 173
395
/* We didn't define endianness above, so get it from OS macros. This
396
is intended for making fat binary builds on OS X. */
397
#if !defined(BIG_ENDIAN_HOST) && !defined(LITTLE_ENDIAN_HOST)
398
#if defined(__BIG_ENDIAN__)
399
#define BIG_ENDIAN_HOST 1
400
#elif defined(__LITTLE_ENDIAN__)
401
#define LITTLE_ENDIAN_HOST 1
403
#error "No endianness found"
408
/* Hack used for W32: ldap.m4 also tests for the ASCII version of
409
ldap_start_tls_s because that is the actual symbol used in the
410
library. winldap.h redefines it to our commonly used value,
411
thus we define our usual macro here. */
412
#ifdef HAVE_LDAP_START_TLS_SA
413
# ifndef HAVE_LDAP_START_TLS_S
414
# define HAVE_LDAP_START_TLS_S 1
419
/* Tell libgcrypt not to use its own libgpg-error implementation. */
420
#define USE_LIBGPG_ERROR 1
422
/* We use jnlib, so tell other modules about it. */
423
#define HAVE_JNLIB_LOGGING 1
425
/* Our HTTP code is used in estream mode. */
426
#define HTTP_USE_ESTREAM 1
428
/* Under W32 we do an explicit socket initialization, thus we need to
429
avoid the on-demand initialization which would also install an atexit
431
#define HTTP_NO_WSASTARTUP
433
/* We always include support for the OpenPGP card. */
434
#define ENABLE_CARD_SUPPORT 1
436
/* We don't want the old assuan codes anymore. */
437
#define _ASSUAN_ONLY_GPG_ERRORS 1
439
/* We explicitly need to disable PTH's soft mapping as Debian
440
currently enables it by default for no reason. */
441
#define PTH_SYSCALL_SOFT 0
443
/* We want to use the libgcrypt provided memory allocation for
445
#define _ESTREAM_PRINTF_MALLOC gcry_malloc
446
#define _ESTREAM_PRINTF_FREE gcry_free
447
#define _ESTREAM_PRINTF_EXTRA_INCLUDE "util.h"
449
#endif /*GNUPG_CONFIG_H_INCLUDED*/
322
453
AM_MAINTAINER_MODE
324
455
# Checks for programs.
456
AC_MSG_NOTICE([checking for programs])
327
459
missing_dir=`cd $ac_aux_dir && pwd`
526
706
*** On a Debian GNU/Linux system you might want to try
527
707
*** apt-get install libpth-dev
530
GNUPG_PTH_VERSION_CHECK(1.3.7)
531
if test $have_pth = yes; then
532
PTH_CFLAGS=`$PTH_CONFIG --cflags`
533
PTH_LIBS=`$PTH_CONFIG --ldflags`
534
PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs`"
535
AC_DEFINE(USE_GNU_PTH, 1,
536
[Defined if the GNU Portable Thread Library should be used])
537
AC_DEFINE(HAVE_PTH, 1,
538
[Defined if the GNU Pth is available])
545
AC_DEFINE(USE_GNU_PTH, 1)
546
AC_DEFINE(HAVE_PTH, 1)
552
dnl Must check for network library requirements before doing link tests
553
dnl for ldap, for example. If ldap libs are static (or dynamic and without
554
dnl ELF runtime link paths), then link will fail and LDAP support won't
712
AC_MSG_NOTICE([checking for networking options])
715
# Must check for network library requirements before doing link tests
716
# for ldap, for example. If ldap libs are static (or dynamic and without
717
# ELF runtime link paths), then link will fail and LDAP support won't
557
720
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
558
721
[NETLIBS="-lnsl $NETLIBS"]))
559
722
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
560
723
[NETLIBS="-lsocket $NETLIBS"]))
562
dnl Now try for the resolver functions so we can use DNS SRV
564
AC_ARG_ENABLE(dns-srv,
565
AC_HELP_STRING([--disable-dns-srv],[disable the use of DNS SRV in HKP]),
566
use_dns_srv=$enableval,use_dns_srv=yes)
568
if test x"$try_hkp" = xyes && test x"$use_dns_srv" = xyes ; then
726
# Now try for the resolver functions so we can use DNS for SRV, PA and CERT.
728
if test x"$try_hkp" = xyes || test x"$try_http" = xyes ; then
729
AC_ARG_ENABLE(dns-srv,
730
AC_HELP_STRING([--disable-dns-srv],
731
[disable the use of DNS SRV in HKP and HTTP]),
732
use_dns_srv=$enableval,use_dns_srv=yes)
735
AC_ARG_ENABLE(dns-pka,
736
AC_HELP_STRING([--disable-dns-pka],
737
[disable the use of PKA records in DNS]),
738
use_dns_pka=$enableval,use_dns_pka=yes)
740
AC_ARG_ENABLE(dns-cert,
741
AC_HELP_STRING([--disable-dns-cert],
742
[disable the use of CERT records in DNS]),
743
use_dns_cert=$enableval,use_dns_cert=yes)
745
if test x"$use_dns_pka" = xyes || test x"$use_dns_srv" = xyes \
746
|| test x"$use_dns_cert" = xyes; then
571
749
# the double underscore thing is a glibc-ism?
572
750
AC_SEARCH_LIBS(res_query,resolv bind,,
573
AC_SEARCH_LIBS(__res_query,resolv bind,,use_dns_srv=no))
751
AC_SEARCH_LIBS(__res_query,resolv bind,,have_resolver=no))
574
752
AC_SEARCH_LIBS(dn_expand,resolv bind,,
575
AC_SEARCH_LIBS(__dn_expand,resolv bind,,use_dns_srv=no))
753
AC_SEARCH_LIBS(__dn_expand,resolv bind,,have_resolver=no))
576
754
AC_SEARCH_LIBS(dn_skipname,resolv bind,,
577
AC_SEARCH_LIBS(__dn_skipname,resolv bind,,use_dns_srv=no))
579
if test x"$use_dns_srv" = xyes ; then
580
AC_DEFINE(USE_DNS_SRV,1,[define to use DNS SRV])
755
AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no))
757
if test x"$have_resolver" != xno ; then
759
# Make sure that the BIND 4 resolver interface is workable before
760
# enabling any code that calls it. At some point I'll rewrite the
761
# code to use the BIND 8 resolver API.
763
AC_MSG_CHECKING([whether the resolver is usable])
764
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
765
#include <netinet/in.h>
766
#include <arpa/nameser.h>
767
#include <resolv.h>],
768
[[unsigned char answer[PACKETSZ];
769
res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
771
dn_expand(0,0,0,0,0);
772
]])],have_resolver=yes,have_resolver=no)
773
AC_MSG_RESULT($have_resolver)
775
# This is Apple-specific and somewhat bizarre as they changed the
776
# define in bind 8 for some reason.
778
if test x"$have_resolver" != xyes ; then
780
[whether I can make the resolver usable with BIND_8_COMPAT])
781
AC_LINK_IFELSE([AC_LANG_PROGRAM([#define BIND_8_COMPAT
782
#include <sys/types.h>
783
#include <netinet/in.h>
784
#include <arpa/nameser.h>
785
#include <resolv.h>],
786
[[unsigned char answer[PACKETSZ];
787
res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
788
dn_skipname(0,0); dn_expand(0,0,0,0,0);
789
]])],[have_resolver=yes ; need_compat=yes])
790
AC_MSG_RESULT($have_resolver)
794
if test x"$have_resolver" = xyes ; then
797
if test x"$use_dns_srv" = xyes ; then
798
AC_DEFINE(USE_DNS_SRV,1,[define to use DNS SRV])
801
if test x"$use_dns_pka" = xyes ; then
802
AC_DEFINE(USE_DNS_PKA,1,[define to use our experimental DNS PKA])
805
if test x"$use_dns_cert" = xyes ; then
806
AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
809
if test x"$need_compat" = xyes ; then
810
AC_DEFINE(BIND_8_COMPAT,1,[an Apple OSXism])
583
AC_MSG_WARN([Resolver functions not found. Disabling DNS SRV.])
590
# Try and link a LDAP test program to weed out unusable LDAP
591
# libraries. -lldap [-llber [-lresolv]] is for OpenLDAP. OpenLDAP in
592
# general is terrible with creating weird dependencies. If all else
593
# fails, the user can play guess-the-dependency by using something
594
# like ./configure LDAPLIBS="-Lfoo -lbar"
823
AM_CONDITIONAL(USE_DNS_SRV, test x"$use_dns_srv" = xyes)
596
828
if test "$try_ldap" = yes ; then
597
for MY_LDAPLIBS in ${LDAPLIBS+"$LDAPLIBS"} "-lldap" "-lldap -llber" "-lldap -llber -lresolv"; do
598
_ldap_save_libs=$LIBS
599
LIBS="$MY_LDAPLIBS $NETLIBS $LIBS"
601
AC_MSG_CHECKING([whether LDAP via \"$MY_LDAPLIBS\" is present and sane])
602
AC_TRY_LINK([#include <ldap.h>],[ldap_open("foobar",1234);],
603
[gnupg_cv_func_ldap_init=yes],[gnupg_cv_func_ldap_init=no])
604
AC_MSG_RESULT([$gnupg_cv_func_ldap_init])
606
if test $gnupg_cv_func_ldap_init = no; then
607
AC_MSG_CHECKING([whether I can make LDAP be sane with lber.h])
608
AC_TRY_LINK([#include <lber.h>
609
#include <ldap.h>],[ldap_open("foobar",1234);],
610
[gnupg_cv_func_ldaplber_init=yes],[gnupg_cv_func_ldaplber_init=no])
611
AC_MSG_RESULT([$gnupg_cv_func_ldaplber_init])
614
if test "$gnupg_cv_func_ldaplber_init" = yes ; then
615
AC_DEFINE(NEED_LBER_H,1,[Define if the LDAP library requires including lber.h before ldap.h])
618
if test "$gnupg_cv_func_ldap_init" = yes || \
619
test "$gnupg_cv_func_ldaplber_init" = yes ; then
620
LDAPLIBS=$MY_LDAPLIBS
621
GPGKEYS_LDAP="gpgkeys_ldap$EXEEXT"
623
AC_MSG_CHECKING([whether LDAP supports ldap_get_option])
625
if test "$gnupg_cv_func_ldap_init" = yes ; then
626
AC_TRY_LINK([#include <ldap.h>],
627
[ldap_get_option((void *)0,0,(void *)0);],
628
[gnupg_cv_func_ldap_get_option=yes],
629
[gnupg_cv_func_ldap_get_option=no])
631
AC_TRY_LINK([#include <lber.h>
632
#include <ldap.h>],[ldap_get_option((void *)0,0,(void *)0);],
633
[gnupg_cv_func_ldap_get_option=yes],
634
[gnupg_cv_func_ldap_get_option=no])
637
AC_MSG_RESULT([$gnupg_cv_func_ldap_get_option])
639
if test "$gnupg_cv_func_ldap_get_option" = yes ; then
640
AC_DEFINE(HAVE_LDAP_GET_OPTION,1,[Define if the LDAP library has ldap_get_option])
642
AC_MSG_CHECKING([whether LDAP supports ld_errno])
644
if test "$gnupg_cv_func_ldap_init" = yes ; then
645
AC_TRY_COMPILE([#include <ldap.h>],
646
[LDAP *ldap; ldap->ld_errno;],
647
[gnupg_cv_func_ldap_ld_errno=yes],
648
[gnupg_cv_func_ldap_ld_errno=no])
650
AC_TRY_LINK([#include <lber.h>
651
#include <ldap.h>],[LDAP *ldap; ldap->ld_errno;],
652
[gnupg_cv_func_ldap_ld_errno=yes],
653
[gnupg_cv_func_ldap_ld_errno=no])
656
AC_MSG_RESULT([$gnupg_cv_func_ldap_ld_errno])
658
if test "$gnupg_cv_func_ldap_ld_errno" = yes ; then
659
AC_DEFINE(HAVE_LDAP_LD_ERRNO,1,[Define if the LDAP library supports ld_errno])
664
LIBS=$_ldap_save_libs
666
if test "$GPGKEYS_LDAP" != "" ; then break; fi
670
AC_SUBST(GPGKEYS_LDAP)
673
dnl This isn't necessarily sendmail itself, but anything that gives a
674
dnl sendmail-ish interface to the outside world. That includes qmail,
675
dnl postfix, etc. Basically, anything that can handle "sendmail -t".
829
GNUPG_CHECK_LDAP($NETLIBS)
833
# Check for curl. We fake the curl API if libcurl isn't installed.
835
LIBCURL_CHECK_CONFIG([yes],,,[fake_curl=yes])
836
AM_CONDITIONAL(FAKE_CURL,test x"$fake_curl" = xyes)
838
# Generic, for us, means curl
840
if test x"$try_generic" = xyes ; then
841
AC_SUBST(GPGKEYS_CURL,"gpg2keys_curl$EXEEXT")
847
# This isn't necessarily sendmail itself, but anything that gives a
848
# sendmail-ish interface to the outside world. That includes Exim,
849
# Postfix, etc. Basically, anything that can handle "sendmail -t".
677
850
if test "$try_mailto" = yes ; then
678
AC_ARG_WITH(mailprog,[ --with-mailprog=NAME use "NAME -t" for mail transport],,with_mailprog=yes)
851
AC_ARG_WITH(mailprog,
852
AC_HELP_STRING([--with-mailprog=NAME],
853
[use "NAME -t" for mail transport]),
680
if test "$with_mailprog" = yes ; then
856
if test x"$with_mailprog" = xyes ; then
681
857
AC_PATH_PROG(SENDMAIL,sendmail,,$PATH:/usr/sbin:/usr/libexec:/usr/lib)
682
858
if test "$ac_cv_path_SENDMAIL" ; then
683
GPGKEYS_MAILTO="gpgkeys_mailto"
859
GPGKEYS_MAILTO="gpg2keys_mailto"
685
elif test "$with_mailprog" != no ; then
861
elif test x"$with_mailprog" != xno ; then
686
862
AC_MSG_CHECKING([for a mail transport program])
687
863
AC_SUBST(SENDMAIL,$with_mailprog)
688
864
AC_MSG_RESULT($with_mailprog)
689
GPGKEYS_MAILTO="gpgkeys_mailto"
865
GPGKEYS_MAILTO="gpg2keys_mailto"
693
869
AC_SUBST(GPGKEYS_MAILTO)
872
# Construct a printable name of the OS
695
874
case "${host}" in
697
876
PRINTABLE_OS_NAME="MingW32"
776
1015
AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
779
dnl Do we have any 64-bit data types?
780
if test "$ac_cv_sizeof_unsigned_int" != "8" \
781
&& test "$ac_cv_sizeof_unsigned_long" != "8" \
782
&& test "$ac_cv_sizeof_unsigned_long_long" != "8" \
783
&& test "$ac_cv_sizeof_uint64_t" != "8"; then
784
AC_MSG_WARN([No 64-bit types. Disabling SHA-384, and SHA-512])
786
if test x"$use_sha512" = xyes ; then
787
AC_SUBST(SHA512_O,sha512.o)
788
AC_DEFINE(USE_SHA512,1,[Define to include the SHA-384 and SHA-512 digests])
792
# fixme: do we really need this - it should be encapsulated in libassuan
793
GNUPG_SYS_SO_PEERCRED
795
1020
# Checks for library functions.
1022
AC_MSG_NOTICE([checking for library functions])
1023
AC_CHECK_DECLS(getpagesize)
799
AC_CHECK_FUNCS(strerror stpcpy strsep strlwr tcgetattr strtoul mmap)
800
AC_CHECK_FUNCS(strcasecmp strncasecmp ctermid times gmtime_r)
801
AC_CHECK_FUNCS(memmove gettimeofday getrusage setrlimit clock_gettime)
802
AC_CHECK_FUNCS(atexit raise getpagesize strftime nl_langinfo setlocale)
803
AC_CHECK_FUNCS(waitpid wait4 sigaction sigprocmask rand pipe stat getaddrinfo)
804
AC_CHECK_FUNCS(fseeko ftello ttyname isascii)
1027
AC_CHECK_FUNCS([strerror strlwr tcgetattr mmap])
1028
AC_CHECK_FUNCS([strcasecmp strncasecmp ctermid times gmtime_r])
1029
AC_CHECK_FUNCS([unsetenv getpwnam getpwuid fcntl ftruncate])
1030
AC_CHECK_FUNCS([gettimeofday getrusage setrlimit clock_gettime])
1031
AC_CHECK_FUNCS([atexit raise getpagesize strftime nl_langinfo setlocale])
1032
AC_CHECK_FUNCS([waitpid wait4 sigaction sigprocmask pipe stat getaddrinfo])
1033
AC_CHECK_FUNCS([ttyname rand ftello])
806
1035
AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
1038
# These are needed by libjnlib - fixme: we should use a jnlib.m4
1040
AC_CHECK_FUNCS([memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol])
1041
AC_CHECK_FUNCS([memrchr isascii timegm getrusage setrlimit stat setlocale])
1042
AC_CHECK_FUNCS([flockfile funlockfile fopencookie funopen])
811
gl_MODULES(setenv strsep mkdtemp vasprintf xsize)
1047
gl_SOURCE_BASE([gl])
1049
gl_MODULES([setenv mkdtemp xsize strpbrk])
814
# These are needed by libjnlib - fixme: we should have macros for them
815
AC_CHECK_FUNCS(memicmp stpcpy strlwr strtoul memmove stricmp strtol)
816
AC_CHECK_FUNCS(getrusage setrlimit stat setlocale)
817
AC_CHECK_FUNCS(flockfile funlockfile fopencookie funopen)
821
# check for gethrtime and run a testprogram to see whether
822
# it is broken. It has been reported that some Solaris and HP UX systems
825
# fixme: Do we need this - iirc, this is only used by libgcrypt.
827
AC_CACHE_CHECK([for gethrtime],
828
[gnupg_cv_func_gethrtime],
829
[AC_TRY_LINK([#include <sys/times.h>],[
833
[gnupg_cv_func_gethrtime=yes],
834
[gnupg_cv_func_gethrtime=no])
836
if test $gnupg_cv_func_gethrtime = yes; then
837
AC_DEFINE([HAVE_GETHRTIME], 1,
838
[Define if you have the `gethrtime(2)' function.])
839
AC_CACHE_CHECK([whether gethrtime is broken],
840
[gnupg_cv_func_broken_gethrtime],
842
#include <sys/times.h>
848
[gnupg_cv_func_broken_gethrtime=no],
849
[gnupg_cv_func_broken_gethrtime=yes],
850
[gnupg_cv_func_broken_gethrtime=assume-no])
852
if test $gnupg_cv_func_broken_gethrtime = yes; then
853
AC_DEFINE([HAVE_BROKEN_GETHRTIME], 1,
854
[Define if `gethrtime(2)' does not work correctly i.e. issues a SIGILL.])
860
1056
GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
863
dnl Check whether we can use Linux capabilities as requested
865
# fixme: Still required?
867
if test "$use_capabilities" = "yes" ; then
869
AC_CHECK_HEADERS(sys/capability.h)
870
if test "$ac_cv_header_sys_capability_h" = "yes" ; then
871
AC_CHECK_LIB(cap, cap_init, ac_need_libcap=1)
872
if test "$ac_cv_lib_cap_cap_init" = "yes"; then
873
AC_DEFINE(USE_CAPABILITIES,1,
874
[define if capabilities should be used])
875
AC_SUBST(CAPLIBS,"-lcap")
879
if test "$use_capabilities" = "no" ; then
882
*** The use of capabilities on this system is not possible.
883
*** You need a recent Linux kernel and some patches:
884
*** fcaps-2.2.9-990610.patch (kernel patch for 2.2.9)
885
*** fcap-module-990613.tar.gz (kernel module)
886
*** libcap-1.92.tar.gz (user mode library and utilities)
887
*** And you have to configure the kernel with CONFIG_VFS_CAP_PLUGIN
888
*** set (filesystems menu). Be warned: This code is *really* ALPHA.
894
1059
# Sanity check regex. Tests adapted from mutt.
896
1061
AC_MSG_CHECKING([whether regular expression support is requested])
897
1062
AC_ARG_ENABLE(regex,
898
[ --disable-regex do not handle regular expressions in trust sigs],
899
use_regex=$enableval, use_regex=yes)
1063
AC_HELP_STRING([--disable-regex],
1064
[do not handle regular expressions in trust signatures]),
1065
use_regex=$enableval, use_regex=yes)
900
1066
AC_MSG_RESULT($use_regex)
902
1068
if test "$use_regex" = yes ; then
903
AC_MSG_CHECKING([whether the included regex lib is requested])
904
AC_ARG_WITH(included-regex,
905
[ --with-included-regex use the included GNU regex library],
906
[gnupg_cv_included_regex="$withval"],[gnupg_cv_included_regex=no])
907
AC_MSG_RESULT($gnupg_cv_included_regex)
909
if test $gnupg_cv_included_regex = no ; then
910
# Does the system have regex functions at all?
911
AC_CHECK_FUNC(regcomp,gnupg_cv_included_regex=no,
912
gnupg_cv_included_regex=yes)
915
if test $gnupg_cv_included_regex = no ; then
916
AC_CACHE_CHECK([whether your system's regexp library is broken],
1069
_cppflags="${CPPFLAGS}"
1070
_ldflags="${LDFLAGS}"
1072
AC_HELP_STRING([--with-regex=DIR],[look for regex in DIR]),
1074
if test -d "$withval" ; then
1075
CPPFLAGS="${CPPFLAGS} -I$withval/include"
1076
LDFLAGS="${LDFLAGS} -L$withval/lib"
1080
# Does the system have regex functions at all?
1081
AC_SEARCH_LIBS([regcomp], [regex])
1082
AC_CHECK_FUNC(regcomp, gnupg_cv_have_regex=yes, gnupg_cv_have_regex=no)
1084
if test $gnupg_cv_have_regex = no; then
1087
if test x"$cross_compiling" = xyes; then
1088
AC_MSG_WARN([cross compiling; assuming regexp libray is not broken])
1090
AC_CACHE_CHECK([whether your system's regexp library is broken],
917
1091
[gnupg_cv_regex_broken],
919
1093
#include <unistd.h>
985
1194
GNUPG_CHECK_GNUMAKE
987
1196
# Add some extra libs here so that previous tests don't fail for
988
# mysterious reasons - the final link step should bail out.
1197
# mysterious reasons - the final link step should bail out.
1198
# W32SOCKLIBS is also defined so that if can be used for tools not
1199
# requiring any network stuff but linking to code in libcommon which
1200
# tracks in winsock stuff (e.g. init_common_subsystems.
989
1201
if test "$have_w32_system" = yes; then
1202
W32SOCKLIBS="-lws2_32"
1203
NETLIBS="${NETLIBS} ${W32SOCKLIBS}"
1207
AC_SUBST(W32SOCKLIBS)
1210
# Setup gcc specific options
1212
AC_MSG_NOTICE([checking for cc features])
994
1213
if test "$GCC" = yes; then
1214
# Note that it is okay to use CFLAGS here because this are just
1215
# warning options and the user should have a chance of overriding
995
1217
if test "$USE_MAINTAINER_MODE" = "yes"; then
996
1218
CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
997
CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security"
1219
CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
999
1221
CFLAGS="$CFLAGS -Wall"
1007
# We use jnlib, so tell other modules about it
1008
AC_DEFINE(HAVE_JNLIB_LOGGING, 1,
1009
[Defined if jnlib style logging functions are available])
1011
# For W32 we need to use our Pth emulation code
1012
if test "$have_w32_system" = yes; then
1013
AC_CONFIG_LINKS(pth.h:jnlib/w32-pth.h)
1224
AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
1225
_gcc_cflags_save=$CFLAGS
1226
CFLAGS="-Wno-pointer-sign"
1227
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
1228
AC_MSG_RESULT($_gcc_psign)
1229
CFLAGS=$_gcc_cflags_save;
1230
if test x"$_gcc_psign" = xyes ; then
1231
CFLAGS="$CFLAGS -Wno-pointer-sign"
1234
AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
1235
_gcc_cflags_save=$CFLAGS
1236
CFLAGS="-Wpointer-arith"
1237
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
1238
AC_MSG_RESULT($_gcc_psign)
1239
CFLAGS=$_gcc_cflags_save;
1240
if test x"$_gcc_psign" = xyes ; then
1241
CFLAGS="$CFLAGS -Wpointer-arith"
1247
# This is handy for debugging so the compiler doesn't rearrange
1248
# things and eliminate variables.
1250
AC_ARG_ENABLE(optimization,
1251
AC_HELP_STRING([--disable-optimization],
1252
[disable compiler optimization]),
1253
[if test $enableval = no ; then
1254
CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
1258
# Prepare building of estream