2008-10-25 20:04:27 +02:00
|
|
|
# $NetBSD: java-vm.mk,v 1.66 2008/10/25 18:04:27 adrianp Exp $
|
2002-10-13 11:29:12 +02:00
|
|
|
#
|
|
|
|
# This Makefile fragment handles Java dependencies and make variables,
|
|
|
|
# and is meant to be included by packages that require Java either at
|
2006-11-04 22:02:57 +01:00
|
|
|
# build-time or at run-time.
|
2002-10-13 11:29:12 +02:00
|
|
|
#
|
2006-11-04 22:02:57 +01:00
|
|
|
# User-settable variables:
|
2002-10-13 11:29:12 +02:00
|
|
|
#
|
2006-11-04 22:02:57 +01:00
|
|
|
# PKG_JVM_DEFAULT
|
|
|
|
# The JVM that should be used if nothing particular is specified.
|
2002-10-13 11:29:12 +02:00
|
|
|
#
|
2008-03-25 14:41:44 +01:00
|
|
|
# Possible values: jdk kaffe
|
2008-01-19 06:04:00 +01:00
|
|
|
# sun-jdk14 jdk14 sun-jdk15 sun-jdk6 jdk15
|
2006-11-04 22:02:57 +01:00
|
|
|
# Default value: (platform-dependent)
|
2003-05-25 20:39:12 +02:00
|
|
|
#
|
2006-11-04 22:02:57 +01:00
|
|
|
# Package-settable variables:
|
2002-12-31 15:42:21 +01:00
|
|
|
#
|
2006-11-04 22:02:57 +01:00
|
|
|
# USE_JAVA
|
|
|
|
# When set to "yes", a build-time dependency on the JDK is added.
|
|
|
|
# When set to "run", a run-time dependency on the JRE is added.
|
2002-10-13 11:29:12 +02:00
|
|
|
#
|
2006-11-04 22:02:57 +01:00
|
|
|
# Possible values: yes run
|
|
|
|
# Default value: yes
|
|
|
|
#
|
|
|
|
# USE_JAVA2
|
|
|
|
# When the package needs a Java 2 implementation, this variable
|
2007-02-18 20:12:07 +01:00
|
|
|
# should be set to "yes". It can also be set to "1.4", "1.5",
|
|
|
|
# or "6" require an even more recent implementation.
|
2006-11-04 22:02:57 +01:00
|
|
|
#
|
2007-02-18 20:12:07 +01:00
|
|
|
# Possible values: yes no 1.4 1.5 6
|
2006-11-04 22:22:30 +01:00
|
|
|
# Default value: no
|
2006-11-04 22:02:57 +01:00
|
|
|
#
|
|
|
|
# PKG_JVMS_ACCEPTED
|
|
|
|
# The list of JVMs that may be used as possible implementations.
|
|
|
|
#
|
|
|
|
# Variables set by this file:
|
|
|
|
#
|
2007-06-05 15:35:06 +02:00
|
|
|
# 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.
|
|
|
|
#
|
2006-11-04 22:02:57 +01:00
|
|
|
# PKG_JVM
|
|
|
|
# The name of the selected Java implementation.
|
|
|
|
#
|
|
|
|
# PKG_JAVA_HOME
|
|
|
|
# The directory where the JVM is installed.
|
2002-10-13 11:29:12 +02:00
|
|
|
#
|
|
|
|
|
2002-12-26 21:52:09 +01:00
|
|
|
.if !defined(JAVA_VM_MK)
|
|
|
|
JAVA_VM_MK= # defined
|
2002-10-13 11:29:12 +02:00
|
|
|
|
2007-06-05 15:35:06 +02:00
|
|
|
_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
|
|
|
|
|
2002-10-13 11:29:12 +02:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2002-12-31 15:39:59 +01:00
|
|
|
USE_JAVA?= yes
|
2006-11-04 22:22:30 +01:00
|
|
|
USE_JAVA2?= no
|
2002-10-13 11:29:12 +02:00
|
|
|
|
|
|
|
PKG_JVM_DEFAULT?= # empty
|
2002-10-14 14:10:54 +02:00
|
|
|
PKG_JVMS_ACCEPTED?= ${_PKG_JVMS}
|
|
|
|
|
2007-02-16 12:13:02 +01:00
|
|
|
# This is a list of all of the JDKs that may be used.
|
2002-12-31 15:39:59 +01:00
|
|
|
#
|
2007-02-18 20:12:07 +01:00
|
|
|
_PKG_JVMS.6= sun-jdk6
|
2008-01-19 06:04:00 +01:00
|
|
|
_PKG_JVMS.1.5= ${_PKG_JVMS.6} sun-jdk15 jdk15
|
2006-11-04 22:22:30 +01:00
|
|
|
_PKG_JVMS.1.4= ${_PKG_JVMS.1.5} sun-jdk14 jdk14
|
2008-03-25 14:41:44 +01:00
|
|
|
_PKG_JVMS.yes= ${_PKG_JVMS.1.4} kaffe
|
2006-11-04 22:22:30 +01:00
|
|
|
_PKG_JVMS.no= ${_PKG_JVMS.yes} jdk
|
|
|
|
_PKG_JVMS= ${_PKG_JVMS.${USE_JAVA2}}
|
2002-10-13 11:29:12 +02:00
|
|
|
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
.if defined(PKG_JVM)
|
|
|
|
. if !empty(PKG_JVM)
|
|
|
|
_PKG_JVM_DEFAULT:= ${PKG_JVM}
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Set the default JVM for this platform.
|
|
|
|
#
|
|
|
|
.if !empty(PKG_JVM_DEFAULT)
|
|
|
|
_PKG_JVM_DEFAULT= ${PKG_JVM_DEFAULT}
|
|
|
|
.endif
|
|
|
|
.if !defined(_PKG_JVM_DEFAULT)
|
|
|
|
. if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || \
|
|
|
|
!empty(MACHINE_PLATFORM:MLinux-*-i[3456]86)
|
2007-02-23 00:52:58 +01:00
|
|
|
_PKG_JVM_DEFAULT?= sun-jdk
|
2002-10-13 11:29:12 +02:00
|
|
|
. elif !empty(MACHINE_PLATFORM:MDarwin-*-*)
|
|
|
|
_PKG_JVM_DEFAULT?= sun-jdk
|
2008-10-25 01:17:30 +02:00
|
|
|
. elif !empty(MACHINE_PLATFORM:MSunOS-5.11-i386)
|
|
|
|
_PKG_JVM_DEFAULT?= sun-jdk
|
2002-10-13 11:29:12 +02:00
|
|
|
. else
|
|
|
|
_PKG_JVM_DEFAULT?= kaffe
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
2002-10-14 14:10:54 +02:00
|
|
|
# These lists are copied from the JVM package Makefiles.
|
2004-10-11 15:38:18 +02:00
|
|
|
_ONLY_FOR_PLATFORMS.jdk= \
|
2007-02-16 12:13:02 +01:00
|
|
|
DragonFly-*-i386 \
|
|
|
|
Linux-*-i[3-6]86 \
|
|
|
|
NetBSD-*-i386
|
2004-10-11 15:38:18 +02:00
|
|
|
_ONLY_FOR_PLATFORMS.jdk14= \
|
2007-02-16 12:13:02 +01:00
|
|
|
DragonFly-*-i386 \
|
|
|
|
NetBSD-[2-9].*-i386
|
2007-06-11 09:03:18 +02:00
|
|
|
_ONLY_FOR_PLATFORMS.jdk15= \
|
|
|
|
DragonFly-*-i386 \
|
|
|
|
NetBSD-[2-9].*-i386
|
2004-10-11 15:38:18 +02:00
|
|
|
_ONLY_FOR_PLATFORMS.kaffe= \
|
|
|
|
*-*-alpha *-*-arm *-*-arm32 *-*-i386 *-*-m68k *-*-mips* *-*-sparc *-*-powerpc
|
2002-10-14 14:10:54 +02:00
|
|
|
_ONLY_FOR_PLATFORMS.sun-jdk14= \
|
2007-02-16 12:13:02 +01:00
|
|
|
Darwin-[678].*-* \
|
|
|
|
DragonFly-*-i386 \
|
|
|
|
FreeBSD-6.*-i386 \
|
|
|
|
Linux-*-i[3-6]86 \
|
2008-10-25 20:04:27 +02:00
|
|
|
NetBSD-*-i386
|
2004-10-01 01:50:33 +02:00
|
|
|
_ONLY_FOR_PLATFORMS.sun-jdk15= \
|
2007-11-18 23:17:50 +01:00
|
|
|
Darwin-[8-9].*-* \
|
2007-02-16 12:13:02 +01:00
|
|
|
DragonFly-*-i386 \
|
|
|
|
FreeBSD-6.*-i386 \
|
|
|
|
Linux-*-i[3-6]86 \
|
2008-10-25 20:04:27 +02:00
|
|
|
NetBSD-*-i386 NetBSD-*-x86_64
|
2007-02-18 20:12:07 +01:00
|
|
|
_ONLY_FOR_PLATFORMS.sun-jdk6= \
|
2008-10-24 23:01:57 +02:00
|
|
|
Darwin-9.*-* \
|
2007-02-18 20:12:07 +01:00
|
|
|
DragonFly-*-i386 \
|
|
|
|
FreeBSD-6.*-i386 \
|
|
|
|
Linux-*-i[3-6]86 \
|
2008-10-25 01:17:30 +02:00
|
|
|
NetBSD-*-i386 \
|
|
|
|
SunOS-5.11-i386
|
2002-10-14 14:10:54 +02:00
|
|
|
|
2002-10-13 11:29:12 +02:00
|
|
|
# Set the accepted JVMs for this platform.
|
2002-10-14 14:10:54 +02:00
|
|
|
.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
|
2002-10-13 11:29:12 +02:00
|
|
|
|
|
|
|
_JAVA_PKGBASE.jdk= jdk
|
2004-06-03 22:19:08 +02:00
|
|
|
_JAVA_PKGBASE.jdk14= jdk14
|
2007-06-11 09:03:18 +02:00
|
|
|
_JAVA_PKGBASE.jdk15= jdk15
|
2004-10-11 15:38:18 +02:00
|
|
|
_JAVA_PKGBASE.kaffe= kaffe
|
2005-04-20 15:17:40 +02:00
|
|
|
_JAVA_PKGBASE.sun-jdk14= sun-jre14
|
|
|
|
_JAVA_PKGBASE.sun-jdk15= sun-jre15
|
2007-02-18 20:12:07 +01:00
|
|
|
_JAVA_PKGBASE.sun-jdk6= sun-jre6
|
2002-10-13 11:29:12 +02:00
|
|
|
|
2007-06-05 15:35:06 +02:00
|
|
|
# The following is copied from the respective JVM Makefiles.
|
|
|
|
_JAVA_NAME.jdk= jdk11
|
|
|
|
_JAVA_NAME.jdk14= jdk14
|
|
|
|
_JAVA_NAME.kaffe= kaffe
|
|
|
|
_JAVA_NAME.sun-jdk14= sun14
|
|
|
|
_JAVA_NAME.sun-jdk15= sun15
|
|
|
|
_JAVA_NAME.sun-jdk6= sun6
|
|
|
|
|
2002-10-13 11:29:12 +02:00
|
|
|
# Mark the acceptable JVMs and check which JVM packages are installed.
|
|
|
|
.for _jvm_ in ${_PKG_JVMS_ACCEPTED}
|
|
|
|
_PKG_JVM_OK.${_jvm_}= yes
|
|
|
|
_PKG_JVM_INSTALLED.${_jvm_}!= \
|
|
|
|
if ${PKG_INFO} -qe ${_JAVA_PKGBASE.${_jvm_}}; then \
|
|
|
|
${ECHO} yes; \
|
|
|
|
else \
|
|
|
|
${ECHO} no; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
|
2008-03-25 14:41:44 +01:00
|
|
|
# Convert "sun-jdk" into "sun-jdk1[45]" depending on the
|
|
|
|
# platform. Recent versions of NetBSD and Linux can use the 1.4-1.5
|
2004-10-01 01:50:33 +02:00
|
|
|
# versions of the Sun JDK, so default to the newer installed one.
|
2002-10-13 11:29:12 +02:00
|
|
|
#
|
|
|
|
.if ${_PKG_JVM_DEFAULT} == "sun-jdk"
|
2003-05-09 13:31:46 +02:00
|
|
|
. if !empty(MACHINE_PLATFORM:MNetBSD-1.6[M-Z]*-i386) || \
|
2004-06-03 22:19:08 +02:00
|
|
|
!empty(MACHINE_PLATFORM:MNetBSD-[2-9].*-i386) || \
|
2006-05-10 09:25:03 +02:00
|
|
|
!empty(MACHINE_PLATFORM:MLinux-*-i[3456]86) || \
|
2008-10-25 01:17:30 +02:00
|
|
|
!empty(MACHINE_PLATFORM:MDarwin-[8-9].*-*) || \
|
|
|
|
!empty(MACHINE_PLATFORM:MSunOS-5.11-i386)
|
2008-01-19 06:04:00 +01:00
|
|
|
. if defined(_PKG_JVM_INSTALLED.sun-jdk6) && \
|
2007-02-18 20:12:07 +01:00
|
|
|
(${_PKG_JVM_INSTALLED.sun-jdk6} == "yes")
|
|
|
|
_PKG_JVM_DEFAULT= sun-jdk6
|
2006-05-15 21:44:06 +02:00
|
|
|
. elif defined(_PKG_JVM_INSTALLED.sun-jdk15) && \
|
2004-10-01 01:50:33 +02:00
|
|
|
(${_PKG_JVM_INSTALLED.sun-jdk15} == "yes")
|
|
|
|
_PKG_JVM_DEFAULT= sun-jdk15
|
|
|
|
. elif defined(_PKG_JVM_INSTALLED.sun-jdk14) && \
|
2002-10-13 11:29:12 +02:00
|
|
|
(${_PKG_JVM_INSTALLED.sun-jdk14} == "yes")
|
|
|
|
_PKG_JVM_DEFAULT= sun-jdk14
|
|
|
|
. else
|
2004-10-01 01:50:33 +02:00
|
|
|
_PKG_JVM_DEFAULT= sun-jdk15
|
2002-10-13 11:29:12 +02:00
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Use one of the installed JVMs,...
|
|
|
|
#
|
|
|
|
.if !defined(_PKG_JVM)
|
|
|
|
. for _jvm_ in ${_PKG_JVMS_ACCEPTED}
|
|
|
|
. if !empty(_PKG_JVM_INSTALLED.${_jvm_}:M[yY][eE][sS])
|
|
|
|
_PKG_JVM?= ${_jvm_}
|
|
|
|
. else
|
|
|
|
_PKG_JVM_FIRSTACCEPTED?= ${_jvm_}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
#
|
|
|
|
# ...otherwise, prefer the default one if it's accepted,...
|
|
|
|
#
|
|
|
|
. if defined(_PKG_JVM_OK.${_PKG_JVM_DEFAULT}) && \
|
|
|
|
!empty(_PKG_JVM_OK.${_PKG_JVM_DEFAULT}:M[yY][eE][sS])
|
|
|
|
_PKG_JVM= ${_PKG_JVM_DEFAULT}
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
#
|
|
|
|
# ...otherwise, just use the first accepted JVM.
|
|
|
|
#
|
|
|
|
.if !defined(_PKG_JVM)
|
2002-10-14 09:25:04 +02:00
|
|
|
. if defined(_PKG_JVM_FIRSTACCEPTED)
|
|
|
|
_PKG_JVM= ${_PKG_JVM_FIRSTACCEPTED}
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
#
|
|
|
|
# If there are no acceptable JVMs, then generate an error.
|
|
|
|
#
|
|
|
|
.if !defined(_PKG_JVM)
|
|
|
|
# force an error
|
2007-02-10 09:59:07 +01:00
|
|
|
PKG_FAIL_REASON= "no acceptable JVM found"
|
2003-02-06 11:17:38 +01:00
|
|
|
_PKG_JVM= "none"
|
2002-10-13 11:29:12 +02:00
|
|
|
.endif
|
|
|
|
|
2006-04-06 08:21:32 +02:00
|
|
|
BUILDLINK_API_DEPENDS.jdk?= jdk-[0-9]*
|
|
|
|
BUILDLINK_API_DEPENDS.jdk14?= jdk14-[0-9]*
|
2007-06-11 09:03:18 +02:00
|
|
|
BUILDLINK_API_DEPENDS.jdk15?= jdk15-[0-9]*
|
2006-04-06 08:21:32 +02:00
|
|
|
BUILDLINK_API_DEPENDS.kaffe?= kaffe>=1.1.4
|
|
|
|
BUILDLINK_API_DEPENDS.sun-jdk14?= sun-jdk14-[0-9]*
|
|
|
|
BUILDLINK_API_DEPENDS.sun-jre14?= sun-jre14-[0-9]*
|
|
|
|
BUILDLINK_API_DEPENDS.sun-jdk15?= sun-jdk15-[0-9]*
|
|
|
|
BUILDLINK_API_DEPENDS.sun-jre15?= sun-jre15-[0-9]*
|
2007-02-18 20:12:07 +01:00
|
|
|
BUILDLINK_API_DEPENDS.sun-jdk6?= sun-jdk6-[0-9]*
|
|
|
|
BUILDLINK_API_DEPENDS.sun-jre6?= sun-jre6-[0-9]*
|
2004-07-14 15:37:09 +02:00
|
|
|
|
2003-01-29 21:52:01 +01:00
|
|
|
_JRE.jdk= jdk
|
2004-06-03 22:19:08 +02:00
|
|
|
_JRE.jdk14= jdk14
|
2007-06-11 09:03:18 +02:00
|
|
|
_JRE.jdk15= jdk15
|
2004-10-11 15:38:18 +02:00
|
|
|
_JRE.kaffe= kaffe
|
2003-01-29 21:52:01 +01:00
|
|
|
_JRE.sun-jdk14= sun-jre14
|
2004-10-01 01:50:33 +02:00
|
|
|
_JRE.sun-jdk15= sun-jre15
|
2007-02-18 20:12:07 +01:00
|
|
|
_JRE.sun-jdk6= sun-jre6
|
2003-01-29 21:52:01 +01:00
|
|
|
|
2003-01-29 10:34:29 +01:00
|
|
|
_JAVA_BASE_CLASSES= classes.zip
|
|
|
|
|
2008-03-25 14:41:44 +01:00
|
|
|
.if ${_PKG_JVM} == "jdk"
|
2002-10-13 11:29:12 +02:00
|
|
|
_JDK_PKGSRCDIR= ../../lang/jdk
|
2003-01-29 21:52:01 +01:00
|
|
|
_JRE_PKGSRCDIR= ${_JDK_PKGSRCDIR}
|
2002-10-13 11:29:12 +02:00
|
|
|
_JAVA_HOME_DEFAULT= ${LOCALBASE}/java/jdk-1.1.8
|
2004-06-03 22:19:08 +02:00
|
|
|
.elif ${_PKG_JVM} == "jdk14"
|
|
|
|
_JDK_PKGSRCDIR= ../../wip/jdk14
|
|
|
|
_JRE_PKGSRCDIR= ${_JDK_PKGSRCDIR}
|
|
|
|
_JAVA_HOME_DEFAULT= ${LOCALBASE}/java/jdk-1.4.2
|
2007-06-11 09:03:18 +02:00
|
|
|
.elif ${_PKG_JVM} == "jdk15"
|
|
|
|
_JDK_PKGSRCDIR= ../../wip/jdk15
|
|
|
|
_JRE_PKGSRCDIR= ${_JDK_PKGSRCDIR}
|
|
|
|
_JAVA_HOME_DEFAULT= ${LOCALBASE}/java/jdk-1.5.0
|
2004-10-11 15:38:18 +02:00
|
|
|
.elif ${_PKG_JVM} == "kaffe"
|
|
|
|
_JDK_PKGSRCDIR= ../../lang/kaffe
|
|
|
|
_JRE_PKGSRCDIR= ${_JDK_PKGSRCDIR}
|
|
|
|
_JAVA_HOME_DEFAULT= ${LOCALBASE}/java/kaffe
|
2002-10-13 11:29:12 +02:00
|
|
|
.elif ${_PKG_JVM} == "sun-jdk14"
|
|
|
|
_JDK_PKGSRCDIR= ../../lang/sun-jdk14
|
|
|
|
_JRE_PKGSRCDIR= ../../lang/sun-jre14
|
2003-01-29 20:35:41 +01:00
|
|
|
_JAVA_HOME_DEFAULT= ${LOCALBASE}/java/sun-1.4
|
2004-10-01 01:50:33 +02:00
|
|
|
.elif ${_PKG_JVM} == "sun-jdk15"
|
|
|
|
_JDK_PKGSRCDIR= ../../lang/sun-jdk15
|
|
|
|
_JRE_PKGSRCDIR= ../../lang/sun-jre15
|
|
|
|
_JAVA_HOME_DEFAULT= ${LOCALBASE}/java/sun-1.5
|
2002-10-13 11:29:12 +02:00
|
|
|
UNLIMIT_RESOURCES+= datasize
|
2007-02-18 20:12:07 +01:00
|
|
|
.elif ${_PKG_JVM} == "sun-jdk6"
|
|
|
|
_JDK_PKGSRCDIR= ../../lang/sun-jdk6
|
|
|
|
_JRE_PKGSRCDIR= ../../lang/sun-jre6
|
|
|
|
_JAVA_HOME_DEFAULT= ${LOCALBASE}/java/sun-6
|
|
|
|
UNLIMIT_RESOURCES+= datasize
|
2002-10-13 11:29:12 +02:00
|
|
|
.endif
|
|
|
|
|
2004-06-09 10:20:22 +02:00
|
|
|
.if defined(_JAVA_HOME_DEFAULT)
|
|
|
|
_JAVA_HOME= ${_JAVA_HOME_DEFAULT}
|
|
|
|
.else
|
2002-10-13 11:29:12 +02:00
|
|
|
EVAL_PREFIX+= _JAVA_HOME=${_JAVA_PKGBASE.${_PKG_JVM}}
|
2004-06-09 10:20:22 +02:00
|
|
|
.endif
|
2002-10-13 11:29:12 +02:00
|
|
|
|
|
|
|
# We always need a run-time dependency on the JRE.
|
2003-02-07 00:44:07 +01:00
|
|
|
.if defined(_JRE_PKGSRCDIR)
|
2005-03-24 18:46:00 +01:00
|
|
|
. if exists(${_JRE_PKGSRCDIR}/buildlink3.mk)
|
|
|
|
. include "${_JRE_PKGSRCDIR}/buildlink3.mk"
|
2004-05-02 22:30:44 +02:00
|
|
|
. endif
|
2003-02-07 00:44:07 +01:00
|
|
|
.endif
|
2002-10-13 11:29:12 +02:00
|
|
|
|
|
|
|
# If we are building Java software, then we need a build-time dependency on
|
|
|
|
# the JDK.
|
|
|
|
#
|
2002-12-31 15:39:59 +01:00
|
|
|
.if empty(USE_JAVA:M[rR][uU][nN])
|
2004-05-02 22:30:44 +02:00
|
|
|
. if defined(_JDK_PKGSRCDIR)
|
2005-03-24 18:46:00 +01:00
|
|
|
. if exists(${_JDK_PKGSRCDIR}/buildlink3.mk)
|
|
|
|
. include "${_JDK_PKGSRCDIR}/buildlink3.mk"
|
2004-05-02 22:30:44 +02:00
|
|
|
. endif
|
2002-10-13 11:29:12 +02:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
PKG_JVM:= ${_PKG_JVM}
|
|
|
|
.if defined(BUILDLINK_JAVA_PREFIX.${_PKG_JVM})
|
|
|
|
PKG_JAVA_HOME?= ${BUILDLINK_JAVA_PREFIX.${_PKG_JVM}}
|
|
|
|
.else
|
|
|
|
PKG_JAVA_HOME?= ${_JAVA_HOME}
|
|
|
|
.endif
|
2005-01-24 20:32:33 +01:00
|
|
|
.if !defined(CLASSPATH)
|
|
|
|
CLASSPATH_cmd= ${ECHO} `for p in \
|
|
|
|
${PKG_JAVA_HOME}/lib/${_JAVA_BASE_CLASSES} \
|
|
|
|
${PKG_JAVA_HOME}/lib/tools.jar; do \
|
|
|
|
${TEST} ! -f $$p || ${ECHO} $$p; done` \
|
|
|
|
. | ${TR} ' ' :
|
|
|
|
CLASSPATH?= ${CLASSPATH_cmd:sh}
|
|
|
|
.endif
|
|
|
|
|
2005-02-11 17:36:49 +01:00
|
|
|
ALL_ENV+= CLASSPATH=${CLASSPATH:Q}
|
|
|
|
ALL_ENV+= JAVA_HOME=${PKG_JAVA_HOME}
|
2007-06-05 15:35:06 +02:00
|
|
|
BUILD_DEFS+= ${_USER_VARS.java}
|
|
|
|
BUILD_DEFS_EFFECTS+= ${_SYS_VARS.java}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= PKG_JVM=${PKG_JVM:Q}
|
2005-01-24 20:32:33 +01:00
|
|
|
PREPEND_PATH+= ${PKG_JAVA_HOME}/bin
|
2007-06-05 15:35:06 +02:00
|
|
|
JAVA_BINPREFIX= ${LOCALBASE}/bin/${_JAVA_NAME.${_PKG_JVM}}
|
2002-10-13 11:29:12 +02:00
|
|
|
|
2007-08-02 20:04:48 +02:00
|
|
|
PLIST_SUBST+= PKG_JAVA_HOME=${PKG_JAVA_HOME:Q}
|
|
|
|
FILES_SUBST+= PKG_JAVA_HOME=${PKG_JAVA_HOME:Q}
|
|
|
|
|
2002-12-26 21:52:09 +01:00
|
|
|
.endif # JAVA_VM_MK
|