< prev index next >

make/autoconf/util_windows.m4

Print this page




  35   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
  36     # wslpath does not check the input, only call if an actual windows path was
  37     # given.
  38     if $ECHO "$windows_path" | $GREP -q ["^[a-zA-Z]:[\\\\/]"]; then
  39       unix_path=`$WSLPATH -u "$windows_path"`
  40       $1="$unix_path"
  41     fi
  42   fi
  43 ])
  44 
  45 AC_DEFUN([UTIL_REWRITE_AS_WINDOWS_MIXED_PATH],
  46 [
  47   unix_path="[$]$1"
  48   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  49     windows_path=`$CYGPATH -m "$unix_path"`
  50     $1="$windows_path"
  51   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  52     windows_path=`cmd //c echo $unix_path`
  53     $1="$windows_path"
  54   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then





  55     windows_path=`$WSLPATH -m "$unix_path"`
  56     $1="$windows_path"



  57   fi
  58 ])
  59 
  60 # Helper function which possibly converts a path using DOS-style short mode.
  61 # If so, the updated path is stored in $new_path.
  62 # $1: The path to check
  63 AC_DEFUN([UTIL_MAKE_WINDOWS_SPACE_SAFE_CYGWIN],
  64 [
  65   input_path="$1"
  66   # Check if we need to convert this using DOS-style short mode. If the path
  67   # contains just simple characters, use it. Otherwise (spaces, weird characters),
  68   # take no chances and rewrite it.
  69   # Note: m4 eats our [], so we need to use @<:@ and @:>@ instead.
  70   has_forbidden_chars=`$ECHO "$input_path" | $GREP @<:@^-._/a-zA-Z0-9@:>@`
  71   if test "x$has_forbidden_chars" != x; then
  72     # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
  73     shortmode_path=`$CYGPATH -s -m -a "$input_path"`
  74     path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
  75     if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
  76       # Going to short mode and back again did indeed matter. Since short mode is




  35   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
  36     # wslpath does not check the input, only call if an actual windows path was
  37     # given.
  38     if $ECHO "$windows_path" | $GREP -q ["^[a-zA-Z]:[\\\\/]"]; then
  39       unix_path=`$WSLPATH -u "$windows_path"`
  40       $1="$unix_path"
  41     fi
  42   fi
  43 ])
  44 
  45 AC_DEFUN([UTIL_REWRITE_AS_WINDOWS_MIXED_PATH],
  46 [
  47   unix_path="[$]$1"
  48   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  49     windows_path=`$CYGPATH -m "$unix_path"`
  50     $1="$windows_path"
  51   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  52     windows_path=`cmd //c echo $unix_path`
  53     $1="$windows_path"
  54   elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
  55     PATH_EXISTS=true
  56     if test ! -e "$unix_path"; then
  57       PATH_EXISTS=false
  58       $TOUCH "$unix_path"
  59     fi
  60     windows_path=`$WSLPATH -m "$unix_path"`
  61     $1="$windows_path"
  62     if test $PATH_EXISTS = false; then
  63       $RM "$unix_path"
  64     fi
  65   fi
  66 ])
  67 
  68 # Helper function which possibly converts a path using DOS-style short mode.
  69 # If so, the updated path is stored in $new_path.
  70 # $1: The path to check
  71 AC_DEFUN([UTIL_MAKE_WINDOWS_SPACE_SAFE_CYGWIN],
  72 [
  73   input_path="$1"
  74   # Check if we need to convert this using DOS-style short mode. If the path
  75   # contains just simple characters, use it. Otherwise (spaces, weird characters),
  76   # take no chances and rewrite it.
  77   # Note: m4 eats our [], so we need to use @<:@ and @:>@ instead.
  78   has_forbidden_chars=`$ECHO "$input_path" | $GREP @<:@^-._/a-zA-Z0-9@:>@`
  79   if test "x$has_forbidden_chars" != x; then
  80     # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
  81     shortmode_path=`$CYGPATH -s -m -a "$input_path"`
  82     path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
  83     if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
  84       # Going to short mode and back again did indeed matter. Since short mode is


< prev index next >