summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-11-14 09:27:28 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-11-14 09:27:28 +0000
commit2c7009b5200ff5b7462b56239c909daef8ed7910 (patch)
tree40b116d31a3c7f56540d12ed05a5b80f3e7c4ef3
parentefccdd821b68280ee3b73c8ef5cda121bc27f620 (diff)
Port to Ubuntu server 10.10 64-bit. C++ code fixes required to compile and run on 64-bit. Update INSTALL doc and build scripts. Remove a few obsolete scripts.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1034963 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-cpp/trunk/INSTALL210
-rw-r--r--sca-cpp/trunk/README2
-rw-r--r--sca-cpp/trunk/components/chat/xmpp.hpp24
-rw-r--r--sca-cpp/trunk/components/log/Makefile.am8
-rw-r--r--sca-cpp/trunk/components/log/scribe.hpp9
-rw-r--r--sca-cpp/trunk/components/nosqldb/tinycdb.hpp6
-rw-r--r--sca-cpp/trunk/configure.ac49
-rw-r--r--sca-cpp/trunk/kernel/fstream.hpp2
-rw-r--r--sca-cpp/trunk/kernel/function.hpp4
-rw-r--r--sca-cpp/trunk/kernel/gc.hpp18
-rw-r--r--sca-cpp/trunk/kernel/hash.hpp14
-rw-r--r--sca-cpp/trunk/kernel/list.hpp6
-rw-r--r--sca-cpp/trunk/kernel/parallel.hpp22
-rw-r--r--sca-cpp/trunk/kernel/sstream.hpp23
-rw-r--r--sca-cpp/trunk/kernel/stream.hpp7
-rw-r--r--sca-cpp/trunk/kernel/string-test.cpp12
-rw-r--r--sca-cpp/trunk/kernel/string.hpp34
-rw-r--r--sca-cpp/trunk/kernel/tree.hpp6
-rw-r--r--sca-cpp/trunk/kernel/xml.hpp2
-rw-r--r--sca-cpp/trunk/kernel/xsd-test.cpp2
-rw-r--r--sca-cpp/trunk/modules/http/curl-connect.cpp10
-rw-r--r--sca-cpp/trunk/modules/http/http.hpp18
-rw-r--r--sca-cpp/trunk/modules/http/httpd.hpp2
-rw-r--r--sca-cpp/trunk/modules/http/mod-ssltunnel.cpp4
-rw-r--r--sca-cpp/trunk/modules/http/openauth.hpp2
-rw-r--r--sca-cpp/trunk/modules/java/eval.hpp4
-rw-r--r--sca-cpp/trunk/modules/json/json-test.cpp2
-rw-r--r--sca-cpp/trunk/modules/json/json.hpp2
-rw-r--r--sca-cpp/trunk/modules/python/eval.hpp2
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-bin-all-image45
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-bin-image90
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-dev-all-image2
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-dev-image41
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-gcc-4.552
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-install109
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-install-all53
-rwxr-xr-xsca-cpp/trunk/ubuntu/uec2-bin-image23
-rwxr-xr-xsca-cpp/trunk/ubuntu/uec2-dev-image23
38 files changed, 229 insertions, 715 deletions
diff --git a/sca-cpp/trunk/INSTALL b/sca-cpp/trunk/INSTALL
index c8d1c23270..8fea45868b 100644
--- a/sca-cpp/trunk/INSTALL
+++ b/sca-cpp/trunk/INSTALL
@@ -1,16 +1,12 @@
Apache Tuscany SCA Runtime
==========================
-Automated installation on Ubuntu 10.04
-======================================
+Automated installation on Ubuntu 10.10 64-bit
+=============================================
Tuscany provides two automated install scripts for Ubuntu. You can start with
-a fresh Ubuntu Server 10.04 system and these scripts will take care of all the
-download, build and installation steps for you.
-
-ubuntu/ubuntu-install:
-Minimum build and installation using dependencies (Apache HTTPD server,
-Memcached etc) from your Ubuntu 10.04 system.
+a fresh Ubuntu Server 10.10 64-bit system and these scripts will take care of
+all the download, build and installation steps for you.
ubuntu/ubuntu-install-all:
Complete build and installation with most dependencies built from source.
@@ -21,14 +17,14 @@ dependencies are downloaded and built in the current directory.
To run the automated installation:
mkdir tuscany
cd tuscany
-wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
-chmod +x ./ubuntu-install
-./ubuntu-install
+wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all
+chmod +x ./ubuntu-install-all
+./ubuntu-install-all
The installation script will display each command as it's executed.
That's all you need to do to build and install the Tuscany SCA runtime on
-Ubuntu 10.04.
+Ubuntu 10.10 64-bit.
For manual build and install steps on other systems or if you need to customize
your installation, read on...
@@ -40,30 +36,23 @@ Building
The Tuscany SCA Linux build uses the GNU Autotools tool chain.
First install the following development tools:
-autoconf-2.64
+autoconf-2.67
automake-1.11
libtool-2.2.6
-doxygen-1.6.1
-gcc-g++-4.5
-
-The GCC 4.5 compiler may not yet be included in your Linux distribution.
-GCC 4.5 Ubuntu / Debian packages can be downloaded from:
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/
-
-To download and setup GCC 4.5 on Ubuntu 10.04, run this script:
-http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-gcc-4.5
-
+doxygen-1.7.1
+gcc-g++-4.4.5
Then install the following development dependencies:
Apache HTTP server and APR:
httpd-2.3.8 (http://httpd.apache.org/)
with included libapr and libaprutil
-built with OpenSSL libssl-0.9.8g
+built with OpenSSL libssl-0.9.8, libpcre3-8.02,
+and expat 2.0.1
Memcached:
memcached-1.4.5 (http://memcached.org/)
-built with libevent-1.4.11
+built with libevent-1.4.13
XML:
libxml2-2.7.7 (http://xmlsoft.org/)
@@ -86,12 +75,12 @@ Apache Axis2/C 1.6.0 (http://ws.apache.org/axis2/c/)
Queueing:
Apache Qpid/C++ 0.6 (http://qpid.apache.org/)
-built with libuuid-2.16, libboost-1.38.1, libboost-program-options-1.38.1 and
-libboost-filesystem-1.38.1
+built with libuuid-2.17.2, libboost-1.42.0, libboost-program-options-1.42.0 and
+libboost-filesystem-1.42.0
Python:
-Python 2.6.4 (http://www.python.org/)
-Google AppEngine 1.3.7 (http://code.google.com/appengine/)
+Python 2.6.6 (http://www.python.org/)
+Google AppEngine 1.3.8 (http://code.google.com/appengine/)
Java:
a Java 5+ JDK (http://openjdk.java.net/, http://harmony.apache.org/)
@@ -111,7 +100,6 @@ Apache Vysper 0.5 (http://mina.apache.org/)
Libstrophe (http://code.stanziq.com/strophe/)
build it from source at git://github.com/jsdelfino/libstrophe.git
-requires Expat 2.0.1 (http://sourceforge.net/projects/expat/)
SQL Database:
postgresql-9.0.1 (http://www.postgresql.org/)
@@ -174,7 +162,7 @@ in the configure help:
./configure --help
-Here's an example configuration, tested on Ubuntu 10.04, with the system
+Here's an example configuration tested on Ubuntu 10.10 64-bit, with the system
dependencies installed in the standard system directories and some of the
dependencies installed under $HOME:
@@ -226,163 +214,3 @@ Installing
To install the Tuscany SCA binaries, do this:
make install
-
-Building dependencies from source
-=================================
-
-Here are example build and install steps for some of the dependencies.
-
-Apache HTTPD, including APR, using the HTTP prefork MPM (recommended):
-wget http://archive.apache.org/dist/httpd/httpd-2.3.8.tar.gz
-tar xzf httpd-2.3.8.tar.gz
-cd httpd-2.3.8
-./configure --enable-ssl --enable-proxy --enable-usertrack \
---with-included-apr --with-mpm=prefork --prefix=$HOME/httpd-2.3.8-bin
-make
-make install
-export PATH=$HOME/httpd-2.3.8-bin/bin:$PATH
-
-Memcached:
-wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
-tar xzf memcached-1.4.5.tar.gz
-cd memcached-1.4.5
-./configure --prefix=$HOME/memcached-1.4.5-bin
-make
-make install
-
-TinyCDB:
-wget http://www.corpit.ru/mjt/tinycdb/tinycdb_0.77.tar.gz
-tar xzf tinycdb_0.77.tar.gz
-cd tinycdb-0.77
-make
-make prefix=$HOME/tinycdb-0.77-bin install
-
-CURL:
-wget http://curl.haxx.se/download/curl-7.19.5.tar.gz
-tar xzf curl-7.19.5.tar.gz
-cd curl-7.19.5
-./configure --prefix=$HOME/curl-7.19.5-bin
-make
-make install
-
-Libxml2:
-wget ftp://xmlsoft.org/libxml2/libxml2-sources-2.7.7.tar.gz
-tar xzf libxml2-sources-2.7.7.tar.gz
-cd libxml2-2.7.7
-./configure --prefix=$HOME/libxml2-2.7.7-bin
-make
-make install
-
-TraceMonkey:
-wget http://hg.mozilla.org/tracemonkey/archive/e4364736e170.tar.gz
-tar xzf tracemonkey-e4364736e170.tar.gz
-cd tracemonkey-e4364736e170/js/src
-autoconf2.13
-./configure --prefix=$HOME/tracemonkey-bin
-make
-make install
-
-Apache Axis2/C:
-wget http://www.apache.org/dist/ws/axis2-c/1_6_0/axis2c-src-1.6.0.tar.gz
-tar xzf axis2c-src-1.6.0.tar.gz
-cd axis2c-src-1.6.0
-./configure --enable-libxml2 --enable-openssl \
---with-apache2=$HOME/httpd-2.3.8-bin/include --prefix=$HOME/axis2c-1.6.0-bin
-make
-make install
-export AXIS2C_HOME=$HOME/axis2c-1.6.0-bin
-
-Apache Qpid/C++:
-wget http://www.apache.org/dist/qpid/0.6/qpid-cpp-0.6.tar.gz
-tar xzf qpid-cpp-0.6.tar.gz
-cd qpidc-0.6
-./configure --prefix=$HOME/qpidc-0.6-bin
-make
-make install
-
-Libexpat:
-wget http://sourceforge.net/projects/expat/files/expat/2.0.1/expat-2.0.1.tar.gz/download
-tar xzf expat-2.0.1.tar.gz
-cd expat-2.0.1
-./configure --prefix=$HOME/expat-2.0.1-bin
-make
-make install
-
-Libstrophe:
-git clone git://github.com/jsdelfino/libstrophe.git
-cd libstrophe
-./bootstrap.sh
-./configure --prefix=$HOME/libstrophe-bin --with-expat=$HOME/expat-2.0.1-bin
-make
-make install
-
-HTML Tidy:
-cvs -z3 -d:pserver:anonymous@tidy.cvs.sourceforge.net:/cvsroot/tidy co -P tidy
-cd tidy
-build/gnuauto/setup.sh
-./configure --prefix=$HOME/htmltidy-bin
-make
-make install
-
-Libopkele:
-git clone git://github.com/jsdelfino/libopkele.git
-cd libopkele
-./autogen.bash
-./configure --prefix=$HOME/libopkele-bin --with-curl=$HOME/curl-7.19.5-bin \
---with-expat=$HOME/expat-2.0.1-bin --with-htmltidy=$HOME/htmltidy-bin
-
-Mod_auth_openid:
-git clone git://github.com/jsdelfino/mod_auth_openid.git
-cd mod_auth_openid
-./autogen.sh
-./configure --prefix=$HOME/mod-auth-openid-bin \
---with-apr=$HOME/httpd-2.3.8-bin --with-httpd=$HOME/httpd-2.3.8-bin \
---with-curl=$HOME/curl-7.19.5-bin --with-libopkele=$HOME/libopkele-bin
-make
-make install
-
-PostgreSQL:
-wget ftp://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v9.0.1/postgresql-9.0.1.tar.gz
-tar xzf postgresql-9.0.1.tar.gz
-cd postgresql-9.0.1
-./configure --prefix=$HOME/postgresql-9.0.1-bin
-make
-make install
-
-Apache Thrift (including Facebook fb303):
-wget http://www.apache.org/dist/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz
-tar xzf thrift-0.2.0-incubating.tar.gz
-cd thrift-0.2.0
-./bootstrap.sh
-./configure --prefix=$HOME/thrift-0.2.0-bin --with-java=no --with-erlang=no \
---with-perl=no --with-ruby=no --with-csharp=no --disable-static
-make
-make install
-cd contrib/fb303
-./bootstrap.sh
-./configure --prefix=$HOME/thrift-0.2.0-bin/contrib/fb303 \
-PY_PREFIX=$HOME/thrift-0.2.0-bin/contrib/fb303 \
---with-thriftpath=$HOME/thrift-0.2.0-bin
-make
-make install
-cp cpp/lib/libfb303.so $HOME/thrift-0.2.0-bin/contrib/fb303/lib
-
-Facebook Scribe:
-wget http://github.com/downloads/facebook/scribe/scribe-2.2.tar.gz
-tar xzf scribe-2.2.tar.gz
-cd scribe
-./bootstrap.sh --prefix=$HOME/scribe-2.2-bin PY_PREFIX=$HOME/scribe-2.2-bin \
---with-thriftpath=$HOME/thrift-0.2.0-bin \
---with-fb303path=$HOME/thrift-0.2.0-bin/contrib/fb303 \
---disable-static
-make
-make install
-cp src/lib/libscribe.so $HOME/scribe-2.2-bin/lib
-
-Apache Libcloud:
-wget http://www.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.3.1.tar.bz2
-tar xjf apache-libcloud-incubating-0.3.1.tar.bz2
-cd apache-libcloud-0.3.1
-python setup.py build
-python setup.py install --home $HOME/libcloud-0.3.1-bin
-
diff --git a/sca-cpp/trunk/README b/sca-cpp/trunk/README
index ff0e06b200..aa55d25f34 100644
--- a/sca-cpp/trunk/README
+++ b/sca-cpp/trunk/README
@@ -86,7 +86,7 @@ Here's a rough guide to the Tuscany SCA source tree:
| | |-- store-sql Online store using an SQL database
| | |-- store-vhost Online store on virtual hosts
| |
- | |-- ubuntu Automated install on Ubuntu 9.10
+ | |-- ubuntu Automated install on Ubuntu 10.10 64-bit
|
|-- branches Topic and release branches
|
diff --git a/sca-cpp/trunk/components/chat/xmpp.hpp b/sca-cpp/trunk/components/chat/xmpp.hpp
index a921b9806d..3a6aa86c5c 100644
--- a/sca-cpp/trunk/components/chat/xmpp.hpp
+++ b/sca-cpp/trunk/components/chat/xmpp.hpp
@@ -87,8 +87,8 @@ private:
friend void connHandler(xmpp_conn_t * const conn, const xmpp_conn_event_t status, const int err, xmpp_stream_error_t* const errstream, void *const udata);
friend int messageHandler(xmpp_conn_t* const conn, xmpp_stanza_t* const stanza, void* const udata);
friend const failable<bool> connect(XMPPClient& xc);
- friend const failable<int> send(const char* data, const int len, XMPPClient& xc);
- friend const failable<int> send(xmpp_stanza_t* const stanza, XMPPClient& xc);
+ friend const failable<size_t> send(const char* data, const size_t len, XMPPClient& xc);
+ friend const failable<size_t> send(xmpp_stanza_t* const stanza, XMPPClient& xc);
friend const failable<bool> post(const value& to, const value& val, XMPPClient& xc);
friend const failable<bool> disconnect(XMPPClient& xc);
friend const failable<bool> listen(const lambda<failable<bool>(const value&, const value&, XMPPClient&)>& listener, XMPPClient& xc);
@@ -227,13 +227,13 @@ const failable<bool> connect(XMPPClient& xc) {
/**
* Send a buffer on an XMPP session.
*/
-const failable<int> send(const char* data, const int len, XMPPClient& xc) {
+const failable<size_t> send(const char* data, const size_t len, XMPPClient& xc) {
if (len == 0)
return 0;
- const int written = xc.conn->tls? tls_write(xc.conn->tls, data, len) : sock_write(xc.conn->sock, data, len);
- if (written < 0) {
+ const size_t written = xc.conn->tls? tls_write(xc.conn->tls, data, len) : sock_write(xc.conn->sock, data, len);
+ if (written == (size_t)-1) {
xc.conn->error = xc.conn->tls? tls_error(xc.conn->tls) : sock_error();
- return mkfailure<int>("Couldn't send stanza to XMPP server");
+ return mkfailure<size_t>("Couldn't send stanza to XMPP server");
}
return send(data + written, len - written, xc);
}
@@ -241,20 +241,20 @@ const failable<int> send(const char* data, const int len, XMPPClient& xc) {
/**
* Send a string on an XMPP session.
*/
-const failable<int> send(const string& data, XMPPClient& xc) {
+const failable<size_t> send(const string& data, XMPPClient& xc) {
return send(c_str(data), length(data), xc);
}
/**
* Send a stanza on an XMPP session.
*/
-const failable<int> send(xmpp_stanza_t* const stanza, XMPPClient& xc) {
+const failable<size_t> send(xmpp_stanza_t* const stanza, XMPPClient& xc) {
char *buf;
size_t len;
const int rc = xmpp_stanza_to_text(stanza, &buf, &len);
if (rc != 0)
- return mkfailure<int>("Couldn't convert stanza to text");
- const failable<int> r = send(buf, len, xc);
+ return mkfailure<size_t>("Couldn't convert stanza to text");
+ const failable<size_t> r = send(buf, len, xc);
if (!hasContent(r)) {
xmpp_free(xc.conn->ctx, buf);
return r;
@@ -283,7 +283,7 @@ const failable<bool> post(const value& to, const value& val, XMPPClient& xc) {
xmpp_stanza_add_child(body, textStanza(c_str(vs), xc.ctx));
// Send it
- const failable<int> r = send(stanza, xc);
+ const failable<size_t> r = send(stanza, xc);
xmpp_stanza_release(stanza);
if (!hasContent(r))
return mkfailure<bool>(reason(r));
@@ -295,7 +295,7 @@ const failable<bool> post(const value& to, const value& val, XMPPClient& xc) {
*/
const failable<bool> disconnect(XMPPClient& xc) {
xc.disconnecting = true;
- const failable<int> r = send("</stream:stream>", xc);
+ const failable<size_t> r = send("</stream:stream>", xc);
if (!hasContent(r))
return mkfailure<bool>(reason(r));
return true;
diff --git a/sca-cpp/trunk/components/log/Makefile.am b/sca-cpp/trunk/components/log/Makefile.am
index 9822d247b2..c53230b23f 100644
--- a/sca-cpp/trunk/components/log/Makefile.am
+++ b/sca-cpp/trunk/components/log/Makefile.am
@@ -43,15 +43,17 @@ CLEANFILES = gen-cpp/*
comp_LTLIBRARIES = liblog.la liblogger.la
noinst_DATA = liblog.so liblogger.so
+CXXFLAGS = ${DEFAULT_CXXFLAGS} -Wno-unused-parameter -Wno-conversion
+
nodist_liblog_la_SOURCES = gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp gen-cpp/scribe_constants.cpp gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/FacebookService.cpp gen-cpp/scribe.h
-liblog_la_CXXFLAGS = -Wno-unused-parameter
+liblog_la_CXXFLAGS = -Wno-unused-parameter -Wno-conversion
liblog_la_SOURCES = log.cpp
liblog_la_LDFLAGS = -L${THRIFT_LIB} -R${THRIFT_LIB} -lthrift -L${FB303_LIB} -R${FB303_LIB} -lfb303 -L${SCRIBE_LIB} -R${SCRIBE_LIB} -lscribe
liblog.so:
ln -s .libs/liblog.so
nodist_liblogger_la_SOURCES = gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp gen-cpp/scribe_constants.cpp gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/FacebookService.cpp gen-cpp/scribe.h
-liblogger_la_CXXFLAGS = -Wno-unused-parameter
+liblogger_la_CXXFLAGS = -Wno-unused-parameter -Wno-conversion
liblogger_la_SOURCES = logger.cpp
liblogger_la_LDFLAGS = -L${THRIFT_LIB} -R${THRIFT_LIB} -lthrift -L${FB303_LIB} -R${FB303_LIB} -lfb303 -L${SCRIBE_LIB} -R${SCRIBE_LIB} -lscribe
liblogger.so:
@@ -60,7 +62,7 @@ liblogger.so:
comp_PROGRAMS = scribe-cat
nodist_scribe_cat_SOURCES = gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp gen-cpp/scribe_constants.cpp gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/FacebookService.cpp gen-cpp/scribe.h
-scribe_cat_CXXFLAGS = -Wno-unused-parameter
+scribe_cat_CXXFLAGS = -Wno-unused-parameter -Wno-conversion
scribe_cat_SOURCES = scribe-cat.cpp
scribe_cat_LDFLAGS = -L${THRIFT_LIB} -R${THRIFT_LIB} -lthrift -L${FB303_LIB} -R${FB303_LIB} -lfb303 -L${SCRIBE_LIB} -R${SCRIBE_LIB} -lscribe
diff --git a/sca-cpp/trunk/components/log/scribe.hpp b/sca-cpp/trunk/components/log/scribe.hpp
index a0cb11fe8e..5237bd0183 100644
--- a/sca-cpp/trunk/components/log/scribe.hpp
+++ b/sca-cpp/trunk/components/log/scribe.hpp
@@ -35,12 +35,21 @@
#undef PACKAGE_VERSION
#undef VERSION
+// Ignore integer conversion issues in Thrift and Scribe headers
+#ifdef WANT_MAINTAINER_MODE
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+
#include <protocol/TBinaryProtocol.h>
#include <transport/TSocket.h>
#include <transport/TTransportUtils.h>
#include "gen-cpp/scribe.h"
+#ifdef WANT_MAINTAINER_MODE
+#pragma GCC diagnostic warning "-Wconversion"
+#endif
+
#include "string.hpp"
#include "list.hpp"
#include "value.hpp"
diff --git a/sca-cpp/trunk/components/nosqldb/tinycdb.hpp b/sca-cpp/trunk/components/nosqldb/tinycdb.hpp
index c98f2c38da..0fab1a9854 100644
--- a/sca-cpp/trunk/components/nosqldb/tinycdb.hpp
+++ b/sca-cpp/trunk/components/nosqldb/tinycdb.hpp
@@ -316,7 +316,7 @@ struct postFinish {
postFinish(const string& ks, const string& vs) : ks(ks), vs(vs) {
}
const failable<bool> operator()(struct cdb_make& cdbm) const {
- if (cdb_make_add(&cdbm, c_str(ks), length(ks), c_str(vs), length(vs)) == -1)
+ if (cdb_make_add(&cdbm, c_str(ks), (unsigned int)length(ks), c_str(vs), (unsigned int)length(vs)) == -1)
return mkfailure<bool>("Could not add tinycdb entry");
return true;
}
@@ -362,7 +362,7 @@ struct putFinish {
putFinish(const string& ks, const string& vs) : ks(ks), vs(vs) {
}
const failable<bool> operator()(struct cdb_make& cdbm) const {
- if (cdb_make_add(&cdbm, c_str(ks), length(ks), c_str(vs), length(vs)) == -1)
+ if (cdb_make_add(&cdbm, c_str(ks), (unsigned int)length(ks), c_str(vs), (unsigned int)length(vs)) == -1)
return mkfailure<bool>("Could not add tinycdb entry");
return true;
}
@@ -403,7 +403,7 @@ const failable<value> get(const value& key, TinyCDB& cdb) {
const string ks(scheme::writeValue(key));
cdbi_t vlen;
- if (cdb_seek(fd, c_str(ks), length(ks), &vlen) <= 0)
+ if (cdb_seek(fd, c_str(ks), (unsigned int)length(ks), &vlen) <= 0)
return mkfailure<value>("Could not get tinycdb entry");
char* data = gc_cnew(vlen + 1);
cdb_bread(fd, data, vlen);
diff --git a/sca-cpp/trunk/configure.ac b/sca-cpp/trunk/configure.ac
index 289fc75b0b..bf7e82f0c2 100644
--- a/sca-cpp/trunk/configure.ac
+++ b/sca-cpp/trunk/configure.ac
@@ -424,35 +424,44 @@ if test "${want_java}" = "true"; then
AC_SUBST(JAR)
# Detect most common Java VMs
- if test -f "${JAVA_PREFIX}/jre/lib/i386/libjava.so"; then
- if test -f "${JAVA_PREFIX}/jre/lib/i386/server/libjvm.so"; then
- # Server VM
- AC_MSG_NOTICE([checking for server Java VM])
- JAVA_CHECK_LIB="-L${JAVA_PREFIX}/jre/lib/i386 -R${JAVA_PREFIX}/jre/lib/i386 -L${JAVA_PREFIX}/jre/lib/i386/server -R${JAVA_PREFIX}/jre/lib/i386/server"
+ JAVA_LIBJAVA_SO=`find ${JAVA_PREFIX}/jre/lib -name libjava.so`
+ if test "${JAVA_LIBJAVA_SO}" != ""; then
+ JAVA_LIBJAVA=`dirname "${JAVA_LIBJAVA_SO}"`
+ JAVA_LIBJVM_SO=`find ${JAVA_PREFIX}/jre/lib -name libjvm.so`
+ JAVA_J9_VM=`echo "${JAVA_LIBJVM}" | grep "j9vm"`
+ if test "${JAVA_J9_VM}" != ""; then
+ # IBM J9 VM
+ AC_MSG_NOTICE([checking for J9 Java VM])
+ JAVA_LIBJVM=`dirname "${JAVA_LIBJVM_SO}"`
+ JAVA_CHECK_LIB="-L${JAVA_LIBJAVA} -R${JAVA_LIBJAVA} -L${JAVA_LIBJVM} -R${JAVA_LIBJVM}"
LIBS="${JAVA_CHECK_LIB} ${defaultlibs}"
- AC_CHECK_LIB([java], [JNI_CreateJavaVM], [JAVA_LDFLAGS="${JAVA_CHECK_LIB} -ljava -ljvm -lverify"], [], [-ljvm -lverify])
+ AC_CHECK_LIB([java], [JNI_CreateJavaVM], [JAVA_LDFLAGS="${JAVA_CHECK_LIB} -ljava -ljvm -ljsig"], [], [-ljvm -ljsig])
if test "${JAVA_LDFLAGS}" != ""; then
- AC_DEFINE([JAVA_SERVER_VM], 1, [Server Java VM])
+ AC_DEFINE([JAVA_J9_VM], 1, [J9 Java VM])
fi
else
- if test -f "${JAVA_PREFIX}/jre/lib/i386/j9vm/libjvm.so"; then
- # J9 VM
- AC_MSG_NOTICE([checking for J9 Java VM])
- JAVA_CHECK_LIB="-L${JAVA_PREFIX}/jre/lib/i386 -R${JAVA_PREFIX}/jre/lib/i386 -L${JAVA_PREFIX}/jre/lib/i386/j9vm -R${JAVA_PREFIX}/jre/lib/i386/j9vm"
- LIBS="${JAVA_CHECK_LIB} ${defaultlibs}"
- AC_CHECK_LIB([java], [JNI_CreateJavaVM], [JAVA_LDFLAGS="${JAVA_CHECK_LIB} -ljava -ljvm -ljsig"], [], [-ljvm -ljsig])
- if test "${JAVA_LDFLAGS}" != ""; then
- AC_DEFINE([JAVA_J9_VM], 1, [J9 Java VM])
- fi
+ # SUN JDK or OpenJDK VM
+ AC_MSG_NOTICE([checking for OpenJDK Java VM])
+ JAVA_LIBJVM_SO=`find ${JAVA_PREFIX}/jre/lib -name libjvm.so | grep server`
+ JAVA_LIBJVM=`dirname "${JAVA_LIBJVM_SO}"`
+ AC_MSG_NOTICE([libjava ${JAVA_LIBJAVA} libjvm ${LIBJVM}])
+ JAVA_CHECK_LIB="-L${JAVA_LIBJAVA} -R${JAVA_LIBJAVA} -L${JAVA_LIBJVM} -R${JAVA_LIBJVM}"
+ LIBS="${JAVA_CHECK_LIB} ${defaultlibs}"
+ AC_CHECK_LIB([java], [JNI_CreateJavaVM], [JAVA_LDFLAGS="${JAVA_CHECK_LIB} -ljava -ljvm -lverify"], [], [-ljvm -lverify])
+ if test "${JAVA_LDFLAGS}" != ""; then
+ AC_DEFINE([JAVA_OPENJDK_VM], 1, [OpenJDK Java VM])
fi
fi
else
- if test -f "${JAVA_PREFIX}/jre/bin/default/libharmonyvm.so"; then
+ JAVA_LIBHARMONYVM_SO=`find ${JAVA_PREFIX}/jre/bin -name libharmonyvm.so`
+ if test "${JAVA_LIBHARMONYVM_SO}" != ""; then
# Apache Harmony VM
+ JAVA_LIBHARMONYVM=`dirname "${JAVA_LIBHARMONYVM_SO}"`
+ JAVA_LIBJAVA=`dirname "${JAVA_LIBHARMONYVM}"`
AC_MSG_NOTICE([checking for Apache Harmony Java VM])
- JAVA_CHECK_LIB="-L${JAVA_PREFIX}/jre/bin -R${JAVA_PREFIX}/jre/bin -L${JAVA_PREFIX}/jre/bin/default -R${JAVA_PREFIX}/jre/bin/default"
+ JAVA_CHECK_LIB="-L${JAVA_LIBJAVA} -R${JAVA_LIBJAVA} -L${JAVA_LIBHARMONYVM} -R${JAVA_LIBHARMONYVM}"
LIBS="${JAVA_CHECK_LIB} ${defaultlibs}"
- AC_CHECK_LIB([harmonyvm], [JNI_CreateJavaVM], [JAVA_LDFLAGS="${JAVA_CHECK_LIB} -lharmonyvm -lhythr -licuuc -lch ${JAVA_PREFIX}/jre/bin/default/libicudata.so.34"], [], [-lhythr -licuuc -lch ${JAVA_PREFIX}/jre/bin/default/libicudata.so.34])
+ AC_CHECK_LIB([harmonyvm], [JNI_CreateJavaVM], [JAVA_LDFLAGS="${JAVA_CHECK_LIB} -lharmonyvm -lhythr -licuuc -lch ${JAVA_LIBHARMONYVM}/libicudata.so.34"], [], [-lhythr -licuuc -lch ${JAVA_LIBHARMONYVM}/libicudata.so.34])
if test "${JAVA_LDFLAGS}" != ""; then
AC_DEFINE([JAVA_HARMONY_VM], 1, [Apache Harmony Java VM])
fi
@@ -868,8 +877,10 @@ else
fi
# Configure GCC C++ and LD options.
+AC_SUBST([DEFAULT_CXXFLAGS], ["${cxxflags}"])
AC_SUBST([CXXFLAGS], ["${cxxflags}"])
AC_SUBST([LDFLAGS], ["${ldflags}"])
+AC_SUBST([DEFAULT_LDFLAGS], ["${ldflags}"])
LIBS="${defaultlibs}"
AC_CONFIG_FILES([Makefile
diff --git a/sca-cpp/trunk/kernel/fstream.hpp b/sca-cpp/trunk/kernel/fstream.hpp
index 033024de1d..8efb798b57 100644
--- a/sca-cpp/trunk/kernel/fstream.hpp
+++ b/sca-cpp/trunk/kernel/fstream.hpp
@@ -101,7 +101,7 @@ public:
fclose(file);
}
- const int read(void* buf, int size) {
+ const size_t read(void* buf, size_t size) {
return fread(buf, 1, size, file);
}
diff --git a/sca-cpp/trunk/kernel/function.hpp b/sca-cpp/trunk/kernel/function.hpp
index db7318303a..701e0f1fa9 100644
--- a/sca-cpp/trunk/kernel/function.hpp
+++ b/sca-cpp/trunk/kernel/function.hpp
@@ -83,7 +83,7 @@ public:
Callable() {
}
- virtual const int size() const = 0;
+ virtual const size_t size() const = 0;
virtual const R operator()(P... p) const = 0;
@@ -110,7 +110,7 @@ public:
return function(std::forward<P>(p)...);
}
- virtual const int size() const {
+ virtual const size_t size() const {
return sizeof(function);
}
diff --git a/sca-cpp/trunk/kernel/gc.hpp b/sca-cpp/trunk/kernel/gc.hpp
index 77a879629a..09dcd1e5ac 100644
--- a/sca-cpp/trunk/kernel/gc.hpp
+++ b/sca-cpp/trunk/kernel/gc.hpp
@@ -244,40 +244,40 @@ template<typename T> T* gc_new() {
}
template<typename T> apr_status_t gc_pool_acleanup(void* v) {
- int* m = static_cast<int*>(v);
- int n = *m;
+ size_t* m = static_cast<size_t*>(v);
+ size_t n = *m;
T* t = (T*)(m + 1);
- for (int i = 0; i < n; i++, t++)
+ for (size_t i = 0; i < n; i++, t++)
t->~T();
return APR_SUCCESS;
}
-template<typename T> T* gc_anew(apr_pool_t* p, int n) {
- int* gc_anew_ptr = static_cast<int*>(apr_palloc(p, sizeof(int) + sizeof(T[n])));
+template<typename T> T* gc_anew(apr_pool_t* p, size_t n) {
+ size_t* gc_anew_ptr = static_cast<size_t*>(apr_palloc(p, sizeof(size_t) + sizeof(T[n])));
assert(gc_anew_ptr != NULL);
*gc_anew_ptr = n;
apr_pool_cleanup_register(p, gc_anew_ptr, gc_pool_acleanup<T>, apr_pool_cleanup_null) ;
return (T*)(gc_anew_ptr + 1);
}
-template<typename T> T* gc_anew(const gc_pool& p, int n) {
+template<typename T> T* gc_anew(const gc_pool& p, size_t n) {
return gc_anew<T>(pool(p), n);
}
-template<typename T> T* gc_anew(int n) {
+template<typename T> T* gc_anew(size_t n) {
return gc_anew<T>(gc_current_pool(), n);
}
/**
* Allocate an array of chars.
*/
-char* gc_cnew(apr_pool_t* p, int n) {
+char* gc_cnew(apr_pool_t* p, size_t n) {
char* gc_cnew_ptr = static_cast<char*>(apr_palloc(p, n));
assert(gc_cnew_ptr != NULL);
return gc_cnew_ptr;
}
-char* gc_cnew(int n) {
+char* gc_cnew(size_t n) {
return gc_cnew(gc_current_pool(), n);
}
diff --git a/sca-cpp/trunk/kernel/hash.hpp b/sca-cpp/trunk/kernel/hash.hpp
index 5cd213f09e..9de13dd690 100644
--- a/sca-cpp/trunk/kernel/hash.hpp
+++ b/sca-cpp/trunk/kernel/hash.hpp
@@ -43,8 +43,8 @@ namespace tuscany
* tree at contrib/ltree/crc32.[ch] and from FreeBSD at
* src/usr.bin/cksum/crc32.c.
*/
-const unsigned int crc32hash(const char* data, const unsigned int len) {
- return apr_memcache_hash_default(NULL, data, len);
+const unsigned int crc32hash(const char* data, const size_t len) {
+ return (unsigned int)apr_memcache_hash_default(NULL, data, len);
}
/**
@@ -89,7 +89,7 @@ const unsigned int crc32hash(const char* data, const unsigned int len) {
*
* -- Ralf S. Engelschall <rse@engelschall.com>
*/
-const unsigned int times33hash(const char* data, const unsigned int len) {
+const unsigned int times33hash(const char* data, const size_t len) {
apr_ssize_t l = len;
return apr_hashfunc_default(data, &l);
}
@@ -107,8 +107,8 @@ const unsigned int times33hash(const char* data, const unsigned int len) {
* Passes Bob Jenkin's frog.c torture-test. No collisions possible for 4 byte
* keys, no small 1 to 7 bit differentials.
*/
-const unsigned int murmurhash(const char* key, const unsigned int klen) {
- unsigned int len = klen;
+const unsigned int murmurhash(const char* key, const size_t klen) {
+ unsigned int len = (unsigned int)klen;
const unsigned int seed = 0;
// 'm' and 'r' are mixing constants generated offline.
@@ -153,8 +153,8 @@ const unsigned int murmurhash(const char* key, const unsigned int klen) {
* An endian and alignment neutral, but half the speed, version of
* the murmur hash.
*/
-const unsigned int portablemurmurhash(const char* key, const unsigned int klen) {
- unsigned int len = klen;
+const unsigned int portablemurmurhash(const char* key, const size_t klen) {
+ unsigned int len = (unsigned int)klen;
const unsigned int seed = 0;
// 'm' and 'r' are mixing constants generated offline.
diff --git a/sca-cpp/trunk/kernel/list.hpp b/sca-cpp/trunk/kernel/list.hpp
index db2f457317..a8dbcc1b0c 100644
--- a/sca-cpp/trunk/kernel/list.hpp
+++ b/sca-cpp/trunk/kernel/list.hpp
@@ -379,14 +379,14 @@ template<typename T> const list<T> cdddr(const list<T>& p) {
* Returns the length of a list.
*/
template<typename T> struct lengthRef {
- const int operator()(const int c, const list<T>& p) {
+ const size_t operator()(const size_t c, const list<T>& p) {
if(isNil(p))
return c;
return (*this)(c + 1, cdr(p));
}
};
-template<typename T> const int length(const list<T>& p) {
+template<typename T> const size_t length(const list<T>& p) {
return lengthRef<T> ()(0, p);
}
@@ -537,7 +537,7 @@ template<typename T> const list<T> seq(const T& start, const T& end) {
/**
* Returns the i-th element of a list.
*/
-template<typename T> const T listRef(const list<T>& l, const int i) {
+template<typename T> const T listRef(const list<T>& l, const size_t i) {
if (i == 0)
return car(l);
return listRef(cdr(l), i - 1);
diff --git a/sca-cpp/trunk/kernel/parallel.hpp b/sca-cpp/trunk/kernel/parallel.hpp
index 09cf0df9a3..09829f0758 100644
--- a/sca-cpp/trunk/kernel/parallel.hpp
+++ b/sca-cpp/trunk/kernel/parallel.hpp
@@ -42,7 +42,7 @@ namespace tuscany {
/**
* Returns the current thread id.
*/
-unsigned int threadId() {
+long int threadId() {
return syscall(__NR_gettid);
}
@@ -134,7 +134,7 @@ public:
*/
template<typename T> class wqueue {
public:
- wqueue(int max) : max(max), size(0), tail(0), head(0), values(new (gc_anew<T>(max)) T[max]) {
+ wqueue(size_t max) : max(max), size(0), tail(0), head(0), values(new (gc_anew<T>(max)) T[max]) {
pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&full, NULL);
pthread_cond_init(&empty, NULL);
@@ -150,23 +150,23 @@ public:
}
private:
- const int max;
- int size;
- int tail;
- int head;
+ const size_t max;
+ size_t size;
+ size_t tail;
+ size_t head;
pthread_mutex_t mutex;
pthread_cond_t full;
pthread_cond_t empty;
gc_ptr<T> values;
- template<typename X> friend const int enqueue(wqueue<X>& q, const X& v);
+ template<typename X> friend const size_t enqueue(wqueue<X>& q, const X& v);
template<typename X> friend const X dequeue(wqueue<X>& q);
};
/**
* Adds an element to the tail of the queue.
*/
-template<typename T> const int enqueue(wqueue<T>&q, const T& v) {
+template<typename T> const size_t enqueue(wqueue<T>&q, const T& v) {
pthread_mutex_lock(&q.mutex);
while(q.size == q.max)
pthread_cond_wait(&q.full, &q.mutex);
@@ -211,7 +211,7 @@ void *workerThreadFunc(void *arg) {
/**
* Returns a list of worker threads.
*/
-const list<pthread_t> workerThreads(wqueue<lambda<bool()> >& wqueue, const int count) {
+const list<pthread_t> workerThreads(wqueue<lambda<bool()> >& wqueue, const size_t count) {
if (count == 0)
return list<pthread_t>();
pthread_t thread;
@@ -229,7 +229,7 @@ private:
// copies of the queue and thread pool when a worker is copied
class sharedWorker {
public:
- sharedWorker(int max) : work(wqueue<lambda<bool()> >(max)), threads(workerThreads(work, max)) {
+ sharedWorker(size_t max) : work(wqueue<lambda<bool()> >(max)), threads(workerThreads(work, max)) {
}
wqueue<lambda<bool()> > work;
@@ -237,7 +237,7 @@ private:
};
public:
- worker(int max) : w(*(new (gc_new<sharedWorker>()) sharedWorker(max))) {
+ worker(size_t max) : w(*(new (gc_new<sharedWorker>()) sharedWorker(max))) {
}
worker(const worker& wk) : w(wk.w) {
diff --git a/sca-cpp/trunk/kernel/sstream.hpp b/sca-cpp/trunk/kernel/sstream.hpp
index 693ba5f88f..770c169e09 100644
--- a/sca-cpp/trunk/kernel/sstream.hpp
+++ b/sca-cpp/trunk/kernel/sstream.hpp
@@ -60,10 +60,11 @@ public:
ostringstream& vprintf(const char* fmt, ...) {
va_list args;
- va_start (args, fmt);
string s;
+ va_start (args, fmt);
s.len = vsnprintf(NULL, 0, fmt, args);
s.buf = gc_cnew(s.len + 1);
+ va_start (args, fmt);
vsnprintf(s.buf, s.len + 1, fmt, args);
buf = cons(s, buf);
len += s.len;
@@ -104,7 +105,7 @@ private:
friend const string str(ostringstream& os);
- int len;
+ size_t len;
list<string> buf;
};
@@ -122,7 +123,7 @@ class istringstream : public istream {
public:
istringstream(const string& s) {
cur = 0;
- const int slen = length(s);
+ const size_t slen = length(s);
len = slen;
buf = c_str(s);
}
@@ -136,8 +137,8 @@ public:
buf = is.buf;
}
- const int read(void* b, int size) {
- const int n = len - cur;
+ const size_t read(void* b, size_t size) {
+ const size_t n = len - cur;
if (n == 0)
return 0;
if (n > size) {
@@ -173,8 +174,8 @@ public:
}
private:
- int len;
- int cur;
+ size_t len;
+ size_t cur;
const char* buf;
};
@@ -183,10 +184,10 @@ private:
*/
const list<string> tokenize(const char* sep, const string& str) {
struct nested {
- static const list<string> tokenize(const char* sep, const string& str, const int start = 0) {
+ static const list<string> tokenize(const char* sep, const string& str, const size_t start = 0) {
if (start >= length(str))
return list<string>();
- const int i = find(str, sep, start);
+ const size_t i = find(str, sep, start);
if (i == length(str))
return mklist(string(substr(str, start)));
return cons(string(substr(str, start, i - start)), tokenize(sep, str, i + 1));
@@ -222,7 +223,7 @@ struct ilistRead{
}
const list<string> operator()() {
char buffer[1024];
- const int n = read(is, buffer, sizeof(buffer));
+ const size_t n = read(is, buffer, sizeof(buffer));
if (n ==0)
return list<string>();
return cons(string(buffer, n), (*this)());
@@ -236,7 +237,7 @@ const list<string> streamList(istream& is) {
/**
* Fragment the first element of a list of strings to fit the given max length.
*/
-const list<string> fragment(list<string> l, int max) {
+const list<string> fragment(list<string> l, size_t max) {
const string s = car(l);
if (length(s) <= max)
return l;
diff --git a/sca-cpp/trunk/kernel/stream.hpp b/sca-cpp/trunk/kernel/stream.hpp
index f9d5cc3afe..53fb5e9ff7 100644
--- a/sca-cpp/trunk/kernel/stream.hpp
+++ b/sca-cpp/trunk/kernel/stream.hpp
@@ -106,7 +106,7 @@ ostream& operator<<(ostream& os, unused const stream_endl e) {
*/
class istream {
public:
- virtual const int read(void* buf, int size) = 0;
+ virtual const size_t read(void* buf, size_t size) = 0;
virtual const bool eof() = 0;
virtual const bool fail() = 0;
virtual const int get() = 0;
@@ -116,7 +116,7 @@ public:
/**
* Read from an input stream.
*/
-const int read(istream& is, void * buf, int size) {
+const size_t read(istream& is, void * buf, size_t size) {
return is.read(buf, size);
}
@@ -164,10 +164,11 @@ public:
odebugstream& vprintf(const char* fmt, ...) {
va_list args;
- va_start (args, fmt);
string s;
+ va_start (args, fmt);
s.len = vsnprintf(NULL, 0, fmt, args);
s.buf = gc_cnew(s.len + 1);
+ va_start (args, fmt);
vsnprintf(s.buf, s.len + 1, fmt, args);
buf = buf + s;
va_end (args);
diff --git a/sca-cpp/trunk/kernel/string-test.cpp b/sca-cpp/trunk/kernel/string-test.cpp
index 323756c7e4..23fa2b9457 100644
--- a/sca-cpp/trunk/kernel/string-test.cpp
+++ b/sca-cpp/trunk/kernel/string-test.cpp
@@ -122,11 +122,11 @@ string add(string& x, string& y) {
char charBuffer[16384];
struct addStrings{
- const int size;
- addStrings(const int size) : size(size) {
+ const size_t size;
+ addStrings(const size_t size) : size(size) {
}
bool operator()() const {
- const int sz = size / 4;
+ const size_t sz = size / 4;
string x(charBuffer, sz);
string y(charBuffer, sz);
assert(length(add(x, y)) == sz * 2);
@@ -135,11 +135,11 @@ struct addStrings{
};
struct addStdStrings{
- const int size;
- addStdStrings(const int size) : size(size) {
+ const size_t size;
+ addStdStrings(const size_t size) : size(size) {
}
bool operator()() const {
- const int sz = size / 4;
+ const size_t sz = size / 4;
std::string x(charBuffer, sz);
std::string y(charBuffer, sz);
assert(stdAdd(x, y).length() == (unsigned int)(sz * 2));
diff --git a/sca-cpp/trunk/kernel/string.hpp b/sca-cpp/trunk/kernel/string.hpp
index 1daec2aac7..cf7b4092d2 100644
--- a/sca-cpp/trunk/kernel/string.hpp
+++ b/sca-cpp/trunk/kernel/string.hpp
@@ -94,7 +94,7 @@ public:
string_memcpy(buf, s, len + 1);
}
- string(const char* s, const int n) {
+ string(const char* s, const size_t n) {
len = n;
if (len == 0) {
buf = stringEmptyBuffer;
@@ -105,7 +105,7 @@ public:
buf[len] = '\0';
}
- string(const int n, const char c) {
+ string(const size_t n, const char c) {
len = n;
if (len == 0) {
buf = stringEmptyBuffer;
@@ -152,7 +152,7 @@ public:
}
const bool operator<(const string& s) const {
- const int n = len < s.len? len : s.len;
+ const size_t n = len < s.len? len : s.len;
const int c = memcmp(buf, s.buf, n);
if (c < 0)
return true;
@@ -162,7 +162,7 @@ public:
}
const bool operator>(const string& s) const {
- const int n = len < s.len? len : s.len;
+ const size_t n = len < s.len? len : s.len;
int c = memcmp(buf, s.buf, n);
if (c > 0)
return true;
@@ -178,12 +178,12 @@ private:
friend class ostringstream;
friend const string operator+(const string& a, const string& b);
friend const string operator+(const string& a, const char* b);
- friend const int length(const string& s);
+ friend const size_t length(const string& s);
friend const char* c_str(const string& s);
- friend const int find(const string& s1, const char* s2, const int start);
- friend const string substr(const string& s, const int pos, const int n);
+ friend const size_t find(const string& s1, const char* s2, const size_t start);
+ friend const string substr(const string& s, const size_t pos, const size_t n);
- int len;
+ size_t len;
char* buf;
};
@@ -202,7 +202,7 @@ const string operator+(const string& a, const string& b) {
const string operator+(const string& a, const char* b) {
string s;
- const int blen = strlen(b);
+ const size_t blen = strlen(b);
s.len = a.len + blen;
s.buf = gc_cnew(s.len + 1);
string_memcpy(s.buf, a.buf, a.len);
@@ -214,7 +214,7 @@ const string operator+(const string& a, const char* b) {
/**
* Returns the length of a string.
*/
-const int length(const string& s) {
+const size_t length(const string& s) {
return s.len;
}
@@ -228,7 +228,7 @@ const char* c_str(const string& s) {
/**
* Find the first occurrence of string s2 in s1, starting at the given position.
*/
-const int find(const string& s1, const char* s2, const int start) {
+const size_t find(const string& s1, const char* s2, const size_t start) {
if (start >= s1.len)
return s1.len;
const char *f = strstr(s1.buf + start, s2);
@@ -237,7 +237,7 @@ const int find(const string& s1, const char* s2, const int start) {
return f - s1.buf;
}
-const int find(const string& s1, const char* s2) {
+const size_t find(const string& s1, const char* s2) {
return find(s1, s2, 0);
}
@@ -251,14 +251,14 @@ const bool contains(const string& s1, const char* s2) {
/**
* Find the first occurence of any character from a string in a string.
*/
-const int find_first_of(const string& s1, const string& s2) {
+const size_t find_first_of(const string& s1, const string& s2) {
return strcspn(c_str(s1), c_str(s2));
}
/**
* Find the first occurence of a character in a string.
*/
-const int find(const string& s, const char c) {
+const size_t find(const string& s, const char c) {
const char* cs = c_str(s);
const char* f = strchr(cs, c);
if (f == NULL)
@@ -269,7 +269,7 @@ const int find(const string& s, const char c) {
/**
* Find the last occurence of a character in a string.
*/
-const int find_last(const string& s, const char c) {
+const size_t find_last(const string& s, const char c) {
const char* cs = c_str(s);
const char* f = strrchr(cs, c);
if (f == NULL)
@@ -280,7 +280,7 @@ const int find_last(const string& s, const char c) {
/**
* Return a substring of a string.
*/
-const string substr(const string& s, const int pos, const int n) {
+const string substr(const string& s, const size_t pos, const size_t n) {
if (pos >= s.len)
return string();
if (pos + n > s.len)
@@ -288,7 +288,7 @@ const string substr(const string& s, const int pos, const int n) {
return string(s.buf + pos, n);
}
-const string substr(const string& s, const int pos) {
+const string substr(const string& s, const size_t pos) {
return substr(s, pos, length(s));
}
diff --git a/sca-cpp/trunk/kernel/tree.hpp b/sca-cpp/trunk/kernel/tree.hpp
index 436385aa1b..89a131c324 100644
--- a/sca-cpp/trunk/kernel/tree.hpp
+++ b/sca-cpp/trunk/kernel/tree.hpp
@@ -96,14 +96,14 @@ template<typename T> const list<T> sort(const list<T>& l) {
/**
* Make a balanced tree from an ordered list of leaves.
*/
-template<typename T> const list<T> btreeHelper(const list<T>& elements, const int n) {
+template<typename T> const list<T> btreeHelper(const list<T>& elements, const size_t n) {
if (n == 0)
return cons<T>(list<T>(), elements);
- const int leftSize = (n - 1) / 2; {
+ const size_t leftSize = (n - 1) / 2; {
const list<T> leftResult = btreeHelper<T>(elements, leftSize); {
const list<T> leftTree = car(leftResult);
const list<T> nonLeftElements = cdr(leftResult);
- const int rightSize = n - (leftSize + 1); {
+ const size_t rightSize = n - (leftSize + 1); {
const T thisEntry = car(nonLeftElements);
const list<T> rightResult = btreeHelper<T>(cdr(nonLeftElements), rightSize); {
const list<T> rightTree = car(rightResult);
diff --git a/sca-cpp/trunk/kernel/xml.hpp b/sca-cpp/trunk/kernel/xml.hpp
index 895ed7035e..3459592c97 100644
--- a/sca-cpp/trunk/kernel/xml.hpp
+++ b/sca-cpp/trunk/kernel/xml.hpp
@@ -196,7 +196,7 @@ int readCallback(void *context, char* buffer, int len) {
const string s(car(f));
rc.ilist = cdr(f);
memcpy(buffer, c_str(s), length(s));
- return length(s);
+ return (int)length(s);
}
/**
diff --git a/sca-cpp/trunk/kernel/xsd-test.cpp b/sca-cpp/trunk/kernel/xsd-test.cpp
index f430f1848d..fbd2ee6dca 100644
--- a/sca-cpp/trunk/kernel/xsd-test.cpp
+++ b/sca-cpp/trunk/kernel/xsd-test.cpp
@@ -45,7 +45,7 @@ bool printNode(xmlTextReaderPtr reader) {
}
int xmlRead(void *context, char* buffer, int len) {
- return fread(buffer, 1, len, (FILE*)context);
+ return (int)fread(buffer, 1, len, (FILE*)context);
}
int xmlClose(void *context) {
diff --git a/sca-cpp/trunk/modules/http/curl-connect.cpp b/sca-cpp/trunk/modules/http/curl-connect.cpp
index 8957fb01b0..432ccc2000 100644
--- a/sca-cpp/trunk/modules/http/curl-connect.cpp
+++ b/sca-cpp/trunk/modules/http/curl-connect.cpp
@@ -60,8 +60,8 @@ const bool testConnect(const string& url, const string& ca = "", const string& c
if (pollfds->rtnevents & APR_POLLIN) {
char data[8192];
if (pollfds->desc.s == csock) {
- const int rl = ::read(0, data, sizeof(data));
- if (rl == -1)
+ const size_t rl = ::read(0, data, sizeof(data));
+ if (rl == (size_t)-1)
return false;
if (rl > 0) {
const failable<bool> src = http::send(data, rl, cs);
@@ -69,12 +69,12 @@ const bool testConnect(const string& url, const string& ca = "", const string& c
}
}
else {
- const failable<int> frl = http::recv(data, sizeof(data), cs);
+ const failable<size_t> frl = http::recv(data, sizeof(data), cs);
assert(hasContent(frl));
- const int rl = content(frl);
+ const size_t rl = content(frl);
if (rl == 0)
return true;
- const int wl = ::write(0, data, rl);
+ const size_t wl = ::write(0, data, rl);
assert(wl == rl);
}
continue;
diff --git a/sca-cpp/trunk/modules/http/http.hpp b/sca-cpp/trunk/modules/http/http.hpp
index 56331d7ee2..b6ec9d4e5a 100644
--- a/sca-cpp/trunk/modules/http/http.hpp
+++ b/sca-cpp/trunk/modules/http/http.hpp
@@ -94,8 +94,8 @@ private:
friend CURL* handle(const CURLSession& cs);
friend apr_socket_t* sock(const CURLSession& cs);
friend const failable<bool> connect(const string& url, CURLSession& cs);
- friend const failable<bool> send(const char* c, const int l, const CURLSession& cs);
- friend const failable<int> recv(char* c, const int l, const CURLSession& cs);
+ friend const failable<bool> send(const char* c, const size_t l, const CURLSession& cs);
+ friend const failable<size_t> recv(char* c, const size_t l, const CURLSession& cs);
public:
string ca;
@@ -257,7 +257,7 @@ template<typename R> const failable<list<R> > apply(const list<list<string> >& h
ostringstream os;
write(cadr(hdr), os);
const string s = str(os);
- const int sz = length(s);
+ const size_t sz = length(s);
// Setup the read, write header and write data callbacks
CURLReadContext rcx(mklist(s));
@@ -564,7 +564,7 @@ const failable<bool> connect(const string& url, CURLSession& cs) {
/**
* Send an array of chars.
*/
-const failable<bool> send(const char* c, const int l, const CURLSession& cs) {
+const failable<bool> send(const char* c, const size_t l, const CURLSession& cs) {
// Send the data
size_t wl = 0;
@@ -582,30 +582,30 @@ const failable<bool> send(const char* c, const int l, const CURLSession& cs) {
return mkfailure<bool>(apreason(pollrc));
// Send what's left
- return send(c + wl, (int)((size_t)l - wl), cs);
+ return send(c + wl, l - wl, cs);
}
/**
* Receive an array of chars.
*/
-const failable<int> recv(char* c, const int l, const CURLSession& cs) {
+const failable<size_t> recv(char* c, const size_t l, const CURLSession& cs) {
// Receive data
size_t rl;
const CURLcode rc = curl_easy_recv(cs.h, c, (size_t)l, &rl);
if (rc == CURLE_OK)
- return (int)rl;
+ return (size_t)rl;
if (rc == 1)
return 0;
if (rc != CURLE_AGAIN)
- return mkfailure<int>(curlreason(rc));
+ return mkfailure<size_t>(curlreason(rc));
// If the socket was not ready, wait for it to become ready
const apr_pollfd_t* pollfds;
apr_int32_t pollcount;
apr_status_t pollrc = apr_pollset_poll(cs.rpollset, -1, &pollcount, &pollfds);
if (pollrc != APR_SUCCESS)
- return mkfailure<int>(apreason(pollrc));
+ return mkfailure<size_t>(apreason(pollrc));
// Receive again
return recv(c, l, cs);
diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp
index 02c9904ac3..78d292dc89 100644
--- a/sca-cpp/trunk/modules/http/httpd.hpp
+++ b/sca-cpp/trunk/modules/http/httpd.hpp
@@ -328,7 +328,7 @@ const int setupReadPolicy(request_rec* r) {
*/
const list<string> read(request_rec* r) {
char b[1024];
- const int n = ap_get_client_block(r, b, sizeof(b));
+ const size_t n = ap_get_client_block(r, b, sizeof(b));
if (n <= 0)
return list<string>();
return cons(string(b, n), read(r));
diff --git a/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp b/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp
index c241cd982d..f5539ce785 100644
--- a/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp
+++ b/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp
@@ -203,10 +203,10 @@ int tunnel(conn_rec* conn, http::CURLSession& cs, const string& url, const strin
// Receive from target
char data[8192];
- const failable<int> frl = http::recv(data, sizeof(data), cs);
+ const failable<size_t> frl = http::recv(data, sizeof(data), cs);
if (!hasContent(frl))
return abort(conn, string("Couldn't receive from target") + reason(frl));
- const int rl = content(frl);
+ const size_t rl = content(frl);
// Target connection closed
if (rl == 0)
diff --git a/sca-cpp/trunk/modules/http/openauth.hpp b/sca-cpp/trunk/modules/http/openauth.hpp
index 53250b4732..ff69a9732f 100644
--- a/sca-cpp/trunk/modules/http/openauth.hpp
+++ b/sca-cpp/trunk/modules/http/openauth.hpp
@@ -51,7 +51,7 @@ const maybe<string> sessionID(const list<string> c) {
if (isNil(c))
return maybe<string>();
const string cn = cookieName(c_str(car(c)));
- const int i = find(cn, "=");
+ const size_t i = find(cn, "=");
if (i < length(cn)) {
const list<string> kv = mklist<string>(substr(cn, 0, i), substr(cn, i+1));
if (!isNil(kv) && !isNil(cdr(kv))) {
diff --git a/sca-cpp/trunk/modules/java/eval.hpp b/sca-cpp/trunk/modules/java/eval.hpp
index daf30d891b..11e57cb08a 100644
--- a/sca-cpp/trunk/modules/java/eval.hpp
+++ b/sca-cpp/trunk/modules/java/eval.hpp
@@ -316,7 +316,7 @@ const jobjectArray valuesToJarrayHelper(const JavaRuntime& jr, jobjectArray a, c
}
const jobjectArray valuesToJarray(const JavaRuntime& jr, const list<value>& v) {
- jobjectArray a = jr.env->NewObjectArray(length(v), jr.objectClass, NULL);
+ jobjectArray a = jr.env->NewObjectArray((jsize)length(v), jr.objectClass, NULL);
return valuesToJarrayHelper(jr, a, v, 0);
}
@@ -360,7 +360,7 @@ const jvalue* valuesToJvaluesHelper(const JavaRuntime& jr, jvalue* a, const list
}
const jvalue* valuesToJvalues(const JavaRuntime& jr, const list<value>& types, const list<value>& v) {
- const int n = length(v);
+ const size_t n = length(v);
jvalue* a = new (gc_anew<jvalue>(n)) jvalue[n];
valuesToJvaluesHelper(jr, a, types, v);
return a;
diff --git a/sca-cpp/trunk/modules/json/json-test.cpp b/sca-cpp/trunk/modules/json/json-test.cpp
index 9bae859ce2..abed71a9c3 100644
--- a/sca-cpp/trunk/modules/json/json-test.cpp
+++ b/sca-cpp/trunk/modules/json/json-test.cpp
@@ -35,7 +35,7 @@ bool testJSEval() {
JSONContext cx;
const string script("(function testJSON(n){ return JSON.parse(JSON.stringify(n)) })(5)");
jsval rval;
- assert(JS_EvaluateScript(cx, cx.getGlobal(), c_str(script), length(script), "testJSON.js", 1, &rval));
+ assert(JS_EvaluateScript(cx, cx.getGlobal(), c_str(script), (uintN)length(script), "testJSON.js", 1, &rval));
const string r(JS_GetStringBytes(JS_ValueToString(cx, rval)));
assert(r == "5");
return true;
diff --git a/sca-cpp/trunk/modules/json/json.hpp b/sca-cpp/trunk/modules/json/json.hpp
index 94d37866a3..a0617b0e5e 100644
--- a/sca-cpp/trunk/modules/json/json.hpp
+++ b/sca-cpp/trunk/modules/json/json.hpp
@@ -217,7 +217,7 @@ failable<bool> consume(JSONParser* parser, const list<string>& ilist, const JSON
if (isNil(ilist))
return true;
JSString* jstr = JS_NewStringCopyZ(cx, c_str(car(ilist)));
- if(!JS_ConsumeJSONText(cx, parser, JS_GetStringChars(jstr), JS_GetStringLength(jstr)))
+ if(!JS_ConsumeJSONText(cx, parser, JS_GetStringChars(jstr), (uint32)JS_GetStringLength(jstr)))
return mkfailure<bool>("JS_ConsumeJSONText failed");
return consume(parser, cdr(ilist), cx);
}
diff --git a/sca-cpp/trunk/modules/python/eval.hpp b/sca-cpp/trunk/modules/python/eval.hpp
index 0ff68a6a1d..7f9339f6e1 100644
--- a/sca-cpp/trunk/modules/python/eval.hpp
+++ b/sca-cpp/trunk/modules/python/eval.hpp
@@ -215,7 +215,7 @@ PyObject* valueToPyObject(const value& v) {
* Convert a python tuple to a list of values.
*/
-const list<value> pyTupleToValuesHelper(PyObject* o, const int i, const int size) {
+const list<value> pyTupleToValuesHelper(PyObject* o, const size_t i, const size_t size) {
if (i == size)
return list<value>();
return cons(pyObjectToValue(PyTuple_GetItem(o, i)), pyTupleToValuesHelper(o, i + 1, size));
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image b/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image
index 85a6f382ad..a3da2132e4 100755
--- a/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image
+++ b/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image
@@ -17,7 +17,7 @@
# Install a complete distribution, the required system tools and libraries,
# the runtime dependencies and the Tuscany SCA runtime on a fresh Ubuntu Server
-# 9.10 image.
+# 10.10 64-bit image.
# Display commands as they are executed
set -x
@@ -33,47 +33,58 @@ sudo chown $u /mnt/tuscany
sudo chgrp $g /mnt/tuscany
cd /mnt/tuscany
-# Install system tools and libraries
+# Install core dev tools
sudo apt-get -y install wget git-core autoconf automake libtool g++
if [ "$?" != "0" ]; then
exit $?
fi
-# Uncomment to install GCC 4.5
-#wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-gcc-4.5
-#chmod +x ./ubuntu-gcc-4.5
-#./ubuntu-gcc-4.5
-#if [ "$?" != "0" ]; then
-# exit $?
-#fi
-sudo apt-get -y install libssl-dev
+# Required by Apache HTTP server
+sudo apt-get -y install libssl-dev libpcre3-dev
if [ "$?" != "0" ]; then
exit $?
fi
-sudo apt-get -y install python-dev
+# Required by Memcached
+sudo apt-get -y install libevent-dev
if [ "$?" != "0" ]; then
exit $?
fi
-sudo apt-get -y install libpcre3-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-sudo apt-get -y install libevent-dev
+# Required by TraceMonkey
+sudo apt-get -y install autoconf2.13 zip
if [ "$?" != "0" ]; then
exit $?
fi
+# Required by Apache Axis2/C
sudo apt-get -y install pkg-config
if [ "$?" != "0" ]; then
exit $?
fi
+# Required by Apache Qpid/C++
sudo apt-get -y install libboost-dev libboost-program-options-dev libboost-filesystem-dev uuid-dev
if [ "$?" != "0" ]; then
exit $?
fi
+# Required by Apache Vysper
sudo apt-get -y install openjdk-6-jdk
if [ "$?" != "0" ]; then
exit $?
fi
-sudo apt-get -y install bison flex
+# Require by HTML Tidy
+sudo apt-get -y install cvs
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+# Required by PostgreSQL
+sudo apt-get -y install libreadline-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+# Required by Apache Thrift
+sudo apt-get -y install bison flex python-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+# Required by Facebook Scribe
+sudo apt-get -y install gawk
if [ "$?" != "0" ]; then
exit $?
fi
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-bin-image b/sca-cpp/trunk/ubuntu/ubuntu-bin-image
deleted file mode 100755
index 175d860087..0000000000
--- a/sca-cpp/trunk/ubuntu/ubuntu-bin-image
+++ /dev/null
@@ -1,90 +0,0 @@
-# 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.
-
-# Install a minimal distribution including only the core runtime, support for
-# Python and C++ components, memcached and tinycdb on a fresh Ubuntu Server
-# 9.10 image.
-
-# Display commands as they are executed
-set -x
-
-# First update the system
-sudo apt-get update
-
-# Get the Ubuntu version
-osver=`cat /etc/issue | awk '{ print $2 }'`
-
-# Create install directory
-u=`id -un`
-g=`id -gn`
-sudo mkdir -p /mnt/tuscany
-sudo chown $u /mnt/tuscany
-sudo chgrp $g /mnt/tuscany
-cd /mnt/tuscany
-
-# Install system tools and libraries
-sudo apt-get -y install wget git-core autoconf automake libtool g++
-if [ "$?" != "0" ]; then
- exit $?
-fi
-# Uncomment to install GCC 4.5
-#wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-gcc-4.5
-#chmod +x ./ubuntu-gcc-4.5
-#./ubuntu-gcc-4.5
-#if [ "$?" != "0" ]; then
-# exit $?
-#fi
-sudo apt-get -y install libssl-dev apache2 apache2-utils apache2-prefork-dev libaprutil1-dev libapr1-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-sudo apt-get -y install curl libcurl4-openssl-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-sudo apt-get -y install libxml2 libxml2-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-if [ "$osver" = "9.10" ]; then
- sudo apt-get -y install xulrunner-1.9.1 xulrunner-1.9.1-dev
- if [ "$?" != "0" ]; then
- exit $?
- fi
-else
- sudo apt-get -y install xulrunner-1.9.2 xulrunner-1.9.2-dev
- if [ "$?" != "0" ]; then
- exit $?
- fi
-fi
-sudo apt-get -y install python-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-sudo apt-get -y install memcached
-if [ "$?" != "0" ]; then
- exit $?
-fi
-sudo apt-get -y install tinycdb libcdb-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-
-# Download and install the Tuscany runtime
-wget http://people.apache.org/~jsdelfino/tuscany/test/tuscany-sca-cpp-1.0.tar.gz
-tar xzf tuscany-sca-cpp-1.0.tar.gz
-
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-dev-all-image b/sca-cpp/trunk/ubuntu/ubuntu-dev-all-image
index 6fa4656c29..28d55e697e 100755
--- a/sca-cpp/trunk/ubuntu/ubuntu-dev-all-image
+++ b/sca-cpp/trunk/ubuntu/ubuntu-dev-all-image
@@ -17,7 +17,7 @@
# Install a complete distribution, the required system tools and libraries,
# the runtime dependencies and the Tuscany SCA runtime on a fresh Ubuntu
-# Server 9.10 image.
+# Server 10.10 64-bit image.
# Display commands as they are executed
set -x
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-dev-image b/sca-cpp/trunk/ubuntu/ubuntu-dev-image
deleted file mode 100755
index ed40aa6b9c..0000000000
--- a/sca-cpp/trunk/ubuntu/ubuntu-dev-image
+++ /dev/null
@@ -1,41 +0,0 @@
-# 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.
-
-# Install a complete distribution, the required system tools and libraries,
-# the runtime dependencies and the Tuscany SCA runtime on a fresh Ubuntu
-# Server 9.10 image.
-
-# Display commands as they are executed
-set -x
-
-# First update the system
-sudo apt-get update
-
-# Create install directory
-u=`id -un`
-g=`id -gn`
-sudo mkdir -p /mnt/tuscany
-sudo chown $u /mnt/tuscany
-sudo chgrp $g /mnt/tuscany
-cd /mnt/tuscany
-
-# Download and run install script
-sudo apt-get -y install wget
-wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
-chmod +x ./ubuntu-install
-./ubuntu-install
-
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-gcc-4.5 b/sca-cpp/trunk/ubuntu/ubuntu-gcc-4.5
deleted file mode 100755
index 8464382d0a..0000000000
--- a/sca-cpp/trunk/ubuntu/ubuntu-gcc-4.5
+++ /dev/null
@@ -1,52 +0,0 @@
-# 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.
-
-# Install GCC 4.5, useful if you want to use it and it's not already included
-# in your Linux distribution
-
-# Display commands as they are executed
-set -x
-
-# Install GCC 4.5 binaries
-mkdir -p gcc-4.5
-cd gcc-4.5
-sudo apt-get -y install libcloog-ppl0 libelfg0 libgmpxx4ldbl libmpc2 libppl-c2 libppl7
-if [ "$?" != "0" ]; then
- exit $?
-fi
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/cpp-4.5_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/fixincludes_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/g++-4.5_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/gcc-4.5_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/gcc-4.5-base_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/lib64gcc1_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/lib64gomp1_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/lib64mudflap0_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/lib64stdc++6_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libgcc1_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libgomp1_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libmudflap0-4.5-dev_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libmudflap0_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libstdc++6_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libstdc++6-4.5-dev_4.5.0-2_i386.deb
-wget http://ftp.debian.org/debian/pool/main/b/binutils/binutils_2.20.51.20100418-1_i386.deb
-sudo dpkg -i *.deb
-if [ "$?" != "0" ]; then
- exit $?
-fi
-cd ..
-
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-install b/sca-cpp/trunk/ubuntu/ubuntu-install
deleted file mode 100755
index 26088745e2..0000000000
--- a/sca-cpp/trunk/ubuntu/ubuntu-install
+++ /dev/null
@@ -1,109 +0,0 @@
-# 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.
-
-# Build a minimal distribution including only the core runtime, support for
-# Python and C++ components, memcached and tinycdb on a fresh Ubuntu Server
-# 9.10 system.
-
-# Display commands as they are executed
-set -x
-
-# Get the Ubuntu version
-osver=`cat /etc/issue | awk '{ print $2 }'`
-
-# Build and install in the current directory
-build=`pwd`
-
-# Install core dev tools
-sudo apt-get -y install wget git-core autoconf automake libtool g++
-if [ "$?" != "0" ]; then
- exit $?
-fi
-
-# Uncomment to install GCC 4.5
-#wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-gcc-4.5
-#chmod +x ./ubuntu-gcc-4.5
-#./ubuntu-gcc-4.5
-#if [ "$?" != "0" ]; then
-# exit $?
-#fi
-
-# Install Apache HTTP server
-sudo apt-get -y install libssl-dev apache2 apache2-utils apache2-prefork-dev libaprutil1-dev libapr1-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-
-# Install Libcurl
-sudo apt-get -y install curl libcurl4-openssl-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-
-# Build Libxml2
-sudo apt-get -y install libxml2 libxml2-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-
-# Install TraceMonkey
-if [ "$osver" = "9.10" ]; then
- sudo apt-get -y install xulrunner-1.9.1 xulrunner-1.9.1-dev
- if [ "$?" != "0" ]; then
- exit $?
- fi
-else
- sudo apt-get -y install xulrunner-1.9.2 xulrunner-1.9.2-dev
- if [ "$?" != "0" ]; then
- exit $?
- fi
-fi
-
-# Install Python
-sudo apt-get -y install python-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-
-# Install Memcached
-sudo apt-get -y install memcached
-if [ "$?" != "0" ]; then
- exit $?
-fi
-
-# Install Tinycdb
-sudo apt-get -y install tinycdb libcdb-dev
-if [ "$?" != "0" ]; then
- exit $?
-fi
-
-# Build Tuscany SCA
-git clone git://git.apache.org/tuscany-sca-cpp.git
-cd tuscany-sca-cpp
-cp etc/git-exclude .git/info/exclude
-./bootstrap
-./configure --prefix=$build/tuscany-sca-cpp-bin
-make
-make install
-if [ "$?" != "0" ]; then
- exit $?
-fi
-cd $build
-
-# Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
-
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-install-all b/sca-cpp/trunk/ubuntu/ubuntu-install-all
index 5231c42d21..dd730a6d03 100755
--- a/sca-cpp/trunk/ubuntu/ubuntu-install-all
+++ b/sca-cpp/trunk/ubuntu/ubuntu-install-all
@@ -17,7 +17,7 @@
# Install a complete distribution, the required system tools and libraries, the
# runtime dependencies and the Tuscany SCA runtime on a fresh Ubuntu Server
-# 9.10 system.
+# 10.10 64-bit system.
# Display commands as they are executed
set -x
@@ -31,23 +31,28 @@ if [ "$?" != "0" ]; then
exit $?
fi
-# Uncomment to install GCC 4.5
-#wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-gcc-4.5
-#chmod +x ./ubuntu-gcc-4.5
-#./ubuntu-gcc-4.5
-#if [ "$?" != "0" ]; then
-# exit $?
-#fi
+# Build Libexpat
+wget http://sourceforge.net/projects/expat/files/expat/2.0.1/expat-2.0.1.tar.gz/download
+mv download expat-2.0.1.tar.gz
+tar xzf expat-2.0.1.tar.gz
+cd expat-2.0.1
+./configure --prefix=$build/expat-2.0.1-bin
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
# Build Apache HTTP server
-sudo apt-get -y install libssl-dev
+sudo apt-get -y install libssl-dev libpcre3-dev
if [ "$?" != "0" ]; then
exit $?
fi
wget http://archive.apache.org/dist/httpd/httpd-2.3.8.tar.gz
tar xzf httpd-2.3.8.tar.gz
cd httpd-2.3.8
-./configure --enable-ssl --enable-proxy --enable-usertrack --enable-mods-shared=most --with-included-apr --with-mpm=prefork --prefix=$build/httpd-2.3.8-bin
+./configure --enable-ssl --enable-proxy --enable-usertrack --enable-mods-shared=most --with-included-apr --with-expat=$build/expat-2.0.1-bin --with-mpm=prefork --prefix=$build/httpd-2.3.8-bin
make
make install
if [ "$?" != "0" ]; then
@@ -124,8 +129,8 @@ fi
cd $build
# Install Google AppEngine SDK
-wget http://googleappengine.googlecode.com/files/google_appengine_1.3.7.zip
-unzip google_appengine_1.3.7.zip
+wget http://googleappengine.googlecode.com/files/google_appengine_1.3.8.zip
+unzip google_appengine_1.3.8.zip
# Build Apache Axis2/C
sudo apt-get -y install pkg-config
@@ -156,8 +161,6 @@ sudo apt-get -y install libboost-dev libboost-program-options-dev libboost-files
if [ "$?" != "0" ]; then
exit $?
fi
-sudo -s ln -s /usr/lib/libboost_program_options-mt.so /usr/lib/libboost_program_options.so
-sudo -s ln -s /usr/lib/libboost_filesystem-mt.so /usr/lib/libboost_filesystem.so
wget http://www.apache.org/dist/qpid/0.6/qpid-cpp-0.6.tar.gz
tar xzf qpid-cpp-0.6.tar.gz
cd qpidc-0.6
@@ -169,19 +172,6 @@ if [ "$?" != "0" ]; then
fi
cd $build
-# Build Libexpat
-wget http://sourceforge.net/projects/expat/files/expat/2.0.1/expat-2.0.1.tar.gz/download
-mv download expat-2.0.1.tar.gz
-tar xzf expat-2.0.1.tar.gz
-cd expat-2.0.1
-./configure --prefix=$build/expat-2.0.1-bin
-make
-make install
-if [ "$?" != "0" ]; then
- exit $?
-fi
-cd $build
-
# Build Libstrophe
git clone git://github.com/jsdelfino/libstrophe.git
cd libstrophe
@@ -234,7 +224,6 @@ fi
cd $build
# Build Mod_auth_openid
-sudo apt-get -y install libpcre3-dev
git clone git://github.com/jsdelfino/mod_auth_openid.git
cd mod_auth_openid
./autogen.sh
@@ -304,6 +293,10 @@ cp cpp/lib/libfb303.so $build/thrift-0.2.0-bin/contrib/fb303/lib
cd $build
# Build Facebook Scribe
+sudo apt-get -y install gawk
+if [ "$?" != "0" ]; then
+ exit $?
+fi
wget http://github.com/downloads/facebook/scribe/scribe-2.2.tar.gz
tar xzf scribe-2.2.tar.gz
cd scribe
@@ -328,10 +321,6 @@ fi
cd $build
# Build Tuscany SCA
-sudo apt-get -y install
-if [ "$?" != "0" ]; then
- exit $?
-fi
git clone git://git.apache.org/tuscany-sca-cpp.git
cd tuscany-sca-cpp
cp etc/git-exclude .git/info/exclude
diff --git a/sca-cpp/trunk/ubuntu/uec2-bin-image b/sca-cpp/trunk/ubuntu/uec2-bin-image
deleted file mode 100755
index f4d738a050..0000000000
--- a/sca-cpp/trunk/ubuntu/uec2-bin-image
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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.
-
-# Install a Tuscany image on an EC2 instance
-host=$1
-
-# Download and execute Tuscany SCA install script
-ssh -i $HOME/.ec2/ec2-tuscany-keypair.pem ubuntu@$host "wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-image; chmod 700 ./ubuntu-bin-image; ./ubuntu-bin-image"
-
diff --git a/sca-cpp/trunk/ubuntu/uec2-dev-image b/sca-cpp/trunk/ubuntu/uec2-dev-image
deleted file mode 100755
index 55a0477a34..0000000000
--- a/sca-cpp/trunk/ubuntu/uec2-dev-image
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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.
-
-# Build a Tuscany image on an EC2 instance
-host=$1
-
-# Download and execute Tuscany SCA install script
-ssh -i $HOME/.ec2/ec2-tuscany-keypair.pem ubuntu@$host "wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-dev-image; chmod 700 ./ubuntu-dev-image; ./ubuntu-dev-image"
-