Add support for mix to: ./configure --enable-rebar=mix

This commit is contained in:
Badlop 2021-07-15 21:31:31 +02:00
parent 1fd452dca9
commit 4c5641a648
2 changed files with 36 additions and 10 deletions

View File

@ -1,4 +1,5 @@
REBAR = @ESCRIPT@ @rebar@
MIX = @rebar@
INSTALL = @INSTALL@
SED = @SED@
ERL = @ERL@
@ -97,17 +98,38 @@ ifneq ($(INSTALLGROUP),)
G_USER=-g $(INSTALLGROUP)
endif
IS_REBAR3:=$(shell expr `$(REBAR) --version | awk -F '[ .]' '/rebar / {print $$2}'` '>=' 3)
ifeq "$(MIX)" "mix"
IS_REBAR:=6
else
IS_REBAR:=$(shell expr `$(REBAR) --version | awk -F '[ .]' '/rebar / {print $$2}'`)
endif
ifeq "$(IS_REBAR3)" "1"
ifeq "$(IS_REBAR)" "6"
REBAR=$(MIX)
SKIPDEPS=
LISTDEPS=deps.tree
UPDATEDEPS=deps.update
DEPSPATTERN="s/.*─ \([a-z0-9_]*\) .*/\1/p;"
DEPSBASE=_build
DEPSDIR=$(DEPSBASE)/dev/lib
GET_DEPS= deps.get
CONFIGURE_DEPS=
EBINDIR=$(DEPSDIR)/ejabberd/ebin
REBARREL=MIX_ENV=prod $(REBAR) release --overwrite
REBARDEV=MIX_ENV=dev $(REBAR) release --overwrite
else
ifeq "$(IS_REBAR)" "3"
SKIPDEPS=
LISTDEPS=tree
UPDATEDEPS=upgrade
DEPSPATTERN="s/ (.*//; /^ / s/.* \([a-z0-9_]*\).*/\1/p;"
DEPSBASE=_build
DEPSDIR=$(DEPSBASE)/default/lib
GET_DEPS= get-deps
CONFIGURE_DEPS=$(REBAR) configure-deps
EBINDIR=$(DEPSDIR)/ejabberd/ebin
REBARREL=as prod tar
REBARREL=$(REBAR) as prod tar
REBARDEV=REBAR_PROFILE=dev $(REBAR) release
else
SKIPDEPS=skip_deps=true
LISTDEPS=-q list-deps
@ -115,8 +137,12 @@ else
DEPSPATTERN="/ TAG / s/ .*// p; / REV / s/ .*// p; / BRANCH / s/ .*// p;"
DEPSBASE=deps
DEPSDIR=$(DEPSBASE)
GET_DEPS= get-deps
CONFIGURE_DEPS=$(REBAR) configure-deps
EBINDIR=ebin
REBARREL=generate
REBARREL=$(REBAR) generate
REBARDEV=
endif
endif
all: deps src
@ -127,10 +153,10 @@ $(DEPSDIR)/.got:
rm -rf $(DEPSDIR)/.got
rm -rf $(DEPSDIR)/.built
mkdir -p $(DEPSDIR)
$(REBAR) get-deps && :> $(DEPSDIR)/.got
$(REBAR) $(GET_DEPS) && :> $(DEPSDIR)/.got
$(DEPSDIR)/.built: $(DEPSDIR)/.got
$(REBAR) configure-deps
$(CONFIGURE_DEPS)
$(REBAR) compile && :> $(DEPSDIR)/.built
src: $(DEPSDIR)/.built
@ -360,19 +386,19 @@ distclean: clean clean-rel
[ ! -f ../ChangeLog ] || rm -f ../ChangeLog
rel:
$(REBAR) $(REBARREL)
$(REBARREL)
DEV_CONFIG = _build/dev/rel/ejabberd/etc/ejabberd/ejabberd.yml
dev $(DEV_CONFIG):
REBAR_PROFILE=dev rebar3 release
$(REBARDEV)
TAGS:
etags *.erl
Makefile: Makefile.in
ifeq "$(IS_REBAR3)" "1"
ifeq "$(IS_REBAR)" "3"
dialyzer:
$(REBAR) dialyzer
else

View File

@ -30,7 +30,7 @@ fi
AC_ARG_WITH(rebar,
AC_HELP_STRING([--with-rebar=bin],
[use rebar specified]),
[use the rebar/rebar3/mix binary specified]),
[if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_rebar" = "X"; then
rebar="rebar"
else