$OpenBSD: patch-configure_in,v 1.5 2010/09/16 22:36:08 fgsch Exp $
--- configure.in.orig	Tue May 25 03:27:03 2010
+++ configure.in	Mon Aug 30 13:55:47 2010
@@ -1831,27 +1831,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"
@@ -2003,9 +1989,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
