Version 1.7.10.
[gnutls.git] / configure.in
blobb0b3f36e84a000bbdfea404cfcfaeb25b50b30ce
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 Mavroyanopoulos
7 # This file is part of GNUTLS.
9 # GNUTLS is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # GNUTLS 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 GNUTLS; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 AC_PREREQ(2.61)
24 AC_INIT([GnuTLS], [1.7.10], [bug-gnutls@gnu.org])
25 AC_CONFIG_AUX_DIR([build-aux])
27 AC_CANONICAL_TARGET
29 AM_INIT_AUTOMAKE([1.10 gnits dist-bzip2])
30 AM_CONFIG_HEADER(config.h)
32 AB_INIT
34 # Library code modified:                              REVISION++
35 # Interfaces changed/added/removed:   CURRENT++       REVISION=0
36 # Interfaces added:                             AGE++
37 # Interfaces removed:                           AGE=0
38 AC_SUBST(LT_CURRENT, 20)
39 AC_SUBST(LT_REVISION, 2)
40 AC_SUBST(LT_AGE, 7)
41 ac_full=1
43 # Used when creating the Windows libgnutls-XX.def files.
44 SOVERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
45 AC_SUBST(SOVERSION)
47 GNUTLS_GCRYPT_VERSION=1:1.2.2
48 GNUTLS_LIBTASN1_VERSION=0.3.4
49 AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gcrypt])
50 AC_DEFINE_UNQUOTED(GNUTLS_LIBTASN1_VERSION, "$GNUTLS_LIBTASN1_VERSION", [version of libtasn1])
52 # Compute numeric versions, used in includes/gnutls/gnutls.h.in.
53 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
54 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
55 AC_SUBST(PATCH_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`)
56 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
58 dnl In order to use the reentrant libc functions.
59 dnl I hope it is portable enough.
60 CFLAGS="${CFLAGS} -D_REENTRANT -D_THREAD_SAFE"
62 opt_dmalloc_mode=no
63 AC_MSG_CHECKING([whether in dmalloc mode])
64 AC_ARG_ENABLE(dmalloc-mode,
65         AS_HELP_STRING([--enable-dmalloc-mode], [enable dmalloc mode]),
66         opt_dmalloc_mode=$enableval)
67 AC_MSG_RESULT($opt_dmalloc_mode)
69 opt_efence_mode=no
70 AC_MSG_CHECKING([whether in electric fence mode])
71 AC_ARG_ENABLE(efence-mode,
72         AS_HELP_STRING([--enable-efence-mode], [enable electric fence mode]),
73 opt_efence_mode=$enableval)
74 AC_MSG_RESULT($opt_efence_mode)
76 opt_developer_mode=no
77 AC_MSG_CHECKING([whether in developer mode])
78 AC_ARG_ENABLE(developer-mode,
79         AS_HELP_STRING([--enable-developer-mode], [enable developer mode]),
80 opt_developer_mode=$enableval)
81 AC_MSG_RESULT($opt_developer_mode)
83 opt_profiler_mode=no
84 AC_MSG_CHECKING([whether in profile mode])
85 AC_ARG_ENABLE(profile-mode,
86         AS_HELP_STRING([--enable-profile-mode], [enable profiler]),
87 opt_profiler_mode=$enableval)
88 AC_MSG_RESULT($opt_profiler_mode)
90 AC_MSG_RESULT([***
91 *** Checking for compilation programs...
94 dnl Checks for programs.
95 AM_GNU_GETTEXT([external])
96 AM_GNU_GETTEXT_VERSION([0.16])
97 AC_PROG_CC
98 AC_PROG_CXX
99 AC_PROG_LN_S
100 GTK_DOC_CHECK(1.1)
101 AC_PATH_PROG([GAA], [gaa])
102 if test "x$GAA" = "x"; then
103    AC_MSG_WARN([[***
104 *** GAA was not found.  It is only needed if you wish to modify
105 *** the source code or command-line description files.  In this case,
106 *** you may want to get it from http://gaa.sourceforge.net/
107 ***]])
110 AC_MSG_RESULT([***
111 *** Detecting compiler options...
114 gl_EARLY
115 lgl_EARLY
116 AC_C_CONST
117 AC_C_INLINE
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           CFLAGS="${CFLAGS} -g -Wall -Wcast-align -W -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wno-unused-parameter"
149 #         CFLAGS="${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([if 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([if gcc/ld supports -Wl,--output-def])
162         _gcc_ldflags_save=$LDFLAGS
163         LDFLAGS="-Wl,--output-def,foo.def"
164         AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
165         AC_MSG_RESULT($output_def)
166         LDFLAGS="$_gcc_ldflags_save"
168         if test x$opt_dmalloc_mode = xyes; then
169           AC_CHECK_LIB(dmalloc, main)
170           AC_DEFINE(USE_DMALLOC, 1, [enable the use of dmalloc])
171         else
172                 if test x$opt_efence_mode = xyes; then
173                   AC_CHECK_LIB(efence, main)
174                   AC_DEFINE(USE_EFENCE, 1, [use electric fence])
175                 fi
176         fi
178         AC_MSG_CHECKING([whether we have GNU assembler])
179         GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
180         if test "$GAS"; then
181           CFLAGS="${CFLAGS} -pipe"
182           AC_MSG_RESULT(yes)
183         else
184           AC_MSG_RESULT(no)
185         fi
188 # Needs to be called outside of 'if' clause.
189 AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, test "$output_def" = "yes")
191 AC_MSG_RESULT([***
192 *** Detecting C library capabilities...
195 AC_HEADER_STDC
196 AC_CHECK_HEADERS(strings.h alloca.h)
197 AC_CHECK_HEADERS(errno.h)
198 AC_CHECK_HEADERS(math.h limits.h float.h stdarg.h ctype.h)
199 dnl opencdk
200 AC_CHECK_HEADERS(netdb.h)
201 AC_CHECK_FUNCS(umask vasprintf isascii fork,,)
202 AC_FUNC_ALLOCA
204 # No fork on MinGW, disable some self-tests until we fix them.
205 AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
207 AC_MSG_RESULT([***
208 *** Detecting system's parameters...
211 # Run self-tests under valgrind?
212 if test "$cross_compiling" = no; then
213   AC_CHECK_PROGS(VALGRIND, valgrind)
215 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
216   opt_valgrind_tests=yes
217 else
218   opt_valgrind_tests=no
219   VALGRIND=
220 fi 
221 AC_MSG_CHECKING([whether self tests are run under valgrind])
222 AC_ARG_ENABLE(valgrind-tests,
223         AS_HELP_STRING([--enable-valgrind-tests],
224                        [run self tests under valgrind]),
225   opt_valgrind_tests=$enableval)
226 AC_MSG_RESULT($opt_valgrind_tests)
228 # For minitasn1.
229 AC_CHECK_SIZEOF(unsigned long, 4)
230 AC_CHECK_SIZEOF(unsigned int, 4)
232 # For storing integers in pointers without warnings
233 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
234 AC_CHECK_SIZEOF(void *)
235 AC_CHECK_SIZEOF(long)
236 AC_CHECK_SIZEOF(int)
237 case $ac_cv_sizeof_void_p in
238   $ac_cv_sizeof_long)
239     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [(long)],
240               [Additional cast to bring void* to a type castable to int.])
241     ;;
242   *)
243     AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [])
244     ;;
245 esac
247 # For some systems we know that we have ld_version scripts.
248 # Use it then as default.
249 have_ld_version_script=no
250 case "${host}" in
251     *-*-linux*)
252         have_ld_version_script=yes
253         ;;
254     *-*-gnu*)
255         have_ld_version_script=yes
256         ;;
257 esac
258 AC_ARG_ENABLE([ld-version-script],
259               AC_HELP_STRING([--enable-ld-version-script],
260                              [enable/disable use of linker version script.
261                               (default is system dependent)]),
262               [have_ld_version_script=$enableval],
263               [ : ] )
264 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
266 AC_CHECK_TYPES(uint,,, [
267 # include <sys/types.h>
270 # Check for and replace ssize_t.
271 AC_CHECK_TYPE(ssize_t,
272         [DEFINE_SSIZE_T="#include <sys/types.h>"
273         AC_SUBST(DEFINE_SSIZE_T)],
274         [AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found])
275         DEFINE_SSIZE_T="typedef int ssize_t;"
276         AC_SUBST(DEFINE_SSIZE_T)],
277         [#include <sys/types.h>])
279 AC_C_BIGENDIAN
281 AC_MSG_RESULT([***
282 *** Checking for external libraries...
285 AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,,
286 dnl Can't disable - gnutls depends on gcrypt
287         AC_MSG_ERROR([[
288 ***  
289 *** libgcrypt was not found. You may want to get it from
290 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
292 ]]))
293 libgcrypt=yes
295 # Hard-wire the gl/m4/gc.m4 test.
296 AC_ARG_WITH(builtin-crypto,
297         AS_HELP_STRING([--with-builtin-crypto],
298                 [use internal crypto instead of libgcrypt (EXPERIMENTAL)]),
299         ac_cv_libgcrypt=no,
300         ac_cv_libgcrypt=yes)
301 LTLIBGCRYPT=$LIBGCRYPT_LIBS
303 AC_MSG_CHECKING([whether to disable SRP authentication support])
304 AC_ARG_ENABLE(srp-authentication,
305         AS_HELP_STRING([--disable-srp-authentication],
306                 [disable the SRP authentication support]),
307         ac_enable_srp=no)
308 if test x$ac_enable_srp != xno; then
309  AC_MSG_RESULT(no)
310  AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication])
311 else
312  ac_full=0
313  AC_MSG_RESULT(yes)
315 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
317 AC_MSG_CHECKING([whether to disable PSK authentication support])
318 AC_ARG_ENABLE(psk-authentication,
319        AS_HELP_STRING([--disable-psk-authentication],
320                [disable the PSK authentication support]),
321        ac_enable_psk=no)
322 if test x$ac_enable_psk != xno; then
323  AC_MSG_RESULT(no)
324  AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication])
325 else
326  ac_full=0
327  AC_MSG_RESULT(yes)
330 AC_MSG_CHECKING([whether to disable anonymous authentication support])
331 AC_ARG_ENABLE(anon-authentication,
332         AS_HELP_STRING([--disable-anon-authentication],
333                 [disable the anonymous authentication support]),
334         ac_enable_anon=no)
335 if test x$ac_enable_anon != xno; then
336  AC_MSG_RESULT(no)
337  AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication])
338 else
339  ac_full=0
340  AC_MSG_RESULT(yes)
342 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
344 AC_MSG_CHECKING([whether to disable authorization (tls-authz) support])
345 AC_ARG_ENABLE(tls-authorization,
346         AS_HELP_STRING([--disable-tls-authorization],
347                 [disable tls authorization support]),
348         ac_enable_authz=no)
349 if test x$ac_enable_authz != xno; then
350  AC_MSG_RESULT(no)
351  AC_DEFINE(ENABLE_AUTHZ, 1, [enable tls authorization])
352 else
353  ac_full=0
354  AC_MSG_RESULT(yes)
356 AM_CONDITIONAL(ENABLE_AUTHZ, test "$ac_enable_authz" != "no")
358 AC_MSG_CHECKING([whether to disable extra PKI stuff])
359 AC_ARG_ENABLE(extra-pki,
360         AS_HELP_STRING([--disable-extra-pki],
361                 [only enable the basic PKI stuff]),
362         disable_pki=$enableval, disable_pki=no)
363 if test "$disable_pki" != "no"; then
364  ac_full=0
365  AC_MSG_RESULT(yes)
366 else
367  AC_MSG_RESULT(no)
368  AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS/PKI stuff])
370 AM_CONDITIONAL(ENABLE_PKI, test "$disable_pki" = "no")
372 dnl Check whether to disable OpenPGP authentication completely
373 dnl from libgnutls-extra.
375 ac_enable_openpgp=yes
376 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
377 AC_ARG_ENABLE(openpgp-authentication,
378         AS_HELP_STRING([--disable-openpgp-authentication],
379                 [disable the OpenPGP authentication support]),
380         ac_enable_openpgp=no)
381 if test x$ac_enable_openpgp = xno; then
382  AC_MSG_RESULT(yes)
383  ac_full=0
384 else
385  AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication])
386  AC_MSG_RESULT(no)
388 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
390 dnl Test whether to use the included opencdk library
391 dnl 
392 if test x$ac_enable_openpgp = xyes; then
393  AC_ARG_WITH(included-opencdk,
394         AS_HELP_STRING([--with-included-opencdk], [use the included opencdk]),
395                 ac_enable_included_opencdk=$withval, 
396                 ac_enable_included_opencdk=no)
397  if test x$ac_enable_included_opencdk = xno;then 
398   AC_LIB_HAVE_LINKFLAGS(opencdk,, [
399 #include <opencdk.h>], [cdk_armor_encode_buffer (NULL, 0, NULL, 0, NULL, 0);])
400   if test "$ac_cv_libopencdk" != yes; then
401    ac_enable_included_opencdk=yes
402    AC_MSG_WARN([[
404 *** libopencdk was not found. You may want to get it from
405 *** ftp://ftp.gnutls.org/pub/gnutls/opencdk/
407 *** Will use the included opencdk.
410   fi
411   AC_MSG_CHECKING([whether to use the included opencdk])
412   AC_MSG_RESULT($ac_enable_included_opencdk)
413  fi
416 AM_CONDITIONAL(ENABLE_INCLUDED_OPENCDK, test "$ac_enable_included_opencdk" = "yes")
418 AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer])
419 AC_ARG_ENABLE(openssl-compatibility,
420         AS_HELP_STRING([--disable-openssl-compatibility],
421                 [disable the OpenSSL compatibility support]),
422         ac_enable_openssl=$withval,
423         ac_enable_openssl=yes)
424 if test x$ac_enable_openssl != xno; then
425  AC_MSG_RESULT(no)
426 else
427  AC_MSG_RESULT(yes)
430 AM_CONDITIONAL(ENABLE_OPENSSL, test "$ac_enable_openssl" = "yes")
433 AC_ARG_WITH(included-libtasn1,
434         AS_HELP_STRING([--with-included-libtasn1],
435                 [use the included libtasn1]),
436         minitasn1_enabled=$withval,
437         minitasn1_enabled=no)
439 if test x$minitasn1_enabled = xno; then
440 AM_PATH_LIBTASN1($GNUTLS_LIBTASN1_VERSION,,
441  minitasn1_enabled=yes
442  AC_MSG_WARN([[
443 *** 
444 *** LibtASN1 ${GNUTLS_LIBTASN1_VERSION} was not found. Will use the included one.
445 ]]))
448 AC_MSG_CHECKING([whether to use the included minitasn1])
449 AC_MSG_RESULT($minitasn1_enabled)
451 AM_CONDITIONAL(ENABLE_MINITASN1, test "$minitasn1_enabled" = "yes")
453 dnl Check for libcfg+
455 SAVED_LIBS=$LIBS
456 AC_ARG_WITH(included-libcfg,
457         AS_HELP_STRING([--with-included-libcfg],
458                 [use the included libcfg+ (certtool only)]),
459         libcfg_enabled=$withval, 
460         libcfg_enabled=no
461 dnl We search for libcfg+ which is used by certtool
463         AC_CHECK_LIB(cfg+, cfg_get_context,:,
464                      libcfg_enabled=yes
465                      AC_MSG_WARN([[
466 *** 
467 *** Libcfg+ was not found. Will use the included one.]])))
469 AM_CONDITIONAL(HAVE_LIBCFG, test "$libcfg_enabled" = "no")
470 LIBS=$SAVED_LIBS
472 AC_MSG_CHECKING([whether to use the included libcfg])
473 AC_MSG_RESULT($libcfg_enabled)
476 dnl CHECK FOR ZLIB SUPPORT
479 AC_MSG_CHECKING([whether to include zlib compression support])
481 AC_ARG_WITH(zlib,
482         AS_HELP_STRING([--without-zlib], [disable zlib compression support]),
483         ac_zlib=$withval,
484         ac_zlib=yes)
486 if test x$ac_zlib != xno; then
487  AC_MSG_RESULT(yes)
488  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
489  if test "$ac_cv_libz" != yes; then
490    AC_MSG_WARN(
491 *** 
492 *** ZLIB was not found. You will not be able to use ZLIB compression.)
493  fi
494 else
495  AC_MSG_RESULT(no)
500 dnl CHECK FOR LZO SUPPORT (whether to use the included one)
503 minilzo_enabled=no
504 use_lzo=yes
505 AC_ARG_WITH(lzo,
506         AS_HELP_STRING([--without-lzo], [do not use lzo compression]),
507         use_lzo=$withval,
508         use_lzo=yes)
510 AC_MSG_CHECKING([whether to include lzo compression support])
511 AC_MSG_RESULT($use_lzo)
513 if test x$use_lzo = xyes; then
514   AC_DEFINE(USE_LZO, 1, [whether to use the lzo compression])
516   AC_ARG_WITH(included-lzo,
517         AS_HELP_STRING([--with-included-lzo],
518                 [include minilzo in libgnutls-extra]),
519         minilzo_enabled=$withval,
520         minilzo_enabled=no)
522   AC_MSG_CHECKING([whether to use the included lzo compression library])
523   AC_MSG_RESULT($minilzo_enabled)
525   LZO_LIBS=
526   if test "$minilzo_enabled" != "yes"; then
527     AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2)
528     if test "$LZO_LIBS" = ""; then
529       AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [
530         minilzo_enabled=yes
531         AC_MSG_WARN(
533 *** Could not find liblzo or liblzo2. Will use the included minilzo.
535       ])
536     fi
537   fi
538   AC_SUBST(LZO_LIBS)
540   if test "$LZO_LIBS" = "-llzo"; then
541     AC_CHECK_HEADERS(lzo1x.h)
542   elif test "$LZO_LIBS" = "-llzo2"; then
543     AC_CHECK_HEADERS(lzo/lzo1x.h)
544   fi
546   if test "$minilzo_enabled" = "yes"; then
547     AC_DEFINE(USE_MINILZO, 1, [whether to use the included minilzo])
548   fi
551 AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes")
552 AM_CONDITIONAL(ENABLE_INCLUDED_LZO, test "$minilzo_enabled" = "yes")
554 if test "$minilzo_enabled" = "yes"; then
555   # See libextra/minilzo/README.LZO
556   AC_CHECK_TYPE(ptrdiff_t,long)
557   AC_TYPE_SIZE_T
558   AC_CHECK_SIZEOF(short)
559   AC_CHECK_SIZEOF(int)
560   AC_CHECK_SIZEOF(long)
561   AC_CHECK_SIZEOF(long long)
562   AC_CHECK_SIZEOF(__int64)
563   AC_CHECK_SIZEOF(void *)
564   AC_CHECK_SIZEOF(size_t)
565   AC_CHECK_SIZEOF(ptrdiff_t)
566   AC_C_CONST
567   AC_CHECK_FUNCS(memcmp memcpy memmove memset)
570 AC_MSG_RESULT([***
571 *** Setting up gnulib compatibility files...
573 gl_INIT
574 lgl_INIT
576 AC_TRY_LINK([#include <winsock2.h>], [
577   WORD wVersionRequested = MAKEWORD(2, 2);
578   WSADATA wsaData;
579   int err = WSAStartup(wVersionRequested, &wsaData);
580   WSACleanup ();], wsastartup=yes, wsastartup=no)
581 if test x$wsastartup = xyes; then
582   AC_DEFINE(HAVE_WINSOCK, 1, [Call WSAStartup in gnutls_global_init])
584 AC_MSG_CHECKING([if we have Windows sockets and WSAStartup/WSACleanup])
585 AC_MSG_RESULT($wsastartup)
587 AC_MSG_RESULT([***
588 *** Detecting options for shared libraries...
590 AC_LIBTOOL_WIN32_DLL
591 AC_PROG_LIBTOOL
593 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS"
594 LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}"
595 AC_SUBST(LIBGNUTLS_LIBS)
596 AC_SUBST(LIBGNUTLS_CFLAGS)
598 LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LTLIBOPENCDK $LZO_LIBS $LIBGNUTLS_LIBS"
599 LIBGNUTLS_EXTRA_CFLAGS="$INCOPENCDK -I${includedir}"
600 AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
601 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
602 export ac_full
604 CFLAGS="${CFLAGS} ${LIBGCRYPT_CFLAGS}"
606 if test $ac_cv_c_compiler_gnu != no; then
607         if test x$opt_profiler_mode = xyes; then
608           AC_CHECK_PROG(FC_OK, fc-config, yes, no)
609           if test x$FC_OK = xyes; then
610                 CFLAGS="${CFLAGS} `fc-config --cflags`"
611                 LIBS="$LIBS `fc-config --libs`"
612           else
613 AC_MSG_WARN(***
614 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
616           fi
617         fi
620 if test $ac_full -eq 0; then
621   AC_SUBST(POSSIBLY_WARN_ABOUT_MISSING_FEATURES, [[
622 #ifdef __GNUC__
623 #warning This is not the official GnuTLS library. Several features were disabled at compilation.
624 #endif /* __GNUC__ */]])
627 AC_CONFIG_COMMANDS([chmod-config],[[
628  chmod +x lib/libgnutls-config
629  chmod +x libextra/libgnutls-extra-config
630 ]],[[]])
632 AC_CONFIG_FILES([Makefile po/Makefile.in \
633         doc/Makefile doc/examples/Makefile doc/scripts/Makefile \
634         doc/manpages/Makefile doc/reference/Makefile \
635         gl/Makefile lgl/Makefile \
636         tests/Makefile tests/rsa-md5-collision/Makefile tests/userid/Makefile \
637         tests/pkcs1-padding/Makefile tests/pkcs8-decode/Makefile \
638         tests/pkcs12-decode/Makefile tests/pathlen/Makefile \
639         tests/key-id/Makefile tests/sha2/Makefile \
640         tests/hostname-check/Makefile \
641         includes/Makefile includes/gnutls/gnutls.h \
642         lib/Makefile lib/minitasn1/Makefile lib/x509/Makefile \
643         libextra/Makefile libextra/openpgp/Makefile libextra/opencdk/Makefile \
644         libextra/minilzo/Makefile tests/openpgp/Makefile \
645         src/Makefile src/x509/Makefile src/srp/Makefile src/openpgp/Makefile \
646         src/cfg/Makefile src/cfg/platon/Makefile src/cfg/platon/str/Makefile \
647         lib/libgnutls-config libextra/libgnutls-extra-config \
648         lib/gnutls.pc libextra/gnutls-extra.pc])
650 AC_OUTPUT