Marcel,

well, here you go.

regards,
Christian

Marcel Holtmann schrieb:
> please post it to the mailing list. If I remember correctly, then the
> configure part needed some adaptions and changes.
>   

$NetBSD$

--- configure.in.orig   2006-06-14 11:24:13.000000000 +0200
+++ configure.in        2006-07-09 10:01:18.000000000 +0200
@@ -23,6 +23,8 @@
 AC_PATH_BLUEZ
 AC_PATH_USB
 
+NETBSD_BLUETOOTH_CHECK
+
 AC_ARG_OPENOBEX
 
 AC_OUTPUT(Makefile include/Makefile lib/Makefile apps/Makefile ircp/Makefile 
doc/Makefile openobex.pc)
$NetBSD$

--- 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")
$NetBSD$

--- lib/obex_transport.h.orig   2006-07-09 10:19:01.000000000 +0200
+++ lib/obex_transport.h        2006-07-09 10:20:53.000000000 +0200
@@ -39,7 +39,10 @@
 #ifdef HAVE_IRDA
 #include "irda_wrap.h"
 #endif /*HAVE_IRDA*/
-#ifdef HAVE_BLUETOOTH
+#ifdef HAVE_NETBSD_BLUETOOTH
+#include <bluetooth.h>
+#include <netbt/rfcomm.h>
+#elif defined(HAVE_BLUETOOTH)
 #include <bluetooth/bluetooth.h>
 #include <bluetooth/rfcomm.h>
 #endif /*HAVE_BLUETOOTH*/
@@ -54,7 +57,9 @@
        struct sockaddr_irda irda;
 #endif /*HAVE_IRDA*/
        struct sockaddr_in   inet;
-#ifdef HAVE_BLUETOOTH
+#ifdef HAVE_NETBSD_BLUETOOTH
+       struct sockaddr_bt   rfcomm;
+#elif defined(HAVE_BLUETOOTH)
        struct sockaddr_rc   rfcomm;
 #endif /*HAVE_BLUETOOTH*/
 #ifdef HAVE_USB
$NetBSD$

--- config.h.in.orig    2006-07-09 10:27:25.000000000 +0200
+++ config.h.in 2006-07-09 10:28:00.000000000 +0200
@@ -6,6 +6,9 @@
 /* Define if system supports Bluetooth and it's enabled */
 #undef HAVE_BLUETOOTH
 
+/* Define if system uses NetBSD's bluetooth stack */
+#undef HAVE_NETBSD_BLUETOOTH
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
$NetBSD$

--- lib/obex_main.c.orig        2006-07-09 10:34:51.000000000 +0200
+++ lib/obex_main.c     2006-07-09 10:35:37.000000000 +0200
@@ -45,7 +45,9 @@
 #include <sys/types.h>
 #include <stdio.h>
 
-#ifdef HAVE_BLUETOOTH
+#ifdef HAVE_NETBSD_BLUETOOTH
+#include <bluetooth.h>
+#elif defined(HAVE_BLUETOOTH)
 #include <bluetooth/bluetooth.h>
 #endif /*HAVE_BLUETOOTH*/
 
$NetBSD$

--- lib/btobex.c.orig   2006-07-09 10:36:43.000000000 +0200
+++ lib/btobex.c        2006-07-09 10:38:51.000000000 +0200
@@ -37,7 +37,7 @@
 #include <winsock.h>
 
 #else /* _WIN32 */
-/* Linux case */
+/* Linux/NetBSD case */
 
 #include <string.h>
 #include <unistd.h>
@@ -46,8 +46,17 @@
 #include <netinet/in.h>
 #include <sys/socket.h>
 
+#ifdef HAVE_NETBSD_BLUETOOTH
+#define rc_family      bt_family
+#define rc_bdaddr      bt_bdaddr
+#define rc_channel     bt_channel
+#define sockaddr_rc    sockaddr_bt
+#include <bluetooth.h>
+#include <netbt/rfcomm.h>
+#else
 #include <bluetooth/bluetooth.h>
 #include <bluetooth/rfcomm.h>
+#endif
 
 #endif /* _WIN32 */
 
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to