From: Stuart Prescott <stuart@debian.org>
Date: Wed, 19 Feb 2020 13:36:39 +1100
Subject: Use pkg-config for libxml2

Bug: 949487

libxml2 no longer includes xml2-config; use pkg-config to get the relevant
compiler flags instead.
---
 Makefile.skel | 4 ++--
 configure     | 5 +----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/Makefile.skel b/Makefile.skel
index 8276fe3..9154d9a 100644
--- a/Makefile.skel
+++ b/Makefile.skel
@@ -41,8 +41,8 @@ VERSION_MIN = 9
 VERSION_REV = 2
 DATE    = 19/09/2012
 
-COMPILE = $(CC) -Wall -g `xml2-config --cflags` `gsl-config --cflags` -c -I $(CWD)/src
-LIBS    = $(LINK_FFTW) `xml2-config --libs` `gsl-config --libs` $(LINK_READLINE) -lz -lpng $(LINK_KPATHSEA) -lm
+COMPILE = $(CC) -Wall -g `pkg-config --cflags libxml-2.0` `gsl-config --cflags` -c -I $(CWD)/src
+LIBS    = $(LINK_FFTW) `pkg-config --libs libxml-2.0` `gsl-config --libs` $(LINK_READLINE) -lz -lpng $(LINK_KPATHSEA) -lm
 LINK    = $(CC) -Wall -g
 
 OPTIMISATION = -O2
diff --git a/configure b/configure
index db9eb89..52437f9 100755
--- a/configure
+++ b/configure
@@ -276,10 +276,7 @@ fi
 # 16. CHECK TO SEE WHETHER THIS SYSTEM HAS LIBXML2 HEADERS
 
 echo $ECHO_N "Checking for libxml2-dev       ............. $ECHO_C"
-whichout=`which xml2-config 2> conf.stderr`
-rm -f conf.*
-if test "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout="" ; fi
-if test "$whichout" != "" ; then
+if pkg-config --exists libxml-2.0 ; then
  echo "YES"
 else
  echo "NO"
