summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorminfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68>2009-01-04 16:28:51 +0000
committerminfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68>2009-01-04 16:28:51 +0000
commit57950dee96bdfc8595e9198e1715dfdbd422351f (patch)
treebe1808948aea37bdf6cd0dba7716e0415bdadcc4
parente52103bf0dd2eab26cfa18d41571019287699afb (diff)
downloadlibapr-util-57950dee96bdfc8595e9198e1715dfdbd422351f.tar.gz
apr_crypto_nss: Oh that it was this easy. Use pgk-config to find
NSS where possible. git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@731291 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES3
-rw-r--r--build/crypto.m428
-rw-r--r--crypto/apr_crypto_nss.c13
3 files changed, 20 insertions, 24 deletions
diff --git a/CHANGES b/CHANGES
index f60794b1..287abb96 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes with APR-util 1.4.0
+ *) apr_crypto_nss: Oh that it was this easy. Use pgk-config to find
+ NSS where possible. [Graham Leggett]
+
*) apr_crypto_nss: The nss.h header file could be in nss or nss3, the
prerror.h header file could be in nspr4. [Graham Leggett]
diff --git a/build/crypto.m4 b/build/crypto.m4
index 7a418669..e1a9500d 100644
--- a/build/crypto.m4
+++ b/build/crypto.m4
@@ -139,10 +139,17 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
nss_have_libs=0
AC_ARG_WITH([nss],
- [APR_HELP_STRING([--with-nss=DIR], [specify location of OpenSSL])],
+ [APR_HELP_STRING([--with-nss=DIR], [specify location of NSS])],
[
if test "$withval" = "yes"; then
- AC_CHECK_HEADERS(prerror.h nspr4/prerror.h nss/nss.h nss3/nss.h nss/pk11pub.h nss3/pk11pub.h, [nss_have_headers=1])
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+ if test -n "$PKG_CONFIG"; then
+ nss_CPPFLAGS=`$PKG_CONFIG --cflags-only-I nss`
+ nss_LDFLAGS=`$PKG_CONFIG --libs nss`
+ APR_ADDTO(CPPFLAGS, [$nss_CPPFLAGS])
+ APR_ADDTO(LDFLAGS, [$nss_LDFLAGS])
+ fi
+ AC_CHECK_HEADERS(prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h, [nss_have_headers=1])
AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID, [nss_have_libs=1],,-lnspr4))
if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then
apu_have_nss=1
@@ -160,27 +167,18 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
APR_ADDTO(LDFLAGS, [$nss_LDFLAGS])
AC_MSG_NOTICE(checking for nss in $withval)
- AC_CHECK_HEADERS(prerror.h nspr4/prerror.h nss/nss.h nss3/nss.h nss/pk11pub.h nss3/pk11pub.h, [nss_have_headers=1])
+ AC_CHECK_HEADERS(prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h, [nss_have_headers=1])
AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID, [nss_have_libs=1],,-lnspr4))
if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then
apu_have_nss=1
- APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
- APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include -I$withval/../public])
- fi
-
- if test "$apu_have_nss" != "1"; then
- AC_CHECK_HEADERS(prerror.h nspr4/prerror.h nss/nss.h nss3/nss.h nss/pk11pub.h nss3/pk11pub.h, [nss_have_headers=1])
- AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID, [nss_have_libs=1],,-lnspr4))
- if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then
- apu_have_nss=1
- APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
- APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include -I$withval/../public])
- fi
fi
CPPFLAGS="$old_cppflags"
LDFLAGS="$old_ldflags"
fi
+ if test "$apu_have_nss" != "0"; then
+ APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$nss_CPPFLAGS])
+ fi
], [
apu_have_nss=0
])
diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c
index 29a79bbb..89ba1274 100644
--- a/crypto/apr_crypto_nss.c
+++ b/crypto/apr_crypto_nss.c
@@ -30,25 +30,20 @@
#if APU_HAVE_CRYPTO
-#ifdef HAVE_PRERROR_H
#include <prerror.h>
-#endif
-#ifdef HAVE_NSPR4_PRERROR_H
-#include <nspr4/prerror.h>
-#endif
#ifdef HAVE_NSS_NSS_H
#include <nss/nss.h>
#endif
-#ifdef HAVE_NSS3_NSS_H
-#include <nss3/nss.h>
+#ifdef HAVE_NSS_H
+#include <nss.h>
#endif
#ifdef HAVE_NSS_PK11PUB_H
#include <nss/pk11pub.h>
#endif
-#ifdef HAVE_NSS3_PK11PUB_H
-#include <nss3/pk11pub.h>
+#ifdef HAVE_PK11PUB_H
+#include <pk11pub.h>
#endif
struct apr_crypto_config_t {