Index: mcs/jay/Makefile
--- mcs/jay/Makefile.orig	2006-11-10 08:13:27 +0100
+++ mcs/jay/Makefile	2006-11-10 08:23:02 +0100
@@ -2,7 +2,7 @@
 SUBDIRS := 
 include ../build/rules.make
 
-LOCAL_CFLAGS = -DSKEL_DIRECTORY=\""$(prefix)/share/jay"\"
+LOCAL_CFLAGS = -DSKEL_DIRECTORY=\""$(prefix)/share/mono/jay"\"
 
 sources = closure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c \
           symtab.c verbose.c warshall.c
@@ -20,13 +20,13 @@
 ifndef NO_INSTALL
 install-local:
 	$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
-	$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/share/jay
-	$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/share/man/man1
+	$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/share/mono/jay
+	$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/man/man1
 	$(INSTALL_BIN) jay $(DESTDIR)$(prefix)/bin
 	for datafile in $(datafiles) ; do \
-	   $(INSTALL_DATA) $$datafile $(DESTDIR)$(prefix)/share/jay ; \
+	   $(INSTALL_DATA) $$datafile $(DESTDIR)$(prefix)/share/mono/jay ; \
 	done
-	$(INSTALL_DATA) jay.1 $(DESTDIR)$(prefix)/share/man/man1
+	$(INSTALL_DATA) jay.1 $(DESTDIR)$(prefix)/man/man1
 
 uninstall-local:
 	-rm -f $(DESTDIR)$(prefix)/bin/jay
Index: mono/Makefile.in
--- mono/Makefile.in.orig	2006-11-02 19:15:52 +0100
+++ mono/Makefile.in	2006-11-10 08:02:45 +0100
@@ -264,7 +264,7 @@
 target_os = @target_os@
 target_vendor = @target_vendor@
 SUBDIRS = utils io-layer monoburg os cil metadata \
-      arch interpreter mini dis monograph tests benchmark profiler
+      arch interpreter mini dis monograph benchmark profiler
 
 all: all-recursive
 
Index: mono/mini/aot-runtime.c
--- mono/mini/aot-runtime.c.orig	2006-11-02 19:09:51 +0100
+++ mono/mini/aot-runtime.c	2006-11-10 08:02:45 +0100
@@ -10,6 +10,7 @@
 
 #include "config.h"
 #include <sys/types.h>
+#include <sys/wait.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
Index: mono/mini/mini-x86.c
--- mono/mini/mini-x86.c.orig	2006-11-02 19:09:51 +0100
+++ mono/mini/mini-x86.c	2006-11-10 08:02:45 +0100
@@ -418,6 +418,34 @@
 	return cinfo;
 }
 
+#ifndef signbit
+union IEEEd2bits {
+    double d;
+    struct {
+#if _BYTE_ORDER == G_LITTLE_ENDIAN
+	unsigned int    manl    :32;
+	unsigned int    manh    :20;
+	unsigned int    exp     :11;
+	unsigned int    sign    :1;
+#else
+	unsigned int    sign    :1;
+	unsigned int    exp     :11;
+	unsigned int    manh    :20;
+	unsigned int    manl    :32;
+#endif
+    } bits;
+};
+
+int
+signbit(double d)
+{
+    union IEEEd2bits u;
+
+    u.d = d;
+    return (u.bits.sign);
+}
+
+#endif /* signbit */
 /*
  * mono_arch_get_argument_info:
  * @csig:  a method signature
Index: mono/utils/mono-codeman.c
--- mono/utils/mono-codeman.c.orig	2006-10-12 02:10:22 +0200
+++ mono/utils/mono-codeman.c	2006-11-10 08:02:45 +0100
@@ -45,7 +45,7 @@
 #endif
 #endif
 
-#ifdef __x86_64__
+#if defined(__x86_64__) && !defined(__FreeBSD__)
 #define ARCH_MAP_FLAGS MAP_32BIT
 #else
 #define ARCH_MAP_FLAGS 0
Index: support/stdio.c
--- support/stdio.c.orig	2006-11-02 19:09:53 +0100
+++ support/stdio.c	2006-11-10 08:02:45 +0100
@@ -142,14 +142,14 @@
 Mono_Posix_Stdlib_setvbuf (void* stream, void *buf, int mode, mph_size_t size)
 {
 	mph_return_if_size_t_overflow (size);
-	return setvbuf (stream, (char *) buf, mode, (size_t) size);
+	return setvbuf ((FILE *)stream, (char *) buf, mode, (size_t) size);
 }
 
 int 
 Mono_Posix_Stdlib_setbuf (void* stream, void* buf)
 {
 	errno = 0;
-	setbuf (stream, buf);
+	setbuf ((FILE *)stream, buf);
 	return errno == 0 ? 0 : -1;
 }
 
@@ -158,13 +158,13 @@
 {
 	mph_return_if_long_overflow (offset);
 
-	return fseek (stream, offset, origin);
+	return fseek ((FILE *)stream, offset, origin);
 }
 
 gint64
 Mono_Posix_Stdlib_ftell (void* stream)
 {
-	return ftell (stream);
+	return ftell ((FILE *)stream);
 }
 
 void*
@@ -177,20 +177,20 @@
 gint32
 Mono_Posix_Stdlib_fgetpos (void* stream, void *pos)
 {
-	return fgetpos (stream, (fpos_t*) pos);
+	return fgetpos ((FILE *)stream, (fpos_t*) pos);
 }
 
 gint32
 Mono_Posix_Stdlib_fsetpos (void* stream, void *pos)
 {
-	return fsetpos (stream, (fpos_t*) pos);
+	return fsetpos ((FILE *)stream, (fpos_t*) pos);
 }
 
 int
 Mono_Posix_Stdlib_rewind (void* stream)
 {
 	errno = 0;
-	rewind (stream);
+	rewind ((FILE *)stream);
 	return errno == 0 ? 0 : -1;
 }
 
