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
ede55c8 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 $
f2ab2b0 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 #
0d59225 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 #
f2ab2b0 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
0d59225 Add JAVA_LD_LIBRARY_PATH, which is needed by the upcoming sun-jre6.
tv authored
39 JAVA_LD_LIBRARY_PATH?= # empty
f2ab2b0 Initial addition.
jmmv authored
40 JAVA_UNLIMIT?= # empty
41 JAVA_WRAPPERS?= # empty
42
bd1f9fe This file needs bsd.prefs.mk, since the variable WRKDIR is used in a
rillig authored
43 .include "../../mk/bsd.prefs.mk"
44
cc685f3 Lets be pkgviews friendly: create the bin directory when installing wrap...
jmmv authored
45 .if !empty(JAVA_WRAPPERS)
46 INSTALLATION_DIRS+= bin
47
1fe6ddf Convert the Java related packages to use the alternatives system. To do
jmmv authored
48 ALTERNATIVES_SRC= ${WRKDIR}/.ALTERNATIVES
49 ${WRKDIR}/.ALTERNATIVES:
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
50 . for w in ${JAVA_WRAPPERS}
1fe6ddf 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
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
53 . endfor
1fe6ddf Convert the Java related packages to use the alternatives system. To do
jmmv authored
54
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
55 . for w in ${JAVA_WRAPPERS}
f2ab2b0 Initial addition.
jmmv authored
56
1df45a3 Let a package specify which is the real binary for each wrapper (by sett...
jmmv authored
57 JAVA_WRAPPER_BIN.${w}?= ${JAVA_HOME}/bin/${w}
58
f2ab2b0 Initial addition.
jmmv authored
59 post-build: ${WRKDIR}/${w}
60
61 .PHONY: install-java-wrapper-${w}
62 post-install: install-java-wrapper-${w}
63
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
64 . if !target(${WRKDIR}/${w})
f2ab2b0 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}
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
71 . if !empty(JAVA_CLASSPATH)
f2ab2b0 Initial addition.
jmmv authored
72 @${ECHO} 'CLASSPATH=${JAVA_CLASSPATH}:$${CLASSPATH}; export CLASSPATH' \
73 >>${WRKDIR}/${w}
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
74 . endif
0d59225 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
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
79 . for f in ${JAVA_UNLIMIT}
f2ab2b0 Initial addition.
jmmv authored
80 @${ECHO} '${ULIMIT_CMD_${f}}' >>${WRKDIR}/${w}
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
81 . endfor
82 . undef f
1df45a3 Let a package specify which is the real binary for each wrapper (by sett...
jmmv authored
83 @${ECHO} '${JAVA_WRAPPER_BIN.${w}} "$$@"' >>${WRKDIR}/${w}
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
84 . endif
f2ab2b0 Initial addition.
jmmv authored
85
86 install-java-wrapper-${w}:
ede55c8 Prepare for DESTDIR support in Java VMs.
joerg authored
87 ${INSTALL_SCRIPT} ${WRKDIR}/${w} ${DESTDIR}${PREFIX}/bin/${JAVA_NAME}-${w}
f2ab2b0 Initial addition.
jmmv authored
88
d5d2a28 Let this file be included even if JAVA_WRAPPERS is empty; this was possi...
jmmv authored
89 . endfor
90 . undef w
91 .endif
f2ab2b0 Initial addition.
jmmv authored
92
93 # Handle the ${PREFIX}/java shared directory automatically.
8581146 Use REQD_DIRS instead of MAKE_DIRS for directories under ${PREFIX} so
jlam authored
94 REQD_DIRS+= ${PREFIX}/java
f2ab2b0 Initial addition.
jmmv authored
95 PRINT_PLIST_AWK+= /^@dirrm java$$/ { next; }
96
c560c1b 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
f2ab2b0 Initial addition.
jmmv authored
100 .endif # JAVA_ENV_MK
Something went wrong with that request. Please try again.