[svn-upgrade] new version bti (028) upstream/028
authorgregor herrmann <gregoa@debian.org>
Thu, 2 Sep 2010 23:11:45 +0000 (23:11 -0000)
committergregor herrmann <gregoa@debian.org>
Thu, 2 Sep 2010 23:11:45 +0000 (23:11 -0000)
ChangeLog
Makefile.am
Makefile.in
RELEASE-NOTES
aclocal.m4
bti.1
bti.c
bti.xml
configure
configure.ac

index fc23ffd..ef2183a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+Summary of changes from v027 to v028
+============================================
+
+Diego Elio 'Flameeyes' Petten√≤ (7):
+      build system: use consistently pkg-config to check for dependencies
+      build system: use AC_SEARCH_LIBS rather than assuming -ldl is needed.
+      Remove autoscan-generated bad tests.
+      Use arrays rather than pointers for static strings.
+      Typo fix.
+      Split --background from --bash, and make the latter imply the former.
+      Collapse more fprintf() calls.
+
+Greg Kroah-Hartman (7):
+      Fixup typo in Makefile.am found by @applehq
+      new version of checkpatch.pl from 2.6.35-rc1 kernel
+      whitespace cleanups for bti.c
+      more formatting cleanups
+      long line cleanups
+      Update my copyright date.
+      Reduce the number of calls to fprintf.
+
+
 Summary of changes from v026 to v027
 ============================================
 
index 46ccbba..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 6594594..c13ebb2 100644 (file)
@@ -55,7 +55,9 @@ am_bti_OBJECTS = bti-bti.$(OBJEXT)
 bti_OBJECTS = $(am_bti_OBJECTS)
 am__DEPENDENCIES_1 =
 bti_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-       $(am__DEPENDENCIES_1)
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+bti_LINK = $(CCLD) $(bti_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+       $@
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -143,8 +145,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
-LIBCURL = @LIBCURL@
-LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
 LIBOAUTH_CFLAGS = @LIBOAUTH_CFLAGS@
 LIBOAUTH_LIBS = @LIBOAUTH_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -168,11 +170,9 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
-XML2_CONFIG = @XML2_CONFIG@
-XML_CPPFLAGS = @XML_CPPFLAGS@
+XML_CFLAGS = @XML_CFLAGS@
 XML_LIBS = @XML_LIBS@
 XSLTPROC = @XSLTPROC@
-_libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -221,7 +221,12 @@ bin_SCRIPTS = \
 bti_SOURCES = \
        bti.c
 
-bti_CPPFLAGS = 
+bti_CFLAGS = \
+       $(LIBCURL_CFLAGS) \
+       $(XML_CFLAGS) \
+       $(LIBPCRE_CFLAGS) \
+       $(LIBOAUTH_CFLAGS)
+
 bti_LDADD = \
        $(LIBCURL_LIBS) \
        $(XML_LIBS) \
@@ -322,7 +327,7 @@ clean-binPROGRAMS:
        -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
 bti$(EXEEXT): $(bti_OBJECTS) $(bti_DEPENDENCIES) 
        @rm -f bti$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(bti_OBJECTS) $(bti_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(bti_LINK) $(bti_OBJECTS) $(bti_LDADD) $(LIBS)
 install-binSCRIPTS: $(bin_SCRIPTS)
        @$(NORMAL_INSTALL)
        test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@@ -383,20 +388,20 @@ distclean-compile:
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 bti-bti.o: bti.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bti_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bti-bti.o -MD -MP -MF $(DEPDIR)/bti-bti.Tpo -c -o bti-bti.o `test -f 'bti.c' || echo '$(srcdir)/'`bti.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bti_CFLAGS) $(CFLAGS) -MT bti-bti.o -MD -MP -MF $(DEPDIR)/bti-bti.Tpo -c -o bti-bti.o `test -f 'bti.c' || echo '$(srcdir)/'`bti.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bti-bti.Tpo $(DEPDIR)/bti-bti.Po
 @am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='bti.c' object='bti-bti.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bti_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bti-bti.o `test -f 'bti.c' || echo '$(srcdir)/'`bti.c
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bti_CFLAGS) $(CFLAGS) -c -o bti-bti.o `test -f 'bti.c' || echo '$(srcdir)/'`bti.c
 
 bti-bti.obj: bti.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bti_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bti-bti.obj -MD -MP -MF $(DEPDIR)/bti-bti.Tpo -c -o bti-bti.obj `if test -f 'bti.c'; then $(CYGPATH_W) 'bti.c'; else $(CYGPATH_W) '$(srcdir)/bti.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bti_CFLAGS) $(CFLAGS) -MT bti-bti.obj -MD -MP -MF $(DEPDIR)/bti-bti.Tpo -c -o bti-bti.obj `if test -f 'bti.c'; then $(CYGPATH_W) 'bti.c'; else $(CYGPATH_W) '$(srcdir)/bti.c'; fi`
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bti-bti.Tpo $(DEPDIR)/bti-bti.Po
 @am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='bti.c' object='bti-bti.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bti_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bti-bti.obj `if test -f 'bti.c'; then $(CYGPATH_W) 'bti.c'; else $(CYGPATH_W) '$(srcdir)/bti.c'; fi`
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bti_CFLAGS) $(CFLAGS) -c -o bti-bti.obj `if test -f 'bti.c'; then $(CYGPATH_W) 'bti.c'; else $(CYGPATH_W) '$(srcdir)/bti.c'; fi`
 install-man1: $(dist_man_MANS)
        @$(NORMAL_INSTALL)
        test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@@ -774,10 +779,6 @@ uninstall-man: uninstall-man1
        tags uninstall uninstall-am uninstall-binPROGRAMS \
        uninstall-binSCRIPTS uninstall-man uninstall-man1
 
-       $(LIBCURL_CPPFLAGS) \
-       $(XML_CPPFLAGS) \
-       $(LIBPCRE_CPPFLAGS) \
-       $(LIBOAUTH_CPPFLAGS)
 
 %.1: %.xml
        $(XSLTPROC) -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
index 0cb64bc..ef98163 100644 (file)
@@ -1,3 +1,7 @@
+bti 028
+=============
+Build fixes thanks to Flameeyes and other minor tweaks.
+
 bti 027
 =============
 OAUTH support
index 01aed9e..9eae968 100644 (file)
@@ -19,446 +19,6 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
-#                       [ACTION-IF-YES], [ACTION-IF-NO])
-# ----------------------------------------------------------
-#      David Shaw <dshaw@jabberwocky.com>   May-09-2006
-#
-# Checks for libcurl.  DEFAULT-ACTION is the string yes or no to
-# specify whether to default to --with-libcurl or --without-libcurl.
-# If not supplied, DEFAULT-ACTION is yes.  MINIMUM-VERSION is the
-# minimum version of libcurl to accept.  Pass the version as a regular
-# version number like 7.10.1. If not supplied, any version is
-# accepted.  ACTION-IF-YES is a list of shell commands to run if
-# libcurl was successfully found and passed the various tests.
-# ACTION-IF-NO is a list of shell commands that are run otherwise.
-# Note that using --without-libcurl does run ACTION-IF-NO.
-#
-# This macro #defines HAVE_LIBCURL if a working libcurl setup is
-# found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary
-# values.  Other useful defines are LIBCURL_FEATURE_xxx where xxx are
-# the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy
-# where yyy are the various protocols supported by libcurl.  Both xxx
-# and yyy are capitalized.  See the list of AH_TEMPLATEs at the top of
-# the macro for the complete list of possible defines.  Shell
-# variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also
-# defined to 'yes' for those features and protocols that were found.
-# Note that xxx and yyy keep the same capitalization as in the
-# curl-config list (e.g. it's "HTTP" and not "http").
-#
-# Users may override the detected values by doing something like:
-# LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure
-#
-# For the sake of sanity, this macro assumes that any libcurl that is
-# found is after version 7.7.2, the first version that included the
-# curl-config script.  Note that it is very important for people
-# packaging binary versions of libcurl to include this script!
-# Without curl-config, we can only guess what protocols are available,
-# or use curl_version_info to figure it out at runtime.
-
-AC_DEFUN([LIBCURL_CHECK_CONFIG],
-[
-  AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL])
-  AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4])
-  AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6])
-  AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz])
-  AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS])
-  AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN])
-  AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI])
-  AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM])
-
-  AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_RTSP],[Defined if libcurl supports RTSP])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_POP3],[Defined if libcurl supports POP3])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_IMAP],[Defined if libcurl supports IMAP])
-  AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP])
-
-  AC_ARG_WITH(libcurl,
-     AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
-     [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
-
-  if test "$_libcurl_with" != "no" ; then
-
-     AC_PROG_AWK
-
-     _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
-
-     _libcurl_try_link=yes
-
-     if test -d "$_libcurl_with" ; then
-        LIBCURL_CPPFLAGS="-I$withval/include"
-        _libcurl_ldflags="-L$withval/lib"
-        AC_PATH_PROG([_libcurl_config],[curl-config],["$withval/bin"],
-                     ["$withval/bin"])
-     else
-        AC_PATH_PROG([_libcurl_config],[curl-config])
-     fi
-
-     if test x$_libcurl_config != "x" ; then
-        AC_CACHE_CHECK([for the version of libcurl],
-           [libcurl_cv_lib_curl_version],
-           [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`])
-
-        _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
-        _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
-
-        if test $_libcurl_wanted -gt 0 ; then
-           AC_CACHE_CHECK([for libcurl >= version $2],
-              [libcurl_cv_lib_version_ok],
-              [
-              if test $_libcurl_version -ge $_libcurl_wanted ; then
-                 libcurl_cv_lib_version_ok=yes
-              else
-                 libcurl_cv_lib_version_ok=no
-              fi
-              ])
-        fi
-
-        if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
-           if test x"$LIBCURL_CPPFLAGS" = "x" ; then
-              LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
-           fi
-           if test x"$LIBCURL" = "x" ; then
-              LIBCURL=`$_libcurl_config --libs`
-
-              # This is so silly, but Apple actually has a bug in their
-              # curl-config script.  Fixed in Tiger, but there are still
-              # lots of Panther installs around.
-              case "${host}" in
-                 powerpc-apple-darwin7*)
-                    LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
-                 ;;
-              esac
-           fi
-
-           # All curl-config scripts support --feature
-           _libcurl_features=`$_libcurl_config --feature`
-
-           # Is it modern enough to have --protocols? (7.12.4)
-           if test $_libcurl_version -ge 461828 ; then
-              _libcurl_protocols=`$_libcurl_config --protocols`
-           fi
-        else
-           _libcurl_try_link=no
-        fi
-
-        unset _libcurl_wanted
-     fi
-
-     if test $_libcurl_try_link = yes ; then
-
-        # we didn't find curl-config, so let's see if the user-supplied
-        # link line (or failing that, "-lcurl") is enough.
-        LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
-
-        AC_CACHE_CHECK([whether libcurl is usable],
-           [libcurl_cv_lib_curl_usable],
-           [
-           _libcurl_save_cppflags=$CPPFLAGS
-           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
-           _libcurl_save_libs=$LIBS
-           LIBS="$LIBCURL $LIBS"
-
-           AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
-/* Try and use a few common options to force a failure if we are
-   missing symbols or can't link. */
-int x;
-curl_easy_setopt(NULL,CURLOPT_URL,NULL);
-x=CURL_ERROR_SIZE;
-x=CURLOPT_WRITEFUNCTION;
-x=CURLOPT_FILE;
-x=CURLOPT_ERRORBUFFER;
-x=CURLOPT_STDERR;
-x=CURLOPT_VERBOSE;
-]),libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
-
-           CPPFLAGS=$_libcurl_save_cppflags
-           LIBS=$_libcurl_save_libs
-           unset _libcurl_save_cppflags
-           unset _libcurl_save_libs
-           ])
-
-        if test $libcurl_cv_lib_curl_usable = yes ; then
-
-           # Does curl_free() exist in this version of libcurl?
-           # If not, fake it with free()
-
-           _libcurl_save_cppflags=$CPPFLAGS
-           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
-           _libcurl_save_libs=$LIBS
-           LIBS="$LIBS $LIBCURL"
-
-           AC_CHECK_FUNC(curl_free,,
-              AC_DEFINE(curl_free,free,
-                [Define curl_free() as free() if our version of curl lacks curl_free.]))
-
-           CPPFLAGS=$_libcurl_save_cppflags
-           LIBS=$_libcurl_save_libs
-           unset _libcurl_save_cppflags
-           unset _libcurl_save_libs
-
-           AC_DEFINE(HAVE_LIBCURL,1,
-             [Define to 1 if you have a functional curl library.])
-           AC_SUBST(LIBCURL_CPPFLAGS)
-           AC_SUBST(LIBCURL)
-
-           for _libcurl_feature in $_libcurl_features ; do
-              AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
-              eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
-           done
-
-           if test "x$_libcurl_protocols" = "x" ; then
-
-              # We don't have --protocols, so just assume that all
-              # protocols are available
-              _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP"
-
-              if test x$libcurl_feature_SSL = xyes ; then
-                 _libcurl_protocols="$_libcurl_protocols HTTPS"
-
-                 # FTPS wasn't standards-compliant until version
-                 # 7.11.0 (0x070b00 == 461568)
-                 if test $_libcurl_version -ge 461568; then
-                    _libcurl_protocols="$_libcurl_protocols FTPS"
-                 fi
-              fi
-
-              # RTSP, IMAP, POP3 and SMTP were added in
-              # 7.20.0 (0x071400 == 463872)
-              if test $_libcurl_version -ge 463872; then
-                 _libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP"
-              fi
-           fi
-
-           for _libcurl_protocol in $_libcurl_protocols ; do
-              AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
-              eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
-           done
-        else
-           unset LIBCURL
-           unset LIBCURL_CPPFLAGS
-        fi
-     fi
-
-     unset _libcurl_try_link
-     unset _libcurl_version_parse
-     unset _libcurl_config
-     unset _libcurl_feature
-     unset _libcurl_features
-     unset _libcurl_protocol
-     unset _libcurl_protocols
-     unset _libcurl_version
-     unset _libcurl_ldflags
-  fi
-
-  if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
-     # This is the IF-NO path
-     ifelse([$4],,:,[$4])
-  else
-     # This is the IF-YES path
-     ifelse([$3],,:,[$3])
-  fi
-
-  unset _libcurl_with
-])dnl
-
-# Configure paths for LIBXML2
-# Mike Hommey 2004-06-19
-# use CPPFLAGS instead of CFLAGS
-# Toshio Kuratomi 2001-04-21
-# Adapted from:
-# Configure paths for GLIB
-# Owen Taylor     97-11-3
-
-dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
-dnl
-AC_DEFUN([AM_PATH_XML2],[ 
-AC_ARG_WITH(xml-prefix,
-            [  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)],
-            xml_config_prefix="$withval", xml_config_prefix="")
-AC_ARG_WITH(xml-exec-prefix,
-            [  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
-            xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
-AC_ARG_ENABLE(xmltest,
-              [  --disable-xmltest       Do not try to compile and run a test LIBXML program],,
-              enable_xmltest=yes)
-
-  if test x$xml_config_exec_prefix != x ; then
-     xml_config_args="$xml_config_args"
-     if test x${XML2_CONFIG+set} != xset ; then
-        XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
-     fi
-  fi
-  if test x$xml_config_prefix != x ; then
-     xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
-     if test x${XML2_CONFIG+set} != xset ; then
-        XML2_CONFIG=$xml_config_prefix/bin/xml2-config
-     fi
-  fi
-
-  AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
-  min_xml_version=ifelse([$1], ,2.0.0,[$1])
-  AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
-  no_xml=""
-  if test "$XML2_CONFIG" = "no" ; then
-    no_xml=yes
-  else
-    XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
-    XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
-    xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-    if test "x$enable_xmltest" = "xyes" ; then
-      ac_save_CPPFLAGS="$CPPFLAGS"
-      ac_save_LIBS="$LIBS"
-      CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
-      LIBS="$XML_LIBS $LIBS"
-dnl
-dnl Now check if the installed libxml is sufficiently new.
-dnl (Also sanity checks the results of xml2-config to some extent)
-dnl
-      rm -f conf.xmltest
-      AC_TRY_RUN([
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <libxml/xmlversion.h>
-
-int 
-main()
-{
-  int xml_major_version, xml_minor_version, xml_micro_version;
-  int major, minor, micro;
-  char *tmp_version;
-
-  system("touch conf.xmltest");
-
-  /* Capture xml2-config output via autoconf/configure variables */
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = (char *)strdup("$min_xml_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string from xml2-config\n", "$min_xml_version");
-     exit(1);
-   }
-   free(tmp_version);
-
-   /* Capture the version information from the header files */
-   tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
-   if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
-     printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
-     exit(1);
-   }
-   free(tmp_version);
-
- /* Compare xml2-config output to the libxml headers */
-  if ((xml_major_version != $xml_config_major_version) ||
-      (xml_minor_version != $xml_config_minor_version) ||
-      (xml_micro_version != $xml_config_micro_version))
-    {
-      printf("*** libxml header files (version %d.%d.%d) do not match\n",
-         xml_major_version, xml_minor_version, xml_micro_version);
-      printf("*** xml2-config (version %d.%d.%d)\n",
-         $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
-      return 1;
-    } 
-/* Compare the headers to the library to make sure we match */
-  /* Less than ideal -- doesn't provide us with return value feedback, 
-   * only exits if there's a serious mismatch between header and library.
-   */
-    LIBXML_TEST_VERSION;
-
-    /* Test that the library is greater than our minimum version */
-    if ((xml_major_version > major) ||
-        ((xml_major_version == major) && (xml_minor_version > minor)) ||
-        ((xml_major_version == major) && (xml_minor_version == minor) &&
-        (xml_micro_version >= micro)))
-      {
-        return 0;
-       }
-     else
-      {
-        printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
-               xml_major_version, xml_minor_version, xml_micro_version);
-        printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
-           major, minor, micro);
-        printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
-        printf("***\n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
-        printf("*** correct copy of xml2-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-    }
-  return 1;
-}
-],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CPPFLAGS="$ac_save_CPPFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-
-  if test "x$no_xml" = x ; then
-     AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
-     ifelse([$2], , :, [$2])     
-  else
-     AC_MSG_RESULT(no)
-     if test "$XML2_CONFIG" = "no" ; then
-       echo "*** The xml2-config script installed by LIBXML could not be found"
-       echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the XML2_CONFIG environment variable to the"
-       echo "*** full path to xml2-config."
-     else
-       if test -f conf.xmltest ; then
-        :
-       else
-          echo "*** Could not run libxml test program, checking why..."
-          CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
-          LIBS="$LIBS $XML_LIBS"
-          AC_TRY_LINK([
-#include <libxml/xmlversion.h>
-#include <stdio.h>
-],      [ LIBXML_TEST_VERSION; return 0;],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
-          echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-          echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
-          echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
-          echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
-          CPPFLAGS="$ac_save_CPPFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-
-     XML_CPPFLAGS=""
-     XML_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  AC_SUBST(XML_CPPFLAGS)
-  AC_SUBST(XML_LIBS)
-  rm -f conf.xmltest
-])
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # 
 # Copyright ¬© 2004 Scott James Remnant <scott@netsplit.com>.
diff --git a/bti.1 b/bti.1
index 385b5f5..778d58d 100644 (file)
--- a/bti.1
+++ b/bti.1
@@ -112,7 +112,13 @@ Verbose mode\&. Print status IDs and timestamps\&.
 .RS 4
 Add the working directory and a \'$\' in the tweet message to help specify it is coming from a command line\&. Don\'t put the working directory and the \'$\' in the tweet message\&.
 .sp
-This mode also does not report back any errors that might have happened when sending the message, and it sends it in the background, returning immediately, allowing the process to continue on\&.
+This option implies
+\fB\-\-background\fR\&.
+.RE
+.PP
+\fB\-\-background\fR
+.RS 4
+Do not report back any errors that might have happened when sending the message, and send it in the background, returning immediately, allowing the user to continue on\&.
 .RE
 .PP
 \fB\-\-version\fR
diff --git a/bti.c b/bti.c
index 8feb8da..23de0e7 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com>
+ * Copyright (C) 2008-2010 Greg Kroah-Hartman <greg@kroah.com>
  * Copyright (C) 2009 Bart Trojanowski <bart@jukie.net>
  * Copyright (C) 2009 Amir Mohammad Saied <amirsaied@gmail.com>
  *
@@ -90,6 +90,7 @@ struct session {
        char *configfile;
        char *replyto;
        int bash;
+       int background;
        int interactive;
        int shrink_urls;
        int dry_run;
@@ -109,31 +110,31 @@ struct bti_curl_buffer {
 
 static void display_help(void)
 {
-       fprintf(stdout, "bti - send tweet to twitter or identi.ca\n");
-       fprintf(stdout, "Version: " VERSION "\n");
-       fprintf(stdout, "Usage:\n");
-       fprintf(stdout, "  bti [options]\n");
-       fprintf(stdout, "options are:\n");
-       fprintf(stdout, "  --account accountname\n");
-       fprintf(stdout, "  --password password\n");
-       fprintf(stdout, "  --action action\n");
-       fprintf(stdout, "    ('update', 'friends', 'public', 'replies', "
-               "'group' or 'user')\n");
-       fprintf(stdout, "  --user screenname\n");
-       fprintf(stdout, "  --group groupname\n");
-       fprintf(stdout, "  --proxy PROXY:PORT\n");
-       fprintf(stdout, "  --host HOST\n");
-       fprintf(stdout, "  --logfile logfile\n");
-       fprintf(stdout, "  --config configfile\n");
-       fprintf(stdout, "  --replyto ID\n");
-       fprintf(stdout, "  --shrink-urls\n");
-       fprintf(stdout, "  --page PAGENUMBER\n");
-       fprintf(stdout, "  --bash\n");
-       fprintf(stdout, "  --debug\n");
-       fprintf(stdout, "  --verbose\n");
-       fprintf(stdout, "  --dry-run\n");
-       fprintf(stdout, "  --version\n");
-       fprintf(stdout, "  --help\n");
+       fprintf(stdout, "bti - send tweet to twitter or identi.ca\n"
+               "Version: %s\n"
+               "Usage:\n"
+               "  bti [options]\n"
+               "options are:\n"
+               "  --account accountname\n"
+               "  --password password\n"
+               "  --action action\n"
+               "    ('update', 'friends', 'public', 'replies', or 'user')\n"
+               "  --user screenname\n"
+               "  --group groupname\n"
+               "  --proxy PROXY:PORT\n"
+               "  --host HOST\n"
+               "  --logfile logfile\n"
+               "  --config configfile\n"
+               "  --replyto ID\n"
+               "  --shrink-urls\n"
+               "  --page PAGENUMBER\n"
+               "  --bash\n"
+               "  --background\n"
+               "  --debug\n"
+               "  --verbose\n"
+               "  --dry-run\n"
+               "  --version\n"
+               "  --help\n", VERSION);
 }
 
 static void display_version(void)
@@ -298,25 +299,25 @@ static void bti_curl_buffer_free(struct bti_curl_buffer *buffer)
        free(buffer);
 }
 
-static const char *twitter_host  = "http://api.twitter.com/1/statuses";
-static const char *identica_host = "https://identi.ca/api/statuses";
-static const char *twitter_name  = "twitter";
-static const char *identica_name = "identi.ca";
-
-static const char *twitter_request_token_uri  = "http://twitter.com/oauth/request_token";
-static const char *twitter_access_token_uri   = "http://twitter.com/oauth/access_token";
-static const char *twitter_authorize_uri      = "http://twitter.com/oauth/authorize?oauth_token=";
-static const char *identica_request_token_uri = "http://identi.ca/api/oauth/request_token";
-static const char *identica_access_token_uri  = "http://identi.ca/api/oauth/access_token";
-static const char *identica_authorize_uri     = "http://identi.ca/api/oauth/authorize?oauth_token=";
-
-static const char *user_uri     = "/user_timeline/";
-static const char *update_uri   = "/update.xml";
-static const char *public_uri   = "/public_timeline.xml";
-static const char *friends_uri  = "/friends_timeline.xml";
-static const char *mentions_uri = "/mentions.xml";
-static const char *replies_uri  = "/replies.xml";
-static const char *group_uri    = "/../statusnet/groups/timeline/";
+static const char twitter_host[]  = "http://api.twitter.com/1/statuses";
+static const char identica_host[] = "https://identi.ca/api/statuses";
+static const char twitter_name[]  = "twitter";
+static const char identica_name[] = "identi.ca";
+
+static const char twitter_request_token_uri[]  = "http://twitter.com/oauth/request_token";
+static const char twitter_access_token_uri[]   = "http://twitter.com/oauth/access_token";
+static const char twitter_authorize_uri[]      = "http://twitter.com/oauth/authorize?oauth_token=";
+static const char identica_request_token_uri[] = "http://identi.ca/api/oauth/request_token";
+static const char identica_access_token_uri[]  = "http://identi.ca/api/oauth/access_token";
+static const char identica_authorize_uri[]     = "http://identi.ca/api/oauth/authorize?oauth_token=";
+
+static const char user_uri[]     = "/user_timeline/";
+static const char update_uri[]   = "/update.xml";
+static const char public_uri[]   = "/public_timeline.xml";
+static const char friends_uri[]  = "/friends_timeline.xml";
+static const char mentions_uri[] = "/mentions.xml";
+static const char replies_uri[]  = "/replies.xml";
+static const char group_uri[]    = "/../statusnet/groups/timeline/";
 
 static CURL *curl_init(void)
 {
@@ -455,20 +456,22 @@ static int parse_osp_reply(const char *reply, char **token, char **secret)
        rc = oauth_split_url_parameters(reply, &rv);
        qsort(rv, rc, sizeof(char *), oauth_cmpstringp);
        if (rc == 2 || rc == 4) {
-               if (!strncmp(rv[0],"oauth_token=",11) && !strncmp(rv[1],"oauth_token_secret=",18)) {
+               if (!strncmp(rv[0], "oauth_token=", 11) &&
+                   !strncmp(rv[1], "oauth_token_secret=", 18)) {
                        if (token)
-                               *token =strdup(&(rv[0][12]));
+                               *token = strdup(&(rv[0][12]));
                        if (secret)
-                               *secret=strdup(&(rv[1][19]));
+                               *secret = strdup(&(rv[1][19]));
 
                        retval = 0;
                }
        } else if (rc == 3) {
-               if (!strncmp(rv[1],"oauth_token=",11) && !strncmp(rv[2],"oauth_token_secret=",18)) {
+               if (!strncmp(rv[1], "oauth_token=", 11) &&
+                   !strncmp(rv[2], "oauth_token_secret=", 18)) {
                        if (token)
-                               *token =strdup(&(rv[1][12]));
+                               *token = strdup(&(rv[1][12]));
                        if (secret)
-                               *secret=strdup(&(rv[2][19]));
+                               *secret = strdup(&(rv[2][19]));
 
                        retval = 0;
                }
@@ -482,7 +485,6 @@ static int parse_osp_reply(const char *reply, char **token, char **secret)
 
        return retval;
 }
-       
 
 static int request_access_token(struct session *session)
 {
@@ -523,21 +525,25 @@ static int request_access_token(struct session *session)
 
        free(reply);
 
-       fprintf(stdout, "Please open the following link in your browser, and ");
-       fprintf(stdout, "allow 'bti' to access your account. Then paste ");
-       fprintf(stdout, "back the provided PIN in here.\n");
+       fprintf(stdout,
+               "Please open the following link in your browser, and "
+               "allow 'bti' to access your account. Then paste "
+               "back the provided PIN in here.\n");
        if (session->host == HOST_TWITTER) {
                fprintf(stdout, "%s%s\nPIN: ", twitter_authorize_uri, at_key);
                verifier = session->readline(NULL);
-               sprintf(at_uri, "%s?oauth_verifier=%s", twitter_access_token_uri, verifier);
+               sprintf(at_uri, "%s?oauth_verifier=%s",
+                       twitter_access_token_uri, verifier);
        } else if (session->host == HOST_IDENTICA) {
                fprintf(stdout, "%s%s\nPIN: ", identica_authorize_uri, at_key);
                verifier = session->readline(NULL);
-               sprintf(at_uri, "%s?oauth_verifier=%s", identica_access_token_uri, verifier);
+               sprintf(at_uri, "%s?oauth_verifier=%s",
+                       identica_access_token_uri, verifier);
        }
        request_url = oauth_sign_url2(at_uri, NULL, OA_HMAC, NULL,
-                       session->consumer_key, session->consumer_secret, at_key,
-                       at_secret);
+                                     session->consumer_key,
+                                     session->consumer_secret,
+                                     at_key, at_secret);
        reply = oauth_http_get(request_url, post_params);
 
        if (!reply)
@@ -548,10 +554,12 @@ static int request_access_token(struct session *session)
 
        free(reply);
 
-       fprintf(stdout, "Please put these two lines in your bti configuration ");
-       fprintf(stdout, "file (~/.bti):\n");
-       fprintf(stdout, "access_token_key=%s\n", at_key);
-       fprintf(stdout, "access_token_secret=%s\n", at_secret);
+       fprintf(stdout,
+               "Please put these two lines in your bti "
+               "configuration file (~/.bti):\n"
+               "access_token_key=%s\n"
+               "access_token_secret=%s\n",
+               at_key, at_secret);
 
        return 0;
 }
@@ -592,72 +600,75 @@ static int send_request(struct session *session)
                        session->hosturl = strdup(twitter_host);
 
                switch (session->action) {
-                       case ACTION_UPDATE:
-                               snprintf(user_password, sizeof(user_password), "%s:%s",
-                                               session->account, session->password);
-                               snprintf(data, sizeof(data), "status=\"%s\"", session->tweet);
+               case ACTION_UPDATE:
+                       snprintf(user_password, sizeof(user_password), "%s:%s",
+                                session->account, session->password);
+                       snprintf(data, sizeof(data), "status=\"%s\"",
+                                session->tweet);
+                       curl_formadd(&formpost, &lastptr,
+                                    CURLFORM_COPYNAME, "status",
+                                    CURLFORM_COPYCONTENTS, session->tweet,
+                                    CURLFORM_END);
+
+                       curl_formadd(&formpost, &lastptr,
+                                    CURLFORM_COPYNAME, "source",
+                                    CURLFORM_COPYCONTENTS, "bti",
+                                    CURLFORM_END);
+
+                       if (session->replyto)
                                curl_formadd(&formpost, &lastptr,
-                                               CURLFORM_COPYNAME, "status",
-                                               CURLFORM_COPYCONTENTS, session->tweet,
-                                               CURLFORM_END);
+                                            CURLFORM_COPYNAME, "in_reply_to_status_id",
+                                            CURLFORM_COPYCONTENTS, session->replyto,
+                                            CURLFORM_END);
 
-                               curl_formadd(&formpost, &lastptr,
-                                               CURLFORM_COPYNAME, "source",
-                                               CURLFORM_COPYCONTENTS, "bti",
-                                               CURLFORM_END);
-
-                               if (session->replyto)
-                                       curl_formadd(&formpost, &lastptr,
-                                                    CURLFORM_COPYNAME, "in_reply_to_status_id",
-                                                    CURLFORM_COPYCONTENTS, session->replyto,
-                                                    CURLFORM_END);
-
-                               curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
-                               slist = curl_slist_append(slist, "Expect:");
-                               curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);
-
-                               sprintf(endpoint, "%s%s", session->hosturl, update_uri);
-                               curl_easy_setopt(curl, CURLOPT_URL, endpoint);
-                               curl_easy_setopt(curl, CURLOPT_USERPWD, user_password);
-                               break;
-                       case ACTION_FRIENDS:
-                               snprintf(user_password, sizeof(user_password), "%s:%s",
-                                               session->account, session->password);
-                               sprintf(endpoint, "%s%s?page=%d", session->hosturl,
-                                               friends_uri, session->page);
-                               curl_easy_setopt(curl, CURLOPT_URL, endpoint);
-                               curl_easy_setopt(curl, CURLOPT_USERPWD, user_password);
-
-                               break;
-                       case ACTION_USER:
-                               sprintf(endpoint, "%s%s%s.xml?page=%d", session->hosturl,
-                                               user_uri, session->user, session->page);
-                               curl_easy_setopt(curl, CURLOPT_URL, endpoint);
-
-                               break;
-                       case ACTION_REPLIES:
-                               snprintf(user_password, sizeof(user_password), "%s:%s",
-                                               session->account, session->password);
-                               sprintf(endpoint, "%s%s?page=%d", session->hosturl, replies_uri,
-                                               session->page);
-                               curl_easy_setopt(curl, CURLOPT_URL, endpoint);
-                               curl_easy_setopt(curl, CURLOPT_USERPWD, user_password);
-
-                               break;
-                       case ACTION_PUBLIC:
-                               sprintf(endpoint, "%s%s?page=%d", session->hosturl, public_uri,
-                                               session->page);
-                               curl_easy_setopt(curl, CURLOPT_URL, endpoint);
-
-                               break;
-                       case ACTION_GROUP:
-                               sprintf(endpoint, "%s%s%s.xml?page=%d", session->hosturl,
-                                               group_uri, session->group, session->page);
-                               curl_easy_setopt(curl, CURLOPT_URL, endpoint);
-
-                               break;
-                       default:
-                               break;
+                       curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
+                       slist = curl_slist_append(slist, "Expect:");
+                       curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);
+
+                       sprintf(endpoint, "%s%s", session->hosturl, update_uri);
+                       curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+                       curl_easy_setopt(curl, CURLOPT_USERPWD, user_password);
+                       break;
+
+               case ACTION_FRIENDS:
+                       snprintf(user_password, sizeof(user_password), "%s:%s",
+                                session->account, session->password);
+                       sprintf(endpoint, "%s%s?page=%d", session->hosturl,
+                                       friends_uri, session->page);
+                       curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+                       curl_easy_setopt(curl, CURLOPT_USERPWD, user_password);
+                       break;
+
+               case ACTION_USER:
+                       sprintf(endpoint, "%s%s%s.xml?page=%d", session->hosturl,
+                               user_uri, session->user, session->page);
+                       curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+                       break;
+
+               case ACTION_REPLIES:
+                       snprintf(user_password, sizeof(user_password), "%s:%s",
+                                session->account, session->password);
+                       sprintf(endpoint, "%s%s?page=%d", session->hosturl,
+                               replies_uri, session->page);
+                       curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+                       curl_easy_setopt(curl, CURLOPT_USERPWD, user_password);
+                       break;
+
+               case ACTION_PUBLIC:
+                       sprintf(endpoint, "%s%s?page=%d", session->hosturl,
+                               public_uri, session->page);
+                       curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+                       break;
+
+               case ACTION_GROUP:
+                       sprintf(endpoint, "%s%s%s.xml?page=%d",
+                               session->hosturl, group_uri, session->group,
+                               session->page);
+                       curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+                       break;
+
+               default:
+                       break;
                }
 
                if (session->proxy)
@@ -674,7 +685,7 @@ static int send_request(struct session *session)
                curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl_buf);
                if (!session->dry_run) {
                        res = curl_easy_perform(curl);
-                       if (res && !session->bash) {
+                       if (res && !session->background) {
                                fprintf(stderr, "error(%d) trying to perform "
                                                "operation\n", res);
                                return -EINVAL;
@@ -687,52 +698,51 @@ static int send_request(struct session *session)
                bti_curl_buffer_free(curl_buf);
        } else {
                switch (session->action) {
-                       case ACTION_UPDATE:
-                               escaped_tweet = oauth_url_escape(session->tweet);
-                               sprintf(endpoint,
-                                               "%s%s?status=%s",
-                                               session->hosturl, update_uri, escaped_tweet);
-                               is_post = 1;
-                               break;
-                       case ACTION_USER:
-                               sprintf(endpoint, "%s%s%s.xml?page=%d",
-                                               session->hosturl, user_uri,
-                                               session->user, session->page);
-                               break;
-                       case ACTION_REPLIES:
-                               sprintf(endpoint, "%s%s?page=%d",
-                                               session->hosturl, mentions_uri, session->page);
-                               break;
-                       case ACTION_PUBLIC:
-                               sprintf(endpoint, "%s%s?page=%d",
-                                               session->hosturl, public_uri, session->page);
-                               break;
-                       case ACTION_GROUP:
-                               sprintf(endpoint, "%s%s%s.xml?page=%d",
-                                               session->hosturl, group_uri,
-                                               session->group, session->page);
-                               break;
-                       case ACTION_FRIENDS:
-                               sprintf(endpoint, "%s%s?page=%d",
-                                               session->hosturl, friends_uri, session->page);
-                               break;
-                       default:
-                               break;
+               case ACTION_UPDATE:
+                       escaped_tweet = oauth_url_escape(session->tweet);
+                       sprintf(endpoint, "%s%s?status=%s", session->hosturl,
+                               update_uri, escaped_tweet);
+                       is_post = 1;
+                       break;
+               case ACTION_USER:
+                       sprintf(endpoint, "%s%s%s.xml?page=%d",
+                               session->hosturl, user_uri, session->user,
+                               session->page);
+                       break;
+               case ACTION_REPLIES:
+                       sprintf(endpoint, "%s%s?page=%d", session->hosturl,
+                               mentions_uri, session->page);
+                       break;
+               case ACTION_PUBLIC:
+                       sprintf(endpoint, "%s%s?page=%d", session->hosturl,
+                               public_uri, session->page);
+                       break;
+               case ACTION_GROUP:
+                       sprintf(endpoint, "%s%s%s.xml?page=%d",
+                               session->hosturl, group_uri, session->group,
+                               session->page);
+                       break;
+               case ACTION_FRIENDS:
+                       sprintf(endpoint, "%s%s?page=%d", session->hosturl,
+                               friends_uri, session->page);
+                       break;
+               default:
+                       break;
                }
 
                if (is_post) {
-                       req_url = oauth_sign_url2(
-                                       endpoint, &postarg, OA_HMAC, NULL,
-                                       session->consumer_key, session->consumer_secret,
-                                       session->access_token_key, session->access_token_secret
-                                       );
+                       req_url = oauth_sign_url2(endpoint, &postarg, OA_HMAC,
+                                                 NULL, session->consumer_key,
+                                                 session->consumer_secret,
+                                                 session->access_token_key,
+                                                 session->access_token_secret);
                        reply = oauth_http_post(req_url, postarg);
                } else {
-                       req_url = oauth_sign_url2(
-                                       endpoint, NULL, OA_HMAC, NULL,
-                                       session->consumer_key, session->consumer_secret,
-                                       session->access_token_key, session->access_token_secret
-                                       );
+                       req_url = oauth_sign_url2(endpoint, NULL, OA_HMAC, NULL,
+                                                 session->consumer_key,
+                                                 session->consumer_secret,
+                                                 session->access_token_key,
+                                                 session->access_token_secret);
                        reply = oauth_http_get(req_url, postarg);
                }
 
@@ -1304,6 +1314,7 @@ int main(int argc, char *argv[], char *envp[])
                { "shrink-urls", 0, NULL, 's' },
                { "help", 0, NULL, 'h' },
                { "bash", 0, NULL, 'b' },
+               { "background", 0, NULL, 'B' },
                { "dry-run", 0, NULL, 'n' },
                { "page", 1, NULL, 'g' },
                { "version", 0, NULL, 'v' },
@@ -1355,7 +1366,8 @@ int main(int argc, char *argv[], char *envp[])
        parse_configfile(session);
 
        while (1) {
-               option = getopt_long_only(argc, argv, "dp:P:H:a:A:u:c:hg:G:sr:nVv",
+               option = getopt_long_only(argc, argv,
+                                         "dp:P:H:a:A:u:c:hg:G:sr:nVv",
                                          options, NULL);
                if (option == -1)
                        break;
@@ -1454,6 +1466,9 @@ int main(int argc, char *argv[], char *envp[])
                        break;
                case 'b':
                        session->bash = 1;
+                       /* fall-through intended */
+               case 'B':
+                       session->background = 1;
                        break;
                case 'c':
                        if (session->configfile)
@@ -1462,8 +1477,9 @@ int main(int argc, char *argv[], char *envp[])
                        dbg("configfile = %s\n", session->configfile);
 
                        /*
-                        * read the config file now.  Yes, this could override previously
-                        * set options from the command line, but the user asked for it...
+                        * read the config file now.  Yes, this could override
+                        * previously set options from the command line, but
+                        * the user asked for it...
                         */
                        parse_configfile(session);
                        break;
@@ -1492,9 +1508,10 @@ int main(int argc, char *argv[], char *envp[])
 
        if (session->host == HOST_TWITTER) {
                if (!session->consumer_key || !session->consumer_secret) {
-                       fprintf(stderr, "Twitter no longer supuports HTTP basic authentication.\n");
-                       fprintf(stderr, "Both consumer key, and consumer secret are required");
-                       fprintf(stderr, " for bti in order to behave as an OAuth consumer.\n");
+                       fprintf(stderr,
+                               "Twitter no longer supports HTTP basic authentication.\n"
+                               "Both consumer key, and consumer secret are required"
+                               " for bti in order to behave as an OAuth consumer.\n");
                        goto exit;
                }
                if (session->action == ACTION_GROUP) {
@@ -1502,31 +1519,32 @@ int main(int argc, char *argv[], char *envp[])
                        goto exit;
                }
        } else {
-               if (!session->consumer_key || !session->consumer_secret) {
+               if (!session->consumer_key || !session->consumer_secret)
                        session->no_oauth = 1;
-               }
        }
-       
+
        if (session->no_oauth) {
                if (!session->account) {
-                       fprintf(stdout, "Enter account for %s: ", session->hostname);
+                       fprintf(stdout, "Enter account for %s: ",
+                               session->hostname);
                        session->account = session->readline(NULL);
                }
                if (!session->password) {
-                       read_password(password, sizeof(password), session->hostname);
+                       read_password(password, sizeof(password),
+                                     session->hostname);
                        session->password = strdup(password);
                }
        } else {
-               if (!session->access_token_key || !session->access_token_secret) {
+               if (!session->access_token_key ||
+                   !session->access_token_secret) {
                        request_access_token(session);
                        goto exit;
-               } 
+               }
        }
 
        if (session->action == ACTION_UNKNOWN) {
-               fprintf(stderr, "Unknown action, valid actions are:\n");
-               fprintf(stderr, "'update', 'friends', 'public', "
-                       "'replies', 'group' or 'user'.\n");
+               fprintf(stderr, "Unknown action, valid actions are:\n"
+                       "'update', 'friends', 'public', 'replies', 'group' or 'user'.\n");
                goto exit;
        }
 
@@ -1536,7 +1554,7 @@ int main(int argc, char *argv[], char *envp[])
        }
 
        if (session->action == ACTION_UPDATE) {
-               if (session->bash || !session->interactive)
+               if (session->background || !session->interactive)
                        tweet = get_string_from_stdin();
                else
                        tweet = session->readline("tweet: ");
@@ -1568,7 +1586,7 @@ int main(int argc, char *argv[], char *envp[])
        /* fork ourself so that the main shell can get on
         * with it's life as we try to connect and handle everything
         */
-       if (session->bash) {
+       if (session->background) {
                child = fork();
                if (child) {
                        dbg("child is %d\n", child);
@@ -1577,7 +1595,7 @@ int main(int argc, char *argv[], char *envp[])
        }
 
        retval = send_request(session);
-       if (retval && !session->bash)
+       if (retval && !session->background)
                fprintf(stderr, "operation failed\n");
 
        log_session(session, retval);
diff --git a/bti.xml b/bti.xml
index 4497e6d..0fba17f 100644 (file)
--- a/bti.xml
+++ b/bti.xml
                 help specify it is coming from a command line.  Don't put the
                 working directory and the '$' in the tweet message.
              </para>
+
+              <para>
+                 This option implies <option>--background</option>.
+              </para>
+            </listitem>
+          </varlistentry>
+          <varlistentry>
+            <term><option>--background</option></term>
+            <listitem>
              <para>
-                This mode also does not report back any errors that might have
-                happened when sending the message, and it sends it in the
-                background, returning immediately, allowing the process to
-                continue on.
+                Do not report back any errors that might have
+                happened when sending the message, and send it in the
+                background, returning immediately, allowing the user
+                to continue on.
               </para>
             </listitem>
           </varlistentry>
index 66c3a0c..7c30f7e 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for bti 027.
+# Generated by GNU Autoconf 2.65 for bti 028.
 #
 # Report bugs to <greg@kroah.com>.
 #
@@ -551,8 +551,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='bti'
 PACKAGE_TARNAME='bti'
-PACKAGE_VERSION='027'
-PACKAGE_STRING='bti 027'
+PACKAGE_VERSION='028'
+PACKAGE_STRING='bti 028'
 PACKAGE_BUGREPORT='greg@kroah.com'
 PACKAGE_URL=''
 
@@ -561,11 +561,9 @@ am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
 XML_LIBS
-XML_CPPFLAGS
-XML2_CONFIG
-LIBCURL
-LIBCURL_CPPFLAGS
-_libcurl_config
+XML_CFLAGS
+LIBCURL_LIBS
+LIBCURL_CFLAGS
 LIBPCRE_LIBS
 LIBPCRE_CFLAGS
 LIBOAUTH_LIBS
@@ -656,10 +654,6 @@ ac_user_opts='
 enable_option_checking
 enable_silent_rules
 enable_dependency_tracking
-with_libcurl
-with_xml_prefix
-with_xml_exec_prefix
-enable_xmltest
 '
       ac_precious_vars='build_alias
 host_alias
@@ -673,7 +667,11 @@ PKG_CONFIG
 LIBOAUTH_CFLAGS
 LIBOAUTH_LIBS
 LIBPCRE_CFLAGS
-LIBPCRE_LIBS'
+LIBPCRE_LIBS
+LIBCURL_CFLAGS
+LIBCURL_LIBS
+XML_CFLAGS
+XML_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1215,7 +1213,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures bti 027 to adapt to many kinds of systems.
+\`configure' configures bti 028 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1281,7 +1279,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of bti 027:";;
+     short | recursive ) echo "Configuration of bti 028:";;
    esac
   cat <<\_ACEOF
 
@@ -1293,14 +1291,6 @@ Optional Features:
   --disable-silent-rules         verbose build output (undo: `make V=0')
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
-  --disable-xmltest       Do not try to compile and run a test LIBXML program
-
-Optional Packages:
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-libcurl=DIR      look for the curl library in DIR
-  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)
-  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)
 
 Some influential environment variables:
   CC          C compiler command
@@ -1319,6 +1309,12 @@ Some influential environment variables:
               C compiler flags for LIBPCRE, overriding pkg-config
   LIBPCRE_LIBS
               linker flags for LIBPCRE, overriding pkg-config
+  LIBCURL_CFLAGS
+              C compiler flags for LIBCURL, overriding pkg-config
+  LIBCURL_LIBS
+              linker flags for LIBCURL, overriding pkg-config
+  XML_CFLAGS  C compiler flags for XML, overriding pkg-config
+  XML_LIBS    linker flags for XML, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1386,7 +1382,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-bti configure 027
+bti configure 028
 generated by GNU Autoconf 2.65
 
 Copyright (C) 2009 Free Software Foundation, Inc.
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_func
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=$ac_status
-fi
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by bti $as_me 027, which was
+It was created by bti $as_me 028, which was
 generated by GNU Autoconf 2.65.  Invocation command line was
 
   $ $0 $@
@@ -2406,7 +2293,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=bti
- VERSION=027
+ VERSION=028
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3486,47 +3373,6 @@ fi
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5
-$as_echo_n "checking for main in -lnsl... " >&6; }
-if test "${ac_cv_lib_nsl_main+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_nsl_main=yes
-else
-  ac_cv_lib_nsl_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5
-$as_echo "$ac_cv_lib_nsl_main" >&6; }
-if test "x$ac_cv_lib_nsl_main" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
-  LIBS="-lnsl $LIBS"
-
-fi
-
-
-
 
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
        if test -n "$ac_tool_prefix"; then
@@ -3730,9 +3576,6 @@ $as_echo "yes" >&6; }
        :
 fi
 
-
-
-
 pkg_failed=no
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBPCRE" >&5
 $as_echo_n "checking for LIBPCRE... " >&6; }
@@ -3819,678 +3662,235 @@ $as_echo "yes" >&6; }
        :
 fi
 
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5
+$as_echo_n "checking for LIBCURL... " >&6; }
 
-
-
-# CURL
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-libcurl was given.
-if test "${with_libcurl+set}" = set; then :
-  withval=$with_libcurl; _libcurl_with=$withval
-else
-  _libcurl_with=yes
-fi
-
-
-  if test "$_libcurl_with" != "no" ; then
-
-     for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$AWK" && break
-done
-
-
-     _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
-
-     _libcurl_try_link=yes
-
-     if test -d "$_libcurl_with" ; then
-        LIBCURL_CPPFLAGS="-I$withval/include"
-        _libcurl_ldflags="-L$withval/lib"
-        # Extract the first word of "curl-config", so it can be a program name with args.
-set dummy curl-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path__libcurl_config+set}" = set; then :
-  $as_echo_n "(cached) " >&6
+if test -n "$LIBCURL_CFLAGS"; then
+    pkg_cv_LIBCURL_CFLAGS="$LIBCURL_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBCURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl" 2>/dev/null`
 else
-  case $_libcurl_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in "$withval/bin"
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path__libcurl_config" && ac_cv_path__libcurl_config=""$withval/bin""
-  ;;
-esac
+  pkg_failed=yes
 fi
-_libcurl_config=$ac_cv_path__libcurl_config
-if test -n "$_libcurl_config"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
-$as_echo "$_libcurl_config" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ else
+    pkg_failed=untried
 fi
-
-
-     else
-        # Extract the first word of "curl-config", so it can be a program name with args.
-set dummy curl-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path__libcurl_config+set}" = set; then :
-  $as_echo_n "(cached) " >&6
+if test -n "$LIBCURL_LIBS"; then
+    pkg_cv_LIBCURL_LIBS="$LIBCURL_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBCURL_LIBS=`$PKG_CONFIG --libs "libcurl" 2>/dev/null`
 else
-  case $_libcurl_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
+  pkg_failed=yes
 fi
-_libcurl_config=$ac_cv_path__libcurl_config
-if test -n "$_libcurl_config"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
-$as_echo "$_libcurl_config" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ else
+    pkg_failed=untried
 fi
 
 
-     fi
-
-     if test x$_libcurl_config != "x" ; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of libcurl" >&5
-$as_echo_n "checking for the version of libcurl... " >&6; }
-if test "${libcurl_cv_lib_curl_version+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_version" >&5
-$as_echo "$libcurl_cv_lib_curl_version" >&6; }
 
-        _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
-        _libcurl_wanted=`echo 0 | $_libcurl_version_parse`
+if test $pkg_failed = yes; then
 
-        if test $_libcurl_wanted -gt 0 ; then
-           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl >= version " >&5
-$as_echo_n "checking for libcurl >= version ... " >&6; }
-if test "${libcurl_cv_lib_version_ok+set}" = set; then :
-  $as_echo_n "(cached) " >&6
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-
-              if test $_libcurl_version -ge $_libcurl_wanted ; then
-                 libcurl_cv_lib_version_ok=yes
-              else
-                 libcurl_cv_lib_version_ok=no
-              fi
-
+        _pkg_short_errors_supported=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_version_ok" >&5
-$as_echo "$libcurl_cv_lib_version_ok" >&6; }
-        fi
-
-        if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
-           if test x"$LIBCURL_CPPFLAGS" = "x" ; then
-              LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
-           fi
-           if test x"$LIBCURL" = "x" ; then
-              LIBCURL=`$_libcurl_config --libs`
-
-              # This is so silly, but Apple actually has a bug in their
-              # curl-config script.  Fixed in Tiger, but there are still
-              # lots of Panther installs around.
-              case "${host}" in
-                 powerpc-apple-darwin7*)
-                    LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
-                 ;;
-              esac
-           fi
-
-           # All curl-config scripts support --feature
-           _libcurl_features=`$_libcurl_config --feature`
-
-           # Is it modern enough to have --protocols? (7.12.4)
-           if test $_libcurl_version -ge 461828 ; then
-              _libcurl_protocols=`$_libcurl_config --protocols`
-           fi
+        if test $_pkg_short_errors_supported = yes; then
+               LIBCURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libcurl" 2>&1`
         else
-           _libcurl_try_link=no
+               LIBCURL_PKG_ERRORS=`$PKG_CONFIG --print-errors "libcurl" 2>&1`
         fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$LIBCURL_PKG_ERRORS" >&5
 
-        unset _libcurl_wanted
-     fi
-
-     if test $_libcurl_try_link = yes ; then
-
-        # we didn't find curl-config, so let's see if the user-supplied
-        # link line (or failing that, "-lcurl") is enough.
-        LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+       as_fn_error "Package requirements (libcurl) were not met:
 
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcurl is usable" >&5
-$as_echo_n "checking whether libcurl is usable... " >&6; }
-if test "${libcurl_cv_lib_curl_usable+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
+$LIBCURL_PKG_ERRORS
 
-           _libcurl_save_cppflags=$CPPFLAGS
-           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
-           _libcurl_save_libs=$LIBS
-           LIBS="$LIBCURL $LIBS"
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <curl/curl.h>
-int
-main ()
-{
+Alternatively, you may set the environment variables LIBCURL_CFLAGS
+and LIBCURL_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
-/* Try and use a few common options to force a failure if we are
-   missing symbols or can't link. */
-int x;
-curl_easy_setopt(NULL,CURLOPT_URL,NULL);
-x=CURL_ERROR_SIZE;
-x=CURLOPT_WRITEFUNCTION;
-x=CURLOPT_FILE;
-x=CURLOPT_ERRORBUFFER;
-x=CURLOPT_STDERR;
-x=CURLOPT_VERBOSE;
+Alternatively, you may set the environment variables LIBCURL_CFLAGS
+and LIBCURL_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  libcurl_cv_lib_curl_usable=yes
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
 else
-  libcurl_cv_lib_curl_usable=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-           CPPFLAGS=$_libcurl_save_cppflags
-           LIBS=$_libcurl_save_libs
-           unset _libcurl_save_cppflags
-           unset _libcurl_save_libs
-
+       LIBCURL_CFLAGS=$pkg_cv_LIBCURL_CFLAGS
+       LIBCURL_LIBS=$pkg_cv_LIBCURL_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_usable" >&5
-$as_echo "$libcurl_cv_lib_curl_usable" >&6; }
-
-        if test $libcurl_cv_lib_curl_usable = yes ; then
 
-           # Does curl_free() exist in this version of libcurl?
-           # If not, fake it with free()
-
-           _libcurl_save_cppflags=$CPPFLAGS
-           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
-           _libcurl_save_libs=$LIBS
-           LIBS="$LIBS $LIBCURL"
-
-           ac_fn_c_check_func "$LINENO" "curl_free" "ac_cv_func_curl_free"
-if test "x$ac_cv_func_curl_free" = x""yes; then :
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML" >&5
+$as_echo_n "checking for XML... " >&6; }
 
+if test -n "$XML_CFLAGS"; then
+    pkg_cv_XML_CFLAGS="$XML_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null`
 else
-
-$as_echo "#define curl_free free" >>confdefs.h
-
-fi
-
-
-           CPPFLAGS=$_libcurl_save_cppflags
-           LIBS=$_libcurl_save_libs
-           unset _libcurl_save_cppflags
-           unset _libcurl_save_libs
-
-
-$as_echo "#define HAVE_LIBCURL 1" >>confdefs.h
-
-
-
-
-           for _libcurl_feature in $_libcurl_features ; do
-              cat >>confdefs.h <<_ACEOF
-#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
-_ACEOF
-
-              eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
-           done
-
-           if test "x$_libcurl_protocols" = "x" ; then
-
-              # We don't have --protocols, so just assume that all
-              # protocols are available
-              _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP"
-
-              if test x$libcurl_feature_SSL = xyes ; then
-                 _libcurl_protocols="$_libcurl_protocols HTTPS"
-
-                 # FTPS wasn't standards-compliant until version
-                 # 7.11.0 (0x070b00 == 461568)
-                 if test $_libcurl_version -ge 461568; then
-                    _libcurl_protocols="$_libcurl_protocols FTPS"
-                 fi
-              fi
-
-              # RTSP, IMAP, POP3 and SMTP were added in
-              # 7.20.0 (0x071400 == 463872)
-              if test $_libcurl_version -ge 463872; then
-                 _libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP"
-              fi
-           fi
-
-           for _libcurl_protocol in $_libcurl_protocols ; do
-              cat >>confdefs.h <<_ACEOF
-#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
-_ACEOF
-
-              eval `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes
-           done
-        else
-           unset LIBCURL
-           unset LIBCURL_CPPFLAGS
-        fi
-     fi
-
-     unset _libcurl_try_link
-     unset _libcurl_version_parse
-     unset _libcurl_config
-     unset _libcurl_feature
-     unset _libcurl_features
-     unset _libcurl_protocol
-     unset _libcurl_protocols
-     unset _libcurl_version
-     unset _libcurl_ldflags
-  fi
-
-  if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
-     # This is the IF-NO path
-     have_libcurl="no"
-  else
-     # This is the IF-YES path
-     have_libcurl="yes"
-  fi
-
-  unset _libcurl_with
-
-if test "${have_libcurl}" != yes; then
-       as_fn_error "libcurl library not found, please install it" "$LINENO" 5
+  pkg_failed=yes
 fi
-
-# libxml2
-
-
-# Check whether --with-xml-prefix was given.
-if test "${with_xml_prefix+set}" = set; then :
-  withval=$with_xml_prefix; xml_config_prefix="$withval"
-else
-  xml_config_prefix=""
+ else
+    pkg_failed=untried
 fi
-
-
-# Check whether --with-xml-exec-prefix was given.
-if test "${with_xml_exec_prefix+set}" = set; then :
-  withval=$with_xml_exec_prefix; xml_config_exec_prefix="$withval"
+if test -n "$XML_LIBS"; then
+    pkg_cv_XML_LIBS="$XML_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XML_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null`
 else
-  xml_config_exec_prefix=""
+  pkg_failed=yes
 fi
-
-# Check whether --enable-xmltest was given.
-if test "${enable_xmltest+set}" = set; then :
-  enableval=$enable_xmltest;
-else
-  enable_xmltest=yes
+ else
+    pkg_failed=untried
 fi
 
 
-  if test x$xml_config_exec_prefix != x ; then
-     xml_config_args="$xml_config_args"
-     if test x${XML2_CONFIG+set} != xset ; then
-        XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
-     fi
-  fi
-  if test x$xml_config_prefix != x ; then
-     xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
-     if test x${XML2_CONFIG+set} != xset ; then
-        XML2_CONFIG=$xml_config_prefix/bin/xml2-config
-     fi
-  fi
 
-  # Extract the first word of "xml2-config", so it can be a program name with args.
-set dummy xml2-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XML2_CONFIG+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $XML2_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+if test $pkg_failed = yes; then
 
-  test -z "$ac_cv_path_XML2_CONFIG" && ac_cv_path_XML2_CONFIG="no"
-  ;;
-esac
-fi
-XML2_CONFIG=$ac_cv_path_XML2_CONFIG
-if test -n "$XML2_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
-$as_echo "$XML2_CONFIG" >&6; }
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+        _pkg_short_errors_supported=no
 fi
+        if test $_pkg_short_errors_supported = yes; then
+               XML_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libxml-2.0" 2>&1`
+        else
+               XML_PKG_ERRORS=`$PKG_CONFIG --print-errors "libxml-2.0" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XML_PKG_ERRORS" >&5
 
+       as_fn_error "Package requirements (libxml-2.0) were not met:
 
-  min_xml_version=2.0.0
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml - version >= $min_xml_version" >&5
-$as_echo_n "checking for libxml - version >= $min_xml_version... " >&6; }
-  no_xml=""
-  if test "$XML2_CONFIG" = "no" ; then
-    no_xml=yes
-  else
-    XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
-    XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
-    xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
-    xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
-    xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
-    if test "x$enable_xmltest" = "xyes" ; then
-      ac_save_CPPFLAGS="$CPPFLAGS"
-      ac_save_LIBS="$LIBS"
-      CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
-      LIBS="$XML_LIBS $LIBS"
-      rm -f conf.xmltest
-      if test "$cross_compiling" = yes; then :
-  echo $ac_n "cross compiling; assumed OK... $ac_c"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+$XML_PKG_ERRORS
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <libxml/xmlversion.h>
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
-int
-main()
-{
-  int xml_major_version, xml_minor_version, xml_micro_version;
-  int major, minor, micro;
-  char *tmp_version;
-
-  system("touch conf.xmltest");
-
-  /* Capture xml2-config output via autoconf/configure variables */
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = (char *)strdup("$min_xml_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string from xml2-config\n", "$min_xml_version");
-     exit(1);
-   }
-   free(tmp_version);
-
-   /* Capture the version information from the header files */
-   tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
-   if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
-     printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
-     exit(1);
-   }
-   free(tmp_version);
-
- /* Compare xml2-config output to the libxml headers */
-  if ((xml_major_version != $xml_config_major_version) ||
-      (xml_minor_version != $xml_config_minor_version) ||
-      (xml_micro_version != $xml_config_micro_version))
-    {
-      printf("*** libxml header files (version %d.%d.%d) do not match\n",
-         xml_major_version, xml_minor_version, xml_micro_version);
-      printf("*** xml2-config (version %d.%d.%d)\n",
-         $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
-      return 1;
-    }
-/* Compare the headers to the library to make sure we match */
-  /* Less than ideal -- doesn't provide us with return value feedback,
-   * only exits if there's a serious mismatch between header and library.
-   */
-    LIBXML_TEST_VERSION;
-
-    /* Test that the library is greater than our minimum version */
-    if ((xml_major_version > major) ||
-        ((xml_major_version == major) && (xml_minor_version > minor)) ||
-        ((xml_major_version == major) && (xml_minor_version == minor) &&
-        (xml_micro_version >= micro)))
-      {
-        return 0;
-       }
-     else
-      {
-        printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
-               xml_major_version, xml_minor_version, xml_micro_version);
-        printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
-           major, minor, micro);
-        printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
-        printf("***\n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
-        printf("*** correct copy of xml2-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-    }
-  return 1;
-}
+Alternatively, you may set the environment variables XML_CFLAGS
+and XML_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+Alternatively, you may set the environment variables XML_CFLAGS
+and XML_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
 else
-  no_xml=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+       XML_CFLAGS=$pkg_cv_XML_CFLAGS
+       XML_LIBS=$pkg_cv_XML_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
 fi
 
-       CPPFLAGS="$ac_save_CPPFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
 
-  if test "x$no_xml" = x ; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&5
-$as_echo "yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&6; }
-     have_libxml="yes"
-  else
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-     if test "$XML2_CONFIG" = "no" ; then
-       echo "*** The xml2-config script installed by LIBXML could not be found"
-       echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the XML2_CONFIG environment variable to the"
-       echo "*** full path to xml2-config."
-     else
-       if test -f conf.xmltest ; then
-        :
-       else
-          echo "*** Could not run libxml test program, checking why..."
-          CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
-          LIBS="$LIBS $XML_LIBS"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if test "${ac_cv_search_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <libxml/xmlversion.h>
-#include <stdio.h>
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
 int
 main ()
 {
- LIBXML_TEST_VERSION; return 0;
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-   echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
-          echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-          echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-else
-   echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
-          echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
-          echo "*** may want to edit the xml2-config script: $XML2_CONFIG"
+for ac_lib in '' dl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_dlopen=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-          CPPFLAGS="$ac_save_CPPFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-
-     XML_CPPFLAGS=""
-     XML_LIBS=""
-     have_libxml="no"
-  fi
-
-
-  rm -f conf.xmltest
-
-if test "${have_libxml}" != yes; then
-       as_fn_error "libxml not found, please install it" "$LINENO" 5
+    conftest$ac_exeext
+  if test "${ac_cv_search_dlopen+set}" = set; then :
+  break
 fi
+done
+if test "${ac_cv_search_dlopen+set}" = set; then :
 
-# explicitly link DSOs
-LIBS="$LIBS -ldl"
-
-
-#AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h unistd.h])
+else
+  ac_cv_search_dlopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
+$as_echo "$ac_cv_search_dlopen" >&6; }
+ac_res=$ac_cv_search_dlopen
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
-#AC_TYPE_PID_T
-#AC_TYPE_SIZE_T
-#AC_TYPE_SSIZE_T
+fi
 
-#AC_FUNC_ALLOCA
-#AC_FUNC_FORK
-#AC_FUNC_MALLOC
-#AC_FUNC_REALLOC
-#AC_CHECK_FUNCS([strcasecmp strchr strdup strncasecmp strndup])
 
 ac_config_files="$ac_config_files Makefile"
 
@@ -5052,7 +4452,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by bti $as_me 027, which was
+This file was extended by bti $as_me 028, which was
 generated by GNU Autoconf 2.65.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5109,7 +4509,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-bti config.status 027
+bti config.status 028
 configured by $0, generated by GNU Autoconf 2.65,
   with options \\"\$ac_cs_config\\"
 
index f19ff0e..4b5fd3a 100644 (file)
@@ -1,8 +1,7 @@
-AC_INIT([bti], [027], [greg@kroah.com])
+AC_INIT([bti], [028], [greg@kroah.com])
 AC_PREREQ(2.60)
 
-AM_INIT_AUTOMAKE(bti, 027)
-dnl AM_CONFIG_HEADER([check-news foreign 1.9 dist-bzip2])
+AM_INIT_AUTOMAKE(bti, 028)
 
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
@@ -13,50 +12,14 @@ AC_CONFIG_MACRO_DIR([m4])
 
 AC_PATH_PROG([XSLTPROC], [xsltproc])
 
-dnl FIXME: Replace `main' with a function in `-lnsl':
-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
-
-# explicitly link DSOs
-LIBS="$LIBS -ldl"
-
-
-dnl Checks for header files.
-#AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h unistd.h])
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-#AC_TYPE_PID_T
-#AC_TYPE_SIZE_T
-#AC_TYPE_SSIZE_T
+PKG_CHECK_MODULES([LIBCURL], [libcurl])
+PKG_CHECK_MODULES([XML], [libxml-2.0])
 
-dnl Checks for library functions.
-#AC_FUNC_ALLOCA
-#AC_FUNC_FORK
-#AC_FUNC_MALLOC
-#AC_FUNC_REALLOC
-#AC_CHECK_FUNCS([strcasecmp strchr strdup strncasecmp strndup])
+AC_SEARCH_LIBS([dlopen], [dl])
 
 AC_CONFIG_FILES([Makefile])