From 013285996b5cba80a4ed73553f40f3893b411a5a Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Tue, 19 May 2009 14:43:49 +0400 Subject: [PATCH] 6833444: _BOOTDIR1/_BOOTDIR2 on MS Windows should be consistent with other platforms Added optional _BOOTDIR3 that provides the J: path for the BOOTDIR on Windows Reviewed-by: ohair, xdono --- jdk/make/common/Sanity.gmk | 1 + jdk/make/common/shared/Defs-windows.gmk | 2 ++ jdk/make/common/shared/Defs.gmk | 22 +++++++++++++++++++++- jdk/make/common/shared/Sanity.gmk | 20 +++++++++++++++++++- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/jdk/make/common/Sanity.gmk b/jdk/make/common/Sanity.gmk index eb4f00eb899..aa15361ff71 100644 --- a/jdk/make/common/Sanity.gmk +++ b/jdk/make/common/Sanity.gmk @@ -92,6 +92,7 @@ sanity-all:: sanity-base \ sane-ld_run_path \ sane-alt_bootdir \ sane-bootdir \ + sane-local-bootdir \ sane-alsa-headers \ sane-jibx diff --git a/jdk/make/common/shared/Defs-windows.gmk b/jdk/make/common/shared/Defs-windows.gmk index abaa6a1807e..ce985c8639d 100644 --- a/jdk/make/common/shared/Defs-windows.gmk +++ b/jdk/make/common/shared/Defs-windows.gmk @@ -431,9 +431,11 @@ DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH) # _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 diff --git a/jdk/make/common/shared/Defs.gmk b/jdk/make/common/shared/Defs.gmk index dc62f1ee5a4..6477a075c18 100644 --- a/jdk/make/common/shared/Defs.gmk +++ b/jdk/make/common/shared/Defs.gmk @@ -94,6 +94,21 @@ $(shell \ 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 @@ endif # 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) diff --git a/jdk/make/common/shared/Sanity.gmk b/jdk/make/common/shared/Sanity.gmk index 84d5e2201a0..fa8894990f3 100644 --- a/jdk/make/common/shared/Sanity.gmk +++ b/jdk/make/common/shared/Sanity.gmk @@ -194,7 +194,8 @@ include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk sane-outputdir \ sane-alt_bootdir \ sane-bootdir \ - sane-cups \ + sane-local-bootdir \ + sane-cups \ sane-devtools_path \ sane-compiler_path \ sane-unixcommand_path \ @@ -766,6 +767,23 @@ sane-bootdir: "" >> $(ERROR_FILE) ; \ 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 ######################################################