[Nut-upsdev] Finding libusb on FreeBSD 8.0

Charles Lepple clepple at gmail.com
Thu Dec 24 16:25:57 UTC 2009


I just upgraded the FreeBSD buildbot machine from 6.4 to 8.0, and I
ran across some interesting differences.

The libusb API that we use (0.1) is available in /usr/include/usb.h
and /usr/lib/libusb.* as before, but it seems to be the compatibility
layer from libusb 1.0.

However, it doesn't include the libusb-config binary.

This is from the 'ports' Makefile for NUT:

########## - - 8< - - cut here - - ##############
.if !defined(WITHOUT_USB)
. if ${OSVERSION} < 800069
LIB_DEPENDS+=   usb-0.1.8:${PORTSDIR}/devel/libusb
. else
EXTRA_PATCHES=  ${FILESDIR}/extra-patch-m4_nut_check_libusb.m4
. endif
CONFIGURE_ARGS+=        --with-usb=auto
MAN8+=          bcmxcp_usb.8 megatec_usb.8 richcomm_usb.8 tripplite_usb.8 \
                usbhid-ups.8
PLIST_SUB+=     NUT_USB=""
.else
CONFIGURE_ARGS+=        --without-usb
PLIST_SUB+=     NUT_USB="@comment "
.endif
########## - - 8< - - cut here - - ##############

The full text of the m4 patch is here:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/sysutils/nut/files/extra-patch-m4_nut_check_libusb.m4?rev=1.1;content-type=text%2Fx-cvsweb-markup

But the gist of it is that they just hardcode "" and "-lusb" for
$CFLAGS and $LDFLAGS, respectively.

For many FreeBSD 8.0 users, this will be a non-issue, since they can
just run 'make install' in the ports directory. However, given all of
the USB stack changes, I suspect we might have to ask some users to
test against a SVN version of NUT, so it might be nice to enable USB
support out-of-the-box.

Suggestions?

Arjen: if you don't have much free time, I can do some local testing
here, but I am not sure which of the autoconf library search routines
I should use as a model.

-- 
- Charles Lepple



More information about the Nut-upsdev mailing list