[vlc-devel] [PATCH 3/7] configure: detect how to transform windows pathes

Steve Lhomme robux4 at ycbcr.xyz
Tue May 12 12:28:04 CEST 2020


winepath, wslpath and cygpath have a compatible syntax (at least -w and -u).

They should be used depending on what is available in the build environment
rather than hardcoding "wine winepath".
---
 configure.ac | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/configure.ac b/configure.ac
index 19e3f8aed7a9..fcc8a42d5d47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1292,6 +1292,7 @@ if test "${ac_cv_c_attribute_packed}" != "no"; then
   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
 fi
 
+WIN32_PATH_CMD=
 AS_IF([test "${SYS}" = "mingw32"], [
     dnl
     dnl Detect if we can call windows apps
@@ -1317,7 +1318,27 @@ AS_IF([test "${SYS}" = "mingw32"], [
         AC_MSG_RESULT([not found])
       ])
     ])
+
+    AC_MSG_CHECKING([whether how to handle windows pathes])
+    win32_path_cmd=no
+    for win_path in "wine winepath" "cygpath" "wslpath"
+    do
+      ac_try="$win_path -u c:\\"
+      (eval "$ac_try") 2>&5
+      ac_status=$?
+      if test $ac_status = 0; then
+        win32_path_cmd=$win_path
+        break
+      fi
+    done
+    AS_IF([test "x${win32_path_cmd}" != "xno"],[
+      WIN32_PATH_CMD=${win32_path_cmd}
+      AC_MSG_RESULT([using '${win32_path_cmd}'])
+    ],[
+      AC_MSG_RESULT([not found])
+    ])
 ])
+AC_SUBST([WIN32_PATH_CMD])
 
 dnl
 dnl  Check the CPU
-- 
2.26.2



More information about the vlc-devel mailing list