diff -Nur freenet.orig/contrib/fec/common/src/com/onionnetworks/util/NativeDeployer.java freenet.mips/contrib/fec/common/src/com/onionnetworks/util/NativeDeployer.java
--- freenet.orig/contrib/fec/common/src/com/onionnetworks/util/NativeDeployer.java	2008-03-29 21:35:53.000000000 +0100
+++ freenet.mips/contrib/fec/common/src/com/onionnetworks/util/NativeDeployer.java	2008-03-29 21:45:27.000000000 +0100
@@ -3,6 +3,7 @@
 import java.io.*;
 import java.util.*;
 import java.net.URL;
+import java.nio.ByteOrder;
 
 /**
  * This class is used for deploying native libraries that are stored inside
@@ -55,6 +56,14 @@
 			OS_ARCH=OS+"-x86_64";
 		else if(System.getProperty("os.arch").toLowerCase().indexOf("86") != -1)
 			OS_ARCH=OS+"-x86";
+		else if(System.getProperty("os.arch").toLowerCase().matches("(mips)")) {
+			ByteOrder b = ByteOrder.nativeOrder();
+			if (b.equals(ByteOrder.BIG_ENDIAN)) {
+				OS_ARCH=OS+"-mips";
+			} else {
+				OS_ARCH=OS+"-mipsel";
+			}
+		}
 		else
 			OS_ARCH=OS+"-"+System.getProperty("os.arch").toLowerCase();
 	}
diff -Nur freenet.orig/contrib/fec/lib/native.properties freenet.mips/contrib/fec/lib/native.properties
--- freenet.orig/contrib/fec/lib/native.properties	2008-03-29 21:35:49.000000000 +0100
+++ freenet.mips/contrib/fec/lib/native.properties	2008-03-29 21:40:07.000000000 +0100
@@ -1,4 +1,4 @@
-com.onionnetworks.native.keys=fec8-linux-x86,fec16-linux-x86,fec8-linux-x86_64,fec16-linux-x86_64,fec8-win32-x86,fec16-win32-x86
+com.onionnetworks.native.keys=fec8-linux-x86,fec16-linux-x86,fec8-linux-x86_64,fec16-linux-x86_64,fec8-win32-x86,fec16-win32-x86,fec8-linux-mips,fec16-linux-mips,fec8-linux-mipsel,fec16-linux-mipsel
 
 com.onionnetworks.native.fec8-linux-x86.name=fec8
 com.onionnetworks.native.fec8-linux-x86.osarch=linux-x86
@@ -23,3 +23,19 @@
 com.onionnetworks.native.fec16-win32-x86.name=fec16
 com.onionnetworks.native.fec16-win32-x86.osarch=win32-x86
 com.onionnetworks.native.fec16-win32-x86.path=lib/win32-x86/fec16.dll
+
+com.onionnetworks.native.fec8-linux-mips.name=fec8
+com.onionnetworks.native.fec8-linux-mips.osarch=linux-mips
+com.onionnetworks.native.fec8-linux-mips.path=lib/linux/mips/libfec8.so
+
+com.onionnetworks.native.fec16-linux-mips.name=fec16
+com.onionnetworks.native.fec16-linux-mips.osarch=linux-mips
+com.onionnetworks.native.fec16-linux-mips.path=lib/linux/mips/libfec16.so
+
+com.onionnetworks.native.fec8-linux-mipsel.name=fec8
+com.onionnetworks.native.fec8-linux-mipsel.osarch=linux-mipsel
+com.onionnetworks.native.fec8-linux-mipsel.path=lib/linux/mipsel/libfec8.so
+
+com.onionnetworks.native.fec16-linux-mipsel.name=fec16
+com.onionnetworks.native.fec16-linux-mipsel.osarch=linux-mipsel
+com.onionnetworks.native.fec16-linux-mipsel.path=lib/linux/mipsel/libfec16.so
diff -Nur freenet.orig/contrib/wrapper/src/c/Makefile-linux-mips-32.make freenet.mips/contrib/wrapper/src/c/Makefile-linux-mips-32.make
--- freenet.orig/contrib/wrapper/src/c/Makefile-linux-mips-32.make	1970-01-01 01:00:00.000000000 +0100
+++ freenet.mips/contrib/wrapper/src/c/Makefile-linux-mips-32.make	2008-03-29 21:40:07.000000000 +0100
@@ -0,0 +1,50 @@
+# Copyright (c) 1999, 2008 Tanuki Software, Inc.
+# http://www.tanukisoftware.com
+# All rights reserved.
+#
+# This software is the confidential and proprietary information
+# of Tanuki Software.  ("Confidential Information").  You shall
+# not disclose such Confidential Information and shall use it
+# only in accordance with the terms of the license agreement you
+# entered into with Tanuki Software.
+
+GCCARCH = $(shell gcc -dumpmachine)
+COMPILE = gcc -O3 -fPIC --pedantic -D_FILE_OFFSET_BITS=64
+
+INCLUDE=$(JAVA_HOME)/include
+
+DEFS = -I$(INCLUDE) -I$(INCLUDE)/linux
+
+wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c
+
+libwrapper_so_OBJECTS = wrapperjni_unix.o wrapperinfo.o wrapperjni.o
+
+BIN = ../../bin
+LIB = ../../lib
+
+all: init wrapper-$(GCCARCH) libwrapper-$(GCCARCH).so
+
+clean:
+	rm -f *.o
+
+cleanall: clean
+	rm -rf *~ .deps
+	rm -f $(BIN)/wrapper $(LIB)/libwrapper.so
+
+init:
+	if test ! -d .deps; then mkdir .deps; fi
+
+wrapper-$(GCCARCH): $(wrapper_SOURCE)
+	$(COMPILE) -pthread -lm $(wrapper_SOURCE) -o $(BIN)/wrapper-$(GCCARCH)
+
+libwrapper-$(GCCARCH).so: $(libwrapper_so_OBJECTS)
+	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper-$(GCCARCH).so
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) $(DEFS) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	>> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
diff -Nur freenet.orig/contrib/wrapper/src/java/org/tanukisoftware/wrapper/WrapperManager.java freenet.mips/contrib/wrapper/src/java/org/tanukisoftware/wrapper/WrapperManager.java
--- freenet.orig/contrib/wrapper/src/java/org/tanukisoftware/wrapper/WrapperManager.java	2008-03-29 21:36:44.000000000 +0100
+++ freenet.mips/contrib/wrapper/src/java/org/tanukisoftware/wrapper/WrapperManager.java	2008-03-29 21:40:07.000000000 +0100
@@ -37,6 +37,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.nio.ByteOrder;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -1094,6 +1095,13 @@
             {
                 arch = "parisc";
             }
+            else if ( arch.equals( "mips" ) )
+            {
+                ByteOrder b = ByteOrder.nativeOrder();
+                if (b.equals(ByteOrder.LITTLE_ENDIAN)) {
+                    arch = "mipsel";
+                }
+            }
         }
         
         return baseName + "-" + os + "-" + arch + "-" + jvmBits;
diff -Nur freenet.orig/freenet/src/freenet/support/LibraryLoader.java freenet.mips/freenet/src/freenet/support/LibraryLoader.java
--- freenet.orig/freenet/src/freenet/support/LibraryLoader.java	2008-03-29 21:39:28.000000000 +0100
+++ freenet.mips/freenet/src/freenet/support/LibraryLoader.java	2008-03-29 21:40:07.000000000 +0100
@@ -7,6 +7,7 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.InputStream;
+import java.nio.ByteOrder;
 import java.net.URL;
 
 /**
@@ -24,6 +25,13 @@
 			arch = "amd64";
 		} else if(System.getProperty("os.arch").toLowerCase().matches("(ppc)")) {
 			arch = "ppc";
+		} else if(System.getProperty("os.arch").toLowerCase().matches("(mips)")) {
+			ByteOrder b = ByteOrder.nativeOrder();
+			if (b.equals(ByteOrder.BIG_ENDIAN)) {
+				arch = "mips";
+			} else {
+				arch = "mipsel";
+			}
 		} else {
 			arch = "i386";
 		}
diff -Nur freenet.orig/freenet/src/net/i2p/util/NativeBigInteger.java freenet.mips/freenet/src/net/i2p/util/NativeBigInteger.java
--- freenet.orig/freenet/src/net/i2p/util/NativeBigInteger.java	2008-03-29 21:38:56.000000000 +0100
+++ freenet.mips/freenet/src/net/i2p/util/NativeBigInteger.java	2008-03-29 21:40:07.000000000 +0100
@@ -18,6 +18,7 @@
 import java.io.IOException;
 import java.io.FileNotFoundException;
 import java.io.File;
+import java.nio.ByteOrder;
 
 import freenet.support.HexUtil;
 import freenet.support.Logger;
@@ -118,6 +119,8 @@
 	private final static String JBIGI_OPTIMIZATION_PENTIUM3 = "pentium3";
 	private final static String JBIGI_OPTIMIZATION_PENTIUM4 = "pentium4";
 	private final static String JBIGI_OPTIMIZATION_PPC = "ppc";
+	private final static String JBIGI_OPTIMIZATION_MIPS = "mips";
+	private final static String JBIGI_OPTIMIZATION_MIPSEL = "mipsel";
 	private final static String sCPUType; //The CPU Type to optimize for (one of the above strings)
 	private static final long serialVersionUID = 0xc5392a97bb283dd2L;
 
@@ -136,6 +139,16 @@
 			else if(System.getProperty("os.arch").toLowerCase().matches("(ppc)")) {
 				System.out.println("Detected PowerPC!");
 				return JBIGI_OPTIMIZATION_PPC;
+			}
+			else if(System.getProperty("os.arch").toLowerCase().matches("(mips)")) {
+				ByteOrder b = ByteOrder.nativeOrder();
+				if (b.equals(ByteOrder.BIG_ENDIAN)) {
+					System.out.println("Detected MIPS Big-endian CPU!");
+					return JBIGI_OPTIMIZATION_MIPS;
+				} else {
+					System.out.println("Detected MIPS Little-endian CPU!");
+					return JBIGI_OPTIMIZATION_MIPSEL;
+				}
 			} else {
 				CPUInfo c = CPUID.getInfo();
 				if(c instanceof AMDCPUInfo) {
