Fix dangling/unused bindings in `(gnutls)'.
[gnutls.git] / configure.in
blob1da545d92e86f52b5475d56a32a9b44dfe7e705a
1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
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.0], [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, 27)
40 AC_SUBST(LT_REVISION, 0)
41 AC_SUBST(LT_AGE, 1)
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 dnl In order to use the reentrant libc functions.
122 dnl I hope it is portable enough.
123 CFLAGS="${CFLAGS} -D_REENTRANT -D_THREAD_SAFE"
124 AM_CFLAGS="${CFLAGS}"
126 AC_ARG_ENABLE(cxx,
127        AS_HELP_STRING([--disable-cxx],
128                [unconditionally disable the C++ library]),
129        use_cxx=$enableval, use_cxx=yes)
130 if test "$use_cxx" != "no"; then
131   AC_LANG_PUSH(C++)
132   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], use_cxx=yes, use_cxx=no)
133   AC_LANG_POP(C++)
135 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
136 AC_MSG_CHECKING([whether to build C++ library])
137 AC_MSG_RESULT($use_cxx)
139 AC_MSG_CHECKING([whether C99 macros are supported])
140 AC_TRY_COMPILE(,[ 
141 #define test_mac(...) 
142 int z,y,x;
143 test_mac(x,y,z);
144 return 0;
145 ], 
146         dnl ***** OK
147         AC_DEFINE(C99_MACROS, 1, [C99 macros are supported])
148         AC_MSG_RESULT(yes),
149         dnl ***** NOT FOUND
150         AC_MSG_RESULT(no)
151         AC_MSG_WARN([C99 macros not supported. This may affect compiling.]))
153 if test $ac_cv_c_compiler_gnu != no; then
154         if test x$opt_developer_mode = xyes; then
155           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"
156 #         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"
157         fi
159         AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
160         _gcc_cflags_save=$CFLAGS
161         CFLAGS="${CFLAGS} -Wno-pointer-sign"
162         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
163         AC_MSG_RESULT($_gcc_psign)
164         if test x"$_gcc_psign" != xyes ; then
165           CFLAGS=$_gcc_cflags_save;
166         fi
168         AC_MSG_CHECKING([if gcc/ld supports -Wl,--output-def])
169         _gcc_ldflags_save=$LDFLAGS
170         LDFLAGS="-Wl,--output-def,foo.def"
171         AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
172         AC_MSG_RESULT($output_def)
173         LDFLAGS="$_gcc_ldflags_save"
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 dnl opencdk
207 AC_CHECK_HEADERS(netdb.h)
208 AC_CHECK_FUNCS(umask vasprintf isascii fork,,)
209 AC_FUNC_ALLOCA
211 # No fork on MinGW, disable some self-tests until we fix them.
212 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
214 AC_MSG_RESULT([***
215 *** Detecting system's parameters...
218 # Run self-tests under valgrind?
219 if test "$cross_compiling" = no; then
220   AC_CHECK_PROGS(VALGRIND, valgrind)
222 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
223   opt_valgrind_tests=yes
224 else
225   opt_valgrind_tests=no
226   VALGRIND=
227 fi 
228 AC_MSG_CHECKING([whether self tests are run under valgrind])
229 AC_ARG_ENABLE(valgrind-tests,
230         AS_HELP_STRING([--enable-valgrind-tests],
231                        [run self tests under valgrind]),
232   opt_valgrind_tests=$enableval)
233 AC_MSG_RESULT($opt_valgrind_tests)
235 # For minitasn1.
236 AC_CHECK_SIZEOF(unsigned long, 4)
237 AC_CHECK_SIZEOF(unsigned int, 4)
239 # For storing integers in pointers without warnings
240 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
241 AC_CHECK_SIZEOF(void *)
242 AC_CHECK_SIZEOF(long)
243 AC_CHECK_SIZEOF(int)
244 case $ac_cv_sizeof_void_p in
245   $ac_cv_sizeof_long)
246     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [(long)],
247               [Additional cast to bring void* to a type castable to int.])
248     ;;
249   *)
250     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [])
251     ;;
252 esac
254 # For some systems we know that we have ld_version scripts.
255 # Use it then as default.
256 have_ld_version_script=no
257 case "${host}" in
258     *-*-linux*)
259         have_ld_version_script=yes
260         ;;
261     *-*-gnu*)
262         have_ld_version_script=yes
263         ;;
264 esac
265 AC_ARG_ENABLE([ld-version-script],
266               AC_HELP_STRING([--enable-ld-version-script],
267                              [enable/disable use of linker version script.
268                               (default is system dependent)]),
269               [have_ld_version_script=$enableval],
270               [ : ] )
271 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
273 AC_CHECK_TYPES(uint,,, [
274 # include <sys/types.h>
277 # Check for and replace ssize_t.
278 AC_CHECK_TYPE(ssize_t,
279         [DEFINE_SSIZE_T="#include <sys/types.h>"
280         AC_SUBST(DEFINE_SSIZE_T)],
281         [AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found])
282         DEFINE_SSIZE_T="typedef int ssize_t;"
283         AC_SUBST(DEFINE_SSIZE_T)],
284         [#include <sys/types.h>])
286 AC_C_BIGENDIAN
288 AC_MSG_RESULT([***
289 *** Checking for external libraries...
292 # For Guile bindings.
294 opt_guile_bindings=yes
295 AC_MSG_CHECKING([whether building Guile bindings])
296 AC_ARG_ENABLE(guile,
297         AS_HELP_STRING([--enable-guile], [build GNU Guile bindings]),
298 opt_guile_bindings=$enableval)
299 AC_MSG_RESULT($opt_guile_bindings)
301 AC_ARG_WITH([--with-guile-site-dir],
302   [AS_HELP_STRING([--with-guile-site-dir],
303      [use the given directory as the Guile site (use with care)])])
305 if test "x$opt_guile_bindings" = "xyes"; then
306    AC_MSG_RESULT([***
307 *** Detecting GNU Guile...
310    AC_PATH_PROG([guile_snarf], [guile-snarf])
311    if test "x$guile_snarf" = "x"; then
312       AC_MSG_WARN([`guile-snarf' from Guile 1.8 not found.  Guile bindings not built.])
313       opt_guile_bindings=no
314    else
315       GUILE_PROGS
316       GUILE_FLAGS
318       save_CFLAGS="$CFLAGS"
319       save_LIBS="$LIBS"
320       CFLAGS="$CFLAGS $GUILE_CFLAGS"
321       LIBS="$LIBS $GUILE_LDFLAGS"
322       AC_MSG_CHECKING([whether GNU Guile is recent enough])
323       AC_LINK_IFELSE(AC_LANG_CALL([], [scm_from_locale_string]),
324         [], [opt_guile_bindings=no])
325       CFLAGS="$save_CFLAGS"
326       LIBS="$save_LIBS"
328       if test "x$opt_guile_bindings" = "xyes"; then
329         AC_MSG_RESULT([yes])
330         case "x$with_guile_site_dir" in 
331              xno)
332                 # Use the default $(GUILE_SITE).
333                 GUILE_SITE_DIR
334                 ;;
335              x|xyes)
336                 # Automatically derive $(GUILE_SITE) from $(pkgdatadir).  This
337                 # hack is used to allow `distcheck' to work (see
338                 # `DISTCHECK_CONFIGURE_FLAGS' in the top-level `Makefile.am').
339                 GUILE_SITE="\$(datadir)/guile/site"
340                 AC_SUBST(GUILE_SITE)
341                 ;;
342              *)
343                 # Use the user-specified directory as $(GUILE_SITE).
344                 GUILE_SITE="$with_guile_site_dir"
345                 AC_SUBST(GUILE_SITE)
346                 ;;
347         esac
348       else
349         AC_MSG_RESULT([no])
350         AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
351         opt_guile_bindings=no
352       fi
353    fi
355 AM_CONDITIONAL(HAVE_GUILE, test "x$opt_guile_bindings" = "xyes")
357 AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,,
358 dnl Can't disable - gnutls depends on gcrypt
359         AC_MSG_ERROR([[
360 ***  
361 *** libgcrypt was not found. You may want to get it from
362 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
364 ]]))
365 libgcrypt=yes
367 # Hard-wire the gl/m4/gc.m4 test.
368 AC_ARG_WITH(builtin-crypto,
369         AS_HELP_STRING([--with-builtin-crypto],
370                 [use internal crypto instead of libgcrypt (EXPERIMENTAL)]),
371         ac_cv_libgcrypt=no,
372         ac_cv_libgcrypt=yes)
373 LTLIBGCRYPT=$LIBGCRYPT_LIBS
375 AC_MSG_CHECKING([whether to enable Opaque PRF input support])
376 AC_ARG_ENABLE(opaque-prf-input,
377         AS_HELP_STRING([--enable-opaque-prf-input=DD],
378                 [enable Opaque PRF input using DD as extension type]),
379         ac_opaque_prf_input=$enableval, ac_opaque_prf_input=no)
380 if test "$ac_opaque_prf_input" != "no"; then
381   if ! echo $ac_opaque_prf_input | egrep -q '^[[0-9]]+$'; then
382     ac_opaque_prf_input=no
383     AC_MSG_WARN([[
384 *** Could not parse Opaque PRF Input extension type.
385 *** Use --enable-opaque-prf-input=XX where XX is decimal, for example
386 *** to use extension value 42 use --enable-opqaue-prf-input=42]])
387   fi
389 if test "$ac_opaque_prf_input" != "no"; then
390  AC_MSG_RESULT([yes (extension value $ac_opaque_prf_input)])
391  AC_DEFINE_UNQUOTED(ENABLE_OPRFI, $ac_opaque_prf_input,
392                     [enable Opaque PRF Input])
393 else
394  AC_MSG_RESULT(no)
396 AM_CONDITIONAL(ENABLE_OPRFI, test "$ac_opaque_prf_input" != "no")
398 AC_MSG_CHECKING([whether to disable SRP authentication support])
399 AC_ARG_ENABLE(srp-authentication,
400         AS_HELP_STRING([--disable-srp-authentication],
401                 [disable the SRP authentication support]),
402         ac_enable_srp=no)
403 if test x$ac_enable_srp != xno; then
404  AC_MSG_RESULT(no)
405  AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication])
406 else
407  ac_full=0
408  AC_MSG_RESULT(yes)
410 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
412 AC_MSG_CHECKING([whether to disable PSK authentication support])
413 AC_ARG_ENABLE(psk-authentication,
414        AS_HELP_STRING([--disable-psk-authentication],
415                [disable the PSK authentication support]),
416        ac_enable_psk=no)
417 if test x$ac_enable_psk != xno; then
418  AC_MSG_RESULT(no)
419  AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication])
420 else
421  ac_full=0
422  AC_MSG_RESULT(yes)
425 AC_MSG_CHECKING([whether to disable anonymous authentication support])
426 AC_ARG_ENABLE(anon-authentication,
427         AS_HELP_STRING([--disable-anon-authentication],
428                 [disable the anonymous authentication support]),
429         ac_enable_anon=no)
430 if test x$ac_enable_anon != xno; then
431  AC_MSG_RESULT(no)
432  AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication])
433 else
434  ac_full=0
435  AC_MSG_RESULT(yes)
437 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
439 dnl Check for Camellia support
441 AC_ARG_ENABLE(camellia,
442         AS_HELP_STRING([--disable-camellia], [disable Camellia cipher]),
443         ac_enable_camellia=no)
444 if test "$ac_enable_camellia" != "no"; then
445   AC_MSG_CHECKING([for Camellia support in libgcrypt])
446   if test -n "`$LIBGCRYPT_CONFIG --algorithms | grep -i camellia`"; then
447     AC_MSG_RESULT([yes])
448     ac_enable_camellia=yes
449   else
450     AC_MSG_RESULT([no])
451     ac_enable_camellia=no
452   fi
454 AC_MSG_CHECKING([whether to disable Camellia cipher])
455 if test "$ac_enable_camellia" = "yes"; then
456  AC_MSG_RESULT([no])
457  AC_DEFINE(ENABLE_CAMELLIA, 1, [enable camellia block cipher])
458 else
459  AC_MSG_RESULT([yes])
462 AC_MSG_CHECKING([whether to disable extra PKI stuff])
463 AC_ARG_ENABLE(extra-pki,
464         AS_HELP_STRING([--disable-extra-pki],
465                 [only enable the basic PKI stuff]),
466         disable_pki=$enableval, disable_pki=no)
467 if test "$disable_pki" != "no"; then
468  ac_full=0
469  AC_MSG_RESULT(yes)
470 else
471  AC_MSG_RESULT(no)
472  AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS/PKI stuff])
474 AM_CONDITIONAL(ENABLE_PKI, test "$disable_pki" = "no")
476 dnl Check whether to disable OpenPGP authentication completely
477 dnl from libgnutls-extra.
479 ac_enable_openpgp=yes
480 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
481 AC_ARG_ENABLE(openpgp-authentication,
482         AS_HELP_STRING([--disable-openpgp-authentication],
483                 [disable the OpenPGP authentication support]),
484         ac_enable_openpgp=no)
485 if test x$ac_enable_openpgp = xno; then
486  AC_MSG_RESULT(yes)
487  ac_full=0
488 else
489  AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication])
490  AC_MSG_RESULT(no)
492 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
494 dnl Test whether to use the included opencdk library
495 dnl 
496 if test x$ac_enable_openpgp = xyes; then
497  AC_ARG_WITH(included-opencdk,
498         AS_HELP_STRING([--with-included-opencdk], [use the included opencdk]),
499                 ac_enable_included_opencdk=$withval, 
500                 ac_enable_included_opencdk=no)
501  if test x$ac_enable_included_opencdk = xno;then 
502   AC_LIB_HAVE_LINKFLAGS(opencdk,, [
503 #include <opencdk.h>], [
504 #if OPENCDK_VERSION_MINOR < 6 || OPENCDK_VERSION_PATCH < 5
505 # error "OpenCDK 0.6.5 is required"
506 #else
507 cdk_check_version( NULL);
508 #endif
510   if test "$ac_cv_libopencdk" != yes; then
511    ac_enable_included_opencdk=yes
512    AC_MSG_WARN([[
514 *** libopencdk was not found. You may want to get it from
515 *** ftp://ftp.gnutls.org/pub/gnutls/opencdk/
517 *** Will use the included opencdk.
520   fi
521   AC_MSG_CHECKING([whether to use the included opencdk])
522   AC_MSG_RESULT($ac_enable_included_opencdk)
523  fi
526 AM_CONDITIONAL(ENABLE_INCLUDED_OPENCDK, test "$ac_enable_included_opencdk" = "yes")
528 AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer])
529 AC_ARG_ENABLE(openssl-compatibility,
530         AS_HELP_STRING([--disable-openssl-compatibility],
531                 [disable the OpenSSL compatibility support]),
532         ac_enable_openssl=$withval,
533         ac_enable_openssl=yes)
534 if test x$ac_enable_openssl != xno; then
535  AC_MSG_RESULT(no)
536 else
537  AC_MSG_RESULT(yes)
540 AM_CONDITIONAL(ENABLE_OPENSSL, test "$ac_enable_openssl" = "yes")
543 AC_ARG_WITH(included-libtasn1,
544         AS_HELP_STRING([--with-included-libtasn1],
545                 [use the included libtasn1]),
546         minitasn1_enabled=$withval,
547         minitasn1_enabled=no)
549 if test x$minitasn1_enabled = xno; then
550 AM_PATH_LIBTASN1($GNUTLS_LIBTASN1_VERSION,,
551  minitasn1_enabled=yes
552  AC_MSG_WARN([[
553 *** 
554 *** LibtASN1 ${GNUTLS_LIBTASN1_VERSION} was not found. Will use the included one.
555 ]]))
558 AC_MSG_CHECKING([whether to use the included minitasn1])
559 AC_MSG_RESULT($minitasn1_enabled)
561 AM_CONDITIONAL(ENABLE_MINITASN1, test "$minitasn1_enabled" = "yes")
563 dnl Check for libcfg+
565 SAVED_LIBS=$LIBS
566 AC_ARG_WITH(included-libcfg,
567         AS_HELP_STRING([--with-included-libcfg],
568                 [use the included libcfg+ (certtool only)]),
569         libcfg_enabled=$withval, 
570         libcfg_enabled=no
571 dnl We search for libcfg+ which is used by certtool
573         AC_CHECK_LIB(cfg+, cfg_get_context,:,
574                      libcfg_enabled=yes
575                      AC_MSG_WARN([[
576 *** 
577 *** Libcfg+ was not found. Will use the included one.]])))
579 AM_CONDITIONAL(HAVE_LIBCFG, test "$libcfg_enabled" = "no")
580 LIBS=$SAVED_LIBS
582 AC_MSG_CHECKING([whether to use the included libcfg])
583 AC_MSG_RESULT($libcfg_enabled)
586 dnl CHECK FOR ZLIB SUPPORT
589 AC_MSG_CHECKING([whether to include zlib compression support])
591 AC_ARG_WITH(zlib,
592         AS_HELP_STRING([--without-zlib], [disable zlib compression support]),
593         ac_zlib=$withval,
594         ac_zlib=yes)
596 if test x$ac_zlib != xno; then
597  AC_MSG_RESULT(yes)
598  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
599  if test "$ac_cv_libz" != yes; then
600    AC_MSG_WARN(
601 *** 
602 *** ZLIB was not found. You will not be able to use ZLIB compression.)
603  fi
604 else
605  AC_MSG_RESULT(no)
610 dnl CHECK FOR LZO SUPPORT (whether to use the included one)
613 minilzo_enabled=no
614 use_lzo=yes
615 AC_ARG_WITH(lzo,
616         AS_HELP_STRING([--without-lzo], [do not use lzo compression]),
617         use_lzo=$withval,
618         use_lzo=yes)
620 AC_MSG_CHECKING([whether to include lzo compression support])
621 AC_MSG_RESULT($use_lzo)
623 if test x$use_lzo = xyes; then
624   AC_DEFINE(USE_LZO, 1, [whether to use the lzo compression])
626   AC_ARG_WITH(included-lzo,
627         AS_HELP_STRING([--with-included-lzo],
628                 [include minilzo in libgnutls-extra]),
629         minilzo_enabled=$withval,
630         minilzo_enabled=no)
632   AC_MSG_CHECKING([whether to use the included lzo compression library])
633   AC_MSG_RESULT($minilzo_enabled)
635   LZO_LIBS=
636   if test "$minilzo_enabled" != "yes"; then
637     AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2)
638     if test "$LZO_LIBS" = ""; then
639       AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [
640         minilzo_enabled=yes
641         AC_MSG_WARN(
643 *** Could not find liblzo or liblzo2. Will use the included minilzo.
645       ])
646     fi
647   fi
648   AC_SUBST(LZO_LIBS)
650   if test "$LZO_LIBS" = "-llzo"; then
651     AC_CHECK_HEADERS(lzo1x.h)
652   elif test "$LZO_LIBS" = "-llzo2"; then
653     AC_CHECK_HEADERS(lzo/lzo1x.h)
654   fi
656   if test "$minilzo_enabled" = "yes"; then
657     AC_DEFINE(USE_MINILZO, 1, [whether to use the included minilzo])
658   fi
661 AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes")
662 AM_CONDITIONAL(ENABLE_INCLUDED_LZO, test "$minilzo_enabled" = "yes")
664 if test "$minilzo_enabled" = "yes"; then
665   # See libextra/minilzo/README.LZO
666   AC_CHECK_TYPE(ptrdiff_t,long)
667   AC_TYPE_SIZE_T
668   AC_CHECK_SIZEOF(short)
669   AC_CHECK_SIZEOF(int)
670   AC_CHECK_SIZEOF(long)
671   AC_CHECK_SIZEOF(long long)
672   AC_CHECK_SIZEOF(__int64)
673   AC_CHECK_SIZEOF(void *)
674   AC_CHECK_SIZEOF(size_t)
675   AC_CHECK_SIZEOF(ptrdiff_t)
676   AC_C_CONST
677   AC_CHECK_FUNCS(memcmp memcpy memmove memset)
680 AC_MSG_RESULT([***
681 *** Setting up gnulib compatibility files...
683 gl_INIT
684 lgl_INIT
686 AC_TRY_LINK([#include <winsock2.h>], [
687   WORD wVersionRequested = MAKEWORD(2, 2);
688   WSADATA wsaData;
689   int err = WSAStartup(wVersionRequested, &wsaData);
690   WSACleanup ();], wsastartup=yes, wsastartup=no)
691 if test x$wsastartup = xyes; then
692   AC_DEFINE(HAVE_WINSOCK, 1, [Call WSAStartup in gnutls_global_init])
694 AC_MSG_CHECKING([if we have Windows sockets and WSAStartup/WSACleanup])
695 AC_MSG_RESULT($wsastartup)
697 AC_MSG_RESULT([***
698 *** Detecting options for shared libraries...
700 AC_LIBTOOL_WIN32_DLL
701 AC_PROG_LIBTOOL
703 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS"
704 LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}"
705 AC_SUBST(LIBGNUTLS_LIBS)
706 AC_SUBST(LIBGNUTLS_CFLAGS)
708 LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LTLIBOPENCDK $LZO_LIBS $LIBGNUTLS_LIBS"
709 LIBGNUTLS_EXTRA_CFLAGS="$INCOPENCDK -I${includedir}"
710 AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
711 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
712 export ac_full
714 AM_CFLAGS="${AM_CFLAGS} ${LIBGCRYPT_CFLAGS}"
716 if test $ac_cv_c_compiler_gnu != no; then
717         if test x$opt_profiler_mode = xyes; then
718           AC_CHECK_PROG(FC_OK, fc-config, yes, no)
719           if test x$FC_OK = xyes; then
720                 AM_CFLAGS="${AM_CFLAGS} `fc-config --cflags`"
721                 LIBS="$LIBS `fc-config --libs`"
722           else
723 AC_MSG_WARN(***
724 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
726           fi
727         fi
730 if test $ac_full -eq 0; then
731   AC_SUBST(POSSIBLY_WARN_ABOUT_MISSING_FEATURES, [[
732 #ifdef __GNUC__
733 #warning This is not the official GnuTLS library. Several features were disabled at compilation.
734 #endif /* __GNUC__ */]])
737 AC_SUBST(AM_CFLAGS)
739 AC_CONFIG_COMMANDS([chmod-config],[[
740  chmod +x lib/libgnutls-config
741  chmod +x libextra/libgnutls-extra-config
742 ]],[[]])
744 AC_CONFIG_FILES([Makefile po/Makefile.in \
745         doc/Makefile doc/examples/Makefile doc/scripts/Makefile \
746         doc/manpages/Makefile doc/reference/Makefile \
747         doc/credentials/Makefile doc/credentials/x509/Makefile \
748         doc/credentials/srp/Makefile doc/credentials/openpgp/Makefile \
749         gl/Makefile lgl/Makefile \
750         tests/Makefile tests/rsa-md5-collision/Makefile tests/userid/Makefile \
751         tests/pkcs1-padding/Makefile tests/pkcs8-decode/Makefile \
752         tests/pkcs12-decode/Makefile tests/pathlen/Makefile \
753         tests/key-id/Makefile tests/sha2/Makefile \
754         tests/hostname-check/Makefile \
755         includes/Makefile includes/gnutls/gnutls.h \
756         lib/Makefile lib/minitasn1/Makefile lib/x509/Makefile \
757         libextra/Makefile libextra/openpgp/Makefile libextra/opencdk/Makefile \
758         libextra/minilzo/Makefile tests/openpgp/Makefile \
759         src/Makefile \
760         src/cfg/Makefile src/cfg/platon/Makefile src/cfg/platon/str/Makefile \
761         lib/libgnutls-config libextra/libgnutls-extra-config \
762         lib/gnutls.pc libextra/gnutls-extra.pc
763         guile/Makefile guile/modules/Makefile
764         guile/src/Makefile guile/tests/Makefile])
766 AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
769 AC_OUTPUT