http://www.perlmonks.org?node_id=373910


in reply to PLJava - Perl embeded into Java (calling Perl from Java) - 1sr release - call for tests and review, please.

Great stuff, here are the testresults of the Gentoo-Jury: g.m.passos douze points ;-)

Update:crossposted this test-result to comp.lang.perl.modules.

[1239]tom@margo PLJava-0.01 $ perl -v This is perl, v5.8.4 built for i686-linux

Makefile.PL diff (diff -c)

** Makefile.PL 2004-07-13 00:20:42.000000000 +0200 --- Makefile.PL.linux 2004-07-13 12:41:27.000000000 +0200 *************** *** 32,38 **** ######### my $C_FILES = "$NAME.c ${NAME}_wrap.c" ; ! my $O_FILES = "$NAME.obj ${NAME}_wrap.obj" ; my $INTERFACE = "$NAME.i" ; my $CLEAN_FILES = "PLJava.dll" ; --- 32,38 ---- ######### my $C_FILES = "$NAME.c ${NAME}_wrap.c" ; ! my $O_FILES = "$NAME.o ${NAME}_wrap.o" ; my $INTERFACE = "$NAME.i" ; my $CLEAN_FILES = "PLJava.dll" ; *************** *** 103,109 **** CFLAGS=$cflags LDFLAGS=$ldflags ! INC = -I"$ENV{JAVA_INCLUDE}" -I"$ENV{JAVA_INCLUDE}/win32" C_FILES = $C_FILES O_FILES = $O_FILES --- 103,109 ---- CFLAGS=$cflags LDFLAGS=$ldflags ! INC = -I"$ENV{JAVA_INCLUDE}" -I"$ENV{JAVA_INCLUDE}/win32" -I"$ENV{JA +VA_INCLUDE}/linux" C_FILES = $C_FILES O_FILES = $O_FILES *************** *** 115,121 **** DISTNAME = $NAME VERSION = $VERSION SUFFIX = .gz - DISTVNAME = \$(DISTNAME)-\$(VERSION) .c$o: --- 115,120 ----

Changes to the generated Makefile:

s/-rdynamic/-shared -rdynamic/

Inside of built/

[1244]tom@margo PLJava-0.01 $ export LD_LIBRARY_PATH=.:$LD_LIBRARY_PAT +H [1245]tom@margo built $ ln -s PLJava.so libPLJava.so [1245]tom@margo built $ java test
java test output:
java test Hello World! TIME: 1089715216 @INC: /lib /usr/lib/perl5/5.8.4/i686-linux /usr/lib/perl5/5.8.4 /usr/lib/perl5/site_perl/5.8.4/i686-linux /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3/i686-linux /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2/i686-linux /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1/i686-linux /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0/i686-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.4/i686-linux /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3/i686-linux /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2/i686-linux /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1/i686-linux /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0/i686-linux /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl . ERROR: This is a warning! at (eval 7) line 1. MATH: 1024 3 3.33333333333333 ============================ ID: 1 Type: SCALAR Val: 123456 ============================ ID: 2 Type: SCALAR Val: 1111 ============================ ID: 1 Type: SCALAR Val: 123456 ============================ ID: 3 Type: ARRAY Val: t 1089715216 x: 1089715216 ============================ <<<<<<<<<<<<<<< ID: 4 Type: foo Val: foo=HASH(0x812a2b4) FOO>> foo=HASH(0x812a2b4) 123 456 foo=HASH(0x812a2b4) call: 1 dump: >>>>>>>>>>>>>>> ============================ ID: 5 Type: HASH Val: HASH(0x8144da0) k: 1089715216 elem: call: ============================'This is a \\\' quote \'test\' !'

Summary: the dll-naming is wrong (libPLJava.so), the object-file-ending is wrong, and inside the generated Makefile an option to gcc is missing (without the -shared gcc needs a main-function).

regards,
tomte


An intellectual is someone whose mind watches itself.
-- Albert Camus