diff -Naur dia-0.97.3ORIG/configure.in dia-0.97.3/configure.in
--- dia-0.97.3ORIG/configure.in	2014-09-05 23:05:27.000000000 +0800
+++ dia-0.97.3/configure.in	2017-05-08 19:27:25.947373399 +0800
@@ -68,14 +68,14 @@
   dnl On Solaris with Forte C, at least, need to link app/dia with -lfreetype.
   dnl It's not enough that -lpangoft2 implicitly pulls it in.
   have_freetype=false
-  AC_CHECK_LIB(freetype,FT_Init_FreeType,have_freetype=true,have_freetype=false,`freetype-config --libs`)
+  AC_CHECK_LIB(freetype,FT_Init_FreeType,have_freetype=true,have_freetype=false,`pkg-config --libs freetype2`)
   if test "$have_freetype" = "true"; then
     dnl Need 2.0.9, as a bug was fixed for us there.
     dnl However, freetype-config doesn't give a meaningful version, so we must
     dnl do it like this.
     AC_MSG_CHECKING([if FreeType version is 2.0.9 or higher])
     old_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS `freetype-config --cflags`"
+    CPPFLAGS="$CPPFLAGS `pkg-config --cflags freetype2`"
     AC_TRY_CPP([#include <ft2build.h>
 #include FT_FREETYPE_H
 #if (FREETYPE_MAJOR*1000+FREETYPE_MINOR)*1000+FREETYPE_PATCH < 2000009
@@ -83,9 +83,9 @@
 #endif
 ],
         [AC_MSG_RESULT(yes)
-	 FREETYPE_LIBS=`freetype-config --libs`
+	 FREETYPE_LIBS=`pkg-config --libs freetype2`
 	 AC_SUBST(FREETYPE_LIBS)
-	 FREETYPE_CFLAGS=`freetype-config --cflags`
+	 FREETYPE_CFLAGS=`pkg-config --cflags freetype2`
 	 AC_SUBST(FREETYPE_CFLAGS)
 	 GTK_MODULES="$GTK_MODULES pangoft2"
 	 AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library])]
@@ -318,16 +318,16 @@
 
 found_libxml=false
 if test $found_libxml = false; then
-  AC_CHECK_PROG(XML2_CONFIG, xml2-config, xml2-config)
+  AC_CHECK_PROG(XML2_CONFIG, pkg-config, pkg-config)
   if test "x$XML2_CONFIG" != x ; then
     AC_MSG_CHECKING(for libxml >= 2.3.9)
-    vers=`$XML2_CONFIG --version | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-
+    vers=`pkg-config --version libxml-2.0 | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+    vers=2003009
     if test "$vers" -ge 2003009; then
       AC_MSG_RESULT(found)
       found_libxml=true
-      XML_LIBS="`$XML2_CONFIG --libs`"
-      XML_CFLAGS="`$XML2_CONFIG --cflags`"
+      XML_LIBS="`pkg-config --libs libxml-2.0`"
+      XML_CFLAGS="`pkg-config --cflags libxml-2.0`"
 
       if test "$enable_gnome_print" = "yes"; then
           gnome-config --cflags print | \
@@ -348,14 +348,14 @@
 AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config)
 if test "x$XML_CONFIG" != x ; then
   AC_MSG_CHECKING(for libxml >= 1.8.14)
-  vers=`$XML_CONFIG --version | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+  vers=`pkg-config --version libxml-2.0 | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
 
   dnl 1.18.14 is required for xmlUseNewParser()    
   if test "$vers" -ge 1008014; then
     AC_MSG_RESULT(found)
     found_libxml=true
-    XML_LIBS="`$XML_CONFIG --libs`"
-    XML_CFLAGS="`$XML_CONFIG --cflags`"
+    XML_LIBS="`pkg-config --libs libxml-2.0`"
+    XML_CFLAGS="`pkg-config --cflags libxml-2.0`"
   else
     AC_MSG_RESULT(not found)
   fi
