$NetBSD: patch-ab,v 1.2 2006/07/09 09:27:52 xtraeme Exp $

--- acinclude.m4.orig	2006-06-14 11:11:47.000000000 +0200
+++ acinclude.m4	2006-07-09 10:33:49.000000000 +0200
@@ -61,6 +61,17 @@
 	AC_SUBST(BLUEZ_LIBS)
 ])
 
+AC_DEFUN([NETBSD_BLUETOOTH_CHECK], [
+	AC_CACHE_CHECK([for NetBSD bluetooth support], netbsdbt_found,[
+
+		AC_TRY_COMPILE([
+				#include <bluetooth.h>
+				], [
+				struct sockaddr_bt *bt;
+				], netbsdbt_found=yes, netbsdbt_found=no)
+		])
+])
+
 AC_DEFUN([AC_PATH_USB], [
 	PKG_CHECK_MODULES(USB, libusb, usb_found=yes, AC_MSG_RESULT(no))
 	AC_SUBST(USB_CFLAGS)
@@ -126,6 +137,12 @@
 		REQUIRES="bluez"
 	fi
 
+	if (test "${bluetooth_enable}" = "yes" && test "${netbsdbt_found}" = "yes"); then
+		AC_DEFINE(HAVE_BLUETOOTH, 1, [Define if system supports Bluetooth and it's enabled])
+		AC_DEFINE(HAVE_NETBSD_BLUETOOTH, 1, [Define if it uses NetBSD's bluetooth stack])
+		CPPFLAGS="$CPPFLAGS -DCOMPAT_BLUEZ"
+	fi
+
 	if (test "${usb_enable}" = "yes" && test "${usb_found}" = "yes"); then
 		AC_DEFINE(HAVE_USB, 1, [Define if system supports USB and it's enabled])
 		AC_CHECK_FILE(${prefix}/lib/pkgconfig/libusb.pc, REQUIRES="$REQUIRES libusb")
