From: Diego Elio 'Flameeyes' Pettenò Date: Fri, 27 Aug 2010 14:41:25 +0000 (+0200) Subject: build system: use consistently pkg-config to check for dependencies X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/a120a113216001e3fe8156ad0ab23d188b7d36c4?ds=sidebyside;hp=cb04fb58b1acdea0a50136b074bdbc1f5f4fa709 build system: use consistently pkg-config to check for dependencies 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 --- 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"