summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugh McMaster <hugh.mcmaster@outlook.com>2022-08-08 15:14:33 +1000
committerHugh McMaster <hugh.mcmaster@outlook.com>2022-08-08 15:14:33 +1000
commita36fdfad210b087949750c8edaadbe97965a63c9 (patch)
tree94397820de7a7e864bb74ce0698053bae3c4d9c4
parentdd6c2a2191d193b2b607e4b3ab0b9c2520a8212a (diff)
downloadlibrcc-a36fdfad210b087949750c8edaadbe97965a63c9.tar.gz
librcc-a36fdfad210b087949750c8edaadbe97965a63c9.tar.bz2
librcc-a36fdfad210b087949750c8edaadbe97965a63c9.tar.xz
librcc-a36fdfad210b087949750c8edaadbe97965a63c9.zip
configure.ac: Use pkg-config to detect libxml2
-rw-r--r--configure.ac10
-rw-r--r--src/Makefile.am4
-rw-r--r--ui/Makefile.am16
3 files changed, 12 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index bff29bb..9248faa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,7 @@ dnl Checks for programs.
AC_PATH_PROG(RM, rm, /bin/rm)
AC_PATH_PROG(MV, mv, /bin/mv)
AC_PATH_PROG(TAR, tar, /bin/tar)
+PKG_PROG_PKG_CONFIG
dnl Fixing ugly libtool, see for details
dnl http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523750
@@ -78,14 +79,7 @@ dnl Checks for libraries.
dnl ***
dnl *** LibXML2 (Mandatory)
dnl ***
-AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
-if test $XML2_CONFIG = no; then
- AC_MSG_ERROR(LibXML2 is required)
-fi
-XML_LIBS="\`xml2-config --libs\`"
-XML_INCLUDES="\`xml2-config --cflags\`"
-AC_SUBST(XML_LIBS)
-AC_SUBST(XML_INCLUDES)
+PKG_CHECK_MODULES([XML2], [libxml-2.0])
dnl ***
dnl *** GTK1 (Optional)
diff --git a/src/Makefile.am b/src/Makefile.am
index 97f5526..7e6e57f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,6 +27,6 @@ librcc_la_SOURCES = librcc.c \
internal.h
include_HEADERS = librcc.h
-AM_CPPFLAGS = -I../src -DLIBRCC_DATA_DIR=\"${pkgdatadir}\" @XML_INCLUDES@ @DLOPEN_INCLUDES@ @RCD_INCLUDES@ @ENCA_INCLUDES@ @BDB_INCLUDES@ @ASPELL_CFLAGS@ @PTHREAD_CFLAGS@
-librcc_la_LIBADD = @XML_LIBS@ @DLOPEN_LIBS@ @RCD_LIBS@ @ENCA_LIBS@ @BDB_LIBS@ @ASPELL_LIBS@ @PTHREAD_LIBS@ @EXTRA_LIBS@
+AM_CPPFLAGS = -I../src -DLIBRCC_DATA_DIR=\"${pkgdatadir}\" @XML2_CFLAGS@ @DLOPEN_INCLUDES@ @RCD_INCLUDES@ @ENCA_INCLUDES@ @BDB_INCLUDES@ @ASPELL_CFLAGS@ @PTHREAD_CFLAGS@
+librcc_la_LIBADD = @XML2_LIBS@ @DLOPEN_LIBS@ @RCD_LIBS@ @ENCA_LIBS@ @BDB_LIBS@ @ASPELL_LIBS@ @PTHREAD_LIBS@ @EXTRA_LIBS@
librcc_la_LDFLAGS = -version-info @LIBRCC_VERSION_INFO@
diff --git a/ui/Makefile.am b/ui/Makefile.am
index 80151bd..9442ac7 100644
--- a/ui/Makefile.am
+++ b/ui/Makefile.am
@@ -4,7 +4,7 @@ librccui_la_SOURCES = librccui.c \
rccnames.c rccnames.h \
internal.h \
null.c
-librccui_la_LIBADD = ../src/librcc.la @XML_LIBS@
+librccui_la_LIBADD = ../src/librcc.la @XML2_LIBS@
librccui_la_LDFLAGS = -version-info @LIBRCC_VERSION_INFO@
if HAVE_GTK
@@ -14,9 +14,9 @@ librccgtk_la_SOURCES = librccui.c \
rccnames.c rccnames.h \
internal.h \
gtk.c
-librccgtk_la_LIBADD = ../src/librcc.la @GTK1_LIBS@ @XML_LIBS@
+librccgtk_la_LIBADD = ../src/librcc.la @GTK1_LIBS@ @XML2_LIBS@
librccgtk_la_LDFLAGS = -version-info @LIBRCC_VERSION_INFO@
-librccgtk_la_CPPFLAGS = -I${top_srcdir}/src @XML_INCLUDES@ @GTK1_INCLUDES@
+librccgtk_la_CPPFLAGS = -I${top_srcdir}/src @XML2_CFLAGS@ @GTK1_INCLUDES@
endif
if HAVE_GTK2
@@ -26,9 +26,9 @@ librccgtk2_la_SOURCES = librccui.c \
rccnames.c rccnames.h \
internal.h \
gtk.c
-librccgtk2_la_LIBADD = ../src/librcc.la @GTK2_LIBS@ @XML_LIBS@
+librccgtk2_la_LIBADD = ../src/librcc.la @GTK2_LIBS@ @XML2_LIBS@
librccgtk2_la_LDFLAGS = -version-info @LIBRCC_VERSION_INFO@
-librccgtk2_la_CPPFLAGS = -I${top_srcdir}/src @XML_INCLUDES@ @GTK2_CFLAGS@
+librccgtk2_la_CPPFLAGS = -I${top_srcdir}/src @XML2_CFLAGS@ @GTK2_CFLAGS@
endif
if HAVE_GTK3
@@ -38,10 +38,10 @@ librccgtk3_la_SOURCES = librccui.c \
rccnames.c rccnames.h \
internal.h \
gtk.c
-librccgtk3_la_LIBADD = ../src/librcc.la @GTK3_LIBS@ @XML_LIBS@
+librccgtk3_la_LIBADD = ../src/librcc.la @GTK3_LIBS@ @XML2_LIBS@
librccgtk3_la_LDFLAGS = -version-info @LIBRCC_VERSION_INFO@
-librccgtk3_la_CPPFLAGS = -I${top_srcdir}/src @XML_INCLUDES@ @GTK3_CFLAGS@
+librccgtk3_la_CPPFLAGS = -I${top_srcdir}/src @XML2_CFLAGS@ @GTK3_CFLAGS@
endif
-AM_CPPFLAGS = -I${top_srcdir}/src @XML_INCLUDES@
+AM_CPPFLAGS = -I${top_srcdir}/src @XML2_CFLAGS@
include_HEADERS = librccui.h