diff options
author | Paul J. Davis <paul.joseph.davis@gmail.com> | 2019-12-02 14:55:06 -0600 |
---|---|---|
committer | jiangph <jiangph@cn.ibm.com> | 2019-12-20 22:44:35 +0800 |
commit | 227f1d657720d97148f09536762b5c7bdebeee8f (patch) | |
tree | 1f6c81b631ed69441d44d5dc5f4ffaf15973ccda | |
parent | 15a3c172c56116c7d4bbb30dc41cb89e6434fe18 (diff) | |
download | couchdb-227f1d657720d97148f09536762b5c7bdebeee8f.tar.gz |
Allow configuring the use of SpiderMonkey 60
-rw-r--r-- | src/couch/rebar.config.script | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script index f4c07057e..e384a83cf 100644 --- a/src/couch/rebar.config.script +++ b/src/couch/rebar.config.script @@ -57,6 +57,8 @@ end. SMVsn = case lists:keyfind(spidermonkey_version, 1, CouchConfig) of {_, "1.8.5"} -> "1.8.5"; + {_, "60"} -> + "60"; undefined -> "1.8.5"; {_, Unsupported} -> @@ -92,12 +94,22 @@ end, {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" + "/LIBPATH:C:\\relax\\js-1.8.5\\js\\src mozjs60.lib" }; - _ when SMVsn == "1.8.5" -> + {unix, _} when SMVsn == "1.8.5" -> { - "-DXP_UNIX -I/usr/inlude/js -I/usr/local/include/js", + "-DXP_UNIX -I/usr/include/js -I/usr/local/include/js", "-L/usr/local/lib -lmozjs185 -lm" + }; + {win32, _} when SMVsn == "60" -> + { + "/DXP_WIN /IC:\\relax\\js-60\\js\\src", + "/LIBPATH:C:\\relax\\js-60\\js\\src mozjs60.0.lib" + }; + {unix, _} when SMVsn == "60" -> + { + "-DXP_UNIX -I/usr/include/mozjs-60 -I/usr/local/include/mozjs-60 -std=c++14", + "-L/usr/local/lib -std=c++14 -lmozjs-60 -lm" } end. @@ -125,9 +137,23 @@ end. end, CouchJSSrc = case SMVsn of - "1.8.5" -> ["priv/couch_js/1.8.5/*.c"] + "1.8.5" -> ["priv/couch_js/1.8.5/*.c"]; + "60" -> ["priv/couch_js/60/*.cpp"] end. +CouchJSEnv = case SMVsn of + "1.8.5" -> + [ + {"CFLAGS", JS_CFLAGS ++ " " ++ CURL_CFLAGS}, + {"LDFLAGS", JS_LDFLAGS ++ " " ++ CURL_LDFLAGS} + ]; + "60" -> + [ + {"CXXFLAGS", JS_CFLAGS ++ " " ++ CURL_CFLAGS}, + {"LDFLAGS", JS_LDFLAGS ++ " " ++ CURL_LDFLAGS} + ] +end, + IcuPath = "priv/couch_icu_driver.so", IcuSrc = ["priv/icu_driver/*.c"], IcuEnv = [{"DRV_CFLAGS", "$DRV_CFLAGS -DPIC -O2 -fno-common"}, @@ -144,7 +170,7 @@ CompareSrc = ["priv/couch_ejson_compare/*.c"], BaseSpecs = [ %% couchjs - {".*", CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ " " ++ CURL_CFLAGS}, {"LDFLAGS", JS_LDFLAGS ++ " " ++ CURL_LDFLAGS}]}]}, + {".*", CouchJSPath, CouchJSSrc, [{env, CouchJSEnv}]}, % ICU {"darwin", IcuPath, IcuSrc, [{env, IcuEnv ++ IcuDarwinEnv}]}, {"linux", IcuPath, IcuSrc, [{env, IcuEnv}]}, |