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.
This commit is contained in:
Dan Williams 2010-11-07 16:31:53 -06:00
parent 68e4d31629
commit 846d92c737

View file

@ -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])