Linphone SDK MAC编译环境搭建

前些天,负责ios手机UI的同事为了适配ios的新特性,重装了MAC编译服务器的系统,以前搭建的 Linphone SDK 的编译环境没了,需要重新搭建SDK的编译环境。

一、从Git库上获取 Linphone SDK 的代码

从启动台打开终端,进入到桌面目录,新建一个 SDK 的目录作为工作目录。

用命令下载指定Git库和分支到本地,这里下载develop分支:
Git clone http://IP.PATH.git -b develop
进入下载好的代码目录,修改 ./git 目录为 ./git.backup
配置编译选项:
./prepare.py -d -DENABLE_NON_FREE_CODECS=ON -DENABLE_OPENH264=ON -DENABLE_VPX=OFF -DENABLE_ILBC=OFF -DENABLE_ZRTP=OFF -DENABLE_VCARD=OFF -DENABLE_LIM=OFF -DENABLE_NLS=OFF -DENABLE_MKV=OFF -DENABLE_ISAC=OFF -DENABLE_FFMPEG=ON devices
结果发现报错:
ERROR: Please install Java JDK (not just JRE).
ERROR: iOS SDK not found, please install Xcode from AppStore or equivalent.
ERROR: The following binaries are missing: convert doxygen cmake intltoolize yasm automake ginstall wget optipng autoconf pkg-config. Please install them using:
brew install imagemagick doxygen cmake intltool yasm automake coreutils wget optipng autoconf pkg-config

二、MAC安装Java JDK

ERROR: Please install Java JDK (not just JRE).
从oracle公司官网下载Java18,根据MAC电脑提示安装,它会自动帮你配置环境变量

三、配置Xcode环境

xcode ERROR: iOS SDK not found, please install Xcode from AppStore or equivalent
这个保持报错是找不到iOS SDK,其实这台MAC已经安装好了Xcode了,我们在命令行中输入:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

四、安装homebrew

在终端中输入安装编译依赖:
brew install imagemagick doxygen cmake intltool yasm automake coreutils wget optipng autoconf pkg-config
此时MAC会保持说找不到brew,需要自行安装homebrew;
Homebrew就是一个macOS(或Linux)的包管理器,可以用它来安装你需要的软件,方便卸载跟升级。此时用官网提供的统一安装方法,执行如下命:
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
发现报错:
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

安装失败看下能不能连接上,在浏览器中输入https://raw.githubusercontent.com/Homebrew/install/master/install
复制浏览器获取到的内容,在电脑中新建文件brew_install,把内容复制进去,保存。
把brew_install文件里面的地址换成国内源提高安装速度,否则会安装失败,
#BREW_REPO = “https://github.com/Homebrew/brew”.freeze
BREW_REPO = “git://mirrors.ustc.edu.cn/brew.git”.freeze
执行命令进行安装:
/usr/bin/ruby ~/brew_install
等待安装,一段时间后发现安装卡住了
==> Tapping homebrew/core
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…
直接关掉命令窗口Terminal,然后进入下面的 Taps 目录,clone homebrew-core
cd /usr/local/Homebrew/Library/Taps/homebrew
git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
替换homebrew默认源
cd “ ( b r e w − − r e p o ) " g i t r e m o t e s e t − u r l o r i g i n g i t : / / m i r r o r s . u s t c . e d u . c n / b r e w . g i t 替 换 h o m e b r e w − c o r e 源 c d " (brew --repo)" git remote set-url origin git://mirrors.ustc.edu.cn/brew.git 替换homebrew-core源 cd " (brewrepo)"gitremoteseturlorigingit://mirrors.ustc.edu.cn/brew.githomebrewcorecd"(brew --repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
更新brew
brew update
设置 bintray镜像后重启终端:
echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles’ >> ~/.bash_profile
source ~/.bash_profile

五、安装环境依赖

brew install imagemagick doxygen cmake intltool yasm automake coreutils wget optipng autoconf pkg-config

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值