summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill <w.young@schaetz-cro.ch>2021-12-22 10:04:31 +0000
committerNick Vatamaniuc <vatamane@apache.org>2022-04-05 23:31:40 -0400
commit9871fdefba9d2b406e13b1e35e8cd2cb64f18c5f (patch)
tree7c2c1527d4466865cb3456610657509670072259
parentb0616fdf63029f2d1c84e83f92dea46f38e7f3b5 (diff)
downloadcouchdb-9871fdefba9d2b406e13b1e35e8cd2cb64f18c5f.tar.gz
Win32-SM91 support and fixes
-rw-r--r--Makefile.win6
-rw-r--r--src/couch/priv/couch_js/86/main.cpp10
-rw-r--r--src/couch/rebar.config.script11
3 files changed, 12 insertions, 15 deletions
diff --git a/Makefile.win b/Makefile.win
index 808f6235e..01e82f061 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -158,18 +158,18 @@ eunit: couch
exunit: export BUILDDIR = $(shell echo %cd%)
exunit: export MIX_ENV=test
exunit: export ERL_LIBS = $(shell echo %cd%)\src
-exunit: export ERL_AFLAGS = -config $(shell echo %cd%)/rel/files/eunit.config
+exunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config")
exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell echo %cd%)/bin/couchjs $(shell echo %cd%)/share/server/main.js
exunit: couch elixir-init setup-eunit elixir-check-formatted elixir-credo
@mix test --cover --trace $(EXUNIT_OPTS)
setup-eunit: export BUILDDIR = $(shell pwd)
-setup-eunit: export ERL_AFLAGS = "-config $(shell echo %cd%)/rel/files/eunit.config")
+setup-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config")
setup-eunit:
@$(REBAR) setup_eunit 2> nul
just-eunit: export BUILDDIR = $(shell pwd)
-just-eunit: export ERL_AFLAGS = "-config $(shell echo %cd%)/rel/files/eunit.config")
+just-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config")
just-eunit:
@$(REBAR) -r eunit $(EUNIT_OPTS)
diff --git a/src/couch/priv/couch_js/86/main.cpp b/src/couch/priv/couch_js/86/main.cpp
index d75f119b2..06ff22428 100644
--- a/src/couch/priv/couch_js/86/main.cpp
+++ b/src/couch/priv/couch_js/86/main.cpp
@@ -287,17 +287,9 @@ int runWithContext(JSContext* cx, couch_args* args) {
// Compile and run
JS::CompileOptions options(cx);
- options.setFileAndLine(filename, 1);
JS::RootedScript script(cx);
- FILE* fp;
- fp = fopen(args->scripts[i], "r");
- if(fp == NULL) {
- fprintf(stderr, "Failed to read file: %s\n", filename);
- return 3;
- }
- script = JS::CompileUtf8File(cx, options, fp);
- fclose(fp);
+ script = JS::CompileUtf8Path(cx, options, filename);
if (!script) {
JS::RootedValue exc(cx);
if(!JS_GetPendingException(cx, &exc)) {
diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script
index a288a96eb..ba907b0a2 100644
--- a/src/couch/rebar.config.script
+++ b/src/couch/rebar.config.script
@@ -155,8 +155,13 @@ end.
};
{unix, _} when SMVsn == "91" ->
{
- "-DXP_UNIX -I/usr/include/mozjs-91 -I/usr/local/include/mozjs-91 -I/opt/homebrew/include/mozjs-91/ -std=c++17 -Wno-invalid-offsetof",
- "-L/usr/local/lib -L /opt/homebrew/lib/ -std=c++17 -lmozjs-91 -lm"
+ "$CFLAGS -DXP_UNIX -I/usr/include/mozjs-91 -I/usr/local/include/mozjs-91 -I/opt/homebrew/include/mozjs-91/ -std=c++17 -Wno-invalid-offsetof",
+ "$LDFLAGS -L/usr/local/lib -L /opt/homebrew/lib/ -std=c++17 -lmozjs-91 -lm"
+ };
+ {win32, _} when SMVsn == "91" ->
+ {
+ "/std:c++17 /DXP_WIN",
+ "$LDFLAGS mozjs-91.lib"
}
end.
@@ -189,7 +194,7 @@ IcuDarwinEnv = [{"CFLAGS", "-DXP_UNIX -I/usr/local/opt/icu4c/include -I/opt/home
IcuBsdEnv = [{"CFLAGS", "-DXP_UNIX -I/usr/local/include"},
{"LDFLAGS", "-L/usr/local/lib"}].
IcuWinEnv = [{"CFLAGS", "$DRV_CFLAGS /DXP_WIN"},
- {"LDFLAGS", "icuin.lib icudt.lib icuuc.lib"}].
+ {"LDFLAGS", "$LDFLAGS icuin.lib icudt.lib icuuc.lib"}].
ComparePath = "priv/couch_ejson_compare.so".
CompareSrc = ["priv/couch_ejson_compare/*.c"].