Installation on MS-Windows

From Rxtx

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

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

Building with Eclipse/CDT

These builds instructions currently depend on a makefile available from CodeSkin.

  • Install Eclipse with CDT and Subclipse. Subclipse is the eclipse interface to subversion and instructions for installing it are at http://subclipse.tigris.org/install.html
  • Install MinGW
  • In Eclipse, select "New Project > Checkout Projects from SVN" and choose this repository location: http://www.codeskin.com/pubsvn/rxtx/tags/rxtx-2.1-7r2.
  • Check out as a "project configured using the New Project Wizard" and choose "Java Project".
  • Once the project has been created, right-click on the project, select "new>other>C++>Convert to a C/C++ Make Project"
  • Right-click on project again and select "properties>C/C++Build" and change "Build command" to
C:\MinGW\bin\mingw32-make
  • Finally, hit "Build All", which should create RXTXcomm.jar and rxtxSerial.dll

Installing Binaries

To do...

Consider merging with Installation for Windows.

External References

Follows are some links that might be useful:

Personal tools