D.H.Q的烂笔头

Just code for fun~

Articles about: CentOS

CentOS(Fedora)下源代码编译安装 erlang 环境的 shell 脚本

填上 erlang 源代码下载地址(erl_url)和安装路径(prefix),然后执行这个 shell 脚本就行。

#!/bin/sh



erl_url="http://www.erlang.org/download/otp_src_R16B.tar.gz"

prefix="/usr/local/erlang" 


yum update -y
yum upgrade -y

#yum groupinstall -y "Development Tools" "Perl Support"
yum groupinstall -y "Development Tools"

yum install -y kernel-devel m4 fop ncurses-devel openssl-devel tk unixODBC unixODBC-devel

if [ ! -s "./erlang_otp.tar.gz" ]; then
    wget -c -O erlang_otp.tar.gz $erl_url
fi

tar zxvf erlang_otp.tar.gz
cd ./otp_src*/

./configure --prefix=$prefix --without-javac \
    --enable-kernel-poll \
    --enable-threads \
    --enable-dynamic-ssl-lib \
    --enable-shared-zlib \
    --enable-smp-support \
    --enable-hipe 

make && make install

#if [ ! -s "~/.bashrc" ]; then
#    touch ~/.bashrc
#fi
#echo 'export PATH="/usr/local/erlang/bin:$PATH"' >> ~/.bashrc
#source ~/.bashrc
ln -sfv $prefix/bin/* /usr/local/bin/

yum clean all

erl -noshell -eval "erlang:display('Erlang Success Install')" -s init stop

上面脚本在 CentOS 6.4 和 Fedora 17 下正常运行安装。

继续阅读 »
返回顶部