Changeset View
Changeset View
Standalone View
Standalone View
Mk/bsd.java.mk
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | |||||
# Stage 1: Define constants | # Stage 1: Define constants | ||||
# Stage 2: Determine which JDK ports are installed and which JDK ports are | # Stage 2: Determine which JDK ports are installed and which JDK ports are | ||||
# suitable | # suitable | ||||
# Stage 3: Decide the exact JDK to use (or install) | # Stage 3: Decide the exact JDK to use (or install) | ||||
# Stage 4: Add any dependencies if necessary | # Stage 4: Add any dependencies if necessary | ||||
# Stage 5: Define all settings for the port to use | # Stage 5: Define all settings for the port to use | ||||
# | # | ||||
. if defined(USE_JAVA) | . if defined(USE_JAVA) | ||||
. if !defined(JAVA_VERSION) && empty(USE_JAVA:C/[0-9]*[\.]*[0-9]*[+]*//) | . if !defined(JAVA_VERSION) && empty(USE_JAVA:C/[0-9]*[\.]*[0-9]*[+]*//) | ||||
JAVA_VERSION=${USE_JAVA} | JAVA_VERSION=${USE_JAVA} | ||||
. endif | . endif | ||||
#------------------------------------------------------------------------------- | #------------------------------------------------------------------------------- | ||||
# Stage 1: Define constants | # Stage 1: Define constants | ||||
# | # | ||||
# System-global directories | # System-global directories | ||||
# NB: If the value of JAVALIBDIR is altered here it must also be altered | # NB: If the value of JAVALIBDIR is altered here it must also be altered | ||||
# in java/javavmwrapper/Makefile. | # in java/javavmwrapper/Makefile. | ||||
JAVASHAREDIR?= ${PREFIX}/share/java | JAVASHAREDIR?= ${PREFIX}/share/java | ||||
JAVAJARDIR?= ${JAVASHAREDIR}/classes | JAVAJARDIR?= ${JAVASHAREDIR}/classes | ||||
JAVALIBDIR?= ${LOCALBASE}/share/java/classes | JAVALIBDIR?= ${LOCALBASE}/share/java/classes | ||||
# Add appropriate substitutions to PLIST_SUB and LIST_SUB | # Add appropriate substitutions to PLIST_SUB and LIST_SUB | ||||
PLIST_SUB+= JAVASHAREDIR="${JAVASHAREDIR:S,^${PREFIX}/,,}" \ | PLIST_SUB+= JAVASHAREDIR="${JAVASHAREDIR:S,^${PREFIX}/,,}" \ | ||||
JAVAJARDIR="${JAVAJARDIR:S,^${PREFIX}/,,}" | JAVAJARDIR="${JAVAJARDIR:S,^${PREFIX}/,,}" | ||||
SUB_LIST+= JAVASHAREDIR="${JAVASHAREDIR}" \ | SUB_LIST+= JAVASHAREDIR="${JAVASHAREDIR}" \ | ||||
JAVAJARDIR="${JAVAJARDIR}" \ | JAVAJARDIR="${JAVAJARDIR}" \ | ||||
JAVALIBDIR="${JAVALIBDIR}" | JAVALIBDIR="${JAVALIBDIR}" | ||||
. if defined(JAVA_VERSION) | . if defined(JAVA_VERSION) | ||||
SUB_LIST+= JAVA_VERSION="${JAVA_VERSION}" | SUB_LIST+= JAVA_VERSION="${JAVA_VERSION}" | ||||
. endif | . endif | ||||
. if defined(JAVA_VENDOR) | . if defined(JAVA_VENDOR) | ||||
SUB_LIST+= JAVA_VENDOR="${JAVA_VENDOR}" | SUB_LIST+= JAVA_VENDOR="${JAVA_VENDOR}" | ||||
. endif | . endif | ||||
. if defined(JAVA_OS) | . if defined(JAVA_OS) | ||||
SUB_LIST+= JAVA_OS="${JAVA_OS}" | SUB_LIST+= JAVA_OS="${JAVA_OS}" | ||||
. endif | . endif | ||||
# The complete list of Java versions, os and vendors supported. | # The complete list of Java versions, os and vendors supported. | ||||
__JAVA_VERSION_LIST= 7 8 11 12 13 14 15 16 17 18 | __JAVA_VERSION_LIST= 7 8 11 12 13 14 15 16 17 18 | ||||
_JAVA_VERSION_LIST= ${__JAVA_VERSION_LIST} ${__JAVA_VERSION_LIST:S/$/+/} | _JAVA_VERSION_LIST= ${__JAVA_VERSION_LIST} ${__JAVA_VERSION_LIST:S/$/+/} | ||||
_JAVA_OS_LIST= native linux | _JAVA_OS_LIST= native linux | ||||
_JAVA_VENDOR_LIST= openjdk oracle | _JAVA_VENDOR_LIST= openjdk oracle | ||||
# Set all meta-information about JDK ports: | # Set all meta-information about JDK ports: | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
#------------------------------------------------------------------------------- | #------------------------------------------------------------------------------- | ||||
# Stage 2: Determine which JDK ports are suitable and which JDK ports are | # Stage 2: Determine which JDK ports are suitable and which JDK ports are | ||||
# suitable | # suitable | ||||
# | # | ||||
# From here, the port is using bsd.java.mk v2.0 | # From here, the port is using bsd.java.mk v2.0 | ||||
# Error checking: defined JAVA_{HOME,PORT,PORT_VERSION,PORT_VENDOR,PORT_OS} | # Error checking: defined JAVA_{HOME,PORT,PORT_VERSION,PORT_VENDOR,PORT_OS} | ||||
. for variable in JAVA_HOME JAVA_PORT JAVA_PORT_VERSION JAVA_PORT_VENDOR JAVA_PORT_OS | . for variable in JAVA_HOME JAVA_PORT JAVA_PORT_VERSION JAVA_PORT_VENDOR JAVA_PORT_OS | ||||
. if defined(${variable}) | . if defined(${variable}) | ||||
check-makevars:: | check-makevars:: | ||||
@${ECHO_CMD} "${PKGNAME}: Environment error: \"${variable}\" should not be defined -- clearing." | @${ECHO_CMD} "${PKGNAME}: Environment error: \"${variable}\" should not be defined -- clearing." | ||||
.undef ${variable} | .undef ${variable} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
# Error checking: JAVA_VERSION | # Error checking: JAVA_VERSION | ||||
.if defined(JAVA_VERSION) | . if defined(JAVA_VERSION) | ||||
.if !defined(_JAVA_VERSION_LIST_REGEXP) | . if !defined(_JAVA_VERSION_LIST_REGEXP) | ||||
_JAVA_VERSION_LIST_REGEXP= ${_JAVA_VERSION_LIST:C/\+/\\+/:ts|} | _JAVA_VERSION_LIST_REGEXP= ${_JAVA_VERSION_LIST:C/\+/\\+/:ts|} | ||||
.endif | . endif | ||||
check-makevars:: | check-makevars:: | ||||
@( test ! -z "${JAVA_VERSION}" && ( ${ECHO_CMD} "${JAVA_VERSION}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VERSION_LIST_REGEXP}")) || \ | @( test ! -z "${JAVA_VERSION}" && ( ${ECHO_CMD} "${JAVA_VERSION}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VERSION_LIST_REGEXP}")) || \ | ||||
(${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VERSION}\" is not a valid value for JAVA_VERSION. It should be one or more of: ${__JAVA_VERSION_LIST} (with an optional \"+\" suffix.)"; ${FALSE}) | (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VERSION}\" is not a valid value for JAVA_VERSION. It should be one or more of: ${__JAVA_VERSION_LIST} (with an optional \"+\" suffix.)"; ${FALSE}) | ||||
.endif | . endif | ||||
# Error checking: JAVA_VENDOR | # Error checking: JAVA_VENDOR | ||||
.if defined(JAVA_VENDOR) | . if defined(JAVA_VENDOR) | ||||
.if !defined(_JAVA_VENDOR_LIST_REGEXP) | . if !defined(_JAVA_VENDOR_LIST_REGEXP) | ||||
_JAVA_VENDOR_LIST_REGEXP= ${_JAVA_VENDOR_LIST:ts|} | _JAVA_VENDOR_LIST_REGEXP= ${_JAVA_VENDOR_LIST:ts|} | ||||
.endif | . endif | ||||
check-makevars:: | check-makevars:: | ||||
@( test ! -z "${JAVA_VENDOR}" && ( ${ECHO_CMD} "${JAVA_VENDOR}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VENDOR_LIST_REGEXP}" )) || \ | @( test ! -z "${JAVA_VENDOR}" && ( ${ECHO_CMD} "${JAVA_VENDOR}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VENDOR_LIST_REGEXP}" )) || \ | ||||
(${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VENDOR}\" is not a valid value for JAVA_VENDOR. It should be one or more of: ${_JAVA_VENDOR_LIST}"; \ | (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VENDOR}\" is not a valid value for JAVA_VENDOR. It should be one or more of: ${_JAVA_VENDOR_LIST}"; \ | ||||
${FALSE}) | ${FALSE}) | ||||
.endif | . endif | ||||
# Error checking: JAVA_OS | # Error checking: JAVA_OS | ||||
.if defined(JAVA_OS) | . if defined(JAVA_OS) | ||||
.if !defined(_JAVA_OS_LIST_REGEXP) | . if !defined(_JAVA_OS_LIST_REGEXP) | ||||
_JAVA_OS_LIST_REGEXP= ${_JAVA_OS_LIST:ts|} | _JAVA_OS_LIST_REGEXP= ${_JAVA_OS_LIST:ts|} | ||||
.endif | . endif | ||||
check-makevars:: | check-makevars:: | ||||
@( test ! -z "${JAVA_OS}" && ( ${ECHO_CMD} "${JAVA_OS}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_OS_LIST_REGEXP}")) || \ | @( test ! -z "${JAVA_OS}" && ( ${ECHO_CMD} "${JAVA_OS}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_OS_LIST_REGEXP}")) || \ | ||||
(${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_OS}\" is not a valid value for JAVA_OS. It should be one or more of: ${_JAVA_OS_LIST}"; \ | (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_OS}\" is not a valid value for JAVA_OS. It should be one or more of: ${_JAVA_OS_LIST}"; \ | ||||
${FALSE}) | ${FALSE}) | ||||
.endif | . endif | ||||
# Set default values for JAVA_BUILD and JAVA_RUN | # Set default values for JAVA_BUILD and JAVA_RUN | ||||
# When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre | # When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre | ||||
# (unless NO_BUILD is set) | # (unless NO_BUILD is set) | ||||
. if !defined(JAVA_EXTRACT) && !defined(JAVA_BUILD) && !defined(JAVA_RUN) | . if !defined(JAVA_EXTRACT) && !defined(JAVA_BUILD) && !defined(JAVA_RUN) | ||||
. if !defined(NO_BUILD) | . if !defined(NO_BUILD) | ||||
JAVA_BUILD= jdk | JAVA_BUILD= jdk | ||||
. endif | . endif | ||||
JAVA_RUN= jre | JAVA_RUN= jre | ||||
. endif | . endif | ||||
# JDK dependency setting | # JDK dependency setting | ||||
. undef _JAVA_PORTS_INSTALLED | . undef _JAVA_PORTS_INSTALLED | ||||
. undef _JAVA_PORTS_POSSIBLE | . undef _JAVA_PORTS_POSSIBLE | ||||
. if defined(JAVA_VERSION) | . if defined(JAVA_VERSION) | ||||
_JAVA_VERSION= ${JAVA_VERSION:S/1.7+/1.7 1.8+/:S/1.8+/1.8 11+/:S/1.7/7/:S/1.8/8/:S/7+/7 8+/:S/8+/8 11+/:S/11+/11 12+/:S/12+/12 13+/:S/13+/13 14+/:S/14+/14 15+/:S/15+/15 16+/:S/16+/16 17+/:S/17+/17 18+/:S/18+/18/} | _JAVA_VERSION= ${JAVA_VERSION:S/1.7+/1.7 1.8+/:S/1.8+/1.8 11+/:S/1.7/7/:S/1.8/8/:S/7+/7 8+/:S/8+/8 11+/:S/11+/11 12+/:S/12+/12 13+/:S/13+/13 14+/:S/14+/14 15+/:S/15+/15 16+/:S/16+/16 17+/:S/17+/17 18+/:S/18+/18/} | ||||
. else | . else | ||||
_JAVA_VERSION= ${__JAVA_VERSION_LIST} | _JAVA_VERSION= ${__JAVA_VERSION_LIST} | ||||
. endif | . endif | ||||
. if defined(JAVA_OS) | . if defined(JAVA_OS) | ||||
_JAVA_OS= ${JAVA_OS} | _JAVA_OS= ${JAVA_OS} | ||||
. else | . else | ||||
_JAVA_OS= ${_JAVA_OS_LIST} | _JAVA_OS= ${_JAVA_OS_LIST} | ||||
. endif | . endif | ||||
. if defined(JAVA_VENDOR) | . if defined(JAVA_VENDOR) | ||||
_JAVA_VENDOR= ${JAVA_VENDOR} | _JAVA_VENDOR= ${JAVA_VENDOR} | ||||
. else | . else | ||||
_JAVA_VENDOR= ${_JAVA_VENDOR_LIST} | _JAVA_VENDOR= ${_JAVA_VENDOR_LIST} | ||||
. endif | . endif | ||||
. for A_JAVA_PORT in ${_JAVA_PORTS_ALL} | . for A_JAVA_PORT in ${_JAVA_PORTS_ALL} | ||||
A_JAVA_PORT_INFO:= ${A_JAVA_PORT:S/^/\${_/:S/$/_INFO}/} | A_JAVA_PORT_INFO:= ${A_JAVA_PORT:S/^/\${_/:S/$/_INFO}/} | ||||
A_JAVA_PORT_HOME= ${A_JAVA_PORT_INFO:MHOME=*:S,HOME=,,} | A_JAVA_PORT_HOME= ${A_JAVA_PORT_INFO:MHOME=*:S,HOME=,,} | ||||
A_JAVA_PORT_VERSION= ${A_JAVA_PORT_INFO:MVERSION=*:S,VERSION=,,} | A_JAVA_PORT_VERSION= ${A_JAVA_PORT_INFO:MVERSION=*:S,VERSION=,,} | ||||
A_JAVA_PORT_OS= ${A_JAVA_PORT_INFO:MOS=*:S,OS=,,} | A_JAVA_PORT_OS= ${A_JAVA_PORT_INFO:MOS=*:S,OS=,,} | ||||
A_JAVA_PORT_VENDOR= ${A_JAVA_PORT_INFO:MVENDOR=*:S,VENDOR=,,} | A_JAVA_PORT_VENDOR= ${A_JAVA_PORT_INFO:MVENDOR=*:S,VENDOR=,,} | ||||
.if !defined(_JAVA_PORTS_INSTALLED) && exists(${A_JAVA_PORT_HOME}/${_JDK_FILE}) | . if !defined(_JAVA_PORTS_INSTALLED) && exists(${A_JAVA_PORT_HOME}/${_JDK_FILE}) | ||||
__JAVA_PORTS_INSTALLED+= ${A_JAVA_PORT} | __JAVA_PORTS_INSTALLED+= ${A_JAVA_PORT} | ||||
.endif | . endif | ||||
# Because variables inside for loops are special (directly replaced as strings), | # Because variables inside for loops are special (directly replaced as strings), | ||||
# we are allowed to use them inside modifiers, where normally ${FOO:M${BAR}} is | # we are allowed to use them inside modifiers, where normally ${FOO:M${BAR}} is | ||||
# not allowed. | # not allowed. | ||||
# | # | ||||
.for ver in ${A_JAVA_PORT_VERSION} | . for ver in ${A_JAVA_PORT_VERSION} | ||||
.for os in ${A_JAVA_PORT_OS} | . for os in ${A_JAVA_PORT_OS} | ||||
.for vendor in ${A_JAVA_PORT_VENDOR} | . for vendor in ${A_JAVA_PORT_VENDOR} | ||||
.if ${_JAVA_VERSION:M${ver}} && ${_JAVA_OS:M${os}} && ${_JAVA_VENDOR:M${vendor}} | . if ${_JAVA_VERSION:M${ver}} && ${_JAVA_OS:M${os}} && ${_JAVA_VENDOR:M${vendor}} | ||||
__JAVA_PORTS_POSSIBLE+= ${A_JAVA_PORT} | __JAVA_PORTS_POSSIBLE+= ${A_JAVA_PORT} | ||||
.endif | . endif | ||||
.endfor | . endfor | ||||
.endfor | . endfor | ||||
.endfor | . endfor | ||||
. endfor | . endfor | ||||
.if !defined(_JAVA_PORTS_INSTALLED) | . if !defined(_JAVA_PORTS_INSTALLED) | ||||
_JAVA_PORTS_INSTALLED= ${__JAVA_PORTS_INSTALLED:C/ [ ]+/ /g} | _JAVA_PORTS_INSTALLED= ${__JAVA_PORTS_INSTALLED:C/ [ ]+/ /g} | ||||
.endif | . endif | ||||
_JAVA_PORTS_POSSIBLE= ${__JAVA_PORTS_POSSIBLE:C/ [ ]+/ /g} | _JAVA_PORTS_POSSIBLE= ${__JAVA_PORTS_POSSIBLE:C/ [ ]+/ /g} | ||||
#------------------------------------------------------------------------------- | #------------------------------------------------------------------------------- | ||||
# Stage 3: Decide the exact JDK to use (or install) | # Stage 3: Decide the exact JDK to use (or install) | ||||
# | # | ||||
# Find an installed JDK port that matches the requirements of the port | # Find an installed JDK port that matches the requirements of the port | ||||
. undef _JAVA_PORTS_INSTALLED_POSSIBLE | . undef _JAVA_PORTS_INSTALLED_POSSIBLE | ||||
. for A_JAVA_PORT in ${_JAVA_PORTS_POSSIBLE} | . for A_JAVA_PORT in ${_JAVA_PORTS_POSSIBLE} | ||||
__JAVA_PORTS_INSTALLED_POSSIBLE+= ${_JAVA_PORTS_INSTALLED:M${A_JAVA_PORT}} | __JAVA_PORTS_INSTALLED_POSSIBLE+= ${_JAVA_PORTS_INSTALLED:M${A_JAVA_PORT}} | ||||
. endfor | . endfor | ||||
_JAVA_PORTS_INSTALLED_POSSIBLE= ${__JAVA_PORTS_INSTALLED_POSSIBLE:C/[ ]+//g} | _JAVA_PORTS_INSTALLED_POSSIBLE= ${__JAVA_PORTS_INSTALLED_POSSIBLE:C/[ ]+//g} | ||||
. if ${_JAVA_PORTS_INSTALLED_POSSIBLE} != "" | . if ${_JAVA_PORTS_INSTALLED_POSSIBLE} != "" | ||||
. for i in ${_JAVA_PORTS_INSTALLED_POSSIBLE} | . for i in ${_JAVA_PORTS_INSTALLED_POSSIBLE} | ||||
. if !defined(_JAVA_PORTS_INSTALLED_POSSIBLE_shortcircuit) | . if !defined(_JAVA_PORTS_INSTALLED_POSSIBLE_shortcircuit) | ||||
_JAVA_PORT= $i | _JAVA_PORT= $i | ||||
_JAVA_PORTS_INSTALLED_POSSIBLE_shortcircuit= 1 | _JAVA_PORTS_INSTALLED_POSSIBLE_shortcircuit= 1 | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
# If no installed JDK port fits, then pick one from the list of possible ones | # If no installed JDK port fits, then pick one from the list of possible ones | ||||
. else | . else | ||||
. for i in ${_JAVA_PORTS_POSSIBLE} | . for i in ${_JAVA_PORTS_POSSIBLE} | ||||
. if !defined(_JAVA_PORTS_POSSIBLE_shortcircuit) | . if !defined(_JAVA_PORTS_POSSIBLE_shortcircuit) | ||||
_JAVA_PORT= $i | _JAVA_PORT= $i | ||||
_JAVA_PORTS_POSSIBLE_shortcircuit= 1 | _JAVA_PORTS_POSSIBLE_shortcircuit= 1 | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
. endif | . endif | ||||
_JAVA_PORT_INFO:= ${_JAVA_PORT:S/^/\${_/:S/$/_INFO}/} | _JAVA_PORT_INFO:= ${_JAVA_PORT:S/^/\${_/:S/$/_INFO}/} | ||||
JAVA_PORT= ${_JAVA_PORT_INFO:MPORT=*:S,PORT=,,} | JAVA_PORT= ${_JAVA_PORT_INFO:MPORT=*:S,PORT=,,} | ||||
JAVA_HOME= ${_JAVA_PORT_INFO:MHOME=*:S,HOME=,,} | JAVA_HOME= ${_JAVA_PORT_INFO:MHOME=*:S,HOME=,,} | ||||
JAVA_PORT_VERSION= ${_JAVA_PORT_INFO:MVERSION=*:S,VERSION=,,} | JAVA_PORT_VERSION= ${_JAVA_PORT_INFO:MVERSION=*:S,VERSION=,,} | ||||
JAVA_PORT_OS= ${_JAVA_PORT_INFO:MOS=*:S,OS=,,} | JAVA_PORT_OS= ${_JAVA_PORT_INFO:MOS=*:S,OS=,,} | ||||
JAVA_PORT_VENDOR= ${_JAVA_PORT_INFO:MVENDOR=*:S,VENDOR=,,} | JAVA_PORT_VENDOR= ${_JAVA_PORT_INFO:MVENDOR=*:S,VENDOR=,,} | ||||
JAVA_PORT_VENDOR_DESCRIPTION:= ${JAVA_PORT_VENDOR:S/^/\${_JAVA_VENDOR_/:S/$/}/} | JAVA_PORT_VENDOR_DESCRIPTION:= ${JAVA_PORT_VENDOR:S/^/\${_JAVA_VENDOR_/:S/$/}/} | ||||
JAVA_PORT_OS_DESCRIPTION:= ${JAVA_PORT_OS:S/^/\${_JAVA_OS_/:S/$/}/} | JAVA_PORT_OS_DESCRIPTION:= ${JAVA_PORT_OS:S/^/\${_JAVA_OS_/:S/$/}/} | ||||
#------------------------------------------------------------------------------- | #------------------------------------------------------------------------------- | ||||
# Stage 4: Add any dependencies if necessary | # Stage 4: Add any dependencies if necessary | ||||
# | # | ||||
# Ant Support: USE_ANT --> JAVA_BUILD=jdk | # Ant Support: USE_ANT --> JAVA_BUILD=jdk | ||||
. if defined(USE_ANT) | . if defined(USE_ANT) | ||||
JAVA_BUILD= jdk | JAVA_BUILD= jdk | ||||
. endif | . endif | ||||
# Add the JDK port to the dependencies | # Add the JDK port to the dependencies | ||||
DEPEND_JAVA= ${JAVA}:${JAVA_PORT} | DEPEND_JAVA= ${JAVA}:${JAVA_PORT} | ||||
. if defined(JAVA_EXTRACT) | . if defined(JAVA_EXTRACT) | ||||
EXTRACT_DEPENDS+= ${DEPEND_JAVA} | EXTRACT_DEPENDS+= ${DEPEND_JAVA} | ||||
. endif | . endif | ||||
. if defined(JAVA_BUILD) | . if defined(JAVA_BUILD) | ||||
. if defined(NO_BUILD) | . if defined(NO_BUILD) | ||||
check-makevars:: | check-makevars:: | ||||
@${ECHO_CMD} "${PKGNAME}: Makefile error: JAVA_BUILD and NO_BUILD cannot be set at the same time."; | @${ECHO_CMD} "${PKGNAME}: Makefile error: JAVA_BUILD and NO_BUILD cannot be set at the same time."; | ||||
@${FALSE} | @${FALSE} | ||||
. endif | . endif | ||||
BUILD_DEPENDS+= ${DEPEND_JAVA} | BUILD_DEPENDS+= ${DEPEND_JAVA} | ||||
. endif | . endif | ||||
. if defined(JAVA_RUN) | . if defined(JAVA_RUN) | ||||
RUN_DEPENDS+= ${DEPEND_JAVA} | RUN_DEPENDS+= ${DEPEND_JAVA} | ||||
. endif | . endif | ||||
# Ant support: default do-build target | # Ant support: default do-build target | ||||
. if defined(USE_ANT) | . if defined(USE_ANT) | ||||
DESTDIRNAME?= -Dfreebsd.ports.destdir | DESTDIRNAME?= -Dfreebsd.ports.destdir | ||||
ANT?= ${LOCALBASE}/bin/ant | ANT?= ${LOCALBASE}/bin/ant | ||||
MAKE_ENV+= JAVA_HOME=${JAVA_HOME} | MAKE_ENV+= JAVA_HOME=${JAVA_HOME} | ||||
BUILD_DEPENDS+= ${ANT}:devel/apache-ant | BUILD_DEPENDS+= ${ANT}:devel/apache-ant | ||||
ALL_TARGET?= | ALL_TARGET?= | ||||
. if !target(do-build) | . if !target(do-build) | ||||
do-build: | do-build: | ||||
@(cd ${BUILD_WRKSRC}; \ | @(cd ${BUILD_WRKSRC}; \ | ||||
${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${ALL_TARGET}) | ${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${ALL_TARGET}) | ||||
. endif | . endif | ||||
. if !target(do-test) && defined(TEST_TARGET) | . if !target(do-test) && defined(TEST_TARGET) | ||||
TEST_DEPENDS+= ${DEPEND_JAVA} | TEST_DEPENDS+= ${DEPEND_JAVA} | ||||
TEST_DEPENDS+= ${ANT}:devel/apache-ant | TEST_DEPENDS+= ${ANT}:devel/apache-ant | ||||
do-test: | do-test: | ||||
@(cd ${TEST_WRKSRC}; \ | @(cd ${TEST_WRKSRC}; \ | ||||
${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${TEST_TARGET}) | ${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${TEST_TARGET}) | ||||
. endif | . endif | ||||
. endif | . endif | ||||
#----------------------------------------------------------------------------- | #----------------------------------------------------------------------------- | ||||
# Stage 5: Define all settings for the port to use | # Stage 5: Define all settings for the port to use | ||||
# | # | ||||
# At this stage both JAVA_HOME and JAVA_PORT are definitely given a value. | # At this stage both JAVA_HOME and JAVA_PORT are definitely given a value. | ||||
# | # | ||||
# Define the location of the Java compiler. | # Define the location of the Java compiler. | ||||
# Only define JAVAC if a JDK is needed | # Only define JAVAC if a JDK is needed | ||||
. undef JAVAC | . undef JAVAC | ||||
# Then test if a JAVAC has to be set (JAVA_BUILD==jdk) | # Then test if a JAVAC has to be set (JAVA_BUILD==jdk) | ||||
. if defined(JAVA_BUILD) | . if defined(JAVA_BUILD) | ||||
. if (${JAVA_BUILD:tu} == "JDK") && !defined(JAVAC) | . if (${JAVA_BUILD:tu} == "JDK") && !defined(JAVAC) | ||||
JAVAC?= ${JAVA_HOME}/bin/javac | JAVAC?= ${JAVA_HOME}/bin/javac | ||||
. endif | . endif | ||||
. endif | . endif | ||||
# Define the location of some more executables. | # Define the location of some more executables. | ||||
APPLETVIEWER?= ${JAVA_HOME}/bin/appletviewer | APPLETVIEWER?= ${JAVA_HOME}/bin/appletviewer | ||||
JAR?= ${JAVA_HOME}/bin/jar | JAR?= ${JAVA_HOME}/bin/jar | ||||
JAVA?= ${JAVA_HOME}/bin/java | JAVA?= ${JAVA_HOME}/bin/java | ||||
JAVADOC?= ${JAVA_HOME}/bin/javadoc | JAVADOC?= ${JAVA_HOME}/bin/javadoc | ||||
JAVAH?= ${JAVA_HOME}/bin/javah | JAVAH?= ${JAVA_HOME}/bin/javah | ||||
JAVAP?= ${JAVA_HOME}/bin/javap | JAVAP?= ${JAVA_HOME}/bin/javap | ||||
Show All 37 Lines | java-debug: | ||||
@${ECHO_CMD} "JAVA_PORT_VERSION= ${JAVA_PORT_VERSION}" | @${ECHO_CMD} "JAVA_PORT_VERSION= ${JAVA_PORT_VERSION}" | ||||
@${ECHO_CMD} "JAVA_PORT_OS= ${JAVA_PORT_OS} (${JAVA_PORT_OS_DESCRIPTION})" | @${ECHO_CMD} "JAVA_PORT_OS= ${JAVA_PORT_OS} (${JAVA_PORT_OS_DESCRIPTION})" | ||||
@${ECHO_CMD} "JAVA_PORT_VENDOR= ${JAVA_PORT_VENDOR} (${JAVA_PORT_VENDOR_DESCRIPTION})" | @${ECHO_CMD} "JAVA_PORT_VENDOR= ${JAVA_PORT_VENDOR} (${JAVA_PORT_VENDOR_DESCRIPTION})" | ||||
@${ECHO_CMD} | @${ECHO_CMD} | ||||
@${ECHO_CMD} "# Additional variables:" | @${ECHO_CMD} "# Additional variables:" | ||||
@${ECHO_CMD} "JAVAC= ${JAVAC}" | @${ECHO_CMD} "JAVAC= ${JAVAC}" | ||||
@${ECHO_CMD} "JAVA_CLASSES= ${JAVA_CLASSES}" | @${ECHO_CMD} "JAVA_CLASSES= ${JAVA_CLASSES}" | ||||
. endif | . endif | ||||
.endif | .endif |