we now explicitly check for librt.
[gnutls:gnutls.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2000-2012 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, write to the Free Software
20 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21 # USA
22
23 AC_PREREQ(2.61)
24 AC_INIT([GnuTLS], [3.2.5], [bug-gnutls@gnu.org])
25 AC_CONFIG_AUX_DIR([build-aux])
26 AC_CONFIG_MACRO_DIR([m4])
27 AC_CANONICAL_HOST
28
29 AM_INIT_AUTOMAKE([1.12.2 no-dist-gzip dist-xz dist-lzip -Wall -Wno-override])
30 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31 AC_CONFIG_HEADERS([config.h])
32
33 AC_MSG_RESULT([***
34 *** Checking for compilation programs...
35 ])
36
37 dnl Checks for programs.
38 AC_PROG_CC
39 gl_EARLY
40 AM_PROG_AS
41 AM_PROG_AR
42 AC_PROG_CXX
43
44 # For includes/gnutls/gnutls.h.in.
45 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
46 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
47 AC_SUBST(PATCH_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`)
48 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
49
50 touch suppressions.valgrind
51 dnl C and C++ capabilities
52 AC_C_INLINE
53 AC_HEADER_STDC
54
55 # For the C++ code
56 AC_ARG_ENABLE(cxx,
57   AS_HELP_STRING([--disable-cxx], [unconditionally disable the C++ library]),
58     use_cxx=$enableval, use_cxx=yes)
59 if test "$use_cxx" != "no"; then
60   AC_LANG_PUSH(C++)
61   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
62   AC_LANG_POP(C++)
63 fi
64 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
65 AM_CONDITIONAL(WANT_TEST_SUITE, [test -f tests/suite/mini-eagain2.c])
66
67 dnl Detect windows build
68 case "$host" in
69   *mingw32* | *mingw64*)
70     have_win=yes
71   ;;
72   *darwin*)
73     have_macosx=yes
74   ;;
75   *)
76     have_elf=yes
77   ;;
78 esac
79
80 AM_CONDITIONAL(WINDOWS, test "$have_win" = yes)
81 AM_CONDITIONAL(MACOSX, test "$have_macosx" = yes)
82 AM_CONDITIONAL(ELF, test "$have_elf" = yes)
83
84 dnl Hardware Acceleration
85 AC_ARG_ENABLE(hardware-acceleration,
86   AS_HELP_STRING([--disable-hardware-acceleration], [unconditionally disable hardware acceleration]),
87     use_accel=$enableval, use_accel=yes)
88 hw_accel=none
89
90
91 if test "$use_accel" != "no"; then
92 case $host_cpu in
93   i?86 | x86_64 | amd64)
94       AC_CHECK_HEADERS(cpuid.h)
95       if test "$host_cpu" = "x86_64" || test "$host_cpu" = "amd64"; then
96         hw_accel="x86-64"
97       else
98         hw_accel="x86"
99       fi
100   ;;
101   *)
102   ;;
103 esac
104
105 fi
106
107 AM_CONDITIONAL(ASM_X86_64, test x"$hw_accel" = x"x86-64")
108 AM_CONDITIONAL(ASM_X86_32, test x"$hw_accel" = x"x86")
109 AM_CONDITIONAL(ASM_X86, test x"$hw_accel" = x"x86" || test x"$hw_accel" = x"x86-64")
110 AM_CONDITIONAL(HAVE_GCC_GNU89_INLINE_OPTION, test "$gnu89_inline" = "yes"])
111 AM_CONDITIONAL(HAVE_GCC, test "$GCC" = "yes")
112
113 dnl Try the hooks.m4
114 LIBGNUTLS_HOOKS
115 LIBGNUTLS_EXTRA_HOOKS
116
117 AC_ARG_ENABLE(doc,
118   AS_HELP_STRING([--disable-doc], [don't generate any documentation]),
119     enable_doc=$enableval, enable_doc=yes)
120 AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" != "no")
121
122 AC_ARG_ENABLE(tests,
123   AS_HELP_STRING([--disable-tests], [don't compile or run any tests]),
124     enable_tests=$enableval, enable_tests=yes)
125 AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" != "no")
126
127 GTK_DOC_CHECK(1.1)
128 AM_GNU_GETTEXT([external])
129 AM_GNU_GETTEXT_VERSION([0.18])
130
131 AC_C_BIGENDIAN
132
133 gl_INIT
134
135 dnl GCC warnings to enable
136
137 AC_ARG_ENABLE([gcc-warnings],
138   [AS_HELP_STRING([--enable-gcc-warnings],
139                   [turn on lots of GCC warnings (for developers)])],
140   [case $enableval in
141      yes|no) ;;
142      *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
143    esac
144    gl_gcc_warnings=$enableval],
145   [gl_gcc_warnings=no]
146 )
147
148 if test "$gl_gcc_warnings" = yes; then
149   gl_WARN_ADD([-Wframe-larger-than=5120], [WSTACK_CFLAGS])
150
151   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
152   nw="$nw -Wc++-compat"             # We don't care about C++ compilers
153   nw="$nw -Wundef"                  # Warns on '#if GNULIB_FOO' etc in gnulib
154   nw="$nw -Wtraditional"            # Warns on #elif which we use often
155   nw="$nw -Wlogical-op"             # Too many false positives
156   nw="$nw -Wold-style-definition"   # 
157   nw="$nw -Wpadded"                 # Our structs are not padded
158   nw="$nw -Wunreachable-code"       # Too many false positives
159   nw="$nw -Wtraditional-conversion" # Too many warnings for now
160   nw="$nw -Wcast-qual"              # Too many warnings for now
161   nw="$nw -Waggregate-return"       # Too many warnings for now
162   nw="$nw -Wshadow"                 # Too many warnings for now
163   nw="$nw -Wswitch-default"         # Too many warnings for now
164   nw="$nw -Wswitch-enum"            # Too many warnings for now
165   nw="$nw -Wconversion"             # Too many warnings for now
166   nw="$nw -Wsign-conversion"        # Too many warnings for now
167   nw="$nw -Wformat-y2k"             # Too many warnings for now
168   nw="$nw -Woverlength-strings"     # We use some in tests/
169   nw="$nw -Wvla"                    # There is no point to avoid C99 variable length arrays
170   nw="$nw -Wformat-nonliteral"      # Incompatible with gettext _()
171   nw="$nw -Wunsafe-loop-optimizations"
172   nw="$nw -Wstrict-overflow"
173   nw="$nw -Wmissing-noreturn"
174   nw="$nw -Winline"                 # Too compiler dependent
175   nw="$nw -Wsuggest-attribute=pure" # Is it worth using attributes?
176   nw="$nw -Wsuggest-attribute=const" # Is it worth using attributes?
177   nw="$nw -Wsuggest-attribute=noreturn" # Is it worth using attributes?
178   nw="$nw -Wstack-protector"        # Some functions cannot be protected
179   nw="$nw -Wredundant-decls"        # Some files cannot be compiled with that (gl_fd_to_handle)
180
181   gl_MANYWARN_ALL_GCC([ws])
182   gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
183   for w in $ws; do
184     gl_WARN_ADD([$w])
185   done
186
187   gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
188   gl_WARN_ADD([-Wno-format-y2k])     # Too many warnings for now
189   gl_WARN_ADD([-Wno-unused-value]) # warnings for things we don't want to get
190   gl_WARN_ADD([-Wno-unused-result]) # warnings for things we don't want to get
191   gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
192   gl_WARN_ADD([-Wno-stack-protector])  # Some functions cannot be protected
193   gl_WARN_ADD([-Wno-int-to-pointer-cast])  # Some files cannot be compiled with that (gl_fd_to_handle)
194   gl_WARN_ADD([-fdiagnostics-show-option])
195 fi
196
197 AC_SUBST([WERROR_CFLAGS])
198 AC_SUBST([WSTACK_CFLAGS])
199 AC_SUBST([WARN_CFLAGS])
200
201 dnl Programs for compilation or development
202 AC_PROG_LN_S
203 AC_LIBTOOL_WIN32_DLL
204 AC_PROG_LIBTOOL
205
206
207 dnl No fork on MinGW, disable some self-tests until we fix them.
208 dnl Check clock_gettime and pthread_mutex_lock in libc (avoid linking to other libs)
209 AC_CHECK_FUNCS([fork getrusage getpwuid_r nanosleep daemon getpid clock_gettime pthread_mutex_lock iconv localtime vasprintf],,)
210 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
211
212 AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>
213 #include <signal.h>
214 ], [timer_create (0,0,0);])
215
216 if test "$ac_cv_func_pthread_mutex_lock" != "yes";then
217   AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
218 fi
219
220 if test "$ac_cv_func_nanosleep" != "yes";then
221   AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>], [nanosleep (0, 0);])
222 fi
223
224 ac_have_unicode=no
225 if test "$ac_cv_func_iconv" != "yes";then
226   AC_LIB_HAVE_LINKFLAGS(iconv,, [#include <iconv.h>], [iconv (0, 0, 0, 0, 0);])
227   if test "$HAVE_LIBICONV" = "yes";then
228     ac_have_unicode=yes
229   fi
230 else
231   ac_have_unicode=yes
232 fi
233
234 if test "$ac_have_unicode" != "yes";then
235   if test "$have_win" = "yes";then
236     ac_have_unicode=yes
237   fi
238 fi
239
240 AC_MSG_CHECKING([whether to build libdane])
241 AC_ARG_ENABLE(libdane,
242     AS_HELP_STRING([--disable-libdane],
243                    [disable the built of libdane]),
244     enable_dane=$enableval, enable_dane=yes)
245 AC_MSG_RESULT($enable_dane)
246
247 if test "$enable_dane" != "no"; then
248     LIBS="$oldlibs -lunbound"
249     AC_MSG_CHECKING([for unbound library])
250     AC_LINK_IFELSE([AC_LANG_PROGRAM([
251                    #include <unbound.h>],[
252                    struct ub_ctx* ctx;
253                    ctx = ub_ctx_create();])],
254                   [AC_MSG_RESULT(yes)
255                    AC_SUBST([UNBOUND_LIBS], [-lunbound])
256                    AC_SUBST([UNBOUND_CFLAGS], [])
257                    AC_DEFINE([HAVE_DANE], 1, [Enable the DANE library])
258                    enable_dane=yes],
259                   [AC_MSG_RESULT(no)
260                    AC_MSG_WARN([[
261 *** 
262 *** libunbound was not found. Libdane will not be built.
263 *** ]])
264                   enable_dane=no])
265     LIBS="$oldlibs"
266 fi
267
268 AM_CONDITIONAL(ENABLE_DANE, test "$enable_dane" = "yes")
269
270 AC_ARG_WITH(unbound-root-key-file, AS_HELP_STRING([--with-unbound-root-key-file],
271                                  [specify the unbound root key file]),
272             unbound_root_key_file="$withval", 
273 if test "$have_win" = yes; then
274     unbound_root_key_file="C:\\Program Files\\Unbound\\root.key"
275 else
276     unbound_root_key_file="/etc/unbound/root.key"
277 fi
278 )
279
280 AC_DEFINE_UNQUOTED([UNBOUND_ROOT_KEY_FILE],
281   ["$unbound_root_key_file"], [The DNSSEC root key file])
282
283 dnl Check for p11-kit
284 AC_ARG_WITH(p11-kit,
285         AS_HELP_STRING([--without-p11-kit],
286                 [Build without p11-kit and PKCS#11 support]))
287 if test "$with_p11_kit" != "no"; then
288         PKG_CHECK_MODULES(P11_KIT, [p11-kit-1 >= 0.11], [with_p11_kit=yes], [with_p11_kit=no])
289         if test "$with_p11_kit" != "no";then
290                 AC_DEFINE([ENABLE_PKCS11], 1, [Build PKCS#11 support])
291                 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
292                         GNUTLS_REQUIRES_PRIVATE="Requires.private: p11-kit-1"
293                 else
294                         GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, p11-kit-1"
295                 fi
296         else
297                 with_p11_kit=no
298                 AC_MSG_WARN([[
299 *** 
300 *** p11-kit was not found. PKCS #11 support will be disabled.
301 *** You may get it from http://p11-glue.freedesktop.org/p11-kit.html
302 *** ]])
303         fi
304 fi
305
306 AM_CONDITIONAL(ENABLE_PKCS11, test "$with_p11_kit" != "no")
307
308 AC_ARG_WITH(tpm,
309         AS_HELP_STRING([--without-tpm],
310                 [Disable TPM (trousers) support.]),
311                 [with_tpm=$withval], [with_tpm=yes])
312 if test "$with_tpm" != "no"; then
313     LIBS="$oldlibs -ltspi"
314     AC_MSG_CHECKING([for tss library])
315     AC_LINK_IFELSE([AC_LANG_PROGRAM([
316                    #include <trousers/tss.h>
317                    #include <trousers/trousers.h>],[
318                    int err = Tspi_Context_Create((void *)0);
319                    Trspi_Error_String(err);])],
320                   [AC_MSG_RESULT(yes)
321                    AC_SUBST([TSS_LIBS], [-ltspi])
322                    AC_SUBST([TSS_CFLAGS], [])
323                    AC_DEFINE([HAVE_TROUSERS], 1, [Enable TPM])
324                    with_tpm=yes],
325                   [AC_MSG_RESULT(no)
326                    AC_MSG_WARN([[
327 *** 
328 *** trousers was not found. TPM support will be disabled.
329 *** ]])
330                   with_tpm=no])
331     LIBS="$oldlibs"
332 fi
333
334 AM_CONDITIONAL(ENABLE_TROUSERS, test "$with_tpm" != "no")
335
336 enable_local_libopts=yes
337 dnl PKG_CHECK_MODULES([autoopts], autoopts >= 36.2.11,, [enable_local_libopts=yes])
338
339 NEED_LIBOPTS_DIR=true
340 LIBOPTS_CHECK([src/libopts])
341
342 AC_CHECK_TYPE(ssize_t,
343   [
344     DEFINE_SSIZE_T="#include <sys/types.h>"
345     AC_SUBST(DEFINE_SSIZE_T)
346   ], [
347     AC_DEFINE([NO_SSIZE_T], 1, [no ssize_t type was found])
348     DEFINE_SSIZE_T="typedef int ssize_t;"
349     AC_SUBST(DEFINE_SSIZE_T)
350   ], [
351     #include <sys/types.h>
352   ])
353
354 # For minitasn1.
355 AC_CHECK_SIZEOF(unsigned long int, 4)
356 AC_CHECK_SIZEOF(unsigned int, 4)
357
358 AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib],
359                                  [disable zlib compression support]),
360             ac_zlib=$withval, ac_zlib=yes)
361 AC_MSG_CHECKING([whether to include zlib compression support])
362 if test x$ac_zlib != xno; then
363  AC_MSG_RESULT(yes)
364  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
365  if test x$ac_cv_libz != xyes; then
366    AC_MSG_WARN(
367 *** 
368 *** ZLIB was not found. You will not be able to use ZLIB compression.)
369  fi
370 else
371  AC_MSG_RESULT(no)
372 fi
373
374 PKG_CHECK_EXISTS(zlib, ZLIB_HAS_PKGCONFIG=y, ZLIB_HAS_PKGCONFIG=n)
375
376 if test x$ac_zlib != xno; then
377   if test "$ZLIB_HAS_PKGCONFIG" = "y" ; then
378     if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
379       GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
380     else
381       GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib"
382     fi
383   fi
384 fi
385 AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
386
387
388
389 AC_ARG_WITH([default-trust-store-pkcs11],
390   [AS_HELP_STRING([--with-default-trust-store-pkcs11=URI],
391     [use the given pkcs11 uri as default trust store])])
392
393 if test "x$with_default_trust_store_pkcs11" != x; then
394   if test "x$with_p11_kit" = xno; then
395     AC_MSG_ERROR([cannot use pkcs11 store without p11-kit])
396   fi
397   AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_PKCS11],
398     ["$with_default_trust_store_pkcs11"], [use the given pkcs11 uri as default trust store])
399 fi
400
401 dnl auto detect http://lists.gnu.org/archive/html/help-gnutls/2012-05/msg00004.html
402 AC_ARG_WITH([default-trust-store-file],
403   [AS_HELP_STRING([--with-default-trust-store-file=FILE],
404     [use the given file default trust store])], with_default_trust_store_file="$withval",
405   [if test "$build" = "$host";then
406   for i in \
407     /etc/ssl/ca-bundle.pem \
408     /etc/ssl/certs/ca-certificates.crt \
409     /etc/pki/tls/cert.pem \
410     /usr/local/share/certs/ca-root-nss.crt \
411     /etc/ssl/cert.pem
412     do
413     if test -e $i; then
414       with_default_trust_store_file="$i"
415       break
416     fi
417   done
418   fi]
419 )
420
421 if test "$with_default_trust_store_file" = "no";then
422   with_default_trust_store_file=""
423 fi
424
425 AC_ARG_WITH([default-crl-file],
426   [AS_HELP_STRING([--with-default-crl-file=FILE],
427     [use the given CRL file as default])])
428
429 if test "x$with_default_trust_store_file" != x; then
430   AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_FILE],
431     ["$with_default_trust_store_file"], [use the given file default trust store])
432 fi
433
434 if test "x$with_default_crl_file" != x; then
435   AC_DEFINE_UNQUOTED([DEFAULT_CRL_FILE],
436     ["$with_default_crl_file"], [use the given CRL file])
437 fi
438
439 dnl Guile bindings.
440 opt_guile_bindings=yes
441 AC_MSG_CHECKING([whether building Guile bindings])
442 AC_ARG_ENABLE(guile,
443         AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
444 opt_guile_bindings=$enableval)
445 AC_MSG_RESULT($opt_guile_bindings)
446
447 AC_ARG_WITH([guile-site-dir],
448   [AS_HELP_STRING([--with-guile-site-dir],
449      [use the given directory as the Guile site (use with care)])])
450
451 if test "$opt_guile_bindings" = "yes"; then
452    AC_MSG_RESULT([***
453 *** Detecting GNU Guile...
454 ])
455
456    AC_PATH_PROG([guile_snarf], [guile-snarf])
457    if test "x$guile_snarf" = "x"; then
458       AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found.  Guile bindings not built.])
459       opt_guile_bindings=no
460    else
461       GUILE_PROGS
462       GUILE_FLAGS
463
464       save_CFLAGS="$CFLAGS"
465       save_LIBS="$LIBS"
466       CFLAGS="$CFLAGS $GUILE_CFLAGS"
467       LIBS="$LIBS $GUILE_LDFLAGS"
468       AC_MSG_CHECKING([whether GNU Guile is recent enough])
469       AC_LINK_IFELSE([AC_LANG_PROGRAM([], [scm_from_locale_string ("")])],
470         [], [opt_guile_bindings=no])
471       CFLAGS="$save_CFLAGS"
472       LIBS="$save_LIBS"
473
474       if test "$opt_guile_bindings" = "yes"; then
475         AC_MSG_RESULT([yes])
476         case "x$with_guile_site_dir" in 
477              xno)
478                 # Use the default $(GUILE_SITE).
479                 GUILE_SITE_DIR
480                 ;;
481              x|xyes)
482                 # Automatically derive $(GUILE_SITE) from $(pkgdatadir).  This
483                 # hack is used to allow `distcheck' to work (see
484                 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
485                 GUILE_SITE="\$(datadir)/guile/site"
486                 AC_SUBST(GUILE_SITE)
487                 ;;
488              *)
489                 # Use the user-specified directory as $(GUILE_SITE).
490                 GUILE_SITE="$with_guile_site_dir"
491                 AC_SUBST(GUILE_SITE)
492                 ;;
493         esac
494         AC_MSG_CHECKING([whether gcc supports -fgnu89-inline])
495         _gcc_cflags_save="$CFLAGS"
496         CFLAGS="${CFLAGS} -fgnu89-inline"
497         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
498                           gnu89_inline=yes, gnu89_inline=no)
499         AC_MSG_RESULT($gnu89_inline)
500         CFLAGS="$_gcc_cflags_save"
501
502         # Optional Guile functions.
503         save_CFLAGS="$CFLAGS"
504         save_LIBS="$LIBS"
505         CFLAGS="$CFLAGS $GUILE_CFLAGS"
506         LIBS="$LIBS $GUILE_LDFLAGS"
507         AC_CHECK_FUNCS([scm_gc_malloc_pointerless])
508         CFLAGS="$save_CFLAGS"
509         LIBS="$save_LIBS"
510
511         # The place where guile-gnutls.la will go.
512         AC_MSG_CHECKING([the Guile effective version])
513         guile_effective_version="`$GUILE -c '(display (effective-version))'`"
514         AC_MSG_RESULT([$guile_effective_version])
515         guileextensiondir="$libdir/guile/$guile_effective_version"
516         AC_SUBST([guileextensiondir])
517       else
518         AC_MSG_RESULT([no])
519         AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
520         opt_guile_bindings=no
521       fi
522    fi
523 fi
524 AM_CONDITIONAL(HAVE_GUILE, test "$opt_guile_bindings" = "yes")
525
526 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS"
527 LIBGNUTLS_CFLAGS="-I${includedir}"
528 AC_SUBST(LIBGNUTLS_LIBS)
529 AC_SUBST(LIBGNUTLS_CFLAGS)
530
531
532 AC_DEFINE([GNUTLS_COMPAT_H], 1, [Make sure we don't use old features in code.])
533 AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
534
535 AC_DEFINE([fread_file], [_gnutls_fread_file], [static lib rename])
536 AC_DEFINE([read_file], [_gnutls_read_file], [static lib rename])
537 AC_DEFINE([read_binary_file], [_gnutls_read_binary_file], [static lib rename])
538
539 dnl Crywrap dependencies
540    AC_MSG_RESULT([***
541 *** Checking dependencies for crywrap...
542 ])
543
544 crywrap=no
545
546 if test "$have_win" != "yes"; then
547
548 AC_CHECK_HEADERS([arpa/inet.h netinet/in.h sys/select.h sys/types.h sys/wait.h])
549
550 dnl **********************
551 dnl * Typedefs & co
552 dnl **********************
553 AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
554 [AC_LANG_PROGRAM([#include <sys/types.h>
555 #include <signal.h>
556 ],
557                  [return *(signal (0, 0)) (0) == 1;])],
558                    [ac_cv_type_signal=int],
559                    [ac_cv_type_signal=void])])
560 AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
561                     (`int' or `void').])
562
563 AC_FUNC_SELECT_ARGTYPES
564 AC_CHECK_FUNCS([alarm atexit dup2 epoll_create kqueue memchr memset munmap \
565                 putenv regcomp scandir select socket strcasecmp strchr \
566                 strdup strerror strncasecmp strrchr strstr strtoul uname])
567
568 AC_ARG_ENABLE(crywrap,
569         AS_HELP_STRING([--disable-crywrap], [unconditionally disable the crywrap TLS proxy service]))
570
571  libidn=no
572
573  if test "x$enable_crywrap" != "xno" ; then
574         PKG_CHECK_MODULES(LIBIDN, libidn >= 0.0.0, [libidn=yes], [libidn=no])
575         AC_CHECK_FUNCS([argp_usage],[ac_argp=yes],[ac_argp=no])
576  fi
577
578  if test "x$libidn" != "xno" && test "$ac_cv_func_daemon" != "no" && test "$ac_argp" != "no";then
579   crywrap=yes
580  fi
581
582 fi
583
584 AM_CONDITIONAL(ENABLE_CRYWRAP, test "x$crywrap" != "xno")
585 rm -f suppressions.valgrind
586 dnl end of crywrap requirements
587
588 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
589 AC_CONFIG_FILES([
590   Makefile
591   doc/Makefile
592   doc/credentials/Makefile
593   doc/credentials/openpgp/Makefile
594   doc/credentials/srp/Makefile
595   doc/credentials/x509/Makefile
596   doc/cyclo/Makefile
597   doc/doxygen/Doxyfile
598   doc/examples/Makefile
599   doc/latex/Makefile
600   doc/manpages/Makefile
601   doc/reference/Makefile
602   doc/reference/version.xml
603   doc/scripts/Makefile
604   extra/Makefile
605   extra/includes/Makefile
606   libdane/Makefile
607   libdane/includes/Makefile
608   libdane/gnutls-dane.pc
609   gl/Makefile
610   gl/tests/Makefile
611   guile/Makefile
612   guile/modules/Makefile
613   guile/src/Makefile
614   guile/tests/Makefile
615   lib/Makefile
616   lib/accelerated/Makefile
617   lib/accelerated/x86/Makefile
618   lib/algorithms/Makefile
619   lib/auth/Makefile
620   lib/ext/Makefile
621   lib/extras/Makefile
622   lib/gnutls.pc
623   lib/includes/Makefile
624   lib/includes/gnutls/gnutls.h
625   lib/minitasn1/Makefile
626   lib/nettle/Makefile
627   lib/opencdk/Makefile
628   lib/openpgp/Makefile
629   lib/x509/Makefile
630   po/Makefile.in
631   src/Makefile
632   src/crywrap/Makefile
633   tests/Makefile
634   tests/cert-tests/Makefile
635   tests/dsa/Makefile
636   tests/dtls/Makefile
637   tests/srp/Makefile
638   tests/ecdsa/Makefile
639   tests/key-id/Makefile
640   tests/openpgp-certs/Makefile
641   tests/pkcs1-padding/Makefile
642   tests/pkcs12-decode/Makefile
643   tests/pkcs8-decode/Makefile
644   tests/rsa-md5-collision/Makefile
645   tests/safe-renegotiation/Makefile
646   tests/scripts/Makefile
647   tests/sha2/Makefile
648   tests/slow/Makefile
649   tests/suite/Makefile
650   tests/userid/Makefile
651 ])
652
653 AC_OUTPUT
654
655 dnl  Warning flags:        errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
656 dnl  Valgrind:             $opt_valgrind_tests ${VALGRIND}
657 AC_MSG_NOTICE([summary of build options:
658
659   version:              ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
660   Host/Target system:   ${host}
661   Build system:         ${build}
662   Install prefix:       ${prefix}
663   Compiler:             ${CC}
664   CFlags:               ${CFLAGS}
665   Library types:        Shared=${enable_shared}, Static=${enable_static}
666 ])
667
668 AC_MSG_NOTICE([External hardware support:
669
670   /dev/crypto:          $enable_cryptodev
671   Hardware accel:       $hw_accel
672   PKCS#11 support:      $with_p11_kit
673   TPM support:          $with_tpm
674 ])
675
676 AC_MSG_NOTICE([Optional features:
677 (note that included applications might not compile properly
678 if features are disabled)
679
680   DTLS-SRTP support:    $ac_enable_srtp
681   ALPN support:         $ac_enable_alpn
682   OCSP support:         $ac_enable_ocsp
683   OpenPGP support:      $ac_enable_openpgp
684   SRP support:          $ac_enable_srp
685   PSK support:          $ac_enable_psk
686   DHE support:          $ac_enable_dhe
687   ECDHE support:        $ac_enable_ecdhe
688   Anon auth support:    $ac_enable_anon
689   Heartbeat support:    $ac_enable_heartbeat
690   RSA-EXPORT compat:    $ac_enable_rsa_export
691   Unicode support:      $ac_have_unicode
692 ])
693
694 AC_MSG_NOTICE([Optional applications:
695
696   crywrap app:          $libidn
697   local libopts:        $enable_local_libopts
698 ])
699
700 AC_MSG_NOTICE([Optional libraries:
701
702   Guile wrappers:       $opt_guile_bindings
703   C++ library:          $use_cxx
704   DANE library:         $enable_dane
705   OpenSSL compat:       $enable_openssl
706 ])
707
708 AC_MSG_NOTICE([System files:
709
710   Trust store pkcs:     $with_default_trust_store_pkcs11
711   Trust store file:     $with_default_trust_store_file
712   CRL file:             $with_default_crl_file
713   DNSSEC root key file: $unbound_root_key_file
714 ])
715
716 if test ! -f "$unbound_root_key_file"; then
717 AC_MSG_WARN([[
718 *** 
719 *** The DNSSEC root key file in $unbound_root_key_file was not found. 
720 *** This file is needed for the verification of DNSSEC responses.
721 *** Use the command: unbound-anchor -a "$unbound_root_key_file"
722 *** to generate or update it.
723 *** ]])
724 fi