Fix compilation with old NSS (no GetVersion).

This commit is contained in:
Milan Broz
2012-05-27 22:35:14 +02:00
parent a5cc87b4a5
commit aba52fa878
2 changed files with 10 additions and 0 deletions

View File

@@ -140,6 +140,12 @@ AC_DEFUN([CONFIGURE_NSS], [
PKG_CHECK_MODULES([NSS], [nss],, PKG_CHECK_MODULES([NSS], [nss],,
AC_MSG_ERROR([You need nss library.])) AC_MSG_ERROR([You need nss library.]))
saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $NSS_CFLAGS"
AC_CHECK_DECLS([NSS_GetVersion], [], [], [#include <nss.h>])
CFLAGS=$saved_CFLAGS
CRYPTO_CFLAGS=$NSS_CFLAGS CRYPTO_CFLAGS=$NSS_CFLAGS
CRYPTO_LIBS=$NSS_LIBS CRYPTO_LIBS=$NSS_LIBS
NO_FIPS([]) NO_FIPS([])

View File

@@ -76,7 +76,11 @@ int crypt_backend_init(struct crypt_device *ctx)
if (NSS_NoDB_Init(".") != SECSuccess) if (NSS_NoDB_Init(".") != SECSuccess)
return -EINVAL; return -EINVAL;
#if HAVE_DECL_NSS_GETVERSION
snprintf(version, 64, "NSS %s", NSS_GetVersion()); snprintf(version, 64, "NSS %s", NSS_GetVersion());
#else
snprintf(version, 64, "NSS");
#endif
crypto_backend_initialised = 1; crypto_backend_initialised = 1;
return 0; return 0;
} }