configure.ac: use pkg-config to find expat

This is now done in the same way as the libffi dependency and still
allows the library to be installed in a non-standard location (with
PKG_CONFIG_PATH).
This commit is contained in:
Andrew Oakley 2015-01-27 17:18:13 +00:00 committed by Bryce Harrington
parent cd0cf5a106
commit a4afd90f9f
2 changed files with 2 additions and 10 deletions

View file

@ -65,6 +65,7 @@ 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

View file

@ -84,17 +84,8 @@ AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
[ ICONDIR=${datadir}/icons])
AC_SUBST([ICONDIR])
EXPAT_LIB=""
AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
[ expat=$withval
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib" ] )
if test "x$enable_scanner" = "xyes"; then
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)
PKG_CHECK_MODULES(EXPAT, [expat])
fi
AC_PATH_PROG(XSLTPROC, xsltproc)