summaryrefslogtreecommitdiff
path: root/comms/openobex/patches/patch-ab
blob: 414ed1343935fcd5a879c23a3361535e1265833b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$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")