diff options
author | Joan Touzet <wohali@apache.org> | 2020-02-07 21:40:49 -0500 |
---|---|---|
committer | Joan Touzet <wohali@apache.org> | 2020-02-07 21:40:49 -0500 |
commit | f9ce69727180bb725497eb25c018c5adbcfa9dc3 (patch) | |
tree | 89bf59e8ed0c835477b98d06c85ecaf2b844578c | |
parent | b3d9399ada1a1262c1cd68ecf997b46bf4ed2b44 (diff) | |
download | couchdb-windows-build-3.0.0.tar.gz |
Fix Windows buildwindows-build-3.0.0
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | configure.ps1 | 15 | ||||
-rw-r--r-- | src/couch/priv/couch_js/60/main.cpp | 1 | ||||
-rw-r--r-- | src/couch/rebar.config.script | 23 |
5 files changed, 33 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore index 78eccc10f..60e6d145a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.so *.pyc *.swp +*.pdb *~ .venv .DS_Store @@ -504,7 +504,7 @@ endif share/www: ifeq ($(with_fauxton), 1) - @echo "Building Fauxton" + @echo 'Building Fauxton' @cd src/fauxton && npm install --production && ./node_modules/grunt-cli/bin/grunt couchdb endif 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" diff --git a/src/couch/priv/couch_js/60/main.cpp b/src/couch/priv/couch_js/60/main.cpp index e78dbb46d..b6157ed85 100644 --- a/src/couch/priv/couch_js/60/main.cpp +++ b/src/couch/priv/couch_js/60/main.cpp @@ -15,6 +15,7 @@ #include <string.h> #ifdef XP_WIN +#define NOMINMAX #include <windows.h> #else #include <unistd.h> diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script index c0889ce75..91e24d99e 100644 --- a/src/couch/rebar.config.script +++ b/src/couch/rebar.config.script @@ -100,8 +100,8 @@ end, {JS_CFLAGS, JS_LDFLAGS} = case os:type() of {win32, _} when SMVsn == "1.8.5" -> { - "/DXP_WIN /IC:\\relax\\js-1.8.5\\js\\src", - "/LIBPATH:C:\\relax\\js-1.8.5\\js\\src mozjs185-1.0.lib" + "/DXP_WIN", + "mozjs185-1.0.lib" }; {unix, _} when SMVsn == "1.8.5" -> { @@ -110,8 +110,8 @@ end, }; {win32, _} when SMVsn == "60" -> { - "/DXP_WIN /IC:\\relax\\js-60\\js\\src", - "/LIBPATH:C:\\relax\\js-60\\js\\src mozjs-60.lib" + "/DXP_WIN", + "mozjs-60.lib" }; {unix, darwin} when SMVsn == "60" -> { @@ -130,8 +130,8 @@ end. case os:type() of {win32, _} -> { - "/DHAVE_CURL /IC:\\relax\\curl\\include", - "/LIBPATH:C:\\Relax\\curl\\lib\\release-ssl libcurl_imp.lib" + "/DHAVE_CURL", + "/DHAVE_CURL libcurl.lib" }; {unix, freebsd} -> { @@ -174,8 +174,8 @@ IcuDarwinEnv = [{"CFLAGS", "-DXP_UNIX -I/usr/local/opt/icu4c/include"}, {"LDFLAGS", "-L/usr/local/opt/icu4c/lib"}], IcuBsdEnv = [{"CFLAGS", "-DXP_UNIX -I/usr/local/include"}, {"LDFLAGS", "-L/usr/local/lib"}], -IcuWinEnv = [{"CFLAGS", "/DXP_WIN /IC:\\relax\\icu\\include"}, - {"LDFLAGS", "/LIBPATH:C:\\relax\\icu\\lib64 icuin.lib icudt.lib icuuc.lib"}], +IcuWinEnv = [{"CFLAGS", "$DRV_CFLAGS /DXP_WIN"}, + {"LDFLAGS", "icuin.lib icudt.lib icuuc.lib"}], ComparePath = "priv/couch_ejson_compare.so", CompareSrc = ["priv/couch_ejson_compare/*.c"], @@ -199,6 +199,12 @@ SpawnSpec = [ {"priv/couchspawnkillable", ["priv/spawnkillable/*.c"]} ], +%% hack required until switch to enc/rebar3 +PortEnvOverrides = [ + {"win32", "EXE_LINK_CXX_TEMPLATE", + "$LINKER $PORT_IN_FILES $LDFLAGS $EXE_LDFLAGS /OUT:$PORT_OUT_FILE"} +], + PortSpecs = case os:type() of {win32, _} -> BaseSpecs ++ SpawnSpec; @@ -218,6 +224,7 @@ AddConfig = [ {d, 'COUCHDB_GIT_SHA', GitSha}, {i, "../"} ] ++ MD5Config ++ ProperConfig}, + {port_env, PortEnvOverrides}, {eunit_compile_opts, PlatformDefines} ]. |