Revert ABI version, make libgnutls-extra use another ABI version.
[gnutls.git] / configure.in
blob0adc81659b5640b4f214b8519f468d8ee257fbc5
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.12], [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, 6)
41 AC_SUBST(LT_AGE, 3)
42 AC_SUBST(EXTRA_LT_CURRENT, 27)
43 AC_SUBST(EXTRA_LT_REVISION, 0)
44 AC_SUBST(EXTRA_LT_AGE, 0)
45 ac_full=1
47 # Used when creating the Windows libgnutls-XX.def files.
48 SOVERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
49 AC_SUBST(SOVERSION)
50 EXTRA_SOVERSION=`expr ${EXTRA_LT_CURRENT} - ${EXTRA_LT_AGE}`
51 AC_SUBST(EXTRA_SOVERSION)
53 GNUTLS_GCRYPT_VERSION=1:1.2.4
54 GNUTLS_LIBTASN1_VERSION=0.3.4
55 AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gcrypt])
56 AC_DEFINE_UNQUOTED(GNUTLS_LIBTASN1_VERSION, "$GNUTLS_LIBTASN1_VERSION", [version of libtasn1])
58 # Compute numeric versions, used in includes/gnutls/gnutls.h.in.
59 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
60 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
61 AC_SUBST(PATCH_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`)
62 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
64 opt_dmalloc_mode=no
65 AC_MSG_CHECKING([whether in dmalloc mode])
66 AC_ARG_ENABLE(dmalloc-mode,
67         AS_HELP_STRING([--enable-dmalloc-mode], [enable dmalloc mode]),
68         opt_dmalloc_mode=$enableval)
69 AC_MSG_RESULT($opt_dmalloc_mode)
71 opt_efence_mode=no
72 AC_MSG_CHECKING([whether in electric fence mode])
73 AC_ARG_ENABLE(efence-mode,
74         AS_HELP_STRING([--enable-efence-mode], [enable electric fence mode]),
75 opt_efence_mode=$enableval)
76 AC_MSG_RESULT($opt_efence_mode)
78 opt_developer_mode=no
79 AC_MSG_CHECKING([whether in developer mode])
80 AC_ARG_ENABLE(developer-mode,
81         AS_HELP_STRING([--enable-developer-mode], [enable developer mode]),
82 opt_developer_mode=$enableval)
83 AC_MSG_RESULT($opt_developer_mode)
85 AC_MSG_RESULT([***
86 *** Checking for compilation programs...
89 dnl Checks for programs.
90 AC_PROG_CC
91 AC_PROG_CXX
92 AC_PROG_LN_S
93 GTK_DOC_CHECK(1.1)
94 AC_PATH_PROG([GAA], [gaa])
95 if test "x$GAA" = "x"; then
96    AC_MSG_WARN([[***
97 *** GAA was not found.  It is only needed if you wish to modify
98 *** the source code or command-line description files.  In this case,
99 *** you may want to get it from http://gaa.sourceforge.net/
100 ***]])
102 AM_CONDITIONAL(HAVE_GCC,   test "x$GCC" = "xyes")
105 AC_MSG_RESULT([***
106 *** Detecting compiler options...
109 gl_EARLY
110 lgl_EARLY
111 AC_C_CONST
112 AC_C_INLINE
114 AM_GNU_GETTEXT([external])
115 AM_GNU_GETTEXT_VERSION([0.17])
117 AC_ARG_ENABLE(cxx,
118        AS_HELP_STRING([--disable-cxx],
119                [unconditionally disable the C++ library]),
120        use_cxx=$enableval, use_cxx=yes)
121 if test "$use_cxx" != "no"; then
122   AC_LANG_PUSH(C++)
123   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
124   AC_LANG_POP(C++)
126 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
127 AC_MSG_CHECKING([whether to build C++ library])
128 AC_MSG_RESULT($use_cxx)
130 AC_MSG_CHECKING([whether C99 macros are supported])
131 AC_TRY_COMPILE(,[ 
132 #define test_mac(...) 
133 int z,y,x;
134 test_mac(x,y,z);
135 return 0;
136 ], 
137         dnl ***** OK
138         AC_DEFINE(C99_MACROS, 1, [C99 macros are supported])
139         AC_MSG_RESULT(yes),
140         dnl ***** NOT FOUND
141         AC_MSG_RESULT(no)
142         AC_MSG_WARN([C99 macros not supported. This may affect compiling.]))
144 if test $ac_cv_c_compiler_gnu != no; then
145         if test x$opt_developer_mode = xyes; then
146           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"
147 #         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"
148         fi
150         AC_MSG_CHECKING([whether gcc supports -Wno-pointer-sign])
151         _gcc_cflags_save=$CFLAGS
152         CFLAGS="${CFLAGS} -Wno-pointer-sign"
153         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
154         AC_MSG_RESULT($_gcc_psign)
155         if test x"$_gcc_psign" != xyes ; then
156           CFLAGS=$_gcc_cflags_save;
157         fi
159         AC_MSG_CHECKING([whether gcc supports -fgnu89-inline])
160         _gcc_cflags_save="$CFLAGS"
161         CFLAGS="${CFLAGS} -fgnu89-inline"
162         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
163           _gcc_gnu89_inline=yes, _gcc_gnu89_inline=no)
164         AC_MSG_RESULT($_gcc_gnu89_inline)
165         CFLAGS=$_gcc_cflags_save;
167         AC_MSG_CHECKING([if gcc/ld supports -Wl,--output-def])
168         if test "$enable_shared" = no; then
169           output_def=no
170           AC_MSG_RESULT([no need, since shared libraries are disabled])
171         else
172           _gcc_ldflags_save=$LDFLAGS
173           LDFLAGS="-Wl,--output-def,foo.def"
174           AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
175           AC_MSG_RESULT($output_def)
176           LDFLAGS="$_gcc_ldflags_save"
177         fi
179         if test x$opt_dmalloc_mode = xyes; then
180           AC_CHECK_LIB(dmalloc, main)
181           AC_DEFINE(USE_DMALLOC, 1, [enable the use of dmalloc])
182         else
183                 if test x$opt_efence_mode = xyes; then
184                   AC_CHECK_LIB(efence, main)
185                   AC_DEFINE(USE_EFENCE, 1, [use electric fence])
186                 fi
187         fi
189         AC_MSG_CHECKING([whether we have GNU assembler])
190         GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
191         if test "$GAS"; then
192           AM_CFLAGS="${AM_CFLAGS} -pipe"
193           AC_MSG_RESULT(yes)
194         else
195           AC_MSG_RESULT(no)
196         fi
199 # Needs to be called outside of 'if' clause.
200 AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, test "$output_def" = "yes")
201 AM_CONDITIONAL([HAVE_GCC_GNU89_INLINE_OPTION],
202                [test "$_gcc_gnu89_inline" = "yes"])
204 AC_MSG_RESULT([***
205 *** Detecting C library capabilities...
208 AC_HEADER_STDC
209 AC_CHECK_HEADERS(netdb.h)
210 AC_CHECK_FUNCS(fork,,)
211 AC_DEFINE([HAVE_STRINGS_H], 1, [Hard-code for src/cfg/.])
212 AC_DEFINE([HAVE_FLOAT_H], 1, [Hard-code for src/cfg/.])
213 AC_DEFINE([HAVE_LIMITS_H], 1, [Hard-code for src/cfg/.])
214 AC_DEFINE([HAVE_MATH_H], 1, [Hard-code for src/cfg/.])
215 AC_DEFINE([HAVE_CTYPE_H], 1, [Hard-code for src/cfg/.])
216 AC_DEFINE([HAVE_ERRNO_H], 1, [Hard-code for src/cfg/.])
218 # No fork on MinGW, disable some self-tests until we fix them.
219 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
221 AC_MSG_RESULT([***
222 *** Detecting system's parameters...
225 # Run self-tests under valgrind?
226 if test "$cross_compiling" = no; then
227   AC_CHECK_PROGS(VALGRIND, valgrind)
229 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
230   opt_valgrind_tests=yes
231 else
232   opt_valgrind_tests=no
233   VALGRIND=
234 fi 
235 AC_MSG_CHECKING([whether self tests are run under valgrind])
236 AC_ARG_ENABLE(valgrind-tests,
237         AS_HELP_STRING([--enable-valgrind-tests],
238                        [run self tests under valgrind]),
239   opt_valgrind_tests=$enableval)
240 AC_MSG_RESULT($opt_valgrind_tests)
242 # For minitasn1.
243 AC_CHECK_SIZEOF(unsigned long int, 4)
244 AC_CHECK_SIZEOF(unsigned int, 4)
246 # For storing integers in pointers without warnings
247 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
248 AC_CHECK_SIZEOF(void *)
249 AC_CHECK_SIZEOF(long)
250 AC_CHECK_SIZEOF(int)
251 case $ac_cv_sizeof_void_p in
252   $ac_cv_sizeof_long)
253     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [(long)],
254               [Additional cast to bring void* to a type castable to int.])
255     ;;
256   *)
257     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [])
258     ;;
259 esac
261 # For some systems we know that we have ld_version scripts.
262 # Use it then as default.
263 have_ld_version_script=no
264 case "${host}" in
265     *-*-linux*)
266         have_ld_version_script=yes
267         ;;
268     *-*-gnu*)
269         have_ld_version_script=yes
270         ;;
271 esac
272 AC_ARG_ENABLE([ld-version-script],
273               AC_HELP_STRING([--enable-ld-version-script],
274                              [enable/disable use of linker version script.
275                               (default is system dependent)]),
276               [have_ld_version_script=$enableval],
277               [ : ] )
278 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
280 AC_CHECK_TYPES(uint,,, [
281 # include <sys/types.h>
284 # Check for and replace ssize_t.
285 AC_CHECK_TYPE(ssize_t,
286         [DEFINE_SSIZE_T="#include <sys/types.h>"
287         AC_SUBST(DEFINE_SSIZE_T)],
288         [AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found])
289         DEFINE_SSIZE_T="typedef int ssize_t;"
290         AC_SUBST(DEFINE_SSIZE_T)],
291         [#include <sys/types.h>])
293 AC_C_BIGENDIAN
295 AC_MSG_RESULT([***
296 *** Checking for external libraries...
299 # For Guile bindings.
301 opt_guile_bindings=yes
302 AC_MSG_CHECKING([whether building Guile bindings])
303 AC_ARG_ENABLE(guile,
304         AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
305 opt_guile_bindings=$enableval)
306 AC_MSG_RESULT($opt_guile_bindings)
308 AC_ARG_WITH([--with-guile-site-dir],
309   [AS_HELP_STRING([--with-guile-site-dir],
310      [use the given directory as the Guile site (use with care)])])
312 if test "x$opt_guile_bindings" = "xyes"; then
313    AC_MSG_RESULT([***
314 *** Detecting GNU Guile...
317    AC_PATH_PROG([guile_snarf], [guile-snarf])
318    if test "x$guile_snarf" = "x"; then
319       AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found.  Guile bindings not built.])
320       opt_guile_bindings=no
321    else
322       GUILE_PROGS
323       GUILE_FLAGS
325       save_CFLAGS="$CFLAGS"
326       save_LIBS="$LIBS"
327       CFLAGS="$CFLAGS $GUILE_CFLAGS"
328       LIBS="$LIBS $GUILE_LDFLAGS"
329       AC_MSG_CHECKING([whether GNU Guile is recent enough])
330       AC_LINK_IFELSE(AC_LANG_CALL([], [scm_from_locale_string]),
331         [], [opt_guile_bindings=no])
332       CFLAGS="$save_CFLAGS"
333       LIBS="$save_LIBS"
335       if test "x$opt_guile_bindings" = "xyes"; then
336         AC_MSG_RESULT([yes])
337         case "x$with_guile_site_dir" in 
338              xno)
339                 # Use the default $(GUILE_SITE).
340                 GUILE_SITE_DIR
341                 ;;
342              x|xyes)
343                 # Automatically derive $(GUILE_SITE) from $(pkgdatadir).  This
344                 # hack is used to allow `distcheck' to work (see
345                 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
346                 GUILE_SITE="\$(datadir)/guile/site"
347                 AC_SUBST(GUILE_SITE)
348                 ;;
349              *)
350                 # Use the user-specified directory as $(GUILE_SITE).
351                 GUILE_SITE="$with_guile_site_dir"
352                 AC_SUBST(GUILE_SITE)
353                 ;;
354         esac
355       else
356         AC_MSG_RESULT([no])
357         AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
358         opt_guile_bindings=no
359       fi
360    fi
362 AM_CONDITIONAL(HAVE_GUILE, test "x$opt_guile_bindings" = "xyes")
364 AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,,
365 dnl Can't disable - gnutls depends on gcrypt
366         AC_MSG_ERROR([[
367 ***  
368 *** libgcrypt was not found. You may want to get it from
369 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
371 ]]))
372 libgcrypt=yes
374 # Hard-wire the gl/m4/gc.m4 test.
375 AC_ARG_WITH(builtin-crypto,
376         AS_HELP_STRING([--with-builtin-crypto],
377                 [use internal crypto instead of libgcrypt (EXPERIMENTAL)]),
378         ac_cv_libgcrypt=no,
379         ac_cv_libgcrypt=yes)
380 LTLIBGCRYPT=$LIBGCRYPT_LIBS
382 AC_MSG_CHECKING([whether to enable Opaque PRF input support])
383 AC_ARG_ENABLE(opaque-prf-input,
384         AS_HELP_STRING([--enable-opaque-prf-input=DD],
385                 [enable Opaque PRF input using DD as extension type]),
386         ac_opaque_prf_input=$enableval, ac_opaque_prf_input=no)
387 if test "$ac_opaque_prf_input" != "no"; then
388   if ! echo $ac_opaque_prf_input | egrep -q '^[[0-9]]+$'; then
389     ac_opaque_prf_input=no
390     AC_MSG_WARN([[
391 *** Could not parse Opaque PRF Input extension type.
392 *** Use --enable-opaque-prf-input=XX where XX is decimal, for example
393 *** to use extension value 42 use --enable-opqaue-prf-input=42]])
394   fi
396 if test "$ac_opaque_prf_input" != "no"; then
397  AC_MSG_RESULT([yes (extension value $ac_opaque_prf_input)])
398  AC_DEFINE_UNQUOTED(ENABLE_OPRFI, $ac_opaque_prf_input,
399                     [enable Opaque PRF Input])
400 else
401  AC_MSG_RESULT(no)
403 AM_CONDITIONAL(ENABLE_OPRFI, test "$ac_opaque_prf_input" != "no")
405 AC_MSG_CHECKING([whether to disable SRP authentication support])
406 AC_ARG_ENABLE(srp-authentication,
407         AS_HELP_STRING([--disable-srp-authentication],
408                 [disable the SRP authentication support]),
409         ac_enable_srp=no)
410 if test x$ac_enable_srp != xno; then
411  AC_MSG_RESULT(no)
412  AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication])
413 else
414  ac_full=0
415  AC_MSG_RESULT(yes)
417 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
419 AC_MSG_CHECKING([whether to disable PSK authentication support])
420 AC_ARG_ENABLE(psk-authentication,
421        AS_HELP_STRING([--disable-psk-authentication],
422                [disable the PSK authentication support]),
423        ac_enable_psk=no)
424 if test x$ac_enable_psk != xno; then
425  AC_MSG_RESULT(no)
426  AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication])
427 else
428  ac_full=0
429  AC_MSG_RESULT(yes)
432 AC_MSG_CHECKING([whether to disable anonymous authentication support])
433 AC_ARG_ENABLE(anon-authentication,
434         AS_HELP_STRING([--disable-anon-authentication],
435                 [disable the anonymous authentication support]),
436         ac_enable_anon=no)
437 if test x$ac_enable_anon != xno; then
438  AC_MSG_RESULT(no)
439  AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication])
440 else
441  ac_full=0
442  AC_MSG_RESULT(yes)
444 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
446 dnl Check for Camellia support
448 AC_ARG_ENABLE(camellia,
449         AS_HELP_STRING([--disable-camellia], [disable Camellia cipher]),
450         ac_enable_camellia=no)
451 if test "$ac_enable_camellia" != "no"; then
452   AC_MSG_CHECKING([for Camellia support in libgcrypt])
453   if test -n "`$LIBGCRYPT_CONFIG --algorithms | grep -i camellia`"; then
454     AC_MSG_RESULT([yes])
455     ac_enable_camellia=yes
456   else
457     AC_MSG_RESULT([no])
458     ac_enable_camellia=no
459   fi
461 AC_MSG_CHECKING([whether to disable Camellia cipher])
462 if test "$ac_enable_camellia" = "yes"; then
463  AC_MSG_RESULT([no])
464  AC_DEFINE(ENABLE_CAMELLIA, 1, [enable camellia block cipher])
465 else
466  AC_MSG_RESULT([yes])
469 AC_MSG_CHECKING([whether to disable extra PKI stuff])
470 AC_ARG_ENABLE(extra-pki,
471         AS_HELP_STRING([--disable-extra-pki],
472                 [only enable the basic PKI stuff]),
473         disable_pki=$enableval, disable_pki=no)
474 if test "$disable_pki" != "no"; then
475  ac_full=0
476  AC_MSG_RESULT(yes)
477 else
478  AC_MSG_RESULT(no)
479  AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS/PKI stuff])
481 AM_CONDITIONAL(ENABLE_PKI, test "$disable_pki" = "no")
483 ac_enable_openpgp=yes
484 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
485 AC_ARG_ENABLE(openpgp-authentication,
486         AS_HELP_STRING([--disable-openpgp-authentication],
487                 [disable the OpenPGP authentication support]),
488         ac_enable_openpgp=no)
489 if test x$ac_enable_openpgp = xno; then
490  AC_MSG_RESULT(yes)
491  ac_full=0
492 else
493  AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication])
494  AC_MSG_RESULT(no)
496 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
498 AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer])
499 AC_ARG_ENABLE(openssl-compatibility,
500         AS_HELP_STRING([--disable-openssl-compatibility],
501                 [disable the OpenSSL compatibility support]),
502         ac_enable_openssl=$withval,
503         ac_enable_openssl=yes)
504 if test x$ac_enable_openssl != xno; then
505  AC_MSG_RESULT(no)
506 else
507  AC_MSG_RESULT(yes)
510 AM_CONDITIONAL(ENABLE_OPENSSL, test "$ac_enable_openssl" = "yes")
513 AC_ARG_WITH(included-libtasn1,
514         AS_HELP_STRING([--with-included-libtasn1],
515                 [use the included libtasn1]),
516         minitasn1_enabled=$withval,
517         minitasn1_enabled=no)
519 if test x$minitasn1_enabled = xno; then
520 AM_PATH_LIBTASN1($GNUTLS_LIBTASN1_VERSION,,
521  minitasn1_enabled=yes
522  AC_MSG_WARN([[
523 *** 
524 *** LibtASN1 ${GNUTLS_LIBTASN1_VERSION} was not found. Will use the included one.
525 ]]))
528 AC_MSG_CHECKING([whether to use the included minitasn1])
529 AC_MSG_RESULT($minitasn1_enabled)
531 AM_CONDITIONAL(ENABLE_MINITASN1, test "$minitasn1_enabled" = "yes")
533 dnl Check for libcfg+
535 SAVED_LIBS=$LIBS
536 AC_ARG_WITH(included-libcfg,
537         AS_HELP_STRING([--with-included-libcfg],
538                 [use the included libcfg+ (certtool only)]),
539         libcfg_enabled=$withval, 
540         libcfg_enabled=no
541 dnl We search for libcfg+ which is used by certtool
543         AC_CHECK_LIB(cfg+, cfg_get_context,:,
544                      libcfg_enabled=yes
545                      AC_MSG_WARN([[
546 *** 
547 *** Libcfg+ was not found. Will use the included one.]])))
549 AM_CONDITIONAL(HAVE_LIBCFG, test "$libcfg_enabled" = "no")
550 LIBS=$SAVED_LIBS
552 AC_MSG_CHECKING([whether to use the included libcfg])
553 AC_MSG_RESULT($libcfg_enabled)
556 dnl CHECK FOR ZLIB SUPPORT
559 AC_MSG_CHECKING([whether to include zlib compression support])
561 AC_ARG_WITH(zlib,
562         AS_HELP_STRING([--without-zlib], [disable zlib compression support]),
563         ac_zlib=$withval,
564         ac_zlib=yes)
566 if test x$ac_zlib != xno; then
567  AC_MSG_RESULT(yes)
568  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
569  if test "$ac_cv_libz" != yes; then
570    AC_MSG_WARN(
571 *** 
572 *** ZLIB was not found. You will not be able to use ZLIB compression.)
573  fi
574 else
575  AC_MSG_RESULT(no)
579 dnl CHECK FOR LZO SUPPORT
582 AC_ARG_WITH(lzo,
583         AS_HELP_STRING([--with-lzo], [use experimental LZO compression]),
584         use_lzo=$withval,
585         use_lzo=no)
586 AC_MSG_CHECKING([whether to include LZO compression support])
587 AC_MSG_RESULT($use_lzo)
589 LZO_LIBS=
590 if test "$use_lzo" = "yes"; then
591   AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2)
592   if test "$LZO_LIBS" = ""; then
593     AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [
594       use_lzo=no
595       AC_MSG_WARN(
597 *** Could not find liblzo or liblzo2.  Disabling LZO compression.
599       ])
600   fi
602 AC_SUBST(LZO_LIBS)
604 if test "$use_lzo" = "yes"; then
605   AC_DEFINE(USE_LZO, 1, [whether to use the LZO compression])
606   if test "$LZO_LIBS" = "-llzo"; then
607     AC_CHECK_HEADERS(lzo1x.h)
608   elif test "$LZO_LIBS" = "-llzo2"; then
609     AC_CHECK_HEADERS(lzo/lzo1x.h)
610   fi
613 AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes")
615 # Windows hacks.
617 AC_DEFINE([WINVER], [0x0501], [Windows 2000 or before not supported.])
618 save_LIBS="$LIBS"
619 LIBS="$LIBS -lws2_32"
620 AC_TRY_LINK([#include <winsock2.h>], [
621   WORD wVersionRequested = MAKEWORD(2, 2);
622   WSADATA wsaData;
623   int err = WSAStartup(wVersionRequested, &wsaData);
624   WSACleanup ();], wsastartup=yes, wsastartup=no)
625 LIBS="$save_LIBS"
626 if test "$wsastartup" = "yes"; then
627   AC_DEFINE(HAVE_WINSOCK, 1, [Call WSAStartup in gnutls_global_init])
629 AM_CONDITIONAL(NEED_WS2_32, test "$wsastartup" = "yes")
630 AC_MSG_CHECKING([if we have Windows and WSAStartup/WSACleanup in -lws2_32])
631 AC_MSG_RESULT($wsastartup)
633 dnl Gnulib files
636 AC_MSG_RESULT([***
637 *** Setting up gnulib compatibility files...
639 gl_INIT
640 lgl_INIT
642 AC_MSG_RESULT([***
643 *** Detecting options for shared libraries...
645 AC_LIBTOOL_WIN32_DLL
646 AC_PROG_LIBTOOL
648 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS"
649 LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}"
650 AC_SUBST(LIBGNUTLS_LIBS)
651 AC_SUBST(LIBGNUTLS_CFLAGS)
653 LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LZO_LIBS $LIBGNUTLS_LIBS"
654 LIBGNUTLS_EXTRA_CFLAGS="-I${includedir}"
655 AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
656 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
657 export ac_full
659 AM_CFLAGS="${AM_CFLAGS} ${LIBGCRYPT_CFLAGS}"
661 if test $ac_full -eq 0; then
662   AC_SUBST(POSSIBLY_WARN_ABOUT_MISSING_FEATURES, [[
663 #ifdef __GNUC__
664 #warning This is not the official GnuTLS library. Several features were disabled at compilation.
665 #endif /* __GNUC__ */]])
668 AC_SUBST(AM_CFLAGS)
670 AC_CONFIG_COMMANDS([chmod-config],[[
671  chmod +x lib/libgnutls-config
672  chmod +x libextra/libgnutls-extra-config
673 ]],[[]])
676 AC_DEFINE([INTERNAL_GNUTLS_CRYPTO_H_ENABLE_UNSUPPORTED_API], 1,
677           [Enable prototypes in includes/crypto.h.])
679 AC_CONFIG_FILES([Makefile po/Makefile.in \
680         doc/Makefile doc/examples/Makefile doc/scripts/Makefile \
681         doc/manpages/Makefile doc/reference/Makefile \
682         doc/credentials/Makefile doc/credentials/x509/Makefile \
683         doc/credentials/srp/Makefile doc/credentials/openpgp/Makefile \
684         gl/Makefile lgl/Makefile \
685         tests/Makefile tests/rsa-md5-collision/Makefile tests/userid/Makefile \
686         tests/pkcs1-padding/Makefile tests/pkcs8-decode/Makefile \
687         tests/pkcs12-decode/Makefile tests/pathlen/Makefile \
688         tests/key-id/Makefile tests/sha2/Makefile \
689         tests/hostname-check/Makefile \
690         includes/Makefile includes/gnutls/gnutls.h \
691         lib/Makefile lib/minitasn1/Makefile lib/x509/Makefile \
692         libextra/Makefile lib/openpgp/Makefile lib/opencdk/Makefile \
693         tests/openpgp/Makefile \
694         src/Makefile \
695         src/cfg/Makefile src/cfg/platon/Makefile src/cfg/platon/str/Makefile \
696         lib/libgnutls-config libextra/libgnutls-extra-config \
697         lib/gnutls.pc libextra/gnutls-extra.pc
698         guile/Makefile guile/modules/Makefile
699         guile/src/Makefile guile/tests/Makefile])
701 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
704 AC_OUTPUT