25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Merge branch 'master' of github.com:processone/ejabberd

This commit is contained in:
Christophe Romain 2015-12-16 13:01:12 +01:00
commit 5ffdfdd95d
4 changed files with 19 additions and 20 deletions

View File

@ -100,10 +100,10 @@ AC_ARG_ENABLE(mssql,
esac],[db_type=generic]) esac],[db_type=generic])
AC_ARG_ENABLE(all, AC_ARG_ENABLE(all,
[AC_HELP_STRING([--enable-all], [same as --enable-nif --enable-odbc --enable-mysql --enable-pgsql --enable-sqlite --enable-pam --enable-zlib --enable-riak --enable-redis --enable-elixir --enable-iconv --enable-debug --enable-lager --enable-tools (useful for Dialyzer checks, default: no)])], [AC_HELP_STRING([--enable-all], [same as --enable-odbc --enable-mysql --enable-pgsql --enable-sqlite --enable-pam --enable-zlib --enable-riak --enable-redis --enable-elixir --enable-iconv --enable-debug --enable-lager --enable-tools (useful for Dialyzer checks, default: no)])],
[case "${enableval}" in [case "${enableval}" in
yes) nif=true odbc=true mysql=true pgsql=true sqlite=true pam=true zlib=true riak=true redis=true elixir=true iconv=true debug=true lager=true tools=true ;; yes) odbc=true mysql=true pgsql=true sqlite=true pam=true zlib=true riak=true redis=true elixir=true iconv=true debug=true lager=true tools=true ;;
no) nif=false odbc=false mysql=false pgsql=false sqlite=false pam=false zlib=false riak=false redis=false elixir=false iconv=false debug=false lager=false tools=false ;; no) odbc=false mysql=false pgsql=false sqlite=false pam=false zlib=false riak=false redis=false elixir=false iconv=false debug=false lager=false tools=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;;
esac],[]) esac],[])
@ -115,14 +115,6 @@ AC_ARG_ENABLE(tools,
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
esac],[if test "x$tools" = "x"; then tools=false; fi]) esac],[if test "x$tools" = "x"; then tools=false; fi])
AC_ARG_ENABLE(nif,
[AC_HELP_STRING([--enable-nif], [replace some functions with C equivalents. Requires Erlang R13B04 or higher (default: no)])],
[case "${enableval}" in
yes) nif=true ;;
no) nif=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-nif) ;;
esac],[if test "x$nif" = "x"; then nif=false; fi])
AC_ARG_ENABLE(odbc, AC_ARG_ENABLE(odbc,
[AC_HELP_STRING([--enable-odbc], [enable pure ODBC support (default: no)])], [AC_HELP_STRING([--enable-odbc], [enable pure ODBC support (default: no)])],
[case "${enableval}" in [case "${enableval}" in
@ -249,7 +241,6 @@ fi
AC_SUBST(hipe) AC_SUBST(hipe)
AC_SUBST(roster_gateway_workaround) AC_SUBST(roster_gateway_workaround)
AC_SUBST(full_xml) AC_SUBST(full_xml)
AC_SUBST(nif)
AC_SUBST(db_type) AC_SUBST(db_type)
AC_SUBST(odbc) AC_SUBST(odbc)
AC_SUBST(mysql) AC_SUBST(mysql)

12
plugins/deps_erl_opts.erl Normal file
View File

@ -0,0 +1,12 @@
-module(deps_erl_opts).
-export([preprocess/2]).
preprocess(Config, Dirs) ->
ExtraOpts = rebar_config:get(Config, deps_erl_opts, []),
Opts = rebar_config:get(Config, erl_opts, []),
NewOpts = lists:foldl(fun(Opt, Acc) when is_tuple(Opt) ->
lists:keystore(element(1, Opt), 1, Acc, Opt);
(Opt, Acc) ->
[Opt | lists:delete(Opt, Acc)]
end, Opts, ExtraOpts),
{ok, rebar_config:set(Config, erl_opts, NewOpts), []}.

View File

@ -19,8 +19,6 @@ Cfg = case file:consult("vars.config") of
Macros = lists:flatmap( Macros = lists:flatmap(
fun({roster_gateway_workaround, true}) -> fun({roster_gateway_workaround, true}) ->
[{d, 'ROSTER_GATEWAY_WORKAROUND'}]; [{d, 'ROSTER_GATEWAY_WORKAROUND'}];
({nif, true}) ->
[{d, 'NIF'}];
({db_type, mssql}) -> ({db_type, mssql}) ->
[{d, 'mssql'}]; [{d, 'mssql'}];
({lager, true}) -> ({lager, true}) ->
@ -76,9 +74,7 @@ ConfigureCmd = fun(Pkg, Flags) ->
end, end,
XMLFlags = lists:foldl( XMLFlags = lists:foldl(
fun({nif, true}, Acc) -> fun({full_xml, true}, Acc) ->
Acc ++ " --enable-nif";
({full_xml, true}, Acc) ->
Acc ++ " --enable-full-xml"; Acc ++ " --enable-full-xml";
(_, Acc) -> (_, Acc) ->
Acc Acc
@ -157,10 +153,10 @@ CfgXrefs = lists:flatmap(
ElixirConfig = case lists:keysearch(elixir, 1, Cfg) of ElixirConfig = case lists:keysearch(elixir, 1, Cfg) of
{value, {elixir, true}} -> {value, {elixir, true}} ->
[{plugins, [rebar_elixir_compiler, rebar_exunit] }, [{plugins, [deps_erl_opts, rebar_elixir_compiler, rebar_exunit] },
{lib_dirs, ["deps/elixir/lib"]}]; {lib_dirs, ["deps/elixir/lib"]}];
_ -> _ ->
[] [{plugins, [deps_erl_opts]}]
end, end,
{ok, Cwd} = file:get_cwd(), {ok, Cwd} = file:get_cwd(),
@ -181,6 +177,7 @@ AllDeps = case lists:keytake(lager, 1, AllDeps0) of
Config = [{erl_opts, Macros ++ HiPE ++ DebugInfo ++ Config = [{erl_opts, Macros ++ HiPE ++ DebugInfo ++
[{src_dirs, [asn1, src | SrcDirs]}]}, [{src_dirs, [asn1, src | SrcDirs]}]},
{deps_erl_opts, HiPE},
{sub_dirs, ["rel"]}, {sub_dirs, ["rel"]},
{keep_build_info, true}, {keep_build_info, true},
{ct_extra_params, "-ct_hooks cth_surefire " {ct_extra_params, "-ct_hooks cth_surefire "

View File

@ -9,7 +9,6 @@
%% Macros %% Macros
{roster_gateway_workaround, @roster_gateway_workaround@}. {roster_gateway_workaround, @roster_gateway_workaround@}.
{full_xml, @full_xml@}. {full_xml, @full_xml@}.
{nif, @nif@}.
{db_type, @db_type@}. {db_type, @db_type@}.
{debug, @debug@}. {debug, @debug@}.
{hipe, @hipe@}. {hipe, @hipe@}.