From c2b451532721deb75c155433245892f0177df998 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 7 Apr 2017 13:43:33 +0100 Subject: [PATCH 1/2] Autotools build: Use pkg-config to find libexpat The version of expat that added the .pc file was released in 2012. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69801 Signed-off-by: Simon McVittie --- bus/Makefile.am | 6 +++--- configure.ac | 12 +----------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/bus/Makefile.am b/bus/Makefile.am index b347d466..c1ccaf1b 100644 --- a/bus/Makefile.am +++ b/bus/Makefile.am @@ -6,7 +6,7 @@ systemdsysusersdir = $(prefix)/lib/sysusers.d DBUS_BUS_LIBS = \ $(CODE_COVERAGE_LDFLAGS) \ - $(XML_LIBS) \ + $(EXPAT_LIBS) \ $(SELINUX_LIBS) \ $(APPARMOR_LIBS) \ $(THREAD_LIBS) \ @@ -16,7 +16,7 @@ DBUS_BUS_LIBS = \ DBUS_LAUNCHER_LIBS = \ $(CODE_COVERAGE_LDFLAGS) \ - $(XML_LIBS) \ + $(EXPAT_LIBS) \ $(THREAD_LIBS) \ $(NETWORK_libs) \ $(NULL) @@ -25,7 +25,7 @@ AM_CPPFLAGS = \ $(CODE_COVERAGE_CPPFLAGS) \ -I$(top_srcdir) \ $(DBUS_STATIC_BUILD_CPPFLAGS) \ - $(XML_CFLAGS) \ + $(EXPAT_CFLAGS) \ $(APPARMOR_CFLAGS) \ -DDBUS_SYSTEM_CONFIG_FILE=\""$(dbusdatadir)/system.conf"\" \ -DDBUS_COMPILATION \ diff --git a/configure.ac b/configure.ac index 97f5ff2b..f9df971f 100644 --- a/configure.ac +++ b/configure.ac @@ -933,17 +933,7 @@ fi # unix:path=/foo or unix:abstract=/foo AC_SUBST(DBUS_PATH_OR_ABSTRACT) -#### Sort out XML library - -AC_CHECK_LIB(expat, XML_ParserCreate_MM, - [ AC_CHECK_HEADERS(expat.h, [], - [AC_MSG_ERROR([Could not find expat.h, check config.log for failed attempts])]) ], - [ AC_MSG_ERROR([Explicitly requested expat but expat not found]) ]) - -XML_LIBS=-lexpat -XML_CFLAGS= -AC_SUBST([XML_CFLAGS]) -AC_SUBST([XML_LIBS]) +PKG_CHECK_MODULES([EXPAT], [expat]) # Thread lib detection AC_ARG_VAR([THREAD_LIBS]) -- 2.11.0