From: Greg Kroah-Hartman Date: Wed, 18 Aug 2010 00:00:33 +0000 (-0700) Subject: fix up the autoconf checking for liboauth and other libraries X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/84465579856f9c7b3a41e6a0b87297dcf1df0bb0 fix up the autoconf checking for liboauth and other libraries Start using pkg-config as its supposed to be used (hopefully) Signed-off-by: Greg Kroah-Hartman --- diff --git a/Makefile.am b/Makefile.am index 1e8f12f..46ccbba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,18 @@ bin_SCRIPTS = \ bti_SOURCES = \ bti.c +bti_CPPFLAGS = + $(LIBCURL_CPPFLAGS) \ + $(XML_CPPFLAGS) \ + $(LIBPCRE_CPPFLAGS) \ + $(LIBOAUTH_CPPFLAGS) + +bti_LDADD = \ + $(LIBCURL_LIBS) \ + $(XML_LIBS) \ + $(LIBPCRE_LIBS) \ + $(LIBOAUTH_LIBS) + dist_man_MANS = \ bti.1 \ bti-shrink-urls.1 diff --git a/configure.ac b/configure.ac index afeba02..c97c260 100644 --- a/configure.ac +++ b/configure.ac @@ -16,33 +16,31 @@ AC_PATH_PROG([XSLTPROC], [xsltproc]) dnl FIXME: Replace `main' with a function in `-lnsl': AC_CHECK_LIB([nsl], [main]) -AC_CHECK_LIB([pcre], [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) -AC_CHECK_LIB(oauth, main, [], [ - echo "Error, you need liboauth to build properly." - exit -1 - ]) # 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]) -else - CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" - LIBS="${LIBS} ${LIBCURL}" 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]) -else - CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" - LIBS="$LIBS $XML_LIBS" fi # explicitly link DSOs -LIBS="$LIBS -ldl -loauth" +LIBS="$LIBS -ldl" dnl Checks for header files.