编译VLC2.0.7
来源:互联网 发布:sql 入门到精通 编辑:程序博客网 时间:2024/05/23 15:59
Unbutn 12.04,32位
VLC 2.0.7
一、下载vlc2.0.7,解压缩到/home/testtest目录下
tar -xvf vlc-2.0.7.tar.xz
cd vlc-2.0.7/
二、安装交叉编译工具
apt-get install gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools
三、安装其他工具
apt-get install lua5.1
apt-get install libtool automake autoconf autopoint make gettext
apt-get install pkg-config
apt-get install qt4-dev-tools
apt-get install git
apt-get install subversion
### apt-get install cmake cvs 编译contribs使用(不需要安装,安装其他工具会附带把该工具安装上)
apt-get install zip p7zip nsis bzip2
i686-w64-mingw32 for Windows 32-bits, using the Mingw-w64 toolchain
x86_64-w64-mingw32 for Windows 64-bits, using the Mingw-w64 toolchain
i586-mingw32msvc for Windows 32-bits, using the Mingw32 toolchain
四、配置第三方库(没有编译QT的步骤)
mkdir -p contrib/win32
cd contrib/win32
../bootstrap --host=i686-w64-mingw32
make prebuilt (把之前下载好的vlc-contrib-i686-w64-mingw32-latest.tar,拷贝到contrib/win32下,就不用重新下载了)
五、编译VLC源代码
cd - 返回vlc根目录
./bootstrap
mkdir win32 && cd win32
../extras/package/win32/configure.sh --host=i686-w64-mingw32
checking whether GCRYCTL_SET_THREAD_CBS is declared... yes
checking for gcry_control in -lgcrypt... no
configure: error: libgcrypt not found. Install libgcrypt or use --disable-libgcrypt. Have a nice day.
安装libgcrypt
sudo apt-get install libgcrypt
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libgcrypt
安装libgcrypt11-dev
sudo apt-get install libgcrypt11-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgcrypt11-dev is already the newest version.
The following package was automatically installed and is no longer required:
g++
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 566 not upgraded.
更新apt-get
sudo apt-get update
查询是否安装libgcrypt
root@ubuntu:/home# updatedb
root@ubuntu:/home# locate libgcrypt
/home/libgcrypt-1.5.2.tar.gz
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/bin/libgcrypt-config
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libgcrypt.a
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libgcrypt.def
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libgcrypt.la
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/share/aclocal/libgcrypt.m4
/lib/i386-linux-gnu/libgcrypt.a
/lib/i386-linux-gnu/libgcrypt.so
/lib/i386-linux-gnu/libgcrypt.so.11
/lib/i386-linux-gnu/libgcrypt.so.11.7.0
/usr/bin/libgcrypt-config
/usr/share/aclocal/libgcrypt.m4
/usr/share/doc/libgcrypt11
/usr/share/doc/libgcrypt11-dev
/usr/share/doc/libgcrypt11/AUTHORS.gz
/usr/share/doc/libgcrypt11/NEWS.gz
/usr/share/doc/libgcrypt11/README.gz
/usr/share/doc/libgcrypt11/THANKS.gz
/usr/share/doc/libgcrypt11/TODO
/usr/share/doc/libgcrypt11/changelog.Debian.gz
/usr/share/doc/libgcrypt11/copyright
/usr/share/doc/libgcrypt11-dev/AUTHORS.gz
/usr/share/doc/libgcrypt11-dev/NEWS.gz
/usr/share/doc/libgcrypt11-dev/README.gz
/usr/share/doc/libgcrypt11-dev/THANKS.gz
/usr/share/doc/libgcrypt11-dev/TODO
/usr/share/doc/libgcrypt11-dev/changelog.Debian.gz
/usr/share/doc/libgcrypt11-dev/copyright
/usr/share/man/man1/libgcrypt-config.1.gz
/var/cache/apt/archives/libgcrypt11-dev_1.5.0-3ubuntu0.1_i386.deb
/var/cache/apt/archives/libgcrypt11_1.5.0-3ubuntu0.1_i386.deb
/var/lib/dpkg/info/libgcrypt11-dev.list
/var/lib/dpkg/info/libgcrypt11-dev.md5sums
/var/lib/dpkg/info/libgcrypt11:i386.list
/var/lib/dpkg/info/libgcrypt11:i386.md5sums
/var/lib/dpkg/info/libgcrypt11:i386.postinst
/var/lib/dpkg/info/libgcrypt11:i386.postrm
/var/lib/dpkg/info/libgcrypt11:i386.shlibs
/var/lib/dpkg/info/libgcrypt11:i386.symbols
下载安装libgcrypt1.5.2版
ftp://ftp.gnupg.org/gcrypt/libgcrypt/
./configure && make && make install
禁用libgcrypt
../extras/package/win32/configure.sh --host=i686-w64-mingw32 --disable-libgcrypt
checking for TAGLIB... yes
configure: error: libgcrypt is required for update checking system
禁用checking system(Make源代码之前的所有步骤都执行结束)
../extras/package/win32/configure.sh --host=i686-w64-mingw32 --disable-libgcrypt --disable-update-check
make 编译源代码
make[5]: Entering directory `/home/testtest/vlc-2.0.7/win32/modules/access'
CC libcdda_plugin_la-cdda.lo
CC libcdda_plugin_la-cdrom.lo
CCLD libcdda_plugin.la
*** Warning: Linking the shared library libcdda_plugin.la against the
*** static library /home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libregex.a is not portable!
Creating library file: .libs/libcdda_plugin.dll.a
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libcddb.a(cddb_conn.o): In function `snprintf':
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/stdio.h:579: undefined reference to `___ms_vsnprintf'
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libcddb.a(cddb_cmd.o): In function `vsnprintf':
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/stdio.h:567: undefined reference to `___ms_vsnprintf'
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libcddb.a(cddb_cmd.o): In function `snprintf':
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/stdio.h:579: undefined reference to `___ms_vsnprintf'
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libcddb.a(cddb_log.o): In function `vsnprintf':
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/stdio.h:567: undefined reference to `___ms_vsnprintf'
/home/testtest/vlc-2.0.7/contrib/i686-w64-mingw32/lib/libcddb.a(cddb_net.o): In function `vsnprintf':
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/stdio.h:567: undefined reference to `___ms_vsnprintf'
collect2: ld returned 1 exit status
make[5]: *** [libcdda_plugin.la] Error 1
make[5]: Leaving directory `/home/testtest/vlc-2.0.7/win32/modules/access'
执行配置
../configure --host=i686-w64-mingw32
../configure --host=i686-w64-mingw32 --disable-libgcrypt
更新mingw-w64-i686-dev
wget http://ftp.jp.debian.org/debian/pool/main/m/mingw-w64/mingw-w64-i686-dev_3.0~svn5915-1_all.deb
sudo dpkg -i mingw*deb
Download Page for mingw-w64-i686-dev_3.0~svn5915-1_all.deb
http://packages.debian.org/sid/all/mingw-w64-i686-dev/download
sudo dpkg -i mingw*deb
dpkg: regarding mingw-w64-i686-dev_3.0~svn5915-1_all.deb containing mingw-w64-i6 86-dev:
mingw-w64-i686-dev breaks mingw-w64-dev (<< 2.0.3-1)
mingw-w64-dev (version 2.0.1-1) is present and installed.
dpkg: error processing mingw-w64-i686-dev_3.0~svn5915-1_all.deb (--install):
installing mingw-w64-i686-dev would break mingw-w64-dev, and
deconfiguration is not permitted (--auto-deconfigure might help)
Errors were encountered while processing:
mingw-w64-i686-dev_3.0~svn5915-1_all.deb
卸载2.0版mingw-w64-dev
sudo apt-get purge mingw-w64-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
g++-4.6 binutils-mingw-w64-i686 g++ gcc-mingw-w64-base libstdc++6-4.6-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
g++-mingw-w64-i686* gcc-mingw-w64-i686* mingw-w64-dev*
0 upgraded, 0 newly installed, 3 to remove and 566 not upgraded.
After this operation, 221 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 155327 files and directories currently installed.)
Removing g++-mingw-w64-i686 ...
Removing gcc-mingw-w64-i686 ...
Removing mingw-w64-dev ...
安装3.0版mingw-w64-dev
sudo dpkg -i mingw*deb
(Reading database ... 152546 files and directories currently installed.)
Preparing to replace mingw-w64-i686-dev 3.0~svn5915-1 (using mingw-w64-i686-dev_3.0~svn5915-1_all.deb) ...
Unpacking replacement mingw-w64-i686-dev ...
Setting up mingw-w64-i686-dev (3.0~svn5915-1) ...
重新安装gcc/g++
apt-get install gcc-mingw-w64-i686
apt-get install g++-mingw-w64-i686
从步骤四开始重来,一直到make源代码之前都没有错误。
mkdir -p contrib/win32
cd contrib/win32
../bootstrap --host=i686-w64-mingw32
make prebuilt (把之前下载好的vlc-contrib-i686-w64-mingw32-latest.tar,拷贝到contrib/win32下,就不用重新下载了)
cd - 返回vlc根目录
./bootstrap
mkdir win32 && cd win32
../extras/package/win32/configure.sh --host=i686-w64-mingw32这次没出现错误
(MAKE之前,没有执行./configure --option)
make 编译源代码
In file included from ../../extras/package/win32/../../../include/vlc_common.h:491:0,
from ../../extras/package/win32/../../../src/interface/interface.c:45:
../../extras/package/win32/../../../include/vlc_threads.h:408:1: error: unknown type name 'pthread_spinlock_t'
../../extras/package/win32/../../../include/vlc_threads.h: In function 'vlc_spin_init':
../../extras/package/win32/../../../include/vlc_threads.h:415:5: error: implicit declaration of function 'pthread_spin_init' [-Werror=implicit-function-declaration]
../../extras/package/win32/../../../include/vlc_threads.h:415:34: error: 'PTHREAD_PROCESS_PRIVATE' undeclared (first use in this function)
../../extras/package/win32/../../../include/vlc_threads.h:415:34: note: each undeclared identifier is reported only once for each function it appears in
../../extras/package/win32/../../../include/vlc_threads.h: In function 'vlc_spin_lock':
../../extras/package/win32/../../../include/vlc_threads.h:424:5: error: implicit declaration of function 'pthread_spin_lock' [-Werror=implicit-function-declaration]
../../extras/package/win32/../../../include/vlc_threads.h: In function 'vlc_spin_unlock':
../../extras/package/win32/../../../include/vlc_threads.h:432:5: error: implicit declaration of function 'pthread_spin_unlock' [-Werror=implicit-function-declaration]
../../extras/package/win32/../../../include/vlc_threads.h: In function 'vlc_spin_destroy':
../../extras/package/win32/../../../include/vlc_threads.h:440:5: error: implicit declaration of function 'pthread_spin_destroy' [-Werror=implicit-function-declaration]
../../extras/package/win32/../../../src/interface/interface.c: In function 'intf_DestroyAll':
../../extras/package/win32/../../../src/interface/interface.c:194:9: warning: 'vlc_object_kill' is deprecated (declared at ../../extras/package/win32/../../../include/vlc_objects.h:76) [-Wdeprecated-declarations]
cc1: some warnings being treated as errors
make[4]: *** [interface/interface.lo] Error 1
make[4]: Leaving directory `/home/testtest/vlc-2.0.7/win32/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/testtest/vlc-2.0.7/win32/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/testtest/vlc-2.0.7/win32/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/testtest/vlc-2.0.7/win32'
make: *** [all] Error 2
/home/testtest/vlc-2.0.7/win32# ../bootstrap
generating modules/**/Makefile.am
.....................................................................
+ echo
+ cp -f INSTALL INSTALL.git
+ autoreconf --install --force --verbose -I m4
autoreconf: Entering directory `.'
autoreconf: running: autopoint --force
Copying file ABOUT-NLS
Copying file po/Makevars.template
autoreconf: running: aclocal -I m4 --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --install --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `autotools'.
libtoolize: copying file `autotools/config.guess'
libtoolize: copying file `autotools/config.sub'
libtoolize: copying file `autotools/install-sh'
libtoolize: copying file `autotools/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --include=m4 --force
autoreconf: running: /usr/bin/autoheader --include=m4 --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
+ rm -f po/Makevars.template ABOUT-NLS
+ echo
+ mv -f INSTALL.git INSTALL
+ rm -f stamp-h*
+ set +x
Successfully bootstrapped
/home/testtest/vlc-2.0.7/win32#../extras/package/win32/configure.sh --host=i686-w64-mingw32
libvlc configuration
--------------------
version : 2.0.7
system : mingw32
architecture : i686 mmx sse sse2
optimizations : yes
vlc aliases : cvlc rvlc svlc qvlc
To build vlc and its plugins, type `make', or `./compile' if you like nice colors.
/home/testtest/vlc-2.0.7/win32# ../configure
checking for zlib.h... yes
checking for MINIZIP... no
checking unzip.h usability... no
checking unzip.h presence... no
checking for unzip.h... no
checking for DBUS... no
configure: error: No package 'dbus-1' found.
/home/testtestlc-2.0.7/win32# ../configure
2012-07-31 18:12 No package 'dbus-1' found解决办法分别安装一下几个包。
libdbus-1-dev
libhal-dev
libgn
问题还没解决,可能是全局的lib,Include配置有问题
********************************************************************************
参考资料链接:
Win32Compile
http://wiki.videolan.org/Win32Compile#Obtaining_the_toolchain
UnixCompile
http://wiki.videolan.org/UnixCompile
VLC configure help
http://wiki.videolan.org/VLC_configure_help
Configure
http://wiki.videolan.org/Configure
Ubuntu 下编译 VLC-Win32
http://www.rosoo.net/a/201212/16406.html
libgcrypt problem during cross-compiling
http://en.it-usenet.org/thread/17096/32852/
vlc_threads.h File Reference
http://www.videolan.org/developers/vlc/doc/doxygen/html/vlc__threads_8h.html
用到的其他命令:
删除之前已安装的文件
---------------------
apt-get purge gcc-mingw-w64-i686
apt-get purge g++-mingw-w64-i686
apt-get purge gfortran-mingw-w64-i686
apt-get purge gcc-mingw32
apt-get purge mingw32-binutils
apt-get purge mingw-w64
apt-get purge mingw-w64-tools
apt-get purge git
apt-get purge lua5.1
apt-get purge libtool
apt-get purge automake
apt-get purge autoconf
apt-get purge autopoint
apt-get purge pkg-config
apt-get purge make
apt-get purge subversion 编译contrib使用
apt-get purge yasm 编译contrib使用
apt-get purge cmake 编译contrib使用
apt-get purge cvs 编译contrib使用
apt-get purge zip
apt-get purge p7zip
apt-get purge p7zip-full
apt-get purge nsis
apt-get purge bzip2
apt-get purge build-essential 不知道用来干什么
sudo apt-get purge g++
sudo apt-get purge i686-w64-mingw32-g++
apt-get purge gettext
-------------------------------
sudo dpkg -r -P mingw-w64-i686-dev_3.deb
sudo dpkg -r -P mingw-w64-i686-dev_2.0.3-1_all.deb
********************************************************************************
- 编译VLC2.0.7
- Unbutn12.04交叉编译VLC2.0.7
- Ubuntu下编译VLC2.0.1
- 最新版本VLC2.2.1编译
- Windows下编译VLC2.2.1
- vlc2.0.2 代码编译和调试
- windows平台下VLC2.0.5编译
- ubuntu12.04 虚拟机编译vlc2.1.2
- windows平台下VLC2.0.5编译
- VS2015编译VLC2.2.1(under WIN7-64)
- Windows下编译VLC2.2.1 ---CygWin环境
- Windows 下编译VLC2.2.1 -Mys2+MinGW
- windows平台下VLC2.0.5编译
- Ubuntu14.04 32 编译VLC2.2.1 错误
- VLC2.2.1 在vs2013中编译
- fedora14 安装vlc2.0.6编译环境 步骤记录
- fedora14 安装vlc2.0.6编译环境 步骤记录
- 在ubuntu13.10下交叉编译VLC2.1.0 win32版
- cocos2d-x源码分析::CCCopying关于浅拷贝和深拷贝
- 学习hibernate不可绕过的两个问题
- android 反射的应用
- linux中select()函数分析
- ConcurrentHashMap
- 编译VLC2.0.7
- sgu 103 Traffic Lights 最短路径
- Insert Interval
- Android layout adaptive to mutiply density screen
- 简单的nginx负载均衡配置
- sql2000和sql2005装在一台机器上和两版本之间的转换
- latex编写论文
- 自定义标签页
- 数据库排序规则(COLLATE Chinese_PRC_CI_AS NULL)