You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2022/03/12 16:59:21 UTC
[couchdb] 03/03: Win32-SM91 support and fixes
This is an automated email from the ASF dual-hosted git repository.
jan pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 79577d8adeca8577a4709ea51cc9bbd3e7bb331e
Author: Will <w....@schaetz-cro.ch>
AuthorDate: Wed Dec 22 10:04:31 2021 +0000
Win32-SM91 support and fixes
---
Makefile.win | 6 +++---
src/couch/priv/couch_js/86/main.cpp | 10 +---------
src/couch/rebar.config.script | 11 ++++++++---
3 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/Makefile.win b/Makefile.win
index de94760..1b711fc 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 d75f119..06ff224 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 a288a96..ba907b0 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"].