netbsd中源码安装erlang

阅读更多
1.下载源码包
wget http://www.erlang.org/download/otp_src_R16B.tar.gz
tar -xzvf otp_src_R16B.tar.gz
2.由于netbsd虽然支持mremap,但不支持MREMAP_MAYMOVE,所以要对源码作一点修改,打开erts\emulator\sys\common\erl_mseg.c,修改其中的
#if defined(__NetBSD__)
new_seg = mremap(old_seg, (size_t)old_size, NULL, new_size, MREMAP_FLAGS);
为#if defined(__NetBSD__)
new_seg = mremap(old_seg, (size_t)old_size, NULL, new_size, 0);
不然会出现以下的错误信息
common/erl_mseg.c:484:62: error: 'MREMAP_MAYMOVE' undeclared (first use in this function)
sys/common/erl_mseg.c:484:62: note: each undeclared identifier is reported only once for each function it appears in
gmake[3]: *** [obj/i386-unknown-netbsdelf6.0.1/opt/smp/erl_mseg.o] Error 1
gmake[3]: Leaving directory `/home/admin/otp_src_R16B/erts/emulator'
gmake[2]: *** [opt] Error 2
gmake[2]: Leaving directory `/home/admin/otp_src_R16B/erts/emulator'
gmake[1]: *** [smp] Error 2
gmake[1]: Leaving directory `/home/admin/otp_src_R16B/erts'
gmake: *** [emulator] Error 2
3.编译安装
当然首先要安装gmake,bsd中的make不是gmake
余下就按步就班了
./configure
gmake
gmake install
gmake clean

完成后enjoy 一下吧
erl -sname myserver

你可能感兴趣的:(erlang,netbsd)