From d7a721027e770e8b267748644cd4160b8d9a88be Mon Sep 17 00:00:00 2001 From: jlam Date: Mon, 14 Oct 2002 12:10:54 +0000 Subject: Knock off a TODO item: when generating the internal list of acceptable JVMs from the package-provided PKG_JVM_ACCEPTED list, filter out those JVMs that aren't available for the current platform. This allows a package to simply list all JVMs that may be used to build it in PKG_JVM_ACCEPTED, regardless of platform issues, instead of having to construct a different PKG_JVM_ACCEPTED based on the platform we are using. --- mk/java.mk | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'mk/java.mk') diff --git a/mk/java.mk b/mk/java.mk index 97bada017eb..9fb20e70d50 100644 --- a/mk/java.mk +++ b/mk/java.mk @@ -1,4 +1,4 @@ -# $NetBSD: java.mk,v 1.4 2002/10/14 11:48:04 jlam Exp $ +# $NetBSD: java.mk,v 1.5 2002/10/14 12:10:54 jlam Exp $ # # This Makefile fragment handles Java dependencies and make variables, # and is meant to be included by packages that require Java either at @@ -9,7 +9,7 @@ # # * add a full dependency on the JRE and possibly a build dependency # on the JDK, based on the value of USE_JAVA (if nonempty). You -# must explicitly set USE_JAVA=build to add the build dependency +# must explicitly set USE_JAVA=run to _not_ add the build dependency # on the JDK; # # There are two variables used to tweak the JVM selection: @@ -19,13 +19,6 @@ # # PKG_JVMS_ACCEPTED is a package-settable list of JVMs that may be used as # possible dependencies for the package. -# -# TODO: -# -# * Have some way to specify which JVMs are acceptable for each -# platform, and use the intersection of these JVMs and the ones -# listed in PKG_JVMS_ACCEPTED as the JVMS that may really be used. -# Currently, we assume all of the JVMs are usable by all platforms. .if !defined(JAVA_MK) JAVA_MK= # defined @@ -39,7 +32,10 @@ USE_JAVA= run .endif PKG_JVM_DEFAULT?= # empty -PKG_JVMS_ACCEPTED?= jdk sun-jdk13 sun-jdk14 blackdown-jdk13 kaffe +PKG_JVMS_ACCEPTED?= ${_PKG_JVMS} + +# This is a list of all of the JVMs that may be used with java.mk. +_PKG_JVMS?= jdk sun-jdk13 sun-jdk14 blackdown-jdk13 kaffe # To be deprecated: if PKG_JVM is explicitly set, then use it as the # default JVM. Note that this has lower precedence than PKG_JVM_DEFAULT. @@ -68,8 +64,31 @@ _PKG_JVM_DEFAULT?= kaffe . endif .endif +# These lists are copied from the JVM package Makefiles. +_ONLY_FOR_PLATFORMS.jdk= \ + NetBSD-*-i386 Linux-*-i[3-6]86 +_ONLY_FOR_PLATFORMS.blackdown-jdk13= \ + NetBSD-*-i386 NetBSD-*-powerpc NetBSD-*-sparc \ + Linux-*-i[3-6]86 Linux-*-powerpc Linux-*-sparc +.if ${USE_JAVA} == "run" +_ONLY_FOR_PLATFORMS.blackdown-jdk13+= \ + NetBSD-*-arm Linux-*-arm +.endif +_ONLY_FOR_PLATFORMS.sun-jdk13= \ + NetBSD-*-i386 Linux-*-i[3-6]86 Darwin-*-* +_ONLY_FOR_PLATFORMS.sun-jdk14= \ + NetBSD-1.5Z[A-Z]-i386 NetBSD-1.[6-9]*-i386 Linux-*-i[3-6]86 +_ONLY_FOR_PLATFORMS.kaffe= \ + *-*-arm32 *-*-i386 *-*-m68k *-*-mips* *-*-sparc *-*-powerpc + # Set the accepted JVMs for this platform. -_PKG_JVMS_ACCEPTED= ${PKG_JVMS_ACCEPTED} +.for _jvm_ in ${_PKG_JVMS} +. for _pattern_ in ${_ONLY_FOR_PLATFORMS.${_jvm_}} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) +_PKG_JVMS_ACCEPTED+= ${PKG_JVMS_ACCEPTED:M${_jvm_}} +. endif +. endfor +.endfor _JAVA_PKGBASE.jdk= jdk _JAVA_PKGBASE.sun-jdk13= sun-jdk13 -- cgit v1.2.3