autogen.sh |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit d1b399b687193951978500056ce461a921575d3e
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Sun Oct 4 19:07:41 2020 +0300
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Sun Oct 4 21:16:22 2020 +0200

    Step towards building for Windows on WSL: ProgramFiles(x86) handling
    
    autogen.sh is a Perl script. When running Perl on WSL, weirdly named
    environment variables like the "ProgramFiles(x86)" one don't seem to
    get imported to a shell child process of the Perl process. So export
    it as PROGRAMFILESX86 instead. configure.ac will look for that on WSL.
    (Changes to configure.ac will be coming in small careful steps.)
    
    Change-Id: I572c3b1e2f2fab3629d1856d33fcf0dda51217d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103921
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/autogen.sh b/autogen.sh
index 49835ff27e25..beda712747ce 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -296,6 +296,18 @@ if (defined $ENV{NOCONFIGURE}) {
     push @args, "--enable-option-checking=$option_checking";
 
     print "Running ./configure with '" . join (" ", @args), "'\n";
+
+    # 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 "") {
+        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";
+            exit (1);
+        }
+        $ENV{"PROGRAMFILESX86"} = $ENV{"ProgramFiles(x86)"};
+    }
+
     system ("./configure", @args) && die "Error running configure";
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to