Author: jsdelfino
Date: Thu Dec 1 09:09:05 2011
New Revision: 1209010
URL: http://svn.apache.org/viewvc?rev=1209010&view=rev
Log:
Fix build and install errors on Mac OS X. Add missing scripts to forward IP
ports on Mac OS X.
Added:
tuscany/sca-cpp/trunk/macos/ip-redirect
- copied, changed from r1208241,
tuscany/sca-cpp/trunk/modules/edit/mkapplinks
tuscany/sca-cpp/trunk/macos/ip-redirect-all (contents, props changed)
- copied, changed from r1208241, tuscany/sca-cpp/trunk/macos/Makefile.am
Modified:
tuscany/sca-cpp/trunk/Makefile.am
tuscany/sca-cpp/trunk/kernel/monad.hpp
tuscany/sca-cpp/trunk/macos/Makefile.am
tuscany/sca-cpp/trunk/macos/macos-install
tuscany/sca-cpp/trunk/modules/edit/mkapplinks
tuscany/sca-cpp/trunk/modules/edit/ssl-start
tuscany/sca-cpp/trunk/modules/edit/start
tuscany/sca-cpp/trunk/modules/http/httpd.hpp
tuscany/sca-cpp/trunk/ubuntu/ip-redirect-all
Modified: tuscany/sca-cpp/trunk/Makefile.am
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/Makefile.am?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/Makefile.am Thu Dec 1 09:09:05 2011
@@ -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
Modified: tuscany/sca-cpp/trunk/kernel/monad.hpp
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/monad.hpp?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/monad.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/monad.hpp Thu Dec 1 09:09:05 2011
@@ -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 f
}
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() {
Modified: tuscany/sca-cpp/trunk/macos/Makefile.am
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/macos/Makefile.am?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/macos/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/macos/Makefile.am Thu Dec 1 09:09:05 2011
@@ -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
Copied: tuscany/sca-cpp/trunk/macos/ip-redirect (from r1208241,
tuscany/sca-cpp/trunk/modules/edit/mkapplinks)
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/macos/ip-redirect?p2=tuscany/sca-cpp/trunk/macos/ip-redirect&p1=tuscany/sca-cpp/trunk/modules/edit/mkapplinks&r1=1208241&r2=1209010&rev=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/mkapplinks (original)
+++ tuscany/sca-cpp/trunk/macos/ip-redirect Thu Dec 1 09:09:05 2011
@@ -1,5 +1,3 @@
-#!/bin/sh
-
# 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
@@ -17,16 +15,22 @@
# specific language governing permissions and limitations
# under the License.
-# Create app links and sub-directories if needed
-for n in `ls apps | awk '{ printf "apps/%s/nuvem\n", $1 }'`; do
- if [ ! -e "$n" ]; then
- ln -s ../../../../../nuvem/nuvem-parallel/nuvem "$n"
- fi
-done
+# 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
-for n in `ls apps | awk '{ printf "apps/%s/lib\n", $1 }'`; do
- if [ ! -e "$n" ]; then
- ln -s ../../../../components "$n"
- fi
-done
+# Redirect incoming traffic
+sudo /sbin/ipfw add $sport fwd $dest,$sport tcp from any to $dest $tport
Copied: tuscany/sca-cpp/trunk/macos/ip-redirect-all (from r1208241,
tuscany/sca-cpp/trunk/macos/Makefile.am)
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/macos/ip-redirect-all?p2=tuscany/sca-cpp/trunk/macos/ip-redirect-all&p1=tuscany/sca-cpp/trunk/macos/Makefile.am&r1=1208241&r2=1209010&rev=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/macos/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/macos/ip-redirect-all Thu Dec 1 09:09:05 2011
@@ -15,8 +15,13 @@
# specific language governing permissions and limitations
# under the License.
-dist_macos_SCRIPTS =
-macosdir=$(prefix)/macos
+# Redirect TCP/IP traffic to all local addresses from one port to another
+# Example: ip-redirect-all 80 8090
-dist_noinst_SCRIPTS = macos-install
+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 {}
Propchange: tuscany/sca-cpp/trunk/macos/ip-redirect-all
------------------------------------------------------------------------------
svn:executable = *
Modified: tuscany/sca-cpp/trunk/macos/macos-install
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/macos/macos-install?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/macos/macos-install (original)
+++ tuscany/sca-cpp/trunk/macos/macos-install Thu Dec 1 09:09:05 2011
@@ -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
Modified: tuscany/sca-cpp/trunk/modules/edit/mkapplinks
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/mkapplinks?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/mkapplinks (original)
+++ tuscany/sca-cpp/trunk/modules/edit/mkapplinks Thu Dec 1 09:09:05 2011
@@ -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
Modified: tuscany/sca-cpp/trunk/modules/edit/ssl-start
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/ssl-start?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/ssl-start (original)
+++ tuscany/sca-cpp/trunk/modules/edit/ssl-start Thu Dec 1 09:09:05 2011
@@ -141,8 +141,8 @@ Alias /home/home.b64 $here/htdocs/home/h
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
Modified: tuscany/sca-cpp/trunk/modules/edit/start
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/start?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/start (original)
+++ tuscany/sca-cpp/trunk/modules/edit/start Thu Dec 1 09:09:05 2011
@@ -92,8 +92,8 @@ Alias /home/home.b64 $here/htdocs/home/h
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
Modified: tuscany/sca-cpp/trunk/modules/http/httpd.hpp
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd.hpp?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd.hpp Thu Dec 1 09:09:05 2011
@@ -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>
Modified: tuscany/sca-cpp/trunk/ubuntu/ip-redirect-all
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ip-redirect-all?rev=1209010&r1=1209009&r2=1209010&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ip-redirect-all (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ip-redirect-all Thu Dec 1 09:09:05 2011
@@ -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