You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2010/01/11 09:30:18 UTC
svn commit: r897791 [1/2] - in /tuscany/sca-cpp/trunk: ./ components/
components/cache/ etc/ kernel/ modules/ modules/atom/ modules/http/
modules/json/ modules/python/ modules/python/htdocs/ modules/scdl/
modules/scheme/ modules/server/ test/store-pyth...
Author: jsdelfino
Date: Mon Jan 11 08:30:15 2010
New Revision: 897791
URL: http://svn.apache.org/viewvc?rev=897791&view=rev
Log:
Improvements to autoconf build to make support for python, web service etc and relevant test cases optional and generate ac_defines used in ifdefs to check for debug and multithreading. Moved some optional code and test cases around to run them only when the tested features are built.
Added:
tuscany/sca-cpp/trunk/kernel/config.hpp
- copied, changed from r897790, tuscany/sca-cpp/trunk/kernel/debug.hpp
tuscany/sca-cpp/trunk/modules/python/client-test.cpp
- copied, changed from r897790, tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp
tuscany/sca-cpp/trunk/modules/python/client-test.py
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/client-test.py
tuscany/sca-cpp/trunk/modules/python/domain-test.composite
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/domain-test.composite
tuscany/sca-cpp/trunk/modules/python/htdocs/
tuscany/sca-cpp/trunk/modules/python/htdocs/index.html
tuscany/sca-cpp/trunk/modules/python/mod-python.cpp
- copied, changed from r897790, tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp
tuscany/sca-cpp/trunk/modules/python/mod-python.hpp
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/mod-python.hpp
tuscany/sca-cpp/trunk/modules/python/python-conf
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/server-conf
tuscany/sca-cpp/trunk/modules/python/server-test
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/server-test
tuscany/sca-cpp/trunk/modules/python/server-test.py
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/server-test.py
tuscany/sca-cpp/trunk/modules/server/client-test.hpp
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/client-test.cpp
tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/mod-eval.cpp
tuscany/sca-cpp/trunk/modules/server/scheme-conf
- copied, changed from r897790, tuscany/sca-cpp/trunk/modules/server/server-conf
Removed:
tuscany/sca-cpp/trunk/kernel/debug.hpp
tuscany/sca-cpp/trunk/modules/server/client-test.py
tuscany/sca-cpp/trunk/modules/server/mod-python.hpp
tuscany/sca-cpp/trunk/modules/server/server-test.py
Modified:
tuscany/sca-cpp/trunk/INSTALL
tuscany/sca-cpp/trunk/components/Makefile.am
tuscany/sca-cpp/trunk/components/cache/Makefile.am
tuscany/sca-cpp/trunk/components/cache/mcache.hpp
tuscany/sca-cpp/trunk/components/cache/server-test
tuscany/sca-cpp/trunk/configure.ac
tuscany/sca-cpp/trunk/etc/git-exclude
tuscany/sca-cpp/trunk/kernel/Makefile.am
tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp
tuscany/sca-cpp/trunk/kernel/fstream.hpp
tuscany/sca-cpp/trunk/kernel/function.hpp
tuscany/sca-cpp/trunk/kernel/gc.hpp
tuscany/sca-cpp/trunk/kernel/list.hpp
tuscany/sca-cpp/trunk/kernel/monad.hpp
tuscany/sca-cpp/trunk/kernel/parallel-test.cpp
tuscany/sca-cpp/trunk/kernel/parallel.hpp
tuscany/sca-cpp/trunk/kernel/stream.hpp
tuscany/sca-cpp/trunk/kernel/string.hpp
tuscany/sca-cpp/trunk/kernel/value.hpp
tuscany/sca-cpp/trunk/modules/Makefile.am
tuscany/sca-cpp/trunk/modules/atom/Makefile.am
tuscany/sca-cpp/trunk/modules/http/Makefile.am
tuscany/sca-cpp/trunk/modules/http/httpd.hpp
tuscany/sca-cpp/trunk/modules/json/Makefile.am
tuscany/sca-cpp/trunk/modules/python/Makefile.am
tuscany/sca-cpp/trunk/modules/scdl/Makefile.am
tuscany/sca-cpp/trunk/modules/scheme/Makefile.am
tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp
tuscany/sca-cpp/trunk/modules/server/Makefile.am
tuscany/sca-cpp/trunk/modules/server/client-test.cpp
tuscany/sca-cpp/trunk/modules/server/domain-test.composite
tuscany/sca-cpp/trunk/modules/server/httpd-test
tuscany/sca-cpp/trunk/modules/server/impl-test.cpp
tuscany/sca-cpp/trunk/modules/server/mod-cpp.hpp
tuscany/sca-cpp/trunk/modules/server/mod-eval.cpp
tuscany/sca-cpp/trunk/modules/server/mod-scheme.hpp
tuscany/sca-cpp/trunk/modules/server/mod-wiring.cpp
tuscany/sca-cpp/trunk/modules/server/server-conf
tuscany/sca-cpp/trunk/modules/server/server-test
tuscany/sca-cpp/trunk/modules/server/wiring-test
tuscany/sca-cpp/trunk/test/store-python/Makefile.am
tuscany/sca-cpp/trunk/test/store-python/server-test
tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am
tuscany/sca-cpp/trunk/test/store-scheme/server-test
Modified: tuscany/sca-cpp/trunk/INSTALL
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/INSTALL?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/INSTALL (original)
+++ tuscany/sca-cpp/trunk/INSTALL Mon Jan 11 08:30:15 2010
@@ -56,6 +56,15 @@
To enable multi-threading with the HTTPD worker MPM, add:
--enable-threads
+To enable support for Python component implementations:
+--enable-python
+
+To enable support for Java component implementations:
+--enable-java
+
+To build the Web service utility component (using Axis2C):
+--enable-webservice
+
To generate doxygen documentation, add:
--enable-doxygen
@@ -70,10 +79,12 @@
./configure --prefix=$HOME/tuscany-sca-cpp-bin \
--with-apr=$HOME/httpd-2.2.13-bin --with-httpd=$HOME/httpd-2.2.13-bin \
+--with-curl=/usr --with-libxml2=/usr \
--with-js-include=/usr/include/xulrunner-1.9.1.5/unstable \
--with-js-lib=/usr/lib/xulrunner-1.9.1.5 \
---with-python=/usr \
---with-curl=/usr --with-libxml2=/usr \
+--enable-python --with-python=/usr \
+--enable-java --with-java=/usr/lib/jvm/default-java \
+--enable-webservice --with-axis2c=$HOME/axis2c-1.6.0-bin \
--enable-threads --enable-maintainer-mode
@@ -99,4 +110,3 @@
To install the Tuscany SCA binaries, do this:
make install
-
Modified: tuscany/sca-cpp/trunk/components/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/components/Makefile.am Mon Jan 11 08:30:15 2010
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-SUBDIRS = cache store
+SUBDIRS = cache store webservice
includedir = $(prefix)/include/components
nobase_include_HEADERS = */*.hpp
Modified: tuscany/sca-cpp/trunk/components/cache/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/cache/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/cache/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/components/cache/Makefile.am Mon Jan 11 08:30:15 2010
@@ -15,20 +15,17 @@
# specific language governing permissions and limitations
# under the License.
-noinst_PROGRAMS = mcache-test mcache-client-test
-
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} -I${JS_INCLUDE} -I${CURL_INCLUDE}
+noinst_PROGRAMS = mcache-test client-test
compdir=$(prefix)/components/cache
comp_LTLIBRARIES = libmcache.la
libmcache_la_SOURCES = mcache.cpp
-libmcache_la_LIBADD = -L${APR_LIB} -lapr-1 -laprutil-1
mcache_test_SOURCES = mcache-test.cpp
-mcache_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
+mcache_test_LDADD = -lxml2
-mcache_client_test_SOURCES = mcache-client-test.cpp
-mcache_client_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${JS_LIB} -lmozjs
+client_test_SOURCES = client-test.cpp
+client_test_LDADD = -lxml2 -lcurl -lmozjs
-TESTS = memcached-test memcached-server-test
+TESTS = memcached-test server-test
Modified: tuscany/sca-cpp/trunk/components/cache/mcache.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/cache/mcache.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/cache/mcache.hpp (original)
+++ tuscany/sca-cpp/trunk/components/cache/mcache.hpp Mon Jan 11 08:30:15 2010
@@ -38,7 +38,6 @@
#include "list.hpp"
#include "value.hpp"
#include "monad.hpp"
-#include "debug.hpp"
#include "../../modules/scheme/eval.hpp"
namespace tuscany {
Modified: tuscany/sca-cpp/trunk/components/cache/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/cache/server-test?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/cache/server-test (original)
+++ tuscany/sca-cpp/trunk/components/cache/server-test Mon Jan 11 08:30:15 2010
@@ -20,6 +20,7 @@
# Setup
../../modules/http/httpd-conf tmp 8090 ../../modules/http/htdocs
../../modules/server/server-conf tmp
+../../modules/server/scheme-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
<Location />
Modified: tuscany/sca-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/configure.ac?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/configure.ac (original)
+++ tuscany/sca-cpp/trunk/configure.ac Mon Jan 11 08:30:15 2010
@@ -25,7 +25,7 @@
AM_INIT_AUTOMAKE([tar-ustar])
AC_PREFIX_DEFAULT(/usr/local/tuscany/sca)
-# Checks for programs.
+# Check for required programs.
AC_MSG_NOTICE([checking for programs])
AC_PROG_CXX
AC_PROG_AWK
@@ -35,23 +35,26 @@
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
+AC_PATH_PROG(MEMCACHED, memcached, , ${PATH})
+if test "${MEMCACHED}" = ""; then
+ AC_MSG_ERROR([could not find memcached])
+fi
-# Check for running on Darwin
+# Check for running on Darwin.
AC_MSG_CHECKING([if running on Darwin])
UNAME=`uname -s`
if test "${UNAME}" = "Darwin"; then
- AC_DEFINE([IS_DARWIN], [1], [Set to 1 when running on Darwin - Mac OSX])
+ AC_DEFINE([IS_DARWIN], 1, [running on Darwin])
AC_MSG_RESULT(yes)
AC_SUBST([libsuffix],[".dylib"])
- is_darwin=true
+ AM_CONDITIONAL([DARWIN], true)
else
AC_MSG_RESULT(no)
AC_SUBST([libsuffix],[".so"])
- is_darwin=false
+ AM_CONDITIONAL([DARWIN], false)
fi
-AM_CONDITIONAL([DARWIN], [test "${is_darmin}" = "true"])
-# Configure CURL_INCLUDE and CURL_LIB
+# Configure path to CURL includes and lib.
AC_MSG_CHECKING([for curl])
AC_ARG_WITH([curl], [AC_HELP_STRING([--with-curl=PATH], [path to installed curl [default=/usr]])], [
CURL_INCLUDE="${withval}/include"
@@ -65,7 +68,7 @@
AC_SUBST(CURL_INCLUDE)
AC_SUBST(CURL_LIB)
-# Configure LIBXML2_INCLUDE and LIBXML2_LIB
+# Configure path to libxml2 includes and lib.
AC_MSG_CHECKING([for libxml2])
AC_ARG_WITH([libxml2], [AC_HELP_STRING([--with-libxml2=PATH], [path to installed libxml2 [default=/usr]])], [
LIBXML2_INCLUDE="${withval}/include/libxml2"
@@ -79,7 +82,7 @@
AC_SUBST(LIBXML2_INCLUDE)
AC_SUBST(LIBXML2_LIB)
-# Configure LIBMOZJS_INCLUDE and LIBMOZJS_LIB
+# Configure path to libmozjs includes and lib.
AC_MSG_CHECKING([for js-include])
AC_ARG_WITH([js-include], [AC_HELP_STRING([--with-js-include=PATH], [path to installed SpiderMonkey include dir
[default=/usr/include/xulrunner-1.9.1.5/unstable]])], [
@@ -100,9 +103,9 @@
AC_SUBST(JS_INCLUDE)
AC_SUBST(JS_LIB)
-# Configure APR and HTTPD
+# Configure path to APR and HTTPD includes and libs.
AC_MSG_CHECKING([for apr])
-AC_ARG_WITH([apr], [AC_HELP_STRING([--with-apr=PATH], [path to installed apr [default=/usr/local/apache2]])], [
+AC_ARG_WITH([apr], [AC_HELP_STRING([--with-apr=PATH], [path to installed APR [default=/usr/local/apache2]])], [
APR_INCLUDE="${withval}/include"
APR_LIB="${withval}/lib"
AC_MSG_RESULT("${withval}")
@@ -115,7 +118,7 @@
AC_SUBST(APR_LIB)
AC_MSG_CHECKING([for httpd])
-AC_ARG_WITH([httpd], [AC_HELP_STRING([--with-httpd=PATH], [path to installed httpd [default=/usr/local/apache2]])], [
+AC_ARG_WITH([httpd], [AC_HELP_STRING([--with-httpd=PATH], [path to installed HTTPD [default=/usr/local/apache2]])], [
HTTPD_INCLUDE="${withval}/include"
AC_MSG_RESULT("${withval}")
], [
@@ -124,60 +127,57 @@
])
AC_SUBST(HTTPD_INCLUDE)
-# Configure PYTHON_INCLUDE and PYTHON_LIB
-AC_MSG_CHECKING([for python])
-AC_ARG_WITH([curl], [AC_HELP_STRING([--with-python=PATH], [path to installed python 2.6 [default=/usr]])], [
- PYTHON_INCLUDE="${withval}/include"
- PYTHON_LIB="${withval}/lib"
- AC_MSG_RESULT("${withval}")
-], [
- PYTHON_INCLUDE="/usr/include"
- PYTHON_LIB="/usr/lib"
- AC_MSG_RESULT(/usr)
-])
-AC_SUBST(PYTHON_INCLUDE)
-AC_SUBST(PYTHON_LIB)
+# Configure TUSCANY_SCACPP path variable.
+TUSCANY_SCACPP=`echo "${TUSCANY_SCACPP}"`
+if test "${TUSCANY_SCACPP}" = ""; then
+ pwd=`pwd`
+ AC_SUBST([TUSCANY_SCACPP], ["${pwd}"])
+fi
-# Checks for libraries.
-original_LIBS="${LIBS}"
-AC_MSG_NOTICE([checking for libraries])
-LIBS="-L${CURL_LIB} ${original_LIBS}"
+# Initialize default GCC C++ and LD options.
+cxxflags=""
+ldflags="${LDFLAGS}"
+
+# Configure default includes.
+cxxflags="${cxxflags} ${INCLUDES} -I. -I${TUSCANY_SCACPP}/kernel -I${APR_INCLUDE} -I${LIBXML2_INCLUDE} -I${JS_INCLUDE} -I${CURL_INCLUDE}"
+
+# Check for libraries required by all modules and add them to default LIBS variable
+AC_MSG_NOTICE([checking for required libraries])
+LIBS="-L${APR_LIB} ${LIBS}"
+AC_CHECK_LIB([apr-1], [apr_pool_initialize], [], [AC_MSG_ERROR([couldn't find a suitable libapr-1, use --with-apr=PATH])])
+AC_CHECK_LIB([aprutil-1], [apr_memcache_replace], [], [AC_MSG_ERROR([couldn't find a suitable libaprutil-1, use --with-apr=PATH])])
+default_LIBS="${LIBS}"
+
+# Check for libraries only required by some modules.
+LIBS="-L${CURL_LIB} ${default_LIBS}"
AC_CHECK_LIB([curl], [curl_global_init], [], [AC_MSG_ERROR([couldn't find a suitable libcurl, use --with-curl=PATH])])
-LIBS="-L${JS_LIB} ${original_LIBS}"
+LIBS="-L${JS_LIB} ${default_LIBS}"
AC_CHECK_LIB([mozjs], [JS_NewContext], [], [AC_MSG_ERROR([couldn't find a suitable libmozjs, use --with-js-lib=PATH])])
-LIBS="${original_LIBS}"
-AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR([couldn't find a suitable libpthread])])
-LIBS="-L${LIBXML2_LIB} ${original_LIBS}"
+LIBS="-L${LIBXML2_LIB} ${default_LIBS}"
AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([couldn't find a suitable libxml2, use --with-libxml2=PATH])])
-LIBS="-L${APR_LIB} ${original_LIBS}"
-AC_CHECK_LIB([apr-1], [apr_pool_initialize], [], [AC_MSG_ERROR([couldn't find a suitable libapr-1, use --with-apr=PATH])])
-AC_CHECK_LIB([aprutil-1], [apr_memcache_replace], [], [AC_MSG_ERROR([couldn't find a suitable libaprutil-1, use --with-apr=PATH])])
-LIBS="-L${PYTHON_LIB} ${original_LIBS}"
-AC_CHECK_LIB([python2.6], [Py_Initialize], [], [AC_MSG_ERROR([couldn't find a suitable libpython2.6, use --with-python=PATH])])
-LIBS="${original_LIBS}"
-# Checks for header files.
+# Configure default search path for these libraries.
+LIBS="-L${CURL_LIB} -L${JS_LIB} -L${LIBXML2_LIB} ${default_LIBS}"
+default_LIBS="${LIBS}"
+
+# Check for required header files.
AC_MSG_NOTICE([checking for header files])
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([string.h sys/time.h])
-# Checks for typedefs, structures, and compiler characteristics.
+# Check for typedefs, structures, and compiler characteristics.
AC_MSG_NOTICE([checking for typedefs, structures, and compiler characteristics])
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
-# Checks for library functions.
+# Check for required library functions.
AC_MSG_NOTICE([checking for library functions])
AC_CHECK_FUNCS([gettimeofday select])
-# Configure GCC C++ compile options
-cxxflags=""
-ldflags="${LDFLAGS}"
-
-# Configure debugging and compile-time warnings
+# Enable debugging and compile-time warnings.
AC_MSG_CHECKING([whether to compile with debugging and compile-time warnings])
AC_ARG_ENABLE(maintainer-mode, [AS_HELP_STRING([--enable-maintainer-mode], [compile with debugging and compile-time warnings [default=no]])],
[ case "${enableval}" in
@@ -193,11 +193,14 @@
if test "${want_maintainer_mode}" = "true"; then
cxxflags="${cxxflags} -D_DEBUG -O0 -ggdb -g3 -Werror -Wall -Wextra -Wno-ignored-qualifiers -Winit-self -Wmissing-include-dirs -Wcast-qual -Wcast-align -Wwrite-strings -Wpointer-arith -Wconversion -Waddress -Wlogical-op -Wredundant-decls -std=c++0x -fmessage-length=0"
ldflags="${ldflags} -pg"
+ AM_CONDITIONAL([WANT_MAINTAINER_MODE], true)
+ AC_DEFINE([WANT_MAINTAINER_MODE], 1, [compile with debugging and compile-time warnings])
else
cxxflags="${cxxflags} -O3 -std=c++0x -fmessage-length=0"
+ AM_CONDITIONAL([WANT_MAINTAINER_MODE], false)
fi
-# Configure profiling
+# Enable profiling with gprof.
AC_MSG_CHECKING([whether to compile with profiling])
AC_ARG_ENABLE(profiling, [AS_HELP_STRING([--enable-profiling], [compile with profiling [default=no]])],
[ case "${enableval}" in
@@ -213,9 +216,13 @@
if test "${want_profiling}" = "true"; then
cxxflags="${cxxflags} -pg"
ldflags="${ldflags} -pg"
+ AM_CONDITIONAL([WANT_PROFILING], true)
+ AC_DEFINE([WANT_PROFILING], 1, [compile with profiling])
+else
+ AM_CONDITIONAL([WANT_PROFILING], false)
fi
-# Configure multi-threading support
+# Enable multi-threading support.
AC_MSG_CHECKING([whether to compile for multi-threaded execution])
AC_ARG_ENABLE(threads, [AS_HELP_STRING([--enable-threads], [compile for multi-threaded execution [default=no]])],
[ case "${enableval}" in
@@ -229,27 +236,26 @@
esac ],
[ AC_MSG_RESULT(no)])
if test "${want_threads}" = "true"; then
- LIBS="${original_LIBS}"
+ LIBS="${default_LIBS}"
AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR([couldn't find a suitable libpthread])])
- LIBS="${original_LIBS}"
+ LIBS="${default_LIBS}"
cxxflags="${cxxflags} -D_REENTRANT"
ldflags="${ldflags} -lpthread"
+ AM_CONDITIONAL([WANT_THREADS], true)
+ AC_DEFINE([WANT_THREADS], 1, [compile for multi-threaded execution])
+else
+ AM_CONDITIONAL([WANT_THREADS], false)
fi
+
+# Configure GCC C++ and LD options.
AC_SUBST([CXXFLAGS], ["${cxxflags}"])
AC_SUBST([LDFLAGS], ["${ldflags}"])
-# Configure exuberant ctags
+# Configure exuberant ctags.
TAGSFILE="`pwd`/tags"
AC_SUBST([CTAGSFLAGS], ["${CTAGSFLAGS} --c++-kinds=+p --fields=+iaS --extra=+q --append --tag-relative=yes -f ${TAGSFILE}"])
-# Configure TUSCANY_SCACPP
-TUSCANY_SCACPP=`echo "${TUSCANY_SCACPP}"`
-if test "${TUSCANY_SCACPP}" = ""; then
- SCAPWD=`pwd`
- AC_SUBST([TUSCANY_SCACPP], ["${SCAPWD}"])
-fi
-
-# Configure Doxygen build
+# Enable Doxygen documentation.
AC_MSG_CHECKING([whether to build Doxygen documentation])
AC_ARG_ENABLE(doxygen, [AS_HELP_STRING([--enable-doxygen], [build Doxygen documentation [default=no]])],
[ case "${enableval}" in
@@ -258,29 +264,149 @@
;;
*)
AC_MSG_RESULT(yes)
+ want_doxygen=true
+ ;;
+ esac ],
+[ AC_MSG_RESULT(no)])
+if test "${want_doxygen}" = "true"; then
AC_PATH_PROG(DOXYGEN, doxygen, , ${PATH})
if test "${DOXYGEN}" = ""; then
AC_MSG_ERROR([could not find doxygen])
fi
- want_doxygen=true
+ AM_CONDITIONAL([WANT_DOXYGEN], true)
+ AC_DEFINE([WANT_DOXYGEN], 1, [build Doxygen documentation])
+else
+ AM_CONDITIONAL([WANT_DOXYGEN], false)
+fi
+
+# Configure path to Python 2.6 includes and lib.
+AC_MSG_CHECKING([for python])
+AC_ARG_WITH([python], [AC_HELP_STRING([--with-python=PATH], [path to installed Python 2.6 [default=/usr]])], [
+ PYTHON_INCLUDE="${withval}/include"
+ PYTHON_LIB="${withval}/lib"
+ AC_MSG_RESULT("${withval}")
+], [
+ PYTHON_INCLUDE="/usr/include"
+ PYTHON_LIB="/usr/lib"
+ AC_MSG_RESULT(/usr)
+])
+AC_SUBST(PYTHON_INCLUDE)
+AC_SUBST(PYTHON_LIB)
+
+# Enable Python 2.6 support.
+AC_MSG_CHECKING([whether to enable Python support])
+AC_ARG_ENABLE(python, [AS_HELP_STRING([--enable-python], [enable Python support [default=no]])],
+[ case "${enableval}" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ want_python=true
;;
esac ],
[ AC_MSG_RESULT(no)])
-AM_CONDITIONAL([WANT_DOXYGEN], [test "${want_doxygen}" = "true"])
+if test "${want_python}" = "true"; then
+ LIBS="-L${PYTHON_LIB} ${default_LIBS}"
+ AC_CHECK_LIB([python2.6], [Py_Initialize], [], [AC_MSG_ERROR([couldn't find a suitable libpython2.6, use --with-python=PATH])])
+ LIBS="${default_LIBS}"
+ AM_CONDITIONAL([WANT_PYTHON], true)
+ AC_DEFINE([WANT_PYTHON], 1, [enable Python support])
+else
+ AM_CONDITIONAL([WANT_PYTHON], false)
+fi
+
+# Configure path to Java includes and lib.
+AC_MSG_CHECKING([for java])
+AC_ARG_WITH([java], [AC_HELP_STRING([--with-java=PATH], [path to installed Java [default=/usr/lib/jvm/default-java]])], [
+ JAVA_INCLUDE="${withval}/include"
+ JAVA_LIB="${withval}/jre/lib/i386"
+ AC_MSG_RESULT("${withval}")
+], [
+ JAVA_INCLUDE="/usr/lib/jvm/default-java/include"
+ JAVA_LIB="/usr/lib/jvm/default-java/jre/lib/i386"
+ AC_MSG_RESULT(/usr/lib/jvm/default-java)
+])
+AC_SUBST(JAVA_INCLUDE)
+AC_SUBST(JAVA_LIB)
+
+# Enable Java support.
+AC_MSG_CHECKING([whether to enable Java support])
+AC_ARG_ENABLE(java, [AS_HELP_STRING([--enable-java], [enable Java support [default=no]])],
+[ case "${enableval}" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ want_java=true
+ ;;
+ esac ],
+[ AC_MSG_RESULT(no)])
+if test "${want_java}" = "true"; then
+ LIBS="-L${JAVA_LIB} ${default_LIBS}"
+ #AC_CHECK_LIB([java], [JNI_OnLoad], [], [AC_MSG_ERROR([couldn't find a suitable libjava, use --with-java=PATH])])
+ LIBS="${default_LIBS}"
+ AC_PROG_JAVAC
+ AC_PROG_JAR
+ AM_CONDITIONAL([WANT_JAVA], true)
+ AC_DEFINE([WANT_JAVA], 1, [enable Java support])
+else
+ AM_CONDITIONAL([WANT_JAVA], false)
+fi
+
+# Configure path to Axis2C includes and lib.
+AC_MSG_CHECKING([for axis2c])
+AC_ARG_WITH([axis2c], [AC_HELP_STRING([--with-axis2c=PATH], [path to installed Axis2C [default=/usr/local/axis2c]])], [
+ AXIS2C_INCLUDE="${withval}/include"
+ AXIS2C_LIB="${withval}/lib"
+ AC_MSG_RESULT("${withval}")
+], [
+ AXIS2C_INCLUDE="/usr/local/axis2c/include"
+ AXIS2C_LIB="/usr/local/axis2c/lib"
+ AC_MSG_RESULT(/usr/local/axis2c)
+])
+AC_SUBST(AXIS2C_INCLUDE)
+AC_SUBST(AXIS2C_LIB)
+
+# Enable Web service support.
+AC_MSG_CHECKING([whether to enable Web service support])
+AC_ARG_ENABLE(webservice, [AS_HELP_STRING([--enable-webservice], [enable Web service support [default=no]])],
+[ case "${enableval}" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ want_webservice=true
+ ;;
+ esac ],
+[ AC_MSG_RESULT(no)])
+if test "${want_webservice}" = "true"; then
+ LIBS="-L${AXIS2C_LIB} ${default_LIBS}"
+ AC_CHECK_LIB([axis2_engine], [axis2_svc_client_create], [], [AC_MSG_ERROR([couldn't find a suitable libaxis2_engine, use --with-axis2c=PATH])])
+ LIBS="${default_LIBS}"
+ AM_CONDITIONAL([WANT_WEBSERVICE], true)
+ AC_DEFINE([WANT_WEBSERVICE], 1, [enable Web service support])
+else
+ AM_CONDITIONAL([WANT_WEBSERVICE], false)
+fi
AC_CONFIG_FILES([Makefile
kernel/Makefile
modules/Makefile
- modules/atom/Makefile
modules/scheme/Makefile
- modules/http/Makefile
+ modules/atom/Makefile
modules/json/Makefile
- modules/python/Makefile
modules/scdl/Makefile
+ modules/http/Makefile
+ modules/python/Makefile
+ modules/java/Makefile
modules/server/Makefile
components/Makefile
components/cache/Makefile
components/store/Makefile
+ components/webservice/Makefile
samples/Makefile
test/Makefile
test/store-scheme/Makefile
@@ -289,4 +415,3 @@
doc/Doxyfile
])
AC_OUTPUT
-
Modified: tuscany/sca-cpp/trunk/etc/git-exclude
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/etc/git-exclude?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/etc/git-exclude (original)
+++ tuscany/sca-cpp/trunk/etc/git-exclude Mon Jan 11 08:30:15 2010
@@ -58,6 +58,9 @@
*~
tags
doxygen
+*.pyc
+*.class
+*.stamp
# Specific ignores
kernel-test
@@ -72,8 +75,10 @@
cache-test
client-test
mcache-test
-mcache-client-test
curl-test
scdl-test
+java-test
+java-shell
script-test
+webservice-test
Modified: tuscany/sca-cpp/trunk/kernel/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/kernel/Makefile.am Mon Jan 11 08:30:15 2010
@@ -23,27 +23,20 @@
includedir = $(prefix)/include/kernel
include_HEADERS = *.hpp
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE}
-
string_test_SOURCES = string-test.cpp
-string_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
libdynlib_test_la_SOURCES = dynlib-test.cpp
-libdynlib_test_la_LIBADD = -L${APR_LIB} -lapr-1 -laprutil-1
kernel_test_SOURCES = kernel-test.cpp
-kernel_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
mem_test_SOURCES = mem-test.cpp
-mem_test_LDADD = -L${APR_LIB} -lapr-1 -laprutil-1
parallel_test_SOURCES = parallel-test.cpp
-parallel_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
xml_test_SOURCES = xml-test.cpp
-xml_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
+xml_test_LDADD = -lxml2
xsd_test_SOURCES = xsd-test.cpp
-xsd_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
+xsd_test_LDADD = -lxml2
TESTS = string-test kernel-test mem-test parallel-test xml-test
Copied: tuscany/sca-cpp/trunk/kernel/config.hpp (from r897790, tuscany/sca-cpp/trunk/kernel/debug.hpp)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/config.hpp?p2=tuscany/sca-cpp/trunk/kernel/config.hpp&p1=tuscany/sca-cpp/trunk/kernel/debug.hpp&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/debug.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/config.hpp Mon Jan 11 08:30:15 2010
@@ -19,22 +19,31 @@
/* $Rev$ $Date$ */
-#ifndef tuscany_debug_hpp
-#define tuscany_debug_hpp
+#ifndef tuscany_config_hpp
+#define tuscany_config_hpp
+
+#include "ap_config.h"
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+
+#include "../config.h"
/**
- * Debug functions and macros.
+ * Platform configuration and debug functions.
*/
namespace tuscany
{
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
/**
* Add string watch members to important classes to help watch them in a debugger.
*/
-#define _DEBUG_WATCH
+#define WANT_MAINTAINER_WATCH
/**
* Increment / decrement a debug counter.
@@ -64,4 +73,4 @@
#endif
}
-#endif /* tuscany_debug_hpp */
+#endif /* tuscany_config_hpp */
Modified: tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp (original)
+++ tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp Mon Jan 11 08:30:15 2010
@@ -24,7 +24,6 @@
*/
#include "function.hpp"
-#include "debug.hpp"
namespace tuscany {
namespace test {
Modified: tuscany/sca-cpp/trunk/kernel/fstream.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/fstream.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/fstream.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/fstream.hpp Mon Jan 11 08:30:15 2010
@@ -139,7 +139,7 @@
/**
* Debug log stream.
*/
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
template<typename V> const bool debug(const V& v, const string& msg) {
cerr << msg << ": " << v << endl;
Modified: tuscany/sca-cpp/trunk/kernel/function.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/function.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/function.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/function.hpp Mon Jan 11 08:30:15 2010
@@ -29,11 +29,11 @@
#include <utility>
#include "fstream.hpp"
#include "gc.hpp"
-#include "debug.hpp"
+#include "config.hpp"
namespace tuscany {
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
/**
* Debug counters.
Modified: tuscany/sca-cpp/trunk/kernel/gc.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/gc.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/gc.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/gc.hpp Mon Jan 11 08:30:15 2010
@@ -31,7 +31,7 @@
#include <apr_pools.h>
#include <assert.h>
#include <new>
-#include "debug.hpp"
+#include "config.hpp"
namespace tuscany
{
@@ -139,7 +139,7 @@
/**
* Maintain a stack of memory pools.
*/
-#ifdef _REENTRANT
+#ifdef WANT_THREADS
__thread
#endif
apr_pool_t* gc_pool_stack = NULL;
Modified: tuscany/sca-cpp/trunk/kernel/list.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/list.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/list.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/list.hpp Mon Jan 11 08:30:15 2010
@@ -30,11 +30,10 @@
#include "string.hpp"
#include "fstream.hpp"
#include "function.hpp"
-#include "debug.hpp"
namespace tuscany {
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
/**
* Debug utilities. Counters used to track instances of lists, and
@@ -71,7 +70,7 @@
#endif
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
#define debug_watchList() do { \
this->watch = watchList(*this); \
@@ -105,7 +104,7 @@
list(const list& p) : car(p.car), cdr(p.cdr) {
debug_inc(countLists);
debug_inc(countCLists);
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
watch = p.watch;
#endif
}
@@ -115,7 +114,7 @@
return *this;
car = p.car;
cdr = p.cdr;
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
watch = p.watch;
#endif
return *this;
@@ -176,7 +175,7 @@
}
private:
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
template<typename X> friend const string watchList(const list<X>& p);
string watch;
#endif
@@ -189,7 +188,7 @@
lambda<list<T>()> cdr;
};
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
/**
* Debug utility used to write the contents of a list to a string, easier
Modified: tuscany/sca-cpp/trunk/kernel/monad.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/monad.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/monad.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/monad.hpp Mon Jan 11 08:30:15 2010
@@ -27,7 +27,6 @@
*/
#include "function.hpp"
-#include "debug.hpp"
#include "string.hpp"
#include "stream.hpp"
Modified: tuscany/sca-cpp/trunk/kernel/parallel-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/parallel-test.cpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/parallel-test.cpp (original)
+++ tuscany/sca-cpp/trunk/kernel/parallel-test.cpp Mon Jan 11 08:30:15 2010
@@ -33,7 +33,7 @@
namespace tuscany {
-#ifdef _REENTRANT
+#ifdef WANT_THREADS
int inci = 0;
@@ -153,7 +153,7 @@
int main() {
tuscany::cout << "Testing..." << tuscany::endl;
-#ifdef _REENTRANT
+#ifdef WANT_THREADS
tuscany::testAtomicPerf();
tuscany::testWorker();
#else
Modified: tuscany/sca-cpp/trunk/kernel/parallel.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/parallel.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/parallel.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/parallel.hpp Mon Jan 11 08:30:15 2010
@@ -26,7 +26,7 @@
* Simple parallel work execution functions.
*/
-#ifdef _REENTRANT
+#ifdef WANT_THREADS
#include <pthread.h>
#include <sys/syscall.h>
#include <unistd.h>
@@ -37,7 +37,7 @@
namespace tuscany {
-#ifdef _REENTRANT
+#ifdef WANT_THREADS
/**
* Returns the current thread id.
Modified: tuscany/sca-cpp/trunk/kernel/stream.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/stream.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/stream.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/stream.hpp Mon Jan 11 08:30:15 2010
@@ -27,7 +27,7 @@
*/
#include <stdarg.h>
-#include "debug.hpp"
+#include "config.hpp"
#include "gc.hpp"
#include "string.hpp"
@@ -152,7 +152,7 @@
return out << p.ptr;
}
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
/**
* Debug stream implementation with no dependencies on anything else.
Modified: tuscany/sca-cpp/trunk/kernel/string.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/string.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/string.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/string.hpp Mon Jan 11 08:30:15 2010
@@ -34,7 +34,7 @@
namespace tuscany {
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
/**
* Debug utilities. Counters used to track string copies.
@@ -67,7 +67,7 @@
* Instrumented memcpy.
*/
void* string_memcpy(void* t, const void* s, const size_t n) {
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
countStringCopies += 1;
#endif
return memcpy(t, s, n);
@@ -172,7 +172,7 @@
}
private:
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
friend class odebugstream;
#endif
friend class ostringstream;
Modified: tuscany/sca-cpp/trunk/kernel/value.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/value.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/value.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/value.hpp Mon Jan 11 08:30:15 2010
@@ -33,12 +33,11 @@
#include "function.hpp"
#include "list.hpp"
#include "monad.hpp"
-#include "debug.hpp"
namespace tuscany
{
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
/**
* Debug utilities. Counters used to track instances of values, and
@@ -75,7 +74,7 @@
#endif
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
#define debug_watchValue() do { \
this->watch = watchValue(*this); \
@@ -124,7 +123,7 @@
default:
break;
}
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
watch = v.watch;
#endif
}
@@ -223,7 +222,7 @@
default:
break;
}
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
watch = v.watch;
#endif
return *this;
@@ -420,7 +419,7 @@
friend ostream& operator<<(ostream&, const value&);
friend const value::ValueType type(const value& v);
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
friend const string watchValue(const value& v);
string watch;
#endif
@@ -429,7 +428,7 @@
lambda<char()> data;
};
-#ifdef _DEBUG_WATCH
+#ifdef WANT_MAINTAINER_WATCH
/**
* Debug utility used to write the contents of a value to a string, easier
Modified: tuscany/sca-cpp/trunk/modules/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/Makefile.am Mon Jan 11 08:30:15 2010
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-SUBDIRS = atom scheme json python scdl http server
+SUBDIRS = scheme atom json scdl http server python java
includedir = $(prefix)/include/modules
nobase_include_HEADERS = */*.hpp
Modified: tuscany/sca-cpp/trunk/modules/atom/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/atom/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/atom/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/atom/Makefile.am Mon Jan 11 08:30:15 2010
@@ -17,10 +17,7 @@
noinst_PROGRAMS = atom-test
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE}
-
atom_test_SOURCES = atom-test.cpp
-atom_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
+atom_test_LDADD = -lxml2
TESTS = atom-test
-
Modified: tuscany/sca-cpp/trunk/modules/http/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/http/Makefile.am Mon Jan 11 08:30:15 2010
@@ -17,9 +17,9 @@
noinst_PROGRAMS = curl-test
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${HTTPD_INCLUDE} -I${APR_INCLUDE} -I${JS_INCLUDE} -I${CURL_INCLUDE}
+INCLUDES = -I${HTTPD_INCLUDE}
curl_test_SOURCES = curl-test.cpp
-curl_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${JS_LIB} -lmozjs
+curl_test_LDADD = -lxml2 -lcurl -lmozjs
TESTS = httpd-test http-test
Modified: tuscany/sca-cpp/trunk/modules/http/httpd.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd.hpp Mon Jan 11 08:30:15 2010
@@ -26,15 +26,11 @@
* HTTPD module implementation functions.
*/
-#include "string.hpp"
-#include "stream.hpp"
-
#include "apr_strings.h"
#include "apr_fnmatch.h"
#include "apr_lib.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
-#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
@@ -48,9 +44,10 @@
#include "mod_core.h"
+#include "string.hpp"
+#include "stream.hpp"
#include "list.hpp"
#include "value.hpp"
-#include "debug.hpp"
namespace tuscany {
@@ -120,7 +117,7 @@
return optional(apr_table_get(r->headers_in, "Content-Type"));
}
-#ifdef _DEBUG
+#ifdef WANT_MAINTAINER_MODE
/**
* Debug log.
Modified: tuscany/sca-cpp/trunk/modules/json/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/json/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/json/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/json/Makefile.am Mon Jan 11 08:30:15 2010
@@ -17,10 +17,7 @@
noinst_PROGRAMS = json-test
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} -I${JS_INCLUDE}
-
json_test_SOURCES = json-test.cpp
-json_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${JS_LIB} -lmozjs
+json_test_LDADD = -lmozjs
TESTS = json-test
-
Modified: tuscany/sca-cpp/trunk/modules/python/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/python/Makefile.am Mon Jan 11 08:30:15 2010
@@ -15,17 +15,31 @@
# specific language governing permissions and limitations
# under the License.
-noinst_PROGRAMS = python-test python-shell
-
datadir=$(prefix)/modules/python
+
+if WANT_PYTHON
+
+noinst_PROGRAMS = python-test python-shell client-test
+
+libdir=$(prefix)/lib
+lib_LTLIBRARIES = libmod_tuscany_python.la
+
nobase_data_DATA = *.xsd
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} -I${PYTHON_INCLUDE}
+INCLUDES = -I${PYTHON_INCLUDE}
+
+libmod_tuscany_python_la_SOURCES = mod-python.cpp
+libmod_tuscany_python_la_LIBADD = -lxml2 -lcurl -lmozjs -L${PYTHON_LIB} -lpython2.6
python_test_SOURCES = python-test.cpp
-python_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${PYTHON_LIB} -lpython2.6
+python_test_LDADD = -L${PYTHON_LIB} -lpython2.6
python_shell_SOURCES = python-shell.cpp
-python_shell_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${PYTHON_LIB} -lpython2.6
+python_shell_LDADD = -L${PYTHON_LIB} -lpython2.6
+
+client_test_SOURCES = client-test.cpp
+client_test_LDADD = -lxml2 -lcurl -lmozjs
+
+TESTS = python-test server-test
-TESTS = python-test
+endif
\ No newline at end of file
Copied: tuscany/sca-cpp/trunk/modules/python/client-test.cpp (from r897790, tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/client-test.cpp?p2=tuscany/sca-cpp/trunk/modules/python/client-test.cpp&p1=tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/client-test.cpp Mon Jan 11 08:30:15 2010
@@ -20,30 +20,27 @@
/* $Rev$ $Date$ */
/**
- * Test library.
+ * Test HTTP client functions.
*/
-#include "function.hpp"
-#include "debug.hpp"
+#include "stream.hpp"
+#include "string.hpp"
+#include "../server/client-test.hpp"
namespace tuscany {
-namespace test {
+namespace server {
- const int cppsquare(int x) {
- return x * x;
- }
+string testURI = "http://localhost:8090/python";
}
}
-extern "C" {
+int main() {
+ tuscany::cout << "Testing..." << tuscany::endl;
- const int csquare(const int x) {
- return tuscany::test::cppsquare(x);
- }
-
- const tuscany::lambda<int(const int)> csquarel() {
- return tuscany::lambda<int(const int)>(tuscany::test::cppsquare);
- }
+ tuscany::server::testServer();
+ tuscany::cout << "OK" << tuscany::endl;
+
+ return 0;
}
Copied: tuscany/sca-cpp/trunk/modules/python/client-test.py (from r897790, tuscany/sca-cpp/trunk/modules/server/client-test.py)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/client-test.py?p2=tuscany/sca-cpp/trunk/modules/python/client-test.py&p1=tuscany/sca-cpp/trunk/modules/server/client-test.py&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
(empty)
Copied: tuscany/sca-cpp/trunk/modules/python/domain-test.composite (from r897790, tuscany/sca-cpp/trunk/modules/server/domain-test.composite)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/domain-test.composite?p2=tuscany/sca-cpp/trunk/modules/python/domain-test.composite&p1=tuscany/sca-cpp/trunk/modules/server/domain-test.composite&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/domain-test.composite (original)
+++ tuscany/sca-cpp/trunk/modules/python/domain-test.composite Mon Jan 11 08:30:15 2010
@@ -22,20 +22,6 @@
targetNamespace="http://domain/test"
name="domain-test">
- <component name="scheme-test">
- <t:implementation.scheme uri="server-test.scm"/>
- <service name="test">
- <t:binding.http uri="test"/>
- </service>
- </component>
-
- <component name="cpp-test">
- <t:implementation.cpp uri=".libs/libimpl-test"/>
- <service name="cpp">
- <t:binding.http uri="cpp"/>
- </service>
- </component>
-
<component name="python-test">
<t:implementation.python uri="server-test.py"/>
<service name="test">
@@ -44,12 +30,11 @@
</component>
<component name="client-test">
- <!-- <t:implementation.scheme uri="client-test.scm"/> -->
<t:implementation.python uri="client-test.py"/>
<service name="client">
<t:binding.http uri="client"/>
</service>
- <reference name="ref" target="scheme-test">
+ <reference name="ref" target="python-test">
<t:binding.http/>
</reference>
</component>
Added: tuscany/sca-cpp/trunk/modules/python/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/htdocs/index.html?rev=897791&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/htdocs/index.html (added)
+++ tuscany/sca-cpp/trunk/modules/python/htdocs/index.html Mon Jan 11 08:30:15 2010
@@ -0,0 +1,21 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<html><body><h1>It works!</h1></body></html>
+
Copied: tuscany/sca-cpp/trunk/modules/python/mod-python.cpp (from r897790, tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/mod-python.cpp?p2=tuscany/sca-cpp/trunk/modules/python/mod-python.cpp&p1=tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/dynlib-test.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/mod-python.cpp Mon Jan 11 08:30:15 2010
@@ -20,30 +20,34 @@
/* $Rev$ $Date$ */
/**
- * Test library.
+ * HTTPD module used to eval Python component implementations.
*/
+#include "string.hpp"
#include "function.hpp"
-#include "debug.hpp"
+#include "list.hpp"
+#include "value.hpp"
+#include "monad.hpp"
+#include "../server/mod-cpp.hpp"
+#include "../server/mod-eval.hpp"
+#include "mod-python.hpp"
namespace tuscany {
-namespace test {
+namespace server {
+namespace modeval {
- const int cppsquare(int x) {
- return x * x;
- }
+/**
+ * Return a configured component implementation.
+ * For now only Scheme and C++ implementations are supported.
+ */
+const failable<lambda<value(const list<value>&)> > readImplementation(const string& itype, const string& path, const list<value>& px) {
+ if (contains(itype, ".python"))
+ return modpython::readImplementation(path, px);
+ if (contains(itype, ".cpp"))
+ return modcpp::readImplementation(path, px);
+ return mkfailure<lambda<value(const list<value>&)> >(string("Unsupported implementation type: ") + itype);
+}
}
}
-
-extern "C" {
-
- const int csquare(const int x) {
- return tuscany::test::cppsquare(x);
- }
-
- const tuscany::lambda<int(const int)> csquarel() {
- return tuscany::lambda<int(const int)>(tuscany::test::cppsquare);
- }
-
}
Copied: tuscany/sca-cpp/trunk/modules/python/mod-python.hpp (from r897790, tuscany/sca-cpp/trunk/modules/server/mod-python.hpp)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/mod-python.hpp?p2=tuscany/sca-cpp/trunk/modules/python/mod-python.hpp&p1=tuscany/sca-cpp/trunk/modules/server/mod-python.hpp&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/mod-python.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/mod-python.hpp Mon Jan 11 08:30:15 2010
@@ -34,7 +34,7 @@
#include "value.hpp"
#include "debug.hpp"
#include "monad.hpp"
-#include "../python/eval.hpp"
+#include "eval.hpp"
#include "../http/httpd.hpp"
namespace tuscany {
Copied: tuscany/sca-cpp/trunk/modules/python/python-conf (from r897790, tuscany/sca-cpp/trunk/modules/server/server-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/python-conf?p2=tuscany/sca-cpp/trunk/modules/python/python-conf&p1=tuscany/sca-cpp/trunk/modules/server/server-conf&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-conf (original)
+++ tuscany/sca-cpp/trunk/modules/python/python-conf Mon Jan 11 08:30:15 2010
@@ -25,7 +25,5 @@
mkdir -p $root/logs
mkdir -p $root/conf
cat >>$root/conf/httpd.conf <<EOF
-LoadModule mod_tuscany_eval $here/.libs/libmod_tuscany_eval.so
-LoadModule mod_tuscany_wiring $here/.libs/libmod_tuscany_wiring.so
+LoadModule mod_tuscany_eval $here/.libs/libmod_tuscany_python.so
EOF
-
Copied: tuscany/sca-cpp/trunk/modules/python/server-test (from r897790, tuscany/sca-cpp/trunk/modules/server/server-test)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/server-test?p2=tuscany/sca-cpp/trunk/modules/python/server-test&p1=tuscany/sca-cpp/trunk/modules/server/server-test&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-test (original)
+++ tuscany/sca-cpp/trunk/modules/python/server-test Mon Jan 11 08:30:15 2010
@@ -19,7 +19,8 @@
# Setup
../http/httpd-conf tmp 8090 htdocs
-./server-conf tmp
+../server/server-conf tmp
+./python-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
<Location />
Copied: tuscany/sca-cpp/trunk/modules/python/server-test.py (from r897790, tuscany/sca-cpp/trunk/modules/server/server-test.py)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/server-test.py?p2=tuscany/sca-cpp/trunk/modules/python/server-test.py&p1=tuscany/sca-cpp/trunk/modules/server/server-test.py&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
(empty)
Modified: tuscany/sca-cpp/trunk/modules/scdl/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/scdl/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/scdl/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/scdl/Makefile.am Mon Jan 11 08:30:15 2010
@@ -17,10 +17,7 @@
noinst_PROGRAMS = scdl-test
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE}
-
scdl_test_SOURCES = scdl-test.cpp
-scdl_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
+scdl_test_LDADD = -lxml2
TESTS = scdl-test
-
Modified: tuscany/sca-cpp/trunk/modules/scheme/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/scheme/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/scheme/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/scheme/Makefile.am Mon Jan 11 08:30:15 2010
@@ -20,13 +20,8 @@
datadir=$(prefix)/modules/eval
nobase_data_DATA = *.xsd
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE}
-
eval_test_SOURCES = eval-test.cpp
-eval_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
eval_shell_SOURCES = eval-shell.cpp
-eval_shell_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
TESTS = eval-test
-
Modified: tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp Mon Jan 11 08:30:15 2010
@@ -40,12 +40,12 @@
const value quoteSymbol("'");
const value lambdaSymbol("lambda");
-#ifdef _REENTRANT
+#ifdef WANT_THREADS
__thread
#endif
ostream* displayOutStream = NULL;
-#ifdef _REENTRANT
+#ifdef WANT_THREADS
__thread
#endif
ostream* logOutStream = NULL;
Modified: tuscany/sca-cpp/trunk/modules/server/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/Makefile.am?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/server/Makefile.am Mon Jan 11 08:30:15 2010
@@ -20,21 +20,20 @@
libdir=$(prefix)/lib
lib_LTLIBRARIES = libmod_tuscany_eval.la libmod_tuscany_wiring.la
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${HTTPD_INCLUDE} -I${APR_INCLUDE} -I${JS_INCLUDE} -I${CURL_INCLUDE}
+INCLUDES = -I${HTTPD_INCLUDE}
libmod_tuscany_eval_la_SOURCES = mod-eval.cpp
-libmod_tuscany_eval_la_LIBADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${JS_LIB} -lmozjs -L${PYTHON_LIB} -lpython2.6
+libmod_tuscany_eval_la_LIBADD = -lxml2 -lcurl -lmozjs
libmod_tuscany_wiring_la_SOURCES = mod-wiring.cpp
-libmod_tuscany_wiring_la_LIBADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${JS_LIB} -lmozjs
+libmod_tuscany_wiring_la_LIBADD = -lxml2 -lcurl -lmozjs
testdir=$(prefix)/test
test_LTLIBRARIES = libimpl-test.la
libimpl_test_la_SOURCES = impl-test.cpp
-libimpl_test_la_LIBADD = -L${APR_LIB} -lapr-1 -laprutil-1
client_test_SOURCES = client-test.cpp
-client_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${JS_LIB} -lmozjs
+client_test_LDADD = -lxml2 -lcurl -lmozjs
TESTS = httpd-test server-test wiring-test
Modified: tuscany/sca-cpp/trunk/modules/server/client-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/client-test.cpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/client-test.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/client-test.cpp Mon Jan 11 08:30:15 2010
@@ -23,364 +23,14 @@
* Test HTTP client functions.
*/
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <assert.h>
#include "stream.hpp"
#include "string.hpp"
-#include "parallel.hpp"
-#include "perf.hpp"
-#include "../http/curl.hpp"
+#include "client-test.hpp"
namespace tuscany {
namespace server {
-ostream* curlWriter(const string& s, ostream* os) {
- (*os) << s;
- return os;
-}
-
-const bool testGet() {
- gc_scoped_pool pool;
- http::CURLSession ch;
- {
- ostringstream os;
- const failable<list<ostream*> > r = http::get<ostream*>(curlWriter, &os, "http://localhost:8090", ch);
- assert(hasContent(r));
- assert(contains(str(os), "HTTP/1.1 200 OK"));
- assert(contains(str(os), "It works"));
- }
- {
- const failable<value> r = http::getcontent("http://localhost:8090", ch);
- assert(hasContent(r));
- assert(contains(car(reverse(list<value>(content(r)))), "It works"));
- }
- return true;
-}
-
-struct getLoop {
- http::CURLSession ch;
- getLoop(http::CURLSession& ch) : ch(ch) {
- }
- const bool operator()() const {
- const failable<value> r = http::getcontent("http://localhost:8090", ch);
- assert(hasContent(r));
- assert(contains(car(reverse(list<value>(content(r)))), "It works"));
- return true;
- }
-};
-
-const bool testGetPerf() {
- gc_scoped_pool pool;
- http::CURLSession ch;
- const lambda<bool()> gl = getLoop(ch);
- cout << "Static GET test " << time(gl, 5, 200) << " ms" << endl;
- return true;
-}
-
-const bool testEval(const string& uri) {
- gc_scoped_pool pool;
- http::CURLSession ch;
- const value val = content(http::evalExpr(mklist<value>(string("echo"), string("Hello")), uri, ch));
- assert(val == string("Hello"));
- return true;
-}
-
-const bool testEval() {
- testEval("http://localhost:8090/test");
- testEval("http://localhost:8090/cpp");
- testEval("http://localhost:8090/python");
- return true;
-}
-
-struct evalLoop {
- const string uri;
- http::CURLSession ch;
- evalLoop(const string& uri, http::CURLSession& ch) : uri(uri), ch(ch) {
- }
- const bool operator()() const {
- const value val = content(http::evalExpr(mklist<value>(string("echo"), string("Hello")), uri, ch));
- assert(val == string("Hello"));
- return true;
- }
-};
-
-const value blob(string(3000, 'A'));
-const list<value> blobs = mklist(blob, blob, blob, blob, blob);
-
-struct blobEvalLoop {
- const string uri;
- http::CURLSession ch;
- blobEvalLoop(const string& uri, http::CURLSession& ch) : uri(uri), ch(ch) {
- }
- const bool operator()() const {
- const value val = content(http::evalExpr(mklist<value>(string("echo"), blobs), uri, ch));
- assert(val == blobs);
- return true;
- }
-};
-
-const bool testEvalPerf(const string& type, const string& uri) {
- gc_scoped_pool pool;
- http::CURLSession ch;
- const lambda<bool()> el = evalLoop(uri, ch);
- cout << type << " JSON-RPC eval echo test " << time(el, 5, 200) << " ms" << endl;
- const lambda<bool()> bel = blobEvalLoop(uri, ch);
- cout << type << " JSON-RPC eval blob test " << time(bel, 5, 200) << " ms" << endl;
- return true;
-}
-
-const bool testEvalPerf() {
- testEvalPerf("Scheme", "http://localhost:8090/test");
- testEvalPerf("C++", "http://localhost:8090/cpp");
- testEvalPerf("Python", "http://localhost:8090/python");
- return true;
-}
-
-bool testPost(const string& uri) {
- gc_scoped_pool pool;
- const list<value> i = list<value>()
- + (list<value>() + "name" + string("Apple"))
- + (list<value>() + "price" + string("$2.99"));
- const list<value> a = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
- http::CURLSession ch;
- const failable<value> id = http::post(a, uri, ch);
- assert(hasContent(id));
- return true;
-}
-
-const bool testPost() {
- testPost("http://localhost:8090/test");
- testPost("http://localhost:8090/cpp");
- testPost("http://localhost:8090/python");
- return true;
-}
-
-struct postLoop {
- const string uri;
- const value val;
- http::CURLSession ch;
- postLoop(const string& uri, const value& val, http::CURLSession& ch) : uri(uri), val(val), ch(ch) {
- }
- const bool operator()() const {
- const failable<value> id = http::post(val, uri, ch);
- assert(hasContent(id));
- return true;
- }
-};
-
-struct postBlobLoop {
- const string uri;
- const value val;
- http::CURLSession ch;
- postBlobLoop(const string& uri, const value& val, http::CURLSession& ch) : uri(uri), val(val), ch(ch) {
- }
- const bool operator()() const {
- gc_scoped_pool pool;
- const failable<value> id = http::post(val, uri, ch);
- assert(hasContent(id));
- return true;
- }
-};
-
-const bool testPostPerf(const string& type, const string& uri) {
- gc_scoped_pool pool;
- http::CURLSession ch;
- {
- const list<value> i = list<value>()
- + (list<value>() + "name" + string("Apple"))
- + (list<value>() + "price" + string("$2.99"));
- const list<value> val = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
- const lambda<bool()> pl = postLoop(uri, val, ch);
- cout << type << " ATOMPub POST small test " << time(pl, 5, 200) << " ms" << endl;
- }
- {
- const list<value> i = list<value>()
- + (list<value>() + "name" + string("Apple"))
- + (list<value>() + "blob1" + blob)
- + (list<value>() + "blob2" + blob)
- + (list<value>() + "blob3" + blob)
- + (list<value>() + "blob4" + blob)
- + (list<value>() + "blob5" + blob)
- + (list<value>() + "price" + string("$2.99"));
- const list<value> val = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
- const lambda<bool()> pl = postBlobLoop(uri, val, ch);
- cout << type << " ATOMPub POST blob test " << time(pl, 5, 200) << " ms" << endl;
- }
- return true;
-}
-
-const bool testPostPerf() {
- testPostPerf("Scheme", "http://localhost:8090/test");
- testPostPerf("C++", "http://localhost:8090/cpp");
- testPostPerf("Python", "http://localhost:8090/python");
- return true;
-}
-
-#ifdef WANT_THREADS
-
-const bool postThread(const string& uri, const int count, const value& val) {
- gc_scoped_pool pool;
- http::CURLSession ch;
- const lambda<bool()> pl = postLoop(uri, val, ch);
- time(pl, 0, count);
- return true;
-}
-
-const list<future<bool> > startPost(worker& w, const int threads, const lambda<bool()>& l) {
- if (threads == 0)
- return list<future<bool> >();
- return cons(submit(w, l), startPost(w, threads - 1, l));
-}
-
-const bool checkPost(const list<future<bool> >& r) {
- if (isNil(r))
- return true;
- assert(car(r) == true);
- return checkPost(cdr(r));
-}
-
-struct postThreadLoop {
- const lambda<bool()> l;
- const int threads;
- const gc_ptr<worker> w;
- postThreadLoop(const lambda<bool()>& l, const int threads) : l(l), threads(threads), w(new (gc_new<worker>()) worker(threads)) {
- }
- const bool operator()() const {
- list<future<bool> > r = startPost(*w, threads, l);
- checkPost(r);
- return true;
- }
-};
-
-const bool testPostThreadPerf(const string& type, const string& uri) {
- gc_scoped_pool pool;
- const int count = 50;
- const int threads = 10;
-
- const list<value> i = list<value>()
- + (list<value>() + "name" + string("Apple"))
- + (list<value>() + "price" + string("$2.99"));
- const value val = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
-
- const lambda<bool()> pl= curry(lambda<bool(const string, const int, const value)>(postThread), uri, count, val);
- const lambda<bool()> ptl = postThreadLoop(pl, threads);
- double t = time(ptl, 0, 1) / (threads * count);
- cout << type << " ATOMPub POST thread test " << t << " ms" << endl;
-
- return true;
-}
-
-const bool testPostThreadPerf() {
- testPostThreadPerf("Scheme", "http://localhost:8090/test");
- testPostThreadPerf("C++", "http://localhost:8090/cpp");
- testPostThreadPerf("Python", "http://localhost:8090/python");
- return true;
-}
-
-#else
-
-const bool postProc(const string& uri, const int count, const value& val) {
- gc_scoped_pool pool;
- http::CURLSession ch;
- const lambda<bool()> pl = postLoop(uri, val, ch);
- time(pl, 0, count);
- return true;
-}
-
-const list<pid_t> startPost(const int procs, const lambda<bool()>& l) {
- if (procs == 0)
- return list<pid_t>();
- pid_t pid = fork();
- if (pid == 0) {
- assert(l() == true);
- exit(0);
- }
- return cons(pid, startPost(procs - 1, l));
-}
-
-const bool checkPost(const list<pid_t>& r) {
- if (isNil(r))
- return true;
- int status;
- waitpid(car(r), &status, 0);
- assert(status == 0);
- return checkPost(cdr(r));
-}
-
-struct postForkLoop {
- const lambda<bool()> l;
- const int procs;
- postForkLoop(const lambda<bool()>& l, const int procs) : l(l), procs(procs) {
- }
- const bool operator()() const {
- list<pid_t> r = startPost(procs, l);
- checkPost(r);
- return true;
- }
-};
-
-const bool testPostForkPerf(const string& type, const string& uri) {
- gc_scoped_pool pool;
- const int count = 50;
- const int procs = 10;
-
- const list<value> i = list<value>()
- + (list<value>() + "name" + string("Apple"))
- + (list<value>() + "price" + string("$2.99"));
- const value val = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
-
- const lambda<bool()> pl= curry(lambda<bool(const string, const int, const value)>(postProc), uri, count, val);
- const lambda<bool()> ptl = postForkLoop(pl, procs);
- double t = time(ptl, 0, 1) / (procs * count);
- cout << type << "ATOMPub POST fork test " << t << " ms" << endl;
-
- return true;
-}
-
-const bool testPostForkPerf() {
- testPostForkPerf("Scheme", "http://localhost:8090/test");
- testPostForkPerf("C++", "http://localhost:8090/cpp");
- testPostForkPerf("Python", "http://localhost:8090/python");
- return true;
-}
-
-#endif
-
-const bool testPut(const string& uri) {
- gc_scoped_pool pool;
- const list<value> i = list<value>()
- + (list<value>() + "name" + string("Apple"))
- + (list<value>() + "price" + string("$2.99"));
- const list<value> a = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
- http::CURLSession ch;
- value rc = content(http::put(a, uri, ch));
- assert(rc == value(true));
- return true;
-}
-
-const bool testPut() {
- testPut("http://localhost:8090/test/111");
- testPut("http://localhost:8090/cpp/111");
- testPut("http://localhost:8090/python/111");
- return true;
-}
-
-const bool testDel(const string& uri) {
- gc_scoped_pool pool;
- http::CURLSession ch;
- value rc = content(http::del(uri, ch));
- assert(rc == value(true));
- return true;
-}
-
-const bool testDel() {
- testDel("http://localhost:8090/test/123456789");
- testDel("http://localhost:8090/cpp/123456789");
- testDel("http://localhost:8090/python/123456789");
- return true;
-}
+string testURI = "http://localhost:8090/test";
}
}
@@ -388,19 +38,7 @@
int main() {
tuscany::cout << "Testing..." << tuscany::endl;
- tuscany::server::testGet();
- tuscany::server::testPost();
- tuscany::server::testPut();
- tuscany::server::testDel();
- tuscany::server::testEval();
- tuscany::server::testGetPerf();
- tuscany::server::testPostPerf();
-#ifdef WANT_THREADS
- tuscany::server::testPostThreadPerf();
-#else
- tuscany::server::testPostForkPerf();
-#endif
- tuscany::server::testEvalPerf();
+ tuscany::server::testServer();
tuscany::cout << "OK" << tuscany::endl;
Copied: tuscany/sca-cpp/trunk/modules/server/client-test.hpp (from r897790, tuscany/sca-cpp/trunk/modules/server/client-test.cpp)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/client-test.hpp?p2=tuscany/sca-cpp/trunk/modules/server/client-test.hpp&p1=tuscany/sca-cpp/trunk/modules/server/client-test.cpp&r1=897790&r2=897791&rev=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/client-test.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/client-test.hpp Mon Jan 11 08:30:15 2010
@@ -36,6 +36,8 @@
namespace tuscany {
namespace server {
+extern string testURI;
+
ostream* curlWriter(const string& s, ostream* os) {
(*os) << s;
return os;
@@ -79,21 +81,14 @@
return true;
}
-const bool testEval(const string& uri) {
+const bool testEval() {
gc_scoped_pool pool;
http::CURLSession ch;
- const value val = content(http::evalExpr(mklist<value>(string("echo"), string("Hello")), uri, ch));
+ const value val = content(http::evalExpr(mklist<value>(string("echo"), string("Hello")), testURI, ch));
assert(val == string("Hello"));
return true;
}
-const bool testEval() {
- testEval("http://localhost:8090/test");
- testEval("http://localhost:8090/cpp");
- testEval("http://localhost:8090/python");
- return true;
-}
-
struct evalLoop {
const string uri;
http::CURLSession ch;
@@ -121,42 +116,28 @@
}
};
-const bool testEvalPerf(const string& type, const string& uri) {
+const bool testEvalPerf() {
gc_scoped_pool pool;
http::CURLSession ch;
- const lambda<bool()> el = evalLoop(uri, ch);
- cout << type << " JSON-RPC eval echo test " << time(el, 5, 200) << " ms" << endl;
- const lambda<bool()> bel = blobEvalLoop(uri, ch);
- cout << type << " JSON-RPC eval blob test " << time(bel, 5, 200) << " ms" << endl;
- return true;
-}
-
-const bool testEvalPerf() {
- testEvalPerf("Scheme", "http://localhost:8090/test");
- testEvalPerf("C++", "http://localhost:8090/cpp");
- testEvalPerf("Python", "http://localhost:8090/python");
+ const lambda<bool()> el = evalLoop(testURI, ch);
+ cout << "JSON-RPC eval echo test " << time(el, 5, 200) << " ms" << endl;
+ const lambda<bool()> bel = blobEvalLoop(testURI, ch);
+ cout << "JSON-RPC eval blob test " << time(bel, 5, 200) << " ms" << endl;
return true;
}
-bool testPost(const string& uri) {
+bool testPost() {
gc_scoped_pool pool;
const list<value> i = list<value>()
+ (list<value>() + "name" + string("Apple"))
+ (list<value>() + "price" + string("$2.99"));
const list<value> a = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
http::CURLSession ch;
- const failable<value> id = http::post(a, uri, ch);
+ const failable<value> id = http::post(a, testURI, ch);
assert(hasContent(id));
return true;
}
-const bool testPost() {
- testPost("http://localhost:8090/test");
- testPost("http://localhost:8090/cpp");
- testPost("http://localhost:8090/python");
- return true;
-}
-
struct postLoop {
const string uri;
const value val;
@@ -184,7 +165,7 @@
}
};
-const bool testPostPerf(const string& type, const string& uri) {
+const bool testPostPerf() {
gc_scoped_pool pool;
http::CURLSession ch;
{
@@ -192,8 +173,8 @@
+ (list<value>() + "name" + string("Apple"))
+ (list<value>() + "price" + string("$2.99"));
const list<value> val = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
- const lambda<bool()> pl = postLoop(uri, val, ch);
- cout << type << " ATOMPub POST small test " << time(pl, 5, 200) << " ms" << endl;
+ const lambda<bool()> pl = postLoop(testURI, val, ch);
+ cout << "ATOMPub POST small test " << time(pl, 5, 200) << " ms" << endl;
}
{
const list<value> i = list<value>()
@@ -205,19 +186,12 @@
+ (list<value>() + "blob5" + blob)
+ (list<value>() + "price" + string("$2.99"));
const list<value> val = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
- const lambda<bool()> pl = postBlobLoop(uri, val, ch);
- cout << type << " ATOMPub POST blob test " << time(pl, 5, 200) << " ms" << endl;
+ const lambda<bool()> pl = postBlobLoop(testURI, val, ch);
+ cout << "ATOMPub POST blob test " << time(pl, 5, 200) << " ms" << endl;
}
return true;
}
-const bool testPostPerf() {
- testPostPerf("Scheme", "http://localhost:8090/test");
- testPostPerf("C++", "http://localhost:8090/cpp");
- testPostPerf("Python", "http://localhost:8090/python");
- return true;
-}
-
#ifdef WANT_THREADS
const bool postThread(const string& uri, const int count, const value& val) {
@@ -254,7 +228,7 @@
}
};
-const bool testPostThreadPerf(const string& type, const string& uri) {
+const bool testPostThreadPerf() {
gc_scoped_pool pool;
const int count = 50;
const int threads = 10;
@@ -264,18 +238,11 @@
+ (list<value>() + "price" + string("$2.99"));
const value val = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
- const lambda<bool()> pl= curry(lambda<bool(const string, const int, const value)>(postThread), uri, count, val);
+ const lambda<bool()> pl= curry(lambda<bool(const string, const int, const value)>(postThread), testURI, count, val);
const lambda<bool()> ptl = postThreadLoop(pl, threads);
double t = time(ptl, 0, 1) / (threads * count);
- cout << type << " ATOMPub POST thread test " << t << " ms" << endl;
-
- return true;
-}
+ cout << "ATOMPub POST thread test " << t << " ms" << endl;
-const bool testPostThreadPerf() {
- testPostThreadPerf("Scheme", "http://localhost:8090/test");
- testPostThreadPerf("C++", "http://localhost:8090/cpp");
- testPostThreadPerf("Python", "http://localhost:8090/python");
return true;
}
@@ -321,7 +288,7 @@
}
};
-const bool testPostForkPerf(const string& type, const string& uri) {
+const bool testPostForkPerf() {
gc_scoped_pool pool;
const int count = 50;
const int procs = 10;
@@ -331,63 +298,37 @@
+ (list<value>() + "price" + string("$2.99"));
const value val = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
- const lambda<bool()> pl= curry(lambda<bool(const string, const int, const value)>(postProc), uri, count, val);
+ const lambda<bool()> pl= curry(lambda<bool(const string, const int, const value)>(postProc), testURI, count, val);
const lambda<bool()> ptl = postForkLoop(pl, procs);
double t = time(ptl, 0, 1) / (procs * count);
- cout << type << "ATOMPub POST fork test " << t << " ms" << endl;
-
- return true;
-}
+ cout << "ATOMPub POST fork test " << t << " ms" << endl;
-const bool testPostForkPerf() {
- testPostForkPerf("Scheme", "http://localhost:8090/test");
- testPostForkPerf("C++", "http://localhost:8090/cpp");
- testPostForkPerf("Python", "http://localhost:8090/python");
return true;
}
#endif
-const bool testPut(const string& uri) {
+const bool testPut() {
gc_scoped_pool pool;
const list<value> i = list<value>()
+ (list<value>() + "name" + string("Apple"))
+ (list<value>() + "price" + string("$2.99"));
const list<value> a = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), i);
http::CURLSession ch;
- value rc = content(http::put(a, uri, ch));
+ value rc = content(http::put(a, testURI, ch));
assert(rc == value(true));
return true;
}
-const bool testPut() {
- testPut("http://localhost:8090/test/111");
- testPut("http://localhost:8090/cpp/111");
- testPut("http://localhost:8090/python/111");
- return true;
-}
-
-const bool testDel(const string& uri) {
+const bool testDel() {
gc_scoped_pool pool;
http::CURLSession ch;
- value rc = content(http::del(uri, ch));
+ value rc = content(http::del(testURI, ch));
assert(rc == value(true));
return true;
}
-const bool testDel() {
- testDel("http://localhost:8090/test/123456789");
- testDel("http://localhost:8090/cpp/123456789");
- testDel("http://localhost:8090/python/123456789");
- return true;
-}
-
-}
-}
-
-int main() {
- tuscany::cout << "Testing..." << tuscany::endl;
-
+const bool testServer() {
tuscany::server::testGet();
tuscany::server::testPost();
tuscany::server::testPut();
@@ -401,8 +342,8 @@
tuscany::server::testPostForkPerf();
#endif
tuscany::server::testEvalPerf();
+ return true;
+}
- tuscany::cout << "OK" << tuscany::endl;
-
- return 0;
+}
}
Modified: tuscany/sca-cpp/trunk/modules/server/domain-test.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/domain-test.composite?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/domain-test.composite (original)
+++ tuscany/sca-cpp/trunk/modules/server/domain-test.composite Mon Jan 11 08:30:15 2010
@@ -36,16 +36,8 @@
</service>
</component>
- <component name="python-test">
- <t:implementation.python uri="server-test.py"/>
- <service name="test">
- <t:binding.http uri="python"/>
- </service>
- </component>
-
<component name="client-test">
- <!-- <t:implementation.scheme uri="client-test.scm"/> -->
- <t:implementation.python uri="client-test.py"/>
+ <t:implementation.scheme uri="client-test.scm"/>
<service name="client">
<t:binding.http uri="client"/>
</service>
Modified: tuscany/sca-cpp/trunk/modules/server/httpd-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/httpd-test?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/httpd-test (original)
+++ tuscany/sca-cpp/trunk/modules/server/httpd-test Mon Jan 11 08:30:15 2010
@@ -22,6 +22,7 @@
# Setup
../http/httpd-conf tmp 8090 htdocs
./server-conf tmp
+./scheme-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
<Location />
Modified: tuscany/sca-cpp/trunk/modules/server/impl-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/impl-test.cpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/impl-test.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/impl-test.cpp Mon Jan 11 08:30:15 2010
@@ -29,7 +29,6 @@
#include "list.hpp"
#include "value.hpp"
#include "monad.hpp"
-#include "debug.hpp"
namespace tuscany {
namespace server {
Modified: tuscany/sca-cpp/trunk/modules/server/mod-cpp.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/mod-cpp.hpp?rev=897791&r1=897790&r2=897791&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/mod-cpp.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/mod-cpp.hpp Mon Jan 11 08:30:15 2010
@@ -33,7 +33,6 @@
#include "function.hpp"
#include "list.hpp"
#include "value.hpp"
-#include "debug.hpp"
#include "monad.hpp"
#include "dynlib.hpp"
#include "../scheme/driver.hpp"