Index: mcs/jay/Makefile
--- mcs/jay/Makefile.orig	2009-09-25 16:58:21 +0200
+++ mcs/jay/Makefile	2009-12-16 19:57:37 +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	2009-12-14 23:36:37 +0100
+++ mono/Makefile.in	2009-12-16 19:58:31 +0100
@@ -252,7 +252,7 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = utils io-layer cil metadata \
-      arch interpreter mini dis monograph tests benchmark profiler
+      arch interpreter mini dis monograph benchmark profiler
 
 all: all-recursive
 
Index: mono/mini/mini-x86.c
--- mono/mini/mini-x86.c.orig	2009-11-13 19:23:07 +0100
+++ mono/mini/mini-x86.c	2009-12-16 19:57:37 +0100
@@ -486,6 +486,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	2009-09-25 16:58:11 +0200
+++ mono/utils/mono-codeman.c	2009-12-16 19:57:37 +0100
@@ -44,7 +44,7 @@
 #define MAX_WASTAGE 32
 #define MIN_BSIZE 32
 
-#ifdef __x86_64__
+#if defined(__x86_64__) && !defined(__FreeBSD__)
 #define ARCH_MAP_FLAGS MONO_MMAP_32BIT
 #else
 #define ARCH_MAP_FLAGS 0
Index: mono/utils/mono-proclib.c
--- mono/utils/mono-proclib.c.orig	2009-10-31 05:22:03 +0100
+++ mono/utils/mono-proclib.c	2009-12-16 19:57:37 +0100
@@ -16,6 +16,7 @@
 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
 #include <sys/types.h>
 #include <sys/sysctl.h>
+#include <sys/param.h>
 #include <sys/proc.h>
 #ifdef HAVE_SYS_USER_H
 #include <sys/user.h>
Index: support/stdio.c
--- support/stdio.c.orig	2009-09-25 16:58:14 +0200
+++ support/stdio.c	2009-12-16 19:57:37 +0100
@@ -146,13 +146,13 @@
 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)
 {
-	setbuf (stream, buf);
+	setbuf ((FILE *)stream, buf);
 	return 0;
 }
 
@@ -161,13 +161,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*
@@ -180,20 +180,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)
 {
 	do {
-		rewind (stream);
+		rewind ((FILE *)stream);
 	} while (errno == EINTR);
 	mph_return_if_val_in_list5(errno, EAGAIN, EBADF, EFBIG, EINVAL, EIO);
 	mph_return_if_val_in_list5(errno, ENOSPC, ENXIO, EOVERFLOW, EPIPE, ESPIPE);
