170 # unix format. |
170 # unix format. |
171 new_path=`$CYGPATH -u "$path"` |
171 new_path=`$CYGPATH -u "$path"` |
172 |
172 |
173 # Now try to locate executable using which |
173 # Now try to locate executable using which |
174 new_path=`$WHICH "$new_path" 2> /dev/null` |
174 new_path=`$WHICH "$new_path" 2> /dev/null` |
|
175 # bat and cmd files are not always considered executable in cygwin causing which |
|
176 # to not find them |
|
177 if test "x$new_path" = x \ |
|
178 && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ |
|
179 && test "x`$LS \"$path\" 2>/dev/null`" != x; then |
|
180 new_path=`$CYGPATH -u "$path"` |
|
181 fi |
175 if test "x$new_path" = x; then |
182 if test "x$new_path" = x; then |
176 # Oops. Which didn't find the executable. |
183 # Oops. Which didn't find the executable. |
177 # The splitting of arguments from the executable at a space might have been incorrect, |
184 # The splitting of arguments from the executable at a space might have been incorrect, |
178 # since paths with space are more likely in Windows. Give it another try with the whole |
185 # since paths with space are more likely in Windows. Give it another try with the whole |
179 # argument. |
186 # argument. |
180 path="$complete" |
187 path="$complete" |
181 arguments="EOL" |
188 arguments="EOL" |
182 new_path=`$CYGPATH -u "$path"` |
189 new_path=`$CYGPATH -u "$path"` |
183 new_path=`$WHICH "$new_path" 2> /dev/null` |
190 new_path=`$WHICH "$new_path" 2> /dev/null` |
|
191 # bat and cmd files are not always considered executable in cygwin causing which |
|
192 # to not find them |
|
193 if test "x$new_path" = x \ |
|
194 && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ |
|
195 && test "x`$LS \"$path\" 2>/dev/null`" != x; then |
|
196 new_path=`$CYGPATH -u "$path"` |
|
197 fi |
184 if test "x$new_path" = x; then |
198 if test "x$new_path" = x; then |
185 # It's still not found. Now this is an unrecoverable error. |
199 # It's still not found. Now this is an unrecoverable error. |
186 AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) |
200 AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) |
187 has_space=`$ECHO "$complete" | $GREP " "` |
201 has_space=`$ECHO "$complete" | $GREP " "` |
188 if test "x$has_space" != x; then |
202 if test "x$has_space" != x; then |