Index: libgomp/config/posix/proc.c
===================================================================
--- libgomp/config/posix/proc.c	(revision 132391)
+++ libgomp/config/posix/proc.c	(working copy)
@@ -33,6 +33,16 @@
 
 #include "libgomp.h"
 #include <unistd.h>
+
+/* OSX 10.5 has _SC_NPROCESSORS_ONLN, but 10.4 didn't, so define it manually
+   here (sysconf() call will fail at runtime on 10.5, but we'll be able to
+   ship the same binary for both versions): */
+#ifdef __APPLE__
+# ifndef _SC_NPROCESSORS_ONLN
+#  define _SC_NPROCESSORS_ONLN  58
+# endif
+#endif
+
 #include <stdlib.h>
 #ifdef HAVE_GETLOADAVG
 # ifdef HAVE_SYS_LOADAVG_H
