Add `gnutls/dtls.h' to the distribution.
[gnutls.git] / lib / configure.ac
blob1f667734e8e667382ae057bf3b21e84c1108d94f
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 # 2009, 2010 Free Software Foundation, Inc.
5 # Author: Nikos Mavrogiannopoulos, Simon Josefsson
7 # This file is part of GnuTLS.
9 # The GnuTLS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1 of
12 # the License, or (at your option) any later version.
14 # The GnuTLS is distributed in the hope that it will be
15 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GnuTLS; if not, write to the Free
21 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 # MA 02110-1301, USA
24 AC_PREREQ(2.61)
25 AC_INIT([libgnutls], [2.11.7], [bug-gnutls@gnu.org])
26 AC_CONFIG_AUX_DIR([build-aux])
27 AC_CONFIG_MACRO_DIR([m4])
29 AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-override])
30 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31 AM_CONFIG_HEADER(config.h)
33 AC_PROG_CC
34 lgl_EARLY
36 AC_LIBTOOL_WIN32_DLL
37 AC_PROG_LIBTOOL
39 LIBGNUTLS_HOOKS
41 AM_GNU_GETTEXT([external])
42 AM_GNU_GETTEXT_VERSION([0.17])
44 AC_C_BIGENDIAN
46 # For includes/gnutls/gnutls.h.in.
47 AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
48 AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
49 AC_SUBST(PATCH_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`)
50 AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
51 AC_CHECK_TYPE(ssize_t,
52   [
53     DEFINE_SSIZE_T="#include <sys/types.h>"
54     AC_SUBST(DEFINE_SSIZE_T)
55   ], [
56     AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found])
57     DEFINE_SSIZE_T="typedef int ssize_t;"
58     AC_SUBST(DEFINE_SSIZE_T)
59   ], [
60     #include <sys/types.h>
61   ])
63 # For minitasn1.
64 AC_CHECK_SIZEOF(unsigned long int, 4)
65 AC_CHECK_SIZEOF(unsigned int, 4)
67 AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib],
68                                  [disable zlib compression support]),
69             ac_zlib=$withval, ac_zlib=yes)
70 AC_MSG_CHECKING([whether to include zlib compression support])
71 if test x$ac_zlib != xno; then
72  AC_MSG_RESULT(yes)
73  AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
74  if test "$ac_cv_libz" != yes; then
75    AC_MSG_WARN(
76 *** 
77 *** ZLIB was not found. You will not be able to use ZLIB compression.)
78  fi
79 else
80  AC_MSG_RESULT(no)
83 if test x$ac_zlib != xno; then
84   if test x$GNUTLS_REQUIRES_PRIVATE = x; then
85     GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
86   else
87     GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE , zlib"
88   fi
90 AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
92 lgl_INIT
94 AC_CHECK_FUNCS(getrusage,,)
95 AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
97 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS"
98 LIBGNUTLS_CFLAGS="-I${includedir}"
99 AC_SUBST(LIBGNUTLS_LIBS)
100 AC_SUBST(LIBGNUTLS_CFLAGS)
102 # Finish things from ../configure.ac.
103 AC_SUBST([WERROR_CFLAGS])
104 AC_SUBST([WSTACK_CFLAGS])
105 AC_SUBST([WARN_CFLAGS])
106 AC_PROG_CXX
107 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
109 AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
111 AC_CONFIG_FILES([
112   Makefile
113   gnutls.pc
114   gl/Makefile
115   gl/tests/Makefile
116   includes/Makefile
117   includes/gnutls/gnutls.h
118   minitasn1/Makefile
119   opencdk/Makefile
120   openpgp/Makefile
121   po/Makefile.in
122   x509/Makefile
123   gcrypt/Makefile
124   nettle/Makefile
126 AC_OUTPUT