common/autoconf/basics_windows.m4
changeset 25882 bd4315f0084b
parent 20363 fa7663fc5d50
child 29790 79641c886929
--- a/common/autoconf/basics_windows.m4	Mon Aug 18 10:05:34 2014 +0100
+++ b/common/autoconf/basics_windows.m4	Tue Aug 19 13:43:40 2014 +0200
@@ -266,6 +266,14 @@
     BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
 
     new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in MSYS causing which
+    # to not find them
+    if test "x$new_path" = x \
+        && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+        && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path="$path"
+      BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
+    fi
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.