# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
- file_conv=mingw
+ if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
+ # MSYS2 environment.
+ file_conv=cygwin
+ else
+ # Original MinGW environment.
+ file_conv=mingw
+ fi
;;
- CYGWIN* | MSYS*)
+ MSYS*)
+ # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
+ file_conv=cygwin
+ ;;
+ CYGWIN*)
+ # Cygwin environment.
file_conv=cygwin
;;
*)
file_conv=
-# func_file_conv build_file lazy
+# func_file_conv build_file unneeded_conversions
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
+# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no
+# conversion will take place.
func_file_conv ()
{
file=$1
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
- file_conv=mingw
+ if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
+ # MSYS2 environment.
+ file_conv=cygwin
+ else
+ # Original MinGW environment.
+ file_conv=mingw
+ fi
;;
- CYGWIN* | MSYS*)
+ MSYS*)
+ # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
+ file_conv=cygwin
+ ;;
+ CYGWIN*)
+ # Cygwin environment.
file_conv=cygwin
;;
*)
fi
case $file_conv/,$2, in
*,$file_conv,*)
+ # This is the optimization mentioned above:
+ # If UNNEEDED_CONVERSIONS contains $file_conv, don't convert.
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`