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

Run the corresponding configure scripts by ourselves

This commit is contained in:
Evgeniy Khramtsov 2013-05-08 13:32:18 +10:00
parent cf11acc450
commit 50b8500bd5
2 changed files with 34 additions and 5 deletions

View File

@ -68,9 +68,9 @@ else
INIT_USER=$(INSTALLUSER)
endif
all: deps/% src
all: deps src
deps/%:
deps:
$(REBAR) get-deps
src:

View File

@ -35,8 +35,6 @@ Macros = lists:flatmap(
[{d, 'ENABLE_FLASH_HACK'}];
({transient_supervisors, true}) ->
[{d, 'NO_TRANSIENT_SUPERVISORS'}];
({full_xml, true}) ->
[{d, 'FULL_XML_SUPPORT'}];
({nif, true}) ->
[{d, 'NIF'}];
({db_type, mssql}) ->
@ -76,6 +74,25 @@ Deps = [{logger, ".*", {git, "git://github.com/processone/p1_logger"}},
{xml, ".*", {git, "git://github.com/processone/xml"}},
{xmlrpc, ".*", {git, "git://github.com/etnt/xmlrpc"}}],
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";
(_, Acc) ->
Acc
end, "", Cfg),
PostHooks = [ConfigureCmd("tls", ""),
ConfigureCmd("stringprep", ""),
ConfigureCmd("xml", XMLFlags)],
CfgDeps = lists:flatmap(
fun({mysql, true}) ->
[{mysql, ".*", {git, "git://github.com/processone/mysql"}}];
@ -100,11 +117,23 @@ CfgDeps = lists:flatmap(
[]
end, Cfg),
CfgPostHooks = lists:flatmap(
fun({pam, true}) ->
[ConfigureCmd("epam", "")];
({zlib, true}) ->
[ConfigureCmd("ezlib", "")];
({iconv, true}) ->
[ConfigureCmd("iconv", "")];
(_) ->
[]
end, Cfg),
Config = [{erl_opts, Includes ++ Macros ++ HiPE ++ DebugInfo},
{src_dirs, [asn1, src | SrcDirs]},
{sub_dirs, ["rel"]},
{post_hooks, PostHooks ++ CfgPostHooks},
{deps, Deps ++ CfgDeps}],
io:format("dynamic configuration:~n ~p~n", [Config]),
io:format("ejabberd configuration:~n ~p~n", [Config]),
Config.
%% Local Variables: