Use pkg-config to detect Expat library.
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 30 May 2015 21:32:17 +0000 (23:32 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 30 May 2015 21:32:17 +0000 (23:32 +0200)
configure.ac
src/plugins/rssyl/Makefile.am

index 60cca19..c4df03d 100644 (file)
@@ -1069,14 +1069,9 @@ AC_SUBST(CURL_LIBS)
 AC_SUBST(CURL_CFLAGS)
 
 dnl expat **********************************************************************
-HAVE_EXPAT=no
-AC_CHECK_HEADER(expat.h, [expat_header=yes], [])
-AC_CHECK_LIB(expat, XML_ParserCreate, [expat_lib=yes], [])
-if test x"$expat_header" = xyes -a x"$expat_lib"=xyes; then
-       HAVE_EXPAT=yes
-       AC_DEFINE(HAVE_EXPAT, 1, [Define if expat is available])
-       EXPAT_LIBS="-lexpat"
-fi
+PKG_CHECK_MODULES(EXPAT, expat, HAVE_EXPAT=yes, HAVE_EXPAT=no)
+AC_SUBST(EXPAT_LIBS)
+AC_SUBST(EXPAT_CFLAGS)
 
 dnl webkit *********************************************************************
 PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= 1.1.14, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
index 6d71d78..12b663a 100644 (file)
@@ -63,6 +63,8 @@ endif
 rssyl_la_LDFLAGS = \
        $(plugin_res_ldflag) $(no_undefined) $(export_symbols) \
        -avoid-version -module \
+       $(EXPAT_LIBS) \
+       $(CURL_LIBS) \
        $(GTK_LIBS)
 
 rssyl_la_DEPENDENCIES = $(plugin_deps) libfeed/libfeed.la
@@ -74,7 +76,8 @@ rssyl_la_CPPFLAGS = \
        $(IFLAGS) \
        $(GLIB_CFLAGS) \
        $(GTK_CFLAGS) \
-       $(CURL_CFLAGS)
+       $(CURL_CFLAGS) \
+       $(EXPAT_CFLAGS)
 
 rssyl_la_SOURCES = \
        old_feeds.c old_feeds.h \