592250e
Use pkg-config for Mozilla NSS library detection
592250e
592250e
Author: Jan Vcelak <jvcelak@redhat.com>
592250e
592250e
---
592250e
 configure.in | 22 +++++-----------------
592250e
 1 file changed, 5 insertions(+), 17 deletions(-)
592250e
592250e
diff --git a/configure.in b/configure.in
592250e
index ecffe30..2a9cfb4 100644
592250e
--- a/configure.in
592250e
+++ b/configure.in
592250e
@@ -1223,28 +1223,16 @@ if test $ol_link_tls = no ; then
592250e
 	fi
592250e
 fi
592250e
 
592250e
-dnl NOTE: caller must specify -I/path/to/nspr4 and -I/path/to/nss3
592250e
-dnl and -L/path/to/nspr4 libs and -L/path/to/nss3 libs if those libs
592250e
-dnl are not in the default system location
592250e
 if test $ol_link_tls = no ; then
592250e
 	if test $ol_with_tls = moznss || test $ol_with_tls = auto ; then
592250e
-		have_moznss=no
592250e
-		AC_CHECK_HEADERS([nssutil.h])
592250e
-		if test "$ac_cv_header_nssutil_h" = yes ; then
592250e
-			AC_CHECK_LIB([nss3], [NSS_Initialize],
592250e
-						 [ have_moznss=yes ], [ have_moznss=no ])
592250e
-		fi
592250e
+		PKG_CHECK_MODULES(MOZNSS, [nss nspr], [have_moznss=yes], [have_moznss=no])
592250e
 
592250e
-		if test "$have_moznss" = yes ; then
592250e
+		if test $have_moznss = yes ; then
592250e
 			ol_with_tls=moznss
592250e
 			ol_link_tls=yes
592250e
-			AC_DEFINE(HAVE_MOZNSS, 1, 
592250e
-					  [define if you have MozNSS])
592250e
-			TLS_LIBS="-lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4"
592250e
-		else
592250e
-			if test $ol_with_tls = moznss ; then
592250e
-			AC_MSG_ERROR([MozNSS not found - please specify the location to the NSPR and NSS header files in CPPFLAGS and the location to the NSPR and NSS libraries in LDFLAGS (if not in the system location)])
592250e
-			fi
592250e
+			AC_DEFINE(HAVE_MOZNSS, 1, [define if you have MozNSS])
592250e
+			TLS_LIBS="$MOZNSS_LIBS"
592250e
+			CFLAGS="$CFLAGS $MOZNSS_CFLAGS"
592250e
 		fi
592250e
 	fi
592250e
 fi
592250e
-- 
592250e
1.7.11.7
592250e