linux交叉编译VLC的webPlugin--npapi-vlc/npapi-vlc的交叉编译

linux交叉编译npapi-vlc

1.下载依赖包和安装依赖

$ sudo apt-get install -y gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools
$ sudo apt-get install -y lua5.2 libtool automake autoconf autopoint make gettext
$ sudo apt-get install -y qt4-dev-tools qt5-default
$ sudo apt-get install -y git subversion cmake cvs wine-dev yasm
$ sudo apt-get install -y zip p7zip nsis bzip2
下载vlc-contrib-x86_64-w64-mingw32-latest.tar.bz2
http://download.videolan.org/pub/videolan/contrib/x86_64-w64-mingw32/  把此解压到一个文件夹

注意:
安装过程中可能会出现Configuring ttf-mscorefonts-installer的配置页面,按tab后,一路回车即可

在任意地方执行一下命令。执行命令,将部分dll库移走备份

#!/bin/sh

# This script enforces statically linking of libgcc, libstdc++-6, and libpthread,
# without needing to rebuild gcc and mingw-w64 from scratch.
# -static-libgcc -static-libstdc++ flags can not be used in a libtool build system,
# as libtool removes flags that it doesn't understand.

move() {
    [ -f $1 ] || return 1
    mkdir -p old/
    mv -v $* old/
    return 0
}

for x in i686 x86_64
do
    library_path_list=`$x-w64-mingw32-gcc -v /dev/null 2>&1 | grep ^LIBRARY_PATH|cut -d= -f2|sort|uniq`
    IFS=':'
    for i in $library_path_list
    do
        cd $i
        move libstdc++-6.dll libstdc++.dll.a libgcc_s.a libgcc_s_sjlj-1.dll && ln -s libgcc_eh.a libgcc_s.a
        move libpthread.dll.a libwinpthread.dll.a
        move libwinpthread-1.dll
        [ -d ../bin ] && cd ../bin && move libwinpthread-1.dll
    done
done


exit 0

2.设置环境

设置依赖包路径
export PKG_CONFIG_LIBDIR=/。。。。。。。/i686-w64-mingw32/lib/pkgconfig
设置vlc头文件和库路径
export LIBVLC_CFLAGS=-I/。。。。。。/vlc-3.0.0-git/sdk/include
export LIBVLC_LIBS=-L/。。。。。。。。/vlc-3.0.0-git/sdk/lib -llibvlc -llibclvcore

3.执行编译命令

./autogen.sh
./configure --host=i686-w64-mingw32 --prefix=/。。。。。。。。/npapi-vlc1/out 
make && make install
注意
在执行make时需要根据提示错误修改源码或者修改makefile中的LIBVLC_CFLAGS /LIBVLC_LIBS 保证路径的正确。修改完makefile不需要从新执行configure这步

在执行nake是有下载npapi-sdk 不会执行成功。需要手动下载并修改名称为npapi-sdk 。并注释掉npapi中Makefile.in 中 的
#   svn export http://npapi-sdk.googlecode.com/svn/trunk/headers npapi-sdk-svn -r HEAD
#   mv npapi-sdk-svn npapi-sdk

4.在out中就应该会出现npvlc.dll

一个修改好的可用与交叉边缘成win的npapi-vlc的包
http://download.csdn.net/download/u011573853/10051039

参考资料

http://blog.csdn.net/a_sungirl/article/details/42520411
http://download.videolan.org/pub/videolan/contrib/i686-w64-mingw32/
https://m.aliyun.com/yunqi/articles/44515

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值