$OpenBSD: patch-configure_in,v 1.11 2007/01/10 16:57:56 steven Exp $
--- configure.in.orig	Tue Jan 11 14:49:00 2005
+++ configure.in	Sat Oct 21 19:57:24 2006
@@ -140,7 +140,7 @@ case $ac_sys_system/$ac_sys_release in
   # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
   # even though select is a POSIX function. Reported by J. Ribbens.
   # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
-  OpenBSD/2.* | OpenBSD/3.@<:@01234@:>@) 
+  OpenBSD*)
     define_xopen_source=no;;
   # On Solaris 2.6, sys/wait.h is inconsistent in the usage
   # of union __?sigval. Reported by Stuart Bishop.
@@ -1321,14 +1321,17 @@ then
 	Linux*|GNU*) LDSHARED='$(CC) -shared';;
 	dgux*) LDSHARED="ld -G";;
 	BSD/OS*/4*) LDSHARED="gcc -shared";;
-	OpenBSD*|FreeBSD*)
+	FreeBSD*)
 		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
 		then
 			LDSHARED="cc -shared ${LDFLAGS}"
 		else
 			LDSHARED="ld -Bshareable ${LDFLAGS}"
 		fi;;
-	NetBSD*) LDSHARED="cc -shared ${LDFLAGS}";;
+	OpenBSD*)
+		LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
+		;;
+	NetBSD*) LDSHARED="${CC} -shared ${LDFLAGS}";;
 	OpenUNIX*|UnixWare*)
 		if test "$GCC" = "yes"
 		then LDSHARED='$(CC) -shared'
@@ -1465,9 +1468,10 @@ AC_CHECK_LIB(dld, shl_load)	# Dynamic li
 
 # only check for sem_ini if thread support is requested
 if test "$with_threads" = "yes" -o -z "$with_threads"; then
-    AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
+#    AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
 						# posix4 on Solaris 2.6
 						# pthread (first!) on Linux
+    LIBS="-pthread ${LIBS}"
 fi
 
 # check if we need libintl for locale functions
