Installation on MS-Windows

From Rxtx

(Difference between revisions)
Jump to: navigation, search
(Building with Eclipse/CDT)
(reformatting)
Line 2: Line 2:
== Installing From Source==
== Installing From Source==
-
==== Compiling for Win32 support ====
 
-
Get the Sun CommAPI if you want a plug-in solution.  The code  
+
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.  
-
is provided for people that may have demanding needs and coding
+
-
ability.  
+
-
There is only serial port code at this time.
+
There is only serial port code at this time.
-
Three ways of compiling win32 libraries are offered:
+
Three ways of compiling win32 libraries are offered:
 +
 
 +
mingw32 tools in DOS
 +
lcc tools in DOS
 +
cross-compiling from Linux
-
mingw32 tools in DOS
 
-
lcc tools in DOS
 
-
cross-compiling from Linux
 
===== mingw32 tools in DOS =====
===== mingw32 tools in DOS =====
-
Install mingw32  http://www.mingw.org
+
Install mingw32  http://www.mingw.org
-
Install a jdk    http://java.sun.com/j2se
+
Install a jdk    http://java.sun.com/j2se
-
Make sure the ming32\bin and jdk\bin directories are in your
+
Make sure the ming32\bin and jdk\bin directories are in your path. In the rxtx top directory to the following:
-
path.
+
mkdir build
-
In the rxtx top directory to the following:
+
copy Makefile.mingw32 build\Makefile
-
mkdir build
+
cd build
-
copy Makefile.mingw32 build\Makefile
+
edit the Makefile and make sure the directories are correct.  
-
cd build
+
execute the following:
-
edit the Makefile and make sure the directories are correct.
+
-
execute the following:
+
make
make
make install
make install
Line 32: Line 28:
===== lcc tools in DOS =====
===== lcc tools in DOS =====
-
Install a jdk    http://java.sun.com/j2se
+
Install a jdk    http://java.sun.com/j2se
-
Install lcc http://www.cs.virginia.edu/~lcc-win32/
+
Install lcc http://www.cs.virginia.edu/~lcc-win32/
-
A make file (Makefile.lcc) for compiling rxtx with lcc
+
A make file (Makefile.lcc) for compiling rxtx with lcc contributed by Valentin Pavlov
-
contributed by Valentin Pavlov
+
-
You will need a config.h file in the src directory.  Other
+
You will need a config.h file in the src directory.  Other builds usually generate them automatically.  The following should work.
-
builds usually generate them automatically.  The following
+
-
should work.
+
-
#define HAVE_FCNTL_H
+
#define HAVE_FCNTL_H
-
#define HAVE_SIGNAL_H
+
#define HAVE_SIGNAL_H
-
#undef HAVE_SYS_FCNTL_H
+
#undef HAVE_SYS_FCNTL_H
-
#undef HAVE_SYS_FILE_H
+
#undef HAVE_SYS_FILE_H
-
#undef HAVE_SYS_SIGNAL_H
+
#undef HAVE_SYS_SIGNAL_H
-
#undef HAVE_TERMIOS_H
+
#undef HAVE_TERMIOS_H
-
#undef HAVE_SYS_TIME_H
+
#undef HAVE_SYS_TIME_H
-
if you know how to create the above in a dos Makefile send in the changes.
+
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
+
the following commands should then work fine on the command line.
-
line.
+
-
cd src
+
cd src
-
make -f ..\Makefile.lcc
+
make -f ..\Makefile.lcc
===== cross-compiling from Linux =====
===== cross-compiling from Linux =====
-
Grab ming32:
+
Grab ming32:
-
Wayne Roberts contributed the version used by the maintainer.
+
Wayne Roberts contributed the version used by the maintainer. (Wayne is largely responsible for bringing rxtx back to win32.)
-
(Wayne is largely responsible for bringing rxtx back to win32.)
+
http://www.linuxgrrls.org/~taj/crossmingw32-2.95-1.i386.rpm
-
http://www.linuxgrrls.org/~taj/crossmingw32-2.95-1.i386.rpm
+
A more current version can be obtained:
-
A more current version can be obtained:
+
http://www.devolution.com/~slouken/SDL/Xmingw32/crossgcc/index.html
-
http://www.devolution.com/~slouken/SDL/Xmingw32/crossgcc/index.html
+
prebuilt Binaries:
-
prebuilt Binaries:
+
http://www.devolution.com/~slouken/SDL/Xmingw32/mingw32-linux-x86-glibc-2.1.tar.gz
-
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  
+
I built the dll with jdk-1.2.2 for linux using jdk-1.2.2 include files from the win32 JDK.
-
include files from the win32 JDK.
+
-
Make sure that ming32 bin dir is the first in your path (at  
+
Make sure that ming32 bin dir is the first in your path (at least before /usr/bin/gcc)
-
least before /usr/bin/gcc)
+
-
$ export PATH=" \
+
$ export PATH=" \
-
/usr/local/cross-tools/i386-mingw32/bin/: \
+
    /usr/local/cross-tools/i386-mingw32/bin/: \
-
$PATH:/usr/X11R6/bin:/usr/local/java/bin: \
+
    $PATH:/usr/X11R6/bin:/usr/local/java/bin: \
-
/usr/local/java/jre/bin/:"
+
    /usr/local/java/jre/bin/:"
-
Place Sun jdk 1.2.2 win32 include files in a known location.
+
Place Sun jdk 1.2.2 win32 include files in a known location.
-
$ mkdir /home/jarvi/win32java
+
$ mkdir /home/jarvi/win32java
-
$ cp -r /mnt/win98//java/include /home/jarvi/win32java
+
$ cp -r /mnt/win98//java/include /home/jarvi/win32java
-
If you are developing win32 support you may want to
+
If you are developing win32 support you may want to export the location to make the config script non interactive
-
export the location to make the config script
+
-
non interactive
+
-
$ export WIN32INCLUDE=/home/jarvi/tools/win32-include
+
$ export WIN32INCLUDE=/home/jarvi/tools/win32-include
-
run configure to generate a Makefile
+
run configure to generate a Makefile
-
$ cd /home/jarvi/rxtx-*
+
$ cd /home/jarvi/rxtx-*
-
$ mkdir build
+
$ mkdir build
-
$ cd build
+
$ cd build
-
$ ../configure --target=i386-mingw32  \
+
$ ../configure --target=i386-mingw32  \
-
--host=i386-redhat-linux
+
--host=i386-redhat-linux
-
build the class files and dll.
+
build the class files and dll.
-
$ make
+
$ make
-
the files will be located in
+
the files will be located in
-
rxtx-*/build/...
+
rxtx-*/build/...
-
If you're looking at rxtx as an example of cross-compiling you  
+
If you're looking at rxtx as an example of cross-compiling you may be interested in looking at the examples provided at:
-
may be interested in looking at the examples provided at:
+
-
ftp.xraylith.wisc.edu
+
ftp.xraylith.wisc.edu
-
/pub/khan/gnu-win32/mingw32/misc/java-jni-examples.zip
+
/pub/khan/gnu-win32/mingw32/misc/java-jni-examples.zip
=== Building with Eclipse/CDT ===
=== Building with Eclipse/CDT ===

Revision as of 14:11, 21 March 2008

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