1.1 --- a/common/autoconf/basics.m4 Wed May 29 14:01:04 2013 +0200 1.2 +++ b/common/autoconf/basics.m4 Fri May 31 14:07:42 2013 +0200 1.3 @@ -72,7 +72,7 @@ 1.4 AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) 1.5 fi 1.6 1.7 - $1="`cd "$path"; $THEPWDCMD`" 1.8 + $1="`cd "$path"; $THEPWDCMD -L`" 1.9 fi 1.10 ]) 1.11 1.12 @@ -169,10 +169,10 @@ 1.13 COUNTER=0 1.14 sym_link_dir=`$DIRNAME [$]$1` 1.15 sym_link_file=`$BASENAME [$]$1` 1.16 - # Use the system pwd and not the shell builtin to resolve directory symlinks 1.17 cd $sym_link_dir 1.18 - cd `$THEPWDCMD` 1.19 - sym_link_dir=`$THEPWDCMD` 1.20 + # Use -P flag to resolve symlinks in directories. 1.21 + cd `$THEPWDCMD -P` 1.22 + sym_link_dir=`$THEPWDCMD -P` 1.23 # Resolve file symlinks 1.24 while test $COUNTER -lt 20; do 1.25 ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` 1.26 @@ -183,7 +183,7 @@ 1.27 # Again resolve directory symlinks since the target of the just found 1.28 # link could be in a different directory 1.29 cd `$DIRNAME $ISLINK` 1.30 - sym_link_dir=`$THEPWDCMD` 1.31 + sym_link_dir=`$THEPWDCMD -P` 1.32 sym_link_file=`$BASENAME $ISLINK` 1.33 let COUNTER=COUNTER+1 1.34 done 1.35 @@ -264,7 +264,6 @@ 1.36 BASIC_REQUIRE_PROG(MKTEMP, mktemp) 1.37 BASIC_REQUIRE_PROG(MV, mv) 1.38 BASIC_REQUIRE_PROG(PRINTF, printf) 1.39 -BASIC_REQUIRE_PROG(THEPWDCMD, pwd) 1.40 BASIC_REQUIRE_PROG(RM, rm) 1.41 BASIC_REQUIRE_PROG(SH, sh) 1.42 BASIC_REQUIRE_PROG(SORT, sort) 1.43 @@ -297,6 +296,10 @@ 1.44 # Always force rm. 1.45 RM="$RM -f" 1.46 1.47 +# pwd behaves differently on various platforms and some don't support the -L flag. 1.48 +# Always use the bash builtin pwd to get uniform behavior. 1.49 +THEPWDCMD=pwd 1.50 + 1.51 # These are not required on all platforms 1.52 AC_PATH_PROG(CYGPATH, cygpath) 1.53 AC_PATH_PROG(READLINK, readlink) 1.54 @@ -309,13 +312,12 @@ 1.55 [ 1.56 # Locate the directory of this script. 1.57 SCRIPT="[$]0" 1.58 -BASIC_REMOVE_SYMBOLIC_LINKS(SCRIPT) 1.59 -AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD` 1.60 +AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` 1.61 1.62 # Where is the source? It is located two levels above the configure script. 1.63 CURDIR="$PWD" 1.64 cd "$AUTOCONF_DIR/../.." 1.65 -SRC_ROOT="`$THEPWDCMD`" 1.66 +SRC_ROOT="`$THEPWDCMD -L`" 1.67 1.68 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then 1.69 PATH_SEP=";" 1.70 @@ -374,13 +376,9 @@ 1.71 [ CONF_NAME=${with_conf_name} ]) 1.72 1.73 # Test from where we are running configure, in or outside of src root. 1.74 -# To enable comparison of directories, CURDIR needs to be symlink free 1.75 -# just like SRC_ROOT already is 1.76 -NOSYM_CURDIR="$CURDIR" 1.77 -BASIC_REMOVE_SYMBOLIC_LINKS(NOSYM_CURDIR) 1.78 -if test "x$NOSYM_CURDIR" = "x$SRC_ROOT" || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common" \ 1.79 - || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/autoconf" \ 1.80 - || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/makefiles" ; then 1.81 +if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ 1.82 + || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ 1.83 + || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then 1.84 # We are running configure from the src root. 1.85 # Create a default ./build/target-variant-debuglevel output root. 1.86 if test "x${CONF_NAME}" = x; then