Debian Codegraph @

configure.ac

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2000-2012, 2016, 2019, 2022 Free Software Foundation, Inc.
3 #
4 # Author: Nikos Mavrogiannopoulos, Simon Josefsson
5 #
6 # This file is part of GnuTLS.
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <https://www.gnu.org/licenses/>.
20
21 AC_PREREQ([2.71])
22
23 dnl when updating version also update LT_REVISION in m4/hooks.m4
24 AC_INIT([GnuTLS],[3.8.13],[[email protected]])
25 AC_CONFIG_AUX_DIR([build-aux])
26 AC_CONFIG_MACRO_DIRS([m4 src/gl/m4 lib/unistring/m4])
27 AC_CANONICAL_HOST
28
29 AM_INIT_AUTOMAKE([1.12.2 foreign subdir-objects no-dist-gzip dist-xz -Wall -Wno-override])
30 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31 AC_CONFIG_HEADERS([config.h])
32
33 AC_MSG_RESULT([***
34 *** Checking for compilation programs...
35 ])
36
37 dnl Checks for programs.
38 PKG_PROG_PKG_CONFIG
39 AC_PROG_CC
40 gl_EARLY
41 ggl_EARLY
42 unistring_EARLY
43 AM_PROG_AS
44 AM_PROG_AR
45 AC_PROG_CXX
46 AM_PROG_CC_C_O
47 AC_PROG_MKDIR_P
48 AC_PROG_YACC
49 AC_PROG_SED
50
51 AC_USE_SYSTEM_EXTENSIONS
52
53 #
54 # Require C99 support
55 #
56 AS_CASE([$ac_prog_cc_stdc],
57 [c89],
58 [AC_MSG_WARN([[Compiler does not support C99. It may not be able to compile the project.]])],
59 [AC_DEFINE([C99_MACROS], 1, [C99 macros are supported])])
60
61 AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = yes)
62
63 AX_CODE_COVERAGE
64
65 AM_MAINTAINER_MODE([enable])
66
67 AM_MISSING_PROG([GPERF], [gperf])
68 AM_MISSING_PROG([ASN1PARSER], [asn1Parser])
69 AM_MISSING_PROG([PERL], [perl])
70
71 AC_CHECK_PROGS([FAKETIME], [faketime])
72 AS_IF([test -n "$FAKETIME"], [FAKETIME_F_OPT="-f"; AC_SUBST([FAKETIME_F_OPT])], [
73 AC_CHECK_PROGS([DATEFUDGE], [datefudge])
74 AS_IF([test -n "$DATEFUDGE"], [
75 FAKETIME_F_OPT="-s"
76 AC_SUBST([FAKETIME], [$DATEFUDGE])
77 AC_SUBST([FAKETIME_F_OPT])
78 ])
79 ])
80
81 AC_CACHE_CHECK([whether faketime program works], [gnutls_cv_prog_faketime_works],
82 [AC_LINK_IFELSE(
83 [AC_LANG_PROGRAM(
84 [[#include <stdio.h>
85 #include <stdlib.h>
86 #include <time.h>
87 ]],
88 [[time_t t = time(NULL);
89 struct tm *tmp = localtime(&t);
90 char outstr[200];
91 if (!tmp) return 0;
92 if (!strftime(outstr, sizeof(outstr), "%s", tmp)) return 0;
93 puts(outstr);
94 return 0;
95 ]])],
96 [AS_IF([test -n "$FAKETIME" && test "`TZ=UTC $FAKETIME $FAKETIME_F_OPT "2006-09-23 00:00:00" ./conftest$EXEEXT`" = "1158969600"], [
97 gnutls_cv_prog_faketime_works=yes
98 ], [
99 gnutls_cv_prog_faketime_works=no
100 ])],
101 [gnutls_cv_prog_faketime_works=no],
102 [gnutls_cv_prog_faketime_works=cross-compiling])])
103
104 AC_SUBST([gnutls_cv_prog_faketime_works])
105
106 AC_ARG_ENABLE(bash-tests,
107 AS_HELP_STRING([--disable-bash-tests], [skip some tests that badly need bash]),
108 enable_bash_tests=$enableval, enable_bash_tests=yes)
109 AM_CONDITIONAL(DISABLE_BASH_TESTS, test "$enable_bash_tests" != "yes")
110
111 AC_ARG_ENABLE(doc,
112 AS_HELP_STRING([--disable-doc], [don't generate any documentation]),
113 enable_doc=$enableval, enable_doc=yes)
114 AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" != "no")
115
116 AC_ARG_ENABLE(manpages,
117 AS_HELP_STRING([--enable-manpages], [install manpages even if disable-doc is given]),
118 enable_manpages=$enableval,enable_manpages=auto)
119
120 if test "${enable_manpages}" = "auto";then
121 enable_manpages="${enable_doc}"
122 fi
123
124 AM_CONDITIONAL(ENABLE_MANPAGES, test "$enable_manpages" != "no")
125
126 AC_ARG_ENABLE(tools,
127 AS_HELP_STRING([--disable-tools], [don't compile any tools]),
128 enable_tools=$enableval, enable_tools=yes)
129 AM_CONDITIONAL(ENABLE_TOOLS, test "$enable_tools" != "no")
130
131 # For includes/gnutls/gnutls.h.in.
132 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
133 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
134 AC_SUBST(PATCH_VERSION, [[`echo $PACKAGE_VERSION | sed 's/.*\..*\.\([0-9]*\).*/\1/g'`]])
135 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
136
137 dnl C and C++ capabilities
138 AC_C_INLINE
139 # Autoupdate added the next two lines to ensure that your configure
140 # script's behavior did not change. They are probably safe to remove.
141 AC_CHECK_INCLUDES_DEFAULT
142 AC_PROG_EGREP
143
144
145 # For the C++ code
146 AC_ARG_ENABLE(cxx,
147 AS_HELP_STRING([--disable-cxx], [unconditionally disable the C++ library]),
148 use_cxx=$enableval, use_cxx=yes)
149 if test "$use_cxx" != "no"; then
150 AC_LANG_PUSH(C++)
151 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
152 AC_LANG_POP(C++)
153 fi
154 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
155
156 dnl Detect windows build
157 use_accel=yes
158 have_vista_dynamic=yes
159 case "$host" in
160 *android*)
161 have_android=yes
162 have_elf=yes
163 ;;
164 *mingw32* | *mingw64*)
165 have_win=yes
166 AC_DEFINE([_UNICODE], [1], [Defined to 1 for Unicode (wide chars) APIs])
167 GNUTLS_LIBS_PRIVATE="${GNUTLS_LIBS_PRIVATE} -ladvapi32 -lcrypt32"
168 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
169 [[#include <windows.h>
170 #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600
171 # error Vista APIs allowed statically
172 #endif
173 ]],[[;]])],[have_vista_dynamic=yes],[have_vista_dynamic=no])
174 AC_ARG_ENABLE(dyn_ncrypt,
175 AS_HELP_STRING([--enable-dyn-ncrypt], [use ncrypt dynamically]),
176 enable_dyn_ncrypt=$enableval, enable_dyn_ncrypt=$have_vista_dynamic
177 )
178 if test "x$enable_dyn_ncrypt" = "xyes"; then
179 AC_DEFINE([DYN_NCRYPT], 1, [Dynamic use of ncrypt API (win32)])
180 else
181 GNUTLS_LIBS_PRIVATE="${GNUTLS_LIBS_PRIVATE} -lncrypt"
182 fi
183 ;;
184 *darwin*)
185 have_macosx=yes
186 save_LDFLAGS="$LDFLAGS"
187 dnl Try to use -no_weak_imports if available. This makes sure we
188 dnl error out when linking to a function that doesn't exist in the
189 dnl intended minimum runtime version.
190 LDFLAGS="$LDFLAGS -Wl,-no_weak_imports"
191 AC_MSG_CHECKING([whether the linker supports -Wl,-no_weak_imports])
192 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
193 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); LDFLAGS="$save_LDFLAGS"])
194 GNUTLS_LIBS_PRIVATE="${GNUTLS_LIBS_PRIVATE} -framework Security -framework CoreFoundation"
195 ;;
196 *solaris*)
197 have_elf=yes
198 use_accel=no
199 AC_MSG_WARN([[
200 ***
201 *** In solaris hardware acceleration is disabled by default due to issues
202 *** with the assembler. Use --enable-hardware-acceleration to enable it.
203 *** ]])
204 ;;
205 *)
206 have_elf=yes
207 ;;
208 esac
209
210 AM_CONDITIONAL(ANDROID, test "$have_android" = yes)
211 AM_CONDITIONAL(WINDOWS, test "$have_win" = yes)
212 AM_CONDITIONAL(MACOSX, test "$have_macosx" = yes)
213 AM_CONDITIONAL(ELF, test "$have_elf" = yes)
214
215 dnl Hardware Acceleration
216 AC_ARG_ENABLE(hardware-acceleration,
217 AS_HELP_STRING([--disable-hardware-acceleration], [unconditionally disable hardware acceleration]),
218 use_accel=$enableval)
219 hw_accel=none
220
221
222 use_padlock=no
223 if test "$use_accel" != "no"; then
224 case $host_cpu in
225 armv8 | aarch64)
226 hw_accel="aarch64"
227 case $host_os in
228 *_ilp32)
229 dnl ILP32 not supported in assembler yet
230 hw_accel="none"
231 ;;
232 esac
233 ;;
234 i?86 | x86_64 | amd64)
235 AC_CHECK_HEADERS(cpuid.h)
236 if test "$host_cpu" = "x86_64" || test "$host_cpu" = "amd64"; then
237 hw_accel="x86-64"
238 else
239 hw_accel="x86"
240 fi
241 use_padlock=yes
242 ;;
243 *)
244 ;;
245 esac
246
247 # Check if the assembler supports -march=all
248 if test "$hw_accel" = aarch64; then
249 AARCH64_CCASFLAGS="-Wa,-march=all"
250 AC_MSG_CHECKING([whether the compiler supports -Wa,-march=all])
251 : > conftest.s
252 if "$CCAS" "$AARCH64_CCASFLAGS" -c conftest.s >/dev/null 2>&1; then
253 AC_MSG_RESULT(yes)
254 else
255 AC_MSG_RESULT(no)
256 AARCH64_CCASFLAGS=
257 fi
258 AC_SUBST(AARCH64_CCASFLAGS)
259 fi
260
261 # check for gcc's __get_cpuid_count functionality
262 AC_CACHE_CHECK([for __get_cpuid_count], [gnutls_cv_func___get_cpuid_count],
263 [AC_LINK_IFELSE(
264 [AC_LANG_PROGRAM(
265 [[#include <cpuid.h>
266 ]],
267 [[unsigned t1;
268 return __get_cpuid_count(7, 0, &t1, &t1, &t1, &t1);
269 ]])],
270 [gnutls_cv_func___get_cpuid_count=yes],
271 [gnutls_cv_func___get_cpuid_count=no]
272 )])
273
274 AS_IF([test "$ac_cv_have___get_cpuid_count" = yes], [
275 AC_DEFINE([HAVE_GET_CPUID_COUNT], [1], [use __get_cpuid_count])
276 ])
277
278 fi
279
280 AC_ARG_ENABLE(tls13-interop,
281 AS_HELP_STRING([--disable-tls13-interop], [disable TLS1.3 interoperability testing with openssl]),
282 enable_tls13_interop=$enableval, enable_tls13_interop=yes)
283
284 dnl Check for iovec type
285 AC_CHECK_MEMBERS([struct iovec.iov_base],
286 [
287 AC_SUBST([DEFINE_IOVEC_T], ["#include <sys/uio.h>
288 typedef struct iovec giovec_t;"])
289 ],
290 [
291 AC_SUBST([DEFINE_IOVEC_T], ["typedef struct {
292 void *iov_base;
293 size_t iov_len;
294 } giovec_t;"])
295 ],
296 [#include <sys/uio.h>
297 ])
298 AM_SUBST_NOTMAKE([DEFINE_IOVEC_T])
299
300 dnl Need netinet/tcp.h for TCP_FASTOPEN
301 AC_CHECK_HEADERS([netinet/tcp.h])
302 AC_CHECK_HEADERS([stdatomic.h])
303
304 dnl This ensures that we link with the right library for atomic operations on Linux SPARC
305 save_LIBS=$LIBS
306 AC_SEARCH_LIBS([__atomic_load_4], [atomic], [], [AC_MSG_NOTICE([Could not detect libatomic])])
307 LIBS=$save_LIBS
308
309 AS_IF([test "$ac_cv_search___atomic_load_4" = "none required" || test "$ac_cv_search___atomic_load_4" = "no"],
310 [AC_SUBST([LIBATOMIC_LIBS], [])],
311 [AC_SUBST([LIBATOMIC_LIBS], [$ac_cv_search___atomic_load_4])])
312
313 dnl We use its presence to detect C11 threads
314 AC_CHECK_HEADERS([threads.h])
315
316 AC_CHECK_HEADERS([sanitizer/asan_interface.h])
317 AC_CHECK_HEADERS([valgrind/memcheck.h])
318
319 AC_ARG_ENABLE(padlock,
320 AS_HELP_STRING([--disable-padlock], [unconditionally disable padlock acceleration]),
321 use_padlock=$enableval)
322
323 if test "$use_padlock" != "no"; then
324 AC_DEFINE([ENABLE_PADLOCK], 1, [Enable padlock acceleration])
325 AC_SUBST([ENABLE_PADLOCK])
326 fi
327 AM_CONDITIONAL(ENABLE_PADLOCK, test "$use_padlock" = "yes")
328 AM_CONDITIONAL(ASM_AARCH64, test x"$hw_accel" = x"aarch64")
329 AM_CONDITIONAL(ASM_X86_64, test x"$hw_accel" = x"x86-64")
330 AM_CONDITIONAL(ASM_X86_32, test x"$hw_accel" = x"x86")
331 AM_CONDITIONAL(ASM_X86, test x"$hw_accel" = x"x86" || test x"$hw_accel" = x"x86-64")
332 AM_CONDITIONAL(HAVE_GCC_GNU89_INLINE_OPTION, test "$gnu89_inline" = "yes"])
333 AM_CONDITIONAL(HAVE_GCC, test "$GCC" = "yes")
334
335 dnl check for getrandom, KERN_ARND, and getentropy, in the order of precedence
336 rnd_variant="auto-detect"
337
338 AC_CACHE_CHECK([for getrandom], [gnutls_cv_func_getrandom],
339 [AC_LINK_IFELSE(
340 [AC_LANG_PROGRAM(
341 [[#include <sys/random.h>
342 ]],
343 [[getrandom(0, 0, 0);]])],
344 [gnutls_cv_func_getrandom=yes],
345 [gnutls_cv_func_getrandom=no])])
346
347 AS_IF([test "$gnutls_cv_func_getrandom" = yes], [
348 AC_DEFINE([HAVE_GETRANDOM], 1, [Enable the Linux getrandom function])
349 rnd_variant=getrandom
350 ])
351
352 AC_CACHE_CHECK([for KERN_ARND], [gnutls_cv_kern_arnd],
353 [AC_LINK_IFELSE(
354 [AC_LANG_PROGRAM(
355 [[#include <sys/sysctl.h>
356 #ifdef __linux__
357 #error 1
358 #endif
359 static int name[] = {CTL_KERN, KERN_ARND};
360 ]],
361 [[sysctl(0, 0, 0, 0, 0, 0);]])],
362 [gnutls_cv_kern_arnd=yes],
363 [gnutls_cv_kern_arnd=no])])
364
365 AM_CONDITIONAL(HAVE_KERN_ARND, test "$gnutls_cv_kern_arnd" = yes)
366 AM_COND_IF([HAVE_KERN_ARND],
367 [AC_DEFINE([HAVE_KERN_ARND], 1, [Enable the BSD sysctl(KERN_ARND) function])
368 rnd_variant=kern_arnd])
369
370 AC_CACHE_CHECK([for getentropy], [gnutls_cv_func_getentropy],
371 [AC_LINK_IFELSE(
372 [AC_LANG_PROGRAM(
373 [[#include <unistd.h>
374 #ifdef __APPLE__
375 #include <sys/random.h>
376 #endif
377 #ifdef __linux__
378 #error 1
379 #endif
380 ]],
381 [[getentropy(0, 0);]])],
382 [gnutls_cv_func_getentropy=yes],
383 [gnutls_cv_func_getentropy=no])])
384
385 AM_CONDITIONAL(HAVE_GETENTROPY, test "$gnutls_cv_func_getentropy" = yes)
386 AM_COND_IF([HAVE_GETENTROPY],
387 [AC_DEFINE([HAVE_GETENTROPY], 1, [Enable the OpenBSD getentropy function])
388 rnd_variant=getentropy])
389
390 dnl Try the hooks.m4
391 LIBGNUTLS_HOOKS
392 LIBGNUTLS_EXTRA_HOOKS
393
394 AC_ARG_ENABLE(tests,
395 AS_HELP_STRING([--disable-tests], [don't compile or run any tests]),
396 enable_tests=$enableval, enable_tests=$enable_tools)
397 AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" != "no")
398
399 AC_ARG_ENABLE(fuzzer-target,
400 AS_HELP_STRING([--enable-fuzzer-target], [make a library intended for testing - not production]),
401 enable_fuzzer_target=$enableval, enable_fuzzer_target=no)
402 if test "$enable_fuzzer_target" != "no";then
403 AC_DEFINE([FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION], 1, [Enable fuzzer target -not for production])
404 fi
405
406 dnl
407 dnl check for gtk-doc
408 dnl
409 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
410
411 AM_GNU_GETTEXT([external])
412 AM_GNU_GETTEXT_VERSION([0.19])
413 m4_ifdef([AM_GNU_GET][TEXT_REQUIRE_VERSION],[
414 AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])
415 ])
416
417 AC_C_BIGENDIAN
418
419 dnl No fork on MinGW, disable some self-tests until we fix them.
420 dnl Check clock_gettime and pthread_mutex_lock in libc (avoid linking to other libs)
421 AC_CHECK_FUNCS([fork setitimer getrusage getpwuid_r nanosleep daemon getpid localtime mmap],,)
422 dnl Manually check some functions by including headers first. On macOS, you
423 dnl normally only have the latest SDK available, containing all existing
424 dnl functions, but having them restricted according to target version in
425 dnl headers. If we bypass the headers and just try linking (as AC_CHECK_FUNCS
426 dnl does), we will accidentally detect functions which we shouldn't use. Set
427 dnl ac_cv_func_* as well, to avoid later AC_CHECK_FUNCS from other included
428 dnl scripts from overriding it.
429 AC_CACHE_CHECK([for clock_gettime], [gnutls_cv_func_clock_gettime],
430 [AC_LINK_IFELSE(
431 [AC_LANG_PROGRAM(
432 [[#include <time.h>
433 ]],
434 [[clock_gettime(0, 0);]])],
435 [gnutls_cv_func_clock_gettime=yes],
436 [gnutls_cv_func_clock_gettime=no])])
437
438 AS_IF([test "$gnutls_cv_func_clock_gettime" = yes], [
439 AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Define to 1 if you have the `clock_gettime' function.])
440 ])
441
442 AC_CACHE_CHECK([for fmemopen], [gnutls_cv_func_fmemopen],
443 [AC_LINK_IFELSE(
444 [AC_LANG_PROGRAM(
445 [[#include <stdio.h>
446 ]],
447 [[fmemopen(0, 0, 0);]])],
448 [gnutls_cv_func_fmemopen=yes],
449 [gnutls_cv_func_fmemopen=no])])
450
451 AS_IF([test "$gnutls_cv_func_fmemopen" = yes], [
452 AC_DEFINE([HAVE_FMEMOPEN], 1, [Define to 1 if you have the `fmemopen' function.])
453 ])
454
455 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
456
457 AC_CHECK_FUNCS([__register_atfork secure_getenv getauxval elf_aux_info],,)
458
459 AC_ARG_ENABLE(seccomp-tests,
460 AS_HELP_STRING([--enable-seccomp-tests], [unconditionally enable tests with seccomp]),
461 seccomp_tests=$enableval, seccomp_tests=no)
462
463 AM_CONDITIONAL(HAVE_SECCOMP_TESTS, test "$seccomp_tests" = "yes")
464
465 # check for libseccomp - used in test programs
466 AC_LIB_HAVE_LINKFLAGS(seccomp,, [#include <seccomp.h>
467 ], [seccomp_init(0);])
468
469 # check for libcrypto - used in test programs
470 AC_LIB_HAVE_LINKFLAGS(crypto,, [#include <openssl/evp.h>
471 ], [EVP_CIPHER_CTX_init(NULL);])
472
473 AM_CONDITIONAL(HAVE_LIBCRYPTO, test "$HAVE_LIBCRYPTO" = "yes")
474
475 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>
476 #include <signal.h>
477 ], [timer_create (0,0,0);])
478
479 if test "$have_win" != "yes";then
480 AC_CHECK_FUNCS([pthread_mutex_lock],,)
481 if test "$ac_cv_func_pthread_mutex_lock" != "yes";then
482 AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
483 fi
484 fi
485
486 if test "$ac_cv_func_nanosleep" != "yes";then
487 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [nanosleep (0, 0);])
488 gnutls_needs_librt=yes
489 fi
490
491 if test "$gnutls_cv_func_clock_gettime" != "yes";then
492 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [clock_gettime (0, 0);])
493 gnutls_needs_librt=yes
494 fi
495
496 if test "$have_macosx" = "yes";then
497 dnl Remove -no_weak_imports from LDFLAGS after testing for function
498 dnl availability; keeping it included later breaks code that uses
499 dnl FD_SET, which since Xcode 11.4 implicitly adds a call to the
500 dnl weakly linked function __darwin_check_fd_set_overflow. We only
501 dnl need it above to make sure that we don't detect functions that
502 dnl are linked weakly (and can end up null at runtime) unless
503 dnl we check for their availability at runtime.
504 new_LDFLAGS=""
505 for f in $LDFLAGS; do
506 if test "$f" != "-Wl,-no_weak_imports"; then
507 new_LDFLAGS="$new_LDFLAGS $f"
508 fi
509 done
510 LDFLAGS="$new_LDFLAGS"
511 fi
512
513 AC_ARG_WITH(included-unistring, AS_HELP_STRING([--with-included-unistring],
514 [disable linking with system libunistring]),
515 included_unistring="$withval",
516 included_unistring=no)
517
518 if test "$included_unistring" = yes;then
519 ac_have_unistring=no
520 else
521 save_LIBS=$LIBS
522 AC_SEARCH_LIBS(u8_normalize, unistring, [
523 included_unistring=no
524 ac_have_unistring=yes
525 AC_SUBST([LIBUNISTRING], [$ac_cv_search_u8_normalize])
526 ], [
527 ac_cv_libunistring=no
528 AC_MSG_ERROR([[
529 ***
530 *** Libunistring was not found. To use the included one, use --with-included-unistring
531 ]])
532 ])
533 LIBS=$save_LIBS
534 fi
535
536 AM_CONDITIONAL(HAVE_LIBUNISTRING, test "$ac_have_unistring" = "yes")
537
538 # specify our own suppressions file; this needs to be set before gl_INIT
539 DEFAULT_VALGRINDFLAGS='-q --error-exitcode=1 --leak-check=full --track-origins=yes --gen-suppressions=all'
540
541 gl_VALGRIND_TESTS_DEFAULT_NO
542
543 dnl Note that g*l_INIT are run after we check for library capabilities,
544 dnl to prevent issues from caching lib dependencies. See discussion
545 dnl in https://bugs.gentoo.org/show_bug.cgi?id=494940 and
546 dnl https://gnu-autoconf.7623.n7.nabble.com/Correct-way-to-check-for-clock-gettime-td12276.html
547 gl_INIT
548 ggl_INIT
549 unistring_INIT
550
551 # disable the extended test suite at tests/suite if asked, or if we are not running in git master
552 AC_ARG_ENABLE(full-test-suite,
553 AS_HELP_STRING([--disable-full-test-suite], [disable running very slow components of test suite]),
554 full_test_suite=$enableval, full_test_suite=yes)
555
556 # test if we are in git master or in release build. In release
557 # builds we do not use valgrind.
558 SUITE_FILE="${srcdir}/tests/suite/prime-check.c"
559 if test "$full_test_suite" = yes && test ! -f "$SUITE_FILE";then
560 full_test_suite=no
561 fi
562
563 AM_CONDITIONAL(WANT_TEST_SUITE, test "$full_test_suite" = "yes")
564
565 dnl Python is required when building from git (for the cligen tool) and
566 dnl when running the extended test suite.
567 if test "$full_test_suite" = yes || test -e "${srcdir}/.git"; then
568 AM_PATH_PYTHON([3.6])
569 fi
570
571 AM_CONDITIONAL([HAVE_PYTHON_SIX], [$PYTHON -c 'import six' 2>/dev/null])
572 if test "$full_test_suite" = yes; then
573 AM_COND_IF([HAVE_PYTHON_SIX],,
574 AC_MSG_WARN(['six' python module not found; skipping tls-fuzzer tests]))
575 fi
576
577 AC_ARG_ENABLE(oldgnutls-interop,
578 AS_HELP_STRING([--enable-oldgnutls-interop], [enable interoperability testing with old gnutls version]),
579 enable_oldgnutls_interop=$enableval, enable_oldgnutls_interop=no)
580
581 if test "$enable_oldgnutls_interop" != "no" && test "$full_test_suite" != yes;then
582 AC_MSG_ERROR([cannot --enable-oldgnutls-interop without --enable-full-test-suite])
583 fi
584
585 AM_CONDITIONAL(ENABLE_OLDGNUTLS_INTEROP, test "$enable_oldgnutls_interop" != "no")
586
587 # check for libev - used in full test suite
588 AC_LIB_HAVE_LINKFLAGS(ev,, [#include <ev.h>], [ev_run(0,0);])
589 if test "$ac_cv_libev" = yes; then
590 AC_SUBST([LIBEV_LIBS], [$LIBEV])
591 elif test "$full_test_suite" = yes;then
592 AC_MSG_ERROR([[***
593 *** libev4 was not found.
594 ***]])
595 fi
596
597 dnl GCC warnings to enable
598
599 AC_ARG_ENABLE([gcc-warnings],
600 [AS_HELP_STRING([--disable-gcc-warnings],
601 [turn off lots of GCC warnings (for developers)])],
602 [case $enableval in
603 yes|no) ;;
604 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
605 esac
606 gl_gcc_warnings=$enableval],
607 [gl_gcc_warnings=yes]
608 )
609
610 if test "$gl_gcc_warnings" = yes; then
611 gl_WARN_ADD([-Wtype-limits], [WSTACK_CFLAGS])
612
613 nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
614 nw="$nw -Wc++-compat" # We don't care about C++ compilers
615 nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
616 nw="$nw -Wtraditional" # Warns on #elif which we use often
617 nw="$nw -Wpadded" # Our structs are not padded
618 nw="$nw -Wtraditional-conversion" # Too many warnings for now
619 nw="$nw -Wswitch-default" # Too many warnings for now
620 nw="$nw -Wformat-y2k" # Too many warnings for now
621 nw="$nw -Woverlength-strings" # We use some in tests/
622 nw="$nw -Wvla" # There is no point to avoid C99 variable length arrays
623 nw="$nw -Wformat-nonliteral" # Incompatible with gettext _()
624 nw="$nw -Wformat-signedness" # Too many to handle
625 nw="$nw -Wstrict-overflow"
626 nw="$nw -Wmissing-noreturn"
627 nw="$nw -Winline" # Too compiler dependent
628 nw="$nw -Wsuggest-attribute=pure" # Is it worth using attributes?
629 nw="$nw -Wsuggest-attribute=const" # Is it worth using attributes?
630 nw="$nw -Wsuggest-attribute=noreturn" # Is it worth using attributes?
631 nw="$nw -Wstack-protector" # Some functions cannot be protected
632 nw="$nw -Wunsafe-loop-optimizations" # Warnings with no point
633 nw="$nw -Wredundant-decls" # Some files cannot be compiled with that (gl_fd_to_handle)
634 nw="$nw -Wtype-limits" # Too many warnings in gnulib macros
635 nw="$nw -Warith-conversion" # Too compiler dependent
636 nw="$nw -Wmissing-variable-declarations" # asn1Parser provides no way to embed declarations in generated code
637
638 gl_MANYWARN_ALL_GCC([ws])
639 gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
640 for w in $ws; do
641 gl_WARN_ADD([$w])
642 done
643 gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
644 gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
645 gl_WARN_ADD([-Wno-format-truncation]) # Many warnings with no point
646 gl_WARN_ADD([-Wimplicit-fallthrough=2])
647 gl_WARN_ADD([-Wabi=11])
648 gl_WARN_ADD([-fdiagnostics-show-option])
649 fi
650
651 if test "$gl_cv_opt_valgrind_tests" != no; then
652 gl_WARN_ADD([-fno-builtin-strcmp])
653 fi
654
655 AC_SUBST([WERROR_CFLAGS])
656 AC_SUBST([WSTACK_CFLAGS])
657 AC_SUBST([WARN_CFLAGS])
658
659 dnl Programs for compilation or development
660 AC_PROG_LN_S
661 LT_INIT([disable-static,win32-dll,shared])
662
663
664
665 AC_LIB_HAVE_LINKFLAGS(dl,, [#include <dlfcn.h>], [dladdr (0, 0);])
666
667 AC_ARG_ENABLE(fips140-mode,
668 AS_HELP_STRING([--enable-fips140-mode], [enable FIPS140-2 mode]),
669 enable_fips=$enableval, enable_fips=no)
670 AM_CONDITIONAL(ENABLE_FIPS140, test "$enable_fips" = "yes")
671 if [ test "$enable_fips" = "yes" ];then
672 if test "x$HAVE_LIBDL" = "xyes";then
673 AC_DEFINE([ENABLE_FIPS140], 1, [Enable FIPS140-2 mode])
674 AC_SUBST([FIPS140_LIBS], $LIBDL)
675 AC_ARG_WITH(fips140-key, AS_HELP_STRING([--with-fips140-key],
676 [specify the FIPS140 HMAC key for integrity]),
677 fips_key="$withval",
678 fips_key="orboDeJITITejsirpADONivirpUkvarP")
679
680 AC_DEFINE_UNQUOTED([FIPS_KEY], ["$fips_key"], [The FIPS140-2 integrity key])
681
682 AC_ARG_WITH(fips140-module-name, AS_HELP_STRING([--with-fips140-module-name],
683 [specify the FIPS140 module name]),
684 fips_module_name="$withval",
685 fips_module_name=none)
686
687 if test "x$fips_module_name" != xnone; then
688 AC_DEFINE_UNQUOTED([FIPS_MODULE_NAME], ["$fips_module_name"], [The FIPS140 module name])
689 fi
690
691 AC_ARG_WITH(fips140-module-version, AS_HELP_STRING([--with-fips140-module-version],
692 [specify the FIPS140 module version]),
693 fips_module_version="$withval",
694 fips_module_version=none)
695
696 if test "x$fips_module_version" != xnone; then
697 AC_DEFINE_UNQUOTED([FIPS_MODULE_VERSION], ["$fips_module_version"], [The FIPS140 module version])
698 fi
699
700 AC_CHECK_FUNCS(dl_iterate_phdr)
701 else
702 enable_fips=no
703 AC_MSG_WARN([[
704 ***
705 *** This system is not supported in FIPS140 mode.
706 *** libdl and dladdr() are required.
707 *** ]])
708 fi
709 fi
710
711 AC_ARG_ENABLE(strict-x509,
712 AS_HELP_STRING([--enable-strict-x509], [enable stricter sanity checks for x509 certificates]),
713 enable_strict_x509=$enableval, enable_strict_x509=no)
714 if test "$enable_strict_x509" != "no"; then
715 AC_DEFINE([STRICT_X509], 1, [Enable stricter sanity checks for x509 certificates])
716 fi
717
718 AC_ARG_WITH([pkcs12-iter-count],
719 [AS_HELP_STRING([--with-pkcs12-iter-count],
720 [specify iteration count for PKCS\#12 key derivation @<:@default=600000@:>@])],
721 [pkcs12_iter_count="$withval"],
722 [pkcs12_iter_count=600000])
723
724 AC_DEFINE_UNQUOTED([PKCS12_ITER_COUNT], [$pkcs12_iter_count],
725 [The iteration count for PKCS\#12 key derivation])
726 AC_SUBST([PKCS12_ITER_COUNT], [$pkcs12_iter_count])
727
728 PKG_CHECK_MODULES(CMOCKA, [cmocka >= 1.0.1], [with_cmocka=yes], [with_cmocka=no])
729 AM_CONDITIONAL(HAVE_CMOCKA, test "$with_cmocka" != "no")
730
731 AC_ARG_WITH(idn, AS_HELP_STRING([--without-idn],
732 [disable support for IDNA]),
733 try_libidn2="$withval",
734 try_libidn2=yes)
735
736 idna_support=no
737 with_libidn2=no
738
739 if test "$try_libidn2" = yes;then
740 PKG_CHECK_MODULES(LIBIDN2, [libidn2 >= 2.0.0], [with_libidn2=yes], [with_libidn2=no])
741 if test "${with_libidn2}" = "yes";then
742 idna_support="IDNA 2008 (libidn2)"
743 AC_DEFINE([HAVE_LIBIDN2], 1, [Define if IDNA 2008 support is enabled.])
744 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
745 GNUTLS_REQUIRES_PRIVATE="Requires.private: libidn2"
746 else
747 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, libidn2"
748 fi
749 else
750 AC_MSG_WARN(*** LIBIDN2 was not found. You will not be able to use IDN2008 support)
751 fi
752 fi
753
754 AM_CONDITIONAL(HAVE_LIBIDN2, test "$with_libidn2" != "no")
755
756 if test "x$have_vista_dynamic" = "xno"; then
757 AC_CHECK_TYPES([BCRYPT_ALG_HANDLE],[
758 GNUTLS_LIBS_PRIVATE="${GNUTLS_LIBS_PRIVATE} -lbcrypt"
759 ],[],[#include <windows.h>
760 #include <bcrypt.h>])
761 fi
762 AM_CONDITIONAL(HAVE_BCRYPT, test "$ac_cv_type_BCRYPT_ALG_HANDLE" = "yes")
763
764 AC_ARG_ENABLE(non-suiteb-curves,
765 AS_HELP_STRING([--disable-non-suiteb-curves], [disable curves not in SuiteB]),
766 enable_non_suiteb=$enableval, enable_non_suiteb=yes)
767
768 if test "$enable_non_suiteb" = "yes";then
769 dnl nettle_secp_192r1 is not really a function
770 AC_CHECK_LIB(hogweed, nettle_get_secp_192r1, enable_non_suiteb=yes, enable_non_suiteb=no, [$HOGWEED_LIBS $NETTLE_LIBS])
771
772 if test "$enable_non_suiteb" = "yes";then
773 AC_DEFINE([ENABLE_NON_SUITEB_CURVES], 1, [Enable all curves])
774 fi
775 fi
776 AM_CONDITIONAL(ENABLE_NON_SUITEB_CURVES, test "$enable_non_suiteb" = "yes")
777
778 AC_ARG_ENABLE(dsa,
779 AS_HELP_STRING([--disable-dsa], [disable DSA]),
780 enable_dsa=$enableval, enable_dsa=yes)
781 if test x$enable_dsa != xno; then
782 AC_DEFINE([ENABLE_DSA], 1, [Define if DSA is enabled.])
783 fi
784 AM_CONDITIONAL([ENABLE_DSA], [test x$enable_dsa != xno])
785
786 # Check for GOST28147
787 save_LIBS=$LIBS
788 LIBS="$LIBS $NETTLE_LIBS"
789 AC_CHECK_FUNCS(nettle_gost28147_set_key)
790 LIBS=$save_LIBS
791
792 # Check for Magma
793 save_LIBS=$LIBS
794 LIBS="$LIBS $NETTLE_LIBS"
795 AC_CHECK_FUNCS(nettle_magma_set_key)
796 LIBS=$save_LIBS
797
798 # Check for Kuznyechik
799 save_LIBS=$LIBS
800 LIBS="$LIBS $NETTLE_LIBS"
801 AC_CHECK_FUNCS(nettle_kuznyechik_set_key)
802 LIBS=$save_LIBS
803
804 # Check for CMAC MAGMA support
805 save_LIBS=$LIBS
806 LIBS="$LIBS $NETTLE_LIBS"
807 AC_CHECK_FUNCS(nettle_cmac_magma_update)
808 LIBS=$save_LIBS
809
810 # Check for CMAC KUZNYECHIK support
811 save_LIBS=$LIBS
812 LIBS="$LIBS $NETTLE_LIBS"
813 AC_CHECK_FUNCS(nettle_cmac_kuznyechik_update)
814 LIBS=$save_LIBS
815
816 # Check sonames of the linked libraries needed for FIPS selftests.
817 save_CFLAGS=$CFLAGS
818 CFLAGS="$CFLAGS $GMP_CFLAGS"
819 save_LIBS=$LIBS
820 LIBS="$LIBS $GMP_LIBS"
821 LIBGNUTLS_CHECK_SONAME([gmp], [AC_LANG_PROGRAM([
822 #include <gmp.h>],[
823 mpz_t n;
824 mpz_init(n);])])
825 LIBS="$save_LIBS"
826 CFLAGS="$save_CFLAGS"
827
828 save_CFLAGS=$CFLAGS
829 CFLAGS="$CFLAGS $NETTLE_CFLAGS"
830 save_LIBS=$LIBS
831 LIBS="$LIBS $NETTLE_LIBS"
832 LIBGNUTLS_CHECK_SONAME([nettle], [AC_LANG_PROGRAM([
833 #include <nettle/sha2.h>],[
834 struct sha256_ctx ctx;
835 sha256_init(&ctx);])])
836 LIBS="$save_LIBS"
837 CFLAGS="$save_CFLAGS"
838
839 save_CFLAGS=$CFLAGS
840 # <nettle/bignum.h> includes <gmp.h>
841 CFLAGS="$CFLAGS $HOGWEED_CFLAGS $GMP_CFLAGS"
842 save_LIBS=$LIBS
843 LIBS="$LIBS $HOGWEED_LIBS"
844 LIBGNUTLS_CHECK_SONAME([hogweed], [AC_LANG_PROGRAM([
845 #include <nettle/rsa.h>],[
846 struct rsa_private_key priv;
847 nettle_rsa_private_key_init(&priv);])])
848 LIBS="$save_LIBS"
849 CFLAGS="$save_CFLAGS"
850
851 gnutls_so=libgnutls.so.`expr "$LT_CURRENT" - "$LT_AGE"`
852 AC_DEFINE_UNQUOTED([GNUTLS_LIBRARY_SONAME], ["$gnutls_so"], [The soname of gnutls library])
853 AC_SUBST([gnutls_so])
854
855 AC_MSG_CHECKING([whether to build libdane])
856 AC_ARG_ENABLE(libdane,
857 AS_HELP_STRING([--disable-libdane],
858 [disable the built of libdane]),
859 enable_dane=$enableval, enable_dane=yes)
860 AC_MSG_RESULT($enable_dane)
861
862 if test "$enable_dane" != "no"; then
863 LIBS="$oldlibs -lunbound"
864 AC_MSG_CHECKING([for unbound library])
865 AC_LINK_IFELSE([AC_LANG_PROGRAM([
866 #include <unbound.h>],[
867 struct ub_ctx* ctx;
868 ctx = ub_ctx_create();])],
869 [AC_MSG_RESULT(yes)
870 AC_SUBST([UNBOUND_LIBS], [-lunbound])
871 AC_SUBST([UNBOUND_CFLAGS], [])
872 AC_DEFINE([HAVE_DANE], 1, [Enable the DANE library])
873 enable_dane=yes],
874 [AC_MSG_RESULT(no)
875 AC_MSG_WARN([[
876 ***
877 *** libunbound was not found. Libdane will not be built.
878 *** ]])
879 enable_dane=no])
880 LIBS="$oldlibs"
881 fi
882
883 AM_CONDITIONAL(ENABLE_DANE, test "$enable_dane" = "yes")
884
885 AC_ARG_WITH(unbound-root-key-file, AS_HELP_STRING([--with-unbound-root-key-file],
886 [specify the unbound root key file]),
887 unbound_root_key_file="$withval",
888 if test "$have_win" = yes; then
889 unbound_root_key_file="C:\\Program Files\\Unbound\\root.key"
890 else
891 if test -f /var/lib/unbound/root.key;then
892 unbound_root_key_file="/var/lib/unbound/root.key"
893 else
894 if test -f /usr/share/dns/root.key;then
895 unbound_root_key_file="/usr/share/dns/root.key"
896 else
897 unbound_root_key_file="/etc/unbound/root.key"
898 fi
899 fi
900 fi
901 )
902
903 AC_DEFINE_UNQUOTED([UNBOUND_ROOT_KEY_FILE],
904 ["$unbound_root_key_file"], [The DNSSEC root key file])
905
906 system_config_file='${sysconfdir}/gnutls/config'
907 AC_ARG_WITH(system-priority-file, AS_HELP_STRING([--with-system-priority-file],
908 [specify the system-wide config file (set empty to disable)]),
909 system_config_file="$withval"
910 )
911
912 AM_CONDITIONAL(DISABLE_SYSTEM_CONFIG, test -z "${system_config_file}")
913
914 if test -z "${system_config_file}";then
915 AC_DEFINE([DISABLE_SYSTEM_CONFIG], 1, [Whether to disable system configuration])
916 fi
917
918 AC_SUBST([system_config_file])
919
920 AC_ARG_WITH(default-priority-string, AS_HELP_STRING([--with-default-priority-string],
921 [specify the default priority string used by gnutls_set_default_priority (default is NORMAL)]),
922 prio_string="$withval",
923 prio_string="NORMAL")
924
925 AC_DEFINE_UNQUOTED([DEFAULT_PRIORITY_STRING], ["$prio_string"], [The default priority string])
926
927 dnl Check for p11-kit
928 P11_KIT_MINIMUM=0.23.1
929 AC_ARG_WITH(p11-kit,
930 AS_HELP_STRING([--without-p11-kit],
931 [Build without p11-kit and PKCS#11 support]))
932 if test "$with_p11_kit" != "no"; then
933 PKG_CHECK_MODULES(P11_KIT, [p11-kit-1 >= $P11_KIT_MINIMUM], [with_p11_kit=yes], [with_p11_kit=no])
934 if test "$with_p11_kit" != "no";then
935 AC_DEFINE([ENABLE_PKCS11], 1, [Build PKCS#11 support])
936 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
937 GNUTLS_REQUIRES_PRIVATE="Requires.private: p11-kit-1"
938 else
939 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, p11-kit-1"
940 fi
941 else
942 with_p11_kit=no
943 AC_MSG_ERROR([[
944 ***
945 *** p11-kit >= $P11_KIT_MINIMUM was not found. To disable PKCS #11 support
946 *** use --without-p11-kit, otherwise you may get p11-kit from
947 *** https://p11-glue.freedesktop.org/p11-kit.html
948 *** ]])
949 fi
950 fi
951
952 AM_CONDITIONAL(P11KIT_0_23_11_API, $PKG_CONFIG --atleast-version=0.23.11 p11-kit-1)
953
954 AM_CONDITIONAL(ENABLE_PKCS11, test "$with_p11_kit" != "no")
955
956 save_LIBS=$LIBS
957 LIBS="$LIBS -lm"
958 LIBGNUTLS_CHECK_SONAME([m], [AC_LANG_PROGRAM([
959 #include <math.h>],[
960 trunc (0);])])
961 LIBS="$save_LIBS"
962 CFLAGS="$save_CFLAGS"
963
964 AC_CACHE_CHECK([whether dlopen works with SONAME], [gnutls_cv_dlopen_soname_works],
965 [AC_RUN_IFELSE(
966 [AC_LANG_PROGRAM(
967 [[#include <dlfcn.h>
968 #include <stdlib.h>
969 ]],
970 [[void *handle = dlopen("$M_LIBRARY_SONAME", RTLD_LAZY | RTLD_GLOBAL);
971 return handle != NULL ? 0 : 1;
972 ]])],
973 [gnutls_cv_dlopen_soname_works=yes],
974 [gnutls_cv_dlopen_soname_works=no],
975 [gnutls_cv_dlopen_soname_works=cross-compiling])])
976
977 AM_CONDITIONAL([ENABLE_DLOPEN], [test "$gnutls_cv_dlopen_soname_works" = yes])
978 need_ltlibdl=no
979
980 AC_ARG_WITH(tpm2,
981 [AS_HELP_STRING([--with-tpm2=yes/link/dlopen/no --without-tpm2],
982 [customize/disable TPM2 support])],
983 with_tpm2=$withval, with_tpm2=yes tpm2_optional=yes)
984 AS_CASE([$with_tpm2],
985 [yes],
986 [AM_COND_IF([ENABLE_DLOPEN], [with_tpm2=dlopen], [with_tpm2=link])],
987 [dlopen],
988 [AM_COND_IF([ENABLE_DLOPEN], [:],[AC_MSG_ERROR([[
989 ***
990 *** Unable to dlopen TPM2, try --with-tpm2=link.
991 *** ]])])],
992 [link], [:],
993 [no], [:],
994 [AC_MSG_ERROR([[Unknown argument ${with_tpm2} for --with-tpm2]])])
995
996 AS_IF([test "$with_tpm2" != no], [
997 PKG_CHECK_MODULES(TSS2_ESYS, [tss2-esys],
998 [have_tss2_esys=yes], [have_tss2_esys=no])
999 PKG_CHECK_MODULES(TSS2_MU, [tss2-mu],
1000 [have_tss2_mu=yes], [have_tss2_mu=no])
1001 PKG_CHECK_MODULES(TSS2_TCTILDR, [tss2-tctildr],
1002 [have_tss2_tctildr=yes], [have_tss2_tctildr=no])
1003 ])
1004
1005 AS_IF([test "$have_tss2_esys" = yes && test "$have_tss2_mu" = yes && test "$have_tss2_tctildr" = yes], [
1006 tss2lib="tss2-esys tss2-mu tss2-tctildr"
1007 AC_DEFINE([HAVE_TSS2], 1, [Have TSS2])
1008 need_ltlibdl=yes
1009 ],
1010 [test x"$with_tpm2" != xno && test x$tpm2_optional != xyes ],[
1011 AC_MSG_ERROR([[
1012 ***
1013 *** TPM2 support was requested but the required libraries were not found.
1014 *** To disable TPM2 support use --without-tpm2, otherwise you may get tpm2-tss from
1015 *** https://github.com/tpm2-software/tpm2-tss
1016 *** ]])],
1017 [with_tpm2=no]
1018 )
1019
1020 AM_CONDITIONAL(ENABLE_TPM2, test -n "$tss2lib")
1021 AM_CONDITIONAL([TPM2_ENABLE_DLOPEN], [test "$with_tpm2" = dlopen])
1022
1023 AS_IF([test "$with_tpm2" = dlopen], [
1024 save_LIBS=$LIBS
1025 LIBS="$LIBS $TSS2_ESYS_LIBS"
1026 LIBGNUTLS_CHECK_SONAME([tss2-esys], [AC_LANG_PROGRAM([
1027 #include <tss2/tss2_esys.h>],[
1028 Esys_Initialize (0, 0, 0);])])
1029 LIBS="$save_LIBS"
1030 CFLAGS="$save_CFLAGS"
1031
1032 save_LIBS=$LIBS
1033 LIBS="$LIBS $TSS2_MU_LIBS"
1034 LIBGNUTLS_CHECK_SONAME([tss2-mu], [AC_LANG_PROGRAM([
1035 #include <tss2/tss2_mu.h>],[
1036 Tss2_MU_INT8_Marshal (0, 0, 0, 0);])])
1037 LIBS="$save_LIBS"
1038 CFLAGS="$save_CFLAGS"
1039
1040 save_LIBS=$LIBS
1041 LIBS="$LIBS $TSS2_TCTILDR_LIBS"
1042 LIBGNUTLS_CHECK_SONAME([tss2-tctildr], [AC_LANG_PROGRAM([
1043 #include <tss2/tss2_tctildr.h>],[
1044 Tss2_TctiLdr_Initialize (0, 0);])])
1045 LIBS="$save_LIBS"
1046 CFLAGS="$save_CFLAGS"
1047 ])
1048
1049 AS_IF([test -n "$tss2lib"], [
1050 # Check for Esys_SetCryptoCallbacks availability
1051 save_LIBS=$LIBS
1052 save_CFLAGS=$CFLAGS
1053 LIBS="$LIBS $TSS2_ESYS_LIBS"
1054 CFLAGS="$CFLAGS $TSS2_ESYS_CFLAGS"
1055 AC_CHECK_FUNCS([Esys_SetCryptoCallbacks])
1056 LIBS="$save_LIBS"
1057 CFLAGS="$save_CFLAGS"
1058 ])
1059
1060 AM_CONDITIONAL(NEED_ESYS_CRYPTO_CALLBACKS, test "$ac_cv_func_Esys_SetCryptoCallbacks" = "yes")
1061
1062 AC_ARG_WITH(tpm,
1063 AS_HELP_STRING([--without-tpm],
1064 [Disable TPM (trousers) support.]),
1065 [with_tpm=$withval], [with_tpm=yes])
1066 if test "$with_tpm" != "no"; then
1067 LIBS="$oldlibs -ltspi"
1068 AC_MSG_CHECKING([for tss library])
1069 AC_LINK_IFELSE([AC_LANG_PROGRAM([
1070 #include <trousers/tss.h>
1071 #include <trousers/trousers.h>],[
1072 int err = Tspi_Context_Create((void *)0);
1073 Trspi_Error_String(err);])],
1074 [AC_MSG_RESULT(yes)
1075 AC_SUBST([TSS_LIBS], [-ltspi])
1076 AC_SUBST([TSS_CFLAGS], [])
1077 AC_DEFINE([HAVE_TROUSERS], 1, [Enable TPM])
1078 with_tpm=yes,
1079 need_ltlibdl=yes],
1080 [AC_MSG_RESULT(no)
1081 AC_MSG_WARN([[
1082 ***
1083 *** trousers was not found. TPM support will be disabled.
1084 *** ]])
1085 with_tpm=no])
1086 LIBS="$oldlibs"
1087 else
1088 with_tpm=no
1089 fi
1090
1091 AM_CONDITIONAL(ENABLE_TROUSERS, test "$with_tpm" != "no")
1092
1093
1094 for l in /usr/lib64 /usr/lib /lib64 /lib /usr/lib/x86_64-linux-gnu/; do
1095 if test -f "${l}/libtspi.so.1";then
1096 default_trousers_lib="${l}/libtspi.so.1"
1097 break
1098 fi
1099 done
1100
1101 AC_ARG_WITH(trousers-lib, AS_HELP_STRING([--with-trousers-lib=LIB],
1102 [set the location of the trousers library]),
1103 ac_trousers_lib=$withval, ac_trousers_lib=$default_trousers_lib)
1104
1105 if test "$with_tpm" != "no" && test -z "$ac_trousers_lib"; then
1106 AC_MSG_ERROR([[
1107 ***
1108 *** unable to find trousers library, please specify with --with-trousers-lib=<lib file>
1109 ***
1110 ]])
1111 fi
1112
1113 AC_DEFINE_UNQUOTED([TROUSERS_LIB], ["$ac_trousers_lib"], [the location of the trousers library])
1114 AC_SUBST(TROUSERS_LIB)
1115
1116
1117 # For minitasn1.
1118 AC_CHECK_SIZEOF(unsigned long int, 4)
1119 AC_CHECK_SIZEOF(unsigned int, 4)
1120 AC_CHECK_SIZEOF(time_t, 4)
1121
1122 AC_ARG_WITH(zlib,
1123 [AS_HELP_STRING([--with-zlib=yes/link/dlopen/no --without-zlib],
1124 [customize/disable zlib compression support])],
1125 ac_zlib=$withval, ac_zlib=yes zlib_optional=yes)
1126 AS_CASE([$ac_zlib],
1127 [yes],
1128 [AM_COND_IF([ENABLE_DLOPEN], [ac_zlib=dlopen], [ac_zlib=link])],
1129 [dlopen],
1130 [AM_COND_IF([ENABLE_DLOPEN], [:],[AC_MSG_ERROR([[
1131 ***
1132 *** Unable to dlopen ZLIB, try --with-zlib=link.
1133 *** ]])])],
1134 [link], [:],
1135 [no], [:],
1136 [AC_MSG_ERROR([[Unknown argument ${ac_zlib} for --with-zlib]])])
1137
1138
1139 AS_IF([test x$ac_zlib != xno],
1140 [PKG_CHECK_MODULES([ZLIB],[zlib],,
1141 [ac_zlib=no
1142 AS_IF([test x$zlib_optional != xyes],
1143 AC_MSG_ERROR([zlib requested but not available]))
1144 AC_MSG_WARN([[
1145 ***
1146 *** ZLIB was not found. You will not be able to use ZLIB compression.
1147 *** ]])
1148 ])])
1149
1150 if test x$ac_zlib != xno; then
1151 AC_DEFINE([HAVE_ZLIB], 1, [Define if ZLIB compression is enabled.])
1152 need_ltlibdl=yes
1153 fi
1154 AM_CONDITIONAL(HAVE_ZLIB, test "$ac_zlib" != "no")
1155
1156 AM_CONDITIONAL([ZLIB_ENABLE_DLOPEN], [test "$ac_zlib" = dlopen])
1157 AS_IF([test "$ac_zlib" = dlopen], [
1158 save_CFLAGS=$CFLAGS
1159 CFLAGS="$CFLAGS $ZLIB_CFLAGS"
1160 save_LIBS=$LIBS
1161 LIBS="$LIBS $ZLIB_LIBS"
1162 LIBGNUTLS_CHECK_SONAME([z], [AC_LANG_PROGRAM([
1163 #include <zlib.h>],[
1164 compress (0, 0, 0, 0);])])
1165 CFLAGS="$save_CFLAGS"
1166 LIBS="$save_LIBS"
1167 ],
1168 [test "$ac_zlib" = link], [
1169 if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
1170 GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
1171 else
1172 GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib"
1173 fi
1174 ])
1175
1176 AC_ARG_WITH(brotli,
1177 [AS_HELP_STRING([--with-brotli=yes/link/dlopen/no --without-brotli],
1178 [customize/disable brotli compression support])],
1179 ac_brotli=$withval, ac_brotli=yes brotli_optional=yes)
1180 AS_CASE([$ac_brotli],
1181 [yes],
1182 [AM_COND_IF([ENABLE_DLOPEN], [ac_brotli=dlopen], [ac_brotli=link])],
1183 [dlopen],
1184 [AM_COND_IF([ENABLE_DLOPEN], [:],[AC_MSG_ERROR([[
1185 ***
1186 *** Unable to dlopen BROTLI, try --with-brotli=link.
1187 *** ]])])],
1188 [link], [:],
1189 [no], [:],
1190 [AC_MSG_ERROR([[Unknown argument ${ac_brotli} for --with-brotli]])])
1191
1192
1193 AS_IF([test x$ac_brotli != xno],
1194 [PKG_CHECK_MODULES([LIBBROTLIENC],[libbrotlienc >= 1.0.0],
1195 [PKG_CHECK_MODULES([LIBBROTLIDEC],[libbrotlidec >= 1.0.0],
1196 [ac_found_brotli_enc_dec=yes],[ac_found_brotli_enc_dec=no])]
1197 ,[ac_found_brotli_enc_dec=no])
1198 ]
1199 )
1200
1201 AS_IF([test x$ac_brotli != xno && test x$ac_found_brotli_enc_dec != xyes ],
1202 [ac_brotli=no
1203 AS_IF([test x$brotli_optional != xyes],
1204 AC_MSG_ERROR([libbrotli support requested but not available]))
1205 AC_MSG_WARN([[
1206 ***
1207 *** LIBBROTLI was not found. You will not be able to use BROTLI compression.
1208 *** ]])
1209 ]
1210 )
1211
1212 if test x$ac_brotli != xno; then
1213 AC_DEFINE([HAVE_LIBBROTLI], 1, [Define if BROTLI compression is enabled.])
1214 need_ltlibdl=yes
1215 fi
1216 AM_CONDITIONAL(HAVE_LIBBROTLI, test "$ac_brotli" != "no")
1217
1218 AM_CONDITIONAL([BROTLI_ENABLE_DLOPEN], [test "$ac_brotli" = dlopen])
1219 AS_IF([test "$ac_brotli" = dlopen], [
1220 save_CFLAGS=$CFLAGS
1221 CFLAGS="$CFLAGS $LIBBROTLIENC_CFLAGS"
1222 save_LIBS=$LIBS
1223 LIBS="$LIBS $LIBBROTLIENC_LIBS"
1224 LIBGNUTLS_CHECK_SONAME([brotlienc], [AC_LANG_PROGRAM([
1225 #include <brotli/encode.h>],[
1226 BrotliEncoderVersion();])])
1227
1228 CFLAGS="$save_CFLAGS $LIBBROTLIDEC_CFLAGS"
1229 LIBS="$save_LIBS $LIBBROTLIDEC_LIBS"
1230 LIBGNUTLS_CHECK_SONAME([brotlidec], [AC_LANG_PROGRAM([
1231 #include <brotli/decode.h>],[
1232 BrotliDecoderVersion();])])
1233 CFLAGS="$save_CFLAGS"
1234 LIBS="$save_LIBS"
1235 ],
1236 [test "$ac_brotli" = link], [
1237 if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
1238 GNUTLS_REQUIRES_PRIVATE="Requires.private: libbrotlienc, libbrotlidec"
1239 else
1240 GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, libbrotlienc, libbrotlidec"
1241 fi
1242 ])
1243
1244 AC_ARG_WITH(zstd,
1245 [AS_HELP_STRING([--with-zstd=yes/link/dlopen/no --without-zstd],
1246 [customize/disable zstd compression support])],
1247 ac_libzstd=$withval, ac_libzstd=yes libzstd_optional=yes)
1248 AS_CASE([$ac_libzstd],
1249 [yes],
1250 [AM_COND_IF([ENABLE_DLOPEN], [ac_libzstd=dlopen], [ac_libzstd=link])],
1251 [dlopen],
1252 [AM_COND_IF([ENABLE_DLOPEN], [:],[AC_MSG_ERROR([[
1253 ***
1254 *** Unable to dlopen LIBZSTD, try --with-libzstd=link.
1255 *** ]])])],
1256 [link], [:],
1257 [no], [:],
1258 [AC_MSG_ERROR([[Unknown argument ${ac_libzstd} for --with-zstd]])])
1259
1260
1261 AS_IF([test x$ac_libzstd != xno],
1262 [PKG_CHECK_MODULES([LIBZSTD],[libzstd],,
1263 [ac_libzstd=no
1264 AS_IF([test x$libzstd_optional != xyes],
1265 AC_MSG_ERROR([libzstd requested but not available]))
1266 AC_MSG_WARN([[
1267 ***
1268 *** LIBZSTD was not found. You will not be able to use ZSTD compression.
1269 *** ]])
1270 ])])
1271
1272 if test x$ac_libzstd != xno; then
1273 AC_DEFINE([HAVE_LIBZSTD], 1, [Define if ZSTD compression is enabled.])
1274 need_ltlibdl=yes
1275 fi
1276 AM_CONDITIONAL(HAVE_LIBZSTD, test "$ac_libzstd" != "no")
1277
1278 AM_CONDITIONAL([LIBZSTD_ENABLE_DLOPEN], [test "$ac_libzstd" = dlopen])
1279 AS_IF([test "$ac_libzstd" = dlopen], [
1280 save_CFLAGS=$CFLAGS
1281 CFLAGS="$CFLAGS $LIBZSTD_CFLAGS"
1282 save_LIBS=$LIBS
1283 LIBS="$LIBS $LIBZSTD_LIBS"
1284 LIBGNUTLS_CHECK_SONAME([zstd], [AC_LANG_PROGRAM([
1285 #include <zstd.h>],[
1286 ZSTD_versionNumber();])])
1287 CFLAGS="$save_CFLAGS"
1288 LIBS="$save_LIBS"
1289 ],
1290 [test "$ac_libzstd" = link], [
1291 if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
1292 GNUTLS_REQUIRES_PRIVATE="Requires.private: libzstd"
1293 else
1294 GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, libzstd"
1295 fi
1296 ])
1297
1298 AC_ARG_WITH(leancrypto,
1299 [AS_HELP_STRING([--with-leancrypto],
1300 [enable leancrypto support])],
1301 ac_leancrypto=$withval, ac_leancrypto=no)
1302
1303 AS_IF([test x$ac_leancrypto != xno],
1304 [PKG_CHECK_MODULES([LEANCRYPTO], [leancrypto >= 1.2.0],
1305 [AC_DEFINE([HAVE_LEANCRYPTO], 1, [Have leancrypto])],
1306 [AC_MSG_ERROR([leancrypto support was requested but the required libraries were not found.])])])
1307
1308 AM_CONDITIONAL(ENABLE_LEANCRYPTO, test "$ac_leancrypto" != "no")
1309
1310 AM_COND_IF([ENABLE_LEANCRYPTO], [
1311 if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
1312 GNUTLS_REQUIRES_PRIVATE="Requires.private: leancrypto"
1313 else
1314 GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, leancrypto"
1315 fi
1316 ])
1317
1318 AM_COND_IF([ENABLE_LEANCRYPTO], [
1319 save_LIBS=$LIBS
1320 LIBS="$LIBS $LEANCRYPTO_LIBS"
1321 AC_CHECK_FUNCS([lc_dilithium_pk_from_sk])
1322 LIBS=$save_LIBS
1323 ])
1324
1325 AM_CONDITIONAL(NEED_LTLIBDL, test "$need_ltlibdl" = yes)
1326
1327 # export for use in scripts
1328 AC_SUBST(ac_cv_sizeof_time_t)
1329
1330 AC_SUBST(GNUTLS_LIBS_PRIVATE)
1331 AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
1332
1333
1334 AC_ARG_WITH([default-trust-store-pkcs11],
1335 [AS_HELP_STRING([--with-default-trust-store-pkcs11=URI],
1336 [use the given pkcs11 uri as default trust store])])
1337
1338 if test "x$with_default_trust_store_pkcs11" != x; then
1339 if test "x$with_p11_kit" = xno; then
1340 AC_MSG_ERROR([cannot use pkcs11 store without p11-kit])
1341 fi
1342 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_PKCS11],
1343 ["$with_default_trust_store_pkcs11"], [use the given pkcs11 uri as default trust store])
1344 fi
1345
1346 AM_CONDITIONAL([HAVE_PKCS11_TRUST_STORE], [test -n "${with_default_trust_store_pkcs11}"])
1347
1348 AC_ARG_WITH([default-trust-store-dir],
1349 [AS_HELP_STRING([--with-default-trust-store-dir=DIR],
1350 [use the given directory as default trust store])])
1351
1352 if test "x$with_default_trust_store_dir" != x; then
1353 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_DIR],
1354 ["$with_default_trust_store_dir"], [use the given directory as default trust store])
1355 fi
1356
1357 dnl auto detect https://lists.gnu.org/archive/html/help-gnutls/2012-05/msg00004.html
1358 AC_ARG_WITH([default-trust-store-file],
1359 [AS_HELP_STRING([--with-default-trust-store-file=FILE],
1360 [use the given file default trust store])], with_default_trust_store_file="$withval",
1361 [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
1362 for i in \
1363 /etc/ssl/ca-bundle.pem \
1364 /etc/ssl/certs/ca-certificates.crt \
1365 /etc/pki/tls/cert.pem \
1366 /usr/local/share/certs/ca-root-nss.crt \
1367 /etc/ssl/cert.pem
1368 do
1369 if test -e "$i"; then
1370 with_default_trust_store_file="$i"
1371 break
1372 fi
1373 done
1374 fi]
1375 )
1376
1377 if test "$with_default_trust_store_file" = "no";then
1378 with_default_trust_store_file=""
1379 fi
1380
1381 AC_ARG_WITH([default-crl-file],
1382 [AS_HELP_STRING([--with-default-crl-file=FILE],
1383 [use the given CRL file as default])])
1384
1385 AC_ARG_WITH([default-blocklist-file],
1386 [AS_HELP_STRING([--with-default-blocklist-file=FILE],
1387 [use the given certificate blocklist file as default])])
1388
1389 AC_ARG_WITH([default-blacklist-file],
1390 [AS_HELP_STRING([--with-default-blacklist-file=FILE],
1391 [use --with-default-blocklist-file instead])],
1392 [AC_MSG_ERROR([use --with-default-blocklist-file instead])])
1393
1394 if test "x$with_default_trust_store_file" != x; then
1395 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_FILE],
1396 ["$with_default_trust_store_file"], [use the given file default trust store])
1397 fi
1398
1399 if test "x$with_default_crl_file" != x; then
1400 AC_DEFINE_UNQUOTED([DEFAULT_CRL_FILE],
1401 ["$with_default_crl_file"], [use the given CRL file])
1402 fi
1403
1404 if test "x$with_default_blocklist_file" != x; then
1405 AC_DEFINE_UNQUOTED([DEFAULT_BLOCKLIST_FILE],
1406 ["$with_default_blocklist_file"], [use the given certificate blocklist file])
1407 fi
1408
1409 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS"
1410 LIBGNUTLS_CFLAGS="-I${includedir}"
1411 AC_SUBST(LIBGNUTLS_LIBS)
1412 AC_SUBST(LIBGNUTLS_CFLAGS)
1413
1414 AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
1415
1416 AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
1417
1418 hw_features=
1419 if test "$enable_cryptodev" = yes; then
1420 hw_features="$hw_features cryptodev"
1421 fi
1422 if test "$enable_afalg" = yes; then
1423 hw_features="$hw_features afalg"
1424 fi
1425 if test "$use_padlock" = yes; then
1426 hw_features="$hw_features padlock"
1427 fi
1428 if test "$with_p11_kit" = yes; then
1429 hw_features="$hw_features pkcs11"
1430 fi
1431 if test "$with_tpm" = yes; then
1432 hw_features="$hw_features tpm"
1433 fi
1434 if test "$have_tpm2" = yes; then
1435 hw_features="$hw_features tpm2"
1436 fi
1437 if test "$enable_ktls" = yes; then
1438 hw_features="$hw_features ktls"
1439 fi
1440 hw_features=`eval 'expr "$hw_features" : " \(.*\)"'`
1441 AC_DEFINE_UNQUOTED([HW_FEATURES], ["$hw_features"],
1442 [The enabled hardware features])
1443
1444 tls_features=
1445 if test "$ac_enable_ssl3" = yes; then
1446 tls_features="$tls_features ssl3"
1447 fi
1448 if test "$ac_enable_ssl2" = yes; then
1449 tls_features="$tls_features ssl2-compat"
1450 fi
1451 if test "$ac_enable_srtp" = yes; then
1452 tls_features="$tls_features srtp"
1453 fi
1454 if test "$ac_enable_alpn" = yes; then
1455 tls_features="$tls_features alpn"
1456 fi
1457 if test "$ac_enable_ocsp" = yes; then
1458 tls_features="$tls_features ocsp"
1459 fi
1460 if test "$ac_enable_srp" = yes; then
1461 tls_features="$tls_features srp"
1462 fi
1463 if test "$ac_enable_psk" = yes; then
1464 tls_features="$tls_features psk"
1465 fi
1466 if test "$ac_enable_dhe" = yes; then
1467 tls_features="$tls_features dhe"
1468 fi
1469 if test "$ac_enable_ecdhe" = yes; then
1470 tls_features="$tls_features ecdhe"
1471 fi
1472 if test "$ac_enable_anon" = yes; then
1473 tls_features="$tls_features auth-anon"
1474 fi
1475 if test "$ac_enable_heartbeat" = yes; then
1476 tls_features="$tls_features heartbeat"
1477 fi
1478 tls_features=`eval 'expr "$tls_features" : " \(.*\)"'`
1479 AC_DEFINE_UNQUOTED([TLS_FEATURES], ["$tls_features"],
1480 [The enabled TLS features])
1481
1482 AC_DEFINE([fread_file], [_gnutls_fread_file], [static lib rename])
1483 AC_DEFINE([read_file], [_gnutls_read_file], [static lib rename])
1484
1485 dnl configuration options for config file parsing (inih)
1486 AC_DEFINE([INI_MAX_LINE], 2048, [inih maximum line size])
1487 AC_DEFINE([INI_ALLOW_INLINE_COMMENTS], 1, [whether to allowin inline comments])
1488 AC_DEFINE([INI_STOP_ON_FIRST_ERROR], 1, [whether to stop on first error])
1489 AC_DEFINE_UNQUOTED([INI_INLINE_COMMENT_PREFIXES], [";#"], [The inline comment prefixes])
1490 AC_DEFINE_UNQUOTED([INI_START_COMMENT_PREFIXES], [";#"], [The comment prefixes])
1491
1492 AH_VERBATIM([gnutls_lib_no_replace_fchdir], [
1493 /* Work around build failure on mingw caused by mis-interactions
1494 * between 'close' and 'fchdir' Gnulib modules through dependencies,
1495 * suggested in:
1496 * <https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00179.html>
1497 */
1498 #ifdef GNUTLS_BUILDING_LIB
1499 # undef REPLACE_FCHDIR
1500 #endif
1501 ])
1502
1503 AC_CONFIG_FILES([
1504 Makefile
1505 doc/Makefile
1506 doc/credentials/Makefile
1507 doc/credentials/srp/Makefile
1508 doc/credentials/x509/Makefile
1509 doc/doxygen/Doxyfile
1510 doc/examples/Makefile
1511 doc/latex/Makefile
1512 doc/manpages/Makefile
1513 doc/reference/Makefile
1514 doc/reference/version.xml
1515 doc/scripts/Makefile
1516 extra/Makefile
1517 extra/includes/Makefile
1518 libdane/Makefile
1519 libdane/includes/Makefile
1520 libdane/gnutls-dane.pc
1521 gl/Makefile
1522 lib/Makefile
1523 lib/accelerated/Makefile
1524 lib/accelerated/x86/Makefile
1525 lib/accelerated/aarch64/Makefile
1526 lib/algorithms/Makefile
1527 lib/auth/Makefile
1528 lib/ext/Makefile
1529 lib/extras/Makefile
1530 lib/gnutls.pc
1531 lib/includes/Makefile
1532 lib/includes/gnutls/gnutls.h
1533 lib/minitasn1/Makefile
1534 lib/nettle/Makefile
1535 lib/pkcs11/Makefile
1536 lib/x509/Makefile
1537 lib/unistring/Makefile
1538 lib/hpke/Makefile
1539 po/Makefile.in
1540 src/Makefile
1541 src/gl/Makefile
1542 src/gl/tests/Makefile
1543 tests/Makefile
1544 tests/windows/Makefile
1545 tests/cert-tests/Makefile
1546 tests/slow/Makefile
1547 tests/suite/Makefile
1548 fuzz/Makefile
1549 ])
1550
1551 AC_OUTPUT
1552
1553 dnl Warning flags: errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
1554 AC_MSG_NOTICE([summary of build options:
1555
1556 version: ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
1557 Host/Target system: ${host}
1558 Build system: ${build}
1559 Install prefix: ${prefix}
1560 Compiler: ${CC}
1561 Valgrind: $opt_valgrind_tests ${VALGRIND}
1562 CFlags: ${CFLAGS}
1563 Library types: Shared=${enable_shared}, Static=${enable_static}
1564 Local libtasn1: ${included_libtasn1}
1565 Local unistring: ${included_unistring}
1566 Use nettle-mini: ${mini_nettle}
1567 Documentation: ${enable_doc} (manpages: ${enable_manpages})
1568 ])
1569
1570 AC_MSG_NOTICE([External hardware support:
1571
1572 /dev/crypto: $enable_cryptodev
1573 AF_ALG support: $enable_afalg
1574 Hardware accel: $hw_accel
1575 Padlock accel: $use_padlock
1576 Random gen. variant: $rnd_variant
1577 PKCS#11 support: $with_p11_kit
1578 TPM support: $with_tpm
1579 TPM2 support: $with_tpm2
1580 KTLS support: $enable_ktls
1581 ])
1582
1583 if test -n "$ac_trousers_lib" && test "$with_tpm" != "no";then
1584 AC_MSG_NOTICE([
1585 TPM library: $ac_trousers_lib
1586 ])
1587 fi
1588
1589 if test "$with_tpm2" != "no";then
1590 AC_MSG_NOTICE([
1591 TPM2 library: $tss2lib
1592 ])
1593 fi
1594
1595 AC_MSG_NOTICE([Optional features:
1596 (note that included applications might not compile properly
1597 if features are disabled)
1598
1599 SSL3.0 support: $ac_enable_ssl3
1600 SSL2.0 client hello: $ac_enable_ssl2
1601 Allow SHA1 sign: $ac_allow_sha1
1602 DTLS-SRTP support: $ac_enable_srtp
1603 ALPN support: $ac_enable_alpn
1604 OCSP support: $ac_enable_ocsp
1605 SRP support: $ac_enable_srp
1606 PSK support: $ac_enable_psk
1607 DHE support: $ac_enable_dhe
1608 ECDHE support: $ac_enable_ecdhe
1609 GOST support: $ac_enable_gost
1610 Anon auth support: $ac_enable_anon
1611 Heartbeat support: $ac_enable_heartbeat
1612 IDNA support: $idna_support
1613 Non-SuiteB curves: $enable_non_suiteb
1614 FIPS140 mode: $enable_fips
1615 Strict DER time: $ac_strict_der_time
1616 Audit trace: $enable_crypto_auditing
1617 HPKE support: $ac_enable_hpke
1618 ])
1619
1620 AC_MSG_NOTICE([Optional libraries:
1621
1622 C++ library: $use_cxx
1623 DANE library: $enable_dane
1624 OpenSSL compat: $enable_openssl
1625 ])
1626
1627 AC_MSG_NOTICE([System files:
1628
1629 Trust store pkcs11: $with_default_trust_store_pkcs11
1630 Trust store dir: $with_default_trust_store_dir
1631 Trust store file: $with_default_trust_store_file
1632 Blocklist file: $with_default_blocklist_file
1633 CRL file: $with_default_crl_file
1634 Configuration file: $system_config_file
1635 DNSSEC root key file: $unbound_root_key_file
1636 ])
1637
1638 if test ! -f "$unbound_root_key_file"; then
1639 AC_MSG_WARN([[
1640 ***
1641 *** The DNSSEC root key file in $unbound_root_key_file was not found.
1642 *** This file is needed for the verification of DNSSEC responses.
1643 *** Use the command: unbound-anchor -a "$unbound_root_key_file"
1644 *** to generate or update it.
1645 *** ]])
1646 fi
1647
1648 if test "${enable_static}" != no;then
1649 AC_MSG_WARN([[
1650 *** GnuTLS will be build as a static library. That means that library
1651 *** constructors for gnutls_global_init will not be made available to
1652 *** linking applications. If you are building that library for arbitrary
1653 *** applications to link, do not enable static linking.
1654 ]])
1655 fi
1656
1657 if test "$enable_fuzzer_target" != "no";then
1658 AC_MSG_WARN([[
1659 *** This version of the library is for fuzzying purposes and is intentionally broken!
1660 ]])
1661 fi