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,
25 AC_INIT([libgnutls], [2.12.18], [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)
41 AM_GNU_GETTEXT([external])
42 AM_GNU_GETTEXT_VERSION([0.17])
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,
53 DEFINE_SSIZE_T="#include <sys/types.h>"
54 AC_SUBST(DEFINE_SSIZE_T)
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)
60 #include <sys/types.h>
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
73 AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
74 if test "$ac_cv_libz" != yes; then
77 *** ZLIB was not found. You will not be able to use ZLIB compression.)
83 PKG_CHECK_EXISTS(zlib, ZLIB_HAS_PKGCONFIG=y, ZLIB_HAS_PKGCONFIG=n)
85 if test x$ac_zlib != xno; then
86 if test "$ZLIB_HAS_PKGCONFIG" = "y" ; then
87 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
88 GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
90 GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE , zlib"
93 GNUTLS_ZLIB_LIBS_PRIVATE="$LTLIBZ"
96 AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
97 AC_SUBST(GNUTLS_ZLIB_LIBS_PRIVATE)
101 AS_HELP_STRING([--without-p11-kit],
102 [Build without p11-kit and PKCS#11 support]))
103 AM_CONDITIONAL(ENABLE_PKCS11, test "$with_p11_kit" != "no")
104 if test "$with_p11_kit" != "no"; then
105 PKG_CHECK_MODULES(P11_KIT, [p11-kit-1 >= 0.4], [with_p11_kit=yes], [with_p11_kit=no])
106 if test "$with_p11_kit" != "no";then
107 AC_DEFINE([ENABLE_PKCS11], 1, [Build PKCS#11 support])
108 CFLAGS="$CFLAGS $P11_KIT_CFLAGS"
109 LIBS="$LIBS $P11_KIT_LIBS"
110 if test "x$GNUTLS_REQUIRES_PRIVATE" = "x"; then
111 GNUTLS_REQUIRES_PRIVATE="Requires.private: p11-kit-1"
113 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, p11-kit-1"
118 *** p11-kit was not found. PKCS #11 support will be disabled.
119 *** You may get it from http://p11-glue.freedesktop.org/p11-kit.html
126 AC_CHECK_FUNCS(getrusage,,)
127 AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
129 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS"
130 LIBGNUTLS_CFLAGS="-I${includedir}"
131 AC_SUBST(LIBGNUTLS_LIBS)
132 AC_SUBST(LIBGNUTLS_CFLAGS)
134 # Finish things from ../configure.ac.
135 AC_SUBST([WERROR_CFLAGS])
136 AC_SUBST([WSTACK_CFLAGS])
137 AC_SUBST([WARN_CFLAGS])
139 AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
141 AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.])
149 includes/gnutls/gnutls.h