Fix docs and build system.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@ Makefile.in
|
|||||||
configure
|
configure
|
||||||
install-sh
|
install-sh
|
||||||
missing
|
missing
|
||||||
|
compile
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
config.log
|
config.log
|
||||||
config.status
|
config.status
|
||||||
|
|||||||
11
Makefile.am
11
Makefile.am
@@ -2,9 +2,6 @@ AUTOMAKE_OPTIONS = subdir-objects
|
|||||||
|
|
||||||
CFLAGS = -g -Wall
|
CFLAGS = -g -Wall
|
||||||
|
|
||||||
builtin_CFLAGS = -I$(top_srcdir)/expat/lib
|
|
||||||
builtin_LIBS = libexpat.a
|
|
||||||
|
|
||||||
PARSER_CFLAGS=@PARSER_CFLAGS@
|
PARSER_CFLAGS=@PARSER_CFLAGS@
|
||||||
PARSER_LIBS=@PARSER_LIBS@
|
PARSER_LIBS=@PARSER_LIBS@
|
||||||
|
|
||||||
@@ -12,11 +9,7 @@ STROPHE_FLAGS = -I$(top_srcdir)
|
|||||||
STROPHE_LIBS = libstrophe.a $(PARSER_LIBS) -lssl -lresolv
|
STROPHE_LIBS = libstrophe.a $(PARSER_LIBS) -lssl -lresolv
|
||||||
|
|
||||||
## Main build targets
|
## Main build targets
|
||||||
if BUILD_EXPAT
|
|
||||||
lib_LIBRARIES = libstrophe.a libexpat.a
|
|
||||||
else
|
|
||||||
lib_LIBRARIES = libstrophe.a
|
lib_LIBRARIES = libstrophe.a
|
||||||
endif
|
|
||||||
|
|
||||||
libstrophe_a_CFLAGS=$(STROPHE_FLAGS) $(PARSER_CFLAGS)
|
libstrophe_a_CFLAGS=$(STROPHE_FLAGS) $(PARSER_CFLAGS)
|
||||||
libstrophe_a_SOURCES = src/auth.c src/conn.c src/ctx.c \
|
libstrophe_a_SOURCES = src/auth.c src/conn.c src/ctx.c \
|
||||||
@@ -30,10 +23,6 @@ else
|
|||||||
libstrophe_a_SOURCES += src/parser_libxml2.c
|
libstrophe_a_SOURCES += src/parser_libxml2.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libexpat_a_CFLAGS=-DXML_DTD -DXML_NS -DXML_CONTEXT_BYTES=1024 -DXML_STATIC \
|
|
||||||
-I$(top_srcdir)/expat/lib
|
|
||||||
libexpat_a_SOURCES=expat/lib/xmlparse.c expat/lib/xmltok.c expat/lib/xmlrole.c
|
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
noinst_PROGRAMS = examples/active examples/roster examples/basic examples/bot
|
noinst_PROGRAMS = examples/active examples/roster examples/basic examples/bot
|
||||||
|
|||||||
63
README.markdown
Normal file
63
README.markdown
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# libstrophe
|
||||||
|
|
||||||
|
libstrophe is a lightweight XMPP client library written in C. It has
|
||||||
|
minimal dependencies and is configurable for various environments. It
|
||||||
|
runs well on both Linux, Unix, and Windows based platforms.
|
||||||
|
|
||||||
|
Its goals are:
|
||||||
|
|
||||||
|
- usable quickly
|
||||||
|
- well documented
|
||||||
|
- reliable
|
||||||
|
|
||||||
|
## Build Instructions
|
||||||
|
|
||||||
|
If you are building from a source control checkout, run:
|
||||||
|
|
||||||
|
./bootstrap.sh
|
||||||
|
|
||||||
|
to generate the `configure` script.
|
||||||
|
|
||||||
|
From the top-level directory, run the following commands:
|
||||||
|
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
|
||||||
|
This will create a static library, also in the top-level
|
||||||
|
directory, which can be linked into other programs. The
|
||||||
|
public API is defined in `strophe.h` which is also in the
|
||||||
|
top-level directory.
|
||||||
|
|
||||||
|
The `examples` directory contains some examples of how to
|
||||||
|
use the library; these may be helpful in addition to the
|
||||||
|
API documentation
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
libstrophe requires:
|
||||||
|
|
||||||
|
- expat or libxml2 - expat is the default; use --with-libxml2 to
|
||||||
|
switch
|
||||||
|
- libresolv on UNIX systems - make sure you include -lresolv
|
||||||
|
if you are compiling by hand.
|
||||||
|
|
||||||
|
In addition, if you wish to run the unit tests, you will need the
|
||||||
|
check package.
|
||||||
|
|
||||||
|
### OS X (with Homebrew package manager)
|
||||||
|
|
||||||
|
You can install the requirements with:
|
||||||
|
|
||||||
|
brew install expat
|
||||||
|
brew install check
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
API documentation is inline with the code and conforms to Doxygen
|
||||||
|
standards. You can generate an HTML version of the API documentation
|
||||||
|
by running:
|
||||||
|
|
||||||
|
doxygen
|
||||||
|
|
||||||
|
Then open `docs/html/index.html`.
|
||||||
|
|
||||||
54
README.txt
54
README.txt
@@ -1,54 +0,0 @@
|
|||||||
This is strophe, our XMPP client library.
|
|
||||||
|
|
||||||
Our goals are:
|
|
||||||
|
|
||||||
* usable quickly
|
|
||||||
* well documented
|
|
||||||
* reliable
|
|
||||||
|
|
||||||
== GIT Instructions ==
|
|
||||||
|
|
||||||
By default, libstrophe has a dependency on the XML parsing
|
|
||||||
library expat. Expat is included as a submodule of this
|
|
||||||
repository. After cloning this repository, you will need
|
|
||||||
to run the following to acquire the expat submodule:
|
|
||||||
|
|
||||||
$ git submodule init
|
|
||||||
|
|
||||||
$ git submodule update
|
|
||||||
|
|
||||||
== Build Instructions ==
|
|
||||||
|
|
||||||
From the top-level directory, run the following commands
|
|
||||||
|
|
||||||
NOTE: By default libstrophe uses expat as it's XML parser.
|
|
||||||
You may pass in --with-libxml2 with the ./configure command
|
|
||||||
to switch to using libxml2 as your XML parser.
|
|
||||||
|
|
||||||
$ ./bootstrap.sh
|
|
||||||
|
|
||||||
$ ./configure
|
|
||||||
or
|
|
||||||
$ ./configure --with-libxml2
|
|
||||||
|
|
||||||
$ make
|
|
||||||
|
|
||||||
This will create a static library, also in the top-level
|
|
||||||
directory, which can be linked into other programs. The
|
|
||||||
public api is defined in <strophe.h> which is also in the
|
|
||||||
top-level directory.
|
|
||||||
|
|
||||||
The examples/ directory contains some examples of how to
|
|
||||||
use the library; these may be helpful in addition to the
|
|
||||||
API documentation in doc/.
|
|
||||||
|
|
||||||
|
|
||||||
== Requirements ==
|
|
||||||
|
|
||||||
Libstrophe requires libresolv on UNIX systems. Make sure you include -lresolv
|
|
||||||
if you are compiling by hand.
|
|
||||||
|
|
||||||
It also uses expat for XML processing, but a current copy is included in the
|
|
||||||
expat/ directory of the SVN checkout
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
aclocal
|
ACFLAGS=""
|
||||||
|
if [ -d /usr/local/share/aclocal ]; then
|
||||||
|
ACFLAGS="-I /usr/local/share/aclocal"
|
||||||
|
fi
|
||||||
|
|
||||||
|
aclocal ${ACFLAGS}
|
||||||
automake --add-missing --foreign --copy
|
automake --add-missing --foreign --copy
|
||||||
autoconf
|
autoconf
|
||||||
13
configure.ac
13
configure.ac
@@ -6,7 +6,7 @@ AC_PROG_RANLIB
|
|||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
|
|
||||||
AC_CHECK_HEADER(openssl/ssl.h, [], [AC_MSG_ERROR([couldn't find openssl headers, openssl required])])
|
AC_CHECK_HEADER(openssl/ssl.h, [], [AC_MSG_ERROR([couldn't find openssl headers, openssl required])])
|
||||||
PKG_CHECK_MODULES([check], [check >= 0.9.4])
|
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],
|
||||||
[AS_HELP_STRING([--with-libxml2], [use libxml2 for XML parsing])],
|
[AS_HELP_STRING([--with-libxml2], [use libxml2 for XML parsing])],
|
||||||
@@ -18,8 +18,7 @@ if test "x$with_libxml2" != xno; then
|
|||||||
[with_libxml2=yes],
|
[with_libxml2=yes],
|
||||||
[AC_MSG_ERROR([couldn't find libxml2])])
|
[AC_MSG_ERROR([couldn't find libxml2])])
|
||||||
else
|
else
|
||||||
AC_CHECK_FUNCS(memmove)
|
AC_CHECK_HEADER(expat.h, [], [AC_MSG_ERROR([couldn't find expat headers; expat required])])
|
||||||
AC_C_BIGENDIAN([byteorder=1234], [byteorder=4321], [], [])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$with_libxml2" = xyes; then
|
if test "x$with_libxml2" = xyes; then
|
||||||
@@ -28,18 +27,16 @@ if test "x$with_libxml2" = xyes; then
|
|||||||
PARSER_CFLAGS=\$\(libxml2_CFLAGS\)
|
PARSER_CFLAGS=\$\(libxml2_CFLAGS\)
|
||||||
PARSER_LIBS=\$\(libxml2_LIBS\)
|
PARSER_LIBS=\$\(libxml2_LIBS\)
|
||||||
else
|
else
|
||||||
with_parser=builtin
|
with_parser=expat
|
||||||
PARSER_NAME=expat
|
PARSER_NAME=expat
|
||||||
PARSER_CFLAGS=\$\(builtin_CFLAGS\)
|
PARSER_CFLAGS=
|
||||||
PARSER_LIBS=\$\(builtin_LIBS\)
|
PARSER_LIBS=-lexpat
|
||||||
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])
|
||||||
|
|
||||||
AM_CONDITIONAL([BUILD_EXPAT], [test x$with_parser = xbuiltin])
|
|
||||||
AM_CONDITIONAL([PARSER_EXPAT], [test x$with_parser != xlibxml2])
|
AM_CONDITIONAL([PARSER_EXPAT], [test x$with_parser != xlibxml2])
|
||||||
AC_DEFINE_UNQUOTED([BYTEORDER], [$byteorder])
|
|
||||||
AC_SUBST(PARSER_NAME)
|
AC_SUBST(PARSER_NAME)
|
||||||
AC_SUBST(PARSER_CFLAGS)
|
AC_SUBST(PARSER_CFLAGS)
|
||||||
AC_SUBST(PARSER_LIBS)
|
AC_SUBST(PARSER_LIBS)
|
||||||
|
|||||||
Reference in New Issue
Block a user