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.
48 AC_CHECK_PROG([AUTOGEN], [autogen], [autogen], [/bin/true])
50 if test x"$AUTOGEN" = "x/bin/true"; then
53 *** autogen not found. Will not link against libopts.
55 enable_local_libopts=yes
58 # For includes/gnutls/gnutls.h.in.
59 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
60 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
61 AC_SUBST(PATCH_VERSION, [[`echo $PACKAGE_VERSION | sed 's/.*\..*\.\([0-9]*\).*/\1/g'`]])
62 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
64 touch suppressions.valgrind
65 dnl C and C++ capabilities
71 AS_HELP_STRING([--disable-cxx], [unconditionally disable the C++ library]),
72 use_cxx=$enableval, use_cxx=yes)
73 if test "$use_cxx" != "no"; then
75 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
78 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
79 AM_CONDITIONAL(WANT_TEST_SUITE, [test -f tests/suite/mini-eagain2.c])
81 dnl Detect windows build
87 *mingw32* | *mingw64*)
97 *** In solaris hardware acceleration is disabled by default due to issues
98 *** with the assembler. Use --enable-hardware-acceleration to enable it.
106 AM_CONDITIONAL(ANDROID, test "$have_android" = yes)
107 AM_CONDITIONAL(WINDOWS, test "$have_win" = yes)
108 AM_CONDITIONAL(MACOSX, test "$have_macosx" = yes)
109 AM_CONDITIONAL(ELF, test "$have_elf" = yes)
111 dnl Hardware Acceleration
112 AC_ARG_ENABLE(hardware-acceleration,
113 AS_HELP_STRING([--disable-hardware-acceleration], [unconditionally disable hardware acceleration]),
114 use_accel=$enableval)
119 if test "$use_accel" != "no"; then
121 i?86 | x86_64 | amd64)
122 AC_CHECK_HEADERS(cpuid.h)
123 if test "$host_cpu" = "x86_64" || test "$host_cpu" = "amd64"; then
136 AC_ARG_ENABLE(padlock,
137 AS_HELP_STRING([--disable-padlock], [unconditionally disable padlock acceleration]),
138 use_padlock=$enableval)
140 if test "$use_padlock" != "no"; then
141 AC_DEFINE([ENABLE_PADLOCK], 1, [Enable padlock acceleration])
142 AC_SUBST([ENABLE_PADLOCK])
144 AM_CONDITIONAL(ENABLE_PADLOCK, test "$use_padlock" = "yes")
145 AM_CONDITIONAL(ASM_X86_64, test x"$hw_accel" = x"x86-64")
146 AM_CONDITIONAL(ASM_X86_32, test x"$hw_accel" = x"x86")
147 AM_CONDITIONAL(ASM_X86, test x"$hw_accel" = x"x86" || test x"$hw_accel" = x"x86-64")
148 AM_CONDITIONAL(HAVE_GCC_GNU89_INLINE_OPTION, test "$gnu89_inline" = "yes"])
149 AM_CONDITIONAL(HAVE_GCC, test "$GCC" = "yes")
151 dnl check for getrandom()
153 AC_MSG_CHECKING([for getrandom])
154 AC_LINK_IFELSE([AC_LANG_PROGRAM([
155 #include <linux/random.h>],[
159 AC_DEFINE([HAVE_LINUX_GETRANDOM], 1, [Enable the Linux getrandom function])
160 enable_getrandom=getrandom],
163 AC_MSG_CHECKING([for getentropy])
164 AC_LINK_IFELSE([AC_LANG_PROGRAM([
165 #include <unistd.h>],[
169 AC_DEFINE([HAVE_GETENTROPY], 1, [Enable the OpenBSD getentropy function])
170 enable_getrandom=getentropy],
175 LIBGNUTLS_EXTRA_HOOKS
178 AS_HELP_STRING([--disable-doc], [don't generate any documentation]),
179 enable_doc=$enableval, enable_doc=yes)
180 AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" != "no")
183 AS_HELP_STRING([--disable-tests], [don't compile or run any tests]),
184 enable_tests=$enableval, enable_tests=yes)
185 AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" != "no")
188 AM_GNU_GETTEXT([external])
189 AM_GNU_GETTEXT_VERSION([0.18])
193 dnl No fork on MinGW, disable some self-tests until we fix them.
194 dnl Check clock_gettime and pthread_mutex_lock in libc (avoid linking to other libs)
195 AC_CHECK_FUNCS([fork inet_ntop inet_pton getrusage getpwuid_r nanosleep daemon getpid clock_gettime iconv localtime vasprintf],,)
196 if test "$ac_cv_func_vasprintf" != "yes";then
197 AC_MSG_CHECKING([for va_copy])
198 AC_LINK_IFELSE([AC_LANG_PROGRAM([
204 [AC_DEFINE(HAVE_VA_COPY, 1, [Have va_copy()])
205 AC_MSG_RESULT(va_copy)],
206 [AC_LINK_IFELSE([AC_LANG_PROGRAM([
212 [AC_DEFINE(HAVE___VA_COPY, 1, [Have __va_copy()])
213 AC_MSG_RESULT(__va_copy)],
215 AC_MSG_ERROR([Your system lacks vasprintf() and va_copy()])])
219 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
221 AC_CHECK_FUNCS([pthread_atfork __register_atfork],,)
223 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>
225 ], [timer_create (0,0,0);])
227 if test "$have_win" != "yes";then
228 AC_CHECK_FUNCS([pthread_mutex_lock],,)
229 if test "$ac_cv_func_pthread_mutex_lock" != "yes";then
230 AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
234 if test "$ac_cv_func_nanosleep" != "yes";then
235 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [nanosleep (0, 0);])
236 gnutls_needs_librt=yes
239 if test "$ac_cv_func_inet_pton" != "yes";then
240 AC_LIB_HAVE_LINKFLAGS(nsl,, [#include <arpa/inet.h>], [inet_pton(0,0,0);])
243 if test "$ac_cv_func_clock_gettime" != "yes";then
244 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [clock_gettime (0, 0);])
245 gnutls_needs_librt=yes
249 if test "$ac_cv_func_iconv" != "yes";then
250 AC_LIB_HAVE_LINKFLAGS(iconv,, [#include <iconv.h>], [iconv (0, 0, 0, 0, 0);])
251 if test "$HAVE_LIBICONV" = "yes";then
258 if test "$ac_have_unicode" != "yes";then
259 if test "$have_win" = "yes";then
264 dnl Note that g*l_INIT are run after we check for library capabilities,
265 dnl to prevent issues from caching lib dependencies. See discussion
266 dnl in https://bugs.gentoo.org/show_bug.cgi?id=494940 and
267 dnl http://gnu-autoconf.7623.n7.nabble.com/Correct-way-to-check-for-clock-gettime-td12276.html
271 dnl GCC warnings to enable
273 AC_ARG_ENABLE([gcc-warnings],
274 [AS_HELP_STRING([--disable-gcc-warnings],
275 [turn off lots of GCC warnings (for developers)])],
278 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
280 gl_gcc_warnings=$enableval],
281 [gl_gcc_warnings=yes]
284 if test "$gl_gcc_warnings" = yes; then
285 gl_WARN_ADD([-Wframe-larger-than=1024], [WSTACK_CFLAGS])
287 nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
288 nw="$nw -Wc++-compat" # We don't care about C++ compilers
289 nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
290 nw="$nw -Wtraditional" # Warns on #elif which we use often
291 nw="$nw -Wpadded" # Our structs are not padded
292 nw="$nw -Wtraditional-conversion" # Too many warnings for now
293 nw="$nw -Wswitch-default" # Too many warnings for now
294 nw="$nw -Wformat-y2k" # Too many warnings for now
295 nw="$nw -Woverlength-strings" # We use some in tests/
296 nw="$nw -Wvla" # There is no point to avoid C99 variable length arrays
297 nw="$nw -Wformat-nonliteral" # Incompatible with gettext _()
298 nw="$nw -Wstrict-overflow"
299 nw="$nw -Wmissing-noreturn"
300 nw="$nw -Winline" # Too compiler dependent
301 nw="$nw -Wsuggest-attribute=pure" # Is it worth using attributes?
302 nw="$nw -Wsuggest-attribute=const" # Is it worth using attributes?
303 nw="$nw -Wsuggest-attribute=noreturn" # Is it worth using attributes?
304 nw="$nw -Wstack-protector" # Some functions cannot be protected
305 nw="$nw -Wredundant-decls" # Some files cannot be compiled with that (gl_fd_to_handle)
307 gl_MANYWARN_ALL_GCC([ws])
308 gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
313 gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
314 gl_WARN_ADD([-Wno-format-y2k]) # Too many warnings for now
315 gl_WARN_ADD([-Wno-unused-value]) # warnings for things we don't want to get
316 gl_WARN_ADD([-Wno-unused-result]) # warnings for things we don't want to get
317 gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
318 gl_WARN_ADD([-Wno-stack-protector]) # Some functions cannot be protected
319 gl_WARN_ADD([-Wno-int-to-pointer-cast]) # Some files cannot be compiled with that (gl_fd_to_handle)
320 gl_WARN_ADD([-fdiagnostics-show-option])
323 AC_SUBST([WERROR_CFLAGS])
324 AC_SUBST([WSTACK_CFLAGS])
325 AC_SUBST([WARN_CFLAGS])
327 dnl Programs for compilation or development
329 LT_INIT([disable-static,win32-dll,shared])
333 AC_ARG_ENABLE(self-checks,
334 AS_HELP_STRING([--enable-self-checks], [enable self checking functionality]),
335 enable_self_checks=$enableval, enable_self_checks=no)
337 AC_ARG_ENABLE(fips140-mode,
338 AS_HELP_STRING([--enable-fips140-mode], [enable FIPS140-2 mode (implies self checks)]),
339 enable_fips=$enableval, enable_fips=no)
340 AM_CONDITIONAL(ENABLE_FIPS140, test "$enable_fips" = "yes")
341 if [ test "$enable_fips" = "yes" ];then
342 AC_LIB_HAVE_LINKFLAGS(dl,, [#include <dlfcn.h>], [dladdr (0, 0);])
343 if test "x$HAVE_LIBDL" = "xyes";then
344 enable_self_checks=yes
346 AC_DEFINE([ENABLE_FIPS140], 1, [Enable FIPS140-2 mode])
348 AC_SUBST([FIPS140_LIBS], $LIBDL)
353 *** This system is not supported in FIPS140 mode.
354 *** libdl and dladdr() are required.
359 AC_ARG_WITH(idn, AS_HELP_STRING([--without-idn],
360 [disable support for libidn]),
361 try_libidn="$withval",
364 if test "$try_libidn" = yes;then
365 PKG_CHECK_MODULES(LIBIDN, libidn >= 0.5.6, [with_libidn=yes], [with_libidn=no])
366 if test "$with_libidn" != "no";then
367 AC_DEFINE([HAVE_LIBIDN], 1, [Build IDNA support])
368 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
369 GNUTLS_REQUIRES_PRIVATE="Requires.private: libidn"
371 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, libidn"
377 *** libidn was not found. IDNA support will be disabled.
384 AM_CONDITIONAL(HAVE_LIBIDN, test "$with_libidn" != "no")
386 AC_ARG_ENABLE(non-suiteb-curves,
387 AS_HELP_STRING([--disable-non-suiteb-curves], [disable curves not in SuiteB]),
388 enable_non_suiteb=$enableval, enable_non_suiteb=yes)
389 if [ test "$enable_non_suiteb" = "yes" ];then
390 AC_DEFINE([ENABLE_NON_SUITEB_CURVES], 1, [Enable all curves])
392 AM_CONDITIONAL(ENABLE_NON_SUITEB_CURVES, test "$enable_non_suiteb" = "yes")
394 AM_CONDITIONAL(ENABLE_SELF_CHECKS, test "$enable_self_checks" = "yes")
395 if [ test "$enable_self_checks" = "yes" ];then
396 AC_DEFINE([ENABLE_SELF_CHECKS], 1, [Self checks are included in the library])
399 AC_MSG_CHECKING([whether to build libdane])
400 AC_ARG_ENABLE(libdane,
401 AS_HELP_STRING([--disable-libdane],
402 [disable the built of libdane]),
403 enable_dane=$enableval, enable_dane=yes)
404 AC_MSG_RESULT($enable_dane)
406 if test "$enable_dane" != "no"; then
407 LIBS="$oldlibs -lunbound"
408 AC_MSG_CHECKING([for unbound library])
409 AC_LINK_IFELSE([AC_LANG_PROGRAM([
410 #include <unbound.h>],[
412 ctx = ub_ctx_create();])],
414 AC_SUBST([UNBOUND_LIBS], [-lunbound])
415 AC_SUBST([UNBOUND_CFLAGS], [])
416 AC_DEFINE([HAVE_DANE], 1, [Enable the DANE library])
421 *** libunbound was not found. Libdane will not be built.
427 AM_CONDITIONAL(ENABLE_DANE, test "$enable_dane" = "yes")
429 AC_ARG_WITH(unbound-root-key-file, AS_HELP_STRING([--with-unbound-root-key-file],
430 [specify the unbound root key file]),
431 unbound_root_key_file="$withval",
432 if test "$have_win" = yes; then
433 unbound_root_key_file="C:\\Program Files\\Unbound\\root.key"
435 if test -f /var/lib/unbound/root.key;then
436 unbound_root_key_file="/var/lib/unbound/root.key"
438 unbound_root_key_file="/etc/unbound/root.key"
443 AC_DEFINE_UNQUOTED([UNBOUND_ROOT_KEY_FILE],
444 ["$unbound_root_key_file"], [The DNSSEC root key file])
446 AC_ARG_WITH(system-priority-file, AS_HELP_STRING([--with-system-priority-file],
447 [specify the system priority file]),
448 system_priority_file="$withval",
449 system_priority_file="/etc/gnutls/default-priorities"
452 AC_DEFINE_UNQUOTED([SYSTEM_PRIORITY_FILE],
453 ["$system_priority_file"], [The system priority file])
456 dnl Check for p11-kit
457 P11_KIT_MINIMUM=0.20.7
459 AS_HELP_STRING([--without-p11-kit],
460 [Build without p11-kit and PKCS#11 support]))
461 if test "$with_p11_kit" != "no"; then
462 PKG_CHECK_MODULES(P11_KIT, [p11-kit-1 >= $P11_KIT_MINIMUM], [with_p11_kit=yes], [with_p11_kit=no])
463 if test "$with_p11_kit" != "no";then
464 AC_DEFINE([ENABLE_PKCS11], 1, [Build PKCS#11 support])
465 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
466 GNUTLS_REQUIRES_PRIVATE="Requires.private: p11-kit-1"
468 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, p11-kit-1"
474 *** p11-kit >= $P11_KIT_MINIMUM was not found. To disable PKCS #11 support
475 *** use --without-p11-kit, otherwise you may get p11-kit from
476 *** http://p11-glue.freedesktop.org/p11-kit.html
481 AM_CONDITIONAL(ENABLE_PKCS11, test "$with_p11_kit" != "no")
484 AS_HELP_STRING([--without-tpm],
485 [Disable TPM (trousers) support.]),
486 [with_tpm=$withval], [with_tpm=yes])
487 if test "$with_tpm" != "no"; then
488 LIBS="$oldlibs -ltspi"
489 AC_MSG_CHECKING([for tss library])
490 AC_LINK_IFELSE([AC_LANG_PROGRAM([
491 #include <trousers/tss.h>
492 #include <trousers/trousers.h>],[
493 int err = Tspi_Context_Create((void *)0);
494 Trspi_Error_String(err);])],
496 AC_SUBST([TSS_LIBS], [-ltspi])
497 AC_SUBST([TSS_CFLAGS], [])
498 AC_DEFINE([HAVE_TROUSERS], 1, [Enable TPM])
503 *** trousers was not found. TPM support will be disabled.
509 AM_CONDITIONAL(ENABLE_TROUSERS, test "$with_tpm" != "no")
511 LIBOPTS_CHECK([src/libopts])
512 if test "$NEED_LIBOPTS_DIR" = "true";then
513 dnl replace libopts-generated files with distributed backups, if present
515 for i in ${srcdir}/src/*-args.c.bak ${srcdir}/src/*-args.h.bak; do
516 nam=`echo $i|sed 's/.bak//g'`
523 if test -z "$missing_baks"; then
524 AC_SUBST([AUTOGEN], [/bin/true])
526 enable_local_libopts=yes
528 enable_local_libopts=no
530 AM_CONDITIONAL(NEED_LIBOPTS, test "$enable_local_libopts" = "yes")
532 AC_CHECK_TYPE(ssize_t,
534 DEFINE_SSIZE_T="#include <sys/types.h>"
535 AC_SUBST(DEFINE_SSIZE_T)
537 AC_DEFINE([NO_SSIZE_T], 1, [no ssize_t type was found])
538 DEFINE_SSIZE_T="typedef int ssize_t;"
539 AC_SUBST(DEFINE_SSIZE_T)
541 #include <sys/types.h>
545 AC_CHECK_SIZEOF(unsigned long int, 4)
546 AC_CHECK_SIZEOF(unsigned int, 4)
548 AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib],
549 [disable zlib compression support]),
550 ac_zlib=$withval, ac_zlib=yes)
551 AC_MSG_CHECKING([whether to include zlib compression support])
552 if test x$ac_zlib != xno; then
554 AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
555 if test x$ac_cv_libz != xyes; then
558 *** ZLIB was not found. You will not be able to use ZLIB compression.)
564 PKG_CHECK_EXISTS(zlib, ZLIB_HAS_PKGCONFIG=y, ZLIB_HAS_PKGCONFIG=n)
566 if test x$ac_zlib != xno; then
567 if test "$ZLIB_HAS_PKGCONFIG" = "y" ; then
568 if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
569 GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
571 GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib"
575 AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
579 AC_ARG_WITH([default-trust-store-pkcs11],
580 [AS_HELP_STRING([--with-default-trust-store-pkcs11=URI],
581 [use the given pkcs11 uri as default trust store])])
583 if test "x$with_default_trust_store_pkcs11" != x; then
584 if test "x$with_p11_kit" = xno; then
585 AC_MSG_ERROR([cannot use pkcs11 store without p11-kit])
587 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_PKCS11],
588 ["$with_default_trust_store_pkcs11"], [use the given pkcs11 uri as default trust store])
591 AC_ARG_WITH([default-trust-store-dir],
592 [AS_HELP_STRING([--with-default-trust-store-dir=DIR],
593 [use the given directory as default trust store])])
595 if test "x$with_default_trust_store_dir" != x; then
596 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_DIR],
597 ["$with_default_trust_store_dir"], [use the given directory as default trust store])
600 dnl auto detect http://lists.gnu.org/archive/html/help-gnutls/2012-05/msg00004.html
601 AC_ARG_WITH([default-trust-store-file],
602 [AS_HELP_STRING([--with-default-trust-store-file=FILE],
603 [use the given file default trust store])], with_default_trust_store_file="$withval",
604 [if test "$build" = "$host" && test x$with_default_trust_store_pkcs11 = x && test x$with_default_trust_store_dir = x;then
606 /etc/ssl/ca-bundle.pem \
607 /etc/ssl/certs/ca-certificates.crt \
608 /etc/pki/tls/cert.pem \
609 /usr/local/share/certs/ca-root-nss.crt \
612 if test -e "$i"; then
613 with_default_trust_store_file="$i"
620 if test "$with_default_trust_store_file" = "no";then
621 with_default_trust_store_file=""
624 AC_ARG_WITH([default-crl-file],
625 [AS_HELP_STRING([--with-default-crl-file=FILE],
626 [use the given CRL file as default])])
628 AC_ARG_WITH([default-blacklist-file],
629 [AS_HELP_STRING([--with-default-blacklist-file=FILE],
630 [use the given certificate blacklist file as default])])
632 if test "x$with_default_trust_store_file" != x; then
633 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_FILE],
634 ["$with_default_trust_store_file"], [use the given file default trust store])
637 if test "x$with_default_crl_file" != x; then
638 AC_DEFINE_UNQUOTED([DEFAULT_CRL_FILE],
639 ["$with_default_crl_file"], [use the given CRL file])
642 if test "x$with_default_blacklist_file" != x; then
643 AC_DEFINE_UNQUOTED([DEFAULT_BLACKLIST_FILE],
644 ["$with_default_blacklist_file"], [use the given certificate blacklist file])
648 opt_guile_bindings=yes
649 AC_MSG_CHECKING([whether building Guile bindings])
651 AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
652 opt_guile_bindings=$enableval)
653 AC_MSG_RESULT($opt_guile_bindings)
655 AC_ARG_WITH([guile-site-dir],
656 [AS_HELP_STRING([--with-guile-site-dir],
657 [use the given directory as the Guile site (use with care)])])
659 if test "$opt_guile_bindings" = "yes"; then
661 *** Detecting GNU Guile...
664 AC_PATH_PROG([guile_snarf], [guile-snarf])
665 if test "x$guile_snarf" = "x"; then
666 AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found. Guile bindings not built.])
667 opt_guile_bindings=no
672 save_CFLAGS="$CFLAGS"
674 CFLAGS="$CFLAGS $GUILE_CFLAGS"
675 LIBS="$LIBS $GUILE_LDFLAGS"
676 AC_MSG_CHECKING([whether GNU Guile is recent enough])
677 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [scm_from_locale_string ("")])],
678 [], [opt_guile_bindings=no])
679 CFLAGS="$save_CFLAGS"
682 if test "$opt_guile_bindings" = "yes"; then
684 case "x$with_guile_site_dir" in
686 # Use the default $(GUILE_SITE).
690 # Automatically derive $(GUILE_SITE) from $(pkgdatadir). This
691 # hack is used to allow `distcheck' to work (see
692 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
693 GUILE_SITE="\$(datadir)/guile/site"
697 # Use the user-specified directory as $(GUILE_SITE).
698 GUILE_SITE="$with_guile_site_dir"
702 AC_MSG_CHECKING([whether gcc supports -fgnu89-inline])
703 _gcc_cflags_save="$CFLAGS"
704 CFLAGS="${CFLAGS} -fgnu89-inline"
705 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
706 gnu89_inline=yes, gnu89_inline=no)
707 AC_MSG_RESULT($gnu89_inline)
708 CFLAGS="$_gcc_cflags_save"
710 # Optional Guile functions.
711 save_CFLAGS="$CFLAGS"
713 CFLAGS="$CFLAGS $GUILE_CFLAGS"
714 LIBS="$LIBS $GUILE_LDFLAGS"
715 AC_CHECK_FUNCS([scm_gc_malloc_pointerless])
716 CFLAGS="$save_CFLAGS"
719 # The place where guile-gnutls.la will go.
720 AC_MSG_CHECKING([the Guile effective version])
721 guile_effective_version="`$GUILE -c '(display (effective-version))'`"
722 AC_MSG_RESULT([$guile_effective_version])
723 guileextensiondir="$libdir/guile/$guile_effective_version"
724 AC_SUBST([guileextensiondir])
727 AC_MSG_WARN([A sufficiently recent GNU Guile not found. Guile bindings not built.])
728 opt_guile_bindings=no
732 AM_CONDITIONAL(HAVE_GUILE, test "$opt_guile_bindings" = "yes")
734 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS"
735 LIBGNUTLS_CFLAGS="-I${includedir}"
736 AC_SUBST(LIBGNUTLS_LIBS)
737 AC_SUBST(LIBGNUTLS_CFLAGS)
739 AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
741 AC_DEFINE([GNUTLS_COMPAT_H], 1, [Make sure we don't use old features in code.])
742 AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
744 AC_DEFINE([fread_file], [_gnutls_fread_file], [static lib rename])
745 AC_DEFINE([read_file], [_gnutls_read_file], [static lib rename])
746 AC_DEFINE([read_binary_file], [_gnutls_read_binary_file], [static lib rename])
748 dnl Crywrap dependencies
750 *** Checking dependencies for crywrap...
755 if test "$have_win" != "yes"; then
757 AC_CHECK_HEADERS([arpa/inet.h netinet/in.h sys/select.h sys/types.h sys/wait.h])
759 dnl **********************
761 dnl **********************
762 AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
763 [AC_LANG_PROGRAM([#include <sys/types.h>
766 [return *(signal (0, 0)) (0) == 1;])],
767 [ac_cv_type_signal=int],
768 [ac_cv_type_signal=void])])
769 AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
772 AC_FUNC_SELECT_ARGTYPES
773 AC_CHECK_FUNCS([alarm atexit dup2 epoll_create kqueue memchr memset munmap \
774 putenv regcomp scandir select socket strcasecmp strchr \
775 strdup strerror strncasecmp strrchr strstr strtoul uname])
777 AC_ARG_ENABLE(crywrap,
778 AS_HELP_STRING([--disable-crywrap], [unconditionally disable the crywrap TLS proxy service]))
781 if test "x$enable_crywrap" != "xno" ; then
782 AC_CHECK_FUNCS([argp_usage],[ac_argp=yes],[ac_argp=no])
785 if test "$ac_cv_func_daemon" != "no" && test "$ac_argp" != "no" && test "$with_libidn" != "no";then
791 AM_CONDITIONAL(ENABLE_CRYWRAP, test "x$crywrap" != "xno")
793 dnl end of crywrap requirements
795 dnl Some variables needed in makefiles
797 AC_SUBST([YEAR], $YEAR)
799 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
803 doc/credentials/Makefile
804 doc/credentials/openpgp/Makefile
805 doc/credentials/srp/Makefile
806 doc/credentials/x509/Makefile
809 doc/examples/Makefile
811 doc/manpages/Makefile
812 doc/reference/Makefile
813 doc/reference/version.xml
816 extra/includes/Makefile
818 libdane/includes/Makefile
819 libdane/gnutls-dane.pc
823 guile/modules/Makefile
827 lib/accelerated/Makefile
828 lib/accelerated/x86/Makefile
829 lib/algorithms/Makefile
834 lib/includes/Makefile
835 lib/includes/gnutls/gnutls.h
836 lib/minitasn1/Makefile
846 tests/cert-tests/Makefile
851 tests/key-tests/Makefile
852 tests/openpgp-certs/Makefile
853 tests/pkcs1-padding/Makefile
854 tests/pkcs12-decode/Makefile
855 tests/pkcs8-decode/Makefile
856 tests/rsa-md5-collision/Makefile
857 tests/safe-renegotiation/Makefile
858 tests/scripts/Makefile
862 tests/userid/Makefile
867 dnl Warning flags: errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
868 dnl Valgrind: $opt_valgrind_tests ${VALGRIND}
869 AC_MSG_NOTICE([summary of build options:
871 version: ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
872 Host/Target system: ${host}
873 Build system: ${build}
874 Install prefix: ${prefix}
877 Library types: Shared=${enable_shared}, Static=${enable_static}
878 Local libopts: ${enable_local_libopts}
879 Local libtasn1: ${included_libtasn1}
880 Use nettle-mini: ${mini_nettle}
883 AC_MSG_NOTICE([External hardware support:
885 /dev/crypto: $enable_cryptodev
886 Hardware accel: $hw_accel
887 Padlock accel: $use_padlock
888 getrandom variant: $enable_getrandom
889 PKCS#11 support: $with_p11_kit
890 TPM support: $with_tpm
893 AC_MSG_NOTICE([Optional features:
894 (note that included applications might not compile properly
895 if features are disabled)
897 DTLS-SRTP support: $ac_enable_srtp
898 ALPN support: $ac_enable_alpn
899 OCSP support: $ac_enable_ocsp
900 Ses. ticket support: $ac_enable_session_tickets
901 OpenPGP support: $ac_enable_openpgp
902 SRP support: $ac_enable_srp
903 PSK support: $ac_enable_psk
904 DHE support: $ac_enable_dhe
905 ECDHE support: $ac_enable_ecdhe
906 Anon auth support: $ac_enable_anon
907 Heartbeat support: $ac_enable_heartbeat
908 IDNA support: $with_libidn
909 Unicode support: $ac_have_unicode
910 Self checks: $enable_self_checks
911 Non-SuiteB curves: $enable_non_suiteb
912 FIPS140 mode: $enable_fips
915 AC_MSG_NOTICE([Optional applications:
917 crywrap app: $crywrap
920 AC_MSG_NOTICE([Optional libraries:
922 Guile wrappers: $opt_guile_bindings
923 C++ library: $use_cxx
924 DANE library: $enable_dane
925 OpenSSL compat: $enable_openssl
928 AC_MSG_NOTICE([System files:
930 Trust store pkcs11: $with_default_trust_store_pkcs11
931 Trust store dir: $with_default_trust_store_dir
932 Trust store file: $with_default_trust_store_file
933 Blacklist file: $with_default_blacklist_file
934 CRL file: $with_default_crl_file
935 Priority file: $system_priority_file
936 DNSSEC root key file: $unbound_root_key_file
939 if test ! -f "$unbound_root_key_file"; then
942 *** The DNSSEC root key file in $unbound_root_key_file was not found.
943 *** This file is needed for the verification of DNSSEC responses.
944 *** Use the command: unbound-anchor -a "$unbound_root_key_file"
945 *** to generate or update it.