diff options
author | Matt Perry <matt@mattperry.com> | 2018-04-05 09:19:04 -0700 |
---|---|---|
committer | Matt Perry <matt@mattperry.com> | 2018-04-05 09:19:04 -0700 |
commit | 41a0955885d274d3c76107672feb72c32f7584ff (patch) | |
tree | ffca681e2e4f1b8271037d7f419a78fa264ba97d | |
parent | be23801a1fbc955bb452fda49f5b88d921339499 (diff) |
Fix build on Cygwin
Cygwin will not have permission to write to the Java installation
directory on a modern Windows system.
Restore the Java/jvm.def file. Modify Java/Makefile.PL to build
libjvm.dll.a in the current directory and include that directory during
compilation.
-rw-r--r-- | Java/Makefile.PL | 7 | ||||
-rw-r--r-- | Java/jvm.def | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Java/Makefile.PL b/Java/Makefile.PL index 9457619..05fdf72 100644 --- a/Java/Makefile.PL +++ b/Java/Makefile.PL @@ -113,10 +113,10 @@ if ($build_jni){ # Cygwin: create gcc-compatible library wrapper for jvm.dll if ($^O eq 'cygwin') { - my $dll = File::Spec->catfile($jdk_dir, 'lib', 'libjvm.dll.a') ; + my $dll = File::Spec->catfile(Cwd::cwd, 'libjvm.dll.a') ; print "Creating '$dll' for cygwin.\n\n" ; system("/usr/bin/dlltool --input-def jvm.def --kill-at --dllname jvm.dll --output-lib '$dll'") - and print "Error attempting to create '$jdk_dir/lib/libjvm.dll.a'\n" ; + and print "Error attempting to create '$dll'\n" ; } print "Building with:\n" ; @@ -137,6 +137,9 @@ if ($build_jni){ ($files->{'jni.h'}->{selected}, $files->{'jni_md.h'}->{selected}) ; @main::L = map { Inline::Java::Portable::portable('SUB_FIX_MAKE_QUOTES', "-L$_") } ($files->{$jvm_lib}->{selected}) ; + if ($^O eq 'cygwin') { + push @main::L, Inline::Java::Portable::portable('SUB_FIX_MAKE_QUOTES', '-L' . Cwd::cwd); + } my $DIR = [] ; if (! defined($build_perl_interpreter)){ diff --git a/Java/jvm.def b/Java/jvm.def new file mode 100644 index 0000000..bdab35d --- /dev/null +++ b/Java/jvm.def @@ -0,0 +1,4 @@ +EXPORTS +JNI_CreateJavaVM@12 +JNI_GetDefaultJavaVMInitArgs@4 +JNI_GetCreatedJavaVMs@12 |