奮斗了一晚上,多方查找資料,終于將MPlayer交叉編譯成功了,小記經(jīng)驗(yàn)于此。
MPlayer版本:MPlayer-1.0rc2.tar.bz2;
交叉編譯器:cross-3.2.tar.bz2
1 在我的主目錄中解壓Mplayer
2 安裝交叉編譯器,將cross-3.2.tar.bz2以root權(quán)限拷貝到/目錄執(zhí)行解壓操作
3 cd Mplayer目錄
4 修改stream.c,注釋掉
//#ifdef USE_DVDREAD
//extern stream_info_t stream_info_dvd;
//#endif
//#ifdef USE_DVDREAD
// &stream_info_dvd,
//#endif
原因見5,都是關(guān)于dvd的錯(cuò)誤。
5 ./configure --host-cc=gcc --cc=arm-linux-gcc --target=arm-armv4l-linux --enable-static --disable-win32dll --disable-dvdread --disable-dvdread-internal --disable-dvdnav --disable-libdvdcss-internal --enable-fbdev --disable-mencoder --disable-live 2>&1 | tee logfile
注意:--host-cc=gcc要加,不然會(huì)出現(xiàn)codec-cfg無法執(zhí)行的錯(cuò)誤。
disable掉所有在configure中的關(guān)于dvd的選項(xiàng),一方面我在嵌入式平臺(tái)上用不著dvd,另一方面如果不去掉這些dvd的選項(xiàng),會(huì)出現(xiàn)以下錯(cuò)誤。
/usr/include/netinet/in.h:259: error: parse error before '(' token
/usr/include/netinet/in.h:259: error: parse error before "__u32"
/usr/include/netinet/in.h:260: error: parse error before '(' token
/usr/include/netinet/in.h:260: error: parse error before "__u16"
/usr/include/netinet/in.h:262: error: parse error before '(' token
/usr/include/netinet/in.h:262: error: parse error before "__u32"
/usr/include/netinet/in.h:264: error: parse error before '(' token
/usr/include/netinet/in.h:264: error: parse error before "__u16"
6 make
7 哈哈,我可愛的mplayer終于將生了!
感謝下面三個(gè)鏈接:
http://blog.chinaunix.net/u/28484/showart_324583.html
http://www.eetop.cn/bbs/thread-55200-1-1.html
http://readlist.com/lists/mplayerhq.hu/mplayer-users/2/11390.html