8006872: Stop creating four jars with identical content in the new build system.
authorohrstrom
Thu, 31 Jan 2013 14:00:09 +0100
changeset 15393 e3761cf4e010
parent 15389 f1478a6d25fd
child 15394 9a1066ec78be
8006872: Stop creating four jars with identical content in the new build system. Reviewed-by: erikj
common/autoconf/spec.gmk.in
common/makefiles/JavaCompilation.gmk
common/makefiles/javadoc/Javadoc.gmk
--- a/common/autoconf/spec.gmk.in	Wed Jul 05 18:38:32 2017 +0200
+++ b/common/autoconf/spec.gmk.in	Thu Jan 31 14:00:09 2013 +0100
@@ -434,6 +434,12 @@
 
 JARSIGNER=@FIXPATH@ $(BOOT_JDK)/bin/jarsigner
 
+# You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
+BOOTSTRAP_JAVAC_JAR:=$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar
+BOOTSTRAP_JAVAC_ARGS:="-Xbootclasspath/p:$(BOOTSTRAP_JAVAC_JAR)" -cp $(BOOTSTRAP_JAVAC_JAR)
+NEW_JAVAC   = $(BOOTSTRAP_JAVAC_ARGS) com.sun.tools.javac.Main
+NEW_JAVADOC = $(BOOTSTRAP_JAVAC_ARGS) com.sun.tools.javadoc.Main
+
 # Base flags for RC
 # Guarding this against resetting value. Legacy make files include spec multiple
 # times.
--- a/common/makefiles/JavaCompilation.gmk	Wed Jul 05 18:38:32 2017 +0200
+++ b/common/makefiles/JavaCompilation.gmk	Thu Jan 31 14:00:09 2013 +0100
@@ -42,8 +42,8 @@
 FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
 
 define SetupJavaCompiler
-    # param 1 is for example BOOT_JAVAC or NEW_JAVAC
-    # This is the name later used to decide which java compiler to use.
+    # param 1 is for example GENERATE_OLD_BYTECODE or GENERATE_NEW_JDKBYTECODE
+    # This is the name of the compiler setup.
     # param 2-9 are named args.
     #   JVM:=The jvm used to run the javac/javah command
     #   JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out
@@ -487,10 +487,10 @@
         # Using sjavac to compile. 
         $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/javac_state
 
-        # Create SJAVAC variable,
-        # expects $1_JAVAC to be "bootclasspathprepend -jar ...javac.jar"
-        # and it is rewritten into "bootclasspathprepend com.sun.tools.sjavac.Main"
-        $1_SJAVAC:=$$(word 1,$$($1_JAVAC)) -cp $$(word 3,$$($1_JAVAC)) com.sun.tools.sjavac.Main
+        # Create SJAVAC variable form JAVAC variable. Expects $1_JAVAC to be 
+        # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main"
+        # and javac is simply replaced with sjavac.
+        $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC))
 
         # Set the $1_REMOTE to spawn a background javac server.
         $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
--- a/common/makefiles/javadoc/Javadoc.gmk	Wed Jul 05 18:38:32 2017 +0200
+++ b/common/makefiles/javadoc/Javadoc.gmk	Thu Jan 31 14:00:09 2013 +0100
@@ -46,14 +46,11 @@
 
 BUILD_NUMBER=$(JDK_BUILD_NUMBER)
 
-BOOT_JAVA_CMD=$(JAVA)
-
-JAVADOC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javadoc.jar
-JAVADOC_CMD = $(BOOT_JAVA_CMD) \
+JAVADOC_CMD = $(JAVA) \
               -Xmx1024m \
 	      -Djava.awt.headless=true \
-              "-Xbootclasspath/p:$(JAVADOC_JAR)" \
-              -jar $(JAVADOC_JAR) -bootclasspath $(JDK_OUTPUTDIR)/classes
+	      $(NEW_JAVADOC) \
+	      -bootclasspath $(JDK_OUTPUTDIR)/classes
 
 # Copyright year for beginning of Java and some of the apis
 #   (Needed when creating the javadocs)