From Ungracious Lechwe, 10 Months ago, written in Plain Text.
Embed
  1. Install QT and prepare Host
  2.  
  3. Create working folder and set a toolchain
  4.  
  5. mkdir ~/raspi
  6. cd ~/raspi
  7. git clone https://github.com/raspberrypi/tools
  8.  
  9. add path variable nano ~/.bashrc
  10.  
  11. "export PATH=$PATH:~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin"
  12. mkdir sysroot sysroot/usr sysroot/opt
  13.  
  14.  
  15. Sync syroot folder with rpi
  16.  
  17. rsync -avz pi@raspberrypi_ip:/lib sysroot
  18. rsync -avz pi@raspberrypi_ip:/usr/include sysroot/usr
  19. rsync -avz pi@raspberrypi_ip:/usr/lib sysroot/usr
  20. rsync -avz pi@raspberrypi_ip:/opt/vc sysroot/opt
  21.  
  22.  
  23. match symlinks
  24.  
  25. sudo apt install python
  26. wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
  27. chmod +x sysroot-relativelinks.py
  28. ./sysroot-relativelinks.py sysroot
  29.  
  30.  
  31. Download and untar Qt 5.12
  32.  
  33. wget http://download.qt.io/official_releases/qt/5.12/5.12.1/single/qt-everywhere-src-5.12.1.tar.xz
  34. tar xvf qt-everywhere-src-5.12.1.tar.xz
  35. cd qt-everywhere-src-5.12.1
  36. substitute all references to -lEGL and -LGLESv2 for -lbrcmEGL and -lbrcmGLESv2 in "./qtbase/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf"
  37. sudo apt-get install gcc git bison python gperf pkg-config gdb-multiarch
  38. ./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm