Update gnulib files.
[gnutls.git] / configure.in
blobc59e7c596ecc49e1858fecbe1ed308ae06fa7574
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.5], [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, 29)
40 AC_SUBST(LT_REVISION, 0)
41 AC_SUBST(LT_AGE, 3)
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         if test "$enable_shared" = no; then
165           output_def=no
166           AC_MSG_RESULT([no need, since shared libraries are disabled])
167         else
168           _gcc_ldflags_save=$LDFLAGS
169           LDFLAGS="-Wl,--output-def,foo.def"
170           AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
171           AC_MSG_RESULT($output_def)
172           LDFLAGS="$_gcc_ldflags_save"
173         fi
175         if test x$opt_dmalloc_mode = xyes; then
176           AC_CHECK_LIB(dmalloc, main)
177           AC_DEFINE(USE_DMALLOC, 1, [enable the use of dmalloc])
178         else
179                 if test x$opt_efence_mode = xyes; then
180                   AC_CHECK_LIB(efence, main)
181                   AC_DEFINE(USE_EFENCE, 1, [use electric fence])
182                 fi
183         fi
185         AC_MSG_CHECKING([whether we have GNU assembler])
186         GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
187         if test "$GAS"; then
188           AM_CFLAGS="${AM_CFLAGS} -pipe"
189           AC_MSG_RESULT(yes)
190         else
191           AC_MSG_RESULT(no)
192         fi
195 # Needs to be called outside of 'if' clause.
196 AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, test "$output_def" = "yes")
198 AC_MSG_RESULT([***
199 *** Detecting C library capabilities...
202 AC_HEADER_STDC
203 AC_CHECK_HEADERS(strings.h alloca.h)
204 AC_CHECK_HEADERS(errno.h)
205 AC_CHECK_HEADERS(math.h limits.h float.h stdarg.h ctype.h)
206 AC_CHECK_HEADERS(netdb.h)
207 AC_CHECK_FUNCS(umask vasprintf isascii fork,,)
208 AC_FUNC_ALLOCA
210 # No fork on MinGW, disable some self-tests until we fix them.
211 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
213 AC_MSG_RESULT([***
214 *** Detecting system's parameters...
217 # Run self-tests under valgrind?
218 if test "$cross_compiling" = no; then
219   AC_CHECK_PROGS(VALGRIND, valgrind)
221 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
222   opt_valgrind_tests=yes
223 else
224   opt_valgrind_tests=no
225   VALGRIND=
226 fi 
227 AC_MSG_CHECKING([whether self tests are run under valgrind])
228 AC_ARG_ENABLE(valgrind-tests,
229         AS_HELP_STRING([--enable-valgrind-tests],
230                        [run self tests under valgrind]),
231   opt_valgrind_tests=$enableval)
232 AC_MSG_RESULT($opt_valgrind_tests)
234 # For minitasn1.
235 AC_CHECK_SIZEOF(unsigned long int, 4)
236 AC_CHECK_SIZEOF(unsigned int, 4)
238 # For storing integers in pointers without warnings
239 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
240 AC_CHECK_SIZEOF(void *)
241 AC_CHECK_SIZEOF(long)
242 AC_CHECK_SIZEOF(int)
243 case $ac_cv_sizeof_void_p in
244   $ac_cv_sizeof_long)
245     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [(long)],
246               [Additional cast to bring void* to a type castable to int.])
247     ;;
248   *)
249     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [])
250     ;;
251 esac
253 # For some systems we know that we have ld_version scripts.
254 # Use it then as default.
255 have_ld_version_script=no
256 case "${host}" in
257     *-*-linux*)
258         have_ld_version_script=yes
259         ;;
260     *-*-gnu*)
261         have_ld_version_script=yes
262         ;;
263 esac
264 AC_ARG_ENABLE([ld-version-script],
265               AC_HELP_STRING([--enable-ld-version-script],
266                              [enable/disable use of linker version script.
267                               (default is system dependent)]),
268               [have_ld_version_script=$enableval],
269               [ : ] )
270 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
272 AC_CHECK_TYPES(uint,,, [
273 # include <sys/types.h>
276 # Check for and replace ssize_t.
277 AC_CHECK_TYPE(ssize_t,
278         [DEFINE_SSIZE_T="#include <sys/types.h>"
279         AC_SUBST(DEFINE_SSIZE_T)],
280         [AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found])
281         DEFINE_SSIZE_T="typedef int ssize_t;"
282         AC_SUBST(DEFINE_SSIZE_T)],
283         [#include <sys/types.h>])
285 AC_C_BIGENDIAN
287 AC_MSG_RESULT([***
288 *** Checking for external libraries...
291 # For Guile bindings.
293 opt_guile_bindings=yes
294 AC_MSG_CHECKING([whether building Guile bindings])
295 AC_ARG_ENABLE(guile,
296         AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
297 opt_guile_bindings=$enableval)
298 AC_MSG_RESULT($opt_guile_bindings)
300 AC_ARG_WITH([--with-guile-site-dir],
301   [AS_HELP_STRING([--with-guile-site-dir],
302      [use the given directory as the Guile site (use with care)])])
304 if test "x$opt_guile_bindings" = "xyes"; then
305    AC_MSG_RESULT([***
306 *** Detecting GNU Guile...
309    AC_PATH_PROG([guile_snarf], [guile-snarf])
310    if test "x$guile_snarf" = "x"; then
311       AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found.  Guile bindings not built.])
312       opt_guile_bindings=no
313    else
314       GUILE_PROGS
315       GUILE_FLAGS
317       save_CFLAGS="$CFLAGS"
318       save_LIBS="$LIBS"
319       CFLAGS="$CFLAGS $GUILE_CFLAGS"
320       LIBS="$LIBS $GUILE_LDFLAGS"
321       AC_MSG_CHECKING([whether GNU Guile is recent enough])
322       AC_LINK_IFELSE(AC_LANG_CALL([], [scm_from_locale_string]),
323         [], [opt_guile_bindings=no])
324       CFLAGS="$save_CFLAGS"
325       LIBS="$save_LIBS"
327       if test "x$opt_guile_bindings" = "xyes"; then
328         AC_MSG_RESULT([yes])
329         case "x$with_guile_site_dir" in 
330              xno)
331                 # Use the default $(GUILE_SITE).
332                 GUILE_SITE_DIR
333                 ;;
334              x|xyes)
335                 # Automatically derive $(GUILE_SITE) from $(pkgdatadir).  This
336                 # hack is used to allow `distcheck' to work (see
337                 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
338                 GUILE_SITE="\$(datadir)/guile/site"
339                 AC_SUBST(GUILE_SITE)
340                 ;;
341              *)
342                 # Use the user-specified directory as $(GUILE_SITE).
343                 GUILE_SITE="$with_guile_site_dir"
344                 AC_SUBST(GUILE_SITE)
345                 ;;
346         esac
347       else
348         AC_MSG_RESULT([no])
349         AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
350         opt_guile_bindings=no
351       fi
352    fi
354 AM_CONDITIONAL(HAVE_GUILE, test "x$opt_guile_bindings" = "xyes")
356 AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,,
357 dnl Can't disable - gnutls depends on gcrypt
358         AC_MSG_ERROR([[
359 ***  
360 *** libgcrypt was not found. You may want to get it from
361 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
363 ]]))
364 libgcrypt=yes
366 # Hard-wire the gl/m4/gc.m4 test.
367 AC_ARG_WITH(builtin-crypto,
368         AS_HELP_STRING([--with-builtin-crypto],
369                 [use internal crypto instead of libgcrypt (EXPERIMENTAL)]),
370         ac_cv_libgcrypt=no,
371         ac_cv_libgcrypt=yes)
372 LTLIBGCRYPT=$LIBGCRYPT_LIBS
374 AC_MSG_CHECKING([whether to enable Opaque PRF input support])
375 AC_ARG_ENABLE(opaque-prf-input,
376         AS_HELP_STRING([--enable-opaque-prf-input=DD],
377                 [enable Opaque PRF input using DD as extension type]),
378         ac_opaque_prf_input=$enableval, ac_opaque_prf_input=no)
379 if test "$ac_opaque_prf_input" != "no"; then
380   if ! echo $ac_opaque_prf_input | egrep -q '^[[0-9]]+$'; then
381     ac_opaque_prf_input=no
382     AC_MSG_WARN([[
383 *** Could not parse Opaque PRF Input extension type.
384 *** Use --enable-opaque-prf-input=XX where XX is decimal, for example
385 *** to use extension value 42 use --enable-opqaue-prf-input=42]])
386   fi
388 if test "$ac_opaque_prf_input" != "no"; then
389  AC_MSG_RESULT([yes (extension value $ac_opaque_prf_input)])
390  AC_DEFINE_UNQUOTED(ENABLE_OPRFI, $ac_opaque_prf_input,
391                     [enable Opaque PRF Input])
392 else
393  AC_MSG_RESULT(no)
395 AM_CONDITIONAL(ENABLE_OPRFI, test "$ac_opaque_prf_input" != "no")
397 AC_MSG_CHECKING([whether to disable SRP authentication support])
398 AC_ARG_ENABLE(srp-authentication,
399         AS_HELP_STRING([--disable-srp-authentication],
400                 [disable the SRP authentication support]),
401         ac_enable_srp=no)
402 if test x$ac_enable_srp != xno; then
403  AC_MSG_RESULT(no)
404  AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication])
405 else
406  ac_full=0
407  AC_MSG_RESULT(yes)
409 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
411 AC_MSG_CHECKING([whether to disable PSK authentication support])
412 AC_ARG_ENABLE(psk-authentication,
413        AS_HELP_STRING([--disable-psk-authentication],
414                [disable the PSK authentication support]),
415        ac_enable_psk=no)
416 if test x$ac_enable_psk != xno; then
417  AC_MSG_RESULT(no)
418  AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication])
419 else
420  ac_full=0
421  AC_MSG_RESULT(yes)
424 AC_MSG_CHECKING([whether to disable anonymous authentication support])
425 AC_ARG_ENABLE(anon-authentication,
426         AS_HELP_STRING([--disable-anon-authentication],
427                 [disable the anonymous authentication support]),
428         ac_enable_anon=no)
429 if test x$ac_enable_anon != xno; then
430  AC_MSG_RESULT(no)
431  AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication])
432 else
433  ac_full=0
434  AC_MSG_RESULT(yes)
436 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
438 dnl Check for Camellia support
440 AC_ARG_ENABLE(camellia,
441         AS_HELP_STRING([--disable-camellia], [disable Camellia cipher]),
442         ac_enable_camellia=no)
443 if test "$ac_enable_camellia" != "no"; then
444   AC_MSG_CHECKING([for Camellia support in libgcrypt])
445   if test -n "`$LIBGCRYPT_CONFIG --algorithms | grep -i camellia`"; then
446     AC_MSG_RESULT([yes])
447     ac_enable_camellia=yes
448   else
449     AC_MSG_RESULT([no])
450     ac_enable_camellia=no
451   fi
453 AC_MSG_CHECKING([whether to disable Camellia cipher])
454 if test "$ac_enable_camellia" = "yes"; then
455  AC_MSG_RESULT([no])
456  AC_DEFINE(ENABLE_CAMELLIA, 1, [enable camellia block cipher])
457 else
458  AC_MSG_RESULT([yes])
461 AC_MSG_CHECKING([whether to disable extra PKI stuff])
462 AC_ARG_ENABLE(extra-pki,
463         AS_HELP_STRING([--disable-extra-pki],
464                 [only enable the basic PKI stuff]),
465         disable_pki=$enableval, disable_pki=no)
466 if test "$disable_pki" != "no"; then
467  ac_full=0
468  AC_MSG_RESULT(yes)
469 else
470  AC_MSG_RESULT(no)
471  AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS/PKI stuff])
473 AM_CONDITIONAL(ENABLE_PKI, test "$disable_pki" = "no")
475 dnl Check whether to disable OpenPGP authentication completely
476 dnl from libgnutls-extra.
478 ac_enable_openpgp=yes
479 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
480 AC_ARG_ENABLE(openpgp-authentication,
481         AS_HELP_STRING([--disable-openpgp-authentication],
482                 [disable the OpenPGP authentication support]),
483         ac_enable_openpgp=no)
484 if test x$ac_enable_openpgp = xno; then
485  AC_MSG_RESULT(yes)
486  ac_full=0
487 else
488  AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication])
489  AC_MSG_RESULT(no)
491 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
493 dnl Test whether to use the included opencdk library
494 dnl 
495 dnl We no longer test for it. We use the LGPL parts of this library internally
496 dnl if test x$ac_enable_openpgp = xyes; then
497 dnl AC_ARG_WITH(included-opencdk,
498 dnl     AS_HELP_STRING([--with-included-opencdk], [use the included opencdk]),
499 dnl             ac_enable_included_opencdk=$withval, 
500 dnl             ac_enable_included_opencdk=no)
501 dnl if test x$ac_enable_included_opencdk = xno;then 
502 dnl  AC_LIB_HAVE_LINKFLAGS(opencdk,, [
503 dnl #include <opencdk.h>], [
504 dnl #if OPENCDK_VERSION_MINOR < 6 || OPENCDK_VERSION_PATCH < 5
505 dnl # error "OpenCDK 0.6.5 is required"
506 dnl #else
507 dnl cdk_check_version( NULL);
508 dnl #endif
509 dnl ])
510 dnl  if test "$ac_cv_libopencdk" != yes; then
511 dnl    ac_enable_included_opencdk=yes
512 dnl    AC_MSG_WARN([[
513 dnl ***
514 dnl *** libopencdk was not found. You may want to get it from
515 dnl *** ftp://ftp.gnutls.org/pub/gnutls/opencdk/
516 dnl ***
517 dnl *** Will use the included opencdk.
518 dnl ***
519 dnl ]])
520 dnl   fi
521 dnl   AC_MSG_CHECKING([whether to use the included opencdk])
522 dnl   AC_MSG_RESULT($ac_enable_included_opencdk)
523 dnl  fi
524 dnl fi
526 ac_enable_included_opencdk=yes
528 AM_CONDITIONAL(ENABLE_INCLUDED_OPENCDK, test "$ac_enable_included_opencdk" = "yes")
530 AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer])
531 AC_ARG_ENABLE(openssl-compatibility,
532         AS_HELP_STRING([--disable-openssl-compatibility],
533                 [disable the OpenSSL compatibility support]),
534         ac_enable_openssl=$withval,
535         ac_enable_openssl=yes)
536 if test x$ac_enable_openssl != xno; then
537  AC_MSG_RESULT(no)
538 else
539  AC_MSG_RESULT(yes)
542 AM_CONDITIONAL(ENABLE_OPENSSL, test "$ac_enable_openssl" = "yes")
545 AC_ARG_WITH(included-libtasn1,
546         AS_HELP_STRING([--with-included-libtasn1],
547                 [use the included libtasn1]),
548         minitasn1_enabled=$withval,
549         minitasn1_enabled=no)
551 if test x$minitasn1_enabled = xno; then
552 AM_PATH_LIBTASN1($GNUTLS_LIBTASN1_VERSION,,
553  minitasn1_enabled=yes
554  AC_MSG_WARN([[
555 *** 
556 *** LibtASN1 ${GNUTLS_LIBTASN1_VERSION} was not found. Will use the included one.
557 ]]))
560 AC_MSG_CHECKING([whether to use the included minitasn1])
561 AC_MSG_RESULT($minitasn1_enabled)
563 AM_CONDITIONAL(ENABLE_MINITASN1, test "$minitasn1_enabled" = "yes")
565 dnl Check for libcfg+
567 SAVED_LIBS=$LIBS
568 AC_ARG_WITH(included-libcfg,
569         AS_HELP_STRING([--with-included-libcfg],
570                 [use the included libcfg+ (certtool only)]),
571         libcfg_enabled=$withval, 
572         libcfg_enabled=no
573 dnl We search for libcfg+ which is used by certtool
575         AC_CHECK_LIB(cfg+, cfg_get_context,:,
576                      libcfg_enabled=yes
577                      AC_MSG_WARN([[
578 *** 
579 *** Libcfg+ was not found. Will use the included one.]])))
581 AM_CONDITIONAL(HAVE_LIBCFG, test "$libcfg_enabled" = "no")
582 LIBS=$SAVED_LIBS
584 AC_MSG_CHECKING([whether to use the included libcfg])
585 AC_MSG_RESULT($libcfg_enabled)
588 dnl CHECK FOR ZLIB SUPPORT
591 AC_MSG_CHECKING([whether to include zlib compression support])
593 AC_ARG_WITH(zlib,
594         AS_HELP_STRING([--without-zlib], [disable zlib compression support]),
595         ac_zlib=$withval,
596         ac_zlib=yes)
598 if test x$ac_zlib != xno; then
599  AC_MSG_RESULT(yes)
600  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
601  if test "$ac_cv_libz" != yes; then
602    AC_MSG_WARN(
603 *** 
604 *** ZLIB was not found. You will not be able to use ZLIB compression.)
605  fi
606 else
607  AC_MSG_RESULT(no)
611 dnl CHECK FOR LZO SUPPORT
614 AC_ARG_WITH(lzo,
615         AS_HELP_STRING([--with-lzo], [use experimental LZO compression]),
616         use_lzo=$withval,
617         use_lzo=no)
618 AC_MSG_CHECKING([whether to include LZO compression support])
619 AC_MSG_RESULT($use_lzo)
621 LZO_LIBS=
622 if test "$use_lzo" = "yes"; then
623   AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2)
624   if test "$LZO_LIBS" = ""; then
625     AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [
626       use_lzo=no
627       AC_MSG_WARN(
629 *** Could not find liblzo or liblzo2.  Disabling LZO compression.
631       ])
632   fi
634 AC_SUBST(LZO_LIBS)
636 if test "$use_lzo" = "yes"; then
637   AC_DEFINE(USE_LZO, 1, [whether to use the LZO compression])
638   if test "$LZO_LIBS" = "-llzo"; then
639     AC_CHECK_HEADERS(lzo1x.h)
640   elif test "$LZO_LIBS" = "-llzo2"; then
641     AC_CHECK_HEADERS(lzo/lzo1x.h)
642   fi
645 AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes")
647 dnl Gnulib files
650 AC_MSG_RESULT([***
651 *** Setting up gnulib compatibility files...
653 gl_INIT
654 lgl_INIT
656 AC_TRY_LINK([#include <winsock2.h>], [
657   WORD wVersionRequested = MAKEWORD(2, 2);
658   WSADATA wsaData;
659   int err = WSAStartup(wVersionRequested, &wsaData);
660   WSACleanup ();], wsastartup=yes, wsastartup=no)
661 if test x$wsastartup = xyes; then
662   AC_DEFINE(HAVE_WINSOCK, 1, [Call WSAStartup in gnutls_global_init])
664 AC_MSG_CHECKING([if we have Windows sockets and WSAStartup/WSACleanup])
665 AC_MSG_RESULT($wsastartup)
667 AC_MSG_RESULT([***
668 *** Detecting options for shared libraries...
670 AC_LIBTOOL_WIN32_DLL
671 AC_PROG_LIBTOOL
673 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS"
674 LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}"
675 AC_SUBST(LIBGNUTLS_LIBS)
676 AC_SUBST(LIBGNUTLS_CFLAGS)
678 LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LTLIBOPENCDK $LZO_LIBS $LIBGNUTLS_LIBS"
679 LIBGNUTLS_EXTRA_CFLAGS="$INCOPENCDK -I${includedir}"
680 AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
681 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
682 export ac_full
684 AM_CFLAGS="${AM_CFLAGS} ${LIBGCRYPT_CFLAGS}"
686 if test $ac_cv_c_compiler_gnu != no; then
687         if test x$opt_profiler_mode = xyes; then
688           AC_CHECK_PROG(FC_OK, fc-config, yes, no)
689           if test x$FC_OK = xyes; then
690                 AM_CFLAGS="${AM_CFLAGS} `fc-config --cflags`"
691                 LIBS="$LIBS `fc-config --libs`"
692           else
693 AC_MSG_WARN(***
694 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
696           fi
697         fi
700 if test $ac_full -eq 0; then
701   AC_SUBST(POSSIBLY_WARN_ABOUT_MISSING_FEATURES, [[
702 #ifdef __GNUC__
703 #warning This is not the official GnuTLS library. Several features were disabled at compilation.
704 #endif /* __GNUC__ */]])
707 AC_SUBST(AM_CFLAGS)
709 AC_CONFIG_COMMANDS([chmod-config],[[
710  chmod +x lib/libgnutls-config
711  chmod +x libextra/libgnutls-extra-config
712 ]],[[]])
714 AC_CONFIG_FILES([Makefile po/Makefile.in \
715         doc/Makefile doc/examples/Makefile doc/scripts/Makefile \
716         doc/manpages/Makefile doc/reference/Makefile \
717         doc/credentials/Makefile doc/credentials/x509/Makefile \
718         doc/credentials/srp/Makefile doc/credentials/openpgp/Makefile \
719         gl/Makefile lgl/Makefile \
720         tests/Makefile tests/rsa-md5-collision/Makefile tests/userid/Makefile \
721         tests/pkcs1-padding/Makefile tests/pkcs8-decode/Makefile \
722         tests/pkcs12-decode/Makefile tests/pathlen/Makefile \
723         tests/key-id/Makefile tests/sha2/Makefile \
724         tests/hostname-check/Makefile \
725         includes/Makefile includes/gnutls/gnutls.h \
726         lib/Makefile lib/minitasn1/Makefile lib/x509/Makefile \
727         libextra/Makefile lib/openpgp/Makefile lib/opencdk/Makefile \
728         tests/openpgp/Makefile \
729         src/Makefile \
730         src/cfg/Makefile src/cfg/platon/Makefile src/cfg/platon/str/Makefile \
731         lib/libgnutls-config libextra/libgnutls-extra-config \
732         lib/gnutls.pc libextra/gnutls-extra.pc
733         guile/Makefile guile/modules/Makefile
734         guile/src/Makefile guile/tests/Makefile])
736 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
739 AC_OUTPUT