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

Use Mix or Rebar3 by default instead of Rebar2 to compile ejabberd

Use the program specified in option: --with-rebar=/path/to/bin
When none is specified, use the system mix
When Elixir not found, use the system rebar3
When Rebar3 not found, use the rebar3 binary included with ejabberd
This commit is contained in:
Badlop 2023-12-26 19:23:21 +01:00
parent dd5a198222
commit 0d852474be
2 changed files with 22 additions and 4 deletions

View File

@ -89,7 +89,7 @@ Build an OTP Release
Instead of installing ejabberd in the system, you can build an OTP release Instead of installing ejabberd in the system, you can build an OTP release
that includes all necessary to run ejabberd in a subdirectory: that includes all necessary to run ejabberd in a subdirectory:
./configure --with-rebar=rebar3 ./configure
make rel make rel
Or, if you have Elixir available and plan to develop Elixir code: Or, if you have Elixir available and plan to develop Elixir code:

View File

@ -28,18 +28,34 @@ fi
]) ])
AC_ARG_WITH(rebar, AC_ARG_WITH(rebar,
AS_HELP_STRING([--with-rebar=bin],[use the rebar/rebar3/mix binary specified]), AS_HELP_STRING([--with-rebar=bin],[use as build tool the rebar/rebar3/mix binary specified]),
[if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_rebar" = "X"; then [if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_rebar" = "X"; then
rebar="rebar" rebar="rebar3"
else else
rebar="$with_rebar" rebar="$with_rebar"
fi fi
], [rebar="rebar"]) ], [rebar="unconfigured"])
AC_PATH_TOOL(ERL, erl, , [${extra_erl_path}$PATH]) AC_PATH_TOOL(ERL, erl, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(ERLC, erlc, , [${extra_erl_path}$PATH]) AC_PATH_TOOL(ERLC, erlc, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(EPMD, epmd, , [${extra_erl_path}$PATH]) AC_PATH_TOOL(EPMD, epmd, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(REBAR3, rebar3, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(ELIXIR, elixir, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(IEX, iex, , [${extra_erl_path}$PATH]) AC_PATH_TOOL(IEX, iex, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(MIX, mix, , [${extra_erl_path}$PATH])
if test "$rebar" = unconfigured; then
if test "x$ELIXIR" = "x" -o "x$IEX" = "x" -o "x$MIX" = "x"; then
if test "x$REBAR3" = "x"; then
rebar="rebar3"
else
rebar=$REBAR3
fi
else
rebar=$MIX
fi
fi
AC_ERLANG_NEED_ERL AC_ERLANG_NEED_ERL
AC_ERLANG_NEED_ERLC AC_ERLANG_NEED_ERLC
@ -281,6 +297,8 @@ case "`uname`" in
;; ;;
esac esac
AC_MSG_RESULT([build tool to use (change using --with-rebar): $rebar])
AC_SUBST(roster_gateway_workaround) AC_SUBST(roster_gateway_workaround)
AC_SUBST(new_sql_schema) AC_SUBST(new_sql_schema)
AC_SUBST(full_xml) AC_SUBST(full_xml)