24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-12 21:52:07 +02:00
xmpp.chapril.org-ejabberd/rebar.config.script

132 lines
4.7 KiB
Plaintext
Raw Normal View History

2013-05-01 15:22:26 +02:00
%%%-------------------------------------------------------------------
%%% @author Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%% @copyright (C) 2013, Evgeniy Khramtsov
%%% @doc
%%%
%%% @end
%%% Created : 1 May 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%-------------------------------------------------------------------
2013-05-09 11:05:35 +02:00
Cfg = case file:consult("vars.config") of
{ok, Terms} ->
Terms;
_Err ->
[]
end,
2013-05-02 10:15:03 +02:00
2013-05-01 15:22:26 +02:00
Macros = lists:flatmap(
fun({roster_gateway_workaround, true}) ->
[{d, 'ROSTER_GATEWAY_WORKAROUND'}];
({flash_hack, true}) ->
[{d, 'ENABLE_FLASH_HACK'}];
({transient_supervisors, true}) ->
[{d, 'NO_TRANSIENT_SUPERVISORS'}];
({nif, true}) ->
[{d, 'NIF'}];
({db_type, mssql}) ->
[{d, 'mssql'}];
(_) ->
[]
end, Cfg),
2013-05-02 10:15:03 +02:00
DebugInfo = case lists:keysearch(debug, 1, Cfg) of
{value, {debug, true}} ->
[debug_info];
_ ->
[]
end,
2013-05-02 10:29:40 +02:00
HiPE = case lists:keysearch(hipe, 1, Cfg) of
{value, {hipe, true}} ->
[native];
_ ->
[]
end,
Includes = [{i, "include"},
2013-05-15 09:33:49 +02:00
{i, filename:join(["deps", "p1_xml", "include"])}],
2013-05-02 10:29:40 +02:00
SrcDirs = lists:foldl(
fun({pubsub_ng, true}, Acc) ->
[mod_pubsub_ng|Acc];
2013-05-12 06:13:16 +02:00
({tools, true}, Acc) ->
[tools|Acc];
2013-05-02 10:29:40 +02:00
(_, Acc) ->
Acc
end, [], Cfg),
2013-05-02 10:15:03 +02:00
Deps = [{p1_logger, ".*", {git, "git://github.com/processone/p1_logger"}},
2013-05-15 09:33:49 +02:00
{p1_cache_tab, ".*", {git, "git://github.com/processone/cache_tab"}},
{p1_tls, ".*", {git, "git://github.com/processone/tls"}},
{p1_stringprep, ".*", {git, "git://github.com/processone/stringprep"}},
{p1_xml, ".*", {git, "git://github.com/processone/xml"}},
2013-05-09 12:57:27 +02:00
{xmlrpc, ".*", {git, "git://github.com/rds13/xmlrpc"}}],
2013-05-02 10:15:03 +02:00
ConfigureCmd = fun(Pkg, Flags) ->
{'get-deps',
"sh -c 'cd deps/" ++ Pkg ++
" && ./configure" ++ Flags ++ "'"}
end,
XMLFlags = lists:foldl(
fun({nif, true}, Acc) ->
Acc ++ " --enable-nif";
({full_xml, true}, Acc) ->
Acc ++ " --enable-full-xml";
({flash_hack, true}, Acc) ->
Acc ++ " --enable-flash-hack";
(_, Acc) ->
Acc
end, "", Cfg),
2013-05-15 09:33:49 +02:00
PostHooks = [ConfigureCmd("p1_tls", ""),
ConfigureCmd("p1_stringprep", ""),
ConfigureCmd("p1_xml", XMLFlags)],
2013-05-01 15:22:26 +02:00
CfgDeps = lists:flatmap(
fun({mysql, true}) ->
2013-05-15 09:33:49 +02:00
[{p1_mysql, ".*", {git, "git://github.com/processone/mysql"}}];
2013-05-01 15:22:26 +02:00
({pgsql, true}) ->
2013-05-15 09:33:49 +02:00
[{p1_pgsql, ".*", {git, "git://github.com/processone/pgsql"}}];
2013-05-01 15:22:26 +02:00
({pam, true}) ->
2013-05-15 09:33:49 +02:00
[{p1_pam, ".*", {git, "git://github.com/processone/epam"}}];
2013-05-01 15:22:26 +02:00
({zlib, true}) ->
2013-05-15 09:33:49 +02:00
[{p1_zlib, ".*", {git, "git://github.com/processone/zlib"}}];
2013-05-01 15:22:26 +02:00
({stun, true}) ->
2013-05-15 09:33:49 +02:00
[{p1_stun, ".*", {git, "git://github.com/processone/stun"}}];
2013-05-01 15:22:26 +02:00
({riak, true}) ->
[{riakc, ".*", {git, "git://github.com/basho/riak-erlang-client"}}];
({json, true}) ->
[{jiffy, ".*", {git, "git://github.com/davisp/jiffy"}}];
2013-05-01 15:35:01 +02:00
({iconv, true}) ->
2013-05-15 09:33:49 +02:00
[{p1_iconv, ".*", {git, "git://github.com/processone/eiconv"}}];
({http, true}) ->
[{ibrowse, ".*", {git, "git://github.com/cmullaparthi/ibrowse"}},
{lhttpc, ".*", {git, "git://github.com/esl/lhttpc"}}];
2013-05-01 15:22:26 +02:00
(_) ->
[]
end, Cfg),
2013-05-02 10:15:03 +02:00
CfgPostHooks = lists:flatmap(
fun({pam, true}) ->
2013-05-15 09:33:49 +02:00
[ConfigureCmd("p1_pam", "")];
({zlib, true}) ->
2013-05-15 09:33:49 +02:00
[ConfigureCmd("p1_zlib", "")];
({iconv, true}) ->
2013-05-15 09:33:49 +02:00
[ConfigureCmd("p1_iconv", "")];
(_) ->
[]
end, Cfg),
Config = [{erl_opts, Includes ++ Macros ++ HiPE ++ DebugInfo ++
[{src_dirs, [asn1, src | SrcDirs]}]},
2013-05-02 12:27:53 +02:00
{sub_dirs, ["rel"]},
{post_hooks, PostHooks ++ CfgPostHooks},
2013-05-02 12:27:53 +02:00
{deps, Deps ++ CfgDeps}],
2013-05-09 03:56:01 +02:00
%%io:format("ejabberd configuration:~n ~p~n", [Config]),
2013-05-02 12:27:53 +02:00
Config.
2013-05-01 15:22:26 +02:00
%% Local Variables:
%% mode: erlang
%% End:
%% vim: set filetype=erlang tabstop=8: