changeset 1169:980f315286b9

8058118: Generate modules.list during the build Reviewed-by: alanb, ihse, tbell, mchung
author erikj
date Tue, 16 Sep 2014 12:08:04 +0200
parents 96de7aa61b7e
children 1540bfaa0606
files Makefile common/autoconf/spec.gmk.in make/Main.gmk make/common/Modules.gmk make/common/SetupJavaCompilers.gmk make/common/modules.list modules.xml
diffstat 7 files changed, 50 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Mon Sep 15 12:23:32 2014 -0700
+++ b/Makefile	Tue Sep 16 12:08:04 2014 +0200
@@ -70,8 +70,8 @@
   # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
   # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
   all_phony_targets := $(sort $(filter-out $(global_targets), $(strip $(shell \
-      cd $(root_dir)/make && $(MAKE) -f Main.gmk -p -q FRC SPEC=$(firstword $(SPEC)) | \
-      grep "^.PHONY:" | head -n 1 | cut -d " " -f 2-))))
+      cd $(root_dir)/make && $(MAKE) -f Main.gmk -p -q FRC SPEC=$(firstword $(SPEC)) \
+      -I $(root_dir)/make/common | grep "^.PHONY:" | head -n 1 | cut -d " " -f 2-))))
 
   # Loop through the configurations and call the main-wrapper for each one. The wrapper
   # target will execute with a single configuration loaded.
@@ -115,12 +115,12 @@
 
     main-wrapper:
         ifneq ($(SEQUENTIAL_TARGETS), )
-	  (cd $(root_dir)/make && $(MAKE) -f Main.gmk SPEC=$(SPEC) -j 1 \
+	  (cd $(SRC_ROOT)/make && $(MAKE) -f Main.gmk SPEC=$(SPEC) -j 1 \
 	      $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(SEQUENTIAL_TARGETS))
         endif
         ifneq ($(PARALLEL_TARGETS), )
 	  @$(call AtMakeStart)
-	  (cd $(root_dir)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -f Main.gmk SPEC=$(SPEC) -j $(JOBS) \
+	  (cd $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -f Main.gmk SPEC=$(SPEC) -j $(JOBS) \
 	      $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(PARALLEL_TARGETS) \
 	      $(if $(filter true, $(OUTPUT_SYNC_SUPPORTED)), -O$(OUTPUT_SYNC)))
 	  @$(call AtMakeEnd)
--- a/common/autoconf/spec.gmk.in	Mon Sep 15 12:23:32 2014 -0700
+++ b/common/autoconf/spec.gmk.in	Tue Sep 16 12:08:04 2014 +0200
@@ -245,6 +245,7 @@
 NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
 IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
 TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/testmake
+MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
 
 LANGTOOLS_DIST=$(LANGTOOLS_OUTPUTDIR)/dist
 CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
--- a/make/Main.gmk	Mon Sep 15 12:23:32 2014 -0700
+++ b/make/Main.gmk	Tue Sep 16 12:08:04 2014 +0200
@@ -493,7 +493,7 @@
 # file.
 
 CLEAN_COMPONENTS += langtools corba hotspot jdk nashorn images \
-    bootcycle-build docs docstemp test
+    bootcycle-build docs docstemp test make-support
 CLEAN_TARGETS := $(addprefix clean-, $(CLEAN_COMPONENTS))
 
 # Remove everything, except the output from configure.
--- a/make/common/Modules.gmk	Mon Sep 15 12:23:32 2014 -0700
+++ b/make/common/Modules.gmk	Tue Sep 16 12:08:04 2014 +0200
@@ -26,6 +26,9 @@
 ifndef _MODULES_GMK
 _MODULES_GMK := 1
 
+include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
+
 ################################################################################
 # Module list macros
 
@@ -50,8 +53,32 @@
           $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS))))))))))))
 endef
 
-MODULES_LIST_FILE := $(SRC_ROOT)/make/common/modules.list
-MODULE_DEPS_MAKEFILE := $(OUTPUT_ROOT)/module-deps.gmk
+# Find all modules with source for the target platform.
+define FindAllModules
+  $(sort $(filter-out closed demo sample, $(notdir $(patsubst %/,%, $(dir \
+      $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \
+      $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \
+      $(patsubst %, %/*/$(OPENJDK_TARGET_OS_API_DIR), $(ALL_TOP_SRC_DIRS))))))))
+endef
+
+################################################################################
+
+$(eval $(call SetupJavaCompilation,BUILD_GENMODULESLIST, \
+    SETUP := BOOT_JAVAC, \
+    SRC := $(JDK_TOPDIR)/make/src/classes, \
+    INCLUDES := build/tools/module, \
+    BIN := $(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist))
+
+TOOL_GENMODULESLIST = $(JAVA_SMALL) \
+    -cp "$(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist" \
+    build.tools.module.GenModulesList
+
+MODULES_LIST_FILE := $(MAKESUPPORT_OUTPUTDIR)/modules.list
+MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
+
+$(MODULES_LIST_FILE): $(SRC_ROOT)/modules.xml \
+    $(BUILD_GENMODULESLIST)
+	$(TOOL_GENMODULESLIST) -o $@ $(filter %.xml, $^)
 
 $(MODULE_DEPS_MAKEFILE): $(MODULES_LIST_FILE)
 	$(CAT) $^ | $(SED) -e 's/^\([^:]*\):/DEPS_\1 :=/g' > $@
@@ -63,14 +90,6 @@
   $(DEPS_$(strip $1))
 endef
 
-# Find all modules with source for the target platform.
-define FindAllModules
-  $(sort $(filter-out closed demo sample, $(notdir $(patsubst %/,%, $(dir \
-      $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \
-      $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \
-      $(patsubst %, %/*/$(OPENJDK_TARGET_OS_API_DIR), $(ALL_TOP_SRC_DIRS))))))))
-endef
-
 ################################################################################
 
 # Hook to include the corresponding custom file, if present.
--- a/make/common/SetupJavaCompilers.gmk	Mon Sep 15 12:23:32 2014 -0700
+++ b/make/common/SetupJavaCompilers.gmk	Tue Sep 16 12:08:04 2014 +0200
@@ -34,6 +34,12 @@
 # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
 JAVAC_WARNINGS := -Xlint:all,-deprecation -Werror
 
+# The BOOT_JAVAC setup uses the boot jdk compiler to compile the tools
+# and the interim javac, to be run by the boot jdk.
+$(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
+    JAVAC := $(JAVAC), \
+    FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror))
+
 # Any java code executed during a JDK build to build other parts of the JDK must be 
 # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this 
 # purpose must be built with -target PREVIOUS for bootstrapping purposes, which 
--- a/make/common/modules.list	Mon Sep 15 12:23:32 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-java.base: 
-java.logging: java.base
-java.security.sasl: java.logging java.base
-java.naming: java.security.sasl java.base
-java.security.acl: java.base
-jdk.charsets: java.base
-java.scripting: java.base
-java.xml: java.base
-java.sql: java.xml java.logging java.base
-jdk.scripting.nashorn: java.scripting java.logging java.base
-java.rmi: java.logging java.base
-java.prefs: java.xml java.base
-java.desktop: jdk.charsets java.prefs java.xml java.logging java.base
-java.corba: java.naming java.rmi java.desktop java.logging java.base
-java.compiler: java.logging java.base
-jdk.compiler: java.compiler java.base
-jdk.javadoc: java.compiler java.xml jdk.compiler java.base
-jdk.rmic: java.corba jdk.compiler jdk.javadoc java.base
-jdk.jvmstat: java.rmi java.base
-jdk.attach: jdk.jvmstat java.base
-jdk.jcmd: jdk.jvmstat jdk.attach java.base
-jdk.jdi: jdk.attach java.base
-jdk.hotspot.agent: java.rmi java.scripting java.desktop java.base jdk.jdi
-jdk.hprof.agent: java.base
-java.management: java.naming java.rmi java.logging java.base
-jdk.jconsole: java.management jdk.jvmstat java.rmi jdk.attach java.desktop java.logging java.base
-java.activation: java.desktop java.logging java.base
-java.xml.bind: java.activation java.compiler java.xml java.desktop java.logging java.base
-jdk.xml.bind: java.activation java.compiler java.xml.bind java.xml java.desktop java.logging jdk.compiler java.base
-jdk.httpserver: java.logging java.base
-java.annotations.common: java.base
-java.xml.soap: java.activation java.xml.bind java.xml java.desktop java.logging java.base
-java.xml.ws: java.activation java.management jdk.httpserver java.rmi java.annotations.common java.xml.bind java.xml java.desktop java.logging java.xml.soap java.base
-jdk.xml.ws: jdk.xml.bind java.compiler java.rmi java.xml.ws java.xml.bind java.xml java.logging java.base
-java.sql.rowset: java.naming java.sql java.xml java.logging java.base
-java.instrument: java.base
-java.security.jgss: java.naming java.security.sasl java.logging java.base
-java.xml.crypto: java.xml java.logging java.base
-jdk.localedata: java.base
-jdk.crypto.ec: java.base
-jdk.crypto.pkcs11: jdk.crypto.ec java.base
-jdk.crypto.mscapi: java.base
-jdk.naming.rmi: java.naming java.rmi java.base
-jdk.zipfs: java.base
-jdk.naming.dns: java.naming java.base
-java.smartcardio: java.base
-jdk.dev: jdk.xml.bind jdk.xml.ws java.scripting jdk.rmic java.xml jdk.compiler java.base
-jdk.snmp: java.management java.security.acl java.logging java.base
-jdk.jdwp.agent: java.base
-jdk.security.auth: java.naming java.security.jgss java.base
-jdk.sctp: java.base
-jdk.runtime: java.desktop java.base
-jdk.jfr: java.management java.xml java.base
-jdk.deploy.osx: java.scripting java.desktop java.base
--- a/modules.xml	Mon Sep 15 12:23:32 2014 -0700
+++ b/modules.xml	Tue Sep 16 12:08:04 2014 +0200
@@ -327,6 +327,7 @@
     </export>
     <export>
       <name>sun.security.internal.spec</name>
+      <to>jdk.crypto.mscapi</to>
       <to>jdk.crypto.pkcs11</to>
       <to>jdk.crypto.ucrypto</to>
     </export>
@@ -731,6 +732,10 @@
     <export>
       <name>javax.swing.undo</name>
     </export>
+    <export>
+      <name>sun.awt</name>
+      <to>oracle.accessbridge</to>
+    </export>
   </module>
   <module>
     <name>java.instrument</name>
@@ -1571,6 +1576,10 @@
     </export>
   </module>
   <module>
+    <name>jdk.crypto.mscapi</name>
+    <depend>java.base</depend>
+  </module>
+  <module>
     <name>jdk.crypto.pkcs11</name>
     <depend>java.base</depend>
     <depend>jdk.crypto.ec</depend>