[Libreoffice-commits] core.git: autogen.sh

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 9 15:28:03 UTC 2020


 autogen.sh |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 6d680b67632b14ce14e761558c07652b7e6782ea
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Oct 9 17:05:51 2020 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Fri Oct 9 17:27:24 2020 +0200

    Enable building for WSL (Linux) on WSL
    
    Change-Id: I47a81a730735ff8c315a57a78c418da2b771e838
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104123
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/autogen.sh b/autogen.sh
index beda712747ce..1779de77e6f3 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -300,9 +300,14 @@ if (defined $ENV{NOCONFIGURE}) {
     # When running a shell script from Perl on WSL, weirdly named
     # environment variables like the "ProgramFiles(x86)" one don't get
     # imported by the shell. So export it as PROGRAMFILESX86 instead.
-    if (`wslsys 2>/dev/null` ne "") {
+    my $building_for_linux = 0;
+    foreach my $arg (@args) {
+        $building_for_linux = 1 if ($arg =~ /--host=x86_64.*linux/);
+    }
+    if (`wslsys 2>/dev/null` ne "" && !$building_for_linux) {
         if (!$ENV{"ProgramFiles(x86)"}) {
-            print STDERR "To build on WSL, you need to set the WSLENV environment variable in the Control Panel to 'ProgramFiles(x86)'\n";
+            print STDERR "To build for Windows on WSL, you need to set the WSLENV environment variable in the Control Panel to 'ProgramFiles(x86)'\n";
+            print STDERR "If you actually do want to build for WSL (Linux) on WSL, pass a --host=x86_64-pc-linux-gnu option\n";
             exit (1);
         }
         $ENV{"PROGRAMFILESX86"} = $ENV{"ProgramFiles(x86)"};


More information about the Libreoffice-commits mailing list