#!/bin/sh
# @function install Erlang
function InstallErlang()
{
    ShowResult "[green]正在安装Erlang... [/green]" 1
    
    # install
    eval cd ${_PATH_COMPILATION_} ${_SYS_SHOW_INSTALL_DETAILS_}
    eval rm -rf ./otp_src_* ${_SYS_SHOW_INSTALL_DETAILS_}
    eval tar zxvf ${_PATH_SOFTWARE_}/otp_src_* ${_SYS_SHOW_INSTALL_DETAILS_}
    eval cd otp_src_* ${_SYS_SHOW_INSTALL_DETAILS_}
    eval ./configure --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac ${_SYS_SHOW_INSTALL_DETAILS_}
    eval make ${_SYS_MAKE_EXT_} ${_SYS_SHOW_INSTALL_DETAILS_}
    eval make install ${_SYS_SHOW_INSTALL_DETAILS_}
    
    echo 'export PATH=$PATH:/usr/local/erlang/bin' >> /etc/profile
    . /etc/profile
    
    ShowStatus $?
}