wohali commented on a change in pull request #2345: port to spidermonkey 60
URL: https://github.com/apache/couchdb/pull/2345#discussion_r359098083
 
 

 ##########
 File path: src/couch/rebar.config.script
 ##########
 @@ -78,27 +90,69 @@ MD5Config = case lists:keyfind(erlang_md5, 1, CouchConfig) 
of
         []
 end,
 
-%% TODO support curl on Windows
-{JS_CFLAGS, JS_LDFLAGS} = case lists:keyfind(with_curl, 1, CouchConfig) of
+{JS_CFLAGS, JS_LDFLAGS} = case os:type() of
+    {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"
+        };
+    {unix, _} when SMVsn == "1.8.5" ->
+        {
+            "-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 mozjs-60.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.
+
+{CURL_CFLAGS, CURL_LDFLAGS} = case lists:keyfind(with_curl, 1, CouchConfig) of
     {with_curl, true} ->
         case os:type() of
             {win32, _} ->
-                {"/DHAVE_CURL /IC:\\relax\\curl\\include", 
"/LIBPATH:C:\\relax\\js-1.8.5\\js\\src 
/LIBPATH:C:\\Relax\\curl\\lib\\release-ssl mozjs185-1.0.lib libcurl_imp.lib"};
+                {
+                    "/DHAVE_CURL /IC:\\relax\\curl\\include",
+                    "/LIBPATH:C:\\Relax\\curl\\lib\\release-ssl 
libcurl_imp.lib"
+                };
             {unix, freebsd} ->
-                {"-DHAVE_CURL -I/usr/local/include", "-DHAVE_CURL -lmozjs185 
-lcurl"};
+                {
+                    "-DHAVE_CURL -I/usr/local/include",
+                    "-DHAVE_CURL -lcurl"
+                };
             _ ->
-                {"-DHAVE_CURL", "-DHAVE_CURL -lmozjs185 -lcurl"}
+                {
+                    "-DHAVE_CURL",
+                    "-DHAVE_CURL -lcurl"
+                }
 
 Review comment:
   These changes look right. If we've broken a platform we haven't tested (like 
freebsd) we can fix it before we release.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to