diff -r d7c37c5d2509 stdext/Makefile
--- a/stdext/Makefile	Mon Nov 02 20:27:08 2009 -0700
+++ b/stdext/Makefile	Wed Nov 04 19:06:44 2009 +0000
@@ -1,6 +1,6 @@
 IPROG=install -m 755 -o root -g root
 CC = gcc
-CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
+CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml -I$(shell ocamlc -where)
 OCAMLC = ocamlc -g
 OCAMLOPT = ocamlopt
 
diff -r d7c37c5d2509 stdext/sigutil_stub.c
--- a/stdext/sigutil_stub.c	Mon Nov 02 20:27:08 2009 -0700
+++ b/stdext/sigutil_stub.c	Wed Nov 04 19:06:44 2009 +0000
@@ -19,6 +19,7 @@
 
 static void fpe_handler(int signum, siginfo_t *info, void *ptr)
 {
+#ifndef __APPLE__
 	FILE *file;
 	if (signum != SIGFPE || info == NULL)
 		return;
@@ -39,10 +40,12 @@
 	fclose(file);
 
 	kill(0, SIGFPE);
+#endif
 }
 
 static void segv_handler(int signum, siginfo_t *info, void *ptr)
 {
+#ifndef __APPLE__
 	FILE *file;
 	if (signum != SIGSEGV || info == NULL)
 		return;
@@ -61,7 +64,7 @@
 	fprintf(file, "si_addr: %lx\n", (unsigned long) info->si_addr);
 	fprintf(file, "uarg: %lx\n", (unsigned long) ptr);
 	fclose(file);
-
+#endif
 	kill(0, SIGSEGV);
 }
 
diff -r d7c37c5d2509 stdext/unixext_stubs.c
--- a/stdext/unixext_stubs.c	Mon Nov 02 20:27:08 2009 -0700
+++ b/stdext/unixext_stubs.c	Wed Nov 04 19:06:44 2009 +0000
@@ -67,10 +67,15 @@
 	CAMLreturn(Val_int(maxfd));
 }
 
+#ifndef __APPLE__
 #include <sys/vfs.h>
+#endif
 
 CAMLprim value stub_unixext_statfs(value path)
 {
+#ifdef __APPLE__
+	caml_failwith("stub_unixext_statfs: not implemented on MacOS X");
+#else
 	CAMLparam1(path);
 	CAMLlocal1(statinfo);
 	struct statfs info;
@@ -89,6 +94,7 @@
 	Store_field(statinfo, 7, Val_int(info.f_namelen));
 
 	CAMLreturn(statinfo);
+#endif
 }
 
 #define FDSET_OF_VALUE(v) (&(((struct fdset_t *) v)->fds))
