1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2000-2012 Free Software Foundation, Inc.
4 # Author: Nikos Mavrogiannopoulos, Simon Josefsson
6 # This file is part of GnuTLS.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
24 AC_INIT([GnuTLS], [3.4.0], [bugs@gnutls.org])
25 AC_CONFIG_AUX_DIR([build-aux])
26 AC_CONFIG_MACRO_DIR([m4])
29 AM_INIT_AUTOMAKE([1.12.2 subdir-objects no-dist-gzip dist-xz dist-lzip -Wall -Wno-override])
30 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31 AC_CONFIG_HEADERS([config.h])
34 *** Checking for compilation programs...
37 dnl Checks for programs.
50 AS_HELP_STRING([--disable-doc], [don't generate any documentation]),
51 enable_doc=$enableval, enable_doc=yes)
52 AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" != "no")
55 AS_HELP_STRING([--disable-tools], [don't compile any tools]),
56 enable_tools=$enableval, enable_tools=yes)
57 AM_CONDITIONAL(ENABLE_TOOLS, test "$enable_tools" != "no")
59 if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
60 AC_CHECK_PROG([AUTOGEN], [autogen], [autogen], [/bin/true])
62 if test x"$AUTOGEN" = "x/bin/true"; then
65 *** autogen not found. Will not link against libopts.
67 enable_local_libopts=yes
71 # For includes/gnutls/gnutls.h.in.
72 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
73 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
74 AC_SUBST(PATCH_VERSION, [[`echo $PACKAGE_VERSION | sed 's/.*\..*\.\([0-9]*\).*/\1/g'`]])
75 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
77 touch suppressions.valgrind
78 dnl C and C++ capabilities
84 AS_HELP_STRING([--disable-cxx], [unconditionally disable the C++ library]),
85 use_cxx=$enableval, use_cxx=yes)
86 if test "$use_cxx" != "no"; then
88 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
91 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
92 AM_CONDITIONAL(WANT_TEST_SUITE, [test -f tests/suite/mini-eagain2.c])
94 dnl Detect windows build
100 *mingw32* | *mingw64*)
110 *** In solaris hardware acceleration is disabled by default due to issues
111 *** with the assembler. Use --enable-hardware-acceleration to enable it.
119 AM_CONDITIONAL(ANDROID, test "$have_android" = yes)
120 AM_CONDITIONAL(WINDOWS, test "$have_win" = yes)
121 AM_CONDITIONAL(MACOSX, test "$have_macosx" = yes)
122 AM_CONDITIONAL(ELF, test "$have_elf" = yes)
124 dnl Hardware Acceleration
125 AC_ARG_ENABLE(hardware-acceleration,
126 AS_HELP_STRING([--disable-hardware-acceleration], [unconditionally disable hardware acceleration]),
127 use_accel=$enableval)
132 if test "$use_accel" != "no"; then
134 i?86 | x86_64 | amd64)
135 AC_CHECK_HEADERS(cpuid.h)
136 if test "$host_cpu" = "x86_64" || test "$host_cpu" = "amd64"; then
149 AC_ARG_ENABLE(padlock,
150 AS_HELP_STRING([--disable-padlock], [unconditionally disable padlock acceleration]),
151 use_padlock=$enableval)
153 if test "$use_padlock" != "no"; then
154 AC_DEFINE([ENABLE_PADLOCK], 1, [Enable padlock acceleration])
155 AC_SUBST([ENABLE_PADLOCK])
157 AM_CONDITIONAL(ENABLE_PADLOCK, test "$use_padlock" = "yes")
158 AM_CONDITIONAL(ASM_X86_64, test x"$hw_accel" = x"x86-64")
159 AM_CONDITIONAL(ASM_X86_32, test x"$hw_accel" = x"x86")
160 AM_CONDITIONAL(ASM_X86, test x"$hw_accel" = x"x86" || test x"$hw_accel" = x"x86-64")
161 AM_CONDITIONAL(HAVE_GCC_GNU89_INLINE_OPTION, test "$gnu89_inline" = "yes"])
162 AM_CONDITIONAL(HAVE_GCC, test "$GCC" = "yes")
164 dnl check for getrandom()
166 AC_MSG_CHECKING([for getrandom])
167 AC_LINK_IFELSE([AC_LANG_PROGRAM([
168 #include <linux/random.h>],[
172 AC_DEFINE([HAVE_LINUX_GETRANDOM], 1, [Enable the Linux getrandom function])
173 enable_getrandom=getrandom],
176 AC_MSG_CHECKING([for getentropy])
177 AC_LINK_IFELSE([AC_LANG_PROGRAM([
178 #include <unistd.h>],[
182 AC_DEFINE([HAVE_GETENTROPY], 1, [Enable the OpenBSD getentropy function])
183 enable_getrandom=getentropy],
188 LIBGNUTLS_EXTRA_HOOKS
191 AS_HELP_STRING([--disable-tests], [don't compile or run any tests]),
192 enable_tests=$enableval, enable_tests=$enable_tools)
193 if test "$enable_tests" = "yes" && test "$enable_tools" = "no"; then
194 true #AC_MSG_ERROR([Cannot enable tests while disabling tools])
196 AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" != "no")
199 AM_GNU_GETTEXT([external])
200 AM_GNU_GETTEXT_VERSION([0.18])
204 dnl No fork on MinGW, disable some self-tests until we fix them.
205 dnl Check clock_gettime and pthread_mutex_lock in libc (avoid linking to other libs)
206 AC_CHECK_FUNCS([fork inet_ntop inet_pton getrusage getpwuid_r nanosleep daemon getpid clock_gettime iconv localtime vasprintf],,)
207 if test "$ac_cv_func_vasprintf" != "yes";then
208 AC_MSG_CHECKING([for va_copy])
209 AC_LINK_IFELSE([AC_LANG_PROGRAM([
215 [AC_DEFINE(HAVE_VA_COPY, 1, [Have va_copy()])
216 AC_MSG_RESULT(va_copy)],
217 [AC_LINK_IFELSE([AC_LANG_PROGRAM([
223 [AC_DEFINE(HAVE___VA_COPY, 1, [Have __va_copy()])
224 AC_MSG_RESULT(__va_copy)],
226 AC_MSG_ERROR([Your system lacks vasprintf() and va_copy()])])
230 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
232 AC_CHECK_FUNCS([pthread_atfork __register_atfork],,)
234 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>
236 ], [timer_create (0,0,0);])
238 if test "$have_win" != "yes";then
239 AC_CHECK_FUNCS([pthread_mutex_lock],,)
240 if test "$ac_cv_func_pthread_mutex_lock" != "yes";then
241 AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
245 if test "$ac_cv_func_nanosleep" != "yes";then
246 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [nanosleep (0, 0);])
247 gnutls_needs_librt=yes
250 if test "$ac_cv_func_inet_pton" != "yes";then
251 AC_LIB_HAVE_LINKFLAGS(nsl,, [#include <arpa/inet.h>], [inet_pton(0,0,0);])
254 if test "$ac_cv_func_clock_gettime" != "yes";then
255 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [clock_gettime (0, 0);])
256 gnutls_needs_librt=yes
260 if test "$ac_cv_func_iconv" != "yes";then
261 AC_LIB_HAVE_LINKFLAGS(iconv,, [#include <iconv.h>], [iconv (0, 0, 0, 0, 0);])
262 if test "$HAVE_LIBICONV" = "yes";then
269 if test "$ac_have_unicode" != "yes";then
270 if test "$have_win" = "yes";then
275 dnl Note that g*l_INIT are run after we check for library capabilities,
276 dnl to prevent issues from caching lib dependencies. See discussion
277 dnl in https://bugs.gentoo.org/show_bug.cgi?id=494940 and
278 dnl http://gnu-autoconf.7623.n7.nabble.com/Correct-way-to-check-for-clock-gettime-td12276.html
282 dnl GCC warnings to enable
284 AC_ARG_ENABLE([gcc-warnings],
285 [AS_HELP_STRING([--disable-gcc-warnings],
286 [turn off lots of GCC warnings (for developers)])],
289 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
291 gl_gcc_warnings=$enableval],
292 [gl_gcc_warnings=yes]
295 if test "$gl_gcc_warnings" = yes; then
296 gl_WARN_ADD([-Wframe-larger-than=1024], [WSTACK_CFLAGS])
298 nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
299 nw="$nw -Wc++-compat" # We don't care about C++ compilers
300 nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
301 nw="$nw -Wtraditional" # Warns on #elif which we use often
302 nw="$nw -Wpadded" # Our structs are not padded
303 nw="$nw -Wtraditional-conversion" # Too many warnings for now
304 nw="$nw -Wswitch-default" # Too many warnings for now
305 nw="$nw -Wformat-y2k" # Too many warnings for now
306 nw="$nw -Woverlength-strings" # We use some in tests/
307 nw="$nw -Wvla" # There is no point to avoid C99 variable length arrays
308 nw="$nw -Wformat-nonliteral" # Incompatible with gettext _()
309 nw="$nw -Wstrict-overflow"
310 nw="$nw -Wmissing-noreturn"
311 nw="$nw -Winline" # Too compiler dependent
312 nw="$nw -Wsuggest-attribute=pure" # Is it worth using attributes?
313 nw="$nw -Wsuggest-attribute=const" # Is it worth using attributes?
314 nw="$nw -Wsuggest-attribute=noreturn" # Is it worth using attributes?
315 nw="$nw -Wstack-protector" # Some functions cannot be protected
316 nw="$nw -Wredundant-decls" # Some files cannot be compiled with that (gl_fd_to_handle)
318 gl_MANYWARN_ALL_GCC([ws])
319 gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
324 gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
325 gl_WARN_ADD([-Wno-format-y2k]) # Too many warnings for now
326 gl_WARN_ADD([-Wno-unused-value]) # warnings for things we don't want to get
327 gl_WARN_ADD([-Wno-unused-result]) # warnings for things we don't want to get
328 gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
329 gl_WARN_ADD([-Wno-stack-protector]) # Some functions cannot be protected
330 gl_WARN_ADD([-Wno-int-to-pointer-cast]) # Some files cannot be compiled with that (gl_fd_to_handle)
331 gl_WARN_ADD([-fdiagnostics-show-option])
334 AC_SUBST([WERROR_CFLAGS])
335 AC_SUBST([WSTACK_CFLAGS])
336 AC_SUBST([WARN_CFLAGS])
338 dnl Programs for compilation or development
340 LT_INIT([disable-static,win32-dll,shared])
344 AC_ARG_ENABLE(self-checks,
345 AS_HELP_STRING([--enable-self-checks], [enable self checking functionality]),
346 enable_self_checks=$enableval, enable_self_checks=no)
348 AC_ARG_ENABLE(fips140-mode,
349 AS_HELP_STRING([--enable-fips140-mode], [enable FIPS140-2 mode (implies self checks)]),
350 enable_fips=$enableval, enable_fips=no)
351 AM_CONDITIONAL(ENABLE_FIPS140, test "$enable_fips" = "yes")
352 if [ test "$enable_fips" = "yes" ];then
353 AC_LIB_HAVE_LINKFLAGS(dl,, [#include <dlfcn.h>], [dladdr (0, 0);])
354 if test "x$HAVE_LIBDL" = "xyes";then
355 enable_self_checks=yes
357 AC_DEFINE([ENABLE_FIPS140], 1, [Enable FIPS140-2 mode])
359 AC_SUBST([FIPS140_LIBS], $LIBDL)
364 *** This system is not supported in FIPS140 mode.
365 *** libdl and dladdr() are required.
370 AC_ARG_WITH(idn, AS_HELP_STRING([--without-idn],
371 [disable support for libidn]),
372 try_libidn="$withval",
375 if test "$try_libidn" = yes;then
376 PKG_CHECK_MODULES(LIBIDN, libidn >= 0.5.6, [with_libidn=yes], [with_libidn=no])
377 if test "$with_libidn" != "no";then
378 AC_DEFINE([HAVE_LIBIDN], 1, [Build IDNA support])
379 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
380 GNUTLS_REQUIRES_PRIVATE="Requires.private: libidn"
382 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, libidn"
388 *** libidn was not found. IDNA support will be disabled.
395 AM_CONDITIONAL(HAVE_LIBIDN, test "$with_libidn" != "no")
397 AC_ARG_ENABLE(non-suiteb-curves,
398 AS_HELP_STRING([--disable-non-suiteb-curves], [disable curves not in SuiteB]),
399 enable_non_suiteb=$enableval, enable_non_suiteb=yes)
400 if [ test "$enable_non_suiteb" = "yes" ];then
401 AC_DEFINE([ENABLE_NON_SUITEB_CURVES], 1, [Enable all curves])
403 AM_CONDITIONAL(ENABLE_NON_SUITEB_CURVES, test "$enable_non_suiteb" = "yes")
405 AM_CONDITIONAL(ENABLE_SELF_CHECKS, test "$enable_self_checks" = "yes")
406 if [ test "$enable_self_checks" = "yes" ];then
407 AC_DEFINE([ENABLE_SELF_CHECKS], 1, [Self checks are included in the library])
410 AC_MSG_CHECKING([whether to build libdane])
411 AC_ARG_ENABLE(libdane,
412 AS_HELP_STRING([--disable-libdane],
413 [disable the built of libdane]),
414 enable_dane=$enableval, enable_dane=yes)
415 AC_MSG_RESULT($enable_dane)
417 if test "$enable_dane" != "no"; then
418 LIBS="$oldlibs -lunbound"
419 AC_MSG_CHECKING([for unbound library])
420 AC_LINK_IFELSE([AC_LANG_PROGRAM([
421 #include <unbound.h>],[
423 ctx = ub_ctx_create();])],
425 AC_SUBST([UNBOUND_LIBS], [-lunbound])
426 AC_SUBST([UNBOUND_CFLAGS], [])
427 AC_DEFINE([HAVE_DANE], 1, [Enable the DANE library])
432 *** libunbound was not found. Libdane will not be built.
438 AM_CONDITIONAL(ENABLE_DANE, test "$enable_dane" = "yes")
440 AC_ARG_WITH(unbound-root-key-file, AS_HELP_STRING([--with-unbound-root-key-file],
441 [specify the unbound root key file]),
442 unbound_root_key_file="$withval",
443 if test "$have_win" = yes; then
444 unbound_root_key_file="C:\\Program Files\\Unbound\\root.key"
446 if test -f /var/lib/unbound/root.key;then
447 unbound_root_key_file="/var/lib/unbound/root.key"
449 unbound_root_key_file="/etc/unbound/root.key"
454 AC_DEFINE_UNQUOTED([UNBOUND_ROOT_KEY_FILE],
455 ["$unbound_root_key_file"], [The DNSSEC root key file])
457 AC_ARG_WITH(system-priority-file, AS_HELP_STRING([--with-system-priority-file],
458 [specify the system priority file]),
459 system_priority_file="$withval",
460 system_priority_file="/etc/gnutls/default-priorities"
463 AC_DEFINE_UNQUOTED([SYSTEM_PRIORITY_FILE],
464 ["$system_priority_file"], [The system priority file])
467 dnl Check for p11-kit
468 P11_KIT_MINIMUM=0.20.7
470 AS_HELP_STRING([--without-p11-kit],
471 [Build without p11-kit and PKCS#11 support]))
472 if test "$with_p11_kit" != "no"; then
473 PKG_CHECK_MODULES(P11_KIT, [p11-kit-1 >= $P11_KIT_MINIMUM], [with_p11_kit=yes], [with_p11_kit=no])
474 if test "$with_p11_kit" != "no";then
475 AC_DEFINE([ENABLE_PKCS11], 1, [Build PKCS#11 support])
476 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
477 GNUTLS_REQUIRES_PRIVATE="Requires.private: p11-kit-1"
479 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, p11-kit-1"
481 if $PKG_CONFIG --atleast-version=0.23.1 p11-kit; then
482 AC_DEFINE([P11_KIT_HAS_PIN_VALUE], 1, [p11-kit supports p11_kit_uri_get_pin_value()])
488 *** p11-kit >= $P11_KIT_MINIMUM was not found. To disable PKCS #11 support
489 *** use --without-p11-kit, otherwise you may get p11-kit from
490 *** http://p11-glue.freedesktop.org/p11-kit.html
495 AM_CONDITIONAL(ENABLE_PKCS11, test "$with_p11_kit" != "no")
498 AS_HELP_STRING([--without-tpm],
499 [Disable TPM (trousers) support.]),
500 [with_tpm=$withval], [with_tpm=yes])
501 if test "$with_tpm" != "no"; then
502 LIBS="$oldlibs -ltspi"
503 AC_MSG_CHECKING([for tss library])
504 AC_LINK_IFELSE([AC_LANG_PROGRAM([
505 #include <trousers/tss.h>
506 #include <trousers/trousers.h>],[
507 int err = Tspi_Context_Create((void *)0);
508 Trspi_Error_String(err);])],
510 AC_SUBST([TSS_LIBS], [-ltspi])
511 AC_SUBST([TSS_CFLAGS], [])
512 AC_DEFINE([HAVE_TROUSERS], 1, [Enable TPM])
517 *** trousers was not found. TPM support will be disabled.
523 AM_CONDITIONAL(ENABLE_TROUSERS, test "$with_tpm" != "no")
525 enable_local_libopts=no
526 if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
527 LIBOPTS_CHECK([src/libopts])
528 if test "$NEED_LIBOPTS_DIR" = "true";then
529 dnl replace libopts-generated files with distributed backups, if present
531 for i in ${srcdir}/src/*-args.c.bak ${srcdir}/src/*-args.h.bak; do
532 nam=`echo $i|sed 's/.bak//g'`
539 if test -z "$missing_baks"; then
540 AC_SUBST([AUTOGEN], [/bin/true])
542 enable_local_libopts=yes
545 # Need to ensure the relevant conditionals get set
547 AM_CONDITIONAL([INSTALL_LIBOPTS],[false])
548 AM_CONDITIONAL([NEED_LIBOPTS], [false])
550 AM_CONDITIONAL(NEED_LIBOPTS, test "$enable_local_libopts" = "yes")
552 AC_CHECK_TYPE(ssize_t,
554 DEFINE_SSIZE_T="#include <sys/types.h>"
555 AC_SUBST(DEFINE_SSIZE_T)
557 AC_DEFINE([NO_SSIZE_T], 1, [no ssize_t type was found])
558 DEFINE_SSIZE_T="typedef int ssize_t;"
559 AC_SUBST(DEFINE_SSIZE_T)
561 #include <sys/types.h>
565 AC_CHECK_SIZEOF(unsigned long int, 4)
566 AC_CHECK_SIZEOF(unsigned int, 4)
568 AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib],
569 [disable zlib compression support]),
570 ac_zlib=$withval, ac_zlib=yes)
571 AC_MSG_CHECKING([whether to include zlib compression support])
572 if test x$ac_zlib != xno; then
574 AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
575 if test x$ac_cv_libz != xyes; then
578 *** ZLIB was not found. You will not be able to use ZLIB compression.)
584 PKG_CHECK_EXISTS(zlib, ZLIB_HAS_PKGCONFIG=y, ZLIB_HAS_PKGCONFIG=n)
586 if test x$ac_zlib != xno; then
587 if test "$ZLIB_HAS_PKGCONFIG" = "y" ; then
588 if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
589 GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
591 GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib"
595 AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
599 AC_ARG_WITH([default-trust-store-pkcs11],
600 [AS_HELP_STRING([--with-default-trust-store-pkcs11=URI],
601 [use the given pkcs11 uri as default trust store])])
603 if test "x$with_default_trust_store_pkcs11" != x; then
604 if test "x$with_p11_kit" = xno; then
605 AC_MSG_ERROR([cannot use pkcs11 store without p11-kit])
607 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_PKCS11],
608 ["$with_default_trust_store_pkcs11"], [use the given pkcs11 uri as default trust store])
611 AC_ARG_WITH([default-trust-store-dir],
612 [AS_HELP_STRING([--with-default-trust-store-dir=DIR],
613 [use the given directory as default trust store])])
615 if test "x$with_default_trust_store_dir" != x; then
616 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_DIR],
617 ["$with_default_trust_store_dir"], [use the given directory as default trust store])
620 dnl auto detect http://lists.gnu.org/archive/html/help-gnutls/2012-05/msg00004.html
621 AC_ARG_WITH([default-trust-store-file],
622 [AS_HELP_STRING([--with-default-trust-store-file=FILE],
623 [use the given file default trust store])], with_default_trust_store_file="$withval",
624 [if test "$build" = "$host" && test x$with_default_trust_store_pkcs11 = x && test x$with_default_trust_store_dir = x;then
626 /etc/ssl/ca-bundle.pem \
627 /etc/ssl/certs/ca-certificates.crt \
628 /etc/pki/tls/cert.pem \
629 /usr/local/share/certs/ca-root-nss.crt \
632 if test -e "$i"; then
633 with_default_trust_store_file="$i"
640 if test "$with_default_trust_store_file" = "no";then
641 with_default_trust_store_file=""
644 AC_ARG_WITH([default-crl-file],
645 [AS_HELP_STRING([--with-default-crl-file=FILE],
646 [use the given CRL file as default])])
648 AC_ARG_WITH([default-blacklist-file],
649 [AS_HELP_STRING([--with-default-blacklist-file=FILE],
650 [use the given certificate blacklist file as default])])
652 if test "x$with_default_trust_store_file" != x; then
653 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_FILE],
654 ["$with_default_trust_store_file"], [use the given file default trust store])
657 if test "x$with_default_crl_file" != x; then
658 AC_DEFINE_UNQUOTED([DEFAULT_CRL_FILE],
659 ["$with_default_crl_file"], [use the given CRL file])
662 if test "x$with_default_blacklist_file" != x; then
663 AC_DEFINE_UNQUOTED([DEFAULT_BLACKLIST_FILE],
664 ["$with_default_blacklist_file"], [use the given certificate blacklist file])
668 opt_guile_bindings=yes
669 AC_MSG_CHECKING([whether building Guile bindings])
671 AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
672 opt_guile_bindings=$enableval)
673 AC_MSG_RESULT($opt_guile_bindings)
675 AC_ARG_WITH([guile-site-dir],
676 [AS_HELP_STRING([--with-guile-site-dir],
677 [use the given directory as the Guile site (use with care)])])
679 if test "$opt_guile_bindings" = "yes"; then
681 *** Detecting GNU Guile...
684 AC_PATH_PROG([guile_snarf], [guile-snarf])
685 if test "x$guile_snarf" = "x"; then
686 AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found. Guile bindings not built.])
687 opt_guile_bindings=no
692 save_CFLAGS="$CFLAGS"
694 CFLAGS="$CFLAGS $GUILE_CFLAGS"
695 LIBS="$LIBS $GUILE_LDFLAGS"
696 AC_MSG_CHECKING([whether GNU Guile is recent enough])
697 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [scm_from_locale_string ("")])],
698 [], [opt_guile_bindings=no])
699 CFLAGS="$save_CFLAGS"
702 if test "$opt_guile_bindings" = "yes"; then
704 case "x$with_guile_site_dir" in
706 # Use the default $(GUILE_SITE).
710 # Automatically derive $(GUILE_SITE) from $(pkgdatadir). This
711 # hack is used to allow `distcheck' to work (see
712 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
713 GUILE_SITE="\$(datadir)/guile/site"
717 # Use the user-specified directory as $(GUILE_SITE).
718 GUILE_SITE="$with_guile_site_dir"
722 AC_MSG_CHECKING([whether gcc supports -fgnu89-inline])
723 _gcc_cflags_save="$CFLAGS"
724 CFLAGS="${CFLAGS} -fgnu89-inline"
725 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
726 gnu89_inline=yes, gnu89_inline=no)
727 AC_MSG_RESULT($gnu89_inline)
728 CFLAGS="$_gcc_cflags_save"
730 # Optional Guile functions.
731 save_CFLAGS="$CFLAGS"
733 CFLAGS="$CFLAGS $GUILE_CFLAGS"
734 LIBS="$LIBS $GUILE_LDFLAGS"
735 AC_CHECK_FUNCS([scm_gc_malloc_pointerless])
736 CFLAGS="$save_CFLAGS"
739 # The place where guile-gnutls.la will go.
740 AC_MSG_CHECKING([the Guile effective version])
741 guile_effective_version="`$GUILE -c '(display (effective-version))'`"
742 AC_MSG_RESULT([$guile_effective_version])
743 guileextensiondir="$libdir/guile/$guile_effective_version"
744 AC_SUBST([guileextensiondir])
747 AC_MSG_WARN([A sufficiently recent GNU Guile not found. Guile bindings not built.])
748 opt_guile_bindings=no
752 AM_CONDITIONAL(HAVE_GUILE, test "$opt_guile_bindings" = "yes")
754 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS"
755 LIBGNUTLS_CFLAGS="-I${includedir}"
756 AC_SUBST(LIBGNUTLS_LIBS)
757 AC_SUBST(LIBGNUTLS_CFLAGS)
759 AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
761 AC_DEFINE([GNUTLS_COMPAT_H], 1, [Make sure we don't use old features in code.])
762 AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
764 AC_DEFINE([fread_file], [_gnutls_fread_file], [static lib rename])
765 AC_DEFINE([read_file], [_gnutls_read_file], [static lib rename])
766 AC_DEFINE([read_binary_file], [_gnutls_read_binary_file], [static lib rename])
768 dnl Crywrap dependencies
770 *** Checking dependencies for crywrap...
775 if test "$have_win" != "yes"; then
777 AC_CHECK_HEADERS([arpa/inet.h netinet/in.h sys/select.h sys/types.h sys/wait.h])
779 dnl **********************
781 dnl **********************
782 AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
783 [AC_LANG_PROGRAM([#include <sys/types.h>
786 [return *(signal (0, 0)) (0) == 1;])],
787 [ac_cv_type_signal=int],
788 [ac_cv_type_signal=void])])
789 AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
792 AC_FUNC_SELECT_ARGTYPES
793 AC_CHECK_FUNCS([alarm atexit dup2 epoll_create kqueue memchr memset munmap \
794 putenv regcomp scandir select socket strcasecmp strchr \
795 strdup strerror strncasecmp strrchr strstr strtoul uname])
797 AC_ARG_ENABLE(crywrap,
798 AS_HELP_STRING([--disable-crywrap], [unconditionally disable the crywrap TLS proxy service]))
801 if test "x$enable_crywrap" != "xno" ; then
802 AC_CHECK_FUNCS([argp_usage],[ac_argp=yes],[ac_argp=no])
805 if test "$ac_cv_func_daemon" != "no" && test "$ac_argp" != "no" && test "$with_libidn" != "no";then
811 AM_CONDITIONAL(ENABLE_CRYWRAP, test "x$crywrap" != "xno")
813 dnl end of crywrap requirements
815 dnl Some variables needed in makefiles
817 AC_SUBST([YEAR], $YEAR)
819 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
823 doc/credentials/Makefile
824 doc/credentials/openpgp/Makefile
825 doc/credentials/srp/Makefile
826 doc/credentials/x509/Makefile
829 doc/examples/Makefile
831 doc/manpages/Makefile
832 doc/reference/Makefile
833 doc/reference/version.xml
836 extra/includes/Makefile
838 libdane/includes/Makefile
839 libdane/gnutls-dane.pc
843 guile/modules/Makefile
847 lib/accelerated/Makefile
848 lib/accelerated/x86/Makefile
849 lib/algorithms/Makefile
854 lib/includes/Makefile
855 lib/includes/gnutls/gnutls.h
856 lib/minitasn1/Makefile
866 tests/cert-tests/Makefile
871 tests/key-tests/Makefile
872 tests/openpgp-certs/Makefile
873 tests/pkcs1-padding/Makefile
874 tests/pkcs12-decode/Makefile
875 tests/pkcs8-decode/Makefile
876 tests/rsa-md5-collision/Makefile
877 tests/safe-renegotiation/Makefile
878 tests/scripts/Makefile
882 tests/userid/Makefile
887 dnl Warning flags: errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
888 dnl Valgrind: $opt_valgrind_tests ${VALGRIND}
889 AC_MSG_NOTICE([summary of build options:
891 version: ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
892 Host/Target system: ${host}
893 Build system: ${build}
894 Install prefix: ${prefix}
897 Library types: Shared=${enable_shared}, Static=${enable_static}
898 Local libopts: ${enable_local_libopts}
899 Local libtasn1: ${included_libtasn1}
900 Use nettle-mini: ${mini_nettle}
903 AC_MSG_NOTICE([External hardware support:
905 /dev/crypto: $enable_cryptodev
906 Hardware accel: $hw_accel
907 Padlock accel: $use_padlock
908 getrandom variant: $enable_getrandom
909 PKCS#11 support: $with_p11_kit
910 TPM support: $with_tpm
913 AC_MSG_NOTICE([Optional features:
914 (note that included applications might not compile properly
915 if features are disabled)
917 DTLS-SRTP support: $ac_enable_srtp
918 ALPN support: $ac_enable_alpn
919 OCSP support: $ac_enable_ocsp
920 Ses. ticket support: $ac_enable_session_tickets
921 OpenPGP support: $ac_enable_openpgp
922 SRP support: $ac_enable_srp
923 PSK support: $ac_enable_psk
924 DHE support: $ac_enable_dhe
925 ECDHE support: $ac_enable_ecdhe
926 Anon auth support: $ac_enable_anon
927 Heartbeat support: $ac_enable_heartbeat
928 IDNA support: $with_libidn
929 Unicode support: $ac_have_unicode
930 Self checks: $enable_self_checks
931 Non-SuiteB curves: $enable_non_suiteb
932 FIPS140 mode: $enable_fips
935 AC_MSG_NOTICE([Optional applications:
937 crywrap app: $crywrap
940 AC_MSG_NOTICE([Optional libraries:
942 Guile wrappers: $opt_guile_bindings
943 C++ library: $use_cxx
944 DANE library: $enable_dane
945 OpenSSL compat: $enable_openssl
948 AC_MSG_NOTICE([System files:
950 Trust store pkcs11: $with_default_trust_store_pkcs11
951 Trust store dir: $with_default_trust_store_dir
952 Trust store file: $with_default_trust_store_file
953 Blacklist file: $with_default_blacklist_file
954 CRL file: $with_default_crl_file
955 Priority file: $system_priority_file
956 DNSSEC root key file: $unbound_root_key_file
959 if test ! -f "$unbound_root_key_file"; then
962 *** The DNSSEC root key file in $unbound_root_key_file was not found.
963 *** This file is needed for the verification of DNSSEC responses.
964 *** Use the command: unbound-anchor -a "$unbound_root_key_file"
965 *** to generate or update it.