duke@1: # ohair@158: # Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. duke@1: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: # duke@1: # This code is free software; you can redistribute it and/or modify it duke@1: # under the terms of the GNU General Public License version 2 only, as ohair@158: # published by the Free Software Foundation. Oracle designates this duke@1: # particular file as subject to the "Classpath" exception as provided ohair@158: # by Oracle in the LICENSE file that accompanied this code. duke@1: # duke@1: # This code is distributed in the hope that it will be useful, but WITHOUT duke@1: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: # version 2 for more details (a copy is included in the LICENSE file that duke@1: # accompanied this code). duke@1: # duke@1: # You should have received a copy of the GNU General Public License version duke@1: # 2 along with this work; if not, write to the Free Software Foundation, duke@1: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: # ohair@158: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@158: # or visit www.oracle.com if you need additional information or have any ohair@158: # questions. duke@1: # duke@1: duke@1: # duke@1: # Common java/javac/jdk variables used by all the Java makefiles. duke@1: # This file should not contain rules. duke@1: # duke@1: duke@1: # duke@1: # Memory related -J flags that all uses of java tools should use. duke@1: # duke@1: JAVA_MEM_FLAGS = -Xmx$(MAX_VM_MEMORY)m duke@1: ifeq ($(ARCH), ia64) duke@1: # Special flags for javac on ia64 to work around a VM problem with duke@1: # bad code generation during inlining (what version had this problem?): duke@1: # Suspect this may not be needed anymore. duke@1: JAVA_MEM_FLAGS += -Xms$(MAX_VM_MEMORY)m -XX:-Inline duke@1: else duke@1: JAVA_MEM_FLAGS += -Xms$(MIN_VM_MEMORY)m -XX:PermSize=32m -XX:MaxPermSize=160m duke@1: endif duke@1: duke@1: # ohair@194: # All java tools (javac and javadoc) run faster with certain java duke@1: # options, this macro should be used with all these tools. duke@1: # In particular, the client VM makes these tools run faster when duke@1: # it's available. duke@1: # duke@1: ADD_CLIENT_VM_OPTION = false duke@1: ifeq ($(PLATFORM), solaris) duke@1: ADD_CLIENT_VM_OPTION = true duke@1: else duke@1: ifeq ($(ARCH_DATA_MODEL), 32) duke@1: ADD_CLIENT_VM_OPTION = true duke@1: endif duke@1: endif andrew@111: andrew@111: # Options for hotspot to turn off printing of options with fastdebug version andrew@111: # and creating the hotspot.log file. andrew@111: JAVA_HOTSPOT_DISABLE_PRINT_VMOPTIONS = \ andrew@111: -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput andrew@111: andrew@111: # JVM options andrew@111: JAVA_JVM_FLAGS = $(JAVA_HOTSPOT_DISABLE_PRINT_VMOPTIONS) andrew@111: duke@1: ifeq ($(ADD_CLIENT_VM_OPTION), true) duke@1: JAVA_JVM_FLAGS += -client duke@1: endif andrew@111: ifdef USE_HOTSPOT_INTERPRETER_MODE andrew@111: JAVA_JVM_FLAGS += -Xint andrew@111: endif duke@1: duke@1: # Various VM flags duke@1: JAVA_TOOLS_FLAGS = $(JAVA_JVM_FLAGS) $(JAVA_MEM_FLAGS) duke@1: duke@1: # The VM flags for javac duke@1: JAVAC_JVM_FLAGS = duke@1: duke@1: # 64-bit builds require a larger thread stack size. duke@1: ifeq ($(ARCH_DATA_MODEL), 32) duke@1: JAVAC_JVM_FLAGS += -J-XX:ThreadStackSize=768 duke@1: else duke@1: JAVAC_JVM_FLAGS += -J-XX:ThreadStackSize=1536 duke@1: endif duke@1: JAVAC_JVM_FLAGS += $(JAVA_TOOLS_FLAGS:%=-J%) duke@1: duke@1: # The jar -J options are special, must be added at the end of the command line duke@1: JAR_JFLAGS = $(JAVA_TOOLS_FLAGS:%=-J%) duke@1: duke@1: # JAVA_TOOLS_DIR is the default location to find Java tools to run, if duke@1: # langtools is not available. duke@1: # This should be the latest promoted JDK javac. duke@1: ifndef JAVA_TOOLS_DIR duke@1: JAVA_TOOLS_DIR = $(JDK_IMPORT_PATH)/bin duke@1: endif duke@1: duke@1: # duke@1: # Invoking the Java compiler. In leaf makefiles, choose as follows: duke@1: # -- Use JAVAC if you want to take full control of what options get duke@1: # passed to javac. duke@1: # -- Use JAVAC_CMD if you want to take the defaults given to you. duke@1: # duke@1: duke@1: ifndef DEBUG_CLASSFILES duke@1: ifeq ($(VARIANT), DBG) duke@1: DEBUG_CLASSFILES = true duke@1: endif duke@1: endif duke@1: JAVACFLAGS = duke@1: ifeq ($(DEBUG_CLASSFILES),true) duke@1: JAVACFLAGS += -g duke@1: endif andrew@111: ifeq ($(JAVAC_MAX_WARNINGS), true) andrew@111: JAVACFLAGS += -Xlint:all andrew@111: endif andrew@111: ifeq ($(JAVAC_WARNINGS_FATAL), true) duke@1: JAVACFLAGS += -Werror duke@1: endif duke@1: jjg@52: NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true jjg@52: JAVACFLAGS += $(NO_PROPRIETARY_API_WARNINGS) jjg@52: jjg@100: # Add the source level andrew@111: SOURCE_LANGUAGE_VERSION = 7 andrew@111: LANGUAGE_VERSION = -source $(SOURCE_LANGUAGE_VERSION) duke@1: JAVACFLAGS += $(LANGUAGE_VERSION) duke@1: jjg@100: # Add the class version we want jjg@100: TARGET_CLASS_VERSION = 7 duke@1: CLASS_VERSION = -target $(TARGET_CLASS_VERSION) duke@1: JAVACFLAGS += $(CLASS_VERSION) duke@1: JAVACFLAGS += -encoding ascii duke@1: JAVACFLAGS += -classpath $(BOOTDIR)/lib/tools.jar duke@1: JAVACFLAGS += $(OTHER_JAVACFLAGS) duke@1: duke@1: # Langtools duke@1: ifdef LANGTOOLS_DIST duke@1: JAVAC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javac.jar duke@1: JAVADOC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javadoc.jar duke@1: DOCLETS_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/doclets.jar duke@1: JAVAC_CMD = $(BOOT_JAVA_CMD) \ duke@1: "-Xbootclasspath/p:$(JAVAC_JAR)" \ duke@1: -jar $(JAVAC_JAR) $(JAVACFLAGS) duke@1: JAVADOC_CMD = $(BOOT_JAVA_CMD) \ duke@1: "-Xbootclasspath/p:$(JAVADOC_JAR)$(CLASSPATH_SEPARATOR)$(JAVAC_JAR)$(CLASSPATH_SEPARATOR)$(DOCLETS_JAR)" \ duke@1: -jar $(JAVADOC_JAR) duke@1: else duke@1: # If no explicit tools, use boot tools (add VM flags in this case) duke@1: JAVAC_CMD = $(JAVA_TOOLS_DIR)/javac $(JAVAC_JVM_FLAGS) \ duke@1: $(JAVACFLAGS) duke@1: JAVADOC_CMD = $(JAVA_TOOLS_DIR)/javadoc $(JAVA_TOOLS_FLAGS:%=-J%) duke@1: endif duke@1: duke@1: # Override of what javac to use (see deploy workspace) duke@1: ifdef JAVAC duke@1: JAVAC_CMD = $(JAVAC) duke@1: endif duke@1: duke@1: # duke@1: # The bootstrap java compiler (defined as the javac in the ALT_BOOTDIR jdk). duke@1: # Will be used to compile java code used to build the jdk, e.g. class files duke@1: # created by this compiler will NOT become part of this built jdk, but just duke@1: # used to build this jdk, e.g. run with the java in the ALT_BOOTDIR jdk. duke@1: # duke@1: # The javac supplied with the LANGTOOLS_DIST should be used to build the duke@1: # classes that will be put into the built jdk. But note that this javac duke@1: # will use the ALT_BOOTDIR java runtime. Any classes created by the duke@1: # LANGTOOLS_DIST javac should not be run during this jdk build and indeed duke@1: # may not even run with the ALT_BOOTDIR jdk because they may be a newer duke@1: # class file version that the ALT_BOOTDIR jdk doesn't understand. duke@1: # duke@1: # The important observation here is that the built jdk is NOT run during duke@1: # the build. If the built jdk needs to be verified that it can build this duke@1: # same jdk, then it should be supplied to the build process as the ALT_BOOTDIR duke@1: # jdk, and this resulting built jdk should be compared to the first one. duke@1: # (They should be the same). Re-using this built jdk as the ALT_BOOTDIR duke@1: # jdk will be the only way and the recommeneded way to verify the built jdk duke@1: # can bootstrap itself. duke@1: # duke@1: duke@1: # The javac options supplied to the boot javac is limited. This compiler duke@1: # should only be used to build the 'make/tools' sources, which are not duke@1: # class files that end up in the classes directory. andrew@111: ifeq ($(JAVAC_MAX_WARNINGS), true) andrew@111: BOOT_JAVACFLAGS += -Xlint:all andrew@111: endif andrew@111: ifeq ($(JAVAC_WARNINGS_FATAL), true) duke@1: BOOT_JAVACFLAGS += -Werror duke@1: endif andrew@111: andrew@109: BOOT_SOURCE_LANGUAGE_VERSION = 6 andrew@109: BOOT_TARGET_CLASS_VERSION = 6 andrew@109: BOOT_JAVACFLAGS += -encoding ascii -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) andrew@111: BOOT_JAR_JFLAGS += $(JAR_JFLAGS) duke@1: duke@1: BOOT_JAVA_CMD = $(BOOTDIR)/bin/java $(JAVA_TOOLS_FLAGS) duke@1: BOOT_JAVAC_CMD = $(BOOTDIR)/bin/javac $(JAVAC_JVM_FLAGS) $(BOOT_JAVACFLAGS) duke@1: BOOT_JAR_CMD = $(BOOTDIR)/bin/jar duke@1: BOOT_JARSIGNER_CMD = $(BOOTDIR)/bin/jarsigner duke@1: duke@1: # Various tools we need to run (FIXUP: Are these the right ones?) duke@1: NATIVE2ASCII = $(BOOTDIR)/bin/native2ascii $(JAVA_TOOLS_FLAGS:%=-J%) duke@1: RMIC = $(BOOTDIR)/bin/rmic $(JAVA_TOOLS_FLAGS:%=-J%) duke@1: IDLJ = $(BOOTDIR)/bin/idlj $(JAVA_TOOLS_FLAGS:%=-J%) duke@1: duke@1: # Should not be used duke@1: JAVA = /should/not/be/used duke@1: