$NetBSD: patch-ad,v 1.3 2009/11/25 22:15:25 joerg Exp $

--- configure.orig	2009-03-13 06:35:43.000000000 +0100
+++ configure
@@ -23751,6 +23751,8 @@ case $host in
 	use_threads=false ;;
 *-freebsd*)
 	use_threads=false ;;
+*-dragonfly*)
+	use_threads=false ;;
 *-bsdi234*)
 	# Thread signals do not work reliably on some versions of BSD/OS.
 	use_threads=false ;;
@@ -23839,7 +23841,7 @@ $as_echo "$as_me: WARNING: linking with 
 $as_echo "native" >&6; }
 				LIBS="-lpthread $LIBS"
 			else
-				if test ! -d $LOCALBASE/pthreads
+				if test ! -d $LOCALBASE/pthreads -a ! -f /usr/include/pthread.h
 				then
 					{ $as_echo "$as_me:$LINENO: result: none" >&5
 $as_echo "none" >&6; }
@@ -23850,14 +23852,23 @@ $as_echo "$as_me: error: \"could not fin
 
 				if $use_threads
 				then
-					{ $as_echo "$as_me:$LINENO: result: mit-pthreads/unproven-pthreads" >&5
+					if test -f /usr/include/pthread.h
+					then
+						{ $as_echo "$as_me:$LINENO: result: native pthreads" >&5
+$as_echo "native pthreads" >&6; }
+						LIBS="-lpthread $LIBS"
+						CPPFLAGS="$CPPFLAGS -I/usr/include"
+						STD_CINDLUES="$STD_CINDLUES -I/usr/include"
+					else
+						{ $as_echo "$as_me:$LINENO: result: mit-pthreads/unproven-pthreads" >&5
 $as_echo "mit-pthreads/unproven-pthreads" >&6; }
-					pkg="$LOCALBASE/pthreads"
-					lib1="-L$pkg/lib -Wl,-R$pkg/lib"
-					lib2="-lpthread -lm -lgcc -lpthread"
-					LIBS="$lib1 $lib2 $LIBS"
-					CPPFLAGS="$CPPFLAGS -I$pkg/include"
-					STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
+						pkg="$LOCALBASE/pthreads"
+						lib1="-L$pkg/lib -Wl,-R$pkg/lib"
+						lib2="-lpthread -lm -lgcc -lpthread"
+						LIBS="$lib1 $lib2 $LIBS"
+						CPPFLAGS="$CPPFLAGS -I$pkg/include"
+						STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
+					fi
 				fi
 			fi
 		fi
@@ -26386,9 +26397,9 @@ case $use_libtool in
 		O=lo
 		A=la
 		LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
-		LIBTOOL_MODE_COMPILE='--mode=compile'
+		LIBTOOL_MODE_COMPILE='--mode=compile --tag=CC'
 		LIBTOOL_MODE_INSTALL='--mode=install'
-		LIBTOOL_MODE_LINK='--mode=link'
+		LIBTOOL_MODE_LINK='--mode=link --tag=CC'
 		case "$host" in
 		*) LIBTOOL_ALLOW_UNDEFINED= ;;
 		esac
@@ -32836,7 +32847,7 @@ $as_echo "no" >&6; }
 	fi
 	if test -n "-L$use_dlz_postgres_lib -lpq"
 	then
-		DLZ_DRIVER_LIBS="$DLZ_DRIVER_LIBS -L$use_dlz_postgres_lib -lpq"
+		DLZ_DRIVER_LIBS="$DLZ_DRIVER_LIBS -L${PREFIX}/lib -lpq"
 	fi
 
 
