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

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

View File

@ -30,7 +30,7 @@ fi
AC_ARG_WITH(rebar, AC_ARG_WITH(rebar,
AC_HELP_STRING([--with-rebar=bin], 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 [if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_rebar" = "X"; then
rebar="rebar" rebar="rebar"
else else