项目上客户使用的是ARM服务器,需要在编译Arm的Janus版本,记录下整个过程。
Janus在ARM环境下部署,编译时,通常会出现下面的错误。
./configure --prefix=/home/OV500/LB/ --disable-docs --libdir=/usr/lib64 --enable-libsrtp2 --enable-websockets --enable-data-channels --enable-rest --disable-rabbitmq --disable-mqtt checking for JANUS... no configure: error: Package requirements ("glib-2.0 >= 2.34 gio-2.0 >= 2.34 libconfig nice jansson >= 2.5 libssl >= 1.0.1 libcrypto zlib") were not met configure: error: Package requirements ("glib-2.0 >= 2.34 gio-2.0 >= 2.34 libconfig nice jansson >= 2.5 libssl >= 1.0.1 libcrypto zlib") were not met:
当然,主要还是缺少相关的基础环境配置。为了避免对系统产生影响,在docker中使用centos 9作为宿主环境进行编译。
主要思路是,使用一个centos9的容器,将Janus依赖的每一个包,都通过源码编译的方式进行安装。
1、容器 [root@localhost fs_work_share_dir]# docker pull quay.io/centos/centos:stream9 stream9: Pulling from centos/centos docker run -d --name centos9_1 -v /home/freeswitch/fs_work_share_dir/:/mnt/work --privileged=true -it 8bff730c2e73 /usr/bin/bash [root@8a60561dcdf7 sofia-sip-1.13.17]# cd .. 镜像修改为阿里云 安装基础软件: yum install -y git glib2-devel binutils gcc gcc-c++ libtool vim make wget alsa-lib-devel bison bzip2 \ curl-devel gnutls-devel libjpeg-devel\ libcurl-devel libedit-devel \ libtool \ libxml2-devel openssl-devel \ pcre-devel pkgconfig \ sqlite-devel libuuid-devel \ which zlib-devel libtiff-devel 2、janus安装 所有库的安装路径统一到/home/OV500/LB/ libnice yum install python3-pip 源码安装re2c autoreconf -i -W all ./configure make && make install [root@8a60561dcdf7 re2c]# pip3 install --user meson 安装ninja git clone git://github.com/ninja-build/ninja.git && cd ninja ./configure.py --bootstrap [root@8a60561dcdf7 ninja-master]# cp ninja /usr/sbin/ [root@8a60561dcdf7 ninja-master]# pwd /mnt/work/source/janus/libnice/re2c/ninja-master [root@8a60561dcdf7 glib-2.60.6]# 编译glib-2.0 ninja -C _build install /home/OV500/LB/lib64/include/glib-2.0/ #jasson源码安装 make build cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=/home/OV500/LB/ -DCMAKE_C_FLAGS="-fpic" #libnice安装 meson setup _build -Dprefix=/home/OV500/LB/ ninja -C _build install #安装libmicrohttpd [root@8a60561dcdf7 libmicrohttpd-0.9.75]# #安装libwebsocket git clone https://libwebsockets.org/repo/libwebsockets cd libwebsockets # If you want the stable version of libwebsockets, uncomment the next line # git checkout v4.3-stable mkdir build cd build #安装 opus [root@8a60561dcdf7 opus-1.5.2]# pwd /mnt/work/source/janus/opus-1.5.2 [root@8a60561dcdf7 opus-1.5.2]# cd .. #安装 paho.mqtt,注意如果没有安装openssl,则不会生成3as的so文件,需要修改janus的依赖makefile [root@8a60561dcdf7 janus]# cd paho.mqtt.c-master [root@8a60561dcdf7 paho.mqtt.c-master]# #安装 libogg [root@8a60561dcdf7 libogg-1.3.5]# make install 安装完了之后,修改PKG_CONFIG_PATH export PKG_CONFIG_PATH=/home/OV500/LB/zlm/lib/:/home/OV500/LB/lib/pkgconfig/: /home/OV500/LB/lib64/pkgconfig/:/usr/lib64/pkgconfig/:/mnt/work/OV500/lib/pkgconfig/: /mnt/work/OV500/LB/lib/pkgconfig/:/mnt/work/OV500/LB/lib64/pkgconfig/:$PKG_CONFIG_PATH 执行ldconfig,然后安装janus。 ./configure --prefix=/home/OV500/LB/ --disable-docs --libdir=/usr/lib64 --enable-libsrtp2 --enable-websockets --enable-data-channels --enable-rest --disable-rabbitmq --disable-mqtt
安装janus成功。
去掉某个告警:GCC_DIAG_OFF(array-bounds)
-------------------广告线---------------
项目、合作,欢迎勾搭,邮箱:promall@qq.com
本文为呱牛笔记原创文章,转载无需和我联系,但请注明来自呱牛笔记 ,it3q.com