$OpenBSD: patch-configure_in,v 1.4 2010/07/23 13:56:26 sthen Exp $
--- configure.in.orig	Tue Mar  9 21:47:28 2010
+++ configure.in	Thu Jun 17 13:04:44 2010
@@ -1815,27 +1815,13 @@ then
 		;;
 	Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
 	BSD/OS*/4*) LDSHARED="gcc -shared";;
-	FreeBSD*)
+	FreeBSD*|OpenBSD*)
 		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
 		then
 			LDSHARED="$CC -shared ${LDFLAGS}"
 		else
 			LDSHARED="ld -Bshareable ${LDFLAGS}"
 		fi;;
-	OpenBSD*)
-		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
-		then
-				LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
-		else
-				case `uname -r` in
-				[[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
-				   LDSHARED="ld -Bshareable ${LDFLAGS}"
-				   ;;
-				*)
-				   LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
-				   ;;
-				esac
-		fi;;
 	NetBSD*|DragonFly*) LDSHARED="cc -shared ${LDFLAGS}";;
 	OpenUNIX*|UnixWare*)
 		if test "$GCC" = "yes"
@@ -1987,9 +1973,10 @@ AC_CHECK_LIB(dld, shl_load)	# Dynamic linking for HP-U
 
 # only check for sem_init 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
