summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk')
-rw-r--r--sca-cpp/trunk/Makefile.am2
-rw-r--r--sca-cpp/trunk/kernel/monad.hpp4
-rw-r--r--sca-cpp/trunk/macos/Makefile.am2
-rwxr-xr-xsca-cpp/trunk/macos/ip-redirect36
-rwxr-xr-xsca-cpp/trunk/macos/ip-redirect-all27
-rwxr-xr-xsca-cpp/trunk/macos/macos-install6
-rwxr-xr-xsca-cpp/trunk/modules/edit/mkapplinks11
-rwxr-xr-xsca-cpp/trunk/modules/edit/ssl-start4
-rwxr-xr-xsca-cpp/trunk/modules/edit/start4
-rw-r--r--sca-cpp/trunk/modules/http/httpd.hpp4
-rwxr-xr-xsca-cpp/trunk/ubuntu/ip-redirect-all2
11 files changed, 85 insertions, 17 deletions
diff --git a/sca-cpp/trunk/Makefile.am b/sca-cpp/trunk/Makefile.am
index d41536ac0b..154643af17 100644
--- a/sca-cpp/trunk/Makefile.am
+++ b/sca-cpp/trunk/Makefile.am
@@ -17,7 +17,7 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = etc kernel modules components samples doc ubuntu
+SUBDIRS = etc kernel modules components samples doc macos ubuntu
datadir=$(prefix)
dist_data_DATA = AUTHORS README LICENSE COPYING NOTICE NEWS
diff --git a/sca-cpp/trunk/kernel/monad.hpp b/sca-cpp/trunk/kernel/monad.hpp
index c21f6409b7..c16e7bade2 100644
--- a/sca-cpp/trunk/kernel/monad.hpp
+++ b/sca-cpp/trunk/kernel/monad.hpp
@@ -242,7 +242,7 @@ private:
template<typename A, typename B> friend const bool hasContent(const failable<A, B>& m);
template<typename A, typename B> friend const A content(const failable<A, B>& m);
template<typename A, typename B> friend const B reason(const failable<A, B>& m);
- template<typename A, typename B> friend const failable<A, B> mkfailure(const B& f, const bool log = true);
+ template<typename A, typename B> friend const failable<A, B> mkfailure(const B& f, const bool log);
template<typename A> friend const failable<A, string> mkfailure();
bool hasv;
@@ -296,7 +296,7 @@ template<typename V, typename F> const failable<V, F> mkfailure(const F& f, cons
}
template<typename V> const failable<V> mkfailure(const char* f, const bool log = true) {
- return mkfailure<V, string>(string(f));
+ return mkfailure<V, string>(string(f), log);
}
template<typename V> const failable<V> mkfailure() {
diff --git a/sca-cpp/trunk/macos/Makefile.am b/sca-cpp/trunk/macos/Makefile.am
index 5584689b80..d1ddf03b73 100644
--- a/sca-cpp/trunk/macos/Makefile.am
+++ b/sca-cpp/trunk/macos/Makefile.am
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-dist_macos_SCRIPTS =
+dist_macos_SCRIPTS = ip-redirect ip-redirect-all
macosdir=$(prefix)/macos
dist_noinst_SCRIPTS = macos-install
diff --git a/sca-cpp/trunk/macos/ip-redirect b/sca-cpp/trunk/macos/ip-redirect
new file mode 100755
index 0000000000..965353cfd6
--- /dev/null
+++ b/sca-cpp/trunk/macos/ip-redirect
@@ -0,0 +1,36 @@
+# 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.
+
+# Redirect TCP/IP traffic to a particular IP address from one port to another
+# port. This is useful to handle incoming traffic on a standard reserved port
+# like 80 or 443 for example in an unprivileged user process bound to a non
+# reserved port.
+# Example: ip-redirect 80 8090 10.1.1.1
+
+sport=$1
+tport=$2
+dest=$3
+if [ "$dest" = "" ]; then
+ dest="127.0.0.1"
+fi
+
+# Delete existing rule
+sudo /sbin/ipfw list | grep "fwd $dest,$sport tcp from any" | awk '{ printf "sudo ipfw delete %s\n", $1 }' | /bin/sh
+
+# Redirect incoming traffic
+sudo /sbin/ipfw add $sport fwd $dest,$sport tcp from any to $dest $tport
+
diff --git a/sca-cpp/trunk/macos/ip-redirect-all b/sca-cpp/trunk/macos/ip-redirect-all
new file mode 100755
index 0000000000..c41c55ffe3
--- /dev/null
+++ b/sca-cpp/trunk/macos/ip-redirect-all
@@ -0,0 +1,27 @@
+# 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.
+
+# Redirect TCP/IP traffic to all local addresses from one port to another
+# Example: ip-redirect-all 80 8090
+
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+sport=$1
+tport=$2
+
+# Redirect traffic
+/sbin/ifconfig | grep "inet " | awk '{ print $2 }' | xargs -I {} $here/ip-redirect $sport $tport {}
+
diff --git a/sca-cpp/trunk/macos/macos-install b/sca-cpp/trunk/macos/macos-install
index b9474482a4..3499d7323d 100755
--- a/sca-cpp/trunk/macos/macos-install
+++ b/sca-cpp/trunk/macos/macos-install
@@ -16,7 +16,7 @@
# under the License.
# Install a complete distribution, the required system tools and libraries, the
-# runtime dependencies and the Tuscany SCA runtime on a fresh MacOS 10.6.7
+# runtime dependencies and the Tuscany SCA runtime on a fresh Mac OS X 10.6.7
# system.
# Display commands as they are executed
@@ -24,10 +24,6 @@ set -x
# Build and install in the current directory
build=`pwd`
-build=$build/build
-rm -rf $build
-mkdir $build
-cd $build
# Install pkg-config
curl -OL http://pkgconfig.freedesktop.org/releases/pkg-config-0.25.tar.gz
diff --git a/sca-cpp/trunk/modules/edit/mkapplinks b/sca-cpp/trunk/modules/edit/mkapplinks
index 94f455ba48..a68a2896ec 100755
--- a/sca-cpp/trunk/modules/edit/mkapplinks
+++ b/sca-cpp/trunk/modules/edit/mkapplinks
@@ -17,16 +17,21 @@
# specific language governing permissions and limitations
# under the License.
-# Create app links and sub-directories if needed
+aprefix=$1
+tprefix=$2
+nprefix=$3
+
+# Create app links to Nuvem and Tuscany components
+cd $1
for n in `ls apps | awk '{ printf "apps/%s/nuvem\n", $1 }'`; do
if [ ! -e "$n" ]; then
- ln -s ../../../../../nuvem/nuvem-parallel/nuvem "$n"
+ ln -s "$nprefix/nuvem-parallel/nuvem" "$n"
fi
done
for n in `ls apps | awk '{ printf "apps/%s/lib\n", $1 }'`; do
if [ ! -e "$n" ]; then
- ln -s ../../../../components "$n"
+ ln -s "$tprefix/components" "$n"
fi
done
diff --git a/sca-cpp/trunk/modules/edit/ssl-start b/sca-cpp/trunk/modules/edit/ssl-start
index 015a5dda66..4a7e779bd6 100755
--- a/sca-cpp/trunk/modules/edit/ssl-start
+++ b/sca-cpp/trunk/modules/edit/ssl-start
@@ -141,8 +141,8 @@ Alias /home/home.b64 $here/htdocs/home/home.b64
EOF
-# Create app links and sub-directories if needed
-./mkapplinks
+# Create app resource links
+./mkapplinks . ../../../.. ../../../../../nuvem
# Configure app resource aliases
cat >>tmp/conf/svhost-ssl.conf <<EOF
diff --git a/sca-cpp/trunk/modules/edit/start b/sca-cpp/trunk/modules/edit/start
index c3ef1f7c4d..9a56cf755c 100755
--- a/sca-cpp/trunk/modules/edit/start
+++ b/sca-cpp/trunk/modules/edit/start
@@ -92,8 +92,8 @@ Alias /home/home.b64 $here/htdocs/home/home.b64
EOF
-# Create app links and sub-directories if needed
-./mkapplinks
+# Create app resource links
+./mkapplinks . ../../../.. ../../../../../nuvem
# Configure app resource aliases
cat >>tmp/conf/svhost.conf <<EOF
diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp
index c1cc16d08d..5f8b867c9b 100644
--- a/sca-cpp/trunk/modules/http/httpd.hpp
+++ b/sca-cpp/trunk/modules/http/httpd.hpp
@@ -45,13 +45,17 @@
#include <http_request.h>
// Ignore conversion warnings in HTTPD 2.3.15 header
#ifdef WANT_MAINTAINER_MODE
+#ifndef IS_DARWIN
#pragma GCC diagnostic ignored "-Wconversion"
#endif
+#endif
#include <http_protocol.h>
// Re-enable conversion warnings
#ifdef WANT_MAINTAINER_MODE
+#ifndef IS_DARWIN
#pragma GCC diagnostic warning "-Wconversion"
#endif
+#endif
// Hack to workaround compile error with HTTPD 2.3.8
#define aplog_module_index aplog_module_index = 0
#include <http_log.h>
diff --git a/sca-cpp/trunk/ubuntu/ip-redirect-all b/sca-cpp/trunk/ubuntu/ip-redirect-all
index b5876c9850..c8743add5d 100755
--- a/sca-cpp/trunk/ubuntu/ip-redirect-all
+++ b/sca-cpp/trunk/ubuntu/ip-redirect-all
@@ -16,7 +16,7 @@
# under the License.
# Redirect TCP/IP traffic to all local addresses from one port to another
-# Example: ip-redirect 80 8090
+# Example: ip-redirect-all 80 8090
here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
sport=$1