$NetBSD: patch-configure,v 1.6 2018/02/08 14:43:07 fhajny Exp $

* Add DragonFly support.
* Link proper postgresql library.
* Avoid using "==" for argument of test(1).

--- configure.orig	2018-01-04 05:35:08.000000000 +0000
+++ configure
@@ -14657,6 +14657,8 @@ case $host in
 	use_threads=false ;;
 *-freebsd*)
 	use_threads=true ;;
+*-dragonfly*)
+	use_threads=false ;;
 *-bsdi[234]*)
 	# Thread signals do not work reliably on some versions of BSD/OS.
 	use_threads=false ;;
@@ -16956,27 +16958,10 @@ case "$use_libjson" in
 		libjson_libs=""
 		;;
 	auto|yes)
-		for d in /usr /usr/local /opt/local
-		do
-			if test -f "${d}/include/json/json.h"
-			then
-				if test ${d} != /usr
-				then
-					libjson_cflags="-I ${d}/include"
-					LIBS="$LIBS -L${d}/lib"
-				fi
-				have_libjson="yes"
-			elif test -f "${d}/include/json-c/json.h"
-			then
-				if test ${d} != /usr
-				then
-					libjson_cflags="-I ${d}/include"
-					LIBS="$LIBS -L${d}/lib"
-				fi
-				have_libjson="yes"
-				have_libjson_c="yes"
-			fi
-		done
+		libjson_cflags="`pkg-config --cflags json-c`"
+		LIBS="$LIBS `pkg-config --libs json-c`"
+		have_libjson="yes"
+		have_libjson_c="yes"
 		;;
 	*)
 		if test -f "${use_libjson}/include/json/json.h"
@@ -21861,7 +21846,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
 
 
