summaryrefslogtreecommitdiff
path: root/configure.ps1
diff options
context:
space:
mode:
authorJoan Touzet <wohali@users.noreply.github.com>2020-02-08 00:30:31 -0500
committerGitHub <noreply@github.com>2020-02-08 00:30:31 -0500
commit24e2c8bf61a4e82504ea6e6ba2caa779980b9597 (patch)
tree6024f2f13d228ef17ecef313a412dd8715096a40 /configure.ps1
parentf58ebc1e75d281bce851b92e36e95b42ca229627 (diff)
downloadcouchdb-24e2c8bf61a4e82504ea6e6ba2caa779980b9597.tar.gz
Fix Windows build (#2534)3.0.0-RC1
* Allows `configure.ps1` to correctly pull and build `rebar` on Windows * Removes the static declarations in `rebar.config.script` on specific, pre-determined paths to various includes/libraries necessary for NIFs and external binaries (expectation is these are passed in env vars INCLUDE, LIB and LIBPATH) * fixes the SM60 `couchjs` build by telling `windows.h` not to redefine min and max as macros through a `#define` * fixes the `make eunit` target on Windows * Adds the missing `EXE_LINK_CXX_TEMPLATE` that our rebar doesn't have, but `enc` has today, which is also causing a failed `couchjs` (C++) build on Windows * Causes `make python-black` to correctly cause failure in `make check` if it finds problems * fixes Mango tests on Python 3.8 by bumping the hypothesis dependency * fixes one Elixir test on Windows (incorrect calculation of `now(:ms)` due to Erlang clock precision difference) * a little bit of python black cleanup (mango tests)
Diffstat (limited to 'configure.ps1')
-rw-r--r--configure.ps115
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ps1 b/configure.ps1
index 9888a9fe0..c74fbcf41 100644
--- a/configure.ps1
+++ b/configure.ps1
@@ -190,6 +190,21 @@ $ConfigERL = @"
"@
$ConfigERL | Out-File "$rootdir\config.erl" -encoding ascii
+# check for rebar; if not found, build it and add it to our path
+if ((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null)
+{
+ Write-Verbose "==> rebar.cmd not found; bootstrapping..."
+ if (-Not (Test-Path "src\rebar"))
+ {
+ git clone --depth 1 https://github.com/apache/couchdb-rebar.git $rootdir\src\rebar
+ }
+ cmd /c "cd src\rebar && $rootdir\src\rebar\bootstrap.bat"
+ cp $rootdir\src\rebar\rebar $rootdir\bin\rebar
+ cp $rootdir\src\rebar\rebar.cmd $rootdir\bin\rebar.cmd
+ make -C $rootdir\src\rebar clean
+ $env:Path += ";$rootdir\bin"
+}
+
# only update dependencies, when we are not in a release tarball
if ( (Test-Path .git -PathType Container) -and (-not $SkipDeps) ) {
Write-Verbose "==> updating dependencies"