Merge branch 'master' of ssh://civodul@git.savannah.gnu.org/srv/git/gnutls
[gnutls.git] / configure.in
blobfd70eb1ecf716e687d6a82d157bd589412904878
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.6], [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, 1)
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 GNUTLS_GCRYPT_VERSION=1:1.2.4
49 GNUTLS_LIBTASN1_VERSION=0.3.4
50 AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gcrypt])
51 AC_DEFINE_UNQUOTED(GNUTLS_LIBTASN1_VERSION, "$GNUTLS_LIBTASN1_VERSION", [version of libtasn1])
53 # Compute numeric versions, used in includes/gnutls/gnutls.h.in.
54 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
55 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
56 AC_SUBST(PATCH_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`)
57 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
59 opt_dmalloc_mode=no
60 AC_MSG_CHECKING([whether in dmalloc mode])
61 AC_ARG_ENABLE(dmalloc-mode,
62         AS_HELP_STRING([--enable-dmalloc-mode], [enable dmalloc mode]),
63         opt_dmalloc_mode=$enableval)
64 AC_MSG_RESULT($opt_dmalloc_mode)
66 opt_efence_mode=no
67 AC_MSG_CHECKING([whether in electric fence mode])
68 AC_ARG_ENABLE(efence-mode,
69         AS_HELP_STRING([--enable-efence-mode], [enable electric fence mode]),
70 opt_efence_mode=$enableval)
71 AC_MSG_RESULT($opt_efence_mode)
73 opt_developer_mode=no
74 AC_MSG_CHECKING([whether in developer mode])
75 AC_ARG_ENABLE(developer-mode,
76         AS_HELP_STRING([--enable-developer-mode], [enable developer mode]),
77 opt_developer_mode=$enableval)
78 AC_MSG_RESULT($opt_developer_mode)
80 opt_profiler_mode=no
81 AC_MSG_CHECKING([whether in profile mode])
82 AC_ARG_ENABLE(profile-mode,
83         AS_HELP_STRING([--enable-profile-mode], [enable profiler]),
84 opt_profiler_mode=$enableval)
85 AC_MSG_RESULT($opt_profiler_mode)
87 AC_MSG_RESULT([***
88 *** Checking for compilation programs...
91 dnl Checks for programs.
92 AC_PROG_CC
93 AC_PROG_CXX
94 AC_PROG_LN_S
95 GTK_DOC_CHECK(1.1)
96 AC_PATH_PROG([GAA], [gaa])
97 if test "x$GAA" = "x"; then
98    AC_MSG_WARN([[***
99 *** GAA was not found.  It is only needed if you wish to modify
100 *** the source code or command-line description files.  In this case,
101 *** you may want to get it from http://gaa.sourceforge.net/
102 ***]])
104 AM_CONDITIONAL(HAVE_GCC,   test "x$GCC" = "xyes")
107 AC_MSG_RESULT([***
108 *** Detecting compiler options...
111 gl_EARLY
112 lgl_EARLY
113 AC_C_CONST
114 AC_C_INLINE
116 AM_GNU_GETTEXT([external])
117 AM_GNU_GETTEXT_VERSION([0.17])
119 AC_ARG_ENABLE(cxx,
120        AS_HELP_STRING([--disable-cxx],
121                [unconditionally disable the C++ library]),
122        use_cxx=$enableval, use_cxx=yes)
123 if test "$use_cxx" != "no"; then
124   AC_LANG_PUSH(C++)
125   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
126   AC_LANG_POP(C++)
128 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
129 AC_MSG_CHECKING([whether to build C++ library])
130 AC_MSG_RESULT($use_cxx)
132 AC_MSG_CHECKING([whether C99 macros are supported])
133 AC_TRY_COMPILE(,[ 
134 #define test_mac(...) 
135 int z,y,x;
136 test_mac(x,y,z);
137 return 0;
138 ], 
139         dnl ***** OK
140         AC_DEFINE(C99_MACROS, 1, [C99 macros are supported])
141         AC_MSG_RESULT(yes),
142         dnl ***** NOT FOUND
143         AC_MSG_RESULT(no)
144         AC_MSG_WARN([C99 macros not supported. This may affect compiling.]))
146 if test $ac_cv_c_compiler_gnu != no; then
147         if test x$opt_developer_mode = xyes; then
148           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"
149 #         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"
150         fi
152         AC_MSG_CHECKING([whether gcc supports -Wno-pointer-sign])
153         _gcc_cflags_save=$CFLAGS
154         CFLAGS="${CFLAGS} -Wno-pointer-sign"
155         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
156         AC_MSG_RESULT($_gcc_psign)
157         if test x"$_gcc_psign" != xyes ; then
158           CFLAGS=$_gcc_cflags_save;
159         fi
161         AC_MSG_CHECKING([whether gcc supports -fgnu89-inline])
162         _gcc_cflags_save="$CFLAGS"
163         CFLAGS="${CFLAGS} -fgnu89-inline"
164         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
165           _gcc_gnu89_inline=yes, _gcc_gnu89_inline=no)
166         AC_MSG_RESULT($_gcc_gnu89_inline)
167         AM_CONDITIONAL([HAVE_GCC_GNU89_INLINE_OPTION],
168           [test "x$_gcc_gnu89_inline" = "xyes"])
169         CFLAGS=$_gcc_cflags_save;
171         AC_MSG_CHECKING([if gcc/ld supports -Wl,--output-def])
172         if test "$enable_shared" = no; then
173           output_def=no
174           AC_MSG_RESULT([no need, since shared libraries are disabled])
175         else
176           _gcc_ldflags_save=$LDFLAGS
177           LDFLAGS="-Wl,--output-def,foo.def"
178           AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
179           AC_MSG_RESULT($output_def)
180           LDFLAGS="$_gcc_ldflags_save"
181         fi
183         if test x$opt_dmalloc_mode = xyes; then
184           AC_CHECK_LIB(dmalloc, main)
185           AC_DEFINE(USE_DMALLOC, 1, [enable the use of dmalloc])
186         else
187                 if test x$opt_efence_mode = xyes; then
188                   AC_CHECK_LIB(efence, main)
189                   AC_DEFINE(USE_EFENCE, 1, [use electric fence])
190                 fi
191         fi
193         AC_MSG_CHECKING([whether we have GNU assembler])
194         GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
195         if test "$GAS"; then
196           AM_CFLAGS="${AM_CFLAGS} -pipe"
197           AC_MSG_RESULT(yes)
198         else
199           AC_MSG_RESULT(no)
200         fi
203 # Needs to be called outside of 'if' clause.
204 AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, test "$output_def" = "yes")
206 AC_MSG_RESULT([***
207 *** Detecting C library capabilities...
210 AC_HEADER_STDC
211 AC_CHECK_HEADERS(strings.h)
212 AC_CHECK_HEADERS(errno.h)
213 AC_CHECK_HEADERS(math.h limits.h float.h stdarg.h ctype.h)
214 AC_CHECK_HEADERS(netdb.h)
215 AC_CHECK_FUNCS(umask vasprintf isascii fork,,)
217 # No fork on MinGW, disable some self-tests until we fix them.
218 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
220 AC_MSG_RESULT([***
221 *** Detecting system's parameters...
224 # Run self-tests under valgrind?
225 if test "$cross_compiling" = no; then
226   AC_CHECK_PROGS(VALGRIND, valgrind)
228 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
229   opt_valgrind_tests=yes
230 else
231   opt_valgrind_tests=no
232   VALGRIND=
233 fi 
234 AC_MSG_CHECKING([whether self tests are run under valgrind])
235 AC_ARG_ENABLE(valgrind-tests,
236         AS_HELP_STRING([--enable-valgrind-tests],
237                        [run self tests under valgrind]),
238   opt_valgrind_tests=$enableval)
239 AC_MSG_RESULT($opt_valgrind_tests)
241 # For minitasn1.
242 AC_CHECK_SIZEOF(unsigned long int, 4)
243 AC_CHECK_SIZEOF(unsigned int, 4)
245 # For storing integers in pointers without warnings
246 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
247 AC_CHECK_SIZEOF(void *)
248 AC_CHECK_SIZEOF(long)
249 AC_CHECK_SIZEOF(int)
250 case $ac_cv_sizeof_void_p in
251   $ac_cv_sizeof_long)
252     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [(long)],
253               [Additional cast to bring void* to a type castable to int.])
254     ;;
255   *)
256     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [])
257     ;;
258 esac
260 # For some systems we know that we have ld_version scripts.
261 # Use it then as default.
262 have_ld_version_script=no
263 case "${host}" in
264     *-*-linux*)
265         have_ld_version_script=yes
266         ;;
267     *-*-gnu*)
268         have_ld_version_script=yes
269         ;;
270 esac
271 AC_ARG_ENABLE([ld-version-script],
272               AC_HELP_STRING([--enable-ld-version-script],
273                              [enable/disable use of linker version script.
274                               (default is system dependent)]),
275               [have_ld_version_script=$enableval],
276               [ : ] )
277 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
279 AC_CHECK_TYPES(uint,,, [
280 # include <sys/types.h>
283 # Check for and replace ssize_t.
284 AC_CHECK_TYPE(ssize_t,
285         [DEFINE_SSIZE_T="#include <sys/types.h>"
286         AC_SUBST(DEFINE_SSIZE_T)],
287         [AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found])
288         DEFINE_SSIZE_T="typedef int ssize_t;"
289         AC_SUBST(DEFINE_SSIZE_T)],
290         [#include <sys/types.h>])
292 AC_C_BIGENDIAN
294 AC_MSG_RESULT([***
295 *** Checking for external libraries...
298 # For Guile bindings.
300 opt_guile_bindings=yes
301 AC_MSG_CHECKING([whether building Guile bindings])
302 AC_ARG_ENABLE(guile,
303         AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
304 opt_guile_bindings=$enableval)
305 AC_MSG_RESULT($opt_guile_bindings)
307 AC_ARG_WITH([--with-guile-site-dir],
308   [AS_HELP_STRING([--with-guile-site-dir],
309      [use the given directory as the Guile site (use with care)])])
311 if test "x$opt_guile_bindings" = "xyes"; then
312    AC_MSG_RESULT([***
313 *** Detecting GNU Guile...
316    AC_PATH_PROG([guile_snarf], [guile-snarf])
317    if test "x$guile_snarf" = "x"; then
318       AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found.  Guile bindings not built.])
319       opt_guile_bindings=no
320    else
321       GUILE_PROGS
322       GUILE_FLAGS
324       save_CFLAGS="$CFLAGS"
325       save_LIBS="$LIBS"
326       CFLAGS="$CFLAGS $GUILE_CFLAGS"
327       LIBS="$LIBS $GUILE_LDFLAGS"
328       AC_MSG_CHECKING([whether GNU Guile is recent enough])
329       AC_LINK_IFELSE(AC_LANG_CALL([], [scm_from_locale_string]),
330         [], [opt_guile_bindings=no])
331       CFLAGS="$save_CFLAGS"
332       LIBS="$save_LIBS"
334       if test "x$opt_guile_bindings" = "xyes"; then
335         AC_MSG_RESULT([yes])
336         case "x$with_guile_site_dir" in 
337              xno)
338                 # Use the default $(GUILE_SITE).
339                 GUILE_SITE_DIR
340                 ;;
341              x|xyes)
342                 # Automatically derive $(GUILE_SITE) from $(pkgdatadir).  This
343                 # hack is used to allow `distcheck' to work (see
344                 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
345                 GUILE_SITE="\$(datadir)/guile/site"
346                 AC_SUBST(GUILE_SITE)
347                 ;;
348              *)
349                 # Use the user-specified directory as $(GUILE_SITE).
350                 GUILE_SITE="$with_guile_site_dir"
351                 AC_SUBST(GUILE_SITE)
352                 ;;
353         esac
354       else
355         AC_MSG_RESULT([no])
356         AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
357         opt_guile_bindings=no
358       fi
359    fi
361 AM_CONDITIONAL(HAVE_GUILE, test "x$opt_guile_bindings" = "xyes")
363 AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,,
364 dnl Can't disable - gnutls depends on gcrypt
365         AC_MSG_ERROR([[
366 ***  
367 *** libgcrypt was not found. You may want to get it from
368 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
370 ]]))
371 libgcrypt=yes
373 # Hard-wire the gl/m4/gc.m4 test.
374 AC_ARG_WITH(builtin-crypto,
375         AS_HELP_STRING([--with-builtin-crypto],
376                 [use internal crypto instead of libgcrypt (EXPERIMENTAL)]),
377         ac_cv_libgcrypt=no,
378         ac_cv_libgcrypt=yes)
379 LTLIBGCRYPT=$LIBGCRYPT_LIBS
381 AC_MSG_CHECKING([whether to enable Opaque PRF input support])
382 AC_ARG_ENABLE(opaque-prf-input,
383         AS_HELP_STRING([--enable-opaque-prf-input=DD],
384                 [enable Opaque PRF input using DD as extension type]),
385         ac_opaque_prf_input=$enableval, ac_opaque_prf_input=no)
386 if test "$ac_opaque_prf_input" != "no"; then
387   if ! echo $ac_opaque_prf_input | egrep -q '^[[0-9]]+$'; then
388     ac_opaque_prf_input=no
389     AC_MSG_WARN([[
390 *** Could not parse Opaque PRF Input extension type.
391 *** Use --enable-opaque-prf-input=XX where XX is decimal, for example
392 *** to use extension value 42 use --enable-opqaue-prf-input=42]])
393   fi
395 if test "$ac_opaque_prf_input" != "no"; then
396  AC_MSG_RESULT([yes (extension value $ac_opaque_prf_input)])
397  AC_DEFINE_UNQUOTED(ENABLE_OPRFI, $ac_opaque_prf_input,
398                     [enable Opaque PRF Input])
399 else
400  AC_MSG_RESULT(no)
402 AM_CONDITIONAL(ENABLE_OPRFI, test "$ac_opaque_prf_input" != "no")
404 AC_MSG_CHECKING([whether to disable SRP authentication support])
405 AC_ARG_ENABLE(srp-authentication,
406         AS_HELP_STRING([--disable-srp-authentication],
407                 [disable the SRP authentication support]),
408         ac_enable_srp=no)
409 if test x$ac_enable_srp != xno; then
410  AC_MSG_RESULT(no)
411  AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication])
412 else
413  ac_full=0
414  AC_MSG_RESULT(yes)
416 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
418 AC_MSG_CHECKING([whether to disable PSK authentication support])
419 AC_ARG_ENABLE(psk-authentication,
420        AS_HELP_STRING([--disable-psk-authentication],
421                [disable the PSK authentication support]),
422        ac_enable_psk=no)
423 if test x$ac_enable_psk != xno; then
424  AC_MSG_RESULT(no)
425  AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication])
426 else
427  ac_full=0
428  AC_MSG_RESULT(yes)
431 AC_MSG_CHECKING([whether to disable anonymous authentication support])
432 AC_ARG_ENABLE(anon-authentication,
433         AS_HELP_STRING([--disable-anon-authentication],
434                 [disable the anonymous authentication support]),
435         ac_enable_anon=no)
436 if test x$ac_enable_anon != xno; then
437  AC_MSG_RESULT(no)
438  AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication])
439 else
440  ac_full=0
441  AC_MSG_RESULT(yes)
443 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
445 dnl Check for Camellia support
447 AC_ARG_ENABLE(camellia,
448         AS_HELP_STRING([--disable-camellia], [disable Camellia cipher]),
449         ac_enable_camellia=no)
450 if test "$ac_enable_camellia" != "no"; then
451   AC_MSG_CHECKING([for Camellia support in libgcrypt])
452   if test -n "`$LIBGCRYPT_CONFIG --algorithms | grep -i camellia`"; then
453     AC_MSG_RESULT([yes])
454     ac_enable_camellia=yes
455   else
456     AC_MSG_RESULT([no])
457     ac_enable_camellia=no
458   fi
460 AC_MSG_CHECKING([whether to disable Camellia cipher])
461 if test "$ac_enable_camellia" = "yes"; then
462  AC_MSG_RESULT([no])
463  AC_DEFINE(ENABLE_CAMELLIA, 1, [enable camellia block cipher])
464 else
465  AC_MSG_RESULT([yes])
468 AC_MSG_CHECKING([whether to disable extra PKI stuff])
469 AC_ARG_ENABLE(extra-pki,
470         AS_HELP_STRING([--disable-extra-pki],
471                 [only enable the basic PKI stuff]),
472         disable_pki=$enableval, disable_pki=no)
473 if test "$disable_pki" != "no"; then
474  ac_full=0
475  AC_MSG_RESULT(yes)
476 else
477  AC_MSG_RESULT(no)
478  AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS/PKI stuff])
480 AM_CONDITIONAL(ENABLE_PKI, test "$disable_pki" = "no")
482 dnl Check whether to disable OpenPGP authentication completely
483 dnl from libgnutls-extra.
485 ac_enable_openpgp=yes
486 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
487 AC_ARG_ENABLE(openpgp-authentication,
488         AS_HELP_STRING([--disable-openpgp-authentication],
489                 [disable the OpenPGP authentication support]),
490         ac_enable_openpgp=no)
491 if test x$ac_enable_openpgp = xno; then
492  AC_MSG_RESULT(yes)
493  ac_full=0
494 else
495  AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication])
496  AC_MSG_RESULT(no)
498 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
500 AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer])
501 AC_ARG_ENABLE(openssl-compatibility,
502         AS_HELP_STRING([--disable-openssl-compatibility],
503                 [disable the OpenSSL compatibility support]),
504         ac_enable_openssl=$withval,
505         ac_enable_openssl=yes)
506 if test x$ac_enable_openssl != xno; then
507  AC_MSG_RESULT(no)
508 else
509  AC_MSG_RESULT(yes)
512 AM_CONDITIONAL(ENABLE_OPENSSL, test "$ac_enable_openssl" = "yes")
515 AC_ARG_WITH(included-libtasn1,
516         AS_HELP_STRING([--with-included-libtasn1],
517                 [use the included libtasn1]),
518         minitasn1_enabled=$withval,
519         minitasn1_enabled=no)
521 if test x$minitasn1_enabled = xno; then
522 AM_PATH_LIBTASN1($GNUTLS_LIBTASN1_VERSION,,
523  minitasn1_enabled=yes
524  AC_MSG_WARN([[
525 *** 
526 *** LibtASN1 ${GNUTLS_LIBTASN1_VERSION} was not found. Will use the included one.
527 ]]))
530 AC_MSG_CHECKING([whether to use the included minitasn1])
531 AC_MSG_RESULT($minitasn1_enabled)
533 AM_CONDITIONAL(ENABLE_MINITASN1, test "$minitasn1_enabled" = "yes")
535 dnl Check for libcfg+
537 SAVED_LIBS=$LIBS
538 AC_ARG_WITH(included-libcfg,
539         AS_HELP_STRING([--with-included-libcfg],
540                 [use the included libcfg+ (certtool only)]),
541         libcfg_enabled=$withval, 
542         libcfg_enabled=no
543 dnl We search for libcfg+ which is used by certtool
545         AC_CHECK_LIB(cfg+, cfg_get_context,:,
546                      libcfg_enabled=yes
547                      AC_MSG_WARN([[
548 *** 
549 *** Libcfg+ was not found. Will use the included one.]])))
551 AM_CONDITIONAL(HAVE_LIBCFG, test "$libcfg_enabled" = "no")
552 LIBS=$SAVED_LIBS
554 AC_MSG_CHECKING([whether to use the included libcfg])
555 AC_MSG_RESULT($libcfg_enabled)
558 dnl CHECK FOR ZLIB SUPPORT
561 AC_MSG_CHECKING([whether to include zlib compression support])
563 AC_ARG_WITH(zlib,
564         AS_HELP_STRING([--without-zlib], [disable zlib compression support]),
565         ac_zlib=$withval,
566         ac_zlib=yes)
568 if test x$ac_zlib != xno; then
569  AC_MSG_RESULT(yes)
570  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
571  if test "$ac_cv_libz" != yes; then
572    AC_MSG_WARN(
573 *** 
574 *** ZLIB was not found. You will not be able to use ZLIB compression.)
575  fi
576 else
577  AC_MSG_RESULT(no)
581 dnl CHECK FOR LZO SUPPORT
584 AC_ARG_WITH(lzo,
585         AS_HELP_STRING([--with-lzo], [use experimental LZO compression]),
586         use_lzo=$withval,
587         use_lzo=no)
588 AC_MSG_CHECKING([whether to include LZO compression support])
589 AC_MSG_RESULT($use_lzo)
591 LZO_LIBS=
592 if test "$use_lzo" = "yes"; then
593   AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2)
594   if test "$LZO_LIBS" = ""; then
595     AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [
596       use_lzo=no
597       AC_MSG_WARN(
599 *** Could not find liblzo or liblzo2.  Disabling LZO compression.
601       ])
602   fi
604 AC_SUBST(LZO_LIBS)
606 if test "$use_lzo" = "yes"; then
607   AC_DEFINE(USE_LZO, 1, [whether to use the LZO compression])
608   if test "$LZO_LIBS" = "-llzo"; then
609     AC_CHECK_HEADERS(lzo1x.h)
610   elif test "$LZO_LIBS" = "-llzo2"; then
611     AC_CHECK_HEADERS(lzo/lzo1x.h)
612   fi
615 AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes")
617 dnl Gnulib files
620 AC_MSG_RESULT([***
621 *** Setting up gnulib compatibility files...
623 gl_INIT
624 lgl_INIT
626 AC_TRY_LINK([#include <winsock2.h>], [
627   WORD wVersionRequested = MAKEWORD(2, 2);
628   WSADATA wsaData;
629   int err = WSAStartup(wVersionRequested, &wsaData);
630   WSACleanup ();], wsastartup=yes, wsastartup=no)
631 if test x$wsastartup = xyes; then
632   AC_DEFINE(HAVE_WINSOCK, 1, [Call WSAStartup in gnutls_global_init])
634 AC_MSG_CHECKING([if we have Windows sockets and WSAStartup/WSACleanup])
635 AC_MSG_RESULT($wsastartup)
637 AC_MSG_RESULT([***
638 *** Detecting options for shared libraries...
640 AC_LIBTOOL_WIN32_DLL
641 AC_PROG_LIBTOOL
643 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS"
644 LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}"
645 AC_SUBST(LIBGNUTLS_LIBS)
646 AC_SUBST(LIBGNUTLS_CFLAGS)
648 LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LZO_LIBS $LIBGNUTLS_LIBS"
649 LIBGNUTLS_EXTRA_CFLAGS="-I${includedir}"
650 AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
651 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
652 export ac_full
654 AM_CFLAGS="${AM_CFLAGS} ${LIBGCRYPT_CFLAGS}"
656 if test $ac_cv_c_compiler_gnu != no; then
657         if test x$opt_profiler_mode = xyes; then
658           AC_CHECK_PROG(FC_OK, fc-config, yes, no)
659           if test x$FC_OK = xyes; then
660                 AM_CFLAGS="${AM_CFLAGS} `fc-config --cflags`"
661                 LIBS="$LIBS `fc-config --libs`"
662           else
663 AC_MSG_WARN(***
664 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
666           fi
667         fi
670 if test $ac_full -eq 0; then
671   AC_SUBST(POSSIBLY_WARN_ABOUT_MISSING_FEATURES, [[
672 #ifdef __GNUC__
673 #warning This is not the official GnuTLS library. Several features were disabled at compilation.
674 #endif /* __GNUC__ */]])
677 AC_SUBST(AM_CFLAGS)
679 AC_CONFIG_COMMANDS([chmod-config],[[
680  chmod +x lib/libgnutls-config
681  chmod +x libextra/libgnutls-extra-config
682 ]],[[]])
684 AC_CONFIG_FILES([Makefile po/Makefile.in \
685         doc/Makefile doc/examples/Makefile doc/scripts/Makefile \
686         doc/manpages/Makefile doc/reference/Makefile \
687         doc/credentials/Makefile doc/credentials/x509/Makefile \
688         doc/credentials/srp/Makefile doc/credentials/openpgp/Makefile \
689         gl/Makefile lgl/Makefile \
690         tests/Makefile tests/rsa-md5-collision/Makefile tests/userid/Makefile \
691         tests/pkcs1-padding/Makefile tests/pkcs8-decode/Makefile \
692         tests/pkcs12-decode/Makefile tests/pathlen/Makefile \
693         tests/key-id/Makefile tests/sha2/Makefile \
694         tests/hostname-check/Makefile \
695         includes/Makefile includes/gnutls/gnutls.h \
696         lib/Makefile lib/minitasn1/Makefile lib/x509/Makefile \
697         libextra/Makefile lib/openpgp/Makefile lib/opencdk/Makefile \
698         tests/openpgp/Makefile \
699         src/Makefile \
700         src/cfg/Makefile src/cfg/platon/Makefile src/cfg/platon/str/Makefile \
701         lib/libgnutls-config libextra/libgnutls-extra-config \
702         lib/gnutls.pc libextra/gnutls-extra.pc
703         guile/Makefile guile/modules/Makefile
704         guile/src/Makefile guile/tests/Makefile])
706 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
709 AC_OUTPUT