8035730: Configure fails in cygwin if current dir is in /home/user

Thu, 12 Apr 2018 02:54:38 -0700

author
kevinw
date
Thu, 12 Apr 2018 02:54:38 -0700
changeset 2214
fda76d0c4b84
parent 2213
5510b933fa58
child 2215
7a73b8b4ac8a

8035730: Configure fails in cygwin if current dir is in /home/user
Reviewed-by: ihse, tbell

common/autoconf/basics.m4 file | annotate | diff | comparison | revisions
common/autoconf/generated-configure.sh file | annotate | diff | comparison | revisions
     1.1 --- a/common/autoconf/basics.m4	Wed Apr 11 09:36:13 2018 -0700
     1.2 +++ b/common/autoconf/basics.m4	Thu Apr 12 02:54:38 2018 -0700
     1.3 @@ -418,21 +418,8 @@
     1.4  # Setup basic configuration paths, and platform-specific stuff related to PATHs.
     1.5  AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
     1.6  [
     1.7 -  # We get the top-level directory from the supporting wrappers.
     1.8 -  AC_MSG_CHECKING([for top-level directory])
     1.9 -  AC_MSG_RESULT([$TOPDIR])
    1.10 -  BASIC_FIXUP_PATH(TOPDIR)
    1.11 -  AC_SUBST(TOPDIR)
    1.12 -
    1.13 -  # SRC_ROOT is a traditional alias for TOPDIR.
    1.14 -  SRC_ROOT=$TOPDIR
    1.15 -
    1.16 -  # Locate the directory of this script.
    1.17 -  AUTOCONF_DIR=$TOPDIR/common/autoconf
    1.18 -
    1.19    # Save the current directory this script was started from
    1.20    CURDIR="$PWD"
    1.21 -  BASIC_FIXUP_PATH(CURDIR)
    1.22  
    1.23    if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
    1.24      PATH_SEP=";"
    1.25 @@ -442,6 +429,20 @@
    1.26    fi
    1.27    AC_SUBST(PATH_SEP)
    1.28  
    1.29 +  # We get the top-level directory from the supporting wrappers.
    1.30 +  AC_MSG_CHECKING([for top-level directory])
    1.31 +  AC_MSG_RESULT([$TOPDIR])
    1.32 +  AC_SUBST(TOPDIR)
    1.33 +
    1.34 +  # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
    1.35 +  BASIC_FIXUP_PATH(CURDIR)
    1.36 +  BASIC_FIXUP_PATH(TOPDIR)
    1.37 +  # SRC_ROOT is a traditional alias for TOPDIR.
    1.38 +  SRC_ROOT=$TOPDIR
    1.39 +
    1.40 +  # Locate the directory of this script.
    1.41 +  AUTOCONF_DIR=$TOPDIR/common/autoconf
    1.42 +
    1.43    if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
    1.44      # Add extra search paths on solaris for utilities like ar and as etc...
    1.45      PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
     2.1 --- a/common/autoconf/generated-configure.sh	Wed Apr 11 09:36:13 2018 -0700
     2.2 +++ b/common/autoconf/generated-configure.sh	Thu Apr 12 02:54:38 2018 -0700
     2.3 @@ -887,8 +887,8 @@
     2.4  BUILD_LOG_PREVIOUS
     2.5  BUILD_LOG
     2.6  SYS_ROOT
     2.7 +TOPDIR
     2.8  PATH_SEP
     2.9 -TOPDIR
    2.10  ZERO_ARCHDEF
    2.11  DEFINE_CROSS_COMPILE_ARCH
    2.12  LP64
    2.13 @@ -4225,7 +4225,7 @@
    2.14  #CUSTOM_AUTOCONF_INCLUDE
    2.15  
    2.16  # Do not change or remove the following line, it is needed for consistency checks:
    2.17 -DATE_WHEN_GENERATED=1523447858
    2.18 +DATE_WHEN_GENERATED=1523526861
    2.19  
    2.20  ###############################################################################
    2.21  #
    2.22 @@ -13899,266 +13899,9 @@
    2.23  
    2.24  # Continue setting up basic stuff. Most remaining code require fundamental tools.
    2.25  
    2.26 -  # We get the top-level directory from the supporting wrappers.
    2.27 -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for top-level directory" >&5
    2.28 -$as_echo_n "checking for top-level directory... " >&6; }
    2.29 -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOPDIR" >&5
    2.30 -$as_echo "$TOPDIR" >&6; }
    2.31 -
    2.32 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
    2.33 -
    2.34 -  # Input might be given as Windows format, start by converting to
    2.35 -  # unix format.
    2.36 -  path="$TOPDIR"
    2.37 -  new_path=`$CYGPATH -u "$path"`
    2.38 -
    2.39 -  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
    2.40 -  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
    2.41 -  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
    2.42 -  # "foo.exe" is OK but "foo" is an error.
    2.43 -  #
    2.44 -  # This test is therefore slightly more accurate than "test -f" to check for file precense.
    2.45 -  # It is also a way to make sure we got the proper file name for the real test later on.
    2.46 -  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
    2.47 -  if test "x$test_shortpath" = x; then
    2.48 -    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5
    2.49 -$as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." >&6;}
    2.50 -    as_fn_error $? "Cannot locate the the path of TOPDIR" "$LINENO" 5
    2.51 -  fi
    2.52 -
    2.53 -  # Call helper function which possibly converts this using DOS-style short mode.
    2.54 -  # If so, the updated path is stored in $new_path.
    2.55 -
    2.56 -  input_path="$new_path"
    2.57 -  # Check if we need to convert this using DOS-style short mode. If the path
    2.58 -  # contains just simple characters, use it. Otherwise (spaces, weird characters),
    2.59 -  # take no chances and rewrite it.
    2.60 -  # Note: m4 eats our [], so we need to use [ and ] instead.
    2.61 -  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
    2.62 -  if test "x$has_forbidden_chars" != x; then
    2.63 -    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
    2.64 -    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
    2.65 -    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
    2.66 -    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
    2.67 -      # Going to short mode and back again did indeed matter. Since short mode is
    2.68 -      # case insensitive, let's make it lowercase to improve readability.
    2.69 -      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    2.70 -      # Now convert it back to Unix-stile (cygpath)
    2.71 -      input_path=`$CYGPATH -u "$shortmode_path"`
    2.72 -      new_path="$input_path"
    2.73 -    fi
    2.74 -  fi
    2.75 -
    2.76 -  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
    2.77 -  if test "x$test_cygdrive_prefix" = x; then
    2.78 -    # As a simple fix, exclude /usr/bin since it's not a real path.
    2.79 -    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
    2.80 -      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
    2.81 -      # a path prefixed by /cygdrive for fixpath to work.
    2.82 -      new_path="$CYGWIN_ROOT_PATH$input_path"
    2.83 -    fi
    2.84 -  fi
    2.85 -
    2.86 -
    2.87 -  if test "x$path" != "x$new_path"; then
    2.88 -    TOPDIR="$new_path"
    2.89 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOPDIR to \"$new_path\"" >&5
    2.90 -$as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;}
    2.91 -  fi
    2.92 -
    2.93 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
    2.94 -
    2.95 -  path="$TOPDIR"
    2.96 -  has_colon=`$ECHO $path | $GREP ^.:`
    2.97 -  new_path="$path"
    2.98 -  if test "x$has_colon" = x; then
    2.99 -    # Not in mixed or Windows style, start by that.
   2.100 -    new_path=`cmd //c echo $path`
   2.101 -  fi
   2.102 -
   2.103 -
   2.104 -  input_path="$new_path"
   2.105 -  # Check if we need to convert this using DOS-style short mode. If the path
   2.106 -  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.107 -  # take no chances and rewrite it.
   2.108 -  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.109 -  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   2.110 -  if test "x$has_forbidden_chars" != x; then
   2.111 -    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.112 -    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.113 -  fi
   2.114 -
   2.115 -
   2.116 -  windows_path="$new_path"
   2.117 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.118 -    unix_path=`$CYGPATH -u "$windows_path"`
   2.119 -    new_path="$unix_path"
   2.120 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.121 -    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   2.122 -    new_path="$unix_path"
   2.123 -  fi
   2.124 -
   2.125 -  if test "x$path" != "x$new_path"; then
   2.126 -    TOPDIR="$new_path"
   2.127 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOPDIR to \"$new_path\"" >&5
   2.128 -$as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;}
   2.129 -  fi
   2.130 -
   2.131 -  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   2.132 -  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   2.133 -
   2.134 -  else
   2.135 -    # We're on a posix platform. Hooray! :)
   2.136 -    path="$TOPDIR"
   2.137 -    has_space=`$ECHO "$path" | $GREP " "`
   2.138 -    if test "x$has_space" != x; then
   2.139 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5
   2.140 -$as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." >&6;}
   2.141 -      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   2.142 -    fi
   2.143 -
   2.144 -    # Use eval to expand a potential ~
   2.145 -    eval path="$path"
   2.146 -    if test ! -f "$path" && test ! -d "$path"; then
   2.147 -      as_fn_error $? "The path of TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5
   2.148 -    fi
   2.149 -
   2.150 -    TOPDIR="`cd "$path"; $THEPWDCMD -L`"
   2.151 -  fi
   2.152 -
   2.153 -
   2.154 -
   2.155 -  # SRC_ROOT is a traditional alias for TOPDIR.
   2.156 -  SRC_ROOT=$TOPDIR
   2.157 -
   2.158 -  # Locate the directory of this script.
   2.159 -  AUTOCONF_DIR=$TOPDIR/common/autoconf
   2.160 -
   2.161    # Save the current directory this script was started from
   2.162    CURDIR="$PWD"
   2.163  
   2.164 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.165 -
   2.166 -  # Input might be given as Windows format, start by converting to
   2.167 -  # unix format.
   2.168 -  path="$CURDIR"
   2.169 -  new_path=`$CYGPATH -u "$path"`
   2.170 -
   2.171 -  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   2.172 -  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   2.173 -  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   2.174 -  # "foo.exe" is OK but "foo" is an error.
   2.175 -  #
   2.176 -  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   2.177 -  # It is also a way to make sure we got the proper file name for the real test later on.
   2.178 -  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   2.179 -  if test "x$test_shortpath" = x; then
   2.180 -    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
   2.181 -$as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;}
   2.182 -    as_fn_error $? "Cannot locate the the path of CURDIR" "$LINENO" 5
   2.183 -  fi
   2.184 -
   2.185 -  # Call helper function which possibly converts this using DOS-style short mode.
   2.186 -  # If so, the updated path is stored in $new_path.
   2.187 -
   2.188 -  input_path="$new_path"
   2.189 -  # Check if we need to convert this using DOS-style short mode. If the path
   2.190 -  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.191 -  # take no chances and rewrite it.
   2.192 -  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.193 -  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   2.194 -  if test "x$has_forbidden_chars" != x; then
   2.195 -    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.196 -    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   2.197 -    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   2.198 -    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   2.199 -      # Going to short mode and back again did indeed matter. Since short mode is
   2.200 -      # case insensitive, let's make it lowercase to improve readability.
   2.201 -      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.202 -      # Now convert it back to Unix-stile (cygpath)
   2.203 -      input_path=`$CYGPATH -u "$shortmode_path"`
   2.204 -      new_path="$input_path"
   2.205 -    fi
   2.206 -  fi
   2.207 -
   2.208 -  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   2.209 -  if test "x$test_cygdrive_prefix" = x; then
   2.210 -    # As a simple fix, exclude /usr/bin since it's not a real path.
   2.211 -    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   2.212 -      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   2.213 -      # a path prefixed by /cygdrive for fixpath to work.
   2.214 -      new_path="$CYGWIN_ROOT_PATH$input_path"
   2.215 -    fi
   2.216 -  fi
   2.217 -
   2.218 -
   2.219 -  if test "x$path" != "x$new_path"; then
   2.220 -    CURDIR="$new_path"
   2.221 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5
   2.222 -$as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;}
   2.223 -  fi
   2.224 -
   2.225 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.226 -
   2.227 -  path="$CURDIR"
   2.228 -  has_colon=`$ECHO $path | $GREP ^.:`
   2.229 -  new_path="$path"
   2.230 -  if test "x$has_colon" = x; then
   2.231 -    # Not in mixed or Windows style, start by that.
   2.232 -    new_path=`cmd //c echo $path`
   2.233 -  fi
   2.234 -
   2.235 -
   2.236 -  input_path="$new_path"
   2.237 -  # Check if we need to convert this using DOS-style short mode. If the path
   2.238 -  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.239 -  # take no chances and rewrite it.
   2.240 -  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.241 -  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   2.242 -  if test "x$has_forbidden_chars" != x; then
   2.243 -    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.244 -    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.245 -  fi
   2.246 -
   2.247 -
   2.248 -  windows_path="$new_path"
   2.249 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.250 -    unix_path=`$CYGPATH -u "$windows_path"`
   2.251 -    new_path="$unix_path"
   2.252 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.253 -    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   2.254 -    new_path="$unix_path"
   2.255 -  fi
   2.256 -
   2.257 -  if test "x$path" != "x$new_path"; then
   2.258 -    CURDIR="$new_path"
   2.259 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5
   2.260 -$as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;}
   2.261 -  fi
   2.262 -
   2.263 -  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   2.264 -  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   2.265 -
   2.266 -  else
   2.267 -    # We're on a posix platform. Hooray! :)
   2.268 -    path="$CURDIR"
   2.269 -    has_space=`$ECHO "$path" | $GREP " "`
   2.270 -    if test "x$has_space" != x; then
   2.271 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
   2.272 -$as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;}
   2.273 -      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   2.274 -    fi
   2.275 -
   2.276 -    # Use eval to expand a potential ~
   2.277 -    eval path="$path"
   2.278 -    if test ! -f "$path" && test ! -d "$path"; then
   2.279 -      as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5
   2.280 -    fi
   2.281 -
   2.282 -    CURDIR="`cd "$path"; $THEPWDCMD -L`"
   2.283 -  fi
   2.284 -
   2.285 -
   2.286    if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   2.287      PATH_SEP=";"
   2.288  
   2.289 @@ -14256,6 +13999,264 @@
   2.290    fi
   2.291  
   2.292  
   2.293 +  # We get the top-level directory from the supporting wrappers.
   2.294 +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for top-level directory" >&5
   2.295 +$as_echo_n "checking for top-level directory... " >&6; }
   2.296 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOPDIR" >&5
   2.297 +$as_echo "$TOPDIR" >&6; }
   2.298 +
   2.299 +
   2.300 +  # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
   2.301 +
   2.302 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.303 +
   2.304 +  # Input might be given as Windows format, start by converting to
   2.305 +  # unix format.
   2.306 +  path="$CURDIR"
   2.307 +  new_path=`$CYGPATH -u "$path"`
   2.308 +
   2.309 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   2.310 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   2.311 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   2.312 +  # "foo.exe" is OK but "foo" is an error.
   2.313 +  #
   2.314 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   2.315 +  # It is also a way to make sure we got the proper file name for the real test later on.
   2.316 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   2.317 +  if test "x$test_shortpath" = x; then
   2.318 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
   2.319 +$as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;}
   2.320 +    as_fn_error $? "Cannot locate the the path of CURDIR" "$LINENO" 5
   2.321 +  fi
   2.322 +
   2.323 +  # Call helper function which possibly converts this using DOS-style short mode.
   2.324 +  # If so, the updated path is stored in $new_path.
   2.325 +
   2.326 +  input_path="$new_path"
   2.327 +  # Check if we need to convert this using DOS-style short mode. If the path
   2.328 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.329 +  # take no chances and rewrite it.
   2.330 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.331 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   2.332 +  if test "x$has_forbidden_chars" != x; then
   2.333 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.334 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   2.335 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   2.336 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   2.337 +      # Going to short mode and back again did indeed matter. Since short mode is
   2.338 +      # case insensitive, let's make it lowercase to improve readability.
   2.339 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.340 +      # Now convert it back to Unix-stile (cygpath)
   2.341 +      input_path=`$CYGPATH -u "$shortmode_path"`
   2.342 +      new_path="$input_path"
   2.343 +    fi
   2.344 +  fi
   2.345 +
   2.346 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   2.347 +  if test "x$test_cygdrive_prefix" = x; then
   2.348 +    # As a simple fix, exclude /usr/bin since it's not a real path.
   2.349 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   2.350 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   2.351 +      # a path prefixed by /cygdrive for fixpath to work.
   2.352 +      new_path="$CYGWIN_ROOT_PATH$input_path"
   2.353 +    fi
   2.354 +  fi
   2.355 +
   2.356 +
   2.357 +  if test "x$path" != "x$new_path"; then
   2.358 +    CURDIR="$new_path"
   2.359 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5
   2.360 +$as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;}
   2.361 +  fi
   2.362 +
   2.363 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.364 +
   2.365 +  path="$CURDIR"
   2.366 +  has_colon=`$ECHO $path | $GREP ^.:`
   2.367 +  new_path="$path"
   2.368 +  if test "x$has_colon" = x; then
   2.369 +    # Not in mixed or Windows style, start by that.
   2.370 +    new_path=`cmd //c echo $path`
   2.371 +  fi
   2.372 +
   2.373 +
   2.374 +  input_path="$new_path"
   2.375 +  # Check if we need to convert this using DOS-style short mode. If the path
   2.376 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.377 +  # take no chances and rewrite it.
   2.378 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.379 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   2.380 +  if test "x$has_forbidden_chars" != x; then
   2.381 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.382 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.383 +  fi
   2.384 +
   2.385 +
   2.386 +  windows_path="$new_path"
   2.387 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.388 +    unix_path=`$CYGPATH -u "$windows_path"`
   2.389 +    new_path="$unix_path"
   2.390 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.391 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   2.392 +    new_path="$unix_path"
   2.393 +  fi
   2.394 +
   2.395 +  if test "x$path" != "x$new_path"; then
   2.396 +    CURDIR="$new_path"
   2.397 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5
   2.398 +$as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;}
   2.399 +  fi
   2.400 +
   2.401 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   2.402 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   2.403 +
   2.404 +  else
   2.405 +    # We're on a posix platform. Hooray! :)
   2.406 +    path="$CURDIR"
   2.407 +    has_space=`$ECHO "$path" | $GREP " "`
   2.408 +    if test "x$has_space" != x; then
   2.409 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
   2.410 +$as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;}
   2.411 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   2.412 +    fi
   2.413 +
   2.414 +    # Use eval to expand a potential ~
   2.415 +    eval path="$path"
   2.416 +    if test ! -f "$path" && test ! -d "$path"; then
   2.417 +      as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5
   2.418 +    fi
   2.419 +
   2.420 +    CURDIR="`cd "$path"; $THEPWDCMD -L`"
   2.421 +  fi
   2.422 +
   2.423 +
   2.424 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.425 +
   2.426 +  # Input might be given as Windows format, start by converting to
   2.427 +  # unix format.
   2.428 +  path="$TOPDIR"
   2.429 +  new_path=`$CYGPATH -u "$path"`
   2.430 +
   2.431 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   2.432 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   2.433 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   2.434 +  # "foo.exe" is OK but "foo" is an error.
   2.435 +  #
   2.436 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   2.437 +  # It is also a way to make sure we got the proper file name for the real test later on.
   2.438 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   2.439 +  if test "x$test_shortpath" = x; then
   2.440 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5
   2.441 +$as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." >&6;}
   2.442 +    as_fn_error $? "Cannot locate the the path of TOPDIR" "$LINENO" 5
   2.443 +  fi
   2.444 +
   2.445 +  # Call helper function which possibly converts this using DOS-style short mode.
   2.446 +  # If so, the updated path is stored in $new_path.
   2.447 +
   2.448 +  input_path="$new_path"
   2.449 +  # Check if we need to convert this using DOS-style short mode. If the path
   2.450 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.451 +  # take no chances and rewrite it.
   2.452 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.453 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   2.454 +  if test "x$has_forbidden_chars" != x; then
   2.455 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.456 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   2.457 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   2.458 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   2.459 +      # Going to short mode and back again did indeed matter. Since short mode is
   2.460 +      # case insensitive, let's make it lowercase to improve readability.
   2.461 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.462 +      # Now convert it back to Unix-stile (cygpath)
   2.463 +      input_path=`$CYGPATH -u "$shortmode_path"`
   2.464 +      new_path="$input_path"
   2.465 +    fi
   2.466 +  fi
   2.467 +
   2.468 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   2.469 +  if test "x$test_cygdrive_prefix" = x; then
   2.470 +    # As a simple fix, exclude /usr/bin since it's not a real path.
   2.471 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   2.472 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   2.473 +      # a path prefixed by /cygdrive for fixpath to work.
   2.474 +      new_path="$CYGWIN_ROOT_PATH$input_path"
   2.475 +    fi
   2.476 +  fi
   2.477 +
   2.478 +
   2.479 +  if test "x$path" != "x$new_path"; then
   2.480 +    TOPDIR="$new_path"
   2.481 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOPDIR to \"$new_path\"" >&5
   2.482 +$as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;}
   2.483 +  fi
   2.484 +
   2.485 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.486 +
   2.487 +  path="$TOPDIR"
   2.488 +  has_colon=`$ECHO $path | $GREP ^.:`
   2.489 +  new_path="$path"
   2.490 +  if test "x$has_colon" = x; then
   2.491 +    # Not in mixed or Windows style, start by that.
   2.492 +    new_path=`cmd //c echo $path`
   2.493 +  fi
   2.494 +
   2.495 +
   2.496 +  input_path="$new_path"
   2.497 +  # Check if we need to convert this using DOS-style short mode. If the path
   2.498 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.499 +  # take no chances and rewrite it.
   2.500 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.501 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   2.502 +  if test "x$has_forbidden_chars" != x; then
   2.503 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.504 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.505 +  fi
   2.506 +
   2.507 +
   2.508 +  windows_path="$new_path"
   2.509 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.510 +    unix_path=`$CYGPATH -u "$windows_path"`
   2.511 +    new_path="$unix_path"
   2.512 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.513 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   2.514 +    new_path="$unix_path"
   2.515 +  fi
   2.516 +
   2.517 +  if test "x$path" != "x$new_path"; then
   2.518 +    TOPDIR="$new_path"
   2.519 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOPDIR to \"$new_path\"" >&5
   2.520 +$as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;}
   2.521 +  fi
   2.522 +
   2.523 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   2.524 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   2.525 +
   2.526 +  else
   2.527 +    # We're on a posix platform. Hooray! :)
   2.528 +    path="$TOPDIR"
   2.529 +    has_space=`$ECHO "$path" | $GREP " "`
   2.530 +    if test "x$has_space" != x; then
   2.531 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5
   2.532 +$as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." >&6;}
   2.533 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   2.534 +    fi
   2.535 +
   2.536 +    # Use eval to expand a potential ~
   2.537 +    eval path="$path"
   2.538 +    if test ! -f "$path" && test ! -d "$path"; then
   2.539 +      as_fn_error $? "The path of TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5
   2.540 +    fi
   2.541 +
   2.542 +    TOPDIR="`cd "$path"; $THEPWDCMD -L`"
   2.543 +  fi
   2.544 +
   2.545 +  # SRC_ROOT is a traditional alias for TOPDIR.
   2.546 +  SRC_ROOT=$TOPDIR
   2.547 +
   2.548 +  # Locate the directory of this script.
   2.549 +  AUTOCONF_DIR=$TOPDIR/common/autoconf
   2.550 +
   2.551    if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
   2.552      # Add extra search paths on solaris for utilities like ar and as etc...
   2.553      PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"

mercurial