--- a/jsonrpc-cpp-0.4/Makefile.am +++ a/jsonrpc-cpp-0.4/Makefile.am @@ -0,0 +1,11 @@ +ACLOCAL_AMFLAGS=-I m4 + +SUBDIRS=src test + +if INSTALL_DOCUMENTATION + SUBDIRS+=doc +endif + +if INSTALL_EXAMPLES + SUBDIRS+=examples +endif --- a/jsonrpc-cpp-0.4/autogen.sh +++ a/jsonrpc-cpp-0.4/autogen.sh @@ -0,0 +1,5 @@ +#!/bin/sh +libtoolize --install --copy --force --automake +aclocal -I m4 +autoconf +automake --add-missing --copy --- a/jsonrpc-cpp-0.4/cleanup.sh +++ a/jsonrpc-cpp-0.4/cleanup.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +find . -name Makefile -exec make -f {} distclean ';' +find . -name Makefile -exec rm {} ';' +find . -name Makefile.in -exec rm {} ';' +rm -rf m4 autom4te.cache +rm -f aclocal.m4 ar-lib config.guess config.sub configure config.log config.status\ + depcomp install-sh missing test-driver ltmain.sh libtool\ + jsonrpc-cpp*.tar.gz jsonrpc-cpp*.tar.bz2 jsonrpc-cpp*.zip + --- a/jsonrpc-cpp-0.4/configure.ac +++ a/jsonrpc-cpp-0.4/configure.ac @@ -0,0 +1,72 @@ +AC_INIT([jsonrpc-cpp], [0.4], []) +AC_CONFIG_MACRO_DIR([m4]) +AC_CANONICAL_HOST +AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) + +AM_PROG_AR +LT_INIT +#LT_OUTPUT + +# Check for C++ compiler and use it to compile the tests. +# +AC_PROG_CXX +AC_PROG_INSTALL +AC_LANG([C++]) +AC_CHECK_PROGS([DOXYGEN], [doxygen], [:]) + + + +# Configure options: --enable-debug[=no]. +AC_ARG_ENABLE( [debug], + [AS_HELP_STRING([--enable-debug], [enable additional debug code paths (default is no)])], + [debug="$withval"], [debug='no']) + +AC_ARG_ENABLE( [examples], + [AS_HELP_STRING([--enable-examples], [install example code (default is yes)])], + [examples="$withval"], [examples='yes']) + +AC_ARG_ENABLE( [doc], + [AS_HELP_STRING([--enable-doc], [install documentation (default is yes)])], + [doc="$withval"], [doc='yes']) + + + +# Configure options: --with-json-cpp-inc-dir +AC_ARG_WITH( [jsoncpp-inc-dir], + [AS_HELP_STRING([--with-jsoncpp-inc-dir], [set jsoncpp include dir (default is /usr/include/jsoncpp)])], + [JSONCPP_INC_DIR="$withval"], + [JSONCPP_INC_DIR='/usr/include/jsoncpp']) + + +#AC_CHECK_LIB([jsoncpp], []) +# Allow the user to specify the pkgconfig directory. +# +#PKGCONFIG + +# Check for doxygen program. +AM_CONDITIONAL([HAVE_DOXYGEN],[test "${DOXYGEN}" != ':']) +AM_CONDITIONAL([ENABLE_DEBUG],[test ${debug} == 'yes']) +AM_CONDITIONAL([INSTALL_DOCUMENTATION],[test "${doc}" == 'yes']) +AM_CONDITIONAL([INSTALL_EXAMPLES],[test "${examples}" == 'yes']) + + +# Output. +# +AC_SUBST([JSONCPP_INC_DIR]) + +AC_CONFIG_FILES(Makefile src/Makefile test/Makefile examples/Makefile doc/Makefile) +AC_OUTPUT + + +echo " +($PACKAGE_NAME) version $PACKAGE_VERSION +Prefix.......................:'${prefix}' +C++ Compiler.................: ${CXX} ${CXXFLAGS} ${CPPFLAGS} +Linker.......................: ${LD} ${LDFLAGS} ${LIBS} +JSON-C++ include directory...:'${JSONCPP_INC_DIR}' +Debug Build..................: ${debug} +Install Examples.............: ${examples} +Install Documentation........: ${doc} +Doxygen......................: ${DOXYGEN:-NONE} +" + --- a/jsonrpc-cpp-0.4/doc/Makefile.am +++ a/jsonrpc-cpp-0.4/doc/Makefile.am @@ -0,0 +1,25 @@ +dist_doc_DATA=\ +../AUTHORS\ +../ChangeLog\ +../COPYING.GPL\ +../COPYING.LGPL\ +../LICENSE\ +../NEWS\ +../README\ +coding_style.txt\ +netstrings.txt + + +if HAVE_DOXYGEN + +noinst_HEADERS=$(srcdir)/doxygen-main.h $(top_srcdir)/Doxyfile + +dist_html_DATA=$(builddir)/html/* + +$(dist_html_DATA): ../Doxyfile doxygen-main.h + sed -e 's:src/:$(top_srcdir)/src/:' -e 's:doc/::' -e 's:doxygen-main.h:$(top_srcdir)/doc/doxygen-main.h:' $< | $(DOXYGEN) $(DOXYFLAGS) - + +clean-local: + -rm -rf html doxywarn.txt doxygen.pyc + +endif --- a/jsonrpc-cpp-0.4/examples/Makefile.am +++ a/jsonrpc-cpp-0.4/examples/Makefile.am @@ -0,0 +1,31 @@ +doc_examplesdir=$(docdir)/examples +dist_doc_examples_DATA=\ + Makefile.am\ + system.cpp\ + tcp-client.cpp\ + tcp-server.cpp\ + test-rpc.cpp\ + test-rpc.h\ + udp-client.cpp\ + udp-server.cpp + +noinst_PROGRAMS=udp-client udp-server tcp-client tcp-server system + +udp_client_SOURCES=udp-client.cpp test-rpc.cpp +tcp_client_SOURCES=tcp-client.cpp test-rpc.cpp +udp_server_SOURCES=udp-server.cpp test-rpc.cpp +tcp_server_SOURCES=tcp-server.cpp test-rpc.cpp +system_SOURCES=system.cpp + + + +tcp_client_LDADD=$(top_builddir)/src/libjsonrpc-cpp.la -ljsoncpp +tcp_server_LDADD=$(top_builddir)/src/libjsonrpc-cpp.la -ljsoncpp +udp_client_LDADD=$(top_builddir)/src/libjsonrpc-cpp.la -ljsoncpp +udp_server_LDADD=$(top_builddir)/src/libjsonrpc-cpp.la -ljsoncpp +system_LDADD=$(top_builddir)/src/libjsonrpc-cpp.la -ljsoncpp + +AM_CPPFLAGS=-I"@JSONCPP_INC_DIR@" -I"$(top_srcdir)/src" +if ENABLE_DEBUG + AM_CPPFLAGS+='-DDEBUG' +endif --- a/jsonrpc-cpp-0.4/src/Makefile.am +++ a/jsonrpc-cpp-0.4/src/Makefile.am @@ -0,0 +1,39 @@ +lib_LTLIBRARIES = libjsonrpc-cpp.la +libjsonrpc_cpp_la_SOURCES = \ + jsonrpc_handler.cpp\ + jsonrpc_server.cpp\ + jsonrpc_client.cpp\ + jsonrpc_udpserver.cpp\ + jsonrpc_tcpserver.cpp\ + jsonrpc_udpclient.cpp\ + jsonrpc_tcpclient.cpp\ + netstring.cpp\ + system.cpp\ + networking.cpp + +libjsonrpc_cpp_la_INCLUDES=\ + jsonrpc.h\ + jsonrpc_handler.h\ + jsonrpc_server.h\ + jsonrpc_client.h\ + jsonrpc_udpserver.h\ + jsonrpc_tcpserver.h\ + jsonrpc_udpclient.h\ + jsonrpc_tcpclient.h\ + jsonrpc_common.h\ + jsonrpc_httpclient.h\ + netstring.h\ + system.h\ + networking.h + +include_jsonrpc_cppdir=$(includedir)/jsonrpc-cpp +include_jsonrpc_cpp_HEADERS=$(libjsonrpc_cpp_la_INCLUDES) + +libjsonrpc_cpp_la_LDFLAGS = -release @PACKAGE_VERSION@ -ljsoncpp -lpthread + +AM_CXXFLAGS=-std=c++98 -Wall -Wextra -pedantic -Wredundant-decls -Wshadow -O2 #-Werror + +AM_CPPFLAGS=-I"@JSONCPP_INC_DIR@" +if ENABLE_DEBUG + AM_CPPFLAGS+='-DDEBUG' +endif --- a/jsonrpc-cpp-0.4/test/Makefile.am +++ a/jsonrpc-cpp-0.4/test/Makefile.am @@ -0,0 +1,15 @@ +check_PROGRAMS = test-runner +TESTS = $(check_PROGRAMS) + +test_runner_SOURCES = \ + test-runner.cpp\ + test-core.cpp\ + test-system.cpp\ + test-netstring.cpp + +test_runner_LDADD=$(top_builddir)/src/libjsonrpc-cpp.la -ljsoncpp -lcppunit + +AM_CPPFLAGS=-I"@JSONCPP_INC_DIR@" +if ENABLE_DEBUG + AM_CPPFLAGS+='-DDEBUG' +endif