$OpenBSD: patch-configure_ac,v 1.2 2010/11/09 13:26:31 jasper Exp $
--- configure.ac.orig	Wed Apr  7 18:38:51 2010
+++ configure.ac	Sun Nov  7 13:02:11 2010
@@ -342,8 +342,13 @@ AC_CHECK_HEADERS([langinfo.h locale.h],[],[AC_MSG_WARN
 AC_CHECK_HEADERS([sys/utsname.h])
 
 AC_CHECK_HEADERS([sched.h ctype.h],[],[])
+
+
+LDFLAGS_SAVE=$LDFLAGS
+LDFLAGS=-pthread
 AC_CHECK_FUNCS([sched_getparam sched_setparam sched_get_priority_min sched_get_priority_max],[],[])
-   
+LDFLAGS=$LDFLAGS_SAVE
+
 AC_CHECK_FUNCS([mkdir], [],
               [AC_MSG_ERROR(required function not found)])
 
@@ -692,6 +697,8 @@ if test $DARWIN_OS -eq 1 ; then
         AC_MSG_NOTICE([You are running OSX, assuming threadsafe gethostbyname version])
 elif test $CYGWIN_OS -eq 1; then
         AC_MSG_NOTICE([Your are building under Cygwin, assuming threadsafe gethostbyname implementation])
+elif test $OPENBSD_OS -eq 1; then
+        AC_MSG_NOTICE([Your are building under OpenBSD, assuming threadsafe gethostbyname implementation])
 fi
 
 AC_CHECK_FUNCS([gethostbyname_r],[],
@@ -758,7 +765,7 @@ if test "x$PTHREAD_LIB_OPTION_ENABLED" = xyes; then
 else
     ACX_PTHREAD(,AC_MSG_ERROR(POSIX threads missing))
 
-    if test $FREEBSD_OS -eq 1; then
+    if ((test $FREEBSD_OS -eq 1) || (test $OPENBSD_OS -eq 1)); then
         ADD_PTHREAD_CFLAGS="$PTHREAD_CFLAGS $PTHREAD_LIBS"
     fi
 
