Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 101 lines (85 sloc) 3.018 kb
85cec19 Prepare for DESTDIR support in Java VMs.
joerg authored
1 # $NetBSD: java-env.mk,v 1.11 2007/11/09 00:49:54 joerg 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 #
cb21519 Add JAVA_LD_LIBRARY_PATH, which is needed by the upcoming sun-jre6.
tv authored
12 # JAVA_LD_LIBRARY_PATH
13 # Value to prepend to LD_LIBRARY_PATH before running
14 # the real command. Optional; use *only* if necessary.
15 #
afd9092 Initial addition.
jmmv authored
16 # JAVA_HOME Path to the directory holding the Java implementation.
17 # Required.
18 #
19 # JAVA_NAME Base name of the Java implementation. This will be
20 # used as part of wrappers' names. Required.
21 #
22 # JAVA_UNLIMIT List of resources to be unlimited at runtime.
23 # Can include any of cmdsize, datasize and stacksize.
24 # Optional.
25 #
26 # JAVA_WRAPPERS List of wrappers to be created under ${PREFIX}/bin,
27 # pointing to binaries under ${JAVA_HOME}/bin. The
28 # names must match files in the later directory.
29 # Required (if empty, the inclusion of this file is
30 # useless).
31 #
32
33 .if !defined(JAVA_ENV_MK)
34 JAVA_ENV_MK= # defined
35
36 JAVA_NAME?= # undefined
37 JAVA_HOME?= # undefined
38 JAVA_CLASSPATH?= # empty
cb21519 Add JAVA_LD_LIBRARY_PATH, which is needed by the upcoming sun-jre6.
tv authored
39 JAVA_LD_LIBRARY_PATH?= # empty
afd9092 Initial addition.
jmmv authored
40 JAVA_UNLIMIT?= # empty
41 JAVA_WRAPPERS?= # empty
42
8847e58 This file needs bsd.prefs.mk, since the variable WRKDIR is used in a
rillig authored
43 .include "../../mk/bsd.prefs.mk"
44
13dcba7 Lets be pkgviews friendly: create the bin directory when installing w…
jmmv authored
45 .if !empty(JAVA_WRAPPERS)
46 INSTALLATION_DIRS+= bin
47
5955fc7 Convert the Java related packages to use the alternatives system. To do
jmmv authored
48 ALTERNATIVES_SRC= ${WRKDIR}/.ALTERNATIVES
49 ${WRKDIR}/.ALTERNATIVES:
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
50 . for w in ${JAVA_WRAPPERS}
5955fc7 Convert the Java related packages to use the alternatives system. To do
jmmv authored
51 @${ECHO} 'bin/${w} ${PREFIX}/bin/${JAVA_NAME}-${w}' \
52 >>${WRKDIR}/.ALTERNATIVES
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
53 . endfor
5955fc7 Convert the Java related packages to use the alternatives system. To do
jmmv authored
54
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
55 . for w in ${JAVA_WRAPPERS}
afd9092 Initial addition.
jmmv authored
56
1d8abe8 Let a package specify which is the real binary for each wrapper (by s…
jmmv authored
57 JAVA_WRAPPER_BIN.${w}?= ${JAVA_HOME}/bin/${w}
58
afd9092 Initial addition.
jmmv authored
59 post-build: ${WRKDIR}/${w}
60
61 .PHONY: install-java-wrapper-${w}
62 post-install: install-java-wrapper-${w}
63
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
64 . if !target(${WRKDIR}/${w})
afd9092 Initial addition.
jmmv authored
65 ${WRKDIR}/${w}:
66 @${ECHO} 'Generating ${w} wrapper...'
67 @${ECHO} '#! ${SH}' >${WRKDIR}/${w}
68 @${ECHO} 'PATH=${JAVA_HOME}/bin:$${PATH}; export PATH' >>${WRKDIR}/${w}
69 @${ECHO} 'JAVA_HOME=${JAVA_HOME}; export JAVA_HOME' >>${WRKDIR}/${w}
70 @${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
71 . if !empty(JAVA_CLASSPATH)
afd9092 Initial addition.
jmmv authored
72 @${ECHO} 'CLASSPATH=${JAVA_CLASSPATH}:$${CLASSPATH}; export CLASSPATH' \
73 >>${WRKDIR}/${w}
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
74 . endif
cb21519 Add JAVA_LD_LIBRARY_PATH, which is needed by the upcoming sun-jre6.
tv authored
75 . if !empty(JAVA_LD_LIBRARY_PATH)
76 @${ECHO} 'LD_LIBRARY_PATH=${JAVA_LD_LIBRARY_PATH}$${LD_LIBRARY_PATH:+:}$${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH' \
77 >>${WRKDIR}/${w}
78 . endif
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
79 . for f in ${JAVA_UNLIMIT}
afd9092 Initial addition.
jmmv authored
80 @${ECHO} '${ULIMIT_CMD_${f}}' >>${WRKDIR}/${w}
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
81 . endfor
82 . undef f
1d8abe8 Let a package specify which is the real binary for each wrapper (by s…
jmmv authored
83 @${ECHO} '${JAVA_WRAPPER_BIN.${w}} "$$@"' >>${WRKDIR}/${w}
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
84 . endif
afd9092 Initial addition.
jmmv authored
85
86 install-java-wrapper-${w}:
85cec19 Prepare for DESTDIR support in Java VMs.
joerg authored
87 ${INSTALL_SCRIPT} ${WRKDIR}/${w} ${DESTDIR}${PREFIX}/bin/${JAVA_NAME}-${w}
afd9092 Initial addition.
jmmv authored
88
f6bcc9a Let this file be included even if JAVA_WRAPPERS is empty; this was po…
jmmv authored
89 . endfor
90 . undef w
91 .endif
afd9092 Initial addition.
jmmv authored
92
93 # Handle the ${PREFIX}/java shared directory automatically.
9f9e663 Use REQD_DIRS instead of MAKE_DIRS for directories under ${PREFIX} so
jlam authored
94 REQD_DIRS+= ${PREFIX}/java
afd9092 Initial addition.
jmmv authored
95 PRINT_PLIST_AWK+= /^@dirrm java$$/ { next; }
96
49603e6 Automatically substitute for JAVA_HOME and PKG_JAVA_HOME in PLISTs.
jlam authored
97 PLIST_SUBST+= JAVA_HOME=${JAVA_HOME:Q}
98 FILES_SUBST+= JAVA_HOME=${JAVA_HOME:Q}
99
afd9092 Initial addition.
jmmv authored
100 .endif # JAVA_ENV_MK
Something went wrong with that request. Please try again.