summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-06-07 20:20:17 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-06-07 20:21:13 +0200
commit18cb0a89d3eb08847fc3ecc8cd9438bb88c7b4fa (patch)
tree1c5362536fc4df64222c6b837d9e1bae5d958456 /configure.ac
parent91b0db8967863694dee39d9722895e153ca8d580 (diff)
downloadgnutls-18cb0a89d3eb08847fc3ecc8cd9438bb88c7b4fa.tar.gz
The attached patch ports gnutls to p11-kit.
p11-kit is added as a dependency. p11-kit itself has no dependencies outside of basic libc stuff. The source code for p11-kit is available both in git and tarball form. [3] If the gnutls dependency on p11-kit is disabled (via a configure option) then the PKCS#11 support is disabled. This is useful in bare bones embedded systems or places where very minimal dependencies are limited.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 14 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index a0f962f796..e16894aebb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,8 +119,19 @@ AC_CHECK_FUNCS(fork,,)
AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no")
AC_CHECK_FUNCS(getrusage,,)
AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
-dnl for pakchois
-AC_LIB_HAVE_LINKFLAGS(dl,, [#include <dlfcn.h>], [dlclose (0);])
+
+dnl Check for p11-kit
+AC_ARG_WITH(p11-kit,
+ AS_HELP_STRING([--without-p11-kit],
+ [Build without p11-kit and PKCS#11 support]))
+AM_CONDITIONAL(ENABLE_PKCS11, test "$with_p11_kit" != "no")
+if test "$with_p11_kit" != "no"; then
+ PKG_CHECK_MODULES(P11_KIT, [p11-kit-1])
+ AC_DEFINE(ENABLE_PKCS11, 1, [Build PKCS#11 support])
+ CFLAGS="$CFLAGS $P11_KIT_CFLAGS"
+ LIBS="$LIBS $P11_KIT_LIBS"
+ with_p11_kit=yes
+fi
dnl Check for libcfg+
SAVED_LIBS=$LIBS
@@ -434,4 +445,5 @@ AC_MSG_NOTICE([summary of build options:
/dev/crypto: $enable_cryptodev
Hardware accel: $hw_accel
Crypto library: $cryptolib
+ PKCS#11 support: $with_p11_kit
])