Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d693cc6d15 | ||
|
|
46f371b311 | ||
|
|
97c6e6d8d4 | ||
|
|
9af64e244e | ||
|
|
90075b5feb | ||
|
|
519edba5de | ||
|
|
7255b49623 | ||
|
|
2dc357438b | ||
|
|
4111cf772a |
@@ -5,10 +5,10 @@ AM_CFLAGS = -g -Wall
|
|||||||
PARSER_CFLAGS=@PARSER_CFLAGS@
|
PARSER_CFLAGS=@PARSER_CFLAGS@
|
||||||
PARSER_LIBS=@PARSER_LIBS@
|
PARSER_LIBS=@PARSER_LIBS@
|
||||||
|
|
||||||
SSL_LIBS = -lssl -lcrypto -lz
|
SSL_LIBS = @openssl_LIBS@
|
||||||
|
|
||||||
STROPHE_FLAGS = -I$(top_srcdir)
|
STROPHE_FLAGS = -I$(top_srcdir)
|
||||||
STROPHE_LIBS = -lstrophe $(PARSER_LIBS) $(SSL_LIBS)
|
STROPHE_LIBS = libstrophe.la
|
||||||
|
|
||||||
## Main build targets
|
## Main build targets
|
||||||
lib_LTLIBRARIES = libstrophe.la
|
lib_LTLIBRARIES = libstrophe.la
|
||||||
|
|||||||
@@ -56,10 +56,9 @@ check package.
|
|||||||
|
|
||||||
### OS X (with Homebrew package manager)
|
### OS X (with Homebrew package manager)
|
||||||
|
|
||||||
You can install the requirements with:
|
You can install libstrophe with:
|
||||||
|
|
||||||
brew install expat
|
brew install libstrophe
|
||||||
brew install check
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|||||||
33
configure.ac
33
configure.ac
@@ -4,8 +4,14 @@ LT_INIT([dlopen])
|
|||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AM_PROG_CC_C_O
|
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])])
|
PKG_CHECK_MODULES([check], [check >= 0.9.4], [], [AC_MSG_WARN([libcheck not found; unit tests will not be compilable])])
|
||||||
|
|
||||||
AC_ARG_WITH([libxml2],
|
AC_ARG_WITH([libxml2],
|
||||||
@@ -18,32 +24,39 @@ if test "x$with_libxml2" != xno; then
|
|||||||
[with_libxml2=yes], [dummy=1])
|
[with_libxml2=yes], [dummy=1])
|
||||||
if test "x$with_libxml2" != xyes; then
|
if test "x$with_libxml2" != xyes; then
|
||||||
old_CFLAGS=$CFLAGS
|
old_CFLAGS=$CFLAGS
|
||||||
CFLAGS="-I /usr/include/libxml2"
|
CFLAGS="-I${includedir}/libxml2"
|
||||||
AC_CHECK_HEADER([libxml/parser.h],
|
AC_CHECK_HEADER([libxml/parser.h],
|
||||||
[with_libxml2=yes; libxml2_CFLAGS="-I /usr/include/libxml2"; libxml2_LIBS="-lxml2"],
|
[with_libxml2=yes; libxml2_CFLAGS="-I${includedir}/libxml2"; libxml2_LIBS="-lxml2"],
|
||||||
[AC_MSG_ERROR([couldn't find libxml2])])
|
[AC_MSG_ERROR([libxml2 not found.])])
|
||||||
CFLAGS=$old_CFLAGS
|
CFLAGS=$old_CFLAGS
|
||||||
fi
|
fi
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
if test "x$with_libxml2" = xyes; then
|
if test "x$with_libxml2" = xyes; then
|
||||||
with_parser=libxml2
|
with_parser=libxml2
|
||||||
PARSER_NAME=libxml2
|
PARSER_NAME=libxml2
|
||||||
PARSER_CFLAGS=\$\(libxml2_CFLAGS\)
|
PARSER_CFLAGS=$libxml2_CFLAGS
|
||||||
PARSER_LIBS=\$\(libxml2_LIBS\)
|
PARSER_LIBS=$libxml2_LIBS
|
||||||
else
|
else
|
||||||
with_parser=expat
|
with_parser=expat
|
||||||
PARSER_NAME=expat
|
PARSER_NAME=expat
|
||||||
PARSER_CFLAGS=
|
PARSER_CFLAGS=$expat_CFLAGS
|
||||||
PARSER_LIBS=-lexpat
|
PARSER_LIBS=$expat_LIBS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_NOTICE([libstrophe will use the $with_parser XML parser])
|
AC_MSG_NOTICE([libstrophe will use the $with_parser XML parser])
|
||||||
AC_SEARCH_LIBS([socket], [socket])
|
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])
|
AC_CHECK_HEADERS([arpa/nameser_compat.h])
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
xmpp_ctx_t *ctx = (xmpp_ctx_t*)userdata;
|
||||||
|
|
||||||
if(!xmpp_stanza_get_child_by_name(stanza, "body")) return 1;
|
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"));
|
intext = xmpp_stanza_get_text(xmpp_stanza_get_child_by_name(stanza, "body"));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user