You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2020/02/10 03:20:37 UTC

[couchdb] 06/11: Fix SM60 build on Mac (#2401)

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

jiangphcn pushed a commit to branch spidermonkey60-porting
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9fb6f45dc324a8d376cea20f97db006ee970f94d
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Mon Jan 6 14:07:13 2020 +0100

    Fix SM60 build on Mac (#2401)
    
    * fix: avoid segfaults, patch by @davisp
    
    * fix: build against sm60 on mac needs extra compiler flags
---
 src/couch/priv/couch_js/60/main.cpp | 3 ---
 src/couch/rebar.config.script       | 5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/couch/priv/couch_js/60/main.cpp b/src/couch/priv/couch_js/60/main.cpp
index c92cfb7..ecedfbd 100644
--- a/src/couch/priv/couch_js/60/main.cpp
+++ b/src/couch/priv/couch_js/60/main.cpp
@@ -487,8 +487,5 @@ main(int argc, const char* argv[])
         JS_MaybeGC(cx);
     }
 
-    JS_DestroyContext(cx);
-    JS_ShutDown();
-
     return 0;
 }
diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script
index a07b941..50131d4 100644
--- a/src/couch/rebar.config.script
+++ b/src/couch/rebar.config.script
@@ -106,6 +106,11 @@ end,
             "/DXP_WIN /IC:\\relax\\js-60\\js\\src",
             "/LIBPATH:C:\\relax\\js-60\\js\\src mozjs-60.lib"
         };
+    {unix, darwin} when SMVsn == "60" ->
+        {
+            "-DXP_UNIX -I/usr/include/mozjs-60 -I/usr/local/include/mozjs-60 -std=c++14",
+            "-L/usr/local/lib -lmozjs-60 -lm -std=c++14 -lc++"
+        };
     {unix, _} when SMVsn == "60" ->
         {
             "-DXP_UNIX -I/usr/include/mozjs-60 -I/usr/local/include/mozjs-60 -std=c++14",