From 9b50b56dbb95ea8f88a2ce23cf972c25cb0cf1be Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Tue, 7 Feb 2012 22:40:55 -0700 Subject: [PATCH] Fix docs and build system. --- .gitignore | 1 + Makefile.am | 11 --------- README.markdown | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ README.txt | 54 ------------------------------------------ bootstrap.sh | 11 ++++++--- configure.ac | 13 ++++------ 6 files changed, 77 insertions(+), 76 deletions(-) create mode 100644 README.markdown delete mode 100644 README.txt diff --git a/.gitignore b/.gitignore index b9b46a4..f854faf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ Makefile.in configure install-sh missing +compile aclocal.m4 config.log config.status diff --git a/Makefile.am b/Makefile.am index 7a5cd57..e52c79c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,9 +2,6 @@ AUTOMAKE_OPTIONS = subdir-objects CFLAGS = -g -Wall -builtin_CFLAGS = -I$(top_srcdir)/expat/lib -builtin_LIBS = libexpat.a - PARSER_CFLAGS=@PARSER_CFLAGS@ PARSER_LIBS=@PARSER_LIBS@ @@ -12,11 +9,7 @@ STROPHE_FLAGS = -I$(top_srcdir) STROPHE_LIBS = libstrophe.a $(PARSER_LIBS) -lssl -lresolv ## Main build targets -if BUILD_EXPAT -lib_LIBRARIES = libstrophe.a libexpat.a -else lib_LIBRARIES = libstrophe.a -endif libstrophe_a_CFLAGS=$(STROPHE_FLAGS) $(PARSER_CFLAGS) libstrophe_a_SOURCES = src/auth.c src/conn.c src/ctx.c \ @@ -30,10 +23,6 @@ else libstrophe_a_SOURCES += src/parser_libxml2.c 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 noinst_PROGRAMS = examples/active examples/roster examples/basic examples/bot diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..4c0b3f8 --- /dev/null +++ b/README.markdown @@ -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`. + diff --git a/README.txt b/README.txt deleted file mode 100644 index c33141e..0000000 --- a/README.txt +++ /dev/null @@ -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 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 - - diff --git a/bootstrap.sh b/bootstrap.sh index 8f69caa..473f746 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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 -autoconf \ No newline at end of file +autoconf diff --git a/configure.ac b/configure.ac index d255670..baac090 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_PROG_RANLIB AM_PROG_CC_C_O 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], [AS_HELP_STRING([--with-libxml2], [use libxml2 for XML parsing])], @@ -18,8 +18,7 @@ if test "x$with_libxml2" != xno; then [with_libxml2=yes], [AC_MSG_ERROR([couldn't find libxml2])]) else - AC_CHECK_FUNCS(memmove) - AC_C_BIGENDIAN([byteorder=1234], [byteorder=4321], [], []) + AC_CHECK_HEADER(expat.h, [], [AC_MSG_ERROR([couldn't find expat headers; expat required])]) fi if test "x$with_libxml2" = xyes; then @@ -28,18 +27,16 @@ if test "x$with_libxml2" = xyes; then PARSER_CFLAGS=\$\(libxml2_CFLAGS\) PARSER_LIBS=\$\(libxml2_LIBS\) else - with_parser=builtin + with_parser=expat PARSER_NAME=expat - PARSER_CFLAGS=\$\(builtin_CFLAGS\) - PARSER_LIBS=\$\(builtin_LIBS\) + PARSER_CFLAGS= + PARSER_LIBS=-lexpat fi AC_MSG_NOTICE([libstrophe will use the $with_parser XML parser]) AC_SEARCH_LIBS([socket], [socket]) -AM_CONDITIONAL([BUILD_EXPAT], [test x$with_parser = xbuiltin]) AM_CONDITIONAL([PARSER_EXPAT], [test x$with_parser != xlibxml2]) -AC_DEFINE_UNQUOTED([BYTEORDER], [$byteorder]) AC_SUBST(PARSER_NAME) AC_SUBST(PARSER_CFLAGS) AC_SUBST(PARSER_LIBS)