[PATCH] Fallback to older detection code if pkg-config can't find expat

Bill Spitzak spitzak at gmail.com
Fri Jan 30 17:23:26 PST 2015


On older expat versions there is no pkg-config file, so fall back to
the previous test for the header file and library if it fails.

This paritally reverts commit a4afd90f9f0c27ed5f3f313b915c260673f8be34.
---
 Makefile.am  |    1 -
 configure.ac |    7 ++++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 0fccf86..43b741a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,7 +65,6 @@ if ENABLE_SCANNER
 wayland_scanner = $(top_builddir)/wayland-scanner
 bin_PROGRAMS = wayland-scanner
 wayland_scanner_SOURCES = src/scanner.c
-wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
 wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
 $(BUILT_SOURCES) : wayland-scanner
 pkgconfig_DATA += src/wayland-scanner.pc
diff --git a/configure.ac b/configure.ac
index 97222f0..f7610e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,12 @@ AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
 AC_SUBST([ICONDIR])
 
 if test "x$enable_scanner" = "xyes"; then
-	PKG_CHECK_MODULES(EXPAT, [expat])
+	PKG_CHECK_MODULES(EXPAT, [expat],,
+        [AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
+		[AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
+	AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
+		[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
+	AC_SUBST(EXPAT_LIBS)])
 fi
 
 AC_PATH_PROG(XSLTPROC, xsltproc)
-- 
1.7.9.5



More information about the wayland-devel mailing list