From 31a7f0d43cdbed13bde771062ef048ed33b5e3d9 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Tue, 27 Oct 2020 16:40:08 -0400 Subject: [PATCH] [build] detect nss3/nss.h or nss/nss.h for NSS --- configure.ac | 1 + src/CMakeLists.txt | 4 +++- src/meson.build | 5 +++++ src/sys-crypto.h | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8a0fd423..cca65e3b 100644 --- a/configure.ac +++ b/configure.ac @@ -892,6 +892,7 @@ if test "x$use_nss" = "xyes"; then PKG_CHECK_MODULES([NSS],[nss]) CPPFLAGS="$CPPFLAGS -I/usr/include/nspr4" fi + AC_DEFINE([HAVE_NSS_NSS_H], [1], [nss/nss.h]) AC_DEFINE([HAVE_NSS3_NSS_H], [1], [nss3/nss.h]) AC_SUBST([NSS_CFLAGS]) AC_SUBST([NSS_LIBS]) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2029da75..16ff59ec 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -399,8 +399,9 @@ else() endif() if(WITH_NSS) + check_include_files(nss/nss.h HAVE_NSS_NSS_H) check_include_files(nss3/nss.h HAVE_NSS3_NSS_H) - if(HAVE_NSS3_NSS_H) + if(HAVE_NSS3_NSS_H OR HAVE_NSS_NSS_H) check_library_exists(ssl3 NSSSSL_GetVersion "" HAVE_LIBSSL3) if(HAVE_LIBSSL3) check_library_exists(smime3 NSSSMIME_GetVersion "" HAVE_LIBSMIME3) @@ -413,6 +414,7 @@ if(WITH_NSS) endif() endif() else() + unset(HAVE_NSS_NSS_H) unset(HAVE_NSS3_NSS_H) unset(HAVE_LIBSSL3) unset(HAVE_LIBSMIME3) diff --git a/src/meson.build b/src/meson.build index 008e48fe..6561aecf 100644 --- a/src/meson.build +++ b/src/meson.build @@ -482,6 +482,11 @@ if get_option('with_nss') != 'false' libnssutil3 = [ dependency('libnssutil3') ] conf_data.set('HAVE_NSS3_NSS_H', true) endif +if get_option('with_nss') != 'false' + # manual search: + # header: nss/nss.h + conf_data.set('HAVE_NSS_NSS_H', true) +endif libpcre = [] if get_option('with_pcre') diff --git a/src/sys-crypto.h b/src/sys-crypto.h index 26c14af0..fb60e4d3 100644 --- a/src/sys-crypto.h +++ b/src/sys-crypto.h @@ -35,6 +35,10 @@ #endif #endif #endif +#ifdef HAVE_NSS_NSS_H +#define USE_LIB_CRYPTO +#define USE_NSS_CRYPTO +#endif #ifdef HAVE_NETTLE_NETTLE_TYPES_H #define USE_LIB_CRYPTO