$OpenBSD: patch-configure,v 1.15 2011/06/15 16:26:07 ajacoutot Exp $
--- configure.orig	Fri Jun 10 22:57:26 2011
+++ configure	Wed Jun 15 18:17:02 2011
@@ -18883,13 +18883,13 @@ fi
 # Thread lib detection
 ac_fn_c_check_func "$LINENO" "pthread_cond_timedwait" "ac_cv_func_pthread_cond_timedwait"
 if test "x$ac_cv_func_pthread_cond_timedwait" = xyes; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_timedwait in -lpthread" >&5
-$as_echo_n "checking for pthread_cond_timedwait in -lpthread... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_timedwait in -pthread" >&5
+$as_echo_n "checking for pthread_cond_timedwait in -pthread... " >&6; }
 if ${ac_cv_lib_pthread_pthread_cond_timedwait+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="-pthread  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -18920,7 +18920,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_timedwait" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_cond_timedwait" >&6; }
 if test "x$ac_cv_lib_pthread_pthread_cond_timedwait" = xyes; then :
-  THREAD_LIBS="-lpthread"
+  THREAD_LIBS="-pthread"
 fi
 
 fi
@@ -19135,13 +19135,13 @@ if test x$have_selinux = xyes ; then
 if test "x$ac_cv_func_pthread_create" = xyes; then :
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -pthread" >&5
+$as_echo_n "checking for pthread_create in -pthread... " >&6; }
 if ${ac_cv_lib_pthread_pthread_create+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="-pthread  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -19172,7 +19172,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
 if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
-  SELINUX_THREAD_LIBS="-lpthread"
+  SELINUX_THREAD_LIBS="-pthread"
 fi
 
 fi
@@ -19562,6 +19562,7 @@ $as_echo_n "checking for SCM_RIGHTS... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 static int x = SCM_RIGHTS;
