summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh12
1 files changed, 12 insertions, 0 deletions
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";
}