$OpenBSD$
--- src/boehm-gc/configure.in.orig	Mon Feb 13 18:14:20 2006
+++ src/boehm-gc/configure.in	Sun Apr 23 18:14:48 2006
@@ -115,6 +115,28 @@ case "$THREADS" in
 	INCLUDES="$INCLUDES -pthread"
 	THREADDLLIBS=-pthread
       	;;
+     *-*-openbsd*)
+	AC_DEFINE(GC_OPENBSD_PTHREADS, 1, [gc openbsd threads])
+	dnl AC_DEFINE(USE_PTHREAD_SPECIFIC, 1, [use pthread specific])
+	dnl openbsd_pthreads.c uses the sources libpthread and libc for accessing pthread_t
+	srclib=/usr/src/lib
+	libpthread=${srclib}/libpthread
+	libc=${srclib}/libc
+	if test ! -d "${libpthread}/uthread"; then
+		AC_MSG_ERROR("OpenBSD pthreads source directory'${libpthread}/uthread' not found.")
+	fi
+	if test ! -d "${libpthread}/arch/${host_cpu}"; then
+		AC_MSG_ERROR("OpenBSD pthreads source directory'${libpthread}/arch/${host_cpu}' not found.")
+	fi
+	if test ! -d "${libc}"; then
+		AC_MSG_ERROR("OpenBSD libc source directory '${libc}/include' not found.")
+	fi
+	INCLUDES="$INCLUDES -pthread"
+	INCLUDES="$INCLUDES -I${libpthread}/uthread -I${libpthread}/arch/${host_cpu}"
+	INCLUDES="$INCLUDES -I${libpthread}/arch/${host_cpu}"
+	INCLUDES="$INCLUDES -I${srclib}/libc/include"
+	THREADDLLIBS=-pthread
+      	;;
      *-*-solaris*)
 	AC_DEFINE([GC_SOLARIS_THREADS], 1, [gc solaris threads])
 	AC_DEFINE([GC_SOLARIS_PTHREADS], 1, [gc solaris pthreads])
