Added first documentation for building the JNI wrapper library.
This commit is contained in:
parent
a54b1e43d9
commit
601c28131a
@ -4,7 +4,77 @@
|
||||
|
||||
Build Instructions
|
||||
|
||||
* Build usb4java on linux
|
||||
This page describes how to compile the JNI wrapper library on various
|
||||
platforms. For all platforms it is recommended to correctly configure the
|
||||
JAVA_HOME environment variable so the Java header files are found
|
||||
automatically.
|
||||
|
||||
Download usb4ja
|
||||
TODO
|
||||
* Linux
|
||||
|
||||
** Build libusb4java on Linux
|
||||
|
||||
You need to install the development files of libusb 0.1.x first. On
|
||||
Debian systems this is done with the following command:
|
||||
|
||||
---
|
||||
sudo apt-get install libusb-dev
|
||||
---
|
||||
|
||||
To compile and install libusb4java simply run the following commands:
|
||||
|
||||
---
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
---
|
||||
|
||||
The library is then located in </usr/local/lib>.
|
||||
|
||||
|
||||
** Compile 32 bit libusb4java on 64 bit Linux
|
||||
|
||||
You need to install the 32 bit development files. On Debian systems this can
|
||||
be done with the following command which also installs the 32 bit version of
|
||||
libusb:
|
||||
|
||||
---
|
||||
sudo apt-get install ia32-libs-dev
|
||||
---
|
||||
|
||||
To compile the library for 32 bit run the following commands:
|
||||
|
||||
---
|
||||
./configure CFLAGS="-m32"
|
||||
make
|
||||
make install DESTDIR=/tmp/usb4java-linux-x86
|
||||
---
|
||||
|
||||
The library is then located in </tmp/usb4java-linux-x86>.
|
||||
|
||||
|
||||
* Windows
|
||||
|
||||
** Cross-compile libusb4java for Windows 32 bit on Linux
|
||||
|
||||
First install the mingw32 cross compiler. On Debian systems this can be
|
||||
done with the following command:
|
||||
|
||||
---
|
||||
sudo apt-get install mingw32
|
||||
---
|
||||
|
||||
Then you need the development files of libusb-win32. Download the latest
|
||||
binary archive from the
|
||||
{{{http://sourceforge.net/apps/trac/libusb-win32/wiki}libusb-win32 website}}
|
||||
and unpack it somwhere (I assume you extracted it to </tmp/libusb-win32>).
|
||||
|
||||
Now compile the library:
|
||||
|
||||
---
|
||||
./configure --host=i586-mingw32msvc --prefix="" CFLAGS="-I/tmp/libusb-win32/include/ -L/tmp/libusb-win32/lib/gcc"
|
||||
make
|
||||
make install DESTDIR=/tmp/usb4java-win32
|
||||
---
|
||||
|
||||
The compiled DLL is then located in </tmp/usb4java-win32/bin>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user