$NetBSD: patch-configure,v 1.3.2.1 2013/03/30 17:52:50 tron Exp $

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

--- configure.orig	2013-03-06 16:56:08.000000000 +0000
+++ configure
@@ -1369,6 +1369,7 @@ LWRES_PLATFORM_NEEDVSNPRINTF
 ISC_PLATFORM_NEEDVSNPRINTF
 LWRES_PLATFORM_NEEDSPRINTF
 ISC_PLATFORM_NEEDSPRINTF
+LIBREADLINE
 ISC_PLATFORM_NEEDSTRLCAT
 ISC_PLATFORM_NEEDSTRLCPY
 GENRANDOMLIB
@@ -19784,7 +19785,7 @@ done
 
 			;;
 		esac
-		if test "X$PYTHON" == "X"
+		if test "X$PYTHON" = "X"
 		then
 			case "$use_python" in
 			unspec)
@@ -22420,6 +22421,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 ;;
@@ -25054,23 +25057,47 @@ no)	;;
 	then
 		readline=-lreadline
 	fi
-	saved_LIBS="$LIBS"
-	LIBS="$LIBS $readline"
-	for ac_func in readline
-do :
-  ac_fn_c_check_func "$LINENO" "readline" "ac_cv_func_readline"
-if test "x$ac_cv_func_readline" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_READLINE 1
-_ACEOF
+	as_ac_Lib=`$as_echo "ac_cv_lib_$readline''_readline" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in $readline" >&5
+$as_echo_n "checking for readline in $readline... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="$readline  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char readline ();
+int
+main ()
+{
+return readline ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  LIBREADLINE=-lreadline
 fi
-done
-
-	if test "$ac_cv_func_readline" = "no"
-	then
-		LIBS="$saved_LIBS"
-	fi
         ;;
 esac
 
@@ -27402,7 +27429,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
 
 
