aboutsummaryrefslogtreecommitdiffstats
path: root/rebar.config.script
diff options
context:
space:
mode:
authorEric B Merritt <[email protected]>2013-04-05 14:31:17 -0700
committerEric B Merritt <[email protected]>2013-04-05 14:31:29 -0700
commita96ae5dc597cbc01515c75fea9f41a6d79be91b3 (patch)
treebaeea4d5ff0d4ed6492d825e36a40c78aca83c4a /rebar.config.script
parenta55808420959bae0d9097ab97bc96e1fc4b4d19b (diff)
downloadrelx-a96ae5dc597cbc01515c75fea9f41a6d79be91b3.tar.gz
relx-a96ae5dc597cbc01515c75fea9f41a6d79be91b3.tar.bz2
relx-a96ae5dc597cbc01515c75fea9f41a6d79be91b3.zip
support both R14 'behaviours' and R15+ 'callback info'
Diffstat (limited to 'rebar.config.script')
-rw-r--r--rebar.config.script15
1 files changed, 15 insertions, 0 deletions
diff --git a/rebar.config.script b/rebar.config.script
new file mode 100644
index 0000000..c19a751
--- /dev/null
+++ b/rebar.config.script
@@ -0,0 +1,15 @@
+{match, [ErtsNumber]} = re:run(erlang:system_info(otp_release), "R(\\d+).+", [{capture, [1], list}]),
+ErtsVsn = erlang:list_to_integer(ErtsNumber),
+Opts1 = case lists:keysearch(erl_opts, 1, CONFIG) of
+ {value, {erl_opts, Opts0}} ->
+ Opts0;
+ false ->
+ []
+ end,
+Opts2 = if
+ ErtsVsn >= 15 ->
+ [{d, have_callback_support} | Opts1];
+ true ->
+ Opts1
+ end,
+lists:keystore(erl_opts, 1, CONFIG, {erl_opts, Opts2}).