build system: use consistently pkg-config to check for dependencies
authorDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 27 Aug 2010 14:41:25 +0000 (16:41 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Aug 2010 23:43:30 +0000 (16:43 -0700)
Rather than rely on the old m4 macros for libxml2 and libcurl, which were
also misused, always use PKG_CHECK_MODULES (also assuming a new enough
version that calls AC_SUBST by itself), and fix the Makefile.am to use
_CFLAGS properly as well.

Signed-off-by: Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Makefile.am
configure.ac

index 7799e4a..7b5953e 100644 (file)
@@ -7,11 +7,11 @@ bin_SCRIPTS = \
 bti_SOURCES = \
        bti.c
 
-bti_CPPFLAGS = \
-       $(LIBCURL_CPPFLAGS) \
-       $(XML_CPPFLAGS) \
-       $(LIBPCRE_CPPFLAGS) \
-       $(LIBOAUTH_CPPFLAGS)
+bti_CFLAGS = \
+       $(LIBCURL_CFLAGS) \
+       $(XML_CFLAGS) \
+       $(LIBPCRE_CFLAGS) \
+       $(LIBOAUTH_CFLAGS)
 
 bti_LDADD = \
        $(LIBCURL_LIBS) \
index f19ff0e..a415f3f 100644 (file)
@@ -19,25 +19,9 @@ AC_CHECK_LIB([nsl], [main])
 PKG_PROG_PKG_CONFIG()
 
 PKG_CHECK_MODULES(LIBOAUTH, oauth)
-AC_SUBST(LIBOAUTH_CFLAGS)
-AC_SUBST(LIBOAUTH_LIBS)
-
 PKG_CHECK_MODULES(LIBPCRE, libpcre)
-AC_SUBST(LIBPCRE_CFLAGS)
-AC_SUBST(LIBPCRE_LIBS)
-
-
-# CURL
-LIBCURL_CHECK_CONFIG([yes], [], [have_libcurl="yes"], [have_libcurl="no"])
-if test "${have_libcurl}" != yes; then
-       AC_MSG_ERROR([libcurl library not found, please install it])
-fi
-
-# libxml2
-AM_PATH_XML2([], [have_libxml="yes"], [have_libxml="no"])
-if test "${have_libxml}" != yes; then
-       AC_MSG_ERROR([libxml not found, please install it])
-fi
+PKG_CHECK_MODULES([LIBCURL], [libcurl])
+PKG_CHECK_MODULES([XML], [libxml-2.0])
 
 # explicitly link DSOs
 LIBS="$LIBS -ldl"