Add.
[gnutls.git] / configure.in
blob07f31e56e3eaa94d6ea1b6357e7f9bb65821f723
1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
3 #    Free Software Foundation, Inc.
5 # Author: Nikos Mavrogiannopoulos
7 # This file is part of GNUTLS.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
22 # USA
24 AC_PREREQ(2.61)
25 AC_INIT([GnuTLS], [2.3.4.netconf.2], [bug-gnutls@gnu.org])
26 AC_CONFIG_AUX_DIR([build-aux])
28 AC_CANONICAL_TARGET
30 AM_INIT_AUTOMAKE([1.10 dist-bzip2])
31 AM_CONFIG_HEADER(config.h)
33 AB_INIT
35 # Library code modified:                              REVISION++
36 # Interfaces changed/added/removed:   CURRENT++       REVISION=0
37 # Interfaces added:                             AGE++
38 # Interfaces removed:                           AGE=0
39 AC_SUBST(LT_CURRENT, 28)
40 AC_SUBST(LT_REVISION, 4)
41 AC_SUBST(LT_AGE, 2)
42 ac_full=1
44 # Used when creating the Windows libgnutls-XX.def files.
45 SOVERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
46 AC_SUBST(SOVERSION)
48 dnl for opencdk needs also change in the test
49 GNUTLS_OPENCDK_VERSION=0.6.5
50 GNUTLS_GCRYPT_VERSION=1:1.2.4
51 GNUTLS_LIBTASN1_VERSION=0.3.4
52 AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gcrypt])
53 AC_DEFINE_UNQUOTED(GNUTLS_LIBTASN1_VERSION, "$GNUTLS_LIBTASN1_VERSION", [version of libtasn1])
55 # Compute numeric versions, used in includes/gnutls/gnutls.h.in.
56 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
57 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
58 AC_SUBST(PATCH_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`)
59 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
61 opt_dmalloc_mode=no
62 AC_MSG_CHECKING([whether in dmalloc mode])
63 AC_ARG_ENABLE(dmalloc-mode,
64         AS_HELP_STRING([--enable-dmalloc-mode], [enable dmalloc mode]),
65         opt_dmalloc_mode=$enableval)
66 AC_MSG_RESULT($opt_dmalloc_mode)
68 opt_efence_mode=no
69 AC_MSG_CHECKING([whether in electric fence mode])
70 AC_ARG_ENABLE(efence-mode,
71         AS_HELP_STRING([--enable-efence-mode], [enable electric fence mode]),
72 opt_efence_mode=$enableval)
73 AC_MSG_RESULT($opt_efence_mode)
75 opt_developer_mode=no
76 AC_MSG_CHECKING([whether in developer mode])
77 AC_ARG_ENABLE(developer-mode,
78         AS_HELP_STRING([--enable-developer-mode], [enable developer mode]),
79 opt_developer_mode=$enableval)
80 AC_MSG_RESULT($opt_developer_mode)
82 opt_profiler_mode=no
83 AC_MSG_CHECKING([whether in profile mode])
84 AC_ARG_ENABLE(profile-mode,
85         AS_HELP_STRING([--enable-profile-mode], [enable profiler]),
86 opt_profiler_mode=$enableval)
87 AC_MSG_RESULT($opt_profiler_mode)
89 AC_MSG_RESULT([***
90 *** Checking for compilation programs...
93 dnl Checks for programs.
94 AC_PROG_CC
95 AC_PROG_CXX
96 AC_PROG_LN_S
97 GTK_DOC_CHECK(1.1)
98 AC_PATH_PROG([GAA], [gaa])
99 if test "x$GAA" = "x"; then
100    AC_MSG_WARN([[***
101 *** GAA was not found.  It is only needed if you wish to modify
102 *** the source code or command-line description files.  In this case,
103 *** you may want to get it from http://gaa.sourceforge.net/
104 ***]])
106 AM_CONDITIONAL(HAVE_GCC,   test "x$GCC" = "xyes")
109 AC_MSG_RESULT([***
110 *** Detecting compiler options...
113 gl_EARLY
114 lgl_EARLY
115 AC_C_CONST
116 AC_C_INLINE
118 AM_GNU_GETTEXT([external])
119 AM_GNU_GETTEXT_VERSION([0.17])
121 AC_ARG_ENABLE(cxx,
122        AS_HELP_STRING([--disable-cxx],
123                [unconditionally disable the C++ library]),
124        use_cxx=$enableval, use_cxx=yes)
125 if test "$use_cxx" != "no"; then
126   AC_LANG_PUSH(C++)
127   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
128   AC_LANG_POP(C++)
130 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
131 AC_MSG_CHECKING([whether to build C++ library])
132 AC_MSG_RESULT($use_cxx)
134 AC_MSG_CHECKING([whether C99 macros are supported])
135 AC_TRY_COMPILE(,[ 
136 #define test_mac(...) 
137 int z,y,x;
138 test_mac(x,y,z);
139 return 0;
140 ], 
141         dnl ***** OK
142         AC_DEFINE(C99_MACROS, 1, [C99 macros are supported])
143         AC_MSG_RESULT(yes),
144         dnl ***** NOT FOUND
145         AC_MSG_RESULT(no)
146         AC_MSG_WARN([C99 macros not supported. This may affect compiling.]))
148 if test $ac_cv_c_compiler_gnu != no; then
149         if test x$opt_developer_mode = xyes; then
150           AM_CFLAGS="${AM_CFLAGS} -g -Wall -Wcast-align -W -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wno-unused-parameter"
151 #         AM_CFLAGS="${AM_CFLAGS} -g -W -Wall -Wcast-align -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wshadow -Wno-unused-parameter -Wimplicit -fno-common -Wno-sign-compare -Wbad-function-cast -Wendif-labels -Wmissing-declarations -Wno-missing-format-attribute -Wmissing-prototypes -Wnested-externs -Wpointer-arith -pedantic -Wlong-long -Wcast-qual -Wcast-align -Winline -Wredundant-decls -Wstrict-prototypes -Wwrite-strings -Wparentheses -Wsequence-point -Wpacked -Waggregate-return -Wfloat-equal -Wmultichar -Wunknown-pragmas -Wtrigraphs -Wswitch -Wreturn-type -Wmain -Wchar-subscripts -Wcomment -Wno-missing-noreturn"
152         fi
154         AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
155         _gcc_cflags_save=$CFLAGS
156         CFLAGS="${CFLAGS} -Wno-pointer-sign"
157         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
158         AC_MSG_RESULT($_gcc_psign)
159         if test x"$_gcc_psign" != xyes ; then
160           CFLAGS=$_gcc_cflags_save;
161         fi
163         AC_MSG_CHECKING([if gcc/ld supports -Wl,--output-def])
164         _gcc_ldflags_save=$LDFLAGS
165         LDFLAGS="-Wl,--output-def,foo.def"
166         AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
167         AC_MSG_RESULT($output_def)
168         LDFLAGS="$_gcc_ldflags_save"
170         if test x$opt_dmalloc_mode = xyes; then
171           AC_CHECK_LIB(dmalloc, main)
172           AC_DEFINE(USE_DMALLOC, 1, [enable the use of dmalloc])
173         else
174                 if test x$opt_efence_mode = xyes; then
175                   AC_CHECK_LIB(efence, main)
176                   AC_DEFINE(USE_EFENCE, 1, [use electric fence])
177                 fi
178         fi
180         AC_MSG_CHECKING([whether we have GNU assembler])
181         GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
182         if test "$GAS"; then
183           AM_CFLAGS="${AM_CFLAGS} -pipe"
184           AC_MSG_RESULT(yes)
185         else
186           AC_MSG_RESULT(no)
187         fi
190 # Needs to be called outside of 'if' clause.
191 AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, test "$output_def" = "yes")
193 AC_MSG_RESULT([***
194 *** Detecting C library capabilities...
197 AC_HEADER_STDC
198 AC_CHECK_HEADERS(strings.h alloca.h)
199 AC_CHECK_HEADERS(errno.h)
200 AC_CHECK_HEADERS(math.h limits.h float.h stdarg.h ctype.h)
201 AC_CHECK_HEADERS(netdb.h)
202 AC_CHECK_FUNCS(umask vasprintf isascii fork,,)
203 AC_FUNC_ALLOCA
205 # No fork on MinGW, disable some self-tests until we fix them.
206 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
208 AC_MSG_RESULT([***
209 *** Detecting system's parameters...
212 # Run self-tests under valgrind?
213 if test "$cross_compiling" = no; then
214   AC_CHECK_PROGS(VALGRIND, valgrind)
216 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
217   opt_valgrind_tests=yes
218 else
219   opt_valgrind_tests=no
220   VALGRIND=
221 fi 
222 AC_MSG_CHECKING([whether self tests are run under valgrind])
223 AC_ARG_ENABLE(valgrind-tests,
224         AS_HELP_STRING([--enable-valgrind-tests],
225                        [run self tests under valgrind]),
226   opt_valgrind_tests=$enableval)
227 AC_MSG_RESULT($opt_valgrind_tests)
229 # For minitasn1.
230 AC_CHECK_SIZEOF(unsigned long int, 4)
231 AC_CHECK_SIZEOF(unsigned int, 4)
233 # For storing integers in pointers without warnings
234 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
235 AC_CHECK_SIZEOF(void *)
236 AC_CHECK_SIZEOF(long)
237 AC_CHECK_SIZEOF(int)
238 case $ac_cv_sizeof_void_p in
239   $ac_cv_sizeof_long)
240     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [(long)],
241               [Additional cast to bring void* to a type castable to int.])
242     ;;
243   *)
244     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [])
245     ;;
246 esac
248 # For some systems we know that we have ld_version scripts.
249 # Use it then as default.
250 have_ld_version_script=no
251 case "${host}" in
252     *-*-linux*)
253         have_ld_version_script=yes
254         ;;
255     *-*-gnu*)
256         have_ld_version_script=yes
257         ;;
258 esac
259 AC_ARG_ENABLE([ld-version-script],
260               AC_HELP_STRING([--enable-ld-version-script],
261                              [enable/disable use of linker version script.
262                               (default is system dependent)]),
263               [have_ld_version_script=$enableval],
264               [ : ] )
265 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
267 AC_CHECK_TYPES(uint,,, [
268 # include <sys/types.h>
271 # Check for and replace ssize_t.
272 AC_CHECK_TYPE(ssize_t,
273         [DEFINE_SSIZE_T="#include <sys/types.h>"
274         AC_SUBST(DEFINE_SSIZE_T)],
275         [AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found])
276         DEFINE_SSIZE_T="typedef int ssize_t;"
277         AC_SUBST(DEFINE_SSIZE_T)],
278         [#include <sys/types.h>])
280 AC_C_BIGENDIAN
282 AC_MSG_RESULT([***
283 *** Checking for external libraries...
286 # For Guile bindings.
288 opt_guile_bindings=yes
289 AC_MSG_CHECKING([whether building Guile bindings])
290 AC_ARG_ENABLE(guile,
291         AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
292 opt_guile_bindings=$enableval)
293 AC_MSG_RESULT($opt_guile_bindings)
295 AC_ARG_WITH([--with-guile-site-dir],
296   [AS_HELP_STRING([--with-guile-site-dir],
297      [use the given directory as the Guile site (use with care)])])
299 if test "x$opt_guile_bindings" = "xyes"; then
300    AC_MSG_RESULT([***
301 *** Detecting GNU Guile...
304    AC_PATH_PROG([guile_snarf], [guile-snarf])
305    if test "x$guile_snarf" = "x"; then
306       AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found.  Guile bindings not built.])
307       opt_guile_bindings=no
308    else
309       GUILE_PROGS
310       GUILE_FLAGS
312       save_CFLAGS="$CFLAGS"
313       save_LIBS="$LIBS"
314       CFLAGS="$CFLAGS $GUILE_CFLAGS"
315       LIBS="$LIBS $GUILE_LDFLAGS"
316       AC_MSG_CHECKING([whether GNU Guile is recent enough])
317       AC_LINK_IFELSE(AC_LANG_CALL([], [scm_from_locale_string]),
318         [], [opt_guile_bindings=no])
319       CFLAGS="$save_CFLAGS"
320       LIBS="$save_LIBS"
322       if test "x$opt_guile_bindings" = "xyes"; then
323         AC_MSG_RESULT([yes])
324         case "x$with_guile_site_dir" in 
325              xno)
326                 # Use the default $(GUILE_SITE).
327                 GUILE_SITE_DIR
328                 ;;
329              x|xyes)
330                 # Automatically derive $(GUILE_SITE) from $(pkgdatadir).  This
331                 # hack is used to allow `distcheck' to work (see
332                 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
333                 GUILE_SITE="\$(datadir)/guile/site"
334                 AC_SUBST(GUILE_SITE)
335                 ;;
336              *)
337                 # Use the user-specified directory as $(GUILE_SITE).
338                 GUILE_SITE="$with_guile_site_dir"
339                 AC_SUBST(GUILE_SITE)
340                 ;;
341         esac
342       else
343         AC_MSG_RESULT([no])
344         AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
345         opt_guile_bindings=no
346       fi
347    fi
349 AM_CONDITIONAL(HAVE_GUILE, test "x$opt_guile_bindings" = "xyes")
351 AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,,
352 dnl Can't disable - gnutls depends on gcrypt
353         AC_MSG_ERROR([[
354 ***  
355 *** libgcrypt was not found. You may want to get it from
356 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
358 ]]))
359 libgcrypt=yes
361 # Hard-wire the gl/m4/gc.m4 test.
362 AC_ARG_WITH(builtin-crypto,
363         AS_HELP_STRING([--with-builtin-crypto],
364                 [use internal crypto instead of libgcrypt (EXPERIMENTAL)]),
365         ac_cv_libgcrypt=no,
366         ac_cv_libgcrypt=yes)
367 LTLIBGCRYPT=$LIBGCRYPT_LIBS
369 AC_MSG_CHECKING([whether to enable Opaque PRF input support])
370 AC_ARG_ENABLE(opaque-prf-input,
371         AS_HELP_STRING([--enable-opaque-prf-input=DD],
372                 [enable Opaque PRF input using DD as extension type]),
373         ac_opaque_prf_input=$enableval, ac_opaque_prf_input=no)
374 if test "$ac_opaque_prf_input" != "no"; then
375   if ! echo $ac_opaque_prf_input | egrep -q '^[[0-9]]+$'; then
376     ac_opaque_prf_input=no
377     AC_MSG_WARN([[
378 *** Could not parse Opaque PRF Input extension type.
379 *** Use --enable-opaque-prf-input=XX where XX is decimal, for example
380 *** to use extension value 42 use --enable-opqaue-prf-input=42]])
381   fi
383 if test "$ac_opaque_prf_input" != "no"; then
384  AC_MSG_RESULT([yes (extension value $ac_opaque_prf_input)])
385  AC_DEFINE_UNQUOTED(ENABLE_OPRFI, $ac_opaque_prf_input,
386                     [enable Opaque PRF Input])
387 else
388  AC_MSG_RESULT(no)
390 AM_CONDITIONAL(ENABLE_OPRFI, test "$ac_opaque_prf_input" != "no")
392 AC_MSG_CHECKING([whether to disable SRP authentication support])
393 AC_ARG_ENABLE(srp-authentication,
394         AS_HELP_STRING([--disable-srp-authentication],
395                 [disable the SRP authentication support]),
396         ac_enable_srp=no)
397 if test x$ac_enable_srp != xno; then
398  AC_MSG_RESULT(no)
399  AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication])
400 else
401  ac_full=0
402  AC_MSG_RESULT(yes)
404 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
406 AC_MSG_CHECKING([whether to disable PSK authentication support])
407 AC_ARG_ENABLE(psk-authentication,
408        AS_HELP_STRING([--disable-psk-authentication],
409                [disable the PSK authentication support]),
410        ac_enable_psk=no)
411 if test x$ac_enable_psk != xno; then
412  AC_MSG_RESULT(no)
413  AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication])
414 else
415  ac_full=0
416  AC_MSG_RESULT(yes)
419 AC_MSG_CHECKING([whether to disable anonymous authentication support])
420 AC_ARG_ENABLE(anon-authentication,
421         AS_HELP_STRING([--disable-anon-authentication],
422                 [disable the anonymous authentication support]),
423         ac_enable_anon=no)
424 if test x$ac_enable_anon != xno; then
425  AC_MSG_RESULT(no)
426  AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication])
427 else
428  ac_full=0
429  AC_MSG_RESULT(yes)
431 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
433 dnl Check for Camellia support
435 AC_ARG_ENABLE(camellia,
436         AS_HELP_STRING([--disable-camellia], [disable Camellia cipher]),
437         ac_enable_camellia=no)
438 if test "$ac_enable_camellia" != "no"; then
439   AC_MSG_CHECKING([for Camellia support in libgcrypt])
440   if test -n "`$LIBGCRYPT_CONFIG --algorithms | grep -i camellia`"; then
441     AC_MSG_RESULT([yes])
442     ac_enable_camellia=yes
443   else
444     AC_MSG_RESULT([no])
445     ac_enable_camellia=no
446   fi
448 AC_MSG_CHECKING([whether to disable Camellia cipher])
449 if test "$ac_enable_camellia" = "yes"; then
450  AC_MSG_RESULT([no])
451  AC_DEFINE(ENABLE_CAMELLIA, 1, [enable camellia block cipher])
452 else
453  AC_MSG_RESULT([yes])
456 AC_MSG_CHECKING([whether to disable extra PKI stuff])
457 AC_ARG_ENABLE(extra-pki,
458         AS_HELP_STRING([--disable-extra-pki],
459                 [only enable the basic PKI stuff]),
460         disable_pki=$enableval, disable_pki=no)
461 if test "$disable_pki" != "no"; then
462  ac_full=0
463  AC_MSG_RESULT(yes)
464 else
465  AC_MSG_RESULT(no)
466  AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS/PKI stuff])
468 AM_CONDITIONAL(ENABLE_PKI, test "$disable_pki" = "no")
470 dnl Check whether to disable OpenPGP authentication completely
471 dnl from libgnutls-extra.
473 ac_enable_openpgp=yes
474 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
475 AC_ARG_ENABLE(openpgp-authentication,
476         AS_HELP_STRING([--disable-openpgp-authentication],
477                 [disable the OpenPGP authentication support]),
478         ac_enable_openpgp=no)
479 if test x$ac_enable_openpgp = xno; then
480  AC_MSG_RESULT(yes)
481  ac_full=0
482 else
483  AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication])
484  AC_MSG_RESULT(no)
486 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
488 dnl Test whether to use the included opencdk library
489 dnl 
490 dnl We no longer test for it. We use the LGPL parts of this library internally
491 dnl if test x$ac_enable_openpgp = xyes; then
492 dnl AC_ARG_WITH(included-opencdk,
493 dnl     AS_HELP_STRING([--with-included-opencdk], [use the included opencdk]),
494 dnl             ac_enable_included_opencdk=$withval, 
495 dnl             ac_enable_included_opencdk=no)
496 dnl if test x$ac_enable_included_opencdk = xno;then 
497 dnl  AC_LIB_HAVE_LINKFLAGS(opencdk,, [
498 dnl #include <opencdk.h>], [
499 dnl #if OPENCDK_VERSION_MINOR < 6 || OPENCDK_VERSION_PATCH < 5
500 dnl # error "OpenCDK 0.6.5 is required"
501 dnl #else
502 dnl cdk_check_version( NULL);
503 dnl #endif
504 dnl ])
505 dnl  if test "$ac_cv_libopencdk" != yes; then
506 dnl    ac_enable_included_opencdk=yes
507 dnl    AC_MSG_WARN([[
508 dnl ***
509 dnl *** libopencdk was not found. You may want to get it from
510 dnl *** ftp://ftp.gnutls.org/pub/gnutls/opencdk/
511 dnl ***
512 dnl *** Will use the included opencdk.
513 dnl ***
514 dnl ]])
515 dnl   fi
516 dnl   AC_MSG_CHECKING([whether to use the included opencdk])
517 dnl   AC_MSG_RESULT($ac_enable_included_opencdk)
518 dnl  fi
519 dnl fi
521 ac_enable_included_opencdk=yes
523 AM_CONDITIONAL(ENABLE_INCLUDED_OPENCDK, test "$ac_enable_included_opencdk" = "yes")
525 AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer])
526 AC_ARG_ENABLE(openssl-compatibility,
527         AS_HELP_STRING([--disable-openssl-compatibility],
528                 [disable the OpenSSL compatibility support]),
529         ac_enable_openssl=$withval,
530         ac_enable_openssl=yes)
531 if test x$ac_enable_openssl != xno; then
532  AC_MSG_RESULT(no)
533 else
534  AC_MSG_RESULT(yes)
537 AM_CONDITIONAL(ENABLE_OPENSSL, test "$ac_enable_openssl" = "yes")
540 AC_ARG_WITH(included-libtasn1,
541         AS_HELP_STRING([--with-included-libtasn1],
542                 [use the included libtasn1]),
543         minitasn1_enabled=$withval,
544         minitasn1_enabled=no)
546 if test x$minitasn1_enabled = xno; then
547 AM_PATH_LIBTASN1($GNUTLS_LIBTASN1_VERSION,,
548  minitasn1_enabled=yes
549  AC_MSG_WARN([[
550 *** 
551 *** LibtASN1 ${GNUTLS_LIBTASN1_VERSION} was not found. Will use the included one.
552 ]]))
555 AC_MSG_CHECKING([whether to use the included minitasn1])
556 AC_MSG_RESULT($minitasn1_enabled)
558 AM_CONDITIONAL(ENABLE_MINITASN1, test "$minitasn1_enabled" = "yes")
560 dnl Check for libcfg+
562 SAVED_LIBS=$LIBS
563 AC_ARG_WITH(included-libcfg,
564         AS_HELP_STRING([--with-included-libcfg],
565                 [use the included libcfg+ (certtool only)]),
566         libcfg_enabled=$withval, 
567         libcfg_enabled=no
568 dnl We search for libcfg+ which is used by certtool
570         AC_CHECK_LIB(cfg+, cfg_get_context,:,
571                      libcfg_enabled=yes
572                      AC_MSG_WARN([[
573 *** 
574 *** Libcfg+ was not found. Will use the included one.]])))
576 AM_CONDITIONAL(HAVE_LIBCFG, test "$libcfg_enabled" = "no")
577 LIBS=$SAVED_LIBS
579 AC_MSG_CHECKING([whether to use the included libcfg])
580 AC_MSG_RESULT($libcfg_enabled)
583 dnl CHECK FOR ZLIB SUPPORT
586 AC_MSG_CHECKING([whether to include zlib compression support])
588 AC_ARG_WITH(zlib,
589         AS_HELP_STRING([--without-zlib], [disable zlib compression support]),
590         ac_zlib=$withval,
591         ac_zlib=yes)
593 if test x$ac_zlib != xno; then
594  AC_MSG_RESULT(yes)
595  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
596  if test "$ac_cv_libz" != yes; then
597    AC_MSG_WARN(
598 *** 
599 *** ZLIB was not found. You will not be able to use ZLIB compression.)
600  fi
601 else
602  AC_MSG_RESULT(no)
606 dnl CHECK FOR LZO SUPPORT
609 AC_ARG_WITH(lzo,
610         AS_HELP_STRING([--with-lzo], [use experimental LZO compression]),
611         use_lzo=$withval,
612         use_lzo=no)
613 AC_MSG_CHECKING([whether to include LZO compression support])
614 AC_MSG_RESULT($use_lzo)
616 LZO_LIBS=
617 if test "$use_lzo" = "yes"; then
618   AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2)
619   if test "$LZO_LIBS" = ""; then
620     AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [
621       use_lzo=no
622       AC_MSG_WARN(
624 *** Could not find liblzo or liblzo2.  Disabling LZO compression.
626       ])
627   fi
629 AC_SUBST(LZO_LIBS)
631 if test "$use_lzo" = "yes"; then
632   AC_DEFINE(USE_LZO, 1, [whether to use the LZO compression])
633   if test "$LZO_LIBS" = "-llzo"; then
634     AC_CHECK_HEADERS(lzo1x.h)
635   elif test "$LZO_LIBS" = "-llzo2"; then
636     AC_CHECK_HEADERS(lzo/lzo1x.h)
637   fi
640 AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes")
642 dnl Gnulib files
645 AC_MSG_RESULT([***
646 *** Setting up gnulib compatibility files...
648 gl_INIT
649 lgl_INIT
651 AC_TRY_LINK([#include <winsock2.h>], [
652   WORD wVersionRequested = MAKEWORD(2, 2);
653   WSADATA wsaData;
654   int err = WSAStartup(wVersionRequested, &wsaData);
655   WSACleanup ();], wsastartup=yes, wsastartup=no)
656 if test x$wsastartup = xyes; then
657   AC_DEFINE(HAVE_WINSOCK, 1, [Call WSAStartup in gnutls_global_init])
659 AC_MSG_CHECKING([if we have Windows sockets and WSAStartup/WSACleanup])
660 AC_MSG_RESULT($wsastartup)
662 AC_MSG_RESULT([***
663 *** Detecting options for shared libraries...
665 AC_LIBTOOL_WIN32_DLL
666 AC_PROG_LIBTOOL
668 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS"
669 LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}"
670 AC_SUBST(LIBGNUTLS_LIBS)
671 AC_SUBST(LIBGNUTLS_CFLAGS)
673 LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LTLIBOPENCDK $LZO_LIBS $LIBGNUTLS_LIBS"
674 LIBGNUTLS_EXTRA_CFLAGS="$INCOPENCDK -I${includedir}"
675 AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
676 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
677 export ac_full
679 AM_CFLAGS="${AM_CFLAGS} ${LIBGCRYPT_CFLAGS}"
681 if test $ac_cv_c_compiler_gnu != no; then
682         if test x$opt_profiler_mode = xyes; then
683           AC_CHECK_PROG(FC_OK, fc-config, yes, no)
684           if test x$FC_OK = xyes; then
685                 AM_CFLAGS="${AM_CFLAGS} `fc-config --cflags`"
686                 LIBS="$LIBS `fc-config --libs`"
687           else
688 AC_MSG_WARN(***
689 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
691           fi
692         fi
695 if test $ac_full -eq 0; then
696   AC_SUBST(POSSIBLY_WARN_ABOUT_MISSING_FEATURES, [[
697 #ifdef __GNUC__
698 #warning This is not the official GnuTLS library. Several features were disabled at compilation.
699 #endif /* __GNUC__ */]])
702 AC_SUBST(AM_CFLAGS)
704 AC_CONFIG_COMMANDS([chmod-config],[[
705  chmod +x lib/libgnutls-config
706  chmod +x libextra/libgnutls-extra-config
707 ]],[[]])
709 AC_CONFIG_FILES([Makefile po/Makefile.in \
710         doc/Makefile doc/examples/Makefile doc/scripts/Makefile \
711         doc/manpages/Makefile doc/reference/Makefile \
712         doc/credentials/Makefile doc/credentials/x509/Makefile \
713         doc/credentials/srp/Makefile doc/credentials/openpgp/Makefile \
714         gl/Makefile lgl/Makefile \
715         tests/Makefile tests/rsa-md5-collision/Makefile tests/userid/Makefile \
716         tests/pkcs1-padding/Makefile tests/pkcs8-decode/Makefile \
717         tests/pkcs12-decode/Makefile tests/pathlen/Makefile \
718         tests/key-id/Makefile tests/sha2/Makefile \
719         tests/hostname-check/Makefile \
720         includes/Makefile includes/gnutls/gnutls.h \
721         lib/Makefile lib/minitasn1/Makefile lib/x509/Makefile \
722         libextra/Makefile lib/openpgp/Makefile lib/opencdk/Makefile \
723         tests/openpgp/Makefile \
724         src/Makefile \
725         src/cfg/Makefile src/cfg/platon/Makefile src/cfg/platon/str/Makefile \
726         lib/libgnutls-config libextra/libgnutls-extra-config \
727         lib/gnutls.pc libextra/gnutls-extra.pc
728         guile/Makefile guile/modules/Makefile
729         guile/src/Makefile guile/tests/Makefile])
731 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
734 AC_OUTPUT