From a120a113216001e3fe8156ad0ab23d188b7d36c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Diego=20Elio=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 27 Aug 2010 16:41:25 +0200 Subject: [PATCH 1/1] build system: use consistently pkg-config to check for dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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ò Signed-off-by: Greg Kroah-Hartman --- Makefile.am | 10 +++++----- configure.ac | 20 ++------------------ 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7799e4a..7b5953e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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) \ diff --git a/configure.ac b/configure.ac index f19ff0e..a415f3f 100644 --- a/configure.ac +++ b/configure.ac @@ -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" -- 2.39.5