Unbutn12.04交叉编译VLC2.0.7

来源:互联网 发布:淘宝加入购物车 找不到 编辑:程序博客网 时间:2024/05/21 10:43

编译环境, XP系统安装Unbutn 12.04虚拟机,32位,unbutn12之前的版本好像无法在线安装编译工具,编译vlc2.0.7

一、检查是多少位操作系统
root@ubuntu:/home/testtest# getconf LONG_BIT
32

root@ubuntu:/home/testtest# uname -a
Linux ubuntu 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux

二、设置ROOT密码,默认没设置
sudo passwd root

su root

三、安装SSH

apt-get install xxxx 安装

apt-get remove xxxx 卸载但不删除配置

apt-get purge xxxx 卸载并且删除相关配置

dpkg -i xxx.deb
#################| --install xxx.deb 安装 deb 软件包
dpkg -r xxx.deb
#################| --remove xxx.deb 删除软件包
dpkg -r -P xxx.deb
#################| --purge xxx.deb 连同配置文件一起删除
dpkg -I xxx.deb
################# | -info xxx.deb 查看软件包信息
dpkg -L xxx.deb
######################查看包内文件
dpkg -l
################ 查看系统中已安装软件包信息
dpkg-reconfigure xxx
#################### 重新配置软件包
apt-get install xxx
###################### 安装 xxx
###########-d 仅下载
############-f 强制安装
apt-get remove xxx
###################卸载 xxx
apt-get update
###############更新软件信息数据库
apt-get upgrade
######################进行系统升级
apt-cache search
##########################搜索软件包

sudo apt-get install openssh-server

sudo apt-get install openssh-client

dpkg --list|grep ssh

ps -e |grep ssh

sudo /etc/init.d/ssh stop

sudo /etc/init.d/ssh start

四、修改目录属性
chmod 777 /home/testtest/

chown root:root /home/testtest/

五、安装gcc/g++
sudo apt-get install gcc-mingw-w64-i686

sudo apt-get install g++-mingw-w64-i686

sudo apt-get install gfortran-mingw-w64-i686(是否需要安装?)

六、安装MinGW
sudo apt-get install gcc-mingw32(gcc-mingw-w64-i686和gcc-mingw32是否都要安装?)

sudo apt-get install mingw32-binutils(是否需要安装?)

sudo apt-get install mingw-w64

sudo apt-get install mingw-w64-tools

七、安装其他工具和插件(部分工具可能不需要)


apt-get install git

apt-get install lua5.1

apt-get install libtool

apt-get install automake

apt-get install autoconf

apt-get install autopoint

apt-get install gettext

apt-get install pkg-config

apt-get install make

apt-get install subversion编译contrib使用

apt-get install yasm  编译contrib使用

apt-get install cmake 编译contrib使用

apt-get install cvs  编译contrib使用


apt-get install zip

apt-get install p7zip

apt-get install p7zip-full

apt-get install nsis

apt-get install bzip2
 

apt-get install build-essential 不知道用来干什么

安装最新包(不清楚是否必须要安装,没安装成功,第一个包需要重命名下再继续安装)
wget http://ftp.jp.debian.org/debian/pool/main/m/mingw-w64/mingw-w64-i686-dev_3.0~svn5915-1_all.deb

mv mingw-w64-i686-dev_3.0~svn5915-1_all.deb mingw-w64-i686-dev_3.deb

sudo dpkg -i mingw-w64-i686-dev_3.deb

wget http://ftp.jp.debian.org/debian/pool/main/m/mingw-w64/mingw-w64-i686-dev_2.0.3-1_all.deb

sudo dpkg -i mingw-w64-i686-dev_2.0.3-1_all.deb

sudo apt-get build-dep vlc ###安装所有第三方依赖包

The preferred method Use your distribution packaging or portage system, in order to get all the needed libs. For example on Debian or Ubuntu:

$ sudo apt-get build-dep vlc
openSUSE users might have a look at the source-install (si) command in the zypper manpage:

$ sudo zypper si -d vlc
Note: To get the libraries, you must first add the VLC repositories to your system repositories. For example in openSUSE:

$ sudo zypper ar http://download.videolan.org/pub/vlc/SuSE/<openSUSEversion> VLC
You should replace <openSUSEversion> with the version of your system (12.1, 11.4, 11.3, 11.2 or 11.1)

八、下载2.0.7版本VLC,释放到/home/user目录下(user是自己的用户名,我的用户名是testtest)
http://download.videolan.org/pub/videolan/vlc/

wget http://download.videolan.org/pub/videolan/vlc/2.0.7/vlc-2.0.7.tar.xz

tar xvJf vlc-2.0.7.tar.xz

九、下载配置第三方库

mkdir -p contrib/win32

cd contrib/win32

../bootstrap --host=i686-w64-mingw32

make prebuilt  下载(直接下载压缩包,拷贝到contrib/win32/目录下)

Get the third-party libraries

Now you could configure the VLC build. But first, you need to make sure that all the required dependencies are in place. Take a look at./configure --help.Take a good look at that enormous list of options.

It is very important that you do install and enable all the 3rd party libraries that you need. Yes, there are going to be a lot of them if you want a complete or even mostly functional VLC build. If you fail to install a required library, you will end up with a VLC application that well..... essentially does not do anything useful. Seehere for a complete list.

There are some very important dependencies: gettext (NLS) for international support (required),libdvbpsi for MPEG-TS files and streams support,libmad for MP3 audio decoding, libmpeg2 for MPEG1 and MPEG2 video support, FFmpeg or libav (libavcodec, libavformat, libpostproc, libswscale and optionally libavio) for MPEG4 and most other audio and video codecs, and many file formats,liba52 for Dolby (AC3) sound,dvdread and dvdnav for DVD playback,live555 for RTSP stream playback, etc.

For audio output, you will need probably alsa-lib (on Linux) and/or libpulse (forPulseAudio). For video output, you will normally need XCB/XVideo and/or OpenGL/GLX. AndQt4 is required to get the GUI support.

Note that you need to install the development packages (development header files and import libraries) to compile VLC, not just the run-time.On Debian/Ubuntu, the correct package names end with -dev. On RPM distributions, they usually end in -devel.

Be careful! If the libraries are not provided by your distribution, you may be better off linking VLC with them statically. Otherwise, you may encounter version problems if another multimedia application updates the libraries later. This is especially true of FFmpeg or libav, and live555.

There are a several ways to get those libraries. You should use only one method at a time:

十、下载编译4.8.2版qt4
http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.2.tar.gz

下载完后,手动复制到 contrib/tarballs,并重名为qt-4.8.2.tar.gz
执行make .qt4,自动释放到contrib/win32/qt4目录下并且编译
$ make .qt4

如果前面部分命令没安装成功,有可能会提示错误:
make[1]: g++: Command not found
sudo apt-get install g++

make[3]: i686-w64-mingw32-g++: Command not found
sudo apt-get install i686-w64-mingw32-g++

十一、回到vlc根目录
cd ../../

$ mkdir win32 && cd win32

../bootstrap

../extras/package/win32/configure.sh --host=i686-w64-mingw32

configure: error: VLC is based on plugins. Shared libraries cannot be disabled
重复执行上面两个步骤,如果是2.0.5版本会提示找不到change_prefix.sh。

checking for gcry_control in -lgcrypt... no
configure: error: libgcrypt not found. Install libgcrypt or use --disable-libgcrypt. Have a nice day.


方法一(没起作用)
export LIBGCRYPT_CONFIG=/usr/local/bin/libgcrypt-config

wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.2.tar.gz

tar -zxvf libgcrypt-1.5.2.tar.gz

cd libgcrypt-1.5.2

./configure && make && make install

source /etc/profile 或 ./etc/profile

方法二(没起作用)
sudo apt-get install libgcrypt11-dev

方法三(配置成功,--disable-libgcrypt --disable-update-check,不知道对后面有什么影响)
../extras/package/win32/configure.sh --host=i686-w64-mingw32 --disable-libgcrypt --disable-update-check

十二、编译VLC源代码,最重要最耗时的步骤
$ make

出现错误
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/stdio.h:579: undefined reference to `___ms_vsnprintf'

问题待解决。。。

 

原创粉丝点击