$NetBSD: patch-ad,v 1.14 2014/05/16 12:49:42 ryoon Exp $

* GNU/kFreeBSD parts: use host of Debian GNU/kFreeBSD 7.0.
* OpenBSD's vish requires stdlib.h.

--- configure.orig	2012-12-09 22:09:32.000000000 +0000
+++ configure
@@ -6779,7 +6779,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*-gnukfreebsd*|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -6791,7 +6791,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
     case `/usr/bin/file conftest.o` in
       *32-bit*)
 	case $host in
-	  x86_64-*kfreebsd*-gnu)
+	  x86_64-*kfreebsd*-gnu|x86_64-*-gnukfreebsd*)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
@@ -6810,7 +6810,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
 	;;
       *64-bit*)
 	case $host in
-	  x86_64-*kfreebsd*-gnu)
+	  x86_64-*kfreebsd*-gnu|x86_64-*-gnukfreebsd*)
 	    LD="${LD-ld} -m elf_x86_64_fbsd"
 	    ;;
 	  x86_64-*linux*)
@@ -12702,7 +12702,11 @@ fi #if test -n "$GCC"; then
 esac
 
 CC="$CC $abi"
-libdir="$libdir$abilibdirext"
+#
+# Comment out the following line for pkgsrc as pkgsrc always installs
+# libraries into .../lib, not .../lib{32,64}.
+#
+#libdir="$libdir$abilibdirext"
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5
@@ -14245,7 +14249,7 @@ case "$host" in
 		;;
 	esac
 	;;
-*-*-kfreebsd*-gnu*)
+*-*-kfreebsd*-gnu*|x86_64-*-gnukfreebsd*)
 	native_pthread_support=yes
 	PTHREAD_CFLAGS=-pthread
 	PTHREAD_LIBADD=-pthread
@@ -16057,6 +16061,7 @@ fi
 for ac_header in vis.h
 do :
   ac_fn_c_check_header_compile "$LINENO" "vis.h" "ac_cv_header_vis_h" "
+#include <stdlib.h>
 #include <vis.h>
 #ifndef VIS_SP
 #error invis
@@ -20473,6 +20478,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef HAVE_VIS_H
+#include <stdlib.h>
 #include <vis.h>
 #endif
 struct foo { int foo; } xx;
@@ -20510,6 +20516,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef HAVE_VIS_H
+#include <stdlib.h>
 #include <vis.h>
 #endif
 struct foo { int foo; } xx;
@@ -20547,6 +20554,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef HAVE_VIS_H
+#include <stdlib.h>
 #include <vis.h>
 #endif
 struct foo { int foo; } xx;
@@ -20584,6 +20592,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef HAVE_VIS_H
+#include <stdlib.h>
 #include <vis.h>
 #endif
 struct foo { int foo; } xx;
@@ -20621,6 +20630,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef HAVE_VIS_H
+#include <stdlib.h>
 #include <vis.h>
 #endif
 struct foo { int foo; } xx;
@@ -20658,6 +20668,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef HAVE_VIS_H
+#include <stdlib.h>
 #include <vis.h>
 #endif
 struct foo { int foo; } xx;
@@ -20695,6 +20706,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef HAVE_VIS_H
+#include <stdlib.h>
 #include <vis.h>
 #endif
 struct foo { int foo; } xx;
@@ -20732,6 +20744,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef HAVE_VIS_H
+#include <stdlib.h>
 #include <vis.h>
 #endif
 struct foo { int foo; } xx;
