大家都有一个经历,经过漫长的编译后,各种报错,经过整理后,我总结出了以下无错步骤:
(一)安装编译所需要的环境包
yum install -y autoconf automake libtool gcc-c++ ncurses-devel make zlib-devel libjpeg-devel
(二)安装依赖包
yum install –y openssl-devel e2fsprogs-devel curl-devel pcre-devel speex-devel sqlite-devel
(三)安装libedit包
yum search libedit-del
yum install -y libedit-devel
(四)修改加载模块
在freeswitch下,vi modules.conf
将mod_enum前加#,注释掉该模块
(五)下载libyuv源码并编译
cd freeswitch/libs
git clone https://freeswitch.org/stash/scm/sd/libyuv.git
cd libyuv
make -f linux.mk CXXFLAGS="-fPIC -O2 -fomit-frame-pointer -Iinclude/"
make install
cp /usr/lib/pkgconfig/libyuv.pc /usr/lib64/pkgconfig/
(六)yasm汇编编译器安装
yasm下载:http://www.tortall.net/projects/yasm/releases/
yasm编译安装:
1 ./configure
2 make
3 make install
(七)下载libvpx源码并编译
cd ..
git clone https://freeswitch.org/stash/scm/sd/libvpx.git
cd libvpx
./configure --enable-pic --disable-static --enable-shared
make
make install
cp /usr/local/lib/pkgconfig/vpx.pc /usr/lib64/pkgconfig/
(八)下载opus并编译
cd ..
git clone https://freeswitch.org/stash/scm/sd/opus.git
cd opus
./autogen.sh
./configure
make
make install
cp /usr/local/lib/pkgconfig/opus.pc /usr/lib64/pkgconfig
(九)下载libpng并编译
cd ..
git clone https://freeswitch.org/stash/scm/sd/libpng.git
cd libpng
./configure
make
make install
cp /usr/local/lib/pkgconfig/libpng* /usr/lib64/pkgconfig/
(十)编译安装
./configure
make install