From 79fe0e0e3bd375c02a6f182508a6feea85379e3c Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 19 Aug 2008 13:33:21 +0300 Subject: [PATCH] Use standard auto*foo checks for NSS - upstream NSPR/NSS doesn't ship pkg-config files (unfortunately) - hardcoded guesses are always wrong for somebody, expect builder to pass in appropriate CPPFLAGS etc --- configure.ac | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 632dfa0..2a8576a 100644 --- a/configure.ac +++ b/configure.ac @@ -342,29 +342,19 @@ AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes]) #================= # Check for NSS library. +# We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS +# have a header named nss.h... so make extra check for NSS's sechash.h +# which we use too and hopefully is slightly more unique to NSS. 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 nss3/nss.h]) +AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [ + AC_MSG_ERROR([missing required NSPR / NSS header]) +]) +AC_CHECK_LIB(nss3, NSS_NoDB_Init, [ + WITH_NSS_LIB=-lnss3 +], [ + AC_MSG_ERROR([missing required NSS library 'nss3']) ]) -CPPFLAGS="$save_CPPFLAGS" AC_SUBST(WITH_NSS_INCLUDE) AC_SUBST(WITH_NSS_LIB) -- 2.7.4