热度 27
2016-6-1 17:23
1114 次阅读|
0 个评论
NOTE :修改 qmake.conf 文件,要特别注意它的 inluce 目录、交叉编译器的设置,以及 INCDIR 和 LIBDIR 是否正确; NOTE :对比 Qt 的 mainline 里面的 qmake.conf ,观察它新增的内容; NOTE : $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2 这个目录并不存在,但并不影响编译结果; 另外还要将交叉编译器的 bin 目录加入环境变量 PATH ,拷贝头文件和 lib (为了省事可以把 lib 的内容全都拷贝进目标文件系统,但是这里还是暂时采取需要什么就拷贝什么的方法,你甚至先什么都不做,等到编译报错的时候再去寻找对应的 lib 或者头文件,这样能够更加清晰的理解 Qt 的编译过程) ,再执行 configure 和 make 步骤: $ export PATH=$PATH:/opt/i686-arago-linux/usr/bin $ mkdir /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/include /home/maria/qt/qt-am335x/roofts.withSDK/usr/ -r $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/crt* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libts* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/librt. * /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libpthread* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libm.* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libc.* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libc_nonshared.a* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libz.so* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libjpeg.so* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libpng* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libnsl.* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libgthread-2.0.so* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libglib-2.0.so* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libasound.so* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libdl.* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libfreetype.so* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/glib-2.0 /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ -r $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libfontconfig.so* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/libexpat.so* /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/lib dbus * /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/lib u * /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ $ cp /opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/lib/ libglslcompiler * /home/maria/qt/qt-am335x/roofts.withSDK/usr/lib/ 另外,还要将目标文件系统的 include/freetypes2/freetype 软链接成 include/freetype : $ cd /home/maria/qt/qt-am335x/roofts.withSDK/usr/include $ ln -s freetype2/freetype freetype ( 如果 freetypes 报错了就做此修改,没有报错的话就不用管了~ ) $ ./configure –help $ ./configure \ -debug -opensource -confirm-license -shared \ -prefix /home/maria/qt/qt-am335x/qt-everywhere/build \ -sysroot /home/maria/qt/qt-am335x/roofts.withSDK \ -platform linux-g++-64 \ -device linux-TIarmv7-sgx-g++ \ -device-option CROSS_COMPILE=/opt/i686-arago-linux/usr/bin/arm-linux-gnueabihf- \ -D QT_NO_QWS_CURSOR -D QT_QWS_CLIENTBLIT \ -eglfs -opengl es2 -qreal float -v \ -nomake examples -nomake tests NOTE : configure 的编译选项,需要根据主机和目标板的实际情况慢慢摸索,有的编译选项随着新版本的发布不再支持,有的编译选项被添加在新版本中,有的编译错误即使存在也没有关系,有的编译错误则会影响结果。一般来说,提示“ Just run 'gmake'” 就算是成功。 NO TE : configure 会生成很多 .o 文件,在重新 configure 之前可以编写脚本 , 来删除旧有的 .o 文件。 -prefix: 主机上 Qt SDK 安装的目录; -sysroot: 目标文件系统的根目录; -platform: 主机使用的 mkspecs ; -device: 目标机使用的 mkspecs ,替代 xplatform ; -nomake examples -nomake tests: 不编译示例和测试程序,否则得花很长的时间; $ gmake -j8 $ gmake -j8 install 这里的 gmake ,是指 GNU Make ,在 Fedora 主机上就是 make ; 编译完成之后,会发现目标文件系统里面增加了 build 目录: $ find . -mmin 1 ./home/maria/qt/qt-am335x/qt-everywhere/build/*