summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2019-12-02 14:55:06 -0600
committerPaul J. Davis <paul.joseph.davis@gmail.com>2019-12-02 14:58:27 -0600
commit466d1d9e6107cdef8e49315837e7e3ea52aa747e (patch)
tree28d601e80cffecdc311e5934038ce2873b3fddf3
parent1f8cac429ea76a387b24a246902b2e6fde21d07f (diff)
downloadcouchdb-466d1d9e6107cdef8e49315837e7e3ea52aa747e.tar.gz
Allow configuring the use of SpiderMonkey 60
-rw-r--r--src/couch/rebar.config.script36
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}]},