summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Avdey <eiri@eiri.ca>2018-06-14 14:28:25 -0300
committerEric Avdey <eiri@eiri.ca>2018-06-14 14:28:25 -0300
commit41decfa06147bf48f9ac30121cbe9ec02c23d5c7 (patch)
tree9807e0fc4744883de16103226a9948d0689dd862
parentdfa878010b27379b278f33360f2a82b814c27883 (diff)
downloadcouchdb-41decfa06147bf48f9ac30121cbe9ec02c23d5c7.tar.gz
Allow custom compile options with env variable
-rw-r--r--Makefile2
-rw-r--r--rebar.config.script6
2 files changed, 4 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 3643eeb20..1e0ea8224 100644
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,7 @@ help:
.PHONY: couch
-# target: couch - Build CouchDB core
+# target: couch - Build CouchDB core, use ERL_OPTS to provide custom compiler's options
couch: config.erl
@COUCHDB_VERSION=$(COUCHDB_VERSION) $(REBAR) compile $(COMPILE_OPTS)
@cp src/couch/priv/couchjs bin/
diff --git a/rebar.config.script b/rebar.config.script
index f1a037b72..82f4d70b9 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -88,8 +88,8 @@ MakeDep = fun
end,
ErlOpts = case os:getenv("ERL_OPTS") of
- "bin_opt_info" -> [bin_opt_info, debug_info, {i, "../"}];
- Else -> [Else, {i, "../"}]
+ false -> [];
+ Opts -> [list_to_atom(O) || O <- string:tokens(Opts, ",")]
end,
AddConfig = [
@@ -98,7 +98,7 @@ AddConfig = [
{deps, lists:map(MakeDep, DepDescs)},
{sub_dirs, SubDirs},
{lib_dirs, ["src"]},
- {erl_opts, ErlOpts},
+ {erl_opts, [{i, "../"} | ErlOpts]},
{eunit_opts, [verbose]},
{plugins, [eunit_plugin]},
{dialyzer, [