8003274: build-infra: Makefile changes needed for sjavac
authortbell
Tue, 13 Nov 2012 15:54:33 -0800
changeset 14379 b449aa34783e
parent 14378 0ef5d942b98e
child 14380 eb017c6fa58a
child 14458 8e22b637770a
8003274: build-infra: Makefile changes needed for sjavac Summary: changes left in build-infra that are related to sjavac Reviewed-by: ohair, tbell Contributed-by: erik.joelsson@oracle.com, fredrik.ohrstrom@oracle.com
common/autoconf/spec.gmk.in
common/makefiles/JavaCompilation.gmk
common/makefiles/MakeHelpers.gmk
--- a/common/autoconf/spec.gmk.in	Mon Nov 12 12:34:11 2012 -0800
+++ b/common/autoconf/spec.gmk.in	Tue Nov 13 15:54:33 2012 -0800
@@ -246,12 +246,6 @@
 # Store sjavac server synchronization files here, and
 # the sjavac server log files.
 SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@
-# We can block the Javac server to never use more cores than this.
-# This is not for performance reasons, but for memory usage, since each
-# core requires its own JavaCompiler. We might have 64 cores and 4GB
-# of memory, 64 JavaCompilers will currently not fit in a 3GB heap.
-# Since there is no sharing of data between the JavaCompilers.
-SJAVAC_SERVER_CORES:=@SJAVAC_SERVER_CORES@
 
 # The OpenJDK makefiles should be changed to using the standard
 # configure output ..._CFLAGS and ..._LIBS. In the meantime we
@@ -496,7 +490,14 @@
 # Where the build output is stored for your convenience.
 BUILD_LOG:=@BUILD_LOG@
 BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
-BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
+# Disable the build log wrapper on sjavac+winapi until
+# we have solved how to prevent the log wrapper to wait
+# for the background sjavac server process.
+ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS_API@,yesXwinapi)
+    BUILD_LOG_WRAPPER:=
+else
+    BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
+endif
 
 # Build setup
 ENABLE_JFR=@ENABLE_JFR@
--- a/common/makefiles/JavaCompilation.gmk	Mon Nov 12 12:34:11 2012 -0800
+++ b/common/makefiles/JavaCompilation.gmk	Tue Nov 13 15:54:33 2012 -0800
@@ -170,9 +170,10 @@
     # tells us what to remove from the jar-file.
     $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE))
     # The update contents macro updates the jar file with the previously capture contents.
+    # xargs is used to trim the whitespace from the contents file, to see if it is empty.
     $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
                     (cd $$(src) && \
-                     if [ -s _the.$$($1_JARNAME)_contents ]; then \
+                     if [ -n "`$(CAT) _the.$$($1_JARNAME)_contents | $(XARGS)`" ]; then \
                          $(ECHO) "  updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
                          $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \
                      fi) $$(NEWLINE))
--- a/common/makefiles/MakeHelpers.gmk	Mon Nov 12 12:34:11 2012 -0800
+++ b/common/makefiles/MakeHelpers.gmk	Tue Nov 13 15:54:33 2012 -0800
@@ -157,7 +157,7 @@
 
 # Hook to be called as the very last thing for targets that are "top level" targets
 define AtMakeEnd
-    $(if $(SJAVAC_SERVER_DIR),@$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
+    [ -f $(SJAVAC_SERVER_DIR)/server.port ] && echo Stopping sjavac server && $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true
     $(call StopGlobalTimer)
     $(call ReportBuildTimes)
     @$(PRINTF) "Finished building $(PRODUCT_NAME) for target '$(call GetRealTarget)'\n"
@@ -174,8 +174,8 @@
 define ParseLogLevel
     ifeq ($$(origin VERBOSE),undefined)
         # Setup logging according to LOG (but only if VERBOSE is not given)
-        
-       # If the "nofile" argument is given, act on it and strip it away
+
+        # If the "nofile" argument is given, act on it and strip it away
         ifneq ($$(findstring nofile,$$(LOG)),)
           # Reset the build log wrapper, regardless of other values
           override BUILD_LOG_WRAPPER=