common/autoconf/basics_windows.m4

changeset 0
75a576e87639
child 1133
50aaf272884f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/common/autoconf/basics_windows.m4	Wed Apr 27 01:39:08 2016 +0800
     1.3 @@ -0,0 +1,420 @@
     1.4 +#
     1.5 +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.  Oracle designates this
    1.11 +# particular file as subject to the "Classpath" exception as provided
    1.12 +# by Oracle in the LICENSE file that accompanied this code.
    1.13 +#
    1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 +# version 2 for more details (a copy is included in the LICENSE file that
    1.18 +# accompanied this code).
    1.19 +#
    1.20 +# You should have received a copy of the GNU General Public License version
    1.21 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 +#
    1.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 +# or visit www.oracle.com if you need additional information or have any
    1.26 +# questions.
    1.27 +#
    1.28 +
    1.29 +AC_DEFUN([BASIC_WINDOWS_REWRITE_AS_UNIX_PATH],
    1.30 +[
    1.31 +  windows_path="[$]$1"
    1.32 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
    1.33 +    unix_path=`$CYGPATH -u "$windows_path"`
    1.34 +    $1="$unix_path"
    1.35 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
    1.36 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
    1.37 +    $1="$unix_path"
    1.38 +  fi
    1.39 +])
    1.40 +
    1.41 +AC_DEFUN([BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH],
    1.42 +[
    1.43 +  unix_path="[$]$1"
    1.44 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
    1.45 +    windows_path=`$CYGPATH -m "$unix_path"`
    1.46 +    $1="$windows_path"
    1.47 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
    1.48 +    windows_path=`cmd //c echo $unix_path`
    1.49 +    $1="$windows_path"
    1.50 +  fi
    1.51 +])
    1.52 +
    1.53 +# Helper function which possibly converts a path using DOS-style short mode.
    1.54 +# If so, the updated path is stored in $new_path.
    1.55 +# $1: The path to check
    1.56 +AC_DEFUN([BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN],
    1.57 +[
    1.58 +  input_path="$1"
    1.59 +  # Check if we need to convert this using DOS-style short mode. If the path
    1.60 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
    1.61 +  # take no chances and rewrite it.
    1.62 +  # Note: m4 eats our [], so we need to use @<:@ and @:>@ instead.
    1.63 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP @<:@^-._/a-zA-Z0-9@:>@`
    1.64 +  if test "x$has_forbidden_chars" != x; then
    1.65 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
    1.66 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
    1.67 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
    1.68 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
    1.69 +      # Going to short mode and back again did indeed matter. Since short mode is
    1.70 +      # case insensitive, let's make it lowercase to improve readability.
    1.71 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    1.72 +      # Now convert it back to Unix-stile (cygpath)
    1.73 +      input_path=`$CYGPATH -u "$shortmode_path"`
    1.74 +      new_path="$input_path"
    1.75 +    fi
    1.76 +  fi
    1.77 +
    1.78 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
    1.79 +  if test "x$test_cygdrive_prefix" = x; then
    1.80 +    # As a simple fix, exclude /usr/bin since it's not a real path.
    1.81 +    if test "x`$ECHO $1 | $GREP ^/usr/bin/`" = x; then
    1.82 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
    1.83 +      # a path prefixed by /cygdrive for fixpath to work.
    1.84 +      new_path="$CYGWIN_ROOT_PATH$input_path"
    1.85 +    fi
    1.86 +  fi
    1.87 +])
    1.88 +
    1.89 +# Helper function which possibly converts a path using DOS-style short mode.
    1.90 +# If so, the updated path is stored in $new_path.
    1.91 +# $1: The path to check
    1.92 +AC_DEFUN([BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS],
    1.93 +[
    1.94 +  input_path="$1"
    1.95 +  # Check if we need to convert this using DOS-style short mode. If the path
    1.96 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
    1.97 +  # take no chances and rewrite it.
    1.98 +  # Note: m4 eats our [], so we need to use @<:@ and @:>@ instead.
    1.99 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP @<:@^-_/:a-zA-Z0-9@:>@`
   1.100 +  if test "x$has_forbidden_chars" != x; then
   1.101 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.102 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.103 +  fi
   1.104 +])
   1.105 +
   1.106 +# FIXME: The BASIC_FIXUP_*_CYGWIN/MSYS is most likely too convoluted
   1.107 +# and could probably be heavily simplified. However, all changes in this
   1.108 +# area tend to need lot of testing in different scenarios, and in lack of
   1.109 +# proper unit testing, cleaning this up has not been deemed worth the effort
   1.110 +# at the moment.
   1.111 +
   1.112 +AC_DEFUN([BASIC_FIXUP_PATH_CYGWIN],
   1.113 +[
   1.114 +  # Input might be given as Windows format, start by converting to
   1.115 +  # unix format.
   1.116 +  path="[$]$1"
   1.117 +  new_path=`$CYGPATH -u "$path"`
   1.118 +
   1.119 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   1.120 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   1.121 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   1.122 +  # "foo.exe" is OK but "foo" is an error.
   1.123 +  #
   1.124 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   1.125 +  # It is also a way to make sure we got the proper file name for the real test later on.
   1.126 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   1.127 +  if test "x$test_shortpath" = x; then
   1.128 +    AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
   1.129 +    AC_MSG_ERROR([Cannot locate the the path of $1])
   1.130 +  fi
   1.131 +
   1.132 +  # Call helper function which possibly converts this using DOS-style short mode.
   1.133 +  # If so, the updated path is stored in $new_path.
   1.134 +  BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN([$new_path])
   1.135 +
   1.136 +  if test "x$path" != "x$new_path"; then
   1.137 +    $1="$new_path"
   1.138 +    AC_MSG_NOTICE([Rewriting $1 to "$new_path"])
   1.139 +  fi
   1.140 +])
   1.141 +
   1.142 +AC_DEFUN([BASIC_FIXUP_PATH_MSYS],
   1.143 +[
   1.144 +  path="[$]$1"
   1.145 +  has_colon=`$ECHO $path | $GREP ^.:`
   1.146 +  new_path="$path"
   1.147 +  if test "x$has_colon" = x; then
   1.148 +    # Not in mixed or Windows style, start by that.
   1.149 +    new_path=`cmd //c echo $path`
   1.150 +  fi
   1.151 +
   1.152 +  BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS([$new_path])
   1.153 +  BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
   1.154 +  if test "x$path" != "x$new_path"; then
   1.155 +    $1="$new_path"
   1.156 +    AC_MSG_NOTICE([Rewriting $1 to "$new_path"])
   1.157 +  fi
   1.158 +
   1.159 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   1.160 +  all_fixpath_prefixes=("${all_fixpath_prefixes@<:@@@:>@}" "${new_path:0:10}")
   1.161 +])
   1.162 +
   1.163 +AC_DEFUN([BASIC_FIXUP_EXECUTABLE_CYGWIN],
   1.164 +[
   1.165 +  # First separate the path from the arguments. This will split at the first
   1.166 +  # space.
   1.167 +  complete="[$]$1"
   1.168 +  path="${complete%% *}"
   1.169 +  tmp="$complete EOL"
   1.170 +  arguments="${tmp#* }"
   1.171 +
   1.172 +  # Input might be given as Windows format, start by converting to
   1.173 +  # unix format.
   1.174 +  new_path=`$CYGPATH -u "$path"`
   1.175 +
   1.176 +  # Now try to locate executable using which
   1.177 +  new_path=`$WHICH "$new_path" 2> /dev/null`
   1.178 +  # bat and cmd files are not always considered executable in cygwin causing which
   1.179 +  # to not find them
   1.180 +  if test "x$new_path" = x \
   1.181 +      && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
   1.182 +      && test "x`$LS \"$path\" 2>/dev/null`" != x; then
   1.183 +    new_path=`$CYGPATH -u "$path"`
   1.184 +  fi
   1.185 +  if test "x$new_path" = x; then
   1.186 +    # Oops. Which didn't find the executable.
   1.187 +    # The splitting of arguments from the executable at a space might have been incorrect,
   1.188 +    # since paths with space are more likely in Windows. Give it another try with the whole
   1.189 +    # argument.
   1.190 +    path="$complete"
   1.191 +    arguments="EOL"
   1.192 +    new_path=`$CYGPATH -u "$path"`
   1.193 +    new_path=`$WHICH "$new_path" 2> /dev/null`
   1.194 +    # bat and cmd files are not always considered executable in cygwin causing which
   1.195 +    # to not find them
   1.196 +    if test "x$new_path" = x \
   1.197 +        && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
   1.198 +        && test "x`$LS \"$path\" 2>/dev/null`" != x; then
   1.199 +      new_path=`$CYGPATH -u "$path"`
   1.200 +    fi
   1.201 +    if test "x$new_path" = x; then
   1.202 +      # It's still not found. Now this is an unrecoverable error.
   1.203 +      AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
   1.204 +      has_space=`$ECHO "$complete" | $GREP " "`
   1.205 +      if test "x$has_space" != x; then
   1.206 +        AC_MSG_NOTICE([You might be mixing spaces in the path and extra arguments, which is not allowed.])
   1.207 +      fi
   1.208 +      AC_MSG_ERROR([Cannot locate the the path of $1])
   1.209 +    fi
   1.210 +  fi
   1.211 +
   1.212 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   1.213 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   1.214 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   1.215 +  # "foo.exe" is OK but "foo" is an error.
   1.216 +  #
   1.217 +  # This test is therefore slightly more accurate than "test -f" to check for file presence.
   1.218 +  # It is also a way to make sure we got the proper file name for the real test later on.
   1.219 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   1.220 +  if test "x$test_shortpath" = x; then
   1.221 +    # Short path failed, file does not exist as specified.
   1.222 +    # Try adding .exe or .cmd
   1.223 +    if test -f "${new_path}.exe"; then
   1.224 +      input_to_shortpath="${new_path}.exe"
   1.225 +    elif test -f "${new_path}.cmd"; then
   1.226 +      input_to_shortpath="${new_path}.cmd"
   1.227 +    else
   1.228 +      AC_MSG_NOTICE([The path of $1, which resolves as "$new_path", is invalid.])
   1.229 +      AC_MSG_NOTICE([Neither "$new_path" nor "$new_path.exe/cmd" can be found])
   1.230 +      AC_MSG_ERROR([Cannot locate the the path of $1])
   1.231 +    fi
   1.232 +  else
   1.233 +    input_to_shortpath="$new_path"
   1.234 +  fi
   1.235 +
   1.236 +  # Call helper function which possibly converts this using DOS-style short mode.
   1.237 +  # If so, the updated path is stored in $new_path.
   1.238 +  new_path="$input_to_shortpath"
   1.239 +  BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN([$input_to_shortpath])
   1.240 +  # remove trailing .exe if any
   1.241 +  new_path="${new_path/%.exe/}"
   1.242 +])
   1.243 +
   1.244 +AC_DEFUN([BASIC_FIXUP_EXECUTABLE_MSYS],
   1.245 +[
   1.246 +  # First separate the path from the arguments. This will split at the first
   1.247 +  # space.
   1.248 +  complete="[$]$1"
   1.249 +  path="${complete%% *}"
   1.250 +  tmp="$complete EOL"
   1.251 +  arguments="${tmp#* }"
   1.252 +
   1.253 +  # Input might be given as Windows format, start by converting to
   1.254 +  # unix format.
   1.255 +  new_path="$path"
   1.256 +  BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
   1.257 +
   1.258 +  # Now try to locate executable using which
   1.259 +  new_path=`$WHICH "$new_path" 2> /dev/null`
   1.260 +
   1.261 +  if test "x$new_path" = x; then
   1.262 +    # Oops. Which didn't find the executable.
   1.263 +    # The splitting of arguments from the executable at a space might have been incorrect,
   1.264 +    # since paths with space are more likely in Windows. Give it another try with the whole
   1.265 +    # argument.
   1.266 +    path="$complete"
   1.267 +    arguments="EOL"
   1.268 +    new_path="$path"
   1.269 +    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
   1.270 +
   1.271 +    new_path=`$WHICH "$new_path" 2> /dev/null`
   1.272 +
   1.273 +    if test "x$new_path" = x; then
   1.274 +      # It's still not found. Now this is an unrecoverable error.
   1.275 +      AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
   1.276 +      has_space=`$ECHO "$complete" | $GREP " "`
   1.277 +      if test "x$has_space" != x; then
   1.278 +        AC_MSG_NOTICE([You might be mixing spaces in the path and extra arguments, which is not allowed.])
   1.279 +      fi
   1.280 +      AC_MSG_ERROR([Cannot locate the the path of $1])
   1.281 +    fi
   1.282 +  fi
   1.283 +
   1.284 +  # Now new_path has a complete unix path to the binary
   1.285 +  if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then
   1.286 +    # Keep paths in /bin as-is, but remove trailing .exe if any
   1.287 +    new_path="${new_path/%.exe/}"
   1.288 +    # Do not save /bin paths to all_fixpath_prefixes!
   1.289 +  else
   1.290 +    # Not in mixed or Windows style, start by that.
   1.291 +    new_path=`cmd //c echo $new_path`
   1.292 +    BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS([$new_path])
   1.293 +    # Output is in $new_path
   1.294 +    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
   1.295 +    # remove trailing .exe if any
   1.296 +    new_path="${new_path/%.exe/}"
   1.297 +
   1.298 +    # Save the first 10 bytes of this path to the storage, so fixpath can work.
   1.299 +    all_fixpath_prefixes=("${all_fixpath_prefixes@<:@@@:>@}" "${new_path:0:10}")
   1.300 +  fi
   1.301 +])
   1.302 +
   1.303 +# Setup basic configuration paths, and platform-specific stuff related to PATHs.
   1.304 +AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
   1.305 +[
   1.306 +  SRC_ROOT_LENGTH=`$THEPWDCMD -L|$WC -m`
   1.307 +  if test $SRC_ROOT_LENGTH -gt 100; then
   1.308 +    AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported])
   1.309 +  fi
   1.310 +
   1.311 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.312 +    AC_MSG_CHECKING([cygwin release])
   1.313 +    CYGWIN_VERSION=`$UNAME -r`
   1.314 +    AC_MSG_RESULT([$CYGWIN_VERSION])
   1.315 +    WINDOWS_ENV_VENDOR='cygwin'
   1.316 +    WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
   1.317 +
   1.318 +    CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.`
   1.319 +    if test "x$CYGWIN_VERSION_OK" = x; then
   1.320 +      AC_MSG_NOTICE([Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade.])
   1.321 +      AC_MSG_ERROR([Cannot continue])
   1.322 +    fi
   1.323 +    if test "x$CYGPATH" = x; then
   1.324 +      AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
   1.325 +    fi
   1.326 +    AC_MSG_CHECKING([cygwin root directory as unix-style path])
   1.327 +    # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
   1.328 +    cygwin_winpath_root=`cd / ; cmd /c cd | grep ".*"`
   1.329 +    # Force cygpath to report the proper root by including a trailing space, and then stripping it off again.
   1.330 +    CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "`
   1.331 +    AC_MSG_RESULT([$CYGWIN_ROOT_PATH])
   1.332 +    WINDOWS_ENV_ROOT_PATH="$CYGWIN_ROOT_PATH"
   1.333 +    test_cygdrive_prefix=`$ECHO $CYGWIN_ROOT_PATH | $GREP ^/cygdrive/`
   1.334 +    if test "x$test_cygdrive_prefix" = x; then
   1.335 +      AC_MSG_ERROR([Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c.])
   1.336 +    fi
   1.337 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.338 +    AC_MSG_CHECKING([msys release])
   1.339 +    MSYS_VERSION=`$UNAME -r`
   1.340 +    AC_MSG_RESULT([$MSYS_VERSION])
   1.341 +
   1.342 +    WINDOWS_ENV_VENDOR='msys'
   1.343 +    WINDOWS_ENV_VERSION="$MSYS_VERSION"
   1.344 +
   1.345 +    AC_MSG_CHECKING([msys root directory as unix-style path])
   1.346 +    # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
   1.347 +    MSYS_ROOT_PATH=`cd / ; cmd /c cd | grep ".*"`
   1.348 +    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(MSYS_ROOT_PATH)
   1.349 +    AC_MSG_RESULT([$MSYS_ROOT_PATH])
   1.350 +    WINDOWS_ENV_ROOT_PATH="$MSYS_ROOT_PATH"
   1.351 +  else
   1.352 +    AC_MSG_ERROR([Unknown Windows environment. Neither cygwin nor msys was detected.])
   1.353 +  fi
   1.354 +
   1.355 +  # Test if windows or unix (cygwin/msys) find is first in path.
   1.356 +  AC_MSG_CHECKING([what kind of 'find' is first on the PATH])
   1.357 +  FIND_BINARY_OUTPUT=`find --version 2>&1`
   1.358 +  if test "x`echo $FIND_BINARY_OUTPUT | $GREP GNU`" != x; then
   1.359 +    AC_MSG_RESULT([unix style])
   1.360 +  elif test "x`echo $FIND_BINARY_OUTPUT | $GREP FIND`" != x; then
   1.361 +    AC_MSG_RESULT([Windows])
   1.362 +    AC_MSG_NOTICE([Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools.])
   1.363 +    AC_MSG_NOTICE([This will not work. Please correct and make sure /usr/bin (or similar) is first in path.])
   1.364 +    AC_MSG_ERROR([Cannot continue])
   1.365 +  else
   1.366 +    AC_MSG_RESULT([unknown])
   1.367 +    AC_MSG_WARN([It seems that your find utility is non-standard.])
   1.368 +  fi
   1.369 +])
   1.370 +
   1.371 +AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
   1.372 +[
   1.373 +  # When using cygwin or msys, we need a wrapper binary that renames
   1.374 +  # /cygdrive/c/ arguments into c:/ arguments and peeks into
   1.375 +  # @files and rewrites these too! This wrapper binary is
   1.376 +  # called fixpath.
   1.377 +  FIXPATH=
   1.378 +  if test "x$OPENJDK_BUILD_OS" = xwindows; then
   1.379 +    AC_MSG_CHECKING([if fixpath can be created])
   1.380 +    FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c"
   1.381 +    FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe"
   1.382 +    if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then
   1.383 +      FIXPATH_SRC=`$CYGPATH -m $FIXPATH_SRC`
   1.384 +      FIXPATH_BIN=`$CYGPATH -m $FIXPATH_BIN`
   1.385 +      # Important to keep the .exe suffix on Cygwin for Hotspot makefiles
   1.386 +      FIXPATH="$OUTPUT_ROOT/fixpath.exe -c"
   1.387 +    elif test "x$OPENJDK_BUILD_OS_ENV" = xwindows.msys; then
   1.388 +      FIXPATH_SRC=`cmd //c echo $FIXPATH_SRC`
   1.389 +      FIXPATH_BIN=`cmd //c echo $FIXPATH_BIN`
   1.390 +
   1.391 +      # Take all collected prefixes and turn them into a -m/c/foo@/c/bar@... command line
   1.392 +      # @ was chosen as separator to minimize risk of other tools messing around with it
   1.393 +      all_unique_prefixes=`echo "${all_fixpath_prefixes@<:@@@:>@}" | tr ' ' '\n' | grep '^/./' | sort | uniq`
   1.394 +      fixpath_argument_list=`echo $all_unique_prefixes  | tr ' ' '@'`
   1.395 +
   1.396 +      FIXPATH="$OUTPUT_ROOT/fixpath -m$fixpath_argument_list"
   1.397 +    fi
   1.398 +    rm -f $OUTPUT_ROOT/fixpath*
   1.399 +    cd $OUTPUT_ROOT
   1.400 +    $CC $FIXPATH_SRC -Fe$FIXPATH_BIN > $OUTPUT_ROOT/fixpath1.log 2>&1
   1.401 +    cd $CURDIR
   1.402 +
   1.403 +    if test ! -x $OUTPUT_ROOT/fixpath.exe; then
   1.404 +      AC_MSG_RESULT([no])
   1.405 +      cat $OUTPUT_ROOT/fixpath1.log
   1.406 +      AC_MSG_ERROR([Could not create $OUTPUT_ROOT/fixpath.exe])
   1.407 +    fi
   1.408 +    AC_MSG_RESULT([yes])
   1.409 +    AC_MSG_CHECKING([if fixpath.exe works])
   1.410 +    cd $OUTPUT_ROOT
   1.411 +    $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1
   1.412 +    cd $CURDIR
   1.413 +    if test ! -x $OUTPUT_ROOT/fixpath2.exe; then
   1.414 +      AC_MSG_RESULT([no])
   1.415 +      cat $OUTPUT_ROOT/fixpath2.log
   1.416 +      AC_MSG_ERROR([fixpath did not work!])
   1.417 +    fi
   1.418 +    AC_MSG_RESULT([yes])
   1.419 +    rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj
   1.420 +  fi
   1.421 +
   1.422 +  AC_SUBST(FIXPATH)
   1.423 +])

mercurial