From d693cc6d1572d69c93b4e398008e328a9c5876a5 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Fri, 8 Aug 2014 19:49:46 +0300 Subject: [PATCH] autotools: check for expat.h if pkg-config failed Some distros provides libexpat without expat.pc. So PKG_CHECK_MODULES fails even if libexpat is installed. To fix this AC_CHECK_HEADER added back. --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 16bb133..53c0c50 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,8 @@ if test "x$with_libxml2" != xno; then CFLAGS=$old_CFLAGS fi else - PKG_CHECK_MODULES([expat], [expat >= 2.0.0], [], [AC_MSG_ERROR([expat not found; expat required.])]) + PKG_CHECK_MODULES([expat], [expat >= 2.0.0], [], + [AC_CHECK_HEADER(expat.h, [expat_LIBS="-lexpat"], [AC_MSG_ERROR([expat not found; expat required.])])]) fi if test "x$with_libxml2" = xyes; then