Follow-up Comment #16, sr #110901 (group libtool):

[comment #12 комментарий №12:]
> [comment #10 comment #10:]
>> Looks like MSys is still in (very inactive) use.
>> The project page has two years old activity.
> Could you link the project page here? 
> 

Probably the most current valid link is 
https://sourceforge.net/projects/mingw/

[comment #15 комментарий №15:]
> I pushed a patch that should cache if cygpath is present with a simple check
> for the help message. If the check is successful,
> func_convert_core_msys_to_w32_with_cygpath will be used, but if it is not,
> the previous implementation will be used, func_convert_core_msys_to_w32.
> 
> This should have the requested behaviour, where MSYS needs command line flags
> escaped, but MSYS2 can use cygpath.
> 
> https://cgit.git.savannah.gnu.org/cgit/libtool.git/commit/?h=development&id=9f4b6adea4403e38b0b1f75761563c103d7c0e03

This could be risky too.
If double slash is not converted (for any reason), then the command "cmd.exe
//c something" will start interactive shell.

I'd suggest to use several workarounds.
* check for cygpath and use it, if available. The best, the fastest and the
most straightforward way.
* Without cygpath cmd may hang with a single slash (when transforming) and may
hang with two slashes (when not transforming). The easy solution is:
_lt_result=`"${COMSPEC-cmd}" /c echo one-slash works. Not checked //c echo
two-slashes 2>/dev/null`
The resulting string is started with "one-slash or "two-slashes".

It can be used like this:

AS_CASE([$host],
  [*-*-mingw* | *-*-windows* | *-*-cygwin*],
  [AS_CASE([$build],
    [*-*-mingw* | *-*-windows* | *-*-cygwin*],
    [AC_MSG_CHECKING([whether cygpath is installed])
      AC_CACHE_VAL([lt_cv_cygpath_installed],
        [lt_cv_cygpath_installed=ignoring
          cygpath --help &> /dev/null
          _lt_result=$?
          AS_IF([test 0 =
"$_lt_result"],[lt_cv_cygpath_installed=yes],[lt_cv_cygpath_installed=no])
        ])
      AC_MSG_RESULT([$lt_cv_cygpath_installed])
      _LT_DECL([cygpath_installed], [lt_cv_cygpath_installed],
               [0], [whether cygpath is installed])dnl
      AS_IF([test "xyes" != "x$lt_cv_cygpath_installed"],
        [
          AC_MSG_CHECKING([whether to use cmd with one slash or two slashes])
          AC_CACHE_VAL([lt_cv_cmd_slashes],
            [
              _lt_result=`"${COMSPEC-cmd}" /c echo one-slash works. Not
checked //c echo two-slashes 2>/dev/null`
              AS_IF([test 0 != $?],[AC_MSG_ERROR([Do not know how to convert
paths])])
              AS_CASE([$_lt_result],
                [one-slash*],[lt_cv_cmd_slashes="one"],
                [two-slashes*],[lt_cv_cmd_slashes="two"],
                [AC_MSG_ERROR([Do not know how to convert paths])]
              )
            ])
          AC_MSG_RESULT([$lt_cv_cmd_slashes])
        ])
    ])
  ]
)dnl


The should be the most robust and reliable way of checking and using paths
conversion.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110901>

_______________________________________________
Сообщение отправлено по Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to