9 Commits
0.8.5 ... 0.8.6

Author SHA1 Message Date
Dmitry Podgorny
d693cc6d15 autotools: check for expat.h if pkg-config failed
Some distros provides libexpat without expat.pc. So PKG_CHECK_MODULES
fails even if libexpat is installed. To fix this AC_CHECK_HEADER added
back.
2014-08-08 19:49:46 +03:00
Fabian Freyer
46f371b311 autotools: cleaned up configure.ac and Makefile.am 2014-08-08 19:42:33 +03:00
Fabian Freyer
97c6e6d8d4 autotools: removed libresov check for freebsd. 2014-08-08 19:40:01 +03:00
Dmytro Podgornyi
9af64e244e examples/bot: removed non-standard strcpy_s/strcat_s
strncpy/strncat must be used instead. But in this case they don't make
sense, because string has enough space.
2014-08-08 18:27:02 +03:00
Dariusz Dwornikowski
90075b5feb Merge pull request #29 from fabianfreyer/fix-readme-homebrew
Updated homebrew install instructions
2014-08-08 15:30:19 +02:00
Fabian Freyer
519edba5de Added homebrew install instructions 2014-08-08 15:17:15 +02:00
Dariusz Dwornikowski
7255b49623 Merge pull request #16 from h0ru5/bot_fixed
patch for bot example to avoid crash when messages without type are sent
2014-08-08 08:35:51 +02:00
James Booth
2dc357438b Use dependency on libstophe.la to enable parallel make 2014-08-07 21:03:04 +01:00
h0ru5
4111cf772a patch to avoid crash when messages without type are sent 2014-01-06 22:46:16 +01:00
4 changed files with 28 additions and 16 deletions

View File

@@ -5,10 +5,10 @@ AM_CFLAGS = -g -Wall
PARSER_CFLAGS=@PARSER_CFLAGS@
PARSER_LIBS=@PARSER_LIBS@
SSL_LIBS = -lssl -lcrypto -lz
SSL_LIBS = @openssl_LIBS@
STROPHE_FLAGS = -I$(top_srcdir)
STROPHE_LIBS = -lstrophe $(PARSER_LIBS) $(SSL_LIBS)
STROPHE_LIBS = libstrophe.la
## Main build targets
lib_LTLIBRARIES = libstrophe.la

View File

@@ -56,10 +56,9 @@ check package.
### OS X (with Homebrew package manager)
You can install the requirements with:
You can install libstrophe with:
brew install expat
brew install check
brew install libstrophe
## Documentation

View File

@@ -4,8 +4,14 @@ LT_INIT([dlopen])
AC_PROG_CC
AM_PROG_CC_C_O
PKG_PROG_PKG_CONFIG
AC_CHECK_HEADER(openssl/ssl.h, [], [AC_MSG_ERROR([couldn't find openssl headers, openssl required])])
AC_CANONICAL_HOST
AS_CASE([$host_os],
[freebsd*], [PLATFORM="freebsd"],
[PLATFORM="nix"])
PKG_CHECK_MODULES([openssl], [openssl], [], [AC_MSG_ERROR([openssl not found; openssl required])])
PKG_CHECK_MODULES([check], [check >= 0.9.4], [], [AC_MSG_WARN([libcheck not found; unit tests will not be compilable])])
AC_ARG_WITH([libxml2],
@@ -18,32 +24,39 @@ if test "x$with_libxml2" != xno; then
[with_libxml2=yes], [dummy=1])
if test "x$with_libxml2" != xyes; then
old_CFLAGS=$CFLAGS
CFLAGS="-I /usr/include/libxml2"
CFLAGS="-I${includedir}/libxml2"
AC_CHECK_HEADER([libxml/parser.h],
[with_libxml2=yes; libxml2_CFLAGS="-I /usr/include/libxml2"; libxml2_LIBS="-lxml2"],
[AC_MSG_ERROR([couldn't find libxml2])])
[with_libxml2=yes; libxml2_CFLAGS="-I${includedir}/libxml2"; libxml2_LIBS="-lxml2"],
[AC_MSG_ERROR([libxml2 not found.])])
CFLAGS=$old_CFLAGS
fi
else
AC_CHECK_HEADER(expat.h, [], [AC_MSG_ERROR([couldn't find expat headers; expat required])])
PKG_CHECK_MODULES([expat], [expat >= 2.0.0], [],
[AC_CHECK_HEADER(expat.h, [expat_LIBS="-lexpat"], [AC_MSG_ERROR([expat not found; expat required.])])])
fi
if test "x$with_libxml2" = xyes; then
with_parser=libxml2
PARSER_NAME=libxml2
PARSER_CFLAGS=\$\(libxml2_CFLAGS\)
PARSER_LIBS=\$\(libxml2_LIBS\)
PARSER_CFLAGS=$libxml2_CFLAGS
PARSER_LIBS=$libxml2_LIBS
else
with_parser=expat
PARSER_NAME=expat
PARSER_CFLAGS=
PARSER_LIBS=-lexpat
PARSER_CFLAGS=$expat_CFLAGS
PARSER_LIBS=$expat_LIBS
fi
AC_MSG_NOTICE([libstrophe will use the $with_parser XML parser])
AC_SEARCH_LIBS([socket], [socket])
AC_LINK_IFELSE([AC_LANG_CALL([#include <resolv.h>], [res_query])], [],[LIBS="$LIBS -lresolv"])
if test "x$PLATFORM" != xfreebsd; then
AC_CHECK_LIB([resolv], [res_query], [],
[AC_CHECK_LIB([resolv], [__res_query], [],
[AC_MSG_ERROR([libresolv not found; libresolv required. ])])])
else
AC_MSG_NOTICE([skipping libresolv checks for freebsd])
fi
AC_CHECK_HEADERS([arpa/nameser_compat.h])

View File

@@ -77,7 +77,7 @@ int message_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void
xmpp_ctx_t *ctx = (xmpp_ctx_t*)userdata;
if(!xmpp_stanza_get_child_by_name(stanza, "body")) return 1;
if(!strcmp(xmpp_stanza_get_attribute(stanza, "type"), "error")) return 1;
if(xmpp_stanza_get_attribute(stanza, "type") !=NULL && !strcmp(xmpp_stanza_get_attribute(stanza, "type"), "error")) return 1;
intext = xmpp_stanza_get_text(xmpp_stanza_get_child_by_name(stanza, "body"));