diff --git a/src/site/apt/build.apt b/src/site/apt/build.apt index 7f81712..68fd75a 100644 --- a/src/site/apt/build.apt +++ b/src/site/apt/build.apt @@ -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 . + + +** 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 . + + +* 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 ). + + 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 + \ No newline at end of file