6833444: _BOOTDIR1/_BOOTDIR2 on MS Windows should be consistent with other platforms
authoranthony
Tue, 19 May 2009 14:43:49 +0400
changeset 2806 27edf81ff967
parent 2805 9f18d7e66042
child 2807 db01a7f6d657
6833444: _BOOTDIR1/_BOOTDIR2 on MS Windows should be consistent with other platforms Summary: Added optional _BOOTDIR3 that provides the J: path for the BOOTDIR on Windows Reviewed-by: ohair, xdono
jdk/make/common/Sanity.gmk
jdk/make/common/shared/Defs-windows.gmk
jdk/make/common/shared/Defs.gmk
jdk/make/common/shared/Sanity.gmk
--- a/jdk/make/common/Sanity.gmk	Tue May 19 14:14:31 2009 +0400
+++ b/jdk/make/common/Sanity.gmk	Tue May 19 14:43:49 2009 +0400
@@ -92,6 +92,7 @@
     sane-ld_run_path \
     sane-alt_bootdir \
     sane-bootdir \
+    sane-local-bootdir \
     sane-alsa-headers \
     sane-jibx
 
--- a/jdk/make/common/shared/Defs-windows.gmk	Tue May 19 14:14:31 2009 +0400
+++ b/jdk/make/common/shared/Defs-windows.gmk	Tue May 19 14:43:49 2009 +0400
@@ -431,9 +431,11 @@
 
 # _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
 # _BOOTDIR2: Second choice
+# The _BOOTDIR3 is defind optionally.
 ifndef ALT_BOOTDIR
   _BOOTDIR1  =$(_system_drive)/jdk$(PREVIOUS_JDK_VERSION)
   _BOOTDIR2  =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION)
+  _BOOTDIR3  =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
 endif
 
 # 32 bit always needs 2 runtimes, 64 bit usually does too
--- a/jdk/make/common/shared/Defs.gmk	Tue May 19 14:14:31 2009 +0400
+++ b/jdk/make/common/shared/Defs.gmk	Tue May 19 14:43:49 2009 +0400
@@ -94,6 +94,21 @@
   fi)
 endef
 
+# Select a directory if it exists, or the alternate 2, or the alternate 3, or the alternate 4
+define DirExists4
+$(shell \
+  if [ -d "$1" ]; then  \
+    echo "$1"; \
+  elif [ -d "$2" ]; then \
+    echo "$2"; \
+  elif [ -d "$3" ]; then \
+    echo "$3"; \
+  else \
+    echo "$4"; \
+  fi)
+endef
+
+
 # Select a writable directory if it exists and is writable, or the alternate
 define WriteDirExists
 $(shell \
@@ -356,10 +371,15 @@
 
 # BOOTDIR: Bootstrap JDK, previous released JDK.
 #   _BOOTDIR1 and _BOOTDIR2 picked by platform
+#   Platform may optionally define _BOOTDIR3 as well.
 ifdef ALT_BOOTDIR
   BOOTDIR =$(ALT_BOOTDIR)
 else
-  BOOTDIR  :=$(call DirExists,$(_BOOTDIR1),$(_BOOTDIR2),/NO_BOOTDIR)
+  ifdef _BOOTDIR3
+    BOOTDIR  :=$(call DirExists4,$(_BOOTDIR1),$(_BOOTDIR2),$(_BOOTDIR3),/NO_BOOTDIR)
+  else
+    BOOTDIR  :=$(call DirExists,$(_BOOTDIR1),$(_BOOTDIR2),/NO_BOOTDIR)
+  endif
 endif
 export BOOTDIR
 BOOTDIR:=$(call AltCheckSpaces,BOOTDIR)
--- a/jdk/make/common/shared/Sanity.gmk	Tue May 19 14:14:31 2009 +0400
+++ b/jdk/make/common/shared/Sanity.gmk	Tue May 19 14:43:49 2009 +0400
@@ -194,7 +194,8 @@
 	sane-outputdir \
 	sane-alt_bootdir \
 	sane-bootdir \
-        sane-cups \
+	sane-local-bootdir \
+	sane-cups \
 	sane-devtools_path \
 	sane-compiler_path \
 	sane-unixcommand_path \
@@ -767,6 +768,23 @@
 	fi
 
 ######################################################
+# BOOTDIR is recommended to reside on a local drive
+######################################################
+sane-local-bootdir:
+ifeq ($(PLATFORM), windows)
+	@if [ `$(ECHO) $(BOOTDIR) | $(EGREP) -ci '^J:'` -ne 0 ]; then \
+	  $(ECHO) "WARNING: Your BOOTDIR is located on the J: drive. Often the J:\n" \
+	    "        drive is mapped over a network. Using a mapped drive for\n" \
+	    "        the BOOTDIR may significantly slow down the build process.\n" \
+	    "        You may want to consider using the ALT_BOOTDIR variable\n" \
+	    "        to point the build to another location for the BOOTDIR instead. \n" \
+	    "        Your current BOOTDIR is:\n" \
+	    "           $(BOOTDIR) \n" \
+	    "" >> $(WARNING_FILE) ; \
+	fi
+endif
+
+######################################################
 # CACERTS_FILE must be absoulte path and readable
 ######################################################
 sane-cacerts: