summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-11-02 10:02:40 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-11-02 10:02:40 +0200
commit8afe81c21445f96e4f5430b05304242c958a9ad0 (patch)
treeac18f50cccc3d07bff97006995221ee7519fcac4 /configure.ac
parente7fd0807d3b0a024634bc62a3bf2571a1bd6098d (diff)
downloadrpm-8afe81c21445f96e4f5430b05304242c958a9ad0.tar.gz
rpm-8afe81c21445f96e4f5430b05304242c958a9ad0.tar.bz2
rpm-8afe81c21445f96e4f5430b05304242c958a9ad0.zip
Use NSS instead of beecrypt for encryption (Tomas Mraz)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac36
1 files changed, 23 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index a9423d123..d79e10a0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -351,22 +351,32 @@ AC_CHECK_HEADERS([dwarf.h], [
AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes])
#=================
-# Check for beecrypt library.
-WITH_BEECRYPT_INCLUDE=
-WITH_BEECRYPT_LIB=
-AC_CHECK_HEADERS([beecrypt/beecrypt.h], [
- AC_CHECK_LIB(beecrypt, mpfprintln, [
- AC_CHECK_HEADERS([beecrypt/api.h])
- WITH_BEECRYPT_INCLUDE=
- WITH_BEECRYPT_LIB="-lbeecrypt"
- ],[
- AC_MSG_ERROR([missing required library beecrypt])
+# Check for NSS library.
+WITH_NSS_INCLUDE=
+WITH_NSS_LIB=
+check=`pkg-config --version 2>/dev/null`
+if test -n "$check"; then
+ addlib=$(pkg-config --libs nss | sed 's/-lsmime3//;s/-lssl3//')
+ addcppflags=$(pkg-config --cflags nss)
+else
+# Without pkg-config, we'll kludge in some defaults
+ addlib="-lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
+ addcppflags="-I/usr/include/nss3 -I/usr/include/nspr4"
+fi
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$save_CPPFLAGS $addcppflags"
+AC_CHECK_HEADER([nss3/nss.h], [
+ AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
+ AC_DEFINE(HAVE_LIBNSS, 1, [Define to 1 if you have the 'NSS' library (-lnss3).])
+ WITH_NSS_INCLUDE="$addcppflags"
+ WITH_NSS_LIB="$addlib"
])
],[
- AC_MSG_ERROR([missing required header beecrypt/beecrypt.h])
+ AC_MSG_ERROR([missing required header nss3/nss.h])
])
-AC_SUBST(WITH_BEECRYPT_INCLUDE)
-AC_SUBST(WITH_BEECRYPT_LIB)
+CPPFLAGS="$save_CPPFLAGS"
+AC_SUBST(WITH_NSS_INCLUDE)
+AC_SUBST(WITH_NSS_LIB)
#=================
# Check for magic library.