$OpenBSD: patch-configure,v 1.20 2012/07/05 07:19:48 ajacoutot Exp $
--- configure.orig	Wed Jun 27 18:49:58 2012
+++ configure	Thu Jul  5 07:47:00 2012
@@ -19039,7 +19039,8 @@ fi
 done
 
 
-ac_fn_c_check_decl "$LINENO" "MSG_NOSIGNAL" "ac_cv_have_decl_MSG_NOSIGNAL" " #include <sys/socket.h>
+ac_fn_c_check_decl "$LINENO" "MSG_NOSIGNAL" "ac_cv_have_decl_MSG_NOSIGNAL" " #include <sys/types.h> 
+#include <sys/socket.h>
 "
 if test "x$ac_cv_have_decl_MSG_NOSIGNAL" = xyes; then :
   ac_have_decl=1
@@ -19594,13 +19595,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.  */
 
@@ -19631,7 +19632,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
@@ -19699,7 +19700,7 @@ $as_echo "$ac_cv_search_clock_getres" >&6; }
 ac_res=$ac_cv_search_clock_getres
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  THREAD_LIBS="$THREAD_LIBS -lrt"
+  THREAD_LIBS="$THREAD_LIBS"
 fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLOCK_MONOTONIC" >&5
@@ -19848,13 +19849,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.  */
 
@@ -19885,7 +19886,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
@@ -20418,6 +20419,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;
