金庆的专栏

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  423 随笔 :: 0 文章 :: 454 评论 :: 0 Trackbacks
Windows编译ejabberd

(金庆的专栏)

安装 erlang OTP. 添加路径到 PATH, 使 erl 可以运行。

git clone ejabberd

安装 rebar:
git clone git@github.com:rebar/rebar.git

E:\Git\rebar>bootstrap.bat
escript: exception error: no match of right hand side value "找不到 E:\\Git\\reb
ar\\ebin\\rebar.beam\r\n"


先创建 ebin\rebar.beam。见:https://github.com/rebar/rebar/issues/613

复制生成的 rebar.cmd 到 ejabberd 目录。其实就几行代码:
setlocal
set rebarscript=%~f0
escript.exe "%rebarscript:.cmd=%" %*

rebar.cmd get-deps

Cloning into 'p1_xmlrpc'...
Pulling luerl from {git,"https://github.com/rvirding/luerl",{tag,"v0.2"}}
Cloning into 'luerl'...
'sh' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
ERROR: Command ['get-deps'] failed!


更改 rebar.config.script,去除sh, 改为
{'get-deps', ""}

将 ejabberd.app.src.in 复制为 ejabberd.app.src,更改其中的变量,
E:\Git\ejabberd>rebar compile skip_deps=true
==> rel (compile)
==> ejabberd (compile)


deps 没有编译,可以使用安装包。
只需替换有更新的beam文件到安装目录。

补充:
E:\Git\ejabberd_jinq0123>rebar compile skip_deps=true
==> rel (compile)
==> ejabberd_jinq0123 (compile)
Compiled asn1/XmppAddr.asn1
Compiled src/eldap_filter_yecc.yrl
e:/Git/ejabberd_jinq0123/src/ejabberd_config.erl:none: undefined parse transform
 'lager_transform'
ERROR: compile failed while processing E:/Git/ejabberd_jinq0123: rebar_abort

须先用 rebar compile 编译 lager. 其他无法编译的可忽略,然后再
rebar compile skip_deps=true
posted on 2016-08-16 19:43 金庆 阅读(603) 评论(0)  编辑 收藏 引用 所属分类: 7. Erlang

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理