configure.ac                 |   20 +++++++++++++++++---
 solenv/wsl/README            |    8 ++++++++
 solenv/wsl/wsl-lo-helper.cpp |    8 --------
 3 files changed, 25 insertions(+), 11 deletions(-)

New commits:
commit 981ba02267af461792c3ff30b8fecc5cd73497a3
Author:     Luboš Luňák <l.lu...@centrum.cz>
AuthorDate: Thu Jul 21 15:59:50 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Fri Jul 22 19:16:29 2022 +0200

    add fallback for $PROGRAMFILESX86
    
    It's not set in my WSL, but since it's going to be c:\program files (x86)
    in the vast majority of cases, just hardcode a fallback.
    
    Change-Id: I3bf41d6bae0e5bb36c53f0a4cf913a980a058fcf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137345
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/configure.ac b/configure.ac
index eca0ab405c85..67493ea442e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4052,6 +4052,9 @@ find_msvc()
     vs_versions_to_check "$1"
     if test "$build_os" = wsl; then
         vswhere="$PROGRAMFILESX86"
+        if test -z "$vswhere"; then
+            vswhere="c:\\Program Files (x86)"
+        fi
     else
         vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
     fi
commit 4fbcededefa07a97aa9ca55986241a0dd0146806
Author:     Luboš Luňák <l.lu...@centrum.cz>
AuthorDate: Thu Jul 21 15:57:53 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Fri Jul 22 19:16:16 2022 +0200

    require wsl-lo-helper to be preinstalled, like 'make'
    
    It is needed to even find MSVC, so configure cannot easily build it.
    
    Change-Id: Ie4e950cf01b9d8778cdc3e9a53718954b0c3c166
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137344
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/configure.ac b/configure.ac
index 2bf56df211d9..eca0ab405c85 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,7 +119,7 @@ PathFormat()
                         formatted_path=$(wslpath -w "$formatted_path")
                         ;;
                 esac
-                formatted_path=$($BUILDDIR/solenv/wsl/wsl-lo-helper.exe --8.3 
"$formatted_path")
+                formatted_path=$($WSL_LO_HELPER --8.3 "$formatted_path")
             elif test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
                 formatted_path=`cygpath -sm "$formatted_path"`
             else
@@ -355,7 +355,7 @@ if test -z "$host" -a -z "$build" -a "$(uname -r | grep -i 
Microsoft 2>/dev/null
                     ;;
             esac
             if test -n "$opt_d" -o -n "$opt_s"; then
-                input=$($BUILDDIR/solenv/wsl/wsl-lo-helper.exe --8.3 "$input")
+                input=$($WSL_LO_HELPER --8.3 "$input")
             fi
             if test -n "$opt_m"; then
                 input="${input//\\//}"
@@ -399,6 +399,17 @@ if test -z "$host" -a -z "$build" -a "$(uname -r | grep -i 
Microsoft 2>/dev/null
 
         exit 0
     fi
+
+    if test -z "$WSL_LO_HELPER"; then
+        if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/wsl-lo-helper" ; then
+            WSL_LO_HELPER="$LODE_HOME/opt/bin/wsl-lo-helper"
+        elif test -x "/opt/lo/bin/wsl-lo-helper"; then
+            WSL_LO_HELPER="/opt/lo/bin/wsl-lo-helper"
+        fi
+    fi
+    if test -z "$WSL_LO_HELPER"; then
+        AC_MSG_ERROR([wsl-lo-helper not found. See solenv/wsl/README.])
+    fi
 fi
 
 AC_CANONICAL_HOST
@@ -3811,7 +3822,7 @@ reg_get_value()
     unset regvalue
 
     if test "$build_os" = "wsl"; then
-        regvalue=$($BUILDDIR/solenv/wsl/wsl-lo-helper.exe --read-registry $1 
"$2" 2>/dev/null)
+        regvalue=$($WSL_LO_HELPER --read-registry $1 "$2" 2>/dev/null)
         return
     fi
 
diff --git a/solenv/wsl/README b/solenv/wsl/README
new file mode 100644
index 000000000000..a9609f08dce9
--- /dev/null
+++ b/solenv/wsl/README
@@ -0,0 +1,8 @@
+This is a tool that will be useful for various tasks when building LO on WSL.
+
+It is a Win32 program, not a Linux (WSL) one.
+
+Compile using the Developer Command Prompt from MSVC as:
+cl wsl-lo-helper.cpp advapi32.lib
+and the copy the executable to /opt/lo/bin (e.g. from shell as):
+sudo mv wsl-lo-helper.exe /opt/lo/bin/wsl-lo-helper
diff --git a/solenv/wsl/wsl-lo-helper.cpp b/solenv/wsl/wsl-lo-helper.cpp
index 1a90580b6f19..87285dcb1d3c 100644
--- a/solenv/wsl/wsl-lo-helper.cpp
+++ b/solenv/wsl/wsl-lo-helper.cpp
@@ -7,14 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/*
- * This is a tool that will be useful for various tasks if/when we build LO on 
WSL
- *
- * It is a Win32 program, not a Linux (WSL) one.
- *
- * Compile as: cl -MD wsl-lo-helper.cpp advapi32.lib
- */
-
 #include <cstdio>
 #include <cstring>
 

Reply via email to