Blame configure.ac

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