diff -ruN p7zip_9.13-orig/CPP/Windows/System.cpp p7zip_9.13/CPP/Windows/System.cpp
--- p7zip_9.13-orig/CPP/Windows/System.cpp	2009-02-15 04:19:45.043515904 -0500
+++ p7zip_9.13/CPP/Windows/System.cpp	2010-11-29 06:20:22.664272896 -0500
@@ -15,7 +15,7 @@
 #include <sys/sysinfo.h>
 #endif
 
-#if defined(ENV_BEOS)
+#if defined(ENV_BEOS) || defined(ENV_HAIKU)
 #include <be/kernel/OS.h>
 #endif
 
@@ -79,7 +79,7 @@
 			if (nbcpu < 1) nbcpu = 1;
 			return nbcpu;
 		}
-		#elif defined(ENV_BEOS)
+		#elif defined(ENV_BEOS) || defined(ENV_HAIKU)
 		UInt32 GetNumberOfProcessors() {
 			system_info info;
 			get_system_info(&info);
diff -ruN p7zip_9.13-orig/CPP/myWindows/config.h p7zip_9.13/CPP/myWindows/config.h
--- p7zip_9.13-orig/CPP/myWindows/config.h	2009-12-22 13:10:30.037486592 -0500
+++ p7zip_9.13/CPP/myWindows/config.h	2010-11-29 06:20:22.666632192 -0500
@@ -24,7 +24,7 @@
 
   #endif /* !ENV_MACOSX && !ENV_BEOS */
 
-  #if !defined(ENV_BEOS)
+  #if !defined(ENV_BEOS) && !defined(ENV_HAIKU)
   #define HAVE_GETPASS
   #endif
 
diff -ruN p7zip_9.13-orig/install.sh p7zip_9.13/install.sh
--- p7zip_9.13-orig/install.sh	2008-03-02 08:35:05.024379392 -0500
+++ p7zip_9.13/install.sh	2010-11-29 06:20:22.669515776 -0500
@@ -56,10 +56,10 @@
     cp bin/7za "${DEST_DIR}${DEST_SHARE}/7za"
     chmod 777 "${DEST_DIR}${DEST_SHARE}/7za"
     strip     "${DEST_DIR}${DEST_SHARE}/7za"
-    chmod 555 "${DEST_DIR}${DEST_SHARE}/7za"
+    chmod 755 "${DEST_DIR}${DEST_SHARE}/7za"
     echo "#! /bin/sh" > "${DEST_DIR}${DEST_BIN}/7za"
     echo "\"${DEST_SHARE}/7za\" \"\$@\"" >> "${DEST_DIR}${DEST_BIN}/7za"
-    chmod 555 "${DEST_DIR}${DEST_BIN}/7za"
+    chmod 755 "${DEST_DIR}${DEST_BIN}/7za"
   fi
 
   if [ -x bin/7zr ]
@@ -68,10 +68,10 @@
     cp bin/7zr "${DEST_DIR}${DEST_SHARE}/7zr"
     chmod 777 "${DEST_DIR}${DEST_SHARE}/7zr"
     strip     "${DEST_DIR}${DEST_SHARE}/7zr"
-    chmod 555 "${DEST_DIR}${DEST_SHARE}/7zr"
+    chmod 755 "${DEST_DIR}${DEST_SHARE}/7zr"
     echo "#! /bin/sh" > "${DEST_DIR}${DEST_BIN}/7zr"
     echo "\"${DEST_SHARE}/7zr\" \"\$@\"" >> "${DEST_DIR}${DEST_BIN}/7zr"
-    chmod 555 "${DEST_DIR}${DEST_BIN}/7zr"
+    chmod 755 "${DEST_DIR}${DEST_BIN}/7zr"
   fi
 
   if [ -x bin/7zCon.sfx ]
@@ -80,7 +80,7 @@
     cp bin/7zCon.sfx "${DEST_DIR}${DEST_SHARE}/7zCon.sfx"
     chmod 777 "${DEST_DIR}${DEST_SHARE}/7zCon.sfx"
     strip     "${DEST_DIR}${DEST_SHARE}/7zCon.sfx"
-    chmod 555 "${DEST_DIR}${DEST_SHARE}/7zCon.sfx"
+    chmod 755 "${DEST_DIR}${DEST_SHARE}/7zCon.sfx"
   fi
 
   if [ -x bin/7z ]
@@ -89,14 +89,14 @@
     cp bin/7z "${DEST_DIR}${DEST_SHARE}/7z"
     chmod 777 "${DEST_DIR}${DEST_SHARE}/7z"
     strip     "${DEST_DIR}${DEST_SHARE}/7z"
-    chmod 555 "${DEST_DIR}${DEST_SHARE}/7z"
+    chmod 755 "${DEST_DIR}${DEST_SHARE}/7z"
     cp -r bin/Codecs "${DEST_DIR}${DEST_SHARE}/"
-    chmod 555 "${DEST_DIR}${DEST_SHARE}"/*/*
+    chmod 755 "${DEST_DIR}${DEST_SHARE}"/*/*
     cp bin/7z.so "${DEST_DIR}${DEST_SHARE}/7z.so"
-    chmod 555 "${DEST_DIR}${DEST_SHARE}/7z.so"
+    chmod 755 "${DEST_DIR}${DEST_SHARE}/7z.so"
     echo "#! /bin/sh" > "${DEST_DIR}${DEST_BIN}/7z"
     echo "\"${DEST_SHARE}/7z\" \"\$@\"" >> "${DEST_DIR}${DEST_BIN}/7z"
-    chmod 555 "${DEST_DIR}${DEST_BIN}/7z"
+    chmod 755 "${DEST_DIR}${DEST_BIN}/7z"
   fi
 
 else
@@ -105,7 +105,7 @@
     echo "- installing ${DEST_DIR}${DEST_BIN}/7za"
     mkdir -p "${DEST_DIR}${DEST_BIN}"
     cp bin/7za "${DEST_DIR}${DEST_BIN}/7za"
-    chmod 555  "${DEST_DIR}${DEST_BIN}/7za"
+    chmod 755  "${DEST_DIR}${DEST_BIN}/7za"
   fi
 
   if [ -x bin/7zr ]
@@ -113,7 +113,7 @@
     echo "- installing ${DEST_DIR}${DEST_BIN}/7zr"
     mkdir -p "${DEST_DIR}${DEST_BIN}"
     cp bin/7zr "${DEST_DIR}${DEST_BIN}/7zr"
-    chmod 555  "${DEST_DIR}${DEST_BIN}/7zr"
+    chmod 755  "${DEST_DIR}${DEST_BIN}/7zr"
   fi
 fi
 
@@ -122,27 +122,27 @@
 then
    echo "- installing ${DEST_DIR}${DEST_MAN}/man1/7z.1"
    sed -e s?"{DEST_SHARE_DOC}"?"${DEST_SHARE_DOC}/DOCS"?g man1/7z.1 > "${DEST_DIR}${DEST_MAN}/man1/7z.1"
-   chmod 444 "${DEST_DIR}${DEST_MAN}/man1/7z.1"
+   chmod 644 "${DEST_DIR}${DEST_MAN}/man1/7z.1"
 
    echo "- installing ${DEST_DIR}${DEST_MAN}/man1/7za.1"
    sed -e s?"{DEST_SHARE_DOC}"?"${DEST_SHARE_DOC}/DOCS"?g man1/7za.1 > "${DEST_DIR}${DEST_MAN}/man1/7za.1"
-   chmod 444 "${DEST_DIR}${DEST_MAN}/man1/7za.1"
+   chmod 644 "${DEST_DIR}${DEST_MAN}/man1/7za.1"
 
    echo "- installing ${DEST_DIR}${DEST_MAN}/man1/7zr.1"
    sed -e s?"{DEST_SHARE_DOC}"?"${DEST_SHARE_DOC}/DOCS"?g man1/7zr.1 > "${DEST_DIR}${DEST_MAN}/man1/7zr.1"
-   chmod 444 "${DEST_DIR}${DEST_MAN}/man1/7zr.1"
+   chmod 644 "${DEST_DIR}${DEST_MAN}/man1/7zr.1"
 else
    echo "- installing ${DEST_DIR}${DEST_MAN}/man1/7z.1"
    grep -v "{DEST_SHARE_DOC}" man1/7z.1 > "${DEST_DIR}${DEST_MAN}/man1/7z.1"
-   chmod 444 "${DEST_DIR}${DEST_MAN}/man1/7z.1"
+   chmod 644 "${DEST_DIR}${DEST_MAN}/man1/7z.1"
 
    echo "- installing ${DEST_DIR}${DEST_MAN}/man1/7za.1"
    grep -v "{DEST_SHARE_DOC}" man1/7za.1 > "${DEST_DIR}${DEST_MAN}/man1/7za.1"
-   chmod 444 "${DEST_DIR}${DEST_MAN}/man1/7za.1"
+   chmod 644 "${DEST_DIR}${DEST_MAN}/man1/7za.1"
 
    echo "- installing ${DEST_DIR}${DEST_MAN}/man1/7zr.1"
    grep -v "{DEST_SHARE_DOC}" man1/7zr.1 > "${DEST_DIR}${DEST_MAN}/man1/7zr.1"
-   chmod 444 "${DEST_DIR}${DEST_MAN}/man1/7zr.1"
+   chmod 644 "${DEST_DIR}${DEST_MAN}/man1/7zr.1"
 fi
 
 if [ -f README ]
@@ -150,7 +150,7 @@
   echo "- installing ${DEST_DIR}${DEST_SHARE_DOC}/README"
   mkdir -p  "${DEST_DIR}${DEST_SHARE_DOC}"
   cp README "${DEST_DIR}${DEST_SHARE_DOC}/README"
-  chmod 444 "${DEST_DIR}${DEST_SHARE_DOC}/README"
+  chmod 644 "${DEST_DIR}${DEST_SHARE_DOC}/README"
 fi
 
 if [ -f ChangeLog ]
@@ -158,7 +158,7 @@
   echo "- installing ${DEST_DIR}${DEST_SHARE_DOC}/ChangeLog"
   mkdir -p     "${DEST_DIR}${DEST_SHARE_DOC}"
   cp ChangeLog "${DEST_DIR}${DEST_SHARE_DOC}/ChangeLog"
-  chmod 444    "${DEST_DIR}${DEST_SHARE_DOC}/ChangeLog"
+  chmod 644    "${DEST_DIR}${DEST_SHARE_DOC}/ChangeLog"
 fi
 
 if [ -d DOCS ]
@@ -166,7 +166,7 @@
   echo "- installing HTML help in ${DEST_DIR}${DEST_SHARE_DOC}/DOCS"
   mkdir -p "${DEST_DIR}${DEST_SHARE_DOC}"
   cp -r DOCS "${DEST_DIR}${DEST_SHARE_DOC}/DOCS"
-  find "${DEST_DIR}${DEST_SHARE_DOC}/DOCS" -type d -exec chmod 555 {} \;
-  find "${DEST_DIR}${DEST_SHARE_DOC}/DOCS" -type f -exec chmod 444 {} \;
+  find "${DEST_DIR}${DEST_SHARE_DOC}/DOCS" -type d -exec chmod 755 {} \;
+  find "${DEST_DIR}${DEST_SHARE_DOC}/DOCS" -type f -exec chmod 644 {} \;
 fi
 
diff -ruN p7zip_9.13-orig/makefile.haiku p7zip_9.13/makefile.haiku
--- p7zip_9.13-orig/makefile.haiku	1969-12-31 19:00:00.000000000 -0500
+++ p7zip_9.13/makefile.haiku	2010-11-29 06:20:22.672399360 -0500
@@ -0,0 +1,17 @@
+OPTFLAGS=-O
+
+ALLFLAGS=${OPTFLAGS} -s \
+	-DENV_HAIKU \
+	-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
+	-DNDEBUG -D_REENTRANT -DENV_UNIX \
+	$(LOCAL_FLAGS)
+	
+CXX=g++ $(ALLFLAGS)
+CC=gcc $(ALLFLAGS)
+LINK_SHARED=-nostart
+
+LOCAL_LIBS=
+LOCAL_LIBS_DLL=$(LOCAL_LIBS)
+
+OBJ_CRC32=$(OBJ_CRC32_C)
+ 
