common/autoconf/basics_windows.m4

Print this page
rev 1119 : 8022177: Windows/MSYS builds broken


 249 
 250   # Input might be given as Windows format, start by converting to
 251   # unix format.
 252   new_path="$path"
 253   BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
 254 
 255   # Now try to locate executable using which
 256   new_path=`$WHICH "$new_path" 2> /dev/null`
 257 
 258   if test "x$new_path" = x; then
 259     # Oops. Which didn't find the executable.
 260     # The splitting of arguments from the executable at a space might have been incorrect,
 261     # since paths with space are more likely in Windows. Give it another try with the whole
 262     # argument.
 263     path="$complete"
 264     arguments="EOL"
 265     new_path="$path"
 266     BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
 267 
 268     new_path=`$WHICH "$new_path" 2> /dev/null`








 269 
 270     if test "x$new_path" = x; then
 271       # It's still not found. Now this is an unrecoverable error.
 272       AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
 273       has_space=`$ECHO "$complete" | $GREP " "`
 274       if test "x$has_space" != x; then
 275         AC_MSG_NOTICE([You might be mixing spaces in the path and extra arguments, which is not allowed.])
 276       fi
 277       AC_MSG_ERROR([Cannot locate the the path of $1])
 278     fi
 279   fi
 280 
 281   # Now new_path has a complete unix path to the binary
 282   if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then
 283     # Keep paths in /bin as-is, but remove trailing .exe if any
 284     new_path="${new_path/%.exe/}"
 285     # Do not save /bin paths to all_fixpath_prefixes!
 286   else
 287     # Not in mixed or Windows style, start by that.
 288     new_path=`cmd //c echo $new_path`




 249 
 250   # Input might be given as Windows format, start by converting to
 251   # unix format.
 252   new_path="$path"
 253   BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
 254 
 255   # Now try to locate executable using which
 256   new_path=`$WHICH "$new_path" 2> /dev/null`
 257 
 258   if test "x$new_path" = x; then
 259     # Oops. Which didn't find the executable.
 260     # The splitting of arguments from the executable at a space might have been incorrect,
 261     # since paths with space are more likely in Windows. Give it another try with the whole
 262     # argument.
 263     path="$complete"
 264     arguments="EOL"
 265     new_path="$path"
 266     BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
 267 
 268     new_path=`$WHICH "$new_path" 2> /dev/null`
 269     # bat and cmd files are not always considered executable in MSYS causing which
 270     # to not find them
 271     if test "x$new_path" = x \
 272         && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
 273         && test "x`$LS \"$path\" 2>/dev/null`" != x; then
 274       new_path="$path"
 275       BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
 276     fi
 277 
 278     if test "x$new_path" = x; then
 279       # It's still not found. Now this is an unrecoverable error.
 280       AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
 281       has_space=`$ECHO "$complete" | $GREP " "`
 282       if test "x$has_space" != x; then
 283         AC_MSG_NOTICE([You might be mixing spaces in the path and extra arguments, which is not allowed.])
 284       fi
 285       AC_MSG_ERROR([Cannot locate the the path of $1])
 286     fi
 287   fi
 288 
 289   # Now new_path has a complete unix path to the binary
 290   if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then
 291     # Keep paths in /bin as-is, but remove trailing .exe if any
 292     new_path="${new_path/%.exe/}"
 293     # Do not save /bin paths to all_fixpath_prefixes!
 294   else
 295     # Not in mixed or Windows style, start by that.
 296     new_path=`cmd //c echo $new_path`