Skip to content

Commit

Permalink
Generate enabled_backends in ejabberd.app instead of configure (#3549)
Browse files Browse the repository at this point in the history
Passing a list of atoms in vars.config.in (introduced in 3c16f21)
breaks rebar2 in "make rel"
  • Loading branch information
badlop committed Mar 15, 2021
1 parent 8b78d27 commit 14c8e12
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
12 changes: 0 additions & 12 deletions configure.ac
Expand Up @@ -283,17 +283,6 @@ case "`uname`" in
;;
esac

enabled_backends=""
for backend in odbc mysql pgsql sqlite redis mssql; do
if eval test x\${$backend} = xtrue; then
if test "x$enabled_backends" = "x"; then
enabled_backends=$backend
else
enabled_backends="$enabled_backends, $backend"
fi
fi
done

AC_SUBST(roster_gateway_workaround)
AC_SUBST(new_sql_schema)
AC_SUBST(full_xml)
Expand All @@ -317,6 +306,5 @@ AC_SUBST(system_deps)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(enabled_backends)

AC_OUTPUT
4 changes: 3 additions & 1 deletion src/ejabberd.app.src.script
@@ -1,8 +1,10 @@
Vars = case file:consult(filename:join([filename:dirname(SCRIPT), "..", "vars.config"])) of
{ok, Terms} ->
Backends = [mssql, mysql, odbc, pgsql, redis, sqlite],
EBs = lists:filter(fun(Backend) -> lists:member({Backend, true}, Terms) end, Backends),
[lists:keyfind(description, 1, Terms),
lists:keyfind(vsn, 1, Terms),
{env, [lists:keyfind(enabled_backends, 1, Terms)]}
{env, [{enabled_backends, EBs}]}
];
_Err ->
[]
Expand Down
1 change: 0 additions & 1 deletion vars.config.in
Expand Up @@ -46,7 +46,6 @@

%% Variables for overlay template files
{description, "@PACKAGE_NAME@"}.
{enabled_backends, [@enabled_backends@]}.

%% Platform-specific installation paths
{release, true}.
Expand Down

0 comments on commit 14c8e12

Please sign in to comment.