~ubuntu-branches/debian/wheezy/libnjb/wheezy

« back to all changes in this revision

Viewing changes to INSTALL

  • Committer: Bazaar Package Importer
  • Author(s): Shaun Jackman
  • Date: 2004-05-25 13:06:10 UTC
  • Revision ID: james.westby@ubuntu.com-20040525130610-vexcucw1qxq1g4dp
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
INSTALLATION OVERVIEW
 
2
=====================
 
3
 
 
4
Once libnjb is built and installed, you will have the following files:
 
5
 
 
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
 
9
 
 
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/
 
14
 
 
15
 
 
16
Shared Library Support
 
17
----------------------
 
18
 
 
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:
 
23
 
 
24
  % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
 
25
 
 
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.)
 
30
 
 
31
If you're building a bundled application for a distribution (like
 
32
a DEB or RPM package) consider linking libnjb statically. It is
 
33
not that big.
 
34
 
 
35
 
 
36
libusb Support
 
37
--------------
 
38
 
 
39
This package depends on libusb.  Get libusb from sourceforge at:
 
40
 
 
41
   http://www.sourceforge.net/projects/libusb/
 
42
 
 
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.
 
46
 
 
47
 
 
48
BASIC BUILD PROCEDURE
 
49
=====================
 
50
 
 
51
To build the package:
 
52
 
 
53
   % ./configure
 
54
   % make
 
55
   % make install
 
56
 
 
57
 
 
58
BSD-SPECIFIC NOTES
 
59
==================
 
60
 
 
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:
 
63
 
 
64
   % ./configure
 
65
   % make SHELL=/bin/sh
 
66
   % make install SHELL=/bin/sh
 
67
 
 
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:
 
72
 
 
73
  % setenv SHELL=/bin/sh
 
74
  % setenv CPPFLAGS=-I/usr/local/include
 
75
  % setenv LDFLAGS=-L/usr/local/lib
 
76
  % ./configure
 
77
  % make
 
78
  % make install
 
79
 
 
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.
 
83
 
 
84
 
 
85
LINUX-SPECIFIC NOTES
 
86
====================
 
87
 
 
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
 
91
 
 
92
Linux hotplugging
 
93
-----------------
 
94
 
 
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.
 
100
 
 
101
Activate hotplugging by runinng:
 
102
 
 
103
   %./hotplug.sh
 
104
 
 
105
 
 
106
If you cannot run hotplugging
 
107
-----------------------------
 
108
 
 
109
If you have a distro without hotplugging enabled try this as root: 
 
110
 
 
111
  % chmod -R a+w /proc/bus/usb
 
112
 
 
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/*
 
118
 
 
119
 
 
120
Other distributions hotplugging
 
121
-------------------------------
 
122
 
 
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.
 
125
 
 
126
     According to Tim Pepper, this should work in your 
 
127
     /etc/fstab:
 
128
 
 
129
     none  /proc/bus/usb  usbdevfs noauto,devmode=0666 0 0
 
130
 
 
131
You can find the Linux hotplug project at:
 
132
http://linux-hotplug.sourceforge.net/