couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [1/5] couch commit: updated refs/heads/import to 68f9777
Date Wed, 05 Feb 2014 04:25:15 GMT
Updated Branches:
  refs/heads/import cee3471cf -> 68f977782


Check for configure settings to enable cURL


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/783326a9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/783326a9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/783326a9

Branch: refs/heads/import
Commit: 783326a985e0e3f59bf67dfb05a1d5d5fd12b5da
Parents: cee3471
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Tue Feb 4 22:08:06 2014 -0600
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Tue Feb 4 22:08:06 2014 -0600

----------------------------------------------------------------------
 rebar.config.script | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/783326a9/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index 8e7c8e6..88483e8 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -19,6 +19,13 @@ end,
 CouchJSPath = filename:join(["priv", CouchJSName]),
 Version = string:strip(os:cmd("git describe --always"), right, $\n),
 
+CouchConfig = case filelib:is_file(os:getenv("COUCHDB_CONFIG")) of
+    true ->
+        {ok, Result} = file:consult(os:getenv("COUCHDB_CONFIG")),
+        Result;
+    false ->
+        []
+end.
 
 ConfigH = [
     {"SM185", ""},
@@ -35,15 +42,21 @@ ConfigH = [
 ConfigSrc = [["#define ", K, " ", V, $\n] || {K, V} <- ConfigH],
 ok = file:write_file("priv/couch_js/config.h", ConfigSrc),
 
-JS_LDFLAGS = "-lmozjs185 -DWITHOUTCURL",
+{JS_CFLAGS, JS_LDFLAGS} = case lists:keyfind(with_curl, 1, CouchConfig) of
+    {with_curl, true} ->
+        {"-DHAVE_CURL ", "-DHAVE_CURL -lmozjs185 -lcurl"};
+    _ ->
+        {"", "-lmozjs185"}
+end,
+
 CouchJSSrc = ["priv/couch_js/{help,http,main,utf8,util}.c"],
 
 BaseSpecs = [
         %% couchjs
-        {"darwin", CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", "-DXP_UNIX -I/usr/local/include/js"},
{"LDFLAGS", JS_LDFLAGS}]}]},
-        {"linux",  CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", "-DXP_UNIX -I/usr/include/js"},
{"LDFLAGS", JS_LDFLAGS ++ " -lm"}]}]},
-        {"unix",   CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", "-DXP_UNIX -I/usr/local/include/js}"},
{"LDFLAGS", JS_LDFLAGS ++ " -lm"}]}]},
-        {"win32",  CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", "-DXP_WIN -I/usr/include/js"},
{"LDFLAGS", JS_LDFLAGS}]}]},
+        {"darwin", CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ "-DXP_UNIX -I/usr/local/include/js"},
{"LDFLAGS", JS_LDFLAGS}]}]},
+        {"linux",  CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ "-DXP_UNIX -I/usr/include/js"},
{"LDFLAGS", JS_LDFLAGS ++ " -lm"}]}]},
+        {"unix",   CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ "-DXP_UNIX -I/usr/local/include/js}"},
{"LDFLAGS", JS_LDFLAGS ++ " -lm"}]}]},
+        {"win32",  CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ "-DXP_WIN -I/usr/include/js"},
{"LDFLAGS", JS_LDFLAGS}]}]},
         % ICU
         {"", "priv/couch_icu_driver.so", ["priv/icu_driver/*.c"], [{env, [
             {"DRV_CFLAGS",  "$DRV_CFLAGS -DPIC -O2 -fno-common"},


Mime
View raw message