diff --git a/mix.exs b/mix.exs index 6d50b2ce2..4200325ce 100644 --- a/mix.exs +++ b/mix.exs @@ -71,6 +71,7 @@ defmodule Ejabberd.Mixfile do if_version_below('23', [{:d, :USE_OLD_CRYPTO_HMAC}]) ++ if_version_below('23', [{:d, :USE_OLD_PG2}]) ++ if_version_below('24', [{:d, :COMPILER_REPORTS_ONLY_LINES}]) ++ + if_version_below('24', [{:d, :SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL}]) ++ if_function_exported(:erl_error, :format_exception, 6, [{:d, :HAVE_ERL_ERROR}]) defines = for {:d, value} <- result, do: {:d, value} result ++ [{:d, :ALL_DEFS, defines}] diff --git a/rebar.config b/rebar.config index 054660337..81f3dc84c 100644 --- a/rebar.config +++ b/rebar.config @@ -100,6 +100,7 @@ {if_version_below, "23", {d, 'USE_OLD_CRYPTO_HMAC'}}, {if_version_below, "23", {d, 'USE_OLD_PG2'}}, {if_version_below, "24", {d, 'COMPILER_REPORTS_ONLY_LINES'}}, + {if_version_below, "24", {d, 'SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL'}}, {if_var_match, db_type, mssql, {d, 'mssql'}}, {if_var_false, debug, no_debug_info}, {if_var_true, debug, debug_info}, diff --git a/src/ejabberd_update.erl b/src/ejabberd_update.erl index 7785b6084..8cb8c0510 100644 --- a/src/ejabberd_update.erl +++ b/src/ejabberd_update.erl @@ -148,6 +148,7 @@ build_script(Dir, UpdatedBeams) -> {Script, LowLevelScript, Check1}. %% Copied from Erlang/OTP file: lib/sasl/src/systools.hrl +-ifdef(SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL). -record(application, {name, %% Name of the application, atom(). type = permanent, %% Application start type, atom(). @@ -177,6 +178,40 @@ build_script(Dir, UpdatedBeams) -> dir = "" %% The directory where the .app file was %% found (internal use). }). +-else. +-record(application, + {name, %% Name of the application, atom(). + type = permanent, %% Application start type, atom(). + vsn = "", %% Version of the application, string(). + id = "", %% Id of the application, string(). + description = "", %% Description of application, string(). + modules = [], %% [Module | {Module,Vsn}] of modules + %% incorporated in the application, + %% Module = atom(), Vsn = string(). + uses = [], %% [Application] list of applications required + %% by the application, Application = atom(). + optional = [], %% [Application] list of applications in uses + %% that are optional, Application = atom(). + includes = [], %% [Application] list of applications included + %% by the application, Application = atom(). + regs = [], %% [RegNames] a list of registered process + %% names used by the application, RegNames = + %% atom(). + env = [], %% [{Key,Value}] environment variable of + %% application, Key = Value = term(). + maxT = infinity, %% Max time an application may exist, + %% integer() | infinity. + maxP = infinity, %% Max number of processes in an application, + %% integer() | infinity. + mod = [], %% [] | {Mod, StartArgs}, Mod= atom(), + %% StartArgs = list(). + start_phases, %% [{Phase, PhaseArgs}] | undefined, + %% Phase = atom(), + %% PhaseArgs = list(). + dir = "" %% The directory where the .app file was + %% found (internal use). + }). +-endif. make_script(UpdatedBeams) ->