8189955: Configuration validation is broken for some types of paths
Reviewed-by: erikj
--- a/make/Init.gmk Thu Oct 26 10:39:59 2017 +0200
+++ b/make/Init.gmk Thu Oct 26 13:20:47 2017 +0200
@@ -223,9 +223,6 @@
# Our helper functions.
include $(TOPDIR)/make/InitSupport.gmk
- # Verify that the spec file we included seems okay.
- $(eval $(call CheckSpecSanity))
-
# Parse COMPARE_BUILD (for makefile development)
$(eval $(call ParseCompareBuild))
--- a/make/InitSupport.gmk Thu Oct 26 10:39:59 2017 +0200
+++ b/make/InitSupport.gmk Thu Oct 26 13:20:47 2017 +0200
@@ -359,23 +359,6 @@
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
- # Sanity check the spec file, so it matches this source code
- define CheckSpecSanity
- ifneq ($$(ACTUAL_TOPDIR), $$(TOPDIR))
- ifneq ($$(ACTUAL_TOPDIR), $$(ORIGINAL_TOPDIR))
- ifneq ($$(ACTUAL_TOPDIR), $$(CANONICAL_TOPDIR))
- $$(info Error: SPEC mismatch! Current working directory)
- $$(info $$(ACTUAL_TOPDIR))
- $$(info does not match either TOPDIR, ORIGINAL_TOPDIR or CANONICAL_TOPDIR)
- $$(info $$(TOPDIR))
- $$(info $$(ORIGINAL_TOPDIR))
- $$(info $$(CANONICAL_TOPDIR))
- $$(error Cannot continue)
- endif
- endif
- endif
- endef
-
# Parse COMPARE_BUILD into COMPARE_BUILD_*
# Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
# MAKE=<make targets>:COMP_OPTS=<compare script options>:
--- a/make/autoconf/basics.m4 Thu Oct 26 10:39:59 2017 +0200
+++ b/make/autoconf/basics.m4 Thu Oct 26 13:20:47 2017 +0200
@@ -561,19 +561,10 @@
AC_MSG_RESULT([$TOPDIR])
AC_SUBST(TOPDIR)
- # Save the original version of TOPDIR for string comparisons
- ORIGINAL_TOPDIR="$TOPDIR"
- AC_SUBST(ORIGINAL_TOPDIR)
-
# We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
BASIC_FIXUP_PATH(CURDIR)
BASIC_FIXUP_PATH(TOPDIR)
- # Calculate a canonical version of TOPDIR for string comparisons
- CANONICAL_TOPDIR=$TOPDIR
- BASIC_REMOVE_SYMBOLIC_LINKS([CANONICAL_TOPDIR])
- AC_SUBST(CANONICAL_TOPDIR)
-
# Locate the directory of this script.
AUTOCONF_DIR=$TOPDIR/make/autoconf
--- a/make/autoconf/generated-configure.sh Thu Oct 26 10:39:59 2017 +0200
+++ b/make/autoconf/generated-configure.sh Thu Oct 26 13:20:47 2017 +0200
@@ -965,8 +965,6 @@
HOTSPOT_DEBUG_LEVEL
JDK_VARIANT
USERNAME
-CANONICAL_TOPDIR
-ORIGINAL_TOPDIR
TOPDIR
PATH_SEP
HOTSPOT_BUILD_CPU_DEFINE
@@ -5117,7 +5115,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1508746828
+DATE_WHEN_GENERATED=1509013542
###############################################################################
#
@@ -16536,10 +16534,6 @@
$as_echo "$TOPDIR" >&6; }
- # Save the original version of TOPDIR for string comparisons
- ORIGINAL_TOPDIR="$TOPDIR"
-
-
# We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
# Only process if variable expands to non-empty
@@ -16806,58 +16800,6 @@
fi
- # Calculate a canonical version of TOPDIR for string comparisons
- CANONICAL_TOPDIR=$TOPDIR
-
- if test "x$OPENJDK_BUILD_OS" != xwindows; then
- # Follow a chain of symbolic links. Use readlink
- # where it exists, else fall back to horribly
- # complicated shell code.
- if test "x$READLINK_TESTED" != yes; then
- # On MacOSX there is a readlink tool with a different
- # purpose than the GNU readlink tool. Check the found readlink.
- ISGNU=`$READLINK --version 2>&1 | $GREP GNU`
- if test "x$ISGNU" = x; then
- # A readlink that we do not know how to use.
- # Are there other non-GNU readlinks out there?
- READLINK_TESTED=yes
- READLINK=
- fi
- fi
-
- if test "x$READLINK" != x; then
- CANONICAL_TOPDIR=`$READLINK -f $CANONICAL_TOPDIR`
- else
- # Save the current directory for restoring afterwards
- STARTDIR=$PWD
- COUNTER=0
- sym_link_dir=`$DIRNAME $CANONICAL_TOPDIR`
- sym_link_file=`$BASENAME $CANONICAL_TOPDIR`
- cd $sym_link_dir
- # Use -P flag to resolve symlinks in directories.
- cd `$THEPWDCMD -P`
- sym_link_dir=`$THEPWDCMD -P`
- # Resolve file symlinks
- while test $COUNTER -lt 20; do
- ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
- if test "x$ISLINK" == x; then
- # This is not a symbolic link! We are done!
- break
- fi
- # Again resolve directory symlinks since the target of the just found
- # link could be in a different directory
- cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD -P`
- sym_link_file=`$BASENAME $ISLINK`
- let COUNTER=COUNTER+1
- done
- cd $STARTDIR
- CANONICAL_TOPDIR=$sym_link_dir/$sym_link_file
- fi
- fi
-
-
-
# Locate the directory of this script.
AUTOCONF_DIR=$TOPDIR/make/autoconf
--- a/make/autoconf/spec.gmk.in Thu Oct 26 10:39:59 2017 +0200
+++ b/make/autoconf/spec.gmk.in Thu Oct 26 13:20:47 2017 +0200
@@ -127,9 +127,6 @@
# The top-level directory of the source repository
TOPDIR:=@TOPDIR@
-# These two versions of TOPDIR are used in string comparisons
-ORIGINAL_TOPDIR:=@ORIGINAL_TOPDIR@
-CANONICAL_TOPDIR:=@CANONICAL_TOPDIR@
IMPORT_MODULES_CLASSES:=@IMPORT_MODULES_CLASSES@