Add.
[gnutls.git] / configure.in
blob4f024e576a31b6195a267361bb34716b41074857
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.7.0], [bug-gnutls@gnu.org])
26 AC_CONFIG_AUX_DIR([build-aux])
27 AC_CONFIG_MACRO_DIR([m4])
29 AM_INIT_AUTOMAKE([1.10 dist-bzip2 -Wall -Werror -Wno-override])
30 AM_CONFIG_HEADER(config.h)
32 # Library code modified:                              REVISION++
33 # Interfaces changed/added/removed:   CURRENT++       REVISION=0
34 # Interfaces added:                             AGE++
35 # Interfaces removed:                           AGE=0
36 AC_SUBST(LT_CURRENT, 38)
37 AC_SUBST(LT_REVISION, 0)
38 AC_SUBST(LT_AGE, 12)
40 # Used when creating the Windows libgnutls-XX.def files.
41 SOVERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
42 AC_SUBST(SOVERSION)
44 GNUTLS_GCRYPT_VERSION=1:1.2.4
45 GNUTLS_LIBTASN1_VERSION=0.3.4
46 AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gcrypt])
47 AC_DEFINE_UNQUOTED(GNUTLS_LIBTASN1_VERSION, "$GNUTLS_LIBTASN1_VERSION", [version of libtasn1])
49 # Compute numeric versions, used in includes/gnutls/gnutls.h.in.
50 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
51 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
52 AC_SUBST(PATCH_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`)
53 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
55 opt_dmalloc_mode=no
56 AC_MSG_CHECKING([whether in dmalloc mode])
57 AC_ARG_ENABLE(dmalloc-mode,
58         AS_HELP_STRING([--enable-dmalloc-mode], [enable dmalloc mode]),
59         opt_dmalloc_mode=$enableval)
60 AC_MSG_RESULT($opt_dmalloc_mode)
62 opt_efence_mode=no
63 AC_MSG_CHECKING([whether in electric fence mode])
64 AC_ARG_ENABLE(efence-mode,
65         AS_HELP_STRING([--enable-efence-mode], [enable electric fence mode]),
66 opt_efence_mode=$enableval)
67 AC_MSG_RESULT($opt_efence_mode)
69 opt_developer_mode=no
70 AC_MSG_CHECKING([whether to enable compiler warnings])
71 AC_ARG_ENABLE(developer-mode,
72         AS_HELP_STRING([--enable-developer-mode], [enable compiler warnings]),
73 opt_developer_mode=$enableval)
74 AC_MSG_RESULT($opt_developer_mode)
76 AC_MSG_RESULT([***
77 *** Checking for compilation programs...
80 dnl Checks for programs.
81 AC_PROG_CC
82 AC_PROG_CXX
83 AC_PROG_LN_S
84 GTK_DOC_CHECK(1.1)
85 AC_PATH_PROG([GAA], [gaa])
86 if test "x$GAA" = "x"; then
87    AC_MSG_WARN([[***
88 *** GAA was not found.  It is only needed if you wish to modify
89 *** the source code or command-line description files.  In this case,
90 *** you may want to get it from http://gaa.sourceforge.net/
91 ***]])
93 AM_CONDITIONAL(HAVE_GCC,   test "x$GCC" = "xyes")
96 AC_MSG_RESULT([***
97 *** Detecting compiler options...
100 gl_EARLY
101 lgl_EARLY
102 xgl_EARLY
103 AC_C_CONST
104 AC_C_INLINE
106 AM_GNU_GETTEXT([external])
107 AM_GNU_GETTEXT_VERSION([0.17])
109 AC_ARG_ENABLE(cxx,
110        AS_HELP_STRING([--disable-cxx],
111                [unconditionally disable the C++ library]),
112        use_cxx=$enableval, use_cxx=yes)
113 if test "$use_cxx" != "no"; then
114   AC_LANG_PUSH(C++)
115   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
116   AC_LANG_POP(C++)
119 AC_MSG_CHECKING([whether C99 macros are supported])
120 AC_TRY_COMPILE(,[ 
121 #define test_mac(...) 
122 int z,y,x;
123 test_mac(x,y,z);
124 return 0;
125 ], 
126         dnl ***** OK
127         AC_DEFINE(C99_MACROS, 1, [C99 macros are supported])
128         AC_MSG_RESULT(yes),
129         dnl ***** NOT FOUND
130         AC_MSG_RESULT(no)
131         AC_MSG_WARN([C99 macros not supported. This may affect compiling.]))
133 if test $ac_cv_c_compiler_gnu != no; then
135         if test x$opt_developer_mode = xyes; then
136            AC_MSG_CHECKING([whether gcc supports various warning flags])
137            _gcc_cflags_save="$CFLAGS"
138            CFLAGS="${CFLAGS} -Wall -W -Wchar-subscripts -Wformat-security -Wnonnull -Winit-self -Wmissing-include-dirs -Wunused -Wno-unused-parameter -Wfloat-equal -Wdeclaration-after-statement -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wvolatile-register-var -Wdisabled-optimization -Wstack-protector -Woverlength-strings"
139            #removed "-Wlogical-op" and "-Wvla" which are not supported by my gcc --nmav
140            # -Wtraditional: warns on #elif which we use often
141            # -Wundef: warns on '#if GNULIB_PORTCHECK' etc in gnulib headers
142            # -Wpadded: many of our structs are not optimized for padding
143            # -Wtraditional-conversion: we catch missing prototypes anyway
144            # -Wno-unused-parameter: added because -Wunused cause too many warns
145            # -Wunreachable-code: appears to return many false positives
146            # -Wconversion: too many warnings for now
147            # -Wswitch-default: too many warnings for now
148            # -Wswitch-enum: too many warnings for now
149            AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_warns=yes,_gcc_warns=no)
150            AC_MSG_RESULT($_gcc_warns)
151            if test x"$_gcc_warns" != xyes ; then
152               CFLAGS=$_gcc_cflags_save;
153            fi
154         fi
156         AC_MSG_CHECKING([whether gcc supports -Wno-pointer-sign])
157         _gcc_cflags_save="$CFLAGS"
158         CFLAGS="${CFLAGS} -Wno-pointer-sign"
159         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
160         AC_MSG_RESULT($_gcc_psign)
161         if test "$_gcc_psign" != "yes"; then
162           CFLAGS="$_gcc_cflags_save";
163         fi
165         AC_MSG_CHECKING([whether gcc supports -fgnu89-inline])
166         _gcc_cflags_save="$CFLAGS"
167         CFLAGS="${CFLAGS} -fgnu89-inline"
168         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
169           _gcc_gnu89_inline=yes, _gcc_gnu89_inline=no)
170         AC_MSG_RESULT($_gcc_gnu89_inline)
171         CFLAGS="$_gcc_cflags_save"
173         AC_MSG_CHECKING([if gcc/ld supports -Wl,--output-def])
174         if test "$enable_shared" = no; then
175           output_def=no
176           AC_MSG_RESULT([no need, since shared libraries are disabled])
177         else
178           _gcc_ldflags_save=$LDFLAGS
179           LDFLAGS="-Wl,--output-def,foo.def"
180           AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
181           rm -f foo.def
182           AC_MSG_RESULT($output_def)
183           LDFLAGS="$_gcc_ldflags_save"
184         fi
186         if test x$opt_dmalloc_mode = xyes; then
187           AC_CHECK_LIB(dmalloc, main)
188           AC_DEFINE(USE_DMALLOC, 1, [enable the use of dmalloc])
189         else
190                 if test x$opt_efence_mode = xyes; then
191                   AC_CHECK_LIB(efence, main)
192                   AC_DEFINE(USE_EFENCE, 1, [use electric fence])
193                 fi
194         fi
196         AC_MSG_CHECKING([whether we have GNU assembler])
197         GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
198         if test "$GAS"; then
199           AM_CFLAGS="${AM_CFLAGS} -pipe"
200           AC_MSG_RESULT(yes)
201         else
202           AC_MSG_RESULT(no)
203         fi
206 # Needs to be called outside of 'if' clause.
207 AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, test "$output_def" = "yes")
208 AM_CONDITIONAL([HAVE_GCC_GNU89_INLINE_OPTION],
209                [test "$_gcc_gnu89_inline" = "yes"])
211 AC_MSG_RESULT([***
212 *** Detecting C library capabilities...
215 AC_HEADER_STDC
216 AC_CHECK_HEADERS(netdb.h)
217 AC_CHECK_FUNCS(fork,,)
218 AC_DEFINE([HAVE_STRINGS_H], 1, [Hard-code for src/cfg/.])
219 AC_DEFINE([HAVE_FLOAT_H], 1, [Hard-code for src/cfg/.])
220 AC_DEFINE([HAVE_LIMITS_H], 1, [Hard-code for src/cfg/.])
221 AC_DEFINE([HAVE_MATH_H], 1, [Hard-code for src/cfg/.])
222 AC_DEFINE([HAVE_CTYPE_H], 1, [Hard-code for src/cfg/.])
223 AC_DEFINE([HAVE_ERRNO_H], 1, [Hard-code for src/cfg/.])
225 # No fork on MinGW, disable some self-tests until we fix them.
226 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
228 AC_MSG_RESULT([***
229 *** Detecting system's parameters...
232 # Run self-tests under valgrind?
233 if test "$cross_compiling" = no; then
234   AC_CHECK_PROGS(VALGRIND, valgrind)
236 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
237   opt_valgrind_tests=yes
238 else
239   opt_valgrind_tests=no
240   VALGRIND=
241 fi 
242 AC_MSG_CHECKING([whether self tests are run under valgrind])
243 AC_ARG_ENABLE(valgrind-tests,
244         AS_HELP_STRING([--enable-valgrind-tests],
245                        [run self tests under valgrind]),
246   opt_valgrind_tests=$enableval)
247 AC_MSG_RESULT($opt_valgrind_tests)
249 # For minitasn1.
250 AC_CHECK_SIZEOF(unsigned long int, 4)
251 AC_CHECK_SIZEOF(unsigned int, 4)
253 # For storing integers in pointers without warnings
254 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
255 AC_CHECK_SIZEOF(void *)
256 AC_CHECK_SIZEOF(long)
257 AC_CHECK_SIZEOF(int)
258 case $ac_cv_sizeof_void_p in
259   $ac_cv_sizeof_long)
260     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [(long)],
261               [Additional cast to bring void* to a type castable to int.])
262     ;;
263   *)
264     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [])
265     ;;
266 esac
268 # For some systems we know that we have ld_version scripts.
269 # Use it then as default.
270 have_ld_version_script=no
271 case "${host}" in
272     *-*-linux*)
273         have_ld_version_script=yes
274         ;;
275     *-*-gnu*)
276         have_ld_version_script=yes
277         ;;
278 esac
279 AC_ARG_ENABLE([ld-version-script],
280               AC_HELP_STRING([--enable-ld-version-script],
281                              [enable/disable use of linker version script.
282                               (default is system dependent)]),
283               [have_ld_version_script=$enableval],
284               [ : ] )
285 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
287 AC_CHECK_TYPES(uint,,, [
288 # include <sys/types.h>
291 # Check for and replace ssize_t.
292 AC_CHECK_TYPE(ssize_t,
293         [DEFINE_SSIZE_T="#include <sys/types.h>"
294         AC_SUBST(DEFINE_SSIZE_T)],
295         [AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found])
296         DEFINE_SSIZE_T="typedef int ssize_t;"
297         AC_SUBST(DEFINE_SSIZE_T)],
298         [#include <sys/types.h>])
300 AC_C_BIGENDIAN
302 AC_MSG_RESULT([***
303 *** Checking for external libraries...
306 # For Guile bindings.
308 opt_guile_bindings=yes
309 AC_MSG_CHECKING([whether building Guile bindings])
310 AC_ARG_ENABLE(guile,
311         AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
312 opt_guile_bindings=$enableval)
313 AC_MSG_RESULT($opt_guile_bindings)
315 AC_ARG_WITH([--with-guile-site-dir],
316   [AS_HELP_STRING([--with-guile-site-dir],
317      [use the given directory as the Guile site (use with care)])])
319 if test "x$opt_guile_bindings" = "xyes"; then
320    AC_MSG_RESULT([***
321 *** Detecting GNU Guile...
324    AC_PATH_PROG([guile_snarf], [guile-snarf])
325    if test "x$guile_snarf" = "x"; then
326       AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found.  Guile bindings not built.])
327       opt_guile_bindings=no
328    else
329       GUILE_PROGS
330       GUILE_FLAGS
332       save_CFLAGS="$CFLAGS"
333       save_LIBS="$LIBS"
334       CFLAGS="$CFLAGS $GUILE_CFLAGS"
335       LIBS="$LIBS $GUILE_LDFLAGS"
336       AC_MSG_CHECKING([whether GNU Guile is recent enough])
337       AC_LINK_IFELSE(AC_LANG_CALL([], [scm_from_locale_string]),
338         [], [opt_guile_bindings=no])
339       CFLAGS="$save_CFLAGS"
340       LIBS="$save_LIBS"
342       if test "x$opt_guile_bindings" = "xyes"; then
343         AC_MSG_RESULT([yes])
344         case "x$with_guile_site_dir" in 
345              xno)
346                 # Use the default $(GUILE_SITE).
347                 GUILE_SITE_DIR
348                 ;;
349              x|xyes)
350                 # Automatically derive $(GUILE_SITE) from $(pkgdatadir).  This
351                 # hack is used to allow `distcheck' to work (see
352                 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
353                 GUILE_SITE="\$(datadir)/guile/site"
354                 AC_SUBST(GUILE_SITE)
355                 ;;
356              *)
357                 # Use the user-specified directory as $(GUILE_SITE).
358                 GUILE_SITE="$with_guile_site_dir"
359                 AC_SUBST(GUILE_SITE)
360                 ;;
361         esac
362       else
363         AC_MSG_RESULT([no])
364         AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
365         opt_guile_bindings=no
366       fi
367    fi
369 AM_CONDITIONAL(HAVE_GUILE, test "x$opt_guile_bindings" = "xyes")
371 AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,,
372 dnl Can't disable - gnutls depends on gcrypt
373         AC_MSG_ERROR([[
374 ***  
375 *** libgcrypt was not found. You may want to get it from
376 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
378 ]]))
380 # If this ever changes to 0, the user disabled some officially enabled
381 # stuff so we will print a warning.
382 ac_full=1
384 AC_MSG_CHECKING([whether to enable Opaque PRF input support])
385 AC_ARG_ENABLE(opaque-prf-input,
386         AS_HELP_STRING([--enable-opaque-prf-input=DD],
387                 [enable Opaque PRF input using DD as extension type]),
388         ac_opaque_prf_input=$enableval, ac_opaque_prf_input=no)
389 if test "$ac_opaque_prf_input" != "no"; then
390   if ! echo $ac_opaque_prf_input | egrep -q '^[[0-9]]+$'; then
391     ac_opaque_prf_input=no
392     AC_MSG_WARN([[
393 *** Could not parse Opaque PRF Input extension type.
394 *** Use --enable-opaque-prf-input=XX where XX is decimal, for example
395 *** to use extension value 42 use --enable-opqaue-prf-input=42]])
396   fi
398 if test "$ac_opaque_prf_input" != "no"; then
399  AC_MSG_RESULT([yes (extension value $ac_opaque_prf_input)])
400  AC_DEFINE_UNQUOTED(ENABLE_OPRFI, $ac_opaque_prf_input,
401                     [enable Opaque PRF Input])
402 else
403  AC_MSG_RESULT(no)
405 AM_CONDITIONAL(ENABLE_OPRFI, test "$ac_opaque_prf_input" != "no")
407 AC_MSG_CHECKING([whether to disable SRP authentication support])
408 AC_ARG_ENABLE(srp-authentication,
409         AS_HELP_STRING([--disable-srp-authentication],
410                 [disable the SRP authentication support]),
411         ac_enable_srp=no)
412 if test x$ac_enable_srp != xno; then
413  AC_MSG_RESULT(no)
414  AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication])
415 else
416  ac_full=0
417  AC_MSG_RESULT(yes)
419 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
421 AC_MSG_CHECKING([whether to disable PSK authentication support])
422 AC_ARG_ENABLE(psk-authentication,
423        AS_HELP_STRING([--disable-psk-authentication],
424                [disable the PSK authentication support]),
425        ac_enable_psk=no)
426 if test x$ac_enable_psk != xno; then
427  AC_MSG_RESULT(no)
428  AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication])
429 else
430  ac_full=0
431  AC_MSG_RESULT(yes)
433 AM_CONDITIONAL(ENABLE_PSK, test "$ac_enable_psk" != "no")
435 AC_MSG_CHECKING([whether to disable anonymous authentication support])
436 AC_ARG_ENABLE(anon-authentication,
437         AS_HELP_STRING([--disable-anon-authentication],
438                 [disable the anonymous authentication support]),
439         ac_enable_anon=no)
440 if test x$ac_enable_anon != xno; then
441  AC_MSG_RESULT(no)
442  AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication])
443 else
444  ac_full=0
445  AC_MSG_RESULT(yes)
447 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
449 dnl Check for Camellia support
451 AC_ARG_ENABLE(camellia,
452         AS_HELP_STRING([--disable-camellia], [disable Camellia cipher]),
453         ac_enable_camellia=no)
454 if test "$ac_enable_camellia" != "no"; then
455   AC_MSG_CHECKING([for Camellia support in libgcrypt])
456   if test -n "`$LIBGCRYPT_CONFIG --algorithms | grep -i camellia`"; then
457     AC_MSG_RESULT([yes])
458     ac_enable_camellia=yes
459   else
460     AC_MSG_RESULT([no])
461     ac_enable_camellia=no
462   fi
464 AC_MSG_CHECKING([whether to disable Camellia cipher])
465 if test "$ac_enable_camellia" = "yes"; then
466  AC_MSG_RESULT([no])
467  AC_DEFINE(ENABLE_CAMELLIA, 1, [enable camellia block cipher])
468 else
469  AC_MSG_RESULT([yes])
472 AC_MSG_CHECKING([whether to disable extra PKI stuff])
473 AC_ARG_ENABLE(extra-pki,
474         AS_HELP_STRING([--disable-extra-pki],
475                 [only enable the basic PKI stuff]),
476         enable_pki=$enableval, enable_pki=yes)
477 if test "$enable_pki" != "yes"; then
478  ac_full=0
479  AC_MSG_RESULT(yes)
480 else
481  AC_MSG_RESULT(no)
482  AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS/PKI stuff])
484 AM_CONDITIONAL(ENABLE_PKI, test "$enable_pki" = "yes")
486 ac_enable_openpgp=yes
487 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
488 AC_ARG_ENABLE(openpgp-authentication,
489         AS_HELP_STRING([--disable-openpgp-authentication],
490                 [disable the OpenPGP authentication support]),
491         ac_enable_openpgp=no)
492 if test x$ac_enable_openpgp = xno; then
493  AC_MSG_RESULT(yes)
494  ac_full=0
495 else
496  AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication])
497  AC_MSG_RESULT(no)
499 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
501 AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer])
502 AC_ARG_ENABLE(openssl-compatibility,
503         AS_HELP_STRING([--disable-openssl-compatibility],
504                 [disable the OpenSSL compatibility support]),
505         ac_enable_openssl=$withval,
506         ac_enable_openssl=yes)
507 if test x$ac_enable_openssl != xno; then
508  AC_MSG_RESULT(no)
509 else
510  AC_MSG_RESULT(yes)
513 AM_CONDITIONAL(ENABLE_OPENSSL, test "$ac_enable_openssl" = "yes")
516 AC_ARG_WITH(included-libtasn1,
517         AS_HELP_STRING([--with-included-libtasn1],
518                 [use the included libtasn1]),
519         minitasn1_enabled=$withval,
520         minitasn1_enabled=no)
522 if test x$minitasn1_enabled = xno; then
523 AM_PATH_LIBTASN1($GNUTLS_LIBTASN1_VERSION,,
524  minitasn1_enabled=yes
525  AC_MSG_WARN([[
526 *** 
527 *** LibtASN1 ${GNUTLS_LIBTASN1_VERSION} was not found. Will use the included one.
528 ]]))
531 AC_MSG_CHECKING([whether to use the included minitasn1])
532 AC_MSG_RESULT($minitasn1_enabled)
534 AM_CONDITIONAL(ENABLE_MINITASN1, test "$minitasn1_enabled" = "yes")
536 if test "$ac_full" != 1; then
537  AC_MSG_WARN([[
538 *** 
539 *** C++ library disabled because some parts of GnuTLS has been disabled.
541   use_cxx=no
543 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
544 AC_MSG_CHECKING([whether to build C++ library])
545 AC_MSG_RESULT($use_cxx)
547 dnl Check for libcfg+
549 SAVED_LIBS=$LIBS
550 AC_ARG_WITH(included-libcfg,
551         AS_HELP_STRING([--with-included-libcfg],
552                 [use the included libcfg+ (certtool only)]),
553         libcfg_enabled=$withval, 
554         libcfg_enabled=no
555 dnl We search for libcfg+ which is used by certtool
557         AC_CHECK_LIB(cfg+, cfg_get_context,:,
558                      libcfg_enabled=yes
559                      AC_MSG_WARN([[
560 *** 
561 *** Libcfg+ was not found. Will use the included one.]])))
563 AM_CONDITIONAL(HAVE_LIBCFG, test "$libcfg_enabled" = "no")
564 LIBS=$SAVED_LIBS
566 AC_MSG_CHECKING([whether to use the included libcfg])
567 AC_MSG_RESULT($libcfg_enabled)
570 dnl CHECK FOR ZLIB SUPPORT
573 AC_MSG_CHECKING([whether to include zlib compression support])
575 AC_ARG_WITH(zlib,
576         AS_HELP_STRING([--without-zlib], [disable zlib compression support]),
577         ac_zlib=$withval,
578         ac_zlib=yes)
580 if test x$ac_zlib != xno; then
581  AC_MSG_RESULT(yes)
582  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
583  if test "$ac_cv_libz" != yes; then
584    AC_MSG_WARN(
585 *** 
586 *** ZLIB was not found. You will not be able to use ZLIB compression.)
587  fi
588 else
589  AC_MSG_RESULT(no)
593 dnl CHECK FOR LZO SUPPORT
596 AC_ARG_WITH(lzo,
597         AS_HELP_STRING([--with-lzo], [use experimental LZO compression]),
598         use_lzo=$withval,
599         use_lzo=no)
600 AC_MSG_CHECKING([whether to include LZO compression support])
601 AC_MSG_RESULT($use_lzo)
603 LZO_LIBS=
604 if test "$use_lzo" = "yes"; then
605   AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2)
606   if test "$LZO_LIBS" = ""; then
607     AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [
608       use_lzo=no
609       AC_MSG_WARN(
611 *** Could not find liblzo or liblzo2.  Disabling LZO compression.
613       ])
614   fi
616 AC_SUBST(LZO_LIBS)
618 if test "$use_lzo" = "yes"; then
619   AC_DEFINE(USE_LZO, 1, [whether to use the LZO compression])
620   if test "$LZO_LIBS" = "-llzo"; then
621     AC_CHECK_HEADERS(lzo1x.h)
622   elif test "$LZO_LIBS" = "-llzo2"; then
623     AC_CHECK_HEADERS(lzo/lzo1x.h)
624   fi
627 AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes")
629 # Windows hacks.
631 AC_DEFINE([WINVER], [0x0501], [Windows 2000 or before not supported.])
632 save_LIBS="$LIBS"
633 LIBS="$LIBS -lws2_32"
634 AC_TRY_LINK([#include <winsock2.h>], [
635   WORD wVersionRequested = MAKEWORD(2, 2);
636   WSADATA wsaData;
637   int err = WSAStartup(wVersionRequested, &wsaData);
638   WSACleanup ();], wsastartup=yes, wsastartup=no)
639 LIBS="$save_LIBS"
640 if test "$wsastartup" = "yes"; then
641   AC_DEFINE(HAVE_WINSOCK, 1, [Call WSAStartup in gnutls_global_init])
643 AM_CONDITIONAL(NEED_WS2_32, test "$wsastartup" = "yes")
644 AC_MSG_CHECKING([if we have Windows and WSAStartup/WSACleanup in -lws2_32])
645 AC_MSG_RESULT($wsastartup)
647 dnl Gnulib files
650 AC_MSG_RESULT([***
651 *** Setting up gnulib compatibility files...
653 gl_INIT
654 lgl_INIT
655 xgl_INIT
657 AC_MSG_RESULT([***
658 *** Detecting options for shared libraries...
660 AC_LIBTOOL_WIN32_DLL
661 AC_PROG_LIBTOOL
663 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS"
664 LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}"
665 AC_SUBST(LIBGNUTLS_LIBS)
666 AC_SUBST(LIBGNUTLS_CFLAGS)
668 LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LZO_LIBS $LIBGNUTLS_LIBS"
669 LIBGNUTLS_EXTRA_CFLAGS="-I${includedir}"
670 AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
671 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
672 export ac_full
674 AM_CFLAGS="${AM_CFLAGS} ${LIBGCRYPT_CFLAGS}"
676 if test $ac_full -eq 0; then
677   AC_SUBST(POSSIBLY_WARN_ABOUT_MISSING_FEATURES, [[
678 #ifdef __GNUC__
679 #warning This is not the official GnuTLS library. Several features were disabled at compilation.
680 #endif /* __GNUC__ */]])
683 AC_SUBST(AM_CFLAGS)
685 AC_CONFIG_COMMANDS([chmod-config],[[
686  chmod +x lib/libgnutls-config
687  chmod +x libextra/libgnutls-extra-config
688 ]],[[]])
691 AC_DEFINE([INTERNAL_GNUTLS_CRYPTO_H_ENABLE_UNSUPPORTED_API], 1,
692           [Enable prototypes in includes/crypto.h.])
694 AC_CONFIG_FILES([Makefile po/Makefile.in \
695         doc/Makefile doc/examples/Makefile doc/scripts/Makefile \
696         doc/manpages/Makefile doc/reference/Makefile doc/doxygen/Doxyfile \
697         doc/credentials/Makefile doc/credentials/x509/Makefile \
698         doc/credentials/srp/Makefile doc/credentials/openpgp/Makefile \
699         gl/Makefile lgl/Makefile \
700         tests/Makefile tests/rsa-md5-collision/Makefile tests/userid/Makefile \
701         tests/pkcs1-padding/Makefile tests/pkcs8-decode/Makefile \
702         tests/pkcs12-decode/Makefile tests/pathlen/Makefile \
703         tests/key-id/Makefile tests/sha2/Makefile \
704         tests/hostname-check/Makefile \
705         includes/Makefile includes/gnutls/gnutls.h \
706         lib/Makefile lib/minitasn1/Makefile lib/x509/Makefile \
707         libextra/Makefile libextra/gl/Makefile \
708         lib/openpgp/Makefile lib/opencdk/Makefile \
709         tests/openpgp/Makefile tests/openpgp-certs/Makefile \
710         src/Makefile \
711         src/cfg/Makefile src/cfg/platon/Makefile src/cfg/platon/str/Makefile \
712         lib/libgnutls-config libextra/libgnutls-extra-config \
713         lib/gnutls.pc libextra/gnutls-extra.pc
714         guile/Makefile guile/modules/Makefile
715         guile/src/Makefile guile/tests/Makefile])
717 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
720 AC_OUTPUT