Clean build of Kaffe.exe on PC

Tony Juricic tony at magg.net
Tue Nov 25 18:59:52 PST 1997


It came to my attention that there are some people out
there who would like to "play" with Kaffe binaries on
PC ( and other systems), without going through the trouble 
of "discovering the hot water" again, especially if somebody 
before them did it already.

So, here are presciptions for "clean" Kaffe build on 
Cygnus Win32 system:

- Download and install CDK.EXE. This is Cygnus emulation
  layer for Unix programs on Win32. It contains lots of
  useful Unix programs ( most of all BASH - I read it is
  an acronym for Born Again SHell). You can download it from
  any site listed at http://www.cygnus.com/misc/gnu-win32/

  CDK.EXE is self-installing executable. You still need to
  edit your AUTOEXEC.BAT file in Windows 95. This is relevant
  listing from my AUTOEXEC.BAT:

SET GCC_EXEC_PREFIX=C:\gnuwin32\b18\H-i386-cygwin32\lib\gcc-lib\
PATH=%PATH%;C:\gnuwin32\b18\H-i386-cygwin32\bin;C:\gnuwin32\b18\tcl\bin
SET TCL_LIBRARY=C:/gnuwin32/b18/tcl/lib/tcl7.6
SET GDBTK_LIBRARY=C:/gnuwin32/b18/share/gdbtcl

  This effectively makes your Windows 95 or Windows NT into
  Cygnus Win32 system.

- Other useful tips are: create tmp and bin directories
  in your root directory. bin directory should contain sh.exe
  from Cygnus CDKE.EXE distribution.

- Download and unzip Kaffe 0.9.2 source distribution.
  I used:
  ftp://rufus.w3.org/pub/kaffe/distrib/
  and downloaded file kaffe-0.9.2.tgz.
  WinZip is convenient for unzipping tgz (TAR GZIP) files on PC.
  From now on I assume you unzipped Kaffe sources into some
  <Unzip directory> which can be root (like c:) as well.

- Start Unix shell bash.exe in C:\gnuwin32\b18\H-i386-cygwin32\bin
  directory. Using "cd" command, move to directory where
  you unzipped Kaffe. You can use "ls", "pwd" and "dir" commands
  on bash prompt to check where you are in directory structure.
  Commands above are to be typed on bash prompt without double 
  quotes and this applies to all commands mentioned further in 
  this document.

- Type command "./configure --prefix=c:/kaffe" on bash propmt.
  ( of course, without double quotes )

- Once the configuration is finished, type "make" on bash prompt.

- You will encounter build errors, all of them due to changed
  names of library DEF extension files and are basically trivial. 

- First error encountered will be displayed as 
  ( follows capture of bash DOS box screen output, edited to
    avoid words split between two lines):

gcc -g -O2 -I. -I../../../../include -I./../../../../include 
-I../../../../config -I./../../../../config -c  
./java.util/ResourceBundle.c dlltool --def ./libnative.def 
--output-exp lib.exp --output-lib libnative.a --dllname libnative.a
dlltool: Can't open def file ./libnative.def
make: *** [lib.exp] Error 1
make: *** [all] Error 1
make: *** [all] Error 1
make: *** [all] Error 1
make: *** [all] Error 1
bash$   <<!!! here bash is waiting on your next command

- Go to directory <Unzip directory>\kaffe-0.9.2\packages\
  tjwassoc.co.uk\APIcore\lib. There is libkaffe_native.def 
  file there. Rename it to libnative.def.

- Type "make" on bash prompt again. The first error will
  not repeat.

- The second error you will get will be:

C:\gnuwin32\b18\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\cygnus-2.7.2-970404\..
/../../../i386-cygwin32/include/sys/socket.h:53: warning: this is the location
of the previous definition dlltool --def ./libnet.def --output-exp lib.exp
--output-lib libnet.a --dllname libnet.a dlltool: Can't open def file
./libnet.def make: *** [lib.exp] Error 1 make: *** [all] Error 1 make: *** [all]
Error 1 make: *** [all] Error 1 make: *** [all] Error 1 bash$

- Go to directory <Unzip directory>\kaffe-0.9.2\packages\
  tjwassoc.co.uk\APInet\lib. There is libkaffe_net.def 
  file there. Rename it to libnet.def.

- Type "make" on bash prompt again.

- For the third error you will get this bash output:

gcc -g -O2 -I. -I../../../../include -I./../../../../include 
-I../../../../config -I./../../../../config -c  
./sun.tools.debug.stubs/AgentStub.c dlltool --def ./libagent.def 
--output-exp lib.exp --output-lib libagent.a --dllname libagent.a
dlltool: Can't open def file ./libagent.def
make: *** [lib.exp] Error 1
make: *** [all] Error 1
make: *** [all] Error 1
make: *** [all] Error 1
make: *** [all] Error 1
bash$

- Go to directory <Unzip directory>\kaffe-0.9.2\packages\
  tjwassoc.co.uk\APIagent\lib. There is libkaffe_agent.def 
  file there. Rename it to libagent.def.

- Run make again.

- The fourth error will cause bash output:

gcc -g -O2 -I. -I../../../../include -I./../../../../include 
-I../../../../config -I./../../../../config -c 
./java.util.zip.stubs/InflaterStub.c dlltool --def ./libzip.def --output-exp
lib.exp --output-lib libzip.a --dllname libzip.a dlltool: Can't open def file
./libzip.def make: *** [lib.exp] Error 1 make: *** [all] Error 1 make: *** [all]
Error 1 make: *** [all] Error 1 make: *** [all] Error 1 bash$

- Go to directory <Unzip directory>\kaffe-0.9.2\packages\
  tjwassoc.co.uk\APIzip\lib. There is libkaffe_zip.def 
  file there. Rename it to libzip.def.

- Run make again.

- Fifth error will cause the following output:

gcc -g -O2 -DNO_SHARED_LIBRARIES -I. -I. -I./../../config -I../../config -I../..
/include -I./../../include -DTRANSLATOR -I./jit -DKVER=\"0.92\" -c  ./jit/seq.c
dlltool --def ./libkaffevm.def --output-exp lib.exp --output-lib libkaffevm.a --
dllname libkaffevm.a dlltool: Can't open def file ./libkaffevm.def make: ***
[lib.exp] Error 1 make: *** [all] Error 1 make: *** [all] Error 1 bash$

- Go to directory <Unzip directory>\kaffe-0.9.2\kaffe\kaffevm.
  There is libkaffe_vm.def file there. Rename it to libkaffevm.def.

- Run make again.

- Sixth ( and final!) error will be shown as:

gcc -g -O2  -I. -I./../kaffevm -I../../config -I./../../config 
-I../../include -I./../../include -o kaffe.exe main.o 
-L../kaffevm -lkaffevm  -L../../packages/tjwassoc.co.uk/APIcore/lib
-lkaffe_native -L../../packages/tjwassoc.co.uk/APInet/lib -lkaffe_net
-L../../packages/tjwassoc.co.uk/APIzip/lib -lkaffe_zip  -lkaffevm -lm
/gnuwin32/b18/H-i386-cygwin32/i386-cygwin32/bin/ld.exe: cannot open
-lkaffe_native: No such file or directory make: *** [kaffe.exe] Error 1 make:
*** [all] Error 1 make: *** [all] Error 1 bash$

- Go to directory <Unzip directory>\kaffe-0.9.2\kaffe\kaffe.
  There is Makefile file there. You will need to edit it.

- There are 3 Makefile command lines:

LIBS=		-L../kaffevm -lkaffevm  
-L../../packages/tjwassoc.co.uk/APIcore/lib -lkaffe_native 
-L../../packages/tjwassoc.co.uk/APInet/lib -lkaffe_net 
-L../../packages/tjwassoc.co.uk/APIzip/lib -lkaffe_zip  -lkaffem -lm 
OBJEXT=		.o
EXEEXT=		.exe

- Edit LIBS = line to be:

-L../../packages/tjwassoc.co.uk/APIcore/lib -lnative 
-L../../packages/tjwassoc.co.uk/APInet/lib -lnet 
-L../../packages/tjwassoc.co.uk/APIzip/lib -lzip  -lkaffem -lm 

- Run make again.

- Your Kaffe VM should be created now. Install Kaffe files in 
  separate directory by issuing this command on bash prompt: 
  "make install"

- If, at any point before, you get message like:

In file included from C:\gnuwin32\b18\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\
cygnus-2.7.2-970404\../../../../i386-cygwin32/include/unistd.h:4,
                 from ../../config/config-std.h:20,
                 from ./jit/slots.c:13:
C:\gnuwin32\b18\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\cygnus-2.7.2-970404\..
/../../../i386-cygwin32/include/sys/unistd.h:9: sys/types.h: Not owner make: ***
[slots.o] Error 1 make: *** [all] Error 1 make: *** [all] Error 1

  just run make again. I don't know where this error comes from, but
  I know for sure that restarting the make process will not show
  it next time.

- Change your AUTOEXEC.BAT to reflect Kaffe installation
  directory. This is an excerpt from my AUTOEXEC.BAT file:

SET KAFFEHOME=c:/kaffe/share/kaffe
SET LD_LIBRARY_PATH=c:/kaffe/lib

- You are also expected to have installed Sun JDK Java 
  classes.zip somewhere and to have set CLASSPATH accordingly.

- Try test running Kaffe.exe with some Java programs.
  Currently, Kaffe does not support graphics applications
  ( so, don't try graphics apps or applets )
  but you can find a lot of other test programs in Kaffe
  source distribution, directory test.

Have fun,
Tony



More information about the kaffe mailing list