This is an automated email from the ASF dual-hosted git repository.

wohali pushed a commit to branch SM78
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 4c7692aad6ff9f318cf4dbde6fd115d2a237b97d
Author: Joan Touzet <woh...@apache.org>
AuthorDate: Wed Apr 7 18:36:26 2021 -0400

    Add support for Spidermonkey 78
---
 src/couch/rebar.config.script | 15 ++++++++++++++-
 support/build_js.escript      | 14 +-------------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script
index 5c9e633..a6d7005 100644
--- a/src/couch/rebar.config.script
+++ b/src/couch/rebar.config.script
@@ -61,6 +61,8 @@ SMVsn = case lists:keyfind(spidermonkey_version, 1, 
CouchConfig) of
         "60";
     {_, "68"} ->
         "68";
+    {_, "78"} ->
+        "78";
     {_, "86"} ->
         "86";
     undefined ->
@@ -84,7 +86,12 @@ ConfigH = [
     {"PACKAGE_VERSION", "\"" ++ Version ++ "\""}
 ].
 
-CouchJSConfig = "priv/couch_js/" ++ SMVsn ++ "/config.h".
+CouchJSConfig = case SMVsn of
+    "78" ->
+        "priv/couch_js/86/config.h";
+    _ ->
+        "priv/couch_js/" ++ SMVsn ++ "/config.h"
+end.
 ConfigSrc = [["#define ", K, " ", V, $\n] || {K, V} <- ConfigH].
 ConfigBin = iolist_to_binary(ConfigSrc).
 ok = CopyIfDifferent(CouchJSConfig, ConfigBin).
@@ -132,6 +139,11 @@ end.
             "-DXP_UNIX -I/usr/include/mozjs-68 -I/usr/local/include/mozjs-68 
-std=c++14 -Wno-invalid-offsetof",
             "-L/usr/local/lib -std=c++14 -lmozjs-68 -lm"
         };
+    {unix, _} when SMVsn == "78" ->
+        {
+            "-DXP_UNIX -I/usr/include/mozjs-78 -I/usr/local/include/mozjs-78 
-std=c++20 -Wno-invalid-offsetof",
+            "-L/usr/local/lib -std=c++20 -lmozjs-78 -lm"
+        };
     {unix, _} when SMVsn == "86" ->
         {
             "-DXP_UNIX -I/usr/include/mozjs-86 -I/usr/local/include/mozjs-86 
-I/opt/homebrew/include/mozjs-86/ -std=c++17 -Wno-invalid-offsetof",
@@ -143,6 +155,7 @@ CouchJSSrc = case SMVsn of
     "1.8.5" -> ["priv/couch_js/1.8.5/*.c"];
     "60" -> ["priv/couch_js/60/*.cpp"];
     "68" -> ["priv/couch_js/68/*.cpp"];
+    "78" -> ["priv/couch_js/86/*.cpp"];
     "86" -> ["priv/couch_js/86/*.cpp"]
 end.
 
diff --git a/support/build_js.escript b/support/build_js.escript
index 03d45a7..5f1e920 100644
--- a/support/build_js.escript
+++ b/support/build_js.escript
@@ -65,19 +65,7 @@ main([]) ->
             [
                 "share/server/rewrite_fun.js"
             ];
-        "60" ->
-            [
-                "share/server/60/esprima.js",
-                "share/server/60/escodegen.js",
-                "share/server/60/rewrite_fun.js"
-            ];
-        "68" ->
-            [
-                "share/server/60/esprima.js",
-                "share/server/60/escodegen.js",
-                "share/server/60/rewrite_fun.js"
-            ];
-        "86" ->
+        _ ->
             [
                 "share/server/60/esprima.js",
                 "share/server/60/escodegen.js",

Reply via email to