author | never |
Mon, 12 Jul 2010 22:27:18 -0700 | |
changeset 5926 | a36f90d986b6 |
parent 5506 | 202f599c92aa |
child 7668 | d4a77089c587 |
permissions | -rw-r--r-- |
2 | 1 |
# |
5506 | 2 |
# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
# published by the Free Software Foundation. Oracle designates this |
2 | 8 |
# particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
# by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
# |
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
2 | 24 |
# |
25 |
||
26 |
# |
|
27 |
# Common java/javac/jdk variables used by all the Java makefiles. |
|
28 |
# This file should not contain rules. |
|
29 |
# |
|
30 |
||
31 |
# WARNING: This file is shared with other workspaces. |
|
32 |
# So when it includes other files, it must use JDK_TOPDIR. |
|
33 |
# |
|
34 |
||
35 |
# |
|
36 |
# Memory related -J flags that all uses of java tools should use. |
|
37 |
# |
|
38 |
JAVA_MEM_FLAGS = -Xmx$(MAX_VM_MEMORY)m |
|
39 |
ifeq ($(ARCH), ia64) |
|
40 |
# Special flags for javac on ia64 to work around a VM problem with |
|
41 |
# bad code generation during inlining (what version had this problem?): |
|
42 |
# Suspect this may not be needed anymore. |
|
43 |
JAVA_MEM_FLAGS += -Xms$(MAX_VM_MEMORY)m -XX:-Inline |
|
44 |
else |
|
45 |
JAVA_MEM_FLAGS += -Xms$(MIN_VM_MEMORY)m -XX:PermSize=32m -XX:MaxPermSize=160m |
|
46 |
endif |
|
47 |
||
48 |
# |
|
49 |
# All java tools (javac, javah, and javadoc) run faster with certain java |
|
50 |
# options, this macro should be used with all these tools. |
|
51 |
# In particular, the client VM makes these tools run faster when |
|
52 |
# it's available. |
|
53 |
# |
|
54 |
ADD_CLIENT_VM_OPTION = false |
|
55 |
ifeq ($(PLATFORM), solaris) |
|
56 |
ADD_CLIENT_VM_OPTION = true |
|
57 |
else |
|
58 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
59 |
ADD_CLIENT_VM_OPTION = true |
|
60 |
endif |
|
61 |
endif |
|
2399
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
62 |
|
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
63 |
# Options for hotspot to turn off printing of options with fastdebug version |
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
64 |
# and creating the hotspot.log file. |
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
65 |
JAVA_HOTSPOT_DISABLE_PRINT_VMOPTIONS = \ |
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
66 |
-XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput |
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
67 |
|
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
68 |
# JVM options |
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
69 |
JAVA_JVM_FLAGS = $(JAVA_HOTSPOT_DISABLE_PRINT_VMOPTIONS) |
8152d21ae245
6745361: Add -XX options to prevent stdout/stderr pollution using fastdebug/debug bootjdk
ohair
parents:
2169
diff
changeset
|
70 |
|
2 | 71 |
ifeq ($(ADD_CLIENT_VM_OPTION), true) |
72 |
JAVA_JVM_FLAGS += -client |
|
73 |
endif |
|
74 |
ifdef USE_HOTSPOT_INTERPRETER_MODE |
|
75 |
JAVA_JVM_FLAGS += -Xint |
|
76 |
endif |
|
77 |
||
78 |
# Various VM flags |
|
79 |
JAVA_TOOLS_FLAGS = $(JAVA_JVM_FLAGS) $(JAVA_MEM_FLAGS) |
|
80 |
||
81 |
# The VM flags for javac |
|
82 |
JAVAC_JVM_FLAGS = |
|
83 |
||
84 |
# 64-bit builds require a larger thread stack size. |
|
85 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
86 |
JAVAC_JVM_FLAGS += -J-XX:ThreadStackSize=768 |
|
87 |
else |
|
88 |
JAVAC_JVM_FLAGS += -J-XX:ThreadStackSize=1536 |
|
89 |
endif |
|
90 |
JAVAC_JVM_FLAGS += $(JAVA_TOOLS_FLAGS:%=-J%) |
|
91 |
||
92 |
# The jar -J options are special, must be added at the end of the command line |
|
93 |
JAR_JFLAGS = $(JAVA_TOOLS_FLAGS:%=-J%) |
|
94 |
||
95 |
# JAVA_TOOLS_DIR is the default location to find Java tools to run, if |
|
96 |
# langtools is not available. |
|
97 |
# This should be the latest promoted JDK javac. |
|
98 |
ifndef JAVA_TOOLS_DIR |
|
99 |
JAVA_TOOLS_DIR = $(JDK_IMPORT_PATH)/bin |
|
100 |
endif |
|
101 |
||
102 |
# |
|
103 |
# Invoking the Java compiler. In leaf makefiles, choose as follows: |
|
104 |
# -- Use JAVAC if you want to take full control of what options get |
|
105 |
# passed to javac. |
|
106 |
# -- Use JAVAC_CMD if you want to take the defaults given to you. |
|
107 |
# |
|
108 |
||
109 |
ifndef DEBUG_CLASSFILES |
|
110 |
ifeq ($(VARIANT), DBG) |
|
111 |
DEBUG_CLASSFILES = true |
|
112 |
endif |
|
113 |
endif |
|
114 |
JAVACFLAGS = |
|
115 |
ifeq ($(DEBUG_CLASSFILES),true) |
|
116 |
JAVACFLAGS += -g |
|
117 |
endif |
|
849
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
2
diff
changeset
|
118 |
ifeq ($(JAVAC_MAX_WARNINGS), true) |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
2
diff
changeset
|
119 |
JAVACFLAGS += -Xlint:all |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
2
diff
changeset
|
120 |
endif |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
2
diff
changeset
|
121 |
ifeq ($(JAVAC_WARNINGS_FATAL), true) |
2 | 122 |
JAVACFLAGS += -Werror |
123 |
endif |
|
124 |
||
3329
51166c6dca11
6854244: change source/target used to compile JDK to 7
jjg
parents:
2920
diff
changeset
|
125 |
# Add the source level |
51166c6dca11
6854244: change source/target used to compile JDK to 7
jjg
parents:
2920
diff
changeset
|
126 |
SOURCE_LANGUAGE_VERSION = 7 |
2920 | 127 |
LANGUAGE_VERSION = -source $(SOURCE_LANGUAGE_VERSION) |
2 | 128 |
JAVACFLAGS += $(LANGUAGE_VERSION) |
129 |
||
3329
51166c6dca11
6854244: change source/target used to compile JDK to 7
jjg
parents:
2920
diff
changeset
|
130 |
# Add the class version we want |
51166c6dca11
6854244: change source/target used to compile JDK to 7
jjg
parents:
2920
diff
changeset
|
131 |
TARGET_CLASS_VERSION = 7 |
2 | 132 |
CLASS_VERSION = -target $(TARGET_CLASS_VERSION) |
133 |
JAVACFLAGS += $(CLASS_VERSION) |
|
134 |
JAVACFLAGS += -encoding ascii |
|
135 |
JAVACFLAGS += "-Xbootclasspath:$(CLASSBINDIR)" |
|
136 |
JAVACFLAGS += $(OTHER_JAVACFLAGS) |
|
137 |
||
138 |
# Needed for javah |
|
139 |
JAVAHFLAGS += -bootclasspath $(CLASSBINDIR) |
|
140 |
||
4717
075c601c3de6
6917466: Should set bootclasspath for javadoc in jdk build
andrew
parents:
4060
diff
changeset
|
141 |
# Needed for javadoc to ensure it builds documentation |
075c601c3de6
6917466: Should set bootclasspath for javadoc in jdk build
andrew
parents:
4060
diff
changeset
|
142 |
# against the newly built classes |
075c601c3de6
6917466: Should set bootclasspath for javadoc in jdk build
andrew
parents:
4060
diff
changeset
|
143 |
JAVADOCFLAGS += -bootclasspath $(CLASSBINDIR) |
075c601c3de6
6917466: Should set bootclasspath for javadoc in jdk build
andrew
parents:
4060
diff
changeset
|
144 |
|
2169 | 145 |
# Needed for JAVADOC and BOOT_JAVACFLAGS |
146 |
NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true |
|
147 |
||
2 | 148 |
# Langtools |
149 |
ifdef LANGTOOLS_DIST |
|
150 |
JAVAC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javac.jar |
|
151 |
JAVAH_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javah.jar |
|
152 |
JAVADOC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javadoc.jar |
|
153 |
DOCLETS_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/doclets.jar |
|
154 |
JAVAC_CMD = $(BOOT_JAVA_CMD) \ |
|
155 |
"-Xbootclasspath/p:$(JAVAC_JAR)" \ |
|
156 |
-jar $(JAVAC_JAR) $(JAVACFLAGS) |
|
157 |
JAVAH_CMD = $(BOOT_JAVA_CMD) \ |
|
158 |
"-Xbootclasspath/p:$(JAVAH_JAR)$(CLASSPATH_SEPARATOR)$(JAVADOC_JAR)$(CLASSPATH_SEPARATOR)$(JAVAC_JAR)" \ |
|
159 |
-jar $(JAVAH_JAR) $(JAVAHFLAGS) |
|
160 |
JAVADOC_CMD = $(BOOT_JAVA_CMD) \ |
|
161 |
"-Xbootclasspath/p:$(JAVADOC_JAR)$(CLASSPATH_SEPARATOR)$(JAVAC_JAR)$(CLASSPATH_SEPARATOR)$(DOCLETS_JAR)" \ |
|
4717
075c601c3de6
6917466: Should set bootclasspath for javadoc in jdk build
andrew
parents:
4060
diff
changeset
|
162 |
-jar $(JAVADOC_JAR) $(JAVADOCFLAGS) |
2 | 163 |
else |
164 |
# If no explicit tools, use boot tools (add VM flags in this case) |
|
165 |
JAVAC_CMD = $(JAVA_TOOLS_DIR)/javac $(JAVAC_JVM_FLAGS) \ |
|
166 |
$(JAVACFLAGS) |
|
167 |
JAVAH_CMD = $(JAVA_TOOLS_DIR)/javah \ |
|
168 |
$(JAVAHFLAGS) |
|
4717
075c601c3de6
6917466: Should set bootclasspath for javadoc in jdk build
andrew
parents:
4060
diff
changeset
|
169 |
JAVADOC_CMD = $(JAVA_TOOLS_DIR)/javadoc $(JAVA_TOOLS_FLAGS:%=-J%) \ |
075c601c3de6
6917466: Should set bootclasspath for javadoc in jdk build
andrew
parents:
4060
diff
changeset
|
170 |
$(JAVADOCFLAGS) |
2 | 171 |
endif |
172 |
||
173 |
# Override of what javac to use (see deploy workspace) |
|
174 |
ifdef JAVAC |
|
175 |
JAVAC_CMD = $(JAVAC) |
|
176 |
endif |
|
177 |
||
178 |
# |
|
179 |
# The bootstrap java compiler (defined as the javac in the ALT_BOOTDIR jdk). |
|
180 |
# Will be used to compile java code used to build the jdk, e.g. class files |
|
181 |
# created by this compiler will NOT become part of this built jdk, but just |
|
182 |
# used to build this jdk, e.g. run with the java in the ALT_BOOTDIR jdk. |
|
183 |
# |
|
184 |
# The javac supplied with the LANGTOOLS_DIST should be used to build the |
|
185 |
# classes that will be put into the built jdk. But note that this javac |
|
186 |
# will use the ALT_BOOTDIR java runtime. Any classes created by the |
|
187 |
# LANGTOOLS_DIST javac should not be run during this jdk build and indeed |
|
188 |
# may not even run with the ALT_BOOTDIR jdk because they may be a newer |
|
189 |
# class file version that the ALT_BOOTDIR jdk doesn't understand. |
|
190 |
# |
|
191 |
# The important observation here is that the built jdk is NOT run during |
|
192 |
# the build. If the built jdk needs to be verified that it can build this |
|
193 |
# same jdk, then it should be supplied to the build process as the ALT_BOOTDIR |
|
194 |
# jdk, and this resulting built jdk should be compared to the first one. |
|
195 |
# (They should be the same). Re-using this built jdk as the ALT_BOOTDIR |
|
196 |
# jdk will be the only way and the recommeneded way to verify the built jdk |
|
197 |
# can bootstrap itself. |
|
198 |
# |
|
199 |
||
200 |
# The javac options supplied to the boot javac is limited. This compiler |
|
201 |
# should only be used to build the 'make/tools' sources, which are not |
|
202 |
# class files that end up in the classes directory. |
|
849
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
2
diff
changeset
|
203 |
ifeq ($(JAVAC_MAX_WARNINGS), true) |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
2
diff
changeset
|
204 |
BOOT_JAVACFLAGS += -Xlint:all |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
2
diff
changeset
|
205 |
endif |
be386e469547
6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
ohair
parents:
2
diff
changeset
|
206 |
ifeq ($(JAVAC_WARNINGS_FATAL), true) |
2 | 207 |
BOOT_JAVACFLAGS += -Werror |
208 |
endif |
|
3638
fbd0a9baa7d4
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk javac
andrew
parents:
3329
diff
changeset
|
209 |
|
fbd0a9baa7d4
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk javac
andrew
parents:
3329
diff
changeset
|
210 |
BOOT_SOURCE_LANGUAGE_VERSION = 6 |
fbd0a9baa7d4
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk javac
andrew
parents:
3329
diff
changeset
|
211 |
BOOT_TARGET_CLASS_VERSION = 6 |
fbd0a9baa7d4
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk javac
andrew
parents:
3329
diff
changeset
|
212 |
BOOT_JAVACFLAGS += -encoding ascii -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) |
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
849
diff
changeset
|
213 |
BOOT_JAR_JFLAGS += $(JAR_JFLAGS) |
2 | 214 |
|
2169 | 215 |
BOOT_JAVACFLAGS += $(NO_PROPRIETARY_API_WARNINGS) |
216 |
||
2 | 217 |
BOOT_JAVA_CMD = $(BOOTDIR)/bin/java $(JAVA_TOOLS_FLAGS) |
218 |
BOOT_JAVAC_CMD = $(BOOTDIR)/bin/javac $(JAVAC_JVM_FLAGS) $(BOOT_JAVACFLAGS) |
|
219 |
BOOT_JAR_CMD = $(BOOTDIR)/bin/jar |
|
220 |
BOOT_JARSIGNER_CMD = $(BOOTDIR)/bin/jarsigner |
|
221 |
||
222 |
# Various tools we need to run (FIXUP: Are these the right ones?) |
|
223 |
NATIVE2ASCII = $(BOOTDIR)/bin/native2ascii $(JAVA_TOOLS_FLAGS:%=-J%) |
|
224 |
RMIC = $(BOOTDIR)/bin/rmic $(JAVA_TOOLS_FLAGS:%=-J%) |
|
225 |
IDLJ = $(BOOTDIR)/bin/idlj $(JAVA_TOOLS_FLAGS:%=-J%) |
|
226 |
||
227 |
# Should not be used |
|
228 |
JAVA = /should/not/be/used |
|
229 |