=== modified file 'libamf/amf.cpp'
--- libamf/amf.cpp	2009-02-25 22:33:03 +0000
+++ libamf/amf.cpp	2009-04-20 21:31:10 +0000
@@ -37,6 +37,9 @@
 #if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
 # include <sys/types.h>
 # include <arpa/inet.h>
+# ifdef __amigaos4__
+# include <netinet/in.h>
+# endif
 #else
 # include <windows.h>
 # include <io.h>

=== modified file 'libamf/flv.cpp'
--- libamf/flv.cpp	2009-02-25 22:33:03 +0000
+++ libamf/flv.cpp	2009-04-20 21:31:27 +0000
@@ -30,6 +30,9 @@
 #if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
 # include <sys/types.h>
 # include <arpa/inet.h>
+# ifdef __amigaos4__
+# include <netinet/in.h>
+# endif
 #else
 # include <windows.h>
 # include <io.h>

=== modified file 'libamf/sol.cpp'
--- libamf/sol.cpp	2009-02-25 22:33:03 +0000
+++ libamf/sol.cpp	2009-04-20 21:31:43 +0000
@@ -46,6 +46,9 @@
 # include <ws2tcpip.h>
 #else
 #include <arpa/inet.h>
+#ifdef __amigaos4__
+#include <netinet/in.h>
+#endif
 #endif
 
 #include <boost/scoped_array.hpp>

=== modified file 'libbase/curl_adapter.cpp'
--- libbase/curl_adapter.cpp	2009-03-29 19:26:31 +0000
+++ libbase/curl_adapter.cpp	2009-04-20 21:13:50 +0000
@@ -677,7 +677,7 @@
 
 // select() will always fail on OS/2 as we can't select
 // on file descriptors, only on sockets
-#ifndef __OS2__ 
+#if !defined(__OS2__) && !defined(__amigaos4__)
 		if ( ret == -1 )
 		{
             if ( errno == EINTR )

=== modified file 'libbase/rc.cpp'
--- libbase/rc.cpp	2009-02-26 08:04:27 +0000
+++ libbase/rc.cpp	2009-04-20 21:15:55 +0000
@@ -117,6 +117,8 @@
             (PSZ) "DefaultBrowserExe", NULL,
             (PVOID) browserExe, (LONG)sizeof(browserExe));
     _urlOpenerFormat += " -remote 'openurl(%u)'";
+#elif defined(__amigaos4__)
+	_urlOpenerFormat = "OWB:owb %u";
 #endif
 
     // TODO: fetch GNASH_URLOPENER_FORMAT from the environment
@@ -138,14 +140,18 @@
     // Check the default system location
     std::string loadfile = SYSCONFDIR;
 
-#ifndef __OS2__ 
+#if !defined(__OS2__) && !defined(__amigaos4__)
     // On OS/2 only look in %HOME%
     loadfile.append("/gnashrc");
     parseFile(loadfile);
 #endif
     
     // Check the users home directory
+#ifndef __amigaos4__
     char *home = std::getenv("HOME");
+#else
+    char *home = "/progdir";
+#endif
     if (home) {
         loadfile = home;
         loadfile.append("/.gnashrc");
@@ -257,7 +263,11 @@
         // Initial "~" followed by "/"
         if (path.substr(1,1) == "/") {
             
+#ifndef __amigaos4__
             const char *home = std::getenv("HOME");
+#else
+            const char *home = "/progdir";
+#endif
             if (home) {
                 // if HOME set in env, replace ~ with HOME
                 path.replace(0, 1, home);
@@ -618,7 +628,11 @@
     else
     {
         // Check the users home directory    
+#ifndef __amigaos4__
         char *home = std::getenv("HOME");
+#else
+        char *home = "/progdir";
+#endif
         if (home) {
             writefile = home;
             writefile.append("/.gnashrc");

=== modified file 'libbase/rc.h'
--- libbase/rc.h	2009-02-25 02:00:44 +0000
+++ libbase/rc.h	2009-04-20 21:17:53 +0000
@@ -32,8 +32,10 @@
 #include <boost/cstdint.hpp>
 #include <boost/tokenizer.hpp>
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__amigaos4__)
 #include <sys/shm.h>
+#elif defined(__amigaos4__)
+typedef long int key_t;
 #else
 typedef boost::uint32_t key_t;
 #endif // _WIN32

=== modified file 'libbase/utf8.h'
--- libbase/utf8.h	2009-02-25 22:33:03 +0000
+++ libbase/utf8.h	2009-04-20 21:19:14 +0000
@@ -26,6 +26,13 @@
 #include <boost/cstdint.hpp> // for C99 int types
 #include <limits>
 
+#ifdef __amigaos4__
+namespace std
+{
+	typedef std::basic_string<wchar_t> wstring;
+};
+#endif
+
 /// Utilities to convert between std::string and std::wstring.
 //
 /// Strings in Gnash are generally stored as std::strings.

=== modified file 'libcore/TextField.h'
--- libcore/TextField.h	2009-04-14 11:26:23 +0000
+++ libcore/TextField.h	2009-04-20 21:23:50 +0000
@@ -25,6 +25,13 @@
 #include "rect.h" // for inlines
 #include "Font.h" // for visibility of font add_ref/drop_ref
 
+#ifdef __amigaos4__
+namespace std
+{
+	typedef std::basic_string<wchar_t> wstring;
+};
+#endif
+
 // Forward declarations
 namespace gnash {
     namespace SWF {

=== modified file 'libcore/asobj/NetConnection_as.cpp'
--- libcore/asobj/NetConnection_as.cpp	2009-04-13 10:28:31 +0000
+++ libcore/asobj/NetConnection_as.cpp	2009-04-20 21:29:50 +0000
@@ -31,6 +31,9 @@
 # include <winsock.h>
 #else
 #include <arpa/inet.h> // for htons
+#ifdef __amigaos4__
+#include <netinet/in.h>
+#endif
 #endif
 
 #include "NetConnection_as.h"

=== modified file 'libcore/asobj/NetStream_as.cpp'
--- libcore/asobj/NetStream_as.cpp	2009-04-03 09:18:40 +0000
+++ libcore/asobj/NetStream_as.cpp	2009-04-20 21:29:58 +0000
@@ -48,6 +48,9 @@
 #if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
 # include <sys/types.h>
 # include <arpa/inet.h>
+#ifdef __amigaos4__
+#include <netinet/in.h>
+#endif
 #else
 # include <windows.h>
 # include <io.h>

=== modified file 'libcore/asobj/SharedObject_as.cpp'
--- libcore/asobj/SharedObject_as.cpp	2009-04-03 09:18:40 +0000
+++ libcore/asobj/SharedObject_as.cpp	2009-04-20 21:30:37 +0000
@@ -27,6 +27,9 @@
 #if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
 # include <sys/types.h>
 # include <arpa/inet.h>
+# ifdef __amigaos4__
+# include <netinet/in.h>
+# endif
 #else
 # include <windows.h>
 # include <io.h>
@@ -415,7 +418,11 @@
     _solSafeDir = rcfile.getSOLSafeDir();
     if (_solSafeDir.empty()) {
         log_debug("Empty SOLSafeDir directive: we'll use '/tmp'");
+#ifndef __amigaos4__
         _solSafeDir = "/tmp/";
+#else
+        _solSafeDir = "/t/";
+#endif
     }
 
     // Check if the base dir exists here

=== modified file 'libcore/swf/swf.h'
--- libcore/swf/swf.h	2009-04-16 08:42:14 +0000
+++ libcore/swf/swf.h	2009-04-20 21:23:11 +0000
@@ -20,6 +20,10 @@
 
 #include <iostream> 
 
+#ifdef __amigaos4__
+#undef ACTION_END //damn we have alredy a definition of ACTION_END into OS4..
+#endif
+
 namespace gnash {
 
 /// SWF format parsing classes

=== modified file 'plugin/plugin.cpp'
--- plugin/plugin.cpp	2009-03-10 17:06:17 +0000
+++ plugin/plugin.cpp	2009-04-20 21:25:53 +0000
@@ -277,7 +277,11 @@
         //       and serialize back (to avoid duplicates)
 
         std::string newGnashRc;
-        char *gnashrc = std::getenv("GNASHRC");
+#ifndef __amigaos4__
+    	char *gnashrc = std::getenv("GNASHRC");
+#else
+	    char *gnashrc = "/progdir/.gnashrc";
+#endif
         if ( gnashrc )
         {
             newGnashRc.assign(gnashrc);
@@ -287,7 +291,11 @@
         newGnashRc.append(SYSCONFDIR);
         newGnashRc.append("/gnashpluginrc");
 
-        char *home = std::getenv("HOME");
+#ifndef __amigaos4__
+    	char *home = std::getenv("HOME");
+#else
+	    char *home = "/progdir";
+#endif
         if ( home )
         {
             newGnashRc.append(":");

=== modified file 'utilities/dumpshm.cpp'
--- utilities/dumpshm.cpp	2009-02-25 22:33:03 +0000
+++ utilities/dumpshm.cpp	2009-04-20 21:29:04 +0000
@@ -37,11 +37,11 @@
 }
 #include <dirent.h>
 #include <sys/types.h>
-#if !defined(HAVE_WINSOCK_H) && !defined(__riscos__) && !defined(__OS2__)
+#if !defined(HAVE_WINSOCK_H) && !defined(__riscos__) && !defined(__OS2__) && !defined(__amigaos4__)
 #include <sys/mman.h>
 #include <sys/shm.h>
 #include <sys/ipc.h>
-#elif !defined(__riscos__) && !defined(__OS2__)
+#elif !defined(__riscos__) && !defined(__OS2__) && !defined(__amigaos4__)
 #include <windows.h>
 #include <process.h>
 #include <io.h>
@@ -73,6 +73,15 @@
 using namespace std;
 using namespace gnash;
 
+#ifdef BOOST_NO_EXCEPTIONS
+namespace boost
+{
+	void throw_exception(std::exception const & e)
+	{
+   		std::abort();
+	}
+}
+#endif
 // #error "No supported shared memory type for this platform"
 
 static void usage (void);

=== modified file 'utilities/flvdumper.cpp'
--- utilities/flvdumper.cpp	2009-02-25 22:33:03 +0000
+++ utilities/flvdumper.cpp	2009-04-20 21:28:44 +0000
@@ -29,8 +29,12 @@
 #include <sys/stat.h>
 #if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
 # include <sys/types.h>
+#ifndef __amigaos4__
 # include <arpa/inet.h>
 #else
+# include <netinet/in.h>
+#endif
+#else
 # include <windows.h>
 # include <io.h>
 #endif
@@ -55,6 +59,16 @@
 gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
 }
 
+#ifdef BOOST_NO_EXCEPTIONS
+namespace boost
+{
+	void throw_exception(std::exception const & e)
+	{
+		std::abort();
+	}
+}
+#endif
+
 static void usage ();
 
 static const char *codec_strs[] = {

=== modified file 'utilities/soldumper.cpp'
--- utilities/soldumper.cpp	2009-02-25 22:33:03 +0000
+++ utilities/soldumper.cpp	2009-04-20 21:28:58 +0000
@@ -52,6 +52,16 @@
 gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
 }
 
+#ifdef BOOST_NO_EXCEPTIONS
+namespace boost
+{
+	void throw_exception(std::exception const & e)
+	{
+		std::abort();
+	}
+}
+#endif
+
 const char *SOLDUMPER_VERSION = "0.5";
 static void usage ();
 

