Linux下编译Qt源码,一定要下载tar.gz版本,否则会报权限不足

时间:2023-03-09 04:20:16
Linux下编译Qt源码,一定要下载tar.gz版本,否则会报权限不足

首先下载qt-everywhere-opensource-src-4.8.1源码,下载地址:

ftp://ftp.qt-project.org/qt/source/

在Linux下编译一定要下载qt-everywhere-opensource-src-4.8.1.tar.gz 不能用qt-everywhere-opensource-src-4.8.1.zip,因为在configure时,会报没有权限和文本编码等错误。

编译Qt之前都需要安装tslib,具体安装方法请看:tslib安装

由于配置的命令比较多,我自己写了一个自动安装脚本:

  1. #!/bin/sh
  2. export PATH=/opt/FriendlyARM/toolschain/4.4.3/bin:$PATH
  3. export TOOLCHAIN=/opt/FriendlyARM/toolschain/4.4.3
  4. export TB_CC_PREFIX=arm-linux-
  5. export PKG_CONFIG_PREFIX=$TOOLCHAIN/arm-none-linux-gnueabi
  6. export MAKE=/usr/bin/make
  7. echo "Delect the exist direction"
  8. rm -rf qt-everywhere-opensource-src-4.8.1
  9. rm -rf /opt/Qt4.8.1
  10. echo "Unzip qt source"
  11. tar xzvf qt-everywhere-opensource-src-4.8.1.tar.gz
  12. cd qt-everywhere-opensource-src-4.8.1
  13. echo "Configure ..."
  14. #chmod +x configure
  15. #dos2unix configure
  16. ./configure \
  17. -prefix /opt/Qt4.8.1 \
  18. -opensource \
  19. -embedded arm \
  20. -xplatform qws/linux-arm-g++ \
  21. -depths 16,18,24,32 \
  22. -no-glib \
  23. -no-cups \
  24. -no-largefile \
  25. -no-accessibility \
  26. -no-openssl \
  27. -no-gtkstyle \
  28. -no-qt3support \
  29. -no-phonon \
  30. -no-webkit \
  31. -no-libtiff \
  32. -no-libmng \
  33. -qt-zlib \
  34. -qt-libpng \
  35. -qt-libjpeg \
  36. -no-nis \
  37. -no-dbus \
  38. -little-endian \
  39. -host-little-endian \
  40. -qt-freetype \
  41. -qt-gfx-transformed \
  42. -qt-gfx-vnc \
  43. -qt-gfx-linuxfb \
  44. -qt-gfx-multiscreen \
  45. -qt-kbd-tty \
  46. -qt-mouse-tslib \
  47. -I/usr/local/arm/tslib/include \
  48. -L/usr/local/arm/tslib/lib \
  49. 2>&1 | tee conf_log
  50. echo "Make..."
  51. make 2>&1 | tee make_log
  52. echo "Inatall..."
  53. make install

http://blog.****.net/jecan123/article/details/8760191