pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Added the variable JAVA_BINPREFIX containing the pr...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0b3a41d97c36
branches:  trunk
changeset: 529470:0b3a41d97c36
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Jun 05 13:35:06 2007 +0000

description:
Added the variable JAVA_BINPREFIX containing the prefix to the wrapped
Java binaries. This makes it easier for packages to call the wrapper
instead of the direct binary. See games/cgoban-java/Makefile revision
1.39 for the current approach and the following revision for the simpler
one.

Added _VARGROUPS. Doing that, I realized that BUILD_DEFS corresponds to
_USER_VARS.* and BUILD_DEFS_EFFECTS to _SYS_VARS.*. This redundancy may
be removed in the future.

Removed a redundant comment.

diffstat:

 mk/java-vm.mk |  37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 deletions(-)

diffs (80 lines):

diff -r 3f782cf5b8e1 -r 0b3a41d97c36 mk/java-vm.mk
--- a/mk/java-vm.mk     Tue Jun 05 13:19:10 2007 +0000
+++ b/mk/java-vm.mk     Tue Jun 05 13:35:06 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: java-vm.mk,v 1.57 2007/04/04 14:32:52 tv Exp $
+# $NetBSD: java-vm.mk,v 1.58 2007/06/05 13:35:06 rillig Exp $
 #
 # This Makefile fragment handles Java dependencies and make variables,
 # and is meant to be included by packages that require Java either at
@@ -35,6 +35,14 @@
 #
 # Variables set by this file:
 #
+# JAVA_BINPREFIX
+#      The prefix for the Java binaries. The path to the real binaries
+#      is constructed by appending -${program} to it.
+#
+#      Examples:
+#      * ${JAVA_BINPREFIX}-java is the path to the Java interpreter.
+#      * ${JAVA_BINPREFIX}-javac is the path to the Java compiler.
+#
 # PKG_JVM
 #      The name of the selected Java implementation.
 #
@@ -45,6 +53,11 @@
 .if !defined(JAVA_VM_MK)
 JAVA_VM_MK=    # defined
 
+_VARGROUPS+=           java
+_USER_VARS.java=       PKG_JVM_DEFAULT
+_PKG_VARS.java=                USE_JAVA USE_JAVA2 PKG_JVMS_ACCEPTED
+_SYS_VARS.java=                PKG_JVM PKG_JAVA_HOME JAVA_BINPREFIX
+
 .include "../../mk/bsd.prefs.mk"
 
 USE_JAVA?=     yes
@@ -153,6 +166,17 @@
 _JAVA_PKGBASE.sun-jdk15=       sun-jre15
 _JAVA_PKGBASE.sun-jdk6=                sun-jre6
 
+# The following is copied from the respective JVM Makefiles.
+_JAVA_NAME.blackdown-jdk13=    blackdown13
+_JAVA_NAME.jdk=                        jdk11
+_JAVA_NAME.jdk14=              jdk14
+_JAVA_NAME.kaffe=              kaffe
+_JAVA_NAME.scsl-jre15=         scsl15
+_JAVA_NAME.sun-jdk13=          sun13
+_JAVA_NAME.sun-jdk14=          sun14
+_JAVA_NAME.sun-jdk15=          sun15
+_JAVA_NAME.sun-jdk6=           sun6
+
 # Mark the acceptable JVMs and check which JVM packages are installed.
 .for _jvm_ in ${_PKG_JVMS_ACCEPTED}
 _PKG_JVM_OK.${_jvm_}=  yes
@@ -329,12 +353,6 @@
 .  endif
 .endif
 
-# PKG_JVM is a publicly readable variable containing the name of the JVM
-#      we will be using.
-#
-# PKG_JAVA_HOME is a publicly readable variable containing ${JAVA_HOME}
-#      for the PKG_JVM described above.
-#
 PKG_JVM:=              ${_PKG_JVM}
 .if defined(BUILDLINK_JAVA_PREFIX.${_PKG_JVM})
 PKG_JAVA_HOME?=                ${BUILDLINK_JAVA_PREFIX.${_PKG_JVM}}
@@ -352,9 +370,10 @@
 
 ALL_ENV+=              CLASSPATH=${CLASSPATH:Q}
 ALL_ENV+=              JAVA_HOME=${PKG_JAVA_HOME}
-BUILD_DEFS+=           PKG_JVM_DEFAULT
-BUILD_DEFS_EFFECTS+=   PKG_JVM PKG_JAVA_HOME
+BUILD_DEFS+=           ${_USER_VARS.java}
+BUILD_DEFS_EFFECTS+=   ${_SYS_VARS.java}
 MAKEFLAGS+=            PKG_JVM=${PKG_JVM:Q}
 PREPEND_PATH+=         ${PKG_JAVA_HOME}/bin
+JAVA_BINPREFIX=                ${LOCALBASE}/bin/${_JAVA_NAME.${_PKG_JVM}}
 
 .endif # JAVA_VM_MK



Home | Main Index | Thread Index | Old Index