4
Once libnjb is built and installed, you will have the following files:
6
$PREFIX/lib/libnjb.a Static C library
7
$PREFIX/lib/libnjb.so Dynamic C library
8
$PREFIX/include/libnjb.h C header file for libnjb API
10
Sample programs will be built in the "sample" directory, and should
11
help you get used to using the libnjb API, as well as provide some
12
immediate gratification. Links to other programs using the libnjb
13
API may be found at the homepage: http://libnjb.sourceforge.net/
16
Shared Library Support
17
----------------------
19
Shared library linking is supported. You will need to 'make install'
20
the library before you can execute the sample binaries, or add the
21
libnjb src directory to your shared library search path (generally
22
the LD_LIBRARY_PATH environment variable). For example:
24
% export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
26
To make this change permanent, in Linux you would add the line
27
"/usr/local/lib" to your "/etc/ld.so.conf" file and run the
28
program "ldconfig" to scan in the new path. (This is part of
29
GNU C library actually.)
31
If you're building a bundled application for a distribution (like
32
a DEB or RPM package) consider linking libnjb statically. It is
39
This package depends on libusb. Get libusb from sourceforge at:
41
http://www.sourceforge.net/projects/libusb/
43
Releases of FreeBSD prior to about 4.7-RELEASE had a conflicitng, native
44
library named libusb.a that is NOT the libusb required by this package.
45
libnjb is not supported on these older FreeBSD releaeses.
61
In recent versions of FreeBSD, the default shell for root has been
62
changed from /bin/sh to /bin/csh. This may cause troubles. Then run:
66
% make install SHELL=/bin/sh
68
Under FreeBSD, /usr/local is not included in the default search path for
69
include and library files when using the compiler from the ports
70
collection. You must set the CPPFLAGS and LDFLAGS environment variables
71
prior to running configure:
73
% setenv SHELL=/bin/sh
74
% setenv CPPFLAGS=-I/usr/local/include
75
% setenv LDFLAGS=-L/usr/local/lib
80
If you build your compiler yourself, then this may not be necessary. It
81
may also not be necessary on NetBSD or OpenBSD. If the build fails because
82
it cannot locate the libusb header file, however, the above may be needed.
88
You need to have libusb installed on your system, and libusb requires that
89
you have the usbdevfs filesystem mounted. If you don't know how to do this,
90
see http://www.linux-usb.org/FAQ.html#gs3
95
After compilation and installation you may (and should) add hotplugging
96
support by running the hotplug script, if your distribution supports
97
hotplugging. This typically means you have something in /etc/hotplug and that
98
hotplugging is started when you boot your machine in a script named
99
/etc/init.d/hotplug or similar.
101
Activate hotplugging by runinng:
106
If you cannot run hotplugging
107
-----------------------------
109
If you have a distro without hotplugging enabled try this as root:
111
% chmod -R a+w /proc/bus/usb
113
You have to do this again every time you unplug/replug your USB cable
114
or restart the jukebox, every time you quit libnjb and restart it,
115
etc etc etc an alternative is to run libnjb as root which works just fine.
116
The problem is to somehow assure that you (ie the current user) always
117
has write access on /proc/bus/usb/*
120
Other distributions hotplugging
121
-------------------------------
123
This is if you don't have hotplugging enabled and do not want to set it
124
up on your machine either. You want to mount the usbfs manually.
126
According to Tim Pepper, this should work in your
129
none /proc/bus/usb usbdevfs noauto,devmode=0666 0 0
131
You can find the Linux hotplug project at:
132
http://linux-hotplug.sourceforge.net/