提交 fd9cce5a 编写于 作者: E erikj

8014003: New build does not handle symlinks in workspace path

Reviewed-by: tbell
上级 9fb2e90a
......@@ -72,7 +72,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
fi
$1="`cd "$path"; $THEPWDCMD`"
$1="`cd "$path"; $THEPWDCMD -L`"
fi
])
......@@ -169,10 +169,10 @@ AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
COUNTER=0
sym_link_dir=`$DIRNAME [$]$1`
sym_link_file=`$BASENAME [$]$1`
# Use the system pwd and not the shell builtin to resolve directory symlinks
cd $sym_link_dir
cd `$THEPWDCMD`
sym_link_dir=`$THEPWDCMD`
# 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/'`
......@@ -183,7 +183,7 @@ AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
# 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`
sym_link_dir=`$THEPWDCMD -P`
sym_link_file=`$BASENAME $ISLINK`
let COUNTER=COUNTER+1
done
......@@ -264,7 +264,6 @@ BASIC_REQUIRE_PROG(MKDIR, mkdir)
BASIC_REQUIRE_PROG(MKTEMP, mktemp)
BASIC_REQUIRE_PROG(MV, mv)
BASIC_REQUIRE_PROG(PRINTF, printf)
BASIC_REQUIRE_PROG(THEPWDCMD, pwd)
BASIC_REQUIRE_PROG(RM, rm)
BASIC_REQUIRE_PROG(SH, sh)
BASIC_REQUIRE_PROG(SORT, sort)
......@@ -297,6 +296,10 @@ BASIC_CHECK_NONEMPTY(NAWK)
# Always force rm.
RM="$RM -f"
# pwd behaves differently on various platforms and some don't support the -L flag.
# Always use the bash builtin pwd to get uniform behavior.
THEPWDCMD=pwd
# These are not required on all platforms
AC_PATH_PROG(CYGPATH, cygpath)
AC_PATH_PROG(READLINK, readlink)
......@@ -309,13 +312,12 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
[
# Locate the directory of this script.
SCRIPT="[$]0"
BASIC_REMOVE_SYMBOLIC_LINKS(SCRIPT)
AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD`
AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L`
# Where is the source? It is located two levels above the configure script.
CURDIR="$PWD"
cd "$AUTOCONF_DIR/../.."
SRC_ROOT="`$THEPWDCMD`"
SRC_ROOT="`$THEPWDCMD -L`"
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
PATH_SEP=";"
......@@ -374,13 +376,9 @@ AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
[ CONF_NAME=${with_conf_name} ])
# Test from where we are running configure, in or outside of src root.
# To enable comparison of directories, CURDIR needs to be symlink free
# just like SRC_ROOT already is
NOSYM_CURDIR="$CURDIR"
BASIC_REMOVE_SYMBOLIC_LINKS(NOSYM_CURDIR)
if test "x$NOSYM_CURDIR" = "x$SRC_ROOT" || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common" \
|| test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/autoconf" \
|| test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
|| test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \
|| test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
# We are running configure from the src root.
# Create a default ./build/target-variant-debuglevel output root.
if test "x${CONF_NAME}" = x; then
......
......@@ -300,7 +300,7 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE_MSYS],
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
[
SRC_ROOT_LENGTH=`$THEPWDCMD|$WC -m`
SRC_ROOT_LENGTH=`$THEPWDCMD -L|$WC -m`
if test $SRC_ROOT_LENGTH -gt 100; then
AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported])
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册