Installation on MS-Windows

From Rxtx

Revision as of 01:42, 28 February 2008 by Ajmas (Talk | contribs)
Jump to: navigation, search

The instuctions below are a little dated, and have been copied over from the old docs. Please can someone update them:

Contents

Installing From Source

Compiling for Win32 support

Get the Sun CommAPI if you want a plug-in solution. The code is provided for people that may have demanding needs and coding ability.

There is only serial port code at this time.

Three ways of compiling win32 libraries are offered:

mingw32 tools in DOS lcc tools in DOS cross-compiling from Linux

mingw32 tools in DOS

Install mingw32 http://www.mingw.org Install a jdk http://java.sun.com/j2se Make sure the ming32\bin and jdk\bin directories are in your path. In the rxtx top directory to the following: mkdir build copy Makefile.mingw32 build\Makefile cd build edit the Makefile and make sure the directories are correct. execute the following: make make install

lcc tools in DOS

Install a jdk http://java.sun.com/j2se Install lcc http://www.cs.virginia.edu/~lcc-win32/

A make file (Makefile.lcc) for compiling rxtx with lcc contributed by Valentin Pavlov

You will need a config.h file in the src directory. Other builds usually generate them automatically. The following should work.

#define HAVE_FCNTL_H #define HAVE_SIGNAL_H #undef HAVE_SYS_FCNTL_H #undef HAVE_SYS_FILE_H #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H #undef HAVE_SYS_TIME_H

if you know how to create the above in a dos Makefile send in the changes.

the following commands should then work fine on the command line.

cd src make -f ..\Makefile.lcc

cross-compiling from Linux

Grab ming32:

Wayne Roberts contributed the version used by the maintainer. (Wayne is largely responsible for bringing rxtx back to win32.) http://www.linuxgrrls.org/~taj/crossmingw32-2.95-1.i386.rpm A more current version can be obtained: http://www.devolution.com/~slouken/SDL/Xmingw32/crossgcc/index.html prebuilt Binaries: http://www.devolution.com/~slouken/SDL/Xmingw32/mingw32-linux-x86-glibc-2.1.tar.gz

I built the dll with jdk-1.2.2 for linux using jdk-1.2.2 include files from the win32 JDK.

Make sure that ming32 bin dir is the first in your path (at least before /usr/bin/gcc)

$ export PATH=" \ /usr/local/cross-tools/i386-mingw32/bin/: \ $PATH:/usr/X11R6/bin:/usr/local/java/bin: \ /usr/local/java/jre/bin/:"

Place Sun jdk 1.2.2 win32 include files in a known location.

$ mkdir /home/jarvi/win32java $ cp -r /mnt/win98//java/include /home/jarvi/win32java

If you are developing win32 support you may want to export the location to make the config script non interactive

$ export WIN32INCLUDE=/home/jarvi/tools/win32-include

run configure to generate a Makefile

$ cd /home/jarvi/rxtx-* $ mkdir build $ cd build $ ../configure --target=i386-mingw32 \ --host=i386-redhat-linux

build the class files and dll.

$ make

the files will be located in

rxtx-*/build/...

If you're looking at rxtx as an example of cross-compiling you may be interested in looking at the examples provided at:

ftp.xraylith.wisc.edu /pub/khan/gnu-win32/mingw32/misc/java-jni-examples.zip

Installing Binaries

To do...

Consider merging with Installation for Windows.

External References

Follows are some links that might be useful:

Personal tools