[Libreoffice-commits] core.git: configure.ac

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Sun Oct 25 13:24:05 UTC 2020


 configure.ac |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 8a88939e9d66db11c0f0945bdbabaab3c7916218
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Sun Oct 25 12:24:53 2020 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Sun Oct 25 14:23:27 2020 +0100

    Fix win_get_env_from_vsvars32bat and find_ucrt for WSL
    
    Change-Id: I8cb2d6b6170d427c0f622b1377b6fd21e3b90383
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104770
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/configure.ac b/configure.ac
index 10a199c975c8..563fd831f18e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3703,16 +3703,21 @@ vs_versions_to_check()
 
 win_get_env_from_vsvars32bat()
 {
-    WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
+    local WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
     # Also seems to be located in another directory under the same name: vsvars32.bat
     # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
     printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
     # use 'echo.%ENV%' syntax (instead of 'echo %ENV%') to avoid outputting "ECHO is off." in case when ENV is empty or a space
     printf '@setlocal\r\n at echo.%%%s%%\r\n at endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
-    chmod +x $WRAPPERBATCHFILEPATH
-    _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
+    local result
+    if test "$build_os" = "wsl"; then
+        result=$(cd /mnt/c && cmd.exe /c $(wslpath -w $WRAPPERBATCHFILEPATH) | tr -d '\r')
+    else
+        chmod +x $WRAPPERBATCHFILEPATH
+        result=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
+    fi
     rm -f $WRAPPERBATCHFILEPATH
-    printf '%s' "$_win_get_env_from_vsvars32bat"
+    printf '%s' "$result"
 }
 
 find_ucrt()
@@ -3720,7 +3725,7 @@ find_ucrt()
     reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
     if test -n "$regvalue"; then
         PathFormat "$regvalue"
-        UCRTSDKDIR=$formatted_path
+        UCRTSDKDIR=$formatted_path_unix
         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
         UCRTVERSION=$regvalue
         # Rest if not exist


More information about the Libreoffice-commits mailing list