File: JNI.pm

package info (click to toggle)
libinline-java-perl 0.58~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 964 kB
  • ctags: 684
  • sloc: perl: 4,717; java: 2,844; makefile: 35
file content (41 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package Inline::Java::JNI ;
@Inline::Java::JNI::ISA = qw(DynaLoader) ;


use strict ;

$Inline::Java::JNI::VERSION = '0.53_90' ;

use DynaLoader ;
use Carp ;
use File::Basename ;


if ($^O eq 'solaris'){
	load_lib('-lthread') ;
}


sub load_lib {
	my $l = shift ;
	my $lib = (DynaLoader::dl_findfile($l))[0] ;	
	
    if ((! $lib)||(! defined(DynaLoader::dl_load_file($lib, 0x01)))){
		carp("Couldn't find or load $l.") ;
	}
}


# A place to attach the Inline object that is currently in Java land
$Inline::Java::JNI::INLINE_HOOK = undef ;


eval {
	Inline::Java::JNI->bootstrap($Inline::Java::JNI::VERSION) ;
} ;
if ($@){
	croak "Can't load JNI module. Did you build it at install time?\nError: $@" ;
}


1 ;