在linux上編譯windows 32/64 上運行的vlc

Windows-32位

1,GCC版本信息
#gcc -v
Using built-in specs.
Target: i686-linux-gnu
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)

 

1 安裝vlc依賴的庫 

sudo apt-get build-dep vlc 

 

2,安裝必須的工具包否則後面會出錯
#apt-get install autoconf automake libtool git subversion

 

 

3,安裝win32下編譯工具


sudo apt-get install mingw32 

#apt-get install gcc-mingw32

#apt-get install mingw32-binutils

如果安裝不了,手動下載第三方交叉工具下載:http://download.videolan.org/pub/

 

4.安裝最新的VLC
#cd /home/git_work
#git clone git://git.videolan.org/vlc.git

5.進入vlc目錄,進入第三方包目錄
#cd vlc
#mkdir -p contrib/win32
#cd contrib/win32


6.配置並編譯第三方包



#../bootstrap --host=i586-mingw32msvc  指定交叉編譯工具
 Guessing build system... i686-linux-gnu
 Creating configuration file... config.mak
 Bootstrap completed.

 Run "make" to start compilation.
 Other targets:
  * make install      same as "make"
  * make prebuilt     fetch and install prebuilt binaries
  * make list         list packages
  * make fetch        fetch required source tarballs
  * make fetch-all    fetch all source tarballs
  * make distclean    clean everything and undo bootstrap
  * makemostlyclean  clean everything exceptsource tarballs
  * make clean        clean everything
  * make package      prepare prebuilt packages

#make prebuilt
 Fixingup ./lib/libdvdread.la
 Fixingup ./lib/libfreetype.la
 Fixingup ./lib/libzvbi.la
 Fixingup ./lib/libresid-builder.la
 Fixingup ./lib/libschroedinger-1.0.la
 Fixingup ./lib/libFLAC.la
 Fixingup ./change_prefix.sh
 
7.回到vlc根目錄
#cd ../..
#./bootstrap
 + rm -fpo/Makevars.template ABOUT-NLS
 + echo
 + mv -fINSTALL.git INSTALL
 + rm -f stamp-h*
 + set +x
 Successfullybootstrapped

8.配置makefile
#mkdir win32 && cd win32
#../extras/package/win32/configure.sh --host=i586-mingw32msvc

checking forLUA... no
configure:WARNING: No package 'lua5.1' found, trying lua >= 5.1 instead
checking forLUA... yes
checking forluac... no
出錯就安裝
#apt-get install lua5.1

#../extras/package/win32/configure.sh --host=i586-mingw32msvc
 libvlcconfiguration
 --------------------
 version               : 2.1.0-git
 system                : mingw32
 architecture          : i586 mmx sse sse2
 optimizations         : yes
 vlcaliases            : cvlc rvlc qvlc svlc
 Tobuild vlc and its plugins, type `./compile' or `make'.

9.編譯
#make

10.打包
#make package-win32-zip

11.在vlc/win32目錄下可以找到vlc-2.1.0-git-win32.zip文件,複製到windows目錄下,解壓縮即可運行

 


Windows-64位

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

環境 Ubuntu12.04


1. 安裝編繹器

  1. sudo apt-get install binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 
sudo apt-get install gcc-mingw-w64 g++-mingw-w64

下載

ftp://ftp.jp.debian.org/debian/pool/main/m/mingw-w64

- You must use mingw-w64 3.0 or later (Please note that the binary size is about 7M)
- http://packages.debian.org/experimental ... 4-i686-dev

 

 

改一下名字,不然裝不了

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

 

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

 

sudo dpkg -i mingw-w64-i686-dev_3.0~svn5408-1_all.deb 

2.安裝相關工具

  1. sudo apt-get install ua5.1 libtool automake autoconf autopoint make gettext pkg-config git subversion cmake cvs zip p7zip-full nsis bzip2 
sudo apt-get install ua5.1 libtool automake autoconf autopoint make gettext pkg-config git subversion cmake cvs zip p7zip-full nsis bzip2

3.下源碼

  1. git clone git://git.videolan.org/vlc.git vlc 
git clone git://git.videolan.org/vlc.git vlc

4.準備第三方庫

  1. cd vlc 
  2. mkdir -p contrib/win32 
  3. cd contrib/win32 
  4. ../bootstrap --host=i686-w64-mingw32 
  5. make prebuilt 
cd vlc
mkdir -p contrib/win32
cd contrib/win32
../bootstrap --host=i686-w64-mingw32
make prebuilt

會把依賴的 第三方庫下載下來.

cd contrib/win32
make .qt4

5.Bootstrap

回到vlc目錄下

  1. cd - 
  2. ./bootstrap 
cd -
./bootstrap

6.Configure

  1. mkdir win32 && cd win32 
  2. ../configure --host=i686-w64-mingw32  
mkdir win32 && cd win32
../configure --host=i686-w64-mingw32 
這裏你能加上自己的配置
  1. ../configure --help 
../configure --help
出現下面打印,配置成功

libvlc configuration
--------------------
version               : 2.1.0-git
system                : mingw32
architecture          : i686 mmx sse sse2
optimizations         : yes
vlc aliases           : cvlc rvlc qvlc svlc

To build vlc and its plugins, type `make', or `./compile' if you like nice colors.

7.開編

  1. make  
make 
開始編繹,漫長等待.
ok
打包
  1. make package-win32-zip 
make package-win32-zip



安裝之後 完美運行

8.總結

qt的版本太舊,編譯時會有問題。所以需要從新下載編譯qt。

vlc官方文檔用的 i586-mingw32msvc
這裏要換成 i686-w64-mingw32

 

 

 

發佈了41 篇原創文章 · 獲贊 36 · 訪問量 34萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章