最近由于工作需求要搭建freeswitch,整个过程比较纠结,遂总结于此留作备忘。
起源
由于我的需求是将freeswitch跑起来,所以先按照freeswitch wiki上的介绍编译freeswitch,但configure过程便遇到问题:
configure: error: OpenSSL >= 1.0.1e and associated developement headers required
很明显,系统的openssl版本过于古老, 而安装freeswitch的编译和运行需要openssl >= 1.0.0e,第一直觉就是先把openssl升级再说,无尽的折磨从此开始。
坑一:openssl编译
一般c项目的configure过程中会通过配置--prefix=xxx来设定被编译lib的安装目录,我一般习惯放到/usr/local/xxx,所以openssl也不例外,顺利安装到/usr/local/openssl-1.0.1h目录下,但freeswitch的configure还是一直提示openssl版本太低:
configure: error: OpenSSL >= 1.0.1e and associated developement headers required
不过很快意识到自己犯了个低级错误,编译默认搜索的header和lib还是系统自带的老版本openssl,于是在freeswitch的configure过程中显示设定openssl的相关路径:
./configure --prefix=/usr/local CFLAGS="-I/usr/local/openssl-1.0.1h/include" L