当然,只有 gcc-4.0 的时候才需要打补丁,并且这个补丁只适合这次的情况,也就是说,只对这个 MPlayer-1.0pre7.tar.bz2 有效果。注意啊,我们现在在源代码目录了。下面是执行结果,好多文件被打上了补丁
[root@geeks MPlayer-1.0pre7]# patch -p1 < ../mplayer-1.0_pre7-gcc4-fix.patch
patching file configure patching file liba52/imdct.c patching file
libavcodec/avcodec.h patching file libavcodec/common.h patching file
libavcodec/libpostproc/postprocess_template.c patching file libmpdemux/frequencies.h
patching file libvo/aclib_template.c patching file mmx.h patching file
postproc/swscale_template.c
4). 配置
根据我们上面提到的环境,没有 gtk-1.2 所以不用 --enable-gui 之类的参数。但是我们需要中文的提示,并且是在 locale 为 UTF-8 的情况下使用,所以要这样配置。--charset=utf8 是在 pre7 里面新增的。下面是命令和输出结果。编译时的输出很重要,从这个输出中我们可以看到 XAnim 和 RealPlayer 的解码器是从 /usr/local/lib/codecs 自动探测到的。没有加入 menu 和 xmms 的支持,也没有 gui,但是这正是我需要的,因为我的系统中没有 xmms 这些过时的 gtk-1.2 程序。
[root@geeks MPlayer-1.0pre7]# ./configure --language=zh_CN --charset=utf8
Detected operating system: Linux Detected host architecture: i386
Checking for cc version ... 4.0.0, ok ...... Checking for XAnim DLL ... yes
(using /usr/local/lib/codecs) Checking for RealPlayer DLL ... yes
(using /usr/local/lib/codecs) Checking for LIVE.COM Streaming Media libraries ...
no ...... Checking for OSD menu ... no Checking for QTX codecs ... yes Checking for
Subtitles sorting ... yes Checking for XMMS inputplugin support ... no Checking for
inet6 ... yes Checking for gethostbyname2 ... yes Checking for GUI ... no ...... Config
files successfully generated by ./configure ! Install prefix: /usr/local Data
directory: /usr/local/share/mplayer Config direct.: /usr/local/etc/mplayer Byte order:
little-endian Optimizing for: pentium4 mmx mmx2 sse sse2 mtrr Languages: Messages/GUI:
zh_CN Manual pages: en Enabled optional drivers: Input: ftp network edl tv matroska
mpdvdkit2 vcd smb Codecs: qtx xvid libavcodec real xanim dshow/dmo win32 faad2(internal)
libmpeg2 liba52 mp3lib tremor(internal) gif Audio output: alsa esd oss sdl mpegpes(file)
Video output: xvidix cvidix sdl vesa gif89a md5sum pnm jpeg png mpegpes(file) fbdev
opengl dga xv x11 xover tga Audio filters: Disabled optional drivers: Input: vstream tv-
v4l2 tv-v4l tv-bsdbt848 live.com cdda dvdread dvb Codecs: opendivx x264 libdv amr_wb
amr_nb libdts libtheora toolame libmad liblzo Audio output: sgi sun jack polyp arts dxr2
nas dsound win32 macosx Video output: winvidix bl zr zr2 dxr3 dxr2 directx svga caca aa
ggi xmga mga xvmc directfb tdfx_vid tdfxfb 3dfx quartz Audio filters:
ladspa