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
This commit is contained in:
Anthony Petrov 2009-05-19 14:43:49 +04:00
parent 7648a0d70b
commit 013285996b
4 changed files with 43 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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
######################################################