< prev index next >

make/common/shared/Defs-java.gmk

Print this page
rev 1377 : 6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles
Reviewed-by: tbell
rev 1381 : 7060849: Eliminate pack200 build warnings
7069870: Parts of the JDK erroneously rely on generic array initializers with diamond
Reviewed-by: ksrini, jjg, mcimadamore
Contributed-by: alexandre.boulgakov@oracle.com

  90 ifndef JAVA_TOOLS_DIR
  91   JAVA_TOOLS_DIR = $(JDK_IMPORT_PATH)/bin
  92 endif
  93 
  94 #
  95 # Invoking the Java compiler.   In leaf makefiles, choose as follows:
  96 #  -- Use JAVAC if you want to take full control of what options get
  97 #     passed to javac.
  98 #  -- Use JAVAC_CMD if you want to take the defaults given to you.
  99 #
 100 
 101 ifndef DEBUG_CLASSFILES
 102   ifeq ($(VARIANT), DBG)
 103     DEBUG_CLASSFILES = true
 104   endif
 105 endif
 106 JAVACFLAGS =
 107 ifeq ($(DEBUG_CLASSFILES),true)
 108   JAVACFLAGS += -g
 109 endif
 110 ifeq ($(COMPILER_WARNINGS_FATAL), true)



 111   JAVACFLAGS  += -Werror
 112 endif
 113 





 114 # Add the source level (currently all source is 1.5, should this be 1.6?)
 115 LANGUAGE_VERSION = -source 1.5
 116 JAVACFLAGS  += $(LANGUAGE_VERSION)
 117 
 118 # Add the class version we want (currently this is 5, should it be 6 or even 7?)
 119 TARGET_CLASS_VERSION = 5
 120 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 121 JAVACFLAGS  += $(CLASS_VERSION)
 122 JAVACFLAGS  += -encoding ascii
 123 JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)"
 124 JAVACFLAGS  += $(OTHER_JAVACFLAGS)
 125 
 126 # Needed for javah
 127 JAVAHFLAGS += -bootclasspath $(CLASSBINDIR)
 128 
 129 # Needed for JAVADOC and BOOT_JAVACFLAGS
 130 NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true
 131 
 132 # Langtools
 133 ifdef LANGTOOLS_DIST


 166 #
 167 # The javac supplied with the LANGTOOLS_DIST should be used to build the
 168 #   classes that will be put into the built jdk. But note that this javac
 169 #   will use the ALT_BOOTDIR java runtime. Any classes created by the
 170 #   LANGTOOLS_DIST javac should not be run during this jdk build and indeed
 171 #   may not even run with the ALT_BOOTDIR jdk because they may be a newer
 172 #   class file version that the ALT_BOOTDIR jdk doesn't understand.
 173 #
 174 # The important observation here is that the built jdk is NOT run during
 175 #   the build. If the built jdk needs to be verified that it can build this
 176 #   same jdk, then it should be supplied to the build process as the ALT_BOOTDIR
 177 #   jdk, and this resulting built jdk should be compared to the first one.
 178 #   (They should be the same). Re-using this built jdk as the ALT_BOOTDIR
 179 #   jdk will be the only way and the recommeneded way to verify the built jdk
 180 #   can bootstrap itself.
 181 #
 182 
 183 # The javac options supplied to the boot javac is limited. This compiler
 184 #   should only be used to build the 'make/tools' sources, which are not
 185 #   class files that end up in the classes directory.
 186 ifeq ($(COMPILER_WARNINGS_FATAL), true)

 187   BOOT_JAVACFLAGS  += -Werror
 188 endif
 189 
 190 BOOT_SOURCE_LANGUAGE_VERSION = 5
 191 BOOT_TARGET_CLASS_VERSION = 5
 192 BOOT_JAVACFLAGS  += -encoding ascii -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
 193 
 194 BOOT_JAVACFLAGS  += $(NO_PROPRIETARY_API_WARNINGS)
 195 
 196 BOOT_JAVA_CMD      = $(BOOTDIR)/bin/java $(JAVA_TOOLS_FLAGS)
 197 BOOT_JAVAC_CMD     = $(BOOTDIR)/bin/javac $(JAVAC_JVM_FLAGS) $(BOOT_JAVACFLAGS)
 198 BOOT_JAR_CMD       = $(BOOTDIR)/bin/jar
 199 BOOT_JARSIGNER_CMD = $(BOOTDIR)/bin/jarsigner
 200 
 201 # Various tools we need to run (FIXUP: Are these the right ones?)
 202 NATIVE2ASCII    = $(BOOTDIR)/bin/native2ascii $(JAVA_TOOLS_FLAGS:%=-J%)
 203 RMIC            = $(BOOTDIR)/bin/rmic $(JAVA_TOOLS_FLAGS:%=-J%)
 204 IDLJ            = $(BOOTDIR)/bin/idlj $(JAVA_TOOLS_FLAGS:%=-J%)
 205 
 206 # Should not be used

  90 ifndef JAVA_TOOLS_DIR
  91   JAVA_TOOLS_DIR = $(JDK_IMPORT_PATH)/bin
  92 endif
  93 
  94 #
  95 # Invoking the Java compiler.   In leaf makefiles, choose as follows:
  96 #  -- Use JAVAC if you want to take full control of what options get
  97 #     passed to javac.
  98 #  -- Use JAVAC_CMD if you want to take the defaults given to you.
  99 #
 100 
 101 ifndef DEBUG_CLASSFILES
 102   ifeq ($(VARIANT), DBG)
 103     DEBUG_CLASSFILES = true
 104   endif
 105 endif
 106 JAVACFLAGS =
 107 ifeq ($(DEBUG_CLASSFILES),true)
 108   JAVACFLAGS += -g
 109 endif
 110 ifeq ($(JAVAC_MAX_WARNINGS), true)
 111   JAVAC_LINT_OPTIONS += -Xlint:all
 112 endif
 113 ifeq ($(JAVAC_WARNINGS_FATAL), true)
 114   JAVACFLAGS  += -Werror
 115 endif
 116 
 117 # TODO: Workaround for CR 7063027. Remove -path eventually.
 118 JAVAC_LINT_OPTIONS += -Xlint:-path
 119 
 120 JAVACFLAGS += $(JAVAC_LINT_OPTIONS)
 121 
 122 # Add the source level (currently all source is 1.5, should this be 1.6?)
 123 LANGUAGE_VERSION = -source 1.5
 124 JAVACFLAGS  += $(LANGUAGE_VERSION)
 125 
 126 # Add the class version we want (currently this is 5, should it be 6 or even 7?)
 127 TARGET_CLASS_VERSION = 5
 128 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 129 JAVACFLAGS  += $(CLASS_VERSION)
 130 JAVACFLAGS  += -encoding ascii
 131 JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)"
 132 JAVACFLAGS  += $(OTHER_JAVACFLAGS)
 133 
 134 # Needed for javah
 135 JAVAHFLAGS += -bootclasspath $(CLASSBINDIR)
 136 
 137 # Needed for JAVADOC and BOOT_JAVACFLAGS
 138 NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true
 139 
 140 # Langtools
 141 ifdef LANGTOOLS_DIST


 174 #
 175 # The javac supplied with the LANGTOOLS_DIST should be used to build the
 176 #   classes that will be put into the built jdk. But note that this javac
 177 #   will use the ALT_BOOTDIR java runtime. Any classes created by the
 178 #   LANGTOOLS_DIST javac should not be run during this jdk build and indeed
 179 #   may not even run with the ALT_BOOTDIR jdk because they may be a newer
 180 #   class file version that the ALT_BOOTDIR jdk doesn't understand.
 181 #
 182 # The important observation here is that the built jdk is NOT run during
 183 #   the build. If the built jdk needs to be verified that it can build this
 184 #   same jdk, then it should be supplied to the build process as the ALT_BOOTDIR
 185 #   jdk, and this resulting built jdk should be compared to the first one.
 186 #   (They should be the same). Re-using this built jdk as the ALT_BOOTDIR
 187 #   jdk will be the only way and the recommeneded way to verify the built jdk
 188 #   can bootstrap itself.
 189 #
 190 
 191 # The javac options supplied to the boot javac is limited. This compiler
 192 #   should only be used to build the 'make/tools' sources, which are not
 193 #   class files that end up in the classes directory.
 194 BOOT_JAVACFLAGS += $(JAVAC_LINT_OPTIONS)
 195 ifeq ($(JAVAC_WARNINGS_FATAL), true)
 196   BOOT_JAVACFLAGS  += -Werror
 197 endif
 198 
 199 BOOT_SOURCE_LANGUAGE_VERSION = 5
 200 BOOT_TARGET_CLASS_VERSION = 5
 201 BOOT_JAVACFLAGS  += -encoding ascii -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
 202 
 203 BOOT_JAVACFLAGS  += $(NO_PROPRIETARY_API_WARNINGS)
 204 
 205 BOOT_JAVA_CMD      = $(BOOTDIR)/bin/java $(JAVA_TOOLS_FLAGS)
 206 BOOT_JAVAC_CMD     = $(BOOTDIR)/bin/javac $(JAVAC_JVM_FLAGS) $(BOOT_JAVACFLAGS)
 207 BOOT_JAR_CMD       = $(BOOTDIR)/bin/jar
 208 BOOT_JARSIGNER_CMD = $(BOOTDIR)/bin/jarsigner
 209 
 210 # Various tools we need to run (FIXUP: Are these the right ones?)
 211 NATIVE2ASCII    = $(BOOTDIR)/bin/native2ascii $(JAVA_TOOLS_FLAGS:%=-J%)
 212 RMIC            = $(BOOTDIR)/bin/rmic $(JAVA_TOOLS_FLAGS:%=-J%)
 213 IDLJ            = $(BOOTDIR)/bin/idlj $(JAVA_TOOLS_FLAGS:%=-J%)
 214 
 215 # Should not be used
< prev index next >