Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/java.mk
- This file was moved from Mk/bsd.java.mk.
| #-*- tab-width: 4; -*- | #-*- tab-width: 4; -*- | ||||
| # ex:ts=4 | # ex:ts=4 | ||||
| # | # | ||||
| # bsd.java.mk - Support for Java-based ports. | # Provide support for Java (java) | ||||
| # | # | ||||
| # Feature: java | |||||
| # Usage: USES= java | |||||
| # | # | ||||
| # It takes no arguments. | |||||
| # | |||||
| # For FreeBSD committers: | # For FreeBSD committers: | ||||
| # Please send all suggested changes to the maintainer instead of committing | # Please send all suggested changes to the maintainer instead of committing | ||||
| # them yourself. | # them yourself. | ||||
| # | # | ||||
| .if !defined(Java_Include) | |||||
| Java_Include= bsd.java.mk | |||||
| Java_Include_MAINTAINER= java@FreeBSD.org | |||||
| #------------------------------------------------------------------------------- | #------------------------------------------------------------------------------- | ||||
| # Variables that each port can define: | # Variables that each port can define: | ||||
| # | # | ||||
| # USE_JAVA Should be defined to the remaining variables to have any | |||||
| # effect | |||||
| # | |||||
| # JAVA_VERSION List of space-separated suitable java versions for the | # JAVA_VERSION List of space-separated suitable java versions for the | ||||
| # port. An optional "+" allows you to specify a range of | # port. An optional "+" allows you to specify a range of | ||||
| # versions. (allowed values: 8[+] 11[+] 17[+] 18[+] 19[+] | # versions. (allowed values: 8[+] 11[+] 17[+] 18[+] 19[+] | ||||
| # 20[+] 21[+] 22[+]) | # 20[+] 21[+] 22[+]) | ||||
| # | # | ||||
| # JAVA_OS List of space-separated suitable JDK port operating systems | # JAVA_OS List of space-separated suitable JDK port operating systems | ||||
| # for the port. (allowed values: native linux) | # for the port. (allowed values: native linux) | ||||
| # | # | ||||
| ▲ Show 20 Lines • Show All 89 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 | ||||
| # | # | ||||
| # MAINTAINER: java@FreeBSD.org | |||||
| . if defined(USE_JAVA) | .if !defined(_INCLUDE_USES_JAVA_MK) | ||||
| . if !defined(JAVA_VERSION) && empty(USE_JAVA:C/[0-9]*[\.]*[0-9]*[+]*//) | _INCLUDE_USES_JAVA_MK= yes | ||||
| JAVA_VERSION=${USE_JAVA} | |||||
| . endif | |||||
| . if !empty(java_ARGS) | |||||
| IGNORE= USES=java does not take arguments | |||||
| . 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 | ||||
| ▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
| # relative path within the JAVA_HOME directory. | # relative path within the JAVA_HOME directory. | ||||
| _JDK_FILE=bin/javac | _JDK_FILE=bin/javac | ||||
| #------------------------------------------------------------------------------- | #------------------------------------------------------------------------------- | ||||
| # 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 | |||||
| # 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 | ||||
| ▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | |||||
| 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}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \ | @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \ | ||||
| ${ANT} ${MAKE_ARGS} ${ALL_TARGET}) | ${ANT} ${MAKE_ARGS} ${ALL_TARGET}) | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 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 | |||||