From 846d92c737bb12157b8720b46d3bc3bcbd8b05fd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 7 Nov 2010 16:31:53 -0600 Subject: [PATCH] build: work around pkg-config bug #29801 PKG_CHECK_MODULES() succeeds even if the module's dependencies are not satisfied, leading to empty CFLAGS and LIBS. --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index d784f098ba..54e1acf795 100644 --- a/configure.ac +++ b/configure.ac @@ -281,6 +281,18 @@ with_nss=no with_gnutls=no if test x"$ac_crypto" = xnss; then PKG_CHECK_MODULES(NSS, [nss >= 3.11]) + + # Work around a pkg-config bug (fdo #29801) where exists != usable + AC_PATH_PROG(PKGCONFIG_PATH, pkg-config, no) + if test x"$PKGCONFIG_PATH" = xno; then + AC_MSG_ERROR([pkgconfig required but not found]) + else + `$PKGCONFIG_PATH --cflags --libs nss` + if test x"$?" != "x0"; then + AC_MSG_ERROR([No usable NSS found]) + fi + fi + AC_SUBST(NSS_CFLAGS) AC_SUBST(NSS_LIBS) AC_DEFINE(HAVE_NSS, 1, [Define if you have NSS])