Bug 106357 - comms/openobex fails on build
Summary: comms/openobex fails on build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Frank J. Laszlo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-05 05:30 UTC by pluknet
Modified: 2006-12-06 22:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pluknet 2006-12-05 05:30:06 UTC
It seems that comms/openobex was not completely patched on last commit 04 Dec 2006. Leastwise it fails in build-time on absent bluetooth/bluetooh.h and bluetooth/rfcomm.h and numerous incomplete types, which all are normally located in linux. This behavior repeats on both systems.

..
Making all in lib
gmake[2]: Entering directory `/var/ports/comms/openobex/work/openobex-1.3/lib'
if /bin/sh /usr/local/bin/libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -O2 -fno-strict-aliasing -pipe  -D_FORTIFY_SOURCE=2 -MT obex.lo -MD -MP -MF ".deps/obex.Tpo" -c -o obex.lo obex.c; \
        then mv -f ".deps/obex.Tpo" ".deps/obex.Plo"; else rm -f ".deps/obex.Tpo"; exit 1; fi
 cc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -O2 -fno-strict-aliasing -pipe -D_FORTIFY_SOURCE=2 -MT obex.lo -MD -MP -MF .deps/obex.Tpo -c obex.c  -fPIC -DPIC -o .libs/obex.o
In file included from obex_main.h:61,
                 from obex.c:49:
obex_transport.h:43:33: bluetooth/bluetooth.h: No such file or directory
obex_transport.h:44:30: bluetooth/rfcomm.h: No such file or directory
In file included from obex_main.h:61,
                 from obex.c:49:
obex_transport.h:58: error: field `rfcomm' has incomplete type
In file included from obex.c:62:
btobex.h:33: error: syntax error before "bdaddr_t"
btobex.h:34: error: syntax error before "bdaddr_t"
obex.c:1026: error: syntax error before "bdaddr_t"
obex.c: In function `BtOBEX_ServerRegister':
obex.c:1030: error: `self' undeclared (first use in this function)
obex.c:1030: error: (Each undeclared identifier is reported only once
obex.c:1030: error: for each function it appears in.)
obex.c:1033: error: `src' undeclared (first use in this function)
obex.c:1034: error: `BDADDR_ANY' undeclared (first use in this function)
obex.c:1035: error: `channel' undeclared (first use in this function)
obex.c: At top level:
obex.c:1049: error: syntax error before "bdaddr_t"
obex.c: In function `BtOBEX_TransportConnect':
obex.c:1053: error: `self' undeclared (first use in this function)
obex.c:1060: error: `dst' undeclared (first use in this function)
obex.c:1063: error: `src' undeclared (first use in this function)
obex.c:1064: error: `BDADDR_ANY' undeclared (first use in this function)
obex.c:1065: error: `channel' undeclared (first use in this function)
gmake[2]: *** [obex.lo] Error 1
gmake[2]: Leaving directory `/var/ports/comms/openobex/work/openobex-1.3/lib'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/var/ports/comms/openobex/work/openobex-1.3'
gmake: *** [all] Error 2
*** Error code 2

Fix: 

in all corresponding places: 1) remove absent #include <bluetooth/bluetooth.h> and #include <bluetooth/rfcomm.h>; 2) adapt Linux vars with analogous FreeBSD names via #define
 (for ex. #define BDADDR_ANY NG_HCI_BDADDR_ANY etc)
How-To-Repeat: `make`
Comment 1 Edwin Groothuis freebsd_committer 2006-12-05 05:30:13 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Guido Falsi freebsd_committer 2006-12-05 19:23:29 UTC
A few files were lost somewhere on the path to the last update.

Following patch should fix everything.

added files:

patch-lib-btobex.c
patch-lib-databuffer.h
patch-lib-obex.c
patch-lib-obex_main.c
patch-lib-obex_transport.h

patch (hope it applies cleanly):

diff -ruN openobex.old/files/patch-lib-btobex.c openobex/files/patch-lib-btobex.c
--- openobex.old/files/patch-lib-btobex.c	Thu Jan  1 01:00:00 1970
+++ openobex/files/patch-lib-btobex.c	Tue Dec  5 20:16:15 2006
@@ -0,0 +1,110 @@
+--- lib/btobex.c.orig	Tue Jan  3 20:36:15 2006
++++ lib/btobex.c	Sat Nov 25 22:00:13 2006
+@@ -46,8 +46,12 @@
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+ 
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++#include <bluetooth.h>
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ 
+ #endif /* _WIN32 */
+ 
+@@ -63,6 +67,15 @@
+ void btobex_prepare_connect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel)
+ {
+ #ifndef _WIN32
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++	self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH;
++	bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src);
++	self->trans.self.rfcomm.rfcomm_channel = 0;
++
++	self->trans.peer.rfcomm.rfcomm_family = AF_BLUETOOTH;
++	bacpy(&self->trans.peer.rfcomm.rfcomm_bdaddr, dst);
++	self->trans.peer.rfcomm.rfcomm_channel = channel;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
+ 	bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
+ 	self->trans.self.rfcomm.rc_channel = 0;
+@@ -70,6 +83,7 @@
+ 	self->trans.peer.rfcomm.rc_family = AF_BLUETOOTH;
+ 	bacpy(&self->trans.peer.rfcomm.rc_bdaddr, dst);
+ 	self->trans.peer.rfcomm.rc_channel = channel;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /* _WIN32 */
+ }
+ 
+@@ -83,9 +97,15 @@
+ {
+ #ifndef _WIN32
+ 	/* Bind local service */
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++	self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH;
++	bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src);
++	self->trans.self.rfcomm.rfcomm_channel = channel;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
+ 	bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
+ 	self->trans.self.rfcomm.rc_channel = channel;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /* _WIN32 */
+ }
+ 
+@@ -106,9 +126,15 @@
+ 		return -1;
+ 	}
+ 	
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++	if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, 
++		 sizeof(struct sockaddr_rfcomm)))
++	{
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, 
+ 		 sizeof(struct sockaddr_rc)))
+ 	{
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ 		DEBUG(0, "Error doing bind\n");
+ 		goto out_freesock;
+ 	}
+@@ -140,7 +166,11 @@
+ int btobex_accept(obex_t *self)
+ {
+ #ifndef _WIN32
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++	socklen_t addrlen = sizeof(struct sockaddr_rfcomm);
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	socklen_t addrlen = sizeof(struct sockaddr_rc);
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	//int mtu;
+ 	//int len = sizeof(int);
+ 
+@@ -178,16 +208,26 @@
+ 			return -1;
+ 	}
+ 
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++	ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
++		   sizeof(struct sockaddr_rfcomm));
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
+ 		   sizeof(struct sockaddr_rc));
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ 
+ 	if (ret < 0) {
+ 		DEBUG(4, "ret=%d\n", ret);
+ 		goto out_freesock;
+ 	}
+ 
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++	ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
++		      sizeof(struct sockaddr_rfcomm));
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
+ 		      sizeof(struct sockaddr_rc));
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	if (ret < 0) {
+ 		DEBUG(4, "ret=%d\n", ret);
+ 		goto out_freesock;
diff -ruN openobex.old/files/patch-lib-databuffer.h openobex/files/patch-lib-databuffer.h
--- openobex.old/files/patch-lib-databuffer.h	Thu Jan  1 01:00:00 1970
+++ openobex/files/patch-lib-databuffer.h	Tue Dec  5 20:16:15 2006
@@ -0,0 +1,11 @@
+--- lib/databuffer.h.orig	Thu May  4 13:24:21 2006
++++ lib/databuffer.h	Sat Nov 25 22:02:38 2006
+@@ -31,7 +31,7 @@
+ #define DATABUFFER_H
+ 
+ #define __need_size_t
+-#include <stddef.h>
++#include <sys/types.h>
+ #include <stdint.h>
+ 
+ /*
diff -ruN openobex.old/files/patch-lib-obex.c openobex/files/patch-lib-obex.c
--- openobex.old/files/patch-lib-obex.c	Thu Jan  1 01:00:00 1970
+++ openobex/files/patch-lib-obex.c	Tue Dec  5 20:16:15 2006
@@ -0,0 +1,26 @@
+--- lib/obex.c.orig	Thu May 25 20:09:41 2006
++++ lib/obex.c	Sat Nov 25 22:04:07 2006
+@@ -1031,7 +1031,11 @@
+ 
+ #ifdef HAVE_BLUETOOTH
+ 	if(src == NULL)
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++		src = NG_HCI_BDADDR_ANY;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 		src = BDADDR_ANY;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	btobex_prepare_listen(self, src, channel);
+ 	return obex_transport_listen(self);
+ #else
+@@ -1061,7 +1065,11 @@
+ 
+ #ifdef HAVE_BLUETOOTH
+ 	if(src == NULL)
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++		src = NG_HCI_BDADDR_ANY;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 		src = BDADDR_ANY;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	btobex_prepare_connect(self, src, dst, channel);
+ 	return obex_transport_connect_request(self);
+ #else
diff -ruN openobex.old/files/patch-lib-obex_main.c openobex/files/patch-lib-obex_main.c
--- openobex.old/files/patch-lib-obex_main.c	Thu Jan  1 01:00:00 1970
+++ openobex/files/patch-lib-obex_main.c	Tue Dec  5 20:16:15 2006
@@ -0,0 +1,26 @@
+--- lib/obex_main.c.orig	Thu May  4 13:24:21 2006
++++ lib/obex_main.c	Sat Nov 25 22:32:59 2006
+@@ -46,7 +46,11 @@
+ #include <stdio.h>
+ 
+ #ifdef HAVE_BLUETOOTH
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++#include <bluetooth.h>
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ #include <bluetooth/bluetooth.h>
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /*HAVE_BLUETOOTH*/
+ 
+ #endif /* _WIN32 */
+@@ -80,7 +84,11 @@
+ 
+ #ifdef HAVE_BLUETOOTH
+ 	if (domain == AF_BLUETOOTH)
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++		proto = BLUETOOTH_PROTO_RFCOMM;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 		proto = BTPROTO_RFCOMM;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /*HAVE_BLUETOOTH*/
+ 
+ 	fd = socket(domain, SOCK_STREAM, proto);
diff -ruN openobex.old/files/patch-lib-obex_transport.h openobex/files/patch-lib-obex_transport.h
--- openobex.old/files/patch-lib-obex_transport.h	Thu Jan  1 01:00:00 1970
+++ openobex/files/patch-lib-obex_transport.h	Tue Dec  5 20:16:15 2006
@@ -0,0 +1,27 @@
+--- lib/obex_transport.h.orig	Thu May  4 13:24:21 2006
++++ lib/obex_transport.h	Sat Nov 25 22:34:03 2006
+@@ -40,8 +40,12 @@
+ #include "irda_wrap.h"
+ #endif /*HAVE_IRDA*/
+ #ifdef HAVE_BLUETOOTH
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++#include <bluetooth.h>
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /*HAVE_BLUETOOTH*/
+ #ifdef HAVE_USB
+ #include "usbobex.h"
+@@ -55,7 +59,11 @@
+ #endif /*HAVE_IRDA*/
+ 	struct sockaddr_in   inet;
+ #ifdef HAVE_BLUETOOTH
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++	struct sockaddr_rfcomm   rfcomm;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ 	struct sockaddr_rc   rfcomm;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /*HAVE_BLUETOOTH*/
+ #ifdef HAVE_USB
+ 	struct obex_usb_intf_transport_t usb;

-- 
Guido Falsi <mad@madpilot.net>
Comment 3 Frank J. Laszlo freebsd_committer 2006-12-06 16:37:01 UTC
Responsible Changed
From-To: freebsd-ports-bugs->laszlof

I'll take it.
Comment 4 dfilter service freebsd_committer 2006-12-06 22:30:29 UTC
laszlof     2006-12-06 22:29:53 UTC

  FreeBSD ports repository

  Added files:
    comms/openobex/files patch-lib-btobex.c patch-lib-databuffer.h 
                         patch-lib-obex.c patch-lib-obex_main.c 
                         patch-lib-obex_transport.h 
  Log:
  Restore patches to fix build.
  
  PR:             ports/106357
  Submitted by:   pluknet <pluknet@gmail.com>
  Approved by:    Guido Falsi <mad@madpilot.net> (maintainer)
  
  Revision  Changes    Path
  1.1       +110 -0    ports/comms/openobex/files/patch-lib-btobex.c (new)
  1.1       +11 -0     ports/comms/openobex/files/patch-lib-databuffer.h (new)
  1.1       +26 -0     ports/comms/openobex/files/patch-lib-obex.c (new)
  1.1       +26 -0     ports/comms/openobex/files/patch-lib-obex_main.c (new)
  1.1       +27 -0     ports/comms/openobex/files/patch-lib-obex_transport.h (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Frank J. Laszlo freebsd_committer 2006-12-06 22:34:40 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!