1 Just-JNI (call into Java from Perl only)
2 ----------------------------------------
4 This has been tested with:
6 Debian GNU/Linux 2.2 i386, perl 5.6.0, Kaffe (CVS, 2000-12-05 or later)
7 RedHat 6.1, perl-5.00503-6 (RedHat RPM), IBM JDK 1.1.8
8 Debian 2.1 SPARC, Perl 5.005_60, JDK 1.2 beta (crashes with AWT, though)
9 Windows NT 4.0 SP4, ActivePerl 519, JDK 1.1.8, Visual C++
10 Solaris 7, Perl 5.005_03, JDK 1.1.6, GCC 2.8.1
12 Solaris 7 Note (this probably applies to all native thread situations):
14 Native threads were tricky. I had to build my own Perl, configured with:
16 sh Configure -Dprefix=/opt/perl5.005 -Duseshrplib -Doptimize=-g \
17 -Uusemymalloc -D cc=gcc -Dusethreads -d
19 When Configure let me edit config.sh, I changed libs to:
21 libs='-lthread -lsocket -lnsl -ldl -lm -lposix4 -lpthread -lc -lcrypt'
23 The leading -lthread is the only thing I had to add.
27 I believe that Kaffe with JIT enabled will likely be problematic. I had a
28 lot of trouble with it, that simply went away with interpreter-based Kaffe.
29 FWIW, here's how I configured Kaffe:
31 env AM_CPPFLAGS=-DDEBUG CFLAGS="-O0 -ggdb" ./configure --disable-gcj \
34 Likely you don't need all that debugging stuff.
36 Also, when I build perl, I do this, to be on the safe side. I was worried
37 about thread interaction, but realized there was no need to build threaded
38 perl, but I thought that the perl code should probably be reentrant, so, I
41 sh ./Configure -Dcc=gcc -Doptimize='-D_REENTRANT -DDEBUGGING -ggdb' \
42 -Dlibperl='libperl.so' -Duseshrplib='true'
44 Again, you likely don't need the debugging flags.
47 How do I do this crazy thing?
48 -----------------------------
50 1) Cd into the JPL directory. Type the following:
56 Under windows, that's:
62 3) cd into the JNI directory (cd ../JNI or cd ..\JNI)
64 4) We now need to compile and make the Closer.class available to your
65 JPL program. Closer is a WindowListener that closes the Frame we
66 make in the test program.
68 It seems that we've managed to fix the problem with CLASSPATH not
69 getting propagated to the JVM, so if '.' is in your CLASSPATH, you
70 should be able to compile Closer.java and leave it in the current
81 a) type the following:
83 for SUN's proprietary software Java:
85 env JAVA_HOME=/path/to/java perl Makefile.PL
86 # setting the JAVA_HOME enviornment variable might not be needed
87 # if Java is in installed in a canonical location
93 env KAFFE_PREFIX=/kaffe/installation/prefix perl Makefile.PL
94 # setting the KAFFE_PREFIX enviornment variable might not be needed
95 # if Kaffe is in a canonical location
106 b) if all went well, type: