移植環境 Utuntu 15.04linux
一、mplayer移植c++
版本:mplayer-export-snapshot.tar.bz2 /mplayer-export-2015-11-26web
Linux PC 平臺: ./configure && make && make installsql
依賴軟件:yasm架構
二、yasm移植app
版本:yasm-1.3.0ide
Linux PC 平臺: ./configure && make && make installsvg
mipsel平臺:ui
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++this
一、QT 編譯
版本 qt-embedded-linux-opensource-src-4.5.3
mips和mipsel的區別
mips是big-endian的mips架構
mipsel是little-endian的mips架構。
他們之間的區別就是內存中存放的數據的字節順序相反,也就是把低位放在低地址仍是高地址。
./configure --prefix=/opt/mipsel/qtopia -opensource -release -shared -Declarative -fast -no-largefile -qt-sql-sqlite -qt3support -exceptions -xmlpatterns -no-glib -no-phonon -no-mmx -no-3dnow -no-sse -no-sse2 -svg -no-webkit -qt-zlib -qt-libtiff -qt-libpng -qt-libjpeg -make libs -make tools -nomake examples -nomake docs -nomake demo -no-nis -no-cups -iconv -no-dbus -xplatform qws/linux-mips-g++ -embedded mipsel -little-endian -qt-freetype -depths 16,24,32 -qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -no-armfpa -DQT_QLOCALE_USES_FCVT -DQT_NO_QWS_CURSOR -no-pch -I/opt/mipsel/tslib/include -L/opt/mipsel/tslib/lib -confirm-license
./configure -embedded mips -little-endian -xplatform qws/linux-mips-g++ -prefix /opt/mipsel/qtopia -release -opensource -confirm-license -webkit -qt-zlib -qt-libpng -qt-libjpeg -qt-gif -I/opt/mipsel/tslib/include -L/opt/mipsel/tslib/lib -no-qt3support -make libs -nomake examples -nomake demos -no-phonon -no-phonon-backend -no-accessibility -no-scripttools
./configure -embedded mips -little-endian -xplatform qws/linux-mips-g++ -prefix /opt/mipsel/qtopia -release -opensource -confirm-license -webkit -qt-zlib -qt-libpng -qt-libjpeg -qt-gif -I/opt/mipsel/tslib/include -L/opt/mipsel/tslib/lib -no-qt3support -shared -make libs -nomake examples -nomake demos -no-phonon -no-phonon-backend -no-accessibility -no-scripttools
./configure -xplatform qws/linux-mips-g++ -prefix /opt/mipsel/qtopia -I/opt/mipsel/tslib/include -L/opt/mipsel/tslib/lib -embedded mips -little-endian -release -opensource -shared -fast -make libs -confirm-license -nomake examples -nomake demos -no-webkit -qt-zlib -qt-libpng -qt-libjpeg -no-qt3support -no-phonon -no-phonon-backend -no-accessibility -no-scripttools -no-largefile -no-exceptions -no-accessibility -no-xmlpatterns -no-phonon -no-phonon-backend -no-svg -no-gif -no-libtiff -no-openssl -no-nis -no-opengl -no-cups -no-dbus
二、mplayer編譯
版本:mplayer1.0rc2
修改libvo/video_out.c添加
#ifdef HAVE_IVTV
extern vo_functions_t video_out_ivtv;
#endif
X86# ./configure --disable-gui --disable-ivtv
MIPS# ./configure --enable-cross-compile --prefix=/opt/mipsel/mplayer/ --target=mips-linux --cc=mipsel-linux-gcc --as=mipsel-linux-as --ar=mipsel-linux-ar --host-cc=gcc --disable-gui --disable-ivtv
tar -zxvf ./text.tar.gz -C /home/app/test/
三、libmad編譯
四、qt-x11編譯
版本:qt-x11-opensource-src-4.5.3
修改qpnghandle.cpp
#include <libpng/png.h>
error :'adoptref' was not declared in this scope, and no declarations were found by.....如上圖所示。
解決方法:找到qt-x11-opensource-src-4.5.3/src/3rdparty/webkit/WebCore/JavaScriptCore/wtf/RefPtr.h在文件頭部加入以下代碼:
#include "PassRefPtr.h"
error: 'prepareComparison' was not declared in this scope, and no declarations were found by.....如上圖所示。
解決方法:
找到qt-x11-opensource-src-4.5.3/src/xmlpatterns目錄下的Makefile文件,在該文件的CXXFLAGS 後面加入:
-fpermissive
error :'erase' was not declared in this scope, and no declarations were found by....如上圖所示。
解決方法:找到 qt-x11-opensource-src-4.5.3/src/corelib/tools/qmap.h文件的996行的24列,將erase改成this->erase
error :'getCachedDOMConstructor' was not declared in this scope, and no declarations were found by.....如上圖所示。
解決方法:src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h
添加
JSC::JSObject* getCachedDOMConstructor(JSC::ExecState*, const JSC::ClassInfo*);
void cacheDOMConstructor(JSC::ExecState*, const JSC::ClassInfo*, JSC::JSObject* constructor);
error :'insert' was not declared in this scope, and no declarations were found by.....如上圖所示。
解決方法:找到 qt-x11-opensource-src-4.5.3/tools/porting/src/codemodel.h文件的99行的50列,將 insert 改成this->insert
X86# ./configure && make
鏈接第三方庫文件出現undefined symbol '__gxx_personality_v0@@CXXABI_1.3' 添加 -lstdc++
undefined reference to symbol 'sincosf@@GLIBC_2.2.5' 添加 -lm
開發時,設置LIBRARY_PATH,以便gcc可以找到編譯時須要的動態連接庫。
發佈時,設置LD_LIBRARY_PATH,以便程序加載運行時可以自動找到須要的動態連接庫。
QT編譯工程:
切換到工程目錄
一、qmake -project 生成後綴名爲*.pro的文件
二、qmake *.pro生成 Makefile
三、修改Makefile相應地方爲 -rpath,/usr/local/lib不然會有段錯誤(僅對PC版本)
注意:qmake要根據須要選擇PC仍是嵌入式版本
四、wxWidgets-3.0.2編譯
X86: 建立amd64目錄,切換到此目錄 ../configure && make 便可, 編譯完後切換到 samples目錄 make 編譯例子
mipsel:../configure --host=mipsel-linux --prefix=/opt/mipsel/wxWidgets
export CFLAGS="-I/home/wxX11/wxX11-arm/include"
export CXXFLAGS="-I/home/wxX11/wxX11-arm/include"
export LDFLAGS="-L/home/wxX11/wxX11-arm/lib"
export CPPFLAGS="-I/home/wxX11/wxX11-arm/include"
export LIBRARY_PATH=/opt/mipsel/usr/lib:/opt/mipsel/usr/libc/lib:/opt/mipsel/usr/libc/uclibc/lib &&
export LD_LIBRARY_PATH=/opt/mipsel/usr/lib:/opt/mipsel/usr/libc/lib:/opt/mipsel/usr/libc/uclibc/lib &&
export C_INCLUDE_PATH=/opt/mipsel/usr/libc/uclibc/usr/include &&
export CPLUS_INCLUDE_PATH=/opt/mipsel/usr/include/c++/4.7.2
../configure --host=mipsel-linux --prefix=/opt/mipsel/wxWidgets --with-x11 --without-subdirs --enable-no_rtti --enable-no_exceptions --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --disable-shared
替換/usr/include /usr/local/include爲相應目錄
../src/stc/scintilla/lexlib/LexerNoExceptions.cxx:34:11: error: exception handling disabled, use -fexceptions to enable
Makefile:16841: recipe for target 'wxscintilla_LexerNoExceptions.o' failed
make: *** [wxscintilla_LexerNoExceptions.o] Error 1
CXXFLAGS 加-fexceptions
src/unix/displayx11.cpp修改
#include <X11/extensions/xinerama.h>
五、編譯libX11
libX11-1.5.0
./configure --prefix=/opt/mipsel/libX11 --build=i686-pc-linux-gnu --host=mipsel-linux --with-freetype-config=/opt/mipsel/freetype/bin/freetype-config --with-expat-lib=/opt/mipsel/libX11/lib --with-expat-includes=/opt/mipsel/libX11/include