[libinline-java-perl] 70/398: *** empty log message ***

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:42:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit 9d933461d5c366ed6dab3a86bf808e326cc8a8da
Author: patrick <>
Date:   Fri Apr 20 14:05:48 2001 +0000

    *** empty log message ***
---
 Java/Makefile.PL | 50 ++++++++++++++++++++++++--------------------------
 Makefile.PL      | 21 +++++++++++++++++++++
 2 files changed, 45 insertions(+), 26 deletions(-)

diff --git a/Java/Makefile.PL b/Java/Makefile.PL
index 9bb01ad..f3cc954 100644
--- a/Java/Makefile.PL
+++ b/Java/Makefile.PL
@@ -3,6 +3,15 @@ use File::Find ;
 
 use strict ;
 
+
+# Inherited from the parent Makefile.PL
+if (! defined($main::JNI_BUILD)){
+	$main::JNI_BUILD = 0 ;
+}
+
+my $JNI_BUILD = $main::JNI_BUILD ;
+
+
 # Define these variables with the correct values to bypass the
 # rest of the code that looks for them.
 my $java_include = 		undef ;
@@ -10,22 +19,20 @@ my $java_include_os = 	undef ;
 my $java_lib = 			undef ;
 my $java_so = 			undef ;
 
+
 my $jvm_lib = ($^O eq "MSWin32" ? "jvm.lib" : "libjvm.so") ;
 my $jvm_so =  ($^O eq "MSWin32" ? "jvm.dll" : "libjvm.so") ;
 
 
-my $q = "\nInline::Java has an optional JNI extension (see README for more " .
-	"information).\nDo you want to build the JNI extension" ;
-
-my $jni = AskYN($q) ;
-
-if ($jni){
+if ($JNI_BUILD){
 	if ((! defined($java_include))&&
 		(! defined($java_include_os))&&
 		(! defined($java_lib))&&
 		(! defined($java_so))){
+		print "\nBuilding JNI extension.\n" ;
+
 		# We need to find the files in order to be able to build
-		$q = "\nWhat is the path to your Java installation" ;
+		my $q = "\nEnter the path to your Java 2 SDK installation" ;
 		my $jh = Ask($q) ;
 		chomp($jh) ;
 		if (! -d $jh){
@@ -47,7 +54,7 @@ if ($jni){
 			die("Couldn't find $jvm_so.") ;
 		}
 	}
-	
+
 	if ($^O eq "MSWin32"){
 		my $l = join(" or ", @{$java_so}) ;
 		print "\nNote: You will need to add $l to your PATH environment " .
@@ -55,34 +62,25 @@ if ($jni){
 	}
 
 	print "\n" ;
-	
 }
 else{
-	# We need to rename the JNI.xs file so that the extension is not built
-	rename("JNI.xs", "JNI.xs_") ;	
+	rename("JNI.xs", "JNI.xs_") ;
 }
 
 
-my %h = (
+ExtUtils::MakeMaker::WriteMakefile(
 	NAME => 'Inline::Java::JNI',
 	VERSION_FROM => 'JNI.pm',
-) ;
-
-if ($jni){
-	$h{INC} = join(" ", 
+	INC => join(" ", 
 		"-I$java_include",
 		"-I$java_include_os"
-	) ;
-	$h{LIBS} = [
-		"-L$java_lib -ljvm"
-	] ;
-}
-
-ExtUtils::MakeMaker::WriteMakefile(%h) ;
-
+	),
+	LIBS => (! $JNI_BUILD ? undef :
+		[
+			"-L$java_lib -ljvm"
+		]),
+) ;
 
-# Restore the JNI.xs file
-rename("JNI.xs_", "JNI.xs") ;
 
 
 #################################################
diff --git a/Makefile.PL b/Makefile.PL
index 1b6be30..7e1de21 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,5 +1,26 @@
 use ExtUtils::MakeMaker;
 
+
+# So that the the sub dir Makefile.PL will see it...
+$main::JNI_BUILD = 0 ;
+
+
+# In case we had built differently a previous time
+rename("Java/JNI.xs_", "Java/JNI.xs") ;
+
+
+foreach my $arg (@ARGV){
+	my $a = $arg ;
+	$a =~ s/^\s+// ;
+	$a =~ s/\s+$// ;
+
+	if ($a =~ /^JNI$/i){
+		$JNI_BUILD = 1 ;
+		last ;
+	}
+}
+
+
 WriteMakefile(
 	NAME => 'Inline::Java',
 	VERSION_FROM => 'Java.pm',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list