aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2015-03-11 14:35:01 +0100
committerChristophe Romain <christophe.romain@process-one.net>2015-03-11 14:35:01 +0100
commitc9b82ff1e5e38a2f23d06260c1b68da5e5dd0c58 (patch)
tree11b29342387805fb7563a35976c38c1328291bf0 /src
parentAdd packaging support for contributed modules (diff)
Compile contributed module with lager if enabled in ejabberd
Diffstat (limited to 'src')
-rw-r--r--src/ext_mod.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ext_mod.erl b/src/ext_mod.erl
index 9b1862f99..3e6995f76 100644
--- a/src/ext_mod.erl
+++ b/src/ext_mod.erl
@@ -443,9 +443,14 @@ compile(_Module, _Spec, DestDir) ->
filelib:ensure_dir(filename:join(Ebin, ".")),
EjabBin = filename:dirname(code:which(ejabberd)),
EjabInc = filename:join(filename:dirname(EjabBin), "include"),
+ Logger = case code:is_loaded(lager) of
+ {file, _} -> [{d, 'LAGER'}];
+ _ -> []
+ end,
Options = [{outdir, Ebin}, {i, "include"}, {i, EjabInc},
{d, 'NO_EXT_LIB'}, %% use include instead of include_lib
- verbose, report_errors, report_warnings],
+ verbose, report_errors, report_warnings]
+ ++ Logger,
Result = [case compile:file(File, Options) of
{ok, _} -> ok;
{ok, _, _} -> ok;