在Macos下编译libmpv遇到以下问题,小记一下。
mpv-build Github地址:https://github.com/mpv-player/mpv-build
按官方指导,执行以下指令:
git clone https://github.com/mpv-player/mpv-build.git
cd mpv-build
./rebuild -j4
(注意:-j4是代表4核,可根据电脑配置调整)
因为是新系统,所以在 ./rebuild -j4 时碰到几个问题:
1、autoreconf命令缺失。
./autogen.sh: line 3: autoreconf: command not found
解决:brew install autoconf
2、不能执行aclocal
Can't exec "aclocal": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
解决:brew install automake
3、缺少yasm
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
解决:brew install yasm
以上3个问题解决,就能成功编译过了。不过此时编译的libmpv是静态的,如需要动态库,需要先执行
echo --enable-libmpv-shared > mpv_options
然后再重新编译一次就好了。