NetBSD

These are instructions from Andreas Wrede on installing under NetBSD

The patches (step #2) are included in OWFS 2.8p4 and later, and so shouldn't be applied to those versions.
The rest of the instructions are needed, however.

 

Notes on building owfs on NetBSD		Nov 9, 2010

Following the procedure below, I have successfully build owfs on NetBSD. All
components will build and presumably work, although I was only able to test owtcl,
owfs (fuse), owserver and the owshell scripts.

I am building on a NetBSD/i386 system, version 5.1RC4

1. cvs -d :pserver:anonymous@owfs.cvs.sourceforge.net:/cvsroot/owfs co owfs
2. apply patch from bottom of this doc (again only for versions prior to 2.8p4)
3. install the following package from pkgsrc, the versions given are the ones I used:
autoconf-2.68
automake-1.11.1
fuse-2.8.4nb1
gmake-3.82nb1
libtool-base-2.2.6bnb4
libusb-0.1.12nb2
php-5.2.14
swig-1.3.36nb1
tcl-8.4.18
tk-8.4.18nb1
4. Building with the supplied libtool will fail. I had to replace it with the one
from libtool-base:
cp /usr/pkg/bin/libtool src/scripts/install/ltmain.sh
(source: http://www.mail-archive.com/owfs-developers@lists.sourceforge.net/msg04821.html)
5. ./bootstrap
6. Assuming you want owfs installed in /usr/local:
CFLAGS=-I/usr/pkg/include LDFLAGS=-L/usr/pkg/lib ./configure --prefix=/usr/local --no-recursion --enable-usb --with-libusb-config=/usr/pkg/bin/libusb-config --with-fuseinclude=/usr/pkg/include --with-fuselib=/usr/pkg/lib -enable-owphp --with-php=/usr/pkg/bin/php --with-phpconfig=/usr/pkg/bin/php-config --enable-owtcl --with-tcl=/usr/pkg/lib
7. gmake && gmake install
Patch for configure.ac needed for OWFS version prior to 2.8p4

---

Index: configure.ac
===================================================================
RCS file: /cvsroot/owfs/owfs/configure.ac,v
retrieving revision 1.285
diff -c -r1.285 configure.ac
*** configure.ac 2 Nov 2010 02:40:34 -0000 1.285
--- configure.ac 9 Nov 2010 22:01:58 -0000
***************
*** 888,894 ****
EXTRACFLAGS="$EXTRACFLAGS -D_XOPEN_SOURCE=500"
AC_MSG_RESULT([-D_XOPEN_SOURCE=500])
;;
! *-darwin*)
AC_MSG_RESULT([no])
;;
*-freebsd* | *)
--- 888,894 ----
EXTRACFLAGS="$EXTRACFLAGS -D_XOPEN_SOURCE=500"
AC_MSG_RESULT([-D_XOPEN_SOURCE=500])
;;
! *-darwin* | *-netbsd*)
AC_MSG_RESULT([no])
;;
*-freebsd* | *)
***************
*** 901,906 ****
--- 901,912 ----

AC_MSG_CHECKING([if cflag _BSD_SOURCE is required])
case "$-$" in
+ *-netbsd*)
+ CFLAGS="$CFLAGS -D_NETBSD_SOURCE=1"
+ EXTRACFLAGS="$EXTRACFLAGS -D_NETBSD_SOURCE=1"
+ : result: -D_NETBSD_SOURCE=1" >&5
+ $as_echo "-D_NETBSD_SOURCE=1" >&6; }
+ ;;
*)
# have to add -D_BSD_SOURCE=1 to support major() in sys/sysmacros.h
# have to add -D_ISOC99_SOURCE=1 to support lrint() in bits/mathcalls.h
Optional patches to build without USB support. Again only needed for versions prior to 2.8p4

Index: module/owlib/src/c/ow_ds9490.c
===================================================================
RCS file: /cvsroot/owfs/owfs/module/owlib/src/c/ow_ds9490.c,v
retrieving revision 1.219
diff -c -r1.219 ow_ds9490.c
*** module/owlib/src/c/ow_ds9490.c 2 Nov 2010 02:29:03 -0000 1.219
--- module/owlib/src/c/ow_ds9490.c 9 Nov 2010 22:01:58 -0000
***************
*** 25,34 ****
#include "ow_counters.h"
#include "ow_connection.h"
#include "ow_codes.h"
- #include "ow_usb_msg.h"
- #include "ow_usb_cycle.h"

#if OW_USB /* conditional inclusion of USB */

/* Extensive FreeBSD workarounds by Robert Nilsson <rnilsson@mac.com> */
/* Peter Radcliffe updated support for FreeBSD >= 8 */
--- 25,34 ----
#include "ow_counters.h"
#include "ow_connection.h"
#include "ow_codes.h"

#if OW_USB /* conditional inclusion of USB */
+ #include "ow_usb_msg.h"
+ #include "ow_usb_cycle.h"

/* Extensive FreeBSD workarounds by Robert Nilsson <rnilsson@mac.com> */
/* Peter Radcliffe updated support for FreeBSD >= 8 */
Index: module/owlib/src/c/ow_interface.c
===================================================================
RCS file: /cvsroot/owfs/owfs/module/owlib/src/c/ow_interface.c,v
retrieving revision 1.41
diff -c -r1.41 ow_interface.c
*** module/owlib/src/c/ow_interface.c 2 Nov 2010 02:29:03 -0000 1.41
--- module/owlib/src/c/ow_interface.c 9 Nov 2010 22:01:58 -0000
***************
*** 484,491 ****
--- 484,493 ----
struct parsedname *pn = PN(owq);
if (pn->selected_connection->busmode != bus_usb) else
return 0;
}
***************
*** 496,502 ****
if (pn->selected_connection->busmode != bus_usb)
!
if (OWQ_U(owq) > 7)
--- 498,504 ----
if (pn->selected_connection->busmode != bus_usb)
! #if OW_USB
if (OWQ_U(owq) > 7)
***************
*** 505,511 ****
pn->selected_connection->changed_bus_settings |= CHANGED_USB_SLEW ; // force a reset

LEVEL_DEBUG("Set slewrate to %d", pn->selected_connection->master.usb.pulldownslewrate);
!
return 0;
}

--- 507,513 ----
pn->selected_connection->changed_bus_settings |= CHANGED_USB_SLEW ; // force a reset

LEVEL_DEBUG("Set slewrate to %d", pn->selected_connection->master.usb.pulldownslewrate);
! #endif
return 0;
}

***************
*** 519,526 ****
--- 521,530 ----
struct parsedname *pn = PN(owq);
if (pn->selected_connection->busmode != bus_usb) else
return 0;
}
***************
*** 531,544 ****
if (pn->selected_connection->busmode != bus_usb)
!
if ((OWQ_U(owq) < 8) || (OWQ_U(owq) > 15))

pn->selected_connection->master.usb.writeonelowtime = OWQ_U(owq) - 8;
pn->selected_connection->changed_bus_settings |= CHANGED_USB_LOW ; // force a reset
!
return 0;
}

--- 535,548 ----
if (pn->selected_connection->busmode != bus_usb)
! #if OW_USB
if ((OWQ_U(owq) < 8) || (OWQ_U(owq) > 15))

pn->selected_connection->master.usb.writeonelowtime = OWQ_U(owq) - 8;
pn->selected_connection->changed_bus_settings |= CHANGED_USB_LOW ; // force a reset
! #endif
return 0;
}

***************
*** 552,559 ****
--- 556,565 ----
struct parsedname *pn = PN(owq);
if (pn->selected_connection->busmode != bus_usb) else
return 0;
}
***************
*** 564,577 ****
if (pn->selected_connection->busmode != bus_usb)
!
if ((OWQ_U(owq) < 3) || (OWQ_U(owq) > 10))

pn->selected_connection->master.usb.datasampleoffset = OWQ_U(owq) - 3;
pn->selected_connection->changed_bus_settings |= CHANGED_USB_OFFSET; // force a reset
!
return 0;
}

--- 570,583 ----
if (pn->selected_connection->busmode != bus_usb)
! #if OW_USB
if ((OWQ_U(owq) < 3) || (OWQ_U(owq) > 10))

pn->selected_connection->master.usb.datasampleoffset = OWQ_U(owq) - 3;
pn->selected_connection->changed_bus_settings |= CHANGED_USB_OFFSET; // force a reset
! #endif
return 0;
}

Index: module/owlib/src/include/ow_usb_cycle.h
===================================================================
RCS file: /cvsroot/owfs/owfs/module/owlib/src/include/ow_usb_cycle.h,v
retrieving revision 1.6
diff -c -r1.6 ow_usb_cycle.h
*** module/owlib/src/include/ow_usb_cycle.h 11 Jul 2010 17:58:18 -0000 1.6
--- module/owlib/src/include/ow_usb_cycle.h 9 Nov 2010 22:01:58 -0000
***************
*** 54,59 ****
--- 54,60 ----
#ifndef OW_USB_CYCLE_H /* tedious wrapper */
#define OW_USB_CYCLE_H

+ #if OW_USB
#include <sys/types.h> // Mac needs this before <usb.h> according to Peter Peter Radcliffe's work
#include <usb.h>

***************
*** 78,81 ****
--- 79,83 ----
#define DS2490_USB_VENDOR 0x04FA
#define DS2490_USB_PRODUCT 0x2490

+ #endif /* UW_USB */
#endif /* OW_USB_CYCLE_H */

Previous page: Maintosh
Next page: Startup sequence (bus traffic)