summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-10-09 17:05:51 +0300
committerTor Lillqvist <tml@collabora.com>2020-10-09 17:27:24 +0200
commit6d680b67632b14ce14e761558c07652b7e6782ea (patch)
tree5f41763d25e3cfef88fa506d0bbf00ebafea2dbf /autogen.sh
parent3273170cf63b37f415b21f560e300847bfd2ecde (diff)
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@collabora.com>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh9
1 files changed, 7 insertions, 2 deletions
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)"};