Blame configure.ac

Packit aea12f
dnl Process this file with autoconf to produce a configure script.
Packit Service 991b93
# Copyright (C) 2000-2012, 2016, 2019 Free Software Foundation, Inc.
Packit aea12f
#
Packit aea12f
# Author: Nikos Mavrogiannopoulos, Simon Josefsson
Packit aea12f
#
Packit aea12f
# This file is part of GnuTLS.
Packit aea12f
#
Packit aea12f
# This program is free software; you can redistribute it and/or modify
Packit aea12f
# it under the terms of the GNU General Public License as published by
Packit aea12f
# the Free Software Foundation; either version 3 of the License, or
Packit aea12f
# (at your option) any later version.
Packit aea12f
#
Packit aea12f
# This program is distributed in the hope that it will be useful, but
Packit aea12f
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit aea12f
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit aea12f
# General Public License for more details.
Packit aea12f
#
Packit aea12f
# You should have received a copy of the GNU General Public License
Packit aea12f
# along with this program; if not, write to the Free Software
Packit aea12f
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
Packit aea12f
# USA
Packit aea12f
Packit aea12f
AC_PREREQ(2.63)
Packit aea12f
Packit aea12f
dnl when updating version also update LT_REVISION in m4/hooks.m4
Packit Service 991b93
AC_INIT([GnuTLS], [3.6.14], [bugs@gnutls.org])
Packit aea12f
AC_CONFIG_AUX_DIR([build-aux])
Packit aea12f
AC_CONFIG_MACRO_DIRS([m4 src/gl/m4 src/libopts/m4 lib/unistring/m4])
Packit aea12f
AC_CANONICAL_HOST
Packit aea12f
Packit aea12f
AM_INIT_AUTOMAKE([1.12.2 foreign subdir-objects no-dist-gzip dist-xz -Wall -Wno-override])
Packit aea12f
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Packit aea12f
AC_CONFIG_HEADERS([config.h])
Packit aea12f
Packit aea12f
AC_MSG_RESULT([***
Packit aea12f
*** Checking for compilation programs...
Packit aea12f
])
Packit aea12f
Packit aea12f
dnl Checks for programs.
Packit aea12f
PKG_PROG_PKG_CONFIG
Packit aea12f
AC_PROG_CC
Packit aea12f
gl_EARLY
Packit aea12f
ggl_EARLY
Packit aea12f
unistring_EARLY
Packit aea12f
AM_PROG_AS
Packit aea12f
AM_PROG_AR
Packit aea12f
AC_PROG_CXX
Packit aea12f
AM_PROG_CC_C_O
Packit aea12f
AC_PROG_YACC
Packit aea12f
AC_PROG_SED
Packit aea12f
Packit aea12f
AC_USE_SYSTEM_EXTENSIONS
Packit aea12f
Packit aea12f
#
Packit aea12f
# Require C99 support
Packit aea12f
#    
Packit aea12f
AC_PROG_CC_C99
Packit aea12f
if test "$ac_cv_prog_cc_c99" = "no"; then
Packit aea12f
  AC_MSG_WARN([[Compiler does not support C99. It may not be able to compile the project.]])
Packit aea12f
fi
Packit aea12f
Packit aea12f
AX_CODE_COVERAGE
Packit aea12f
Packit aea12f
AM_MAINTAINER_MODE([enable])
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(bash-tests,
Packit aea12f
  AS_HELP_STRING([--disable-bash-tests], [skip some tests that badly need bash]),
Packit aea12f
    enable_bash_tests=$enableval, enable_bash_tests=yes)
Packit aea12f
AM_CONDITIONAL(DISABLE_BASH_TESTS, test "$enable_bash_tests" != "yes")
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(doc,
Packit aea12f
  AS_HELP_STRING([--disable-doc], [don't generate any documentation]),
Packit aea12f
    enable_doc=$enableval, enable_doc=yes)
Packit aea12f
AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" != "no")
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(manpages,
Packit aea12f
  AS_HELP_STRING([--enable-manpages], [install manpages even if disable-doc is given]),
Packit aea12f
    enable_manpages=$enableval,enable_manpages=auto)
Packit aea12f
Packit aea12f
if test "${enable_manpages}" = "auto";then
Packit aea12f
  enable_manpages="${enable_doc}"
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL(ENABLE_MANPAGES, test "$enable_manpages" != "no")
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(tools,
Packit aea12f
  AS_HELP_STRING([--disable-tools], [don't compile any tools]),
Packit aea12f
    enable_tools=$enableval, enable_tools=yes)
Packit aea12f
AM_CONDITIONAL(ENABLE_TOOLS, test "$enable_tools" != "no")
Packit aea12f
Packit aea12f
# For includes/gnutls/gnutls.h.in.
Packit aea12f
AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
Packit aea12f
AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
Packit aea12f
AC_SUBST(PATCH_VERSION, [[`echo $PACKAGE_VERSION | sed 's/.*\..*\.\([0-9]*\).*/\1/g'`]])
Packit aea12f
AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
Packit aea12f
Packit aea12f
dnl C and C++ capabilities
Packit aea12f
AC_C_INLINE
Packit aea12f
AC_HEADER_STDC
Packit aea12f
Packit aea12f
# For the C++ code
Packit aea12f
AC_ARG_ENABLE(cxx,
Packit aea12f
  AS_HELP_STRING([--disable-cxx], [unconditionally disable the C++ library]),
Packit aea12f
    use_cxx=$enableval, use_cxx=yes)
Packit aea12f
if test "$use_cxx" != "no"; then
Packit aea12f
  AC_LANG_PUSH(C++)
Packit aea12f
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
Packit aea12f
  AC_LANG_POP(C++)
Packit aea12f
fi
Packit aea12f
AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
Packit aea12f
Packit aea12f
dnl Detect windows build
Packit aea12f
use_accel=yes
Packit Service 991b93
have_vista_dynamic=yes
Packit aea12f
case "$host" in
Packit aea12f
  *android*)
Packit aea12f
    have_android=yes
Packit aea12f
    have_elf=yes
Packit aea12f
  ;;
Packit aea12f
  *mingw32* | *mingw64*)
Packit aea12f
    have_win=yes
Packit aea12f
    AC_DEFINE([_UNICODE], [1], [Defined to 1 for Unicode (wide chars) APIs])
Packit Service 991b93
    LIB_CRYPT32="-lcrypt32"
Packit Service 991b93
    AC_SUBST([LIB_CRYPT32])
Packit Service 991b93
    AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
Packit Service 991b93
      [[#include <windows.h>
Packit Service 991b93
       #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600
Packit Service 991b93
       # error Vista APIs allowed statically
Packit Service 991b93
       #endif
Packit Service 991b93
      ]],[[;]])],[have_vista_dynamic=yes],[have_vista_dynamic=no])
Packit Service 991b93
    AC_ARG_ENABLE(dyn_ncrypt,
Packit Service 991b93
      AS_HELP_STRING([--enable-dyn-ncrypt], [use ncrypt dynamically]),
Packit Service 991b93
      enable_dyn_ncrypt=$enableval, enable_dyn_ncrypt=$have_vista_dynamic
Packit Service 991b93
    )
Packit Service 991b93
    if test "x$enable_dyn_ncrypt" = "xyes"; then
Packit Service 991b93
      AC_DEFINE([DYN_NCRYPT], 1, [Dynamic use of ncrypt API (win32)])
Packit Service 991b93
    else
Packit Service 991b93
      LIBNCRYPT="-lncrypt"
Packit Service 991b93
    fi
Packit Service 991b93
    AC_SUBST([LIBNCRYPT])
Packit aea12f
  ;;
Packit aea12f
  *darwin*)
Packit aea12f
    have_macosx=yes
Packit aea12f
    save_LDFLAGS="$LDFLAGS"
Packit aea12f
    dnl Try to use -no_weak_imports if available. This makes sure we
Packit aea12f
    dnl error out when linking to a function that doesn't exist in the
Packit aea12f
    dnl intended minimum runtime version.
Packit aea12f
    LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
Packit aea12f
    AC_MSG_CHECKING([whether the linker supports -Wl,-no_weak_imports])
Packit Service 991b93
    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/select.h>], [fd_set rfds; FD_ZERO(&rfds); FD_SET(0, &rfds);])],
Packit aea12f
      [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); LDFLAGS="$save_LDFLAGS"])
Packit aea12f
  ;;
Packit aea12f
  *solaris*)
Packit aea12f
    have_elf=yes
Packit aea12f
    use_accel=no
Packit aea12f
    AC_MSG_WARN([[
Packit aea12f
***
Packit aea12f
*** In solaris hardware acceleration is disabled by default due to issues
Packit aea12f
*** with the assembler. Use --enable-hardware-acceleration to enable it.
Packit aea12f
*** ]])
Packit aea12f
  ;;
Packit aea12f
  *)
Packit aea12f
    have_elf=yes
Packit aea12f
  ;;
Packit aea12f
esac
Packit aea12f
Packit aea12f
AM_CONDITIONAL(ANDROID, test "$have_android" = yes)
Packit aea12f
AM_CONDITIONAL(WINDOWS, test "$have_win" = yes)
Packit aea12f
AM_CONDITIONAL(MACOSX, test "$have_macosx" = yes)
Packit aea12f
AM_CONDITIONAL(ELF, test "$have_elf" = yes)
Packit aea12f
Packit aea12f
dnl Hardware Acceleration
Packit aea12f
AC_ARG_ENABLE(hardware-acceleration,
Packit aea12f
  AS_HELP_STRING([--disable-hardware-acceleration], [unconditionally disable hardware acceleration]),
Packit aea12f
    use_accel=$enableval)
Packit aea12f
hw_accel=none
Packit aea12f
Packit aea12f
Packit aea12f
use_padlock=no
Packit aea12f
if test "$use_accel" != "no"; then
Packit aea12f
case $host_cpu in
Packit aea12f
  armv8 | aarch64)
Packit aea12f
      hw_accel="aarch64"
Packit aea12f
      case $host_os in
Packit aea12f
        *_ilp32)
Packit aea12f
	  dnl ILP32 not supported in assembler yet
Packit aea12f
	  hw_accel="none"
Packit aea12f
        ;;
Packit aea12f
      esac
Packit aea12f
  ;;
Packit aea12f
  i?86 | x86_64 | amd64)
Packit aea12f
      AC_CHECK_HEADERS(cpuid.h)
Packit aea12f
      if test "$host_cpu" = "x86_64" || test "$host_cpu" = "amd64"; then
Packit aea12f
        hw_accel="x86-64"
Packit aea12f
      else
Packit aea12f
        hw_accel="x86"
Packit aea12f
      fi
Packit aea12f
      use_padlock=yes
Packit aea12f
  ;;
Packit aea12f
  *)
Packit aea12f
  ;;
Packit aea12f
esac
Packit aea12f
Packit Service 991b93
# check for gcc's __get_cpuid_count functionality
Packit Service 991b93
AC_MSG_CHECKING([for __get_cpuid_count])
Packit Service 991b93
AC_LINK_IFELSE(
Packit Service 991b93
   [AC_LANG_SOURCE([
Packit Service 991b93
    #include <cpuid.h>
Packit Service 991b93
    int main(void) { unsigned t1; return __get_cpuid_count(7, 0, &t1, &t1, &t1, &t1;; }
Packit Service 991b93
   ])],
Packit Service 991b93
   [AC_DEFINE([HAVE_GET_CPUID_COUNT], [1], [use __get_cpuid_count]) AC_MSG_RESULT([yes])],
Packit Service 991b93
   [AC_MSG_RESULT([no])]
Packit Service 991b93
)
Packit Service 991b93
Packit aea12f
fi
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(tls13-interop,
Packit aea12f
  AS_HELP_STRING([--disable-tls13-interop], [disable TLS1.3 interoperability testing with openssl]),
Packit aea12f
    enable_tls13_interop=$enableval, enable_tls13_interop=yes)
Packit aea12f
Packit aea12f
AM_CONDITIONAL(ENABLE_TLS13_INTEROP, test "$enable_tls13_interop" != "no")
Packit aea12f
Packit aea12f
dnl Check for iovec type
Packit aea12f
AC_CHECK_MEMBERS([struct iovec.iov_base],
Packit aea12f
      [
Packit aea12f
        AC_SUBST([DEFINE_IOVEC_T], ["#include <sys/uio.h>
Packit aea12f
typedef struct iovec giovec_t;"])
Packit aea12f
      ],
Packit aea12f
      [
Packit aea12f
        AC_SUBST([DEFINE_IOVEC_T], ["typedef struct {
Packit aea12f
    void *iov_base;
Packit aea12f
    size_t iov_len;
Packit aea12f
} giovec_t;"])
Packit aea12f
      ],
Packit aea12f
      [#include <sys/uio.h>
Packit aea12f
      ])
Packit aea12f
AM_SUBST_NOTMAKE([DEFINE_IOVEC_T])
Packit aea12f
Packit aea12f
dnl Need netinet/tcp.h for TCP_FASTOPEN
Packit aea12f
AC_CHECK_HEADERS([netinet/tcp.h])
Packit aea12f
AC_CHECK_HEADERS([stdatomic.h])
Packit aea12f
Packit aea12f
dnl This ensures that we link with the right library for atomic operations on Linux SPARC
Packit aea12f
save_LIBS=$LIBS
Packit aea12f
AC_SEARCH_LIBS([__atomic_load_4], [atomic], [], [AC_MSG_NOTICE([Could not detect libatomic])])
Packit aea12f
LIBS=$save_LIBS
Packit aea12f
Packit aea12f
AS_IF([test "$ac_cv_search___atomic_load_4" = "none required" || test "$ac_cv_search___atomic_load_4" = "no"],
Packit aea12f
      [AC_SUBST([LIBATOMIC_LIBS], [])],
Packit aea12f
      [AC_SUBST([LIBATOMIC_LIBS], [$ac_cv_search___atomic_load_4])])
Packit aea12f
Packit aea12f
dnl We use its presence to detect C11 threads
Packit aea12f
AC_CHECK_HEADERS([threads.h])
Packit aea12f
Packit Service 991b93
AC_CHECK_HEADERS([valgrind/memcheck.h])
Packit Service 991b93
Packit aea12f
AC_ARG_ENABLE(padlock,
Packit aea12f
  AS_HELP_STRING([--disable-padlock], [unconditionally disable padlock acceleration]),
Packit aea12f
    use_padlock=$enableval)
Packit aea12f
Packit aea12f
if test "$use_padlock" != "no"; then
Packit aea12f
    AC_DEFINE([ENABLE_PADLOCK], 1, [Enable padlock acceleration])
Packit aea12f
    AC_SUBST([ENABLE_PADLOCK])
Packit aea12f
fi
Packit aea12f
AM_CONDITIONAL(ENABLE_PADLOCK, test "$use_padlock" = "yes")
Packit aea12f
AM_CONDITIONAL(ASM_AARCH64, test x"$hw_accel" = x"aarch64")
Packit aea12f
AM_CONDITIONAL(ASM_X86_64, test x"$hw_accel" = x"x86-64")
Packit aea12f
AM_CONDITIONAL(ASM_X86_32, test x"$hw_accel" = x"x86")
Packit aea12f
AM_CONDITIONAL(ASM_X86, test x"$hw_accel" = x"x86" || test x"$hw_accel" = x"x86-64")
Packit aea12f
AM_CONDITIONAL(HAVE_GCC_GNU89_INLINE_OPTION, test "$gnu89_inline" = "yes"])
Packit aea12f
AM_CONDITIONAL(HAVE_GCC, test "$GCC" = "yes")
Packit aea12f
Packit aea12f
dnl check for getrandom()
Packit aea12f
rnd_variant="auto-detect"
Packit aea12f
AC_MSG_CHECKING([for getrandom])
Packit aea12f
AC_LINK_IFELSE([AC_LANG_PROGRAM([
Packit aea12f
	   #include <sys/random.h>],[
Packit aea12f
		   getrandom(0, 0, 0);
Packit aea12f
		  ])],
Packit aea12f
		  [AC_MSG_RESULT(yes)
Packit aea12f
		   AC_DEFINE([HAVE_GETRANDOM], 1, [Enable the Linux getrandom function])
Packit aea12f
		   rnd_variant=getrandom],
Packit aea12f
		  [AC_MSG_RESULT(no)])
Packit aea12f
Packit Service 991b93
AC_MSG_CHECKING([for KERN_ARND])
Packit Service 991b93
AC_LINK_IFELSE([AC_LANG_PROGRAM([
Packit Service 991b93
	   #include <sys/sysctl.h>
Packit Service 991b93
           #ifdef __linux__
Packit Service 991b93
           #error 1
Packit Service 991b93
           #endif
Packit Service 991b93
           static int name[] = {CTL_KERN, KERN_ARND};
Packit Service 991b93
	   ],[
Packit Service 991b93
		   sysctl(0, 0, 0, 0, 0, 0);
Packit Service 991b93
		  ])],
Packit Service 991b93
		  [AC_MSG_RESULT(yes)
Packit Service 991b93
		   AC_DEFINE([HAVE_KERN_ARND], 1, [Enable the BSD sysctl(KERN_ARND) function])
Packit Service 991b93
		   rnd_variant=kern_arnd],
Packit Service 991b93
		  [AC_MSG_RESULT(no)])
Packit Service 991b93
Packit Service 991b93
AM_CONDITIONAL(HAVE_KERN_ARND, test "$rnd_variant" = "kern_arnd")
Packit Service 991b93
Packit aea12f
AC_MSG_CHECKING([for getentropy])
Packit aea12f
AC_LINK_IFELSE([AC_LANG_PROGRAM([
Packit aea12f
	   #include <unistd.h>
Packit aea12f
           #ifdef __APPLE__
Packit aea12f
           #include <sys/random.h>
Packit aea12f
           #endif
Packit aea12f
           #ifdef __linux__
Packit aea12f
           #error 1
Packit aea12f
           #endif
Packit aea12f
	   ],[
Packit aea12f
		   getentropy(0, 0);
Packit aea12f
		  ])],
Packit aea12f
		  [AC_MSG_RESULT(yes)
Packit aea12f
		   AC_DEFINE([HAVE_GETENTROPY], 1, [Enable the OpenBSD getentropy function])
Packit aea12f
		   rnd_variant=getentropy],
Packit aea12f
		  [AC_MSG_RESULT(no)])
Packit aea12f
Packit aea12f
AM_CONDITIONAL(HAVE_GETENTROPY, test "$rnd_variant" = "getentropy")
Packit aea12f
Packit aea12f
dnl Try the hooks.m4
Packit aea12f
LIBGNUTLS_HOOKS
Packit aea12f
LIBGNUTLS_EXTRA_HOOKS
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(tests,
Packit aea12f
  AS_HELP_STRING([--disable-tests], [don't compile or run any tests]),
Packit aea12f
    enable_tests=$enableval, enable_tests=$enable_tools)
Packit aea12f
AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" != "no")
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(fuzzer-target,
Packit aea12f
  AS_HELP_STRING([--enable-fuzzer-target], [make a library intended for testing - not production]),
Packit aea12f
    enable_fuzzer_target=$enableval, enable_fuzzer_target=no)
Packit aea12f
if test "$enable_fuzzer_target" != "no";then
Packit aea12f
	AC_DEFINE([FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION], 1, [Enable fuzzer target -not for production])
Packit aea12f
fi
Packit aea12f
Packit aea12f
dnl
Packit aea12f
dnl check for gtk-doc
Packit aea12f
dnl
Packit aea12f
m4_ifdef([GTK_DOC_CHECK], [
Packit aea12f
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
Packit aea12f
],[
Packit aea12f
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
Packit aea12f
])
Packit aea12f
# needed for some older versions of gtk-doc
Packit aea12f
m4_ifdef([GTK_DOC_USE_LIBTOOL], [], [
Packit aea12f
AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], false)
Packit aea12f
])
Packit aea12f
Packit aea12f
AM_GNU_GETTEXT([external])
Packit aea12f
AM_GNU_GETTEXT_VERSION([0.19])
Packit aea12f
Packit aea12f
AC_C_BIGENDIAN
Packit aea12f
Packit aea12f
dnl No fork on MinGW, disable some self-tests until we fix them.
Packit aea12f
dnl Check clock_gettime and pthread_mutex_lock in libc (avoid linking to other libs)
Packit aea12f
AC_CHECK_FUNCS([fork setitimer getrusage getpwuid_r nanosleep daemon getpid localtime mmap explicit_bzero],,)
Packit aea12f
dnl Manually check some functions by including headers first. On macOS, you
Packit aea12f
dnl normally only have the latest SDK available, containing all existing
Packit aea12f
dnl functions, but having them restricted according to target version in
Packit aea12f
dnl headers. If we bypass the headers and just try linking (as AC_CHECK_FUNCS
Packit aea12f
dnl does), we will accidentally detect functions which we shouldn't use. Set
Packit aea12f
dnl ac_cv_func_* as well, to avoid later AC_CHECK_FUNCS from other included
Packit aea12f
dnl scripts from overriding it.
Packit aea12f
AC_MSG_CHECKING([for clock_gettime])
Packit aea12f
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [clock_gettime(0, 0);])],
Packit aea12f
  [AC_MSG_RESULT(yes); ac_cv_func_clock_gettime=yes
Packit aea12f
  AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Define to 1 if you have the `clock_gettime' function.])],
Packit aea12f
  [AC_MSG_RESULT(no); ac_cv_func_clock_gettime=no])
Packit aea12f
AC_MSG_CHECKING([for fmemopen])
Packit aea12f
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [fmemopen(0, 0, 0);])],
Packit aea12f
  [AC_MSG_RESULT(yes); ac_cv_func_fmemopen=yes
Packit aea12f
  AC_DEFINE([HAVE_FMEMOPEN], 1, [Define to 1 if you have the `fmemopen' function.])],
Packit aea12f
  [AC_MSG_RESULT(no); ac_cv_func_fmemopen=no])
Packit aea12f
Packit aea12f
AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
Packit aea12f
Packit aea12f
AC_CHECK_FUNCS([__register_atfork secure_getenv getauxval],,)
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(seccomp-tests,
Packit aea12f
  AS_HELP_STRING([--enable-seccomp-tests], [unconditionally enable tests with seccomp]),
Packit aea12f
    seccomp_tests=$enableval, seccomp_tests=no)
Packit aea12f
Packit aea12f
AM_CONDITIONAL(HAVE_SECCOMP_TESTS, test "$seccomp_tests" = "yes")
Packit aea12f
Packit aea12f
# check for libseccomp - used in test programs
Packit aea12f
AC_LIB_HAVE_LINKFLAGS(seccomp,, [#include <seccomp.h>  
Packit aea12f
], [seccomp_init(0);])
Packit aea12f
Packit aea12f
# check for libcrypto - used in test programs
Packit aea12f
AC_LIB_HAVE_LINKFLAGS(crypto,, [#include <openssl/evp.h>  
Packit aea12f
], [EVP_CIPHER_CTX_init(NULL);])
Packit aea12f
Packit aea12f
AM_CONDITIONAL(HAVE_LIBCRYPTO, test "$HAVE_LIBCRYPTO" = "yes")
Packit aea12f
Packit aea12f
AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>
Packit aea12f
#include <signal.h>
Packit aea12f
], [timer_create (0,0,0);])
Packit aea12f
Packit aea12f
if test "$have_win" != "yes";then
Packit aea12f
  AC_CHECK_FUNCS([pthread_mutex_lock],,)
Packit aea12f
  if test "$ac_cv_func_pthread_mutex_lock" != "yes";then
Packit aea12f
    AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
Packit aea12f
  fi
Packit aea12f
fi
Packit aea12f
Packit aea12f
if test "$ac_cv_func_nanosleep" != "yes";then
Packit aea12f
  AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [nanosleep (0, 0);])
Packit aea12f
  gnutls_needs_librt=yes
Packit aea12f
fi
Packit aea12f
Packit aea12f
if test "$ac_cv_func_clock_gettime" != "yes";then
Packit aea12f
  AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [clock_gettime (0, 0);])
Packit aea12f
  gnutls_needs_librt=yes
Packit aea12f
fi
Packit aea12f
Packit aea12f
AC_ARG_WITH(included-unistring, AS_HELP_STRING([--with-included-unistring],
Packit aea12f
                                 [disable linking with system libunistring]),
Packit aea12f
            included_unistring="$withval", 
Packit aea12f
            included_unistring=no)
Packit aea12f
Packit aea12f
if test "$included_unistring" = yes;then
Packit aea12f
  ac_have_unistring=no
Packit aea12f
else
Packit aea12f
  save_LIBS=$LIBS
Packit aea12f
  AC_SEARCH_LIBS(u8_normalize, unistring, [
Packit aea12f
    included_unistring=no
Packit aea12f
    ac_have_unistring=yes
Packit aea12f
    AC_SUBST([LIBUNISTRING], [$ac_cv_search_u8_normalize])
Packit aea12f
  ], [
Packit aea12f
    ac_cv_libunistring=no
Packit aea12f
    AC_MSG_ERROR([[
Packit aea12f
  ***
Packit aea12f
  *** Libunistring was not found. To use the included one, use --with-included-unistring
Packit aea12f
    ]])
Packit aea12f
  ])
Packit aea12f
  LIBS=$save_LIBS
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL(HAVE_LIBUNISTRING, test "$ac_have_unistring" = "yes")
Packit aea12f
Packit aea12f
dnl Note that g*l_INIT are run after we check for library capabilities,
Packit aea12f
dnl to prevent issues from caching lib dependencies. See discussion
Packit aea12f
dnl in https://bugs.gentoo.org/show_bug.cgi?id=494940 and
Packit aea12f
dnl https://gnu-autoconf.7623.n7.nabble.com/Correct-way-to-check-for-clock-gettime-td12276.html
Packit aea12f
gl_INIT
Packit aea12f
ggl_INIT
Packit aea12f
unistring_INIT
Packit aea12f
Packit aea12f
# disable the extended test suite at tests/suite if asked, or if we are not running in git master
Packit aea12f
AC_ARG_ENABLE(full-test-suite,
Packit aea12f
  AS_HELP_STRING([--disable-full-test-suite], [disable running very slow components of test suite]),
Packit aea12f
    full_test_suite=$enableval, full_test_suite=yes)
Packit aea12f
Packit aea12f
# test if we are in git master or in release build. In release
Packit aea12f
# builds we do not use valgrind.
Packit Service 991b93
SUITE_FILE="${srcdir}/tests/suite/prime-check.c"
Packit aea12f
if test "$full_test_suite" = yes && test ! -f "$SUITE_FILE";then
Packit aea12f
	full_test_suite=no
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL(WANT_TEST_SUITE, test "$full_test_suite" = "yes")
Packit aea12f
Packit Service 991b93
AC_ARG_ENABLE(oldgnutls-interop,
Packit Service 991b93
  AS_HELP_STRING([--enable-oldgnutls-interop], [enable interoperability testing with old gnutls version]),
Packit Service 991b93
    enable_oldgnutls_interop=$enableval, enable_oldgnutls_interop=no)
Packit Service 991b93
Packit Service 991b93
if test "$enable_oldgnutls_interop" != "no" && test "$full_test_suite" != yes;then
Packit Service 991b93
	AC_MSG_ERROR([cannot --enable-oldgnutls-interop without --enable-full-test-suite])
Packit Service 991b93
fi
Packit Service 991b93
Packit Service 991b93
AM_CONDITIONAL(ENABLE_OLDGNUTLS_INTEROP, test "$enable_oldgnutls_interop" != "no")
Packit Service 991b93
Packit Service 991b93
# check for libev - used in full test suite
Packit Service 991b93
AC_LIB_HAVE_LINKFLAGS(ev,, [#include <ev.h>], [ev_run(0,0);])
Packit Service 991b93
if test "$ac_cv_libev" = yes; then
Packit Service 991b93
        AC_SUBST([LIBEV_LIBS], [$LIBEV])
Packit Service 991b93
elif test "$full_test_suite" = yes;then
Packit Service 991b93
        AC_MSG_ERROR([[***
Packit Service 991b93
*** libev4 was not found.
Packit Service 991b93
***]])
Packit Service 991b93
fi
Packit Service 991b93
Packit aea12f
dnl GCC warnings to enable
Packit aea12f
Packit aea12f
AC_ARG_ENABLE([gcc-warnings],
Packit aea12f
  [AS_HELP_STRING([--disable-gcc-warnings],
Packit aea12f
		  [turn off lots of GCC warnings (for developers)])],
Packit aea12f
  [case $enableval in
Packit aea12f
     yes|no) ;;
Packit aea12f
     *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
Packit aea12f
   esac
Packit aea12f
   gl_gcc_warnings=$enableval],
Packit aea12f
  [gl_gcc_warnings=yes]
Packit aea12f
)
Packit aea12f
Packit aea12f
if test "$gl_gcc_warnings" = yes; then
Packit aea12f
  gl_WARN_ADD([-Wtype-limits], [WSTACK_CFLAGS])
Packit aea12f
Packit aea12f
  nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
Packit aea12f
  nw="$nw -Wc++-compat"             # We don't care about C++ compilers
Packit aea12f
  nw="$nw -Wundef"                  # Warns on '#if GNULIB_FOO' etc in gnulib
Packit aea12f
  nw="$nw -Wtraditional"            # Warns on #elif which we use often
Packit aea12f
  nw="$nw -Wpadded"                 # Our structs are not padded
Packit aea12f
  nw="$nw -Wtraditional-conversion" # Too many warnings for now
Packit aea12f
  nw="$nw -Wswitch-default"         # Too many warnings for now
Packit aea12f
  nw="$nw -Wformat-y2k"             # Too many warnings for now
Packit aea12f
  nw="$nw -Woverlength-strings"     # We use some in tests/
Packit aea12f
  nw="$nw -Wvla"                    # There is no point to avoid C99 variable length arrays
Packit aea12f
  nw="$nw -Wformat-nonliteral"      # Incompatible with gettext _()
Packit aea12f
  nw="$nw -Wformat-signedness"      # Too many to handle
Packit aea12f
  nw="$nw -Wstrict-overflow"
Packit aea12f
  nw="$nw -Wmissing-noreturn"
Packit aea12f
  nw="$nw -Winline"                 # Too compiler dependent
Packit aea12f
  nw="$nw -Wsuggest-attribute=pure" # Is it worth using attributes?
Packit aea12f
  nw="$nw -Wsuggest-attribute=const" # Is it worth using attributes?
Packit aea12f
  nw="$nw -Wsuggest-attribute=noreturn" # Is it worth using attributes?
Packit aea12f
  nw="$nw -Wstack-protector"        # Some functions cannot be protected
Packit aea12f
  nw="$nw -Wunsafe-loop-optimizations" # Warnings with no point
Packit aea12f
  nw="$nw -Wredundant-decls"        # Some files cannot be compiled with that (gl_fd_to_handle)
Packit aea12f
Packit aea12f
  gl_MANYWARN_ALL_GCC([ws])
Packit aea12f
  gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
Packit aea12f
  for w in $ws; do
Packit aea12f
    gl_WARN_ADD([$w])
Packit aea12f
  done
Packit aea12f
  gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
Packit aea12f
  gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
Packit aea12f
  gl_WARN_ADD([-Wno-format-truncation]) # Many warnings with no point
Packit aea12f
  gl_WARN_ADD([-Wimplicit-fallthrough=2])
Packit aea12f
  gl_WARN_ADD([-Wabi=11])
Packit aea12f
  gl_WARN_ADD([-fdiagnostics-show-option])
Packit aea12f
fi
Packit aea12f
Packit Service 991b93
if test "$gl_cv_opt_valgrind_tests" != no; then
Packit Service 991b93
  gl_WARN_ADD([-fno-builtin-strcmp])
Packit Service 991b93
fi
Packit Service 991b93
Packit aea12f
AC_SUBST([WERROR_CFLAGS])
Packit aea12f
AC_SUBST([WSTACK_CFLAGS])
Packit aea12f
AC_SUBST([WARN_CFLAGS])
Packit aea12f
Packit aea12f
dnl Programs for compilation or development
Packit aea12f
AC_PROG_LN_S
Packit aea12f
LT_INIT([disable-static,win32-dll,shared])
Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
AC_LIB_HAVE_LINKFLAGS(dl,, [#include <dlfcn.h>], [dladdr (0, 0);])
Packit aea12f
Packit aea12f
AC_ARG_ENABLE(fips140-mode,
Packit aea12f
  AS_HELP_STRING([--enable-fips140-mode], [enable FIPS140-2 mode]),
Packit aea12f
    enable_fips=$enableval, enable_fips=no)
Packit aea12f
AM_CONDITIONAL(ENABLE_FIPS140, test "$enable_fips" = "yes")
Packit aea12f
if [ test "$enable_fips" = "yes" ];then
Packit aea12f
  if test "x$HAVE_LIBDL" = "xyes";then
Packit aea12f
    AC_DEFINE([ENABLE_FIPS140], 1, [Enable FIPS140-2 mode])
Packit aea12f
    AC_SUBST([FIPS140_LIBS], $LIBDL)
Packit aea12f
    AC_ARG_WITH(fips140-key, AS_HELP_STRING([--with-fips140-key],
Packit aea12f
                                 [specify the FIPS140 HMAC key for integrity]),
Packit aea12f
            fips_key="$withval", 
Packit aea12f
            fips_key="orboDeJITITejsirpADONivirpUkvarP")
Packit aea12f
Packit aea12f
    AC_DEFINE_UNQUOTED([FIPS_KEY], ["$fips_key"], [The FIPS140-2 integrity key])
Packit aea12f
  else
Packit aea12f
    enable_fips=no
Packit aea12f
    AC_MSG_WARN([[
Packit aea12f
*** 
Packit aea12f
*** This system is not supported in FIPS140 mode.
Packit aea12f
*** libdl and dladdr() are required.
Packit aea12f
*** ]])
Packit aea12f
  fi
Packit aea12f
fi
Packit aea12f
Packit aea12f
PKG_CHECK_MODULES(CMOCKA, [cmocka >= 1.0.1], [with_cmocka=yes], [with_cmocka=no])
Packit aea12f
AM_CONDITIONAL(HAVE_CMOCKA, test "$with_cmocka" != "no")
Packit aea12f
Packit aea12f
AC_ARG_WITH(idn, AS_HELP_STRING([--without-idn],
Packit aea12f
                                [disable support for IDNA]),
Packit aea12f
            try_libidn2="$withval", 
Packit aea12f
            try_libidn2=yes)
Packit aea12f
Packit aea12f
idna_support=no
Packit aea12f
with_libidn2=no
Packit aea12f
Packit aea12f
if test "$try_libidn2" = yes;then
Packit Service 991b93
    PKG_CHECK_MODULES(LIBIDN2, [libidn2 >= 2.0.0], [with_libidn2=yes], [with_libidn2=no])
Packit Service 991b93
    if test "${with_libidn2}" = "yes";then
Packit aea12f
      idna_support="IDNA 2008 (libidn2)"
Packit aea12f
      AC_DEFINE([HAVE_LIBIDN2], 1, [Define if IDNA 2008 support is enabled.])
Packit Service 991b93
      if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
Packit Service 991b93
        GNUTLS_REQUIRES_PRIVATE="Requires.private: libidn2"
Packit Service 991b93
      else
Packit Service 991b93
        GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, libidn2"
Packit Service 991b93
      fi
Packit Service 991b93
    else
Packit aea12f
      AC_MSG_WARN(*** LIBIDN2 was not found. You will not be able to use IDN2008 support)
Packit Service 991b93
    fi
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL(HAVE_LIBIDN2, test "$with_libidn2" != "no")
Packit aea12f
Packit Service 991b93
if test "x$have_vista_dynamic" = "xno"; then
Packit Service 991b93
  AC_CHECK_TYPES([BCRYPT_ALG_HANDLE],[LIBBCRYPT="-lbcrypt"],[],[#include <windows.h>
Packit Service 991b93
  #include <bcrypt.h>])
Packit Service 991b93
fi
Packit Service 991b93
AM_CONDITIONAL(HAVE_BCRYPT, test "$ac_cv_type_BCRYPT_ALG_HANDLE" = "yes")
Packit Service 991b93
AC_SUBST([LIBBCRYPT])
Packit Service 991b93
Packit aea12f
AC_ARG_ENABLE(non-suiteb-curves,
Packit aea12f
  AS_HELP_STRING([--disable-non-suiteb-curves], [disable curves not in SuiteB]),
Packit aea12f
    enable_non_suiteb=$enableval, enable_non_suiteb=yes)
Packit aea12f
Packit aea12f
if test "$enable_non_suiteb" = "yes";then
Packit aea12f
	dnl nettle_secp_192r1 is not really a function
Packit Service 991b93
	AC_CHECK_LIB(hogweed, nettle_get_secp_192r1, enable_non_suiteb=yes, enable_non_suiteb=no, [$HOGWEED_LIBS $NETTLE_LIBS])
Packit aea12f
Packit aea12f
	if test "$enable_non_suiteb" = "yes";then
Packit aea12f
		AC_DEFINE([ENABLE_NON_SUITEB_CURVES], 1, [Enable all curves])
Packit aea12f
	fi
Packit aea12f
fi
Packit aea12f
AM_CONDITIONAL(ENABLE_NON_SUITEB_CURVES, test "$enable_non_suiteb" = "yes")
Packit aea12f
Packit aea12f
# We MUST require a Nettle version that has rsa_sec_decrypt now.
Packit aea12f
save_LIBS=$LIBS
Packit aea12f
LIBS="$LIBS $HOGWEED_LIBS $NETTLE_LIBS"
Packit aea12f
AC_CHECK_FUNCS(nettle_rsa_sec_decrypt,
Packit aea12f
    [],
Packit aea12f
    [AC_MSG_ERROR([Nettle lacks the required rsa_sec_decrypt function])]
Packit aea12f
)
Packit aea12f
LIBS=$save_LIBS
Packit aea12f
Packit aea12f
# Check if nettle has CFB8 support
Packit Service 991b93
if test -z "$ac_cv_func_nettle_cfb8_encrypt"; then
Packit Service 991b93
	# nettle_cfb8_decrypt in nettle upto 3.6 is known to be broken
Packit Service 991b93
	if ! $PKG_CONFIG --atleast-version=3.6 nettle; then
Packit Service 991b93
		ac_cv_func_nettle_cfb8_encrypt=no
Packit Service 991b93
	fi
Packit Service 991b93
fi
Packit Service 991b93
Packit aea12f
save_LIBS=$LIBS
Packit aea12f
LIBS="$LIBS $NETTLE_LIBS"
Packit aea12f
AC_CHECK_FUNCS(nettle_cfb8_encrypt)
Packit aea12f
LIBS=$save_LIBS
Packit Service 991b93
AM_CONDITIONAL(NEED_CFB, [test "$ac_cv_func_nettle_cfb8_encrypt" != "yes"])
Packit aea12f
Packit aea12f
# Check if nettle has CMAC support
Packit Service 991b93
save_CFLAGS=$CFLAGS
Packit Service 991b93
CFLAGS="$CFLAGS $NETTLE_CFLAGS"
Packit Service 991b93
AC_CHECK_TYPES([union nettle_block8], , , [[#include <nettle/nettle-types.h>]])
Packit Service 991b93
CFLAGS=$save_CFLAGS
Packit Service 991b93
Packit aea12f
save_LIBS=$LIBS
Packit aea12f
LIBS="$LIBS $NETTLE_LIBS"
Packit aea12f
AC_CHECK_FUNCS(nettle_cmac128_update)
Packit aea12f
LIBS=$save_LIBS
Packit Service 991b93
AM_CONDITIONAL(NEED_CMAC, [test "$ac_cv_func_nettle_cmac128_update" != "yes"])
Packit aea12f
Packit aea12f
# Check if nettle has XTS support
Packit aea12f
save_LIBS=$LIBS
Packit aea12f
LIBS="$LIBS $NETTLE_LIBS"
Packit Service 991b93
AC_CHECK_FUNCS(nettle_xts_encrypt_message)
Packit aea12f
LIBS=$save_LIBS
Packit Service 991b93
AM_CONDITIONAL(NEED_XTS, [test "$ac_cv_func_nettle_xts_encrypt_message" != "yes"])
Packit aea12f
Packit Service 991b93
# Check for Gosthash94 with CryptoPro S-box support
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $NETTLE_LIBS"
Packit Service 991b93
AC_CHECK_FUNCS(nettle_gosthash94cp_update)
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
Packit Service 991b93
# Check for GOST28147
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $NETTLE_LIBS"
Packit Service 991b93
AC_CHECK_FUNCS(nettle_gost28147_set_key)
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
Packit Service 991b93
# Check for Streebog support
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $NETTLE_LIBS"
Packit Service 991b93
AC_CHECK_FUNCS(nettle_streebog512_update)
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
Packit Service 991b93
# Check for Curve448 and Ed448
Packit Service 991b93
have_new_ecc=yes
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $HOGWEED_LIBS $NETTLE_LIBS"
Packit Service 991b93
AC_CHECK_FUNCS([nettle_curve448_mul nettle_ed448_shake256_sign nettle_get_gost_gc256b nettle_get_gost_gc512a nettle_gostdsa_sign],
Packit Service 991b93
	       [], [have_new_ecc=no])
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
AS_IF([test "$have_new_ecc" != "yes"], AC_DEFINE([NEED_INT_ECC], 1, [Use backported Curve448/GOST R 34.10 DSA support]))
Packit Service 991b93
AM_CONDITIONAL(NEED_INT_ECC, test "$have_new_ecc" != "yes")
Packit Service 991b93
Packit Service 991b93
# Check if nettle has ChaCha20 initial block counter support
Packit Service 991b93
have_chacha_set_counter=no
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $NETTLE_LIBS"
Packit Service 991b93
AC_CHECK_FUNCS([nettle_chacha_set_counter],
Packit Service 991b93
               [have_chacha_set_counter=yes])
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
AM_CONDITIONAL(NEED_CHACHA, [test "$have_chacha_set_counter" != "yes"])
Packit Service 991b93
Packit Service 991b93
# Check for SIV-CMAC
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $NETTLE_LIBS"
Packit Service 991b93
AC_CHECK_FUNCS(nettle_siv_cmac_aes128_set_key)
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
AM_CONDITIONAL(NEED_SIV, [test "$ac_cv_func_nettle_siv_cmac_aes128_set_key" != "yes"])
Packit Service 991b93
Packit Service 991b93
# Check sonames of the linked libraries needed for FIPS selftests.
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $GMP_LIBS"
Packit Service 991b93
AC_MSG_CHECKING([gmp soname])
Packit Service 991b93
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
Packit Service 991b93
	[gmp_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libgmp\.so'`],
Packit Service 991b93
	[gmp_so=none])
Packit Service 991b93
if test -z "$gmp_so"; then
Packit Service 991b93
	gmp_so=none
Packit Service 991b93
fi
Packit Service 991b93
AC_MSG_RESULT($gmp_so)
Packit Service 991b93
AC_DEFINE_UNQUOTED([GMP_LIBRARY_SONAME], ["$gmp_so"], [The soname of gmp library])
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $NETTLE_LIBS"
Packit Service 991b93
AC_MSG_CHECKING([nettle soname])
Packit Service 991b93
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
Packit Service 991b93
	[nettle_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libnettle\.so'`],
Packit Service 991b93
	[nettle_so=none])
Packit Service 991b93
if test -z "$nettle_so"; then
Packit Service 991b93
	nettle_so=none
Packit Service 991b93
fi
Packit Service 991b93
AC_MSG_RESULT($nettle_so)
Packit Service 991b93
AC_DEFINE_UNQUOTED([NETTLE_LIBRARY_SONAME], ["$nettle_so"], [The soname of nettle library])
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
Packit Service 991b93
save_LIBS=$LIBS
Packit Service 991b93
LIBS="$LIBS $HOGWEED_LIBS"
Packit Service 991b93
AC_MSG_CHECKING([hogweed soname])
Packit Service 991b93
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
Packit Service 991b93
	[hogweed_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libhogweed\.so'`],
Packit Service 991b93
	[hogweed_so=none])
Packit Service 991b93
if test -z "$hogweed_so"; then
Packit Service 991b93
	hogweed_so=none
Packit Service 991b93
fi
Packit Service 991b93
AC_MSG_RESULT($hogweed_so)
Packit Service 991b93
AC_DEFINE_UNQUOTED([HOGWEED_LIBRARY_SONAME], ["$hogweed_so"], [The soname of hogweed library])
Packit Service 991b93
LIBS=$save_LIBS
Packit Service 991b93
Packit Service 991b93
gnutls_so=libgnutls.so.`expr "$LT_CURRENT" - "$LT_AGE"`
Packit Service 991b93
AC_DEFINE_UNQUOTED([GNUTLS_LIBRARY_SONAME], ["$gnutls_so"], [The soname of gnutls library])
Packit aea12f
Packit aea12f
AC_MSG_CHECKING([whether to build libdane])
Packit aea12f
AC_ARG_ENABLE(libdane,
Packit aea12f
    AS_HELP_STRING([--disable-libdane],
Packit aea12f
                   [disable the built of libdane]),
Packit aea12f
    enable_dane=$enableval, enable_dane=yes)
Packit aea12f
AC_MSG_RESULT($enable_dane)
Packit aea12f
Packit aea12f
if test "$enable_dane" != "no"; then
Packit aea12f
    LIBS="$oldlibs -lunbound"
Packit aea12f
    AC_MSG_CHECKING([for unbound library])
Packit aea12f
    AC_LINK_IFELSE([AC_LANG_PROGRAM([
Packit aea12f
		   #include <unbound.h>],[
Packit aea12f
		   struct ub_ctx* ctx;
Packit aea12f
		   ctx = ub_ctx_create();])],
Packit aea12f
		  [AC_MSG_RESULT(yes)
Packit aea12f
		   AC_SUBST([UNBOUND_LIBS], [-lunbound])
Packit aea12f
		   AC_SUBST([UNBOUND_CFLAGS], [])
Packit aea12f
		   AC_DEFINE([HAVE_DANE], 1, [Enable the DANE library])
Packit aea12f
		   enable_dane=yes],
Packit aea12f
		  [AC_MSG_RESULT(no)
Packit aea12f
		   AC_MSG_WARN([[
Packit aea12f
*** 
Packit aea12f
*** libunbound was not found. Libdane will not be built.
Packit aea12f
*** ]])
Packit aea12f
		  enable_dane=no])
Packit aea12f
    LIBS="$oldlibs"
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL(ENABLE_DANE, test "$enable_dane" = "yes")
Packit aea12f
Packit aea12f
AC_ARG_WITH(unbound-root-key-file, AS_HELP_STRING([--with-unbound-root-key-file],
Packit aea12f
                                 [specify the unbound root key file]),
Packit aea12f
            unbound_root_key_file="$withval", 
Packit aea12f
if test "$have_win" = yes; then
Packit aea12f
    unbound_root_key_file="C:\\Program Files\\Unbound\\root.key"
Packit aea12f
else
Packit aea12f
    if test -f /var/lib/unbound/root.key;then
Packit aea12f
	unbound_root_key_file="/var/lib/unbound/root.key"
Packit aea12f
    else
Packit aea12f
        if test -f /usr/share/dns/root.key;then
Packit aea12f
	    unbound_root_key_file="/usr/share/dns/root.key"
Packit aea12f
        else
Packit aea12f
            unbound_root_key_file="/etc/unbound/root.key"
Packit aea12f
        fi
Packit aea12f
    fi
Packit aea12f
fi
Packit aea12f
)
Packit aea12f
Packit aea12f
AC_DEFINE_UNQUOTED([UNBOUND_ROOT_KEY_FILE],
Packit aea12f
  ["$unbound_root_key_file"], [The DNSSEC root key file])
Packit aea12f
Packit Service 991b93
system_config_file="/etc/gnutls/config"
Packit aea12f
AC_ARG_WITH(system-priority-file, AS_HELP_STRING([--with-system-priority-file],
Packit Service 991b93
                                 [specify the system-wide config file (set empty to disable)]),
Packit Service 991b93
            system_config_file="$withval"
Packit aea12f
)
Packit aea12f
Packit Service 991b93
AM_CONDITIONAL(DISABLE_SYSTEM_CONFIG, test -z "${system_config_file}")
Packit Service 991b93
Packit Service 991b93
if test -z "${system_config_file}";then
Packit Service 991b93
	AC_DEFINE([DISABLE_SYSTEM_CONFIG], 1, [Whether to disable system configuration])
Packit Service 991b93
fi
Packit Service 991b93
Packit aea12f
AC_DEFINE_UNQUOTED([SYSTEM_PRIORITY_FILE],
Packit Service 991b93
  ["$system_config_file"], [The system-wide gnutls configuration file])
Packit aea12f
Packit aea12f
AC_ARG_WITH(default-priority-string, AS_HELP_STRING([--with-default-priority-string],
Packit Service 991b93
                                 [specify the default priority string used by gnutls_set_default_priority (default is NORMAL)]),
Packit aea12f
            prio_string="$withval", 
Packit aea12f
            prio_string="NORMAL")
Packit aea12f
Packit aea12f
AC_DEFINE_UNQUOTED([DEFAULT_PRIORITY_STRING], ["$prio_string"], [The default priority string])
Packit aea12f
Packit aea12f
dnl Check for p11-kit
Packit aea12f
P11_KIT_MINIMUM=0.23.1
Packit aea12f
AC_ARG_WITH(p11-kit,
Packit aea12f
	AS_HELP_STRING([--without-p11-kit],
Packit aea12f
		[Build without p11-kit and PKCS#11 support]))
Packit aea12f
if test "$with_p11_kit" != "no"; then
Packit aea12f
	PKG_CHECK_MODULES(P11_KIT, [p11-kit-1 >= $P11_KIT_MINIMUM], [with_p11_kit=yes], [with_p11_kit=no])
Packit aea12f
	if test "$with_p11_kit" != "no";then
Packit aea12f
		AC_DEFINE([ENABLE_PKCS11], 1, [Build PKCS#11 support])
Packit aea12f
		if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
Packit aea12f
			GNUTLS_REQUIRES_PRIVATE="Requires.private: p11-kit-1"
Packit aea12f
		else
Packit aea12f
			GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, p11-kit-1"
Packit aea12f
		fi
Packit aea12f
	else
Packit aea12f
	        with_p11_kit=no
Packit aea12f
	        AC_MSG_ERROR([[
Packit aea12f
*** 
Packit aea12f
*** p11-kit >= $P11_KIT_MINIMUM was not found. To disable PKCS #11 support 
Packit aea12f
*** use --without-p11-kit, otherwise you may get p11-kit from
Packit aea12f
*** https://p11-glue.freedesktop.org/p11-kit.html
Packit aea12f
*** ]])
Packit aea12f
	fi
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL(P11KIT_0_23_11_API, $PKG_CONFIG --atleast-version=0.23.11 p11-kit-1)
Packit aea12f
Packit aea12f
AM_CONDITIONAL(ENABLE_PKCS11, test "$with_p11_kit" != "no")
Packit aea12f
Packit aea12f
AC_ARG_WITH(tpm,
Packit aea12f
	AS_HELP_STRING([--without-tpm],
Packit aea12f
		[Disable TPM (trousers) support.]),
Packit aea12f
		[with_tpm=$withval], [with_tpm=yes])
Packit aea12f
if test "$with_tpm" != "no"; then
Packit aea12f
    LIBS="$oldlibs -ltspi"
Packit aea12f
    AC_MSG_CHECKING([for tss library])
Packit aea12f
    AC_LINK_IFELSE([AC_LANG_PROGRAM([
Packit aea12f
		   #include <trousers/tss.h>
Packit aea12f
		   #include <trousers/trousers.h>],[
Packit aea12f
		   int err = Tspi_Context_Create((void *)0);
Packit aea12f
		   Trspi_Error_String(err);])],
Packit aea12f
		  [AC_MSG_RESULT(yes)
Packit aea12f
		   AC_SUBST([TSS_LIBS], [-ltspi])
Packit aea12f
		   AC_SUBST([TSS_CFLAGS], [])
Packit aea12f
		   AC_DEFINE([HAVE_TROUSERS], 1, [Enable TPM])
Packit aea12f
		   with_tpm=yes],
Packit aea12f
		  [AC_MSG_RESULT(no)
Packit aea12f
		   AC_MSG_WARN([[
Packit aea12f
*** 
Packit aea12f
*** trousers was not found. TPM support will be disabled.
Packit aea12f
*** ]])
Packit aea12f
		  with_tpm=no])
Packit aea12f
    LIBS="$oldlibs"
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL(ENABLE_TROUSERS, test "$with_tpm" != "no")
Packit aea12f
Packit aea12f
for l in /usr/lib64 /usr/lib /lib64 /lib /usr/lib/x86_64-linux-gnu/; do
Packit aea12f
    if test -f "${l}/libtspi.so.1";then
Packit aea12f
        default_trousers_lib="${l}/libtspi.so.1"
Packit aea12f
        break
Packit aea12f
    fi
Packit aea12f
done
Packit aea12f
Packit aea12f
AC_ARG_WITH(trousers-lib, AS_HELP_STRING([--with-trousers-lib=LIB],
Packit aea12f
                                 [set the location of the trousers library]),
Packit aea12f
            ac_trousers_lib=$withval, ac_trousers_lib=$default_trousers_lib)
Packit aea12f
Packit aea12f
if test "$with_tpm" != "no" && test -z "$ac_trousers_lib"; then
Packit aea12f
    AC_MSG_ERROR([[
Packit aea12f
  ***
Packit aea12f
  *** unable to find trousers library, please specify with --with-trousers-lib=<lib file>
Packit aea12f
  ***
Packit aea12f
  ]])
Packit aea12f
fi
Packit aea12f
Packit aea12f
AC_DEFINE_UNQUOTED([TROUSERS_LIB], ["$ac_trousers_lib"], [the location of the trousers library])
Packit aea12f
AC_SUBST(TROUSERS_LIB)
Packit aea12f
Packit aea12f
AM_MISSING_PROG([AUTOGEN], [autogen])
Packit aea12f
Packit aea12f
included_libopts=no
Packit aea12f
if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
Packit aea12f
	AC_CHECK_PROGS([autogen], [autogen])
Packit aea12f
Packit aea12f
	if test -z "$autogen"; then
Packit aea12f
		AC_MSG_WARN([[
Packit aea12f
***
Packit aea12f
*** autogen not found. Will not link against system libopts.
Packit aea12f
*** ]])
Packit aea12f
		dnl simulate specifying option on the command line
Packit Service 991b93
		included_libopts=yes
Packit aea12f
	fi
Packit aea12f
	LIBOPTS_CHECK([src/libopts])
Packit aea12f
	if test "$NEED_LIBOPTS_DIR" = "true";then
Packit aea12f
		dnl replace libopts-generated files with distributed backups, if present
Packit aea12f
		included_libopts=yes
Packit aea12f
	fi
Packit aea12f
else
Packit aea12f
	# Need to ensure the relevant conditionals get set
Packit aea12f
	gl_STDNORETURN_H
Packit aea12f
	AM_CONDITIONAL([INSTALL_LIBOPTS],[false])
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL(NEED_LIBOPTS, test "$included_libopts" = "yes")
Packit aea12f
Packit aea12f
# For minitasn1.
Packit aea12f
AC_CHECK_SIZEOF(unsigned long int, 4)
Packit aea12f
AC_CHECK_SIZEOF(unsigned int, 4)
Packit aea12f
AC_CHECK_SIZEOF(time_t, 4)
Packit aea12f
Packit aea12f
# export for use in scripts
Packit aea12f
AC_SUBST(ac_cv_sizeof_time_t)
Packit aea12f
Packit aea12f
AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
Packit aea12f
Packit aea12f
Packit aea12f
AC_ARG_WITH([default-trust-store-pkcs11],
Packit aea12f
  [AS_HELP_STRING([--with-default-trust-store-pkcs11=URI],
Packit aea12f
    [use the given pkcs11 uri as default trust store])])
Packit aea12f
Packit aea12f
if test "x$with_default_trust_store_pkcs11" != x; then
Packit aea12f
  if test "x$with_p11_kit" = xno; then
Packit aea12f
    AC_MSG_ERROR([cannot use pkcs11 store without p11-kit])
Packit aea12f
  fi
Packit aea12f
  AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_PKCS11],
Packit aea12f
    ["$with_default_trust_store_pkcs11"], [use the given pkcs11 uri as default trust store])
Packit aea12f
fi
Packit aea12f
Packit aea12f
AM_CONDITIONAL([HAVE_PKCS11_TRUST_STORE], [test -n "${with_default_trust_store_pkcs11}"])
Packit aea12f
Packit aea12f
AC_ARG_WITH([default-trust-store-dir],
Packit aea12f
  [AS_HELP_STRING([--with-default-trust-store-dir=DIR],
Packit aea12f
    [use the given directory as default trust store])])
Packit aea12f
Packit aea12f
if test "x$with_default_trust_store_dir" != x; then
Packit aea12f
  AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_DIR],
Packit aea12f
    ["$with_default_trust_store_dir"], [use the given directory as default trust store])
Packit aea12f
fi
Packit aea12f
Packit aea12f
dnl auto detect https://lists.gnu.org/archive/html/help-gnutls/2012-05/msg00004.html
Packit aea12f
AC_ARG_WITH([default-trust-store-file],
Packit aea12f
  [AS_HELP_STRING([--with-default-trust-store-file=FILE],
Packit aea12f
    [use the given file default trust store])], with_default_trust_store_file="$withval",
Packit aea12f
  [if test "$build" = "$host" && test x$with_default_trust_store_pkcs11 = x && test x$with_default_trust_store_dir = x && test x$have_macosx = x;then
Packit aea12f
  for i in \
Packit aea12f
    /etc/ssl/ca-bundle.pem \
Packit aea12f
    /etc/ssl/certs/ca-certificates.crt \
Packit aea12f
    /etc/pki/tls/cert.pem \
Packit aea12f
    /usr/local/share/certs/ca-root-nss.crt \
Packit aea12f
    /etc/ssl/cert.pem
Packit aea12f
    do
Packit aea12f
    if test -e "$i"; then
Packit aea12f
      with_default_trust_store_file="$i"
Packit aea12f
      break
Packit aea12f
    fi
Packit aea12f
  done
Packit aea12f
  fi]
Packit aea12f
)
Packit aea12f
Packit aea12f
if test "$with_default_trust_store_file" = "no";then
Packit aea12f
  with_default_trust_store_file=""
Packit aea12f
fi
Packit aea12f
Packit aea12f
AC_ARG_WITH([default-crl-file],
Packit aea12f
  [AS_HELP_STRING([--with-default-crl-file=FILE],
Packit aea12f
    [use the given CRL file as default])])
Packit aea12f
Packit aea12f
AC_ARG_WITH([default-blacklist-file],
Packit aea12f
  [AS_HELP_STRING([--with-default-blacklist-file=FILE],
Packit aea12f
    [use the given certificate blacklist file as default])])
Packit aea12f
Packit aea12f
if test "x$with_default_trust_store_file" != x; then
Packit aea12f
  AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_FILE],
Packit aea12f
    ["$with_default_trust_store_file"], [use the given file default trust store])
Packit aea12f
fi
Packit aea12f
Packit aea12f
if test "x$with_default_crl_file" != x; then
Packit aea12f
  AC_DEFINE_UNQUOTED([DEFAULT_CRL_FILE],
Packit aea12f
    ["$with_default_crl_file"], [use the given CRL file])
Packit aea12f
fi
Packit aea12f
Packit aea12f
if test "x$with_default_blacklist_file" != x; then
Packit aea12f
  AC_DEFINE_UNQUOTED([DEFAULT_BLACKLIST_FILE],
Packit aea12f
    ["$with_default_blacklist_file"], [use the given certificate blacklist file])
Packit aea12f
fi
Packit aea12f
Packit aea12f
dnl Guile bindings.
Packit aea12f
AC_MSG_CHECKING([whether building Guile bindings])
Packit aea12f
AC_ARG_ENABLE(guile,
Packit aea12f
	AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
Packit aea12f
		[opt_guile_bindings=$enableval], [opt_guile_bindings=yes])
Packit aea12f
AC_MSG_RESULT($opt_guile_bindings)
Packit aea12f
Packit aea12f
AC_ARG_WITH([guile-site-dir], AS_HELP_STRING([--with-guile-site-dir=DIR],
Packit aea12f
    [guile site directory for gnutls, default is guile system settings]),
Packit aea12f
    [guilesitedir="${withval}"], [guilesitedir='$(GUILE_SITE)'])
Packit aea12f
AC_ARG_WITH([guile-site-ccache-dir], AS_HELP_STRING([--with-guile-site-ccache-dir=DIR],
Packit aea12f
    [guile ccache directory for gnutls, default is guile system settings]),
Packit aea12f
    [guilesiteccachedir="${withval}"], [guilesiteccachedir='$(GUILE_SITE_CCACHE)'])
Packit aea12f
AC_ARG_WITH([guile-extension-dir], AS_HELP_STRING([--with-guile-extension-dir=DIR],
Packit aea12f
    [guile extension directory for gnutls, default is guile system settings]),
Packit aea12f
    [guileextensiondir="${withval}"], [guileextensiondir='$(GUILE_EXTENSION)'])
Packit aea12f
AC_SUBST([guilesitedir])
Packit aea12f
AC_SUBST([guilesiteccachedir])
Packit aea12f
AC_SUBST([guileextensiondir])
Packit Service 991b93
maybe_guileextensiondir="\"$guileextensiondir\""
Packit aea12f
Packit aea12f
if test "$opt_guile_bindings" = "yes"; then
Packit aea12f
   AC_MSG_RESULT([***
Packit aea12f
*** Detecting GNU Guile...
Packit aea12f
])
Packit aea12f
Packit aea12f
   AC_PATH_PROG([guile_snarf], [guile-snarf])
Packit aea12f
   if test "x$guile_snarf" = "x"; then
Packit aea12f
      AC_MSG_WARN([`guile-snarf' from Guile not found.  Guile bindings not built.])
Packit aea12f
      opt_guile_bindings=no
Packit aea12f
   else
Packit aea12f
      dnl Check for 'guild', which can be used to compile Scheme code
Packit aea12f
      dnl on Guile 2.x.
Packit aea12f
      AC_PATH_PROG([GUILD], [guild])
Packit aea12f
      AC_SUBST([GUILD])
Packit aea12f
Packit Service 991b93
      GUILE_PKG([3.0 2.2 2.0 1.8])
Packit aea12f
      GUILE_PROGS
Packit aea12f
      GUILE_SITE_DIR
Packit aea12f
      GUILE_FLAGS
Packit aea12f
Packit aea12f
      # Backward compatibility with 
Packit aea12f
      # due to autreconf of several CI machine.
Packit aea12f
      # We need to guess the locations of ccache and extension
Packit aea12f
      if test -z "${GUILE_SITE_CCACHE}"; then
Packit aea12f
          AC_MSG_NOTICE([Found 
Packit aea12f
Packit aea12f
          AC_MSG_CHECKING([for GUILE_SITE_CCACHE via pkg-config])
Packit aea12f
          GUILE_SITE_CCACHE=`$PKG_CONFIG --variable=siteccachedir guile-$GUILE_EFFECTIVE_VERSION`
Packit aea12f
          AC_MSG_RESULT([${GUILE_SITE_CCACHE}])
Packit aea12f
          if test -z "${GUILE_SITE_CCACHE}"; then
Packit aea12f
                  AC_MSG_CHECKING([for GUILE_SITE_CCACHE via guile])
Packit aea12f
                  GUILE_SITE_CCACHE=`$GUILE -c "(display (if (defined? '%site-ccache-dir) (%site-ccache-dir) \"\"))"`
Packit aea12f
                  AC_MSG_RESULT([${GUILE_SITE_CCACHE}])
Packit aea12f
          fi
Packit aea12f
          AC_SUBST([GUILE_SITE_CCACHE])
Packit aea12f
Packit aea12f
          AC_MSG_CHECKING([for GUILE_EXTENSION])
Packit aea12f
          GUILE_EXTENSION=`$PKG_CONFIG --print-errors --variable=extensiondir guile-$GUILE_EFFECTIVE_VERSION`
Packit aea12f
          AC_MSG_RESULT([${GUILE_EXTENSION}])
Packit aea12f
          AC_SUBST([GUILE_EXTENSION])
Packit aea12f
      fi
Packit aea12f
Packit aea12f
      save_CFLAGS="$CFLAGS"
Packit aea12f
      save_LIBS="$LIBS"
Packit aea12f
      CFLAGS="$CFLAGS $GUILE_CFLAGS"
Packit aea12f
      LIBS="$LIBS $GUILE_LDFLAGS"
Packit aea12f
      AC_MSG_CHECKING([whether GNU Guile is recent enough])
Packit aea12f
      AC_LINK_IFELSE([AC_LANG_PROGRAM([], [scm_from_locale_string ("")])],
Packit aea12f
        [], [opt_guile_bindings=no])
Packit aea12f
      CFLAGS="$save_CFLAGS"
Packit aea12f
      LIBS="$save_LIBS"
Packit aea12f
Packit aea12f
      if test "$opt_guile_bindings" = "yes"; then
Packit aea12f
        AC_MSG_RESULT([yes])
Packit aea12f
        AC_MSG_CHECKING([whether gcc supports -fgnu89-inline])
Packit aea12f
        _gcc_cflags_save="$CFLAGS"
Packit aea12f
        CFLAGS="${CFLAGS} -fgnu89-inline"
Packit aea12f
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
Packit aea12f
                          gnu89_inline=yes, gnu89_inline=no)
Packit aea12f
        AC_MSG_RESULT($gnu89_inline)
Packit aea12f
        CFLAGS="$_gcc_cflags_save"
Packit aea12f
Packit aea12f
	# Optional Guile functions.
Packit aea12f
	save_CFLAGS="$CFLAGS"
Packit aea12f
	save_LIBS="$LIBS"
Packit aea12f
	CFLAGS="$CFLAGS $GUILE_CFLAGS"
Packit aea12f
	LIBS="$LIBS $GUILE_LDFLAGS"
Packit aea12f
	AC_CHECK_FUNCS([scm_gc_malloc_pointerless])
Packit aea12f
	CFLAGS="$save_CFLAGS"
Packit aea12f
	LIBS="$save_LIBS"
Packit Service 991b93
Packit Service 991b93
	# Do we need to hard-code $guileextensiondir in gnutls.scm?
Packit Service 991b93
	# This is not necessary when $guileextensiondir is equal to
Packit Service 991b93
	# Guile's 'extensiondir' as specified in 'guile-MAJOR.MINOR.pc'.
Packit Service 991b93
	if test "$guileextensiondir" = "`$PKG_CONFIG guile-$GUILE_EFFECTIVE_VERSION --variable extensiondir`" \
Packit Service 991b93
	     || test "$guileextensiondir" = '$(GUILE_EXTENSION)'; then
Packit Service 991b93
	  maybe_guileextensiondir='#f'
Packit Service 991b93
	fi
Packit aea12f
      else
Packit aea12f
        AC_MSG_RESULT([no])
Packit aea12f
        AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
Packit aea12f
        opt_guile_bindings=no
Packit aea12f
      fi
Packit aea12f
   fi
Packit aea12f
fi
Packit aea12f
Packit Service 991b93
AC_SUBST([maybe_guileextensiondir])
Packit aea12f
AM_CONDITIONAL([HAVE_GUILE], [test "$opt_guile_bindings" = "yes"])
Packit aea12f
AM_CONDITIONAL([HAVE_GUILD], [test "x$GUILD" != "x"])
Packit Service 991b93
AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])
Packit aea12f
Packit aea12f
LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS"
Packit aea12f
LIBGNUTLS_CFLAGS="-I${includedir}"
Packit aea12f
AC_SUBST(LIBGNUTLS_LIBS)
Packit aea12f
AC_SUBST(LIBGNUTLS_CFLAGS)
Packit aea12f
Packit aea12f
AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
Packit aea12f
Packit aea12f
AC_DEFINE([GNUTLS_COMPAT_H], 1, [Make sure we don't use old features in code.])
Packit aea12f
AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
Packit aea12f
Packit aea12f
AC_DEFINE([fread_file], [_gnutls_fread_file], [static lib rename])
Packit aea12f
AC_DEFINE([read_file], [_gnutls_read_file], [static lib rename])
Packit aea12f
Packit Service 991b93
dnl configuration options for config file parsing (inih)
Packit Service 991b93
AC_DEFINE([INI_MAX_LINE], 2048, [inih maximum line size])
Packit Service 991b93
AC_DEFINE([INI_ALLOW_INLINE_COMMENTS], 1, [whether to allowin inline comments])
Packit Service 991b93
AC_DEFINE([INI_STOP_ON_FIRST_ERROR], 1, [whether to stop on first error])
Packit Service 991b93
AC_DEFINE_UNQUOTED([INI_INLINE_COMMENT_PREFIXES], [";#"], [The inline comment prefixes])
Packit Service 991b93
AC_DEFINE_UNQUOTED([INI_START_COMMENT_PREFIXES], [";#"], [The comment prefixes])
Packit aea12f
Packit aea12f
AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
Packit aea12f
AC_CONFIG_FILES([
Packit aea12f
  Makefile
Packit aea12f
  doc/Makefile
Packit aea12f
  doc/credentials/Makefile
Packit aea12f
  doc/credentials/srp/Makefile
Packit aea12f
  doc/credentials/x509/Makefile
Packit aea12f
  doc/doxygen/Doxyfile
Packit aea12f
  doc/examples/Makefile
Packit aea12f
  doc/latex/Makefile
Packit aea12f
  doc/manpages/Makefile
Packit aea12f
  doc/reference/Makefile
Packit aea12f
  doc/reference/version.xml
Packit aea12f
  doc/scripts/Makefile
Packit aea12f
  extra/Makefile
Packit aea12f
  extra/includes/Makefile
Packit aea12f
  libdane/Makefile
Packit aea12f
  libdane/includes/Makefile
Packit aea12f
  libdane/gnutls-dane.pc
Packit aea12f
  gl/Makefile
Packit aea12f
  gl/tests/Makefile
Packit aea12f
  guile/Makefile
Packit aea12f
  guile/src/Makefile
Packit aea12f
  lib/Makefile
Packit aea12f
  lib/accelerated/Makefile
Packit aea12f
  lib/accelerated/x86/Makefile
Packit aea12f
  lib/accelerated/aarch64/Makefile
Packit aea12f
  lib/algorithms/Makefile
Packit aea12f
  lib/auth/Makefile
Packit aea12f
  lib/ext/Makefile
Packit aea12f
  lib/extras/Makefile
Packit aea12f
  lib/gnutls.pc
Packit aea12f
  lib/includes/Makefile
Packit aea12f
  lib/includes/gnutls/gnutls.h
Packit aea12f
  lib/minitasn1/Makefile
Packit aea12f
  lib/nettle/Makefile
Packit aea12f
  lib/x509/Makefile
Packit aea12f
  lib/unistring/Makefile
Packit aea12f
  po/Makefile.in
Packit aea12f
  src/Makefile
Packit aea12f
  src/args-std.def
Packit aea12f
  src/gl/Makefile
Packit aea12f
  tests/Makefile
Packit aea12f
  tests/windows/Makefile
Packit aea12f
  tests/cert-tests/Makefile
Packit aea12f
  tests/slow/Makefile
Packit aea12f
  tests/suite/Makefile
Packit aea12f
  fuzz/Makefile
Packit aea12f
])
Packit aea12f
Packit aea12f
AC_OUTPUT
Packit aea12f
Packit aea12f
dnl  Warning flags:        errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
Packit aea12f
AC_MSG_NOTICE([summary of build options:
Packit aea12f
Packit aea12f
  version:              ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
Packit aea12f
  Host/Target system:   ${host}
Packit aea12f
  Build system:         ${build}
Packit aea12f
  Install prefix:       ${prefix}
Packit aea12f
  Compiler:             ${CC}
Packit aea12f
  Valgrind:             $opt_valgrind_tests ${VALGRIND}
Packit aea12f
  CFlags:               ${CFLAGS}
Packit aea12f
  Library types:        Shared=${enable_shared}, Static=${enable_static}
Packit aea12f
  Local libopts:        ${included_libopts}
Packit aea12f
  Local libtasn1:       ${included_libtasn1}
Packit aea12f
  Local unistring:      ${included_unistring}
Packit aea12f
  Use nettle-mini:      ${mini_nettle}
Packit aea12f
  Documentation:        ${enable_doc} (manpages: ${enable_manpages})
Packit aea12f
])
Packit aea12f
Packit aea12f
AC_MSG_NOTICE([External hardware support:
Packit aea12f
Packit aea12f
  /dev/crypto:          $enable_cryptodev
Packit aea12f
  Hardware accel:       $hw_accel
Packit aea12f
  Padlock accel:        $use_padlock
Packit aea12f
  Random gen. variant:  $rnd_variant
Packit aea12f
  PKCS#11 support:      $with_p11_kit
Packit aea12f
  TPM support:          $with_tpm
Packit aea12f
])
Packit aea12f
if test -n "$ac_trousers_lib";then
Packit aea12f
AC_MSG_NOTICE([
Packit aea12f
  TPM library:          $ac_trousers_lib
Packit aea12f
])
Packit aea12f
fi
Packit aea12f
Packit aea12f
AC_MSG_NOTICE([Optional features:
Packit aea12f
(note that included applications might not compile properly
Packit aea12f
if features are disabled)
Packit aea12f
Packit aea12f
  SSL3.0 support:       $ac_enable_ssl3
Packit aea12f
  SSL2.0 client hello:  $ac_enable_ssl2
Packit aea12f
  Allow SHA1 sign:      $ac_allow_sha1
Packit aea12f
  DTLS-SRTP support:    $ac_enable_srtp
Packit aea12f
  ALPN support:         $ac_enable_alpn
Packit aea12f
  OCSP support:         $ac_enable_ocsp
Packit aea12f
  SRP support:          $ac_enable_srp
Packit aea12f
  PSK support:          $ac_enable_psk
Packit aea12f
  DHE support:          $ac_enable_dhe
Packit aea12f
  ECDHE support:        $ac_enable_ecdhe
Packit aea12f
  GOST support:         $ac_enable_gost
Packit aea12f
  Anon auth support:    $ac_enable_anon
Packit aea12f
  Heartbeat support:    $ac_enable_heartbeat
Packit aea12f
  IDNA support:         $idna_support
Packit aea12f
  Non-SuiteB curves:    $enable_non_suiteb
Packit aea12f
  FIPS140 mode:         $enable_fips
Packit Service 991b93
  Strict DER time:	$ac_strict_der_time
Packit aea12f
])
Packit aea12f
Packit aea12f
AC_MSG_NOTICE([Optional libraries:
Packit aea12f
Packit aea12f
  Guile wrappers:       $opt_guile_bindings
Packit aea12f
  C++ library:          $use_cxx
Packit aea12f
  DANE library:         $enable_dane
Packit aea12f
  OpenSSL compat:       $enable_openssl
Packit aea12f
])
Packit aea12f
Packit aea12f
AC_MSG_NOTICE([System files:
Packit aea12f
Packit aea12f
  Trust store pkcs11:   $with_default_trust_store_pkcs11
Packit aea12f
  Trust store dir:      $with_default_trust_store_dir
Packit aea12f
  Trust store file:     $with_default_trust_store_file
Packit aea12f
  Blacklist file:       $with_default_blacklist_file
Packit aea12f
  CRL file:             $with_default_crl_file
Packit Service 991b93
  Configuration file:   $system_config_file
Packit aea12f
  DNSSEC root key file: $unbound_root_key_file
Packit aea12f
])
Packit aea12f
Packit aea12f
if test ! -f "$unbound_root_key_file"; then
Packit aea12f
AC_MSG_WARN([[
Packit aea12f
*** 
Packit aea12f
*** The DNSSEC root key file in $unbound_root_key_file was not found. 
Packit aea12f
*** This file is needed for the verification of DNSSEC responses.
Packit aea12f
*** Use the command: unbound-anchor -a "$unbound_root_key_file"
Packit aea12f
*** to generate or update it.
Packit aea12f
*** ]])
Packit aea12f
fi
Packit aea12f
Packit aea12f
if test "${enable_static}" != no;then
Packit aea12f
AC_MSG_WARN([[
Packit aea12f
*** GnuTLS will be build as a static library. That means that library
Packit aea12f
*** constructors for gnutls_global_init will not be made available to
Packit aea12f
*** linking applications. If you are building that library for arbitrary
Packit aea12f
*** applications to link, do not enable static linking.
Packit aea12f
]])
Packit aea12f
fi
Packit aea12f
Packit aea12f
if test "$enable_fuzzer_target" != "no";then
Packit aea12f
AC_MSG_WARN([[
Packit aea12f
*** This version of the library is for fuzzying purposes and is intentionally broken!
Packit aea12f
]])
Packit aea12f
fi