Skip to content
Newer
Older
100644 89 lines (74 sloc) 2.51 KB
8847e58 This file needs bsd.prefs.mk, since the variable WRKDIR is used in a
rillig authored
1 # $NetBSD: java-env.mk,v 1.8 2006/05/16 21:25:38 rillig Exp $
afd9092 Initial addition.
jmmv authored
2 #
3 # This Makefile fragment handles Java wrappers and is meant to be included
4 # by packages that provide a Java build-time and/or run-time environment.
5 #
6 # The following variables can be defined in package Makefiles to tune the
7 # behavior of this file:
8 #
9 # JAVA_CLASSPATH Classpath that will be prepended on all invocations
10 # to this implementation. Optional.
11 #
12 # JAVA_HOME Path to the directory holding the Java implementation.
13 # Required.
14 #
15 # JAVA_NAME Base name of the Java implementation. This will be
16 # used as part of wrappers' names. Required.
17 #
18 # JAVA_UNLIMIT List of resources to be unlimited at runtime.
19 # Can include any of cmdsize, datasize and stacksize.
20 # Optional.
21 #
22 # JAVA_WRAPPERS List of wrappers to be created under ${PREFIX}/bin,
23 # pointing to binaries under ${JAVA_HOME}/bin. The
24 # names must match files in the later directory.
25 # Required (if empty, the inclusion of this file is
26 # useless).
27 #
28
29 .if !defined(JAVA_ENV_MK)
30 JAVA_ENV_MK= # defined
31
32 JAVA_NAME?= # undefined
33 JAVA_HOME?= # undefined
34 JAVA_CLASSPATH?= # empty
35 JAVA_UNLIMIT?= # empty
36 JAVA_WRAPPERS?= # empty
37
8847e58 This file needs bsd.prefs.mk, since the variable WRKDIR is used in a
rillig authored
38 .include "../../mk/bsd.prefs.mk"
39
13dcba7 Lets be pkgviews friendly: create the bin directory when installing w…
jmmv authored
40 .if !empty(JAVA_WRAPPERS)
41 INSTALLATION_DIRS+= bin
42
5955fc7 Convert the Java related packages to use the alternatives system. To do
jmmv authored
43 ALTERNATIVES_SRC= ${WRKDIR}/.ALTERNATIVES
44 ${WRKDIR}/.ALTERNATIVES:
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
45 . for w in ${JAVA_WRAPPERS}
5955fc7 Convert the Java related packages to use the alternatives system. To do
jmmv authored
46 @${ECHO} 'bin/${w} ${PREFIX}/bin/${JAVA_NAME}-${w}' \
47 >>${WRKDIR}/.ALTERNATIVES
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
48 . endfor
5955fc7 Convert the Java related packages to use the alternatives system. To do
jmmv authored
49
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
50 . for w in ${JAVA_WRAPPERS}
afd9092 Initial addition.
jmmv authored
51
1d8abe8 Let a package specify which is the real binary for each wrapper (by s…
jmmv authored
52 JAVA_WRAPPER_BIN.${w}?= ${JAVA_HOME}/bin/${w}
53
afd9092 Initial addition.
jmmv authored
54 post-build: ${WRKDIR}/${w}
55
56 .PHONY: install-java-wrapper-${w}
57 post-install: install-java-wrapper-${w}
58
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
59 . if !target(${WRKDIR}/${w})
afd9092 Initial addition.
jmmv authored
60 ${WRKDIR}/${w}:
61 @${ECHO} 'Generating ${w} wrapper...'
62 @${ECHO} '#! ${SH}' >${WRKDIR}/${w}
63 @${ECHO} 'PATH=${JAVA_HOME}/bin:$${PATH}; export PATH' >>${WRKDIR}/${w}
64 @${ECHO} 'JAVA_HOME=${JAVA_HOME}; export JAVA_HOME' >>${WRKDIR}/${w}
65 @${ECHO} 'JVM_HOME=${JAVA_HOME}; export JVM_HOME' >>${WRKDIR}/${w}
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
66 . if !empty(JAVA_CLASSPATH)
afd9092 Initial addition.
jmmv authored
67 @${ECHO} 'CLASSPATH=${JAVA_CLASSPATH}:$${CLASSPATH}; export CLASSPATH' \
68 >>${WRKDIR}/${w}
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
69 . endif
70 . for f in ${JAVA_UNLIMIT}
afd9092 Initial addition.
jmmv authored
71 @${ECHO} '${ULIMIT_CMD_${f}}' >>${WRKDIR}/${w}
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
72 . endfor
73 . undef f
1d8abe8 Let a package specify which is the real binary for each wrapper (by s…
jmmv authored
74 @${ECHO} '${JAVA_WRAPPER_BIN.${w}} "$$@"' >>${WRKDIR}/${w}
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
75 . endif
afd9092 Initial addition.
jmmv authored
76
77 install-java-wrapper-${w}:
78 ${INSTALL_SCRIPT} ${WRKDIR}/${w} ${PREFIX}/bin/${JAVA_NAME}-${w}
79
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
80 . endfor
81 . undef w
82 .endif
afd9092 Initial addition.
jmmv authored
83
84 # Handle the ${PREFIX}/java shared directory automatically.
9f9e663 Use REQD_DIRS instead of MAKE_DIRS for directories under ${PREFIX} so
jlam authored
85 REQD_DIRS+= ${PREFIX}/java
afd9092 Initial addition.
jmmv authored
86 PRINT_PLIST_AWK+= /^@dirrm java$$/ { next; }
87
88 .endif # JAVA_ENV_MK
Something went wrong with that request. Please try again.